Template Function flatten

Function Documentation

template<typename Container>
auto flatten(const Container &container)

Flatten nested containers into a 1D vector.

This helper function recursively flattens nested containers into a 1D vector for writing to HDF5. If the input container is already 1D, it simply returns it.

Template Parameters:

Container – The type of the container.

Parameters:

container – The container to flatten.

Returns:

A flat vector containing all elements of the input container in a linear order.