Skip to content

Allow to choose the indexes of the MultiDimensionalArray to map into the Eigen Matrix in theto_eigen method #88

Closed
@xela-95

Description

@xela-95

Hi,
I am working in loading some complex MAT file in C++ using matioCpp and then obtaining their corresponding Eigen Matrix. One of the data structure I need loaded is of type MultiDimensionalArray with dimension (3,1,15000).

Up to now is not possible to directly use the to_eigen method

template <typename type>
inline Eigen::Map<Eigen::Matrix<type, Eigen::Dynamic, Eigen::Dynamic>> matioCpp::to_eigen(matioCpp::MultiDimensionalArray<type>& input)
{
assert(input.isValid());
assert(input.dimensions().size() == 2);
return Eigen::Map<Eigen::Matrix<type, Eigen::Dynamic, Eigen::Dynamic>>(input.data(), input.dimensions()(0), input.dimensions()(1));
}

to convert it to an Eigen Matrix since the array's dimensions are > 2.

It would be nice if I could select the indices of the dimensions I need when calling this method (in this case they are the 1st and 3rd dimension).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions