This forum has been archived. All content is frozen. Please use KDE Discuss instead.

INVALID_MATRIX_TEMPLATE_PARAMETERS error

Tags: None
(comma "," separated)
coolcat
Registered Member
Posts
20
Karma
0
OS
Hi,
I found something strange.

When I declare a variable as follows I get INVALID_MATRIX_TEMPLATE_PARAMETERS error.

----

Eigen::Array<double, DIM, Dynamic, ColMajor, DIM, 5> p;

---

It seems that it is due to the following EIGEN_STATIC_ASSERT (when DIM = 1)

(In PlainObjectBase.h)
EIGEN_STATIC_ASSERT((EIGEN_IMPLIES(MaxRowsAtCompileTime==1 && MaxColsAtCompileTime!=1, (Options&RowMajor)==RowMajor), ...

When I set RowMajot instead of ColMajor, it is fine.
Also when DIM > 1, it is ok.

I do not understand whether this assert statement is really required.
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
You are creating a 1 x N vector, that is a row vector, and so, to prevent ambiguities and to create multiple equivalent types, we request that a row-vector is column major. You can use DIM==1?RowMajor?ColMajor for the option parameter.
coolcat
Registered Member
Posts
20
Karma
0
OS
Thanks.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Sogou [Bot]