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

compile error: 'const Type' has no member named 'array'

Tags: None
(comma "," separated)
by
Registered Member
Posts
1
Karma
0
I encountered the above compile error for my first Eigen program. Really appreciate any help.

The related code is:
a += b * (v.matrix() * X).array();

where the definitions are:
Map<ArrayXf> a, b; // dim: m
ArrayXf v(n); // dim: n
SparseMatrix<float, RowMajor, int> X; // n * m

Should I transpose v?
M is huge, so I'd like to avoid temp object for v.matrix() * X. Can the above code achieve it?
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
yes you have to transpose v which is a column vector, and a temporary will be required. Nevertheless, your error " 'const Type' has no member named 'array'" seems odd to me. Perhaps an explicit evaluation will solve the issue if it's still exist after transposing:

a += b * (v.matrix() * X).eval().array();


Bookmarks



Who is online

Registered users: Baidu [Spider], Bing [Bot], Google [Bot], Yahoo [Bot]