KcFnMi
KcFnMi

Reputation: 6201

How to create dynamic sized Eigen::Matrix of double RowMajor?

Its said to use dynamic size to perform bigger https://eigen.tuxfamily.org/dox/group__TutorialMatrixClass.html, how to create it for RowMajor?

I have this (which I guess is fixed size ?)

Matrix<double, N, N, RowMajor> m;

I think for (default) ColMajor answer will be MatrixXd m(N,N);. What about RowMajor?

Where const int N = 1000;

Upvotes: 0

Views: 445

Answers (1)

Avi Ginsburg
Avi Ginsburg

Reputation: 10596

Matrix<double, N, N, RowMajor> m; will create a RowMajor matrix of a fixed size (NxN, assuming N is known at runtime). If you want it to be dynamically sized, use Matrix<double, Dynamic, Dynamic, RowMajor> m; instead.

Upvotes: 2

Related Questions