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

eclipse cdt indexer and CommonCwiseUnaryOps

Tags: None
(comma "," separated)
osurce
Registered Member
Posts
3
Karma
0
Hi,

I am using eclipse mars with cdt and I am having problems to get the indexer to work with the eigen library (3.2.7) in a makefile project.
Most of the library is getting indexed fine, but for example:

Code: Select all
#include <Eigen/Core> // ok
Eigen::MatrixXcd m; // ok
m.setConstant(2, 2, std::complex<double>{1.0}); // ok
m(0,0).real(); //method 'real' could not be resolved
m.real()(0,0); //ok


I was searching through the lib a little.
In CommonCwiseUnaryOps.h:109 we have:
Code: Select all
inline RealReturnType
real() const { return derived(); }

which seems to be a member function, but of which class ? and where is it declared ?
maybe the inlining screws the indexer ?

is anybody here using eclipse ide and got the indexer to work ?

thanks!!
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
hm, the member you are showing in CommonCwiseUnaryOps.h, is the one called in the last line for which you said it's OK:

Code: Select all
m.real()(0,0); //ok


the one that does not work is std::complex::real.
osurce
Registered Member
Posts
3
Karma
0
Hi!

The problem also goes away if I cast to std::complex<double> explicitly:

Code: Select all
std::complex<double>(m(0,0)).real(); //ok!


could it be that the indexing operator [.(0,0)] returns something else than std::complex<double> ?

Can you explain to me how .real() (the one from eigen) becomes a member function of MatrixXcd ? All I see is this little inline statement
I posted and I do not get where it is said which class this belongs to. That probably does not solve the
indexer problem for me, but I am curious.

cheers!
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
you don't wanna know ;) (the file is included in the body of the DenseBase and SparseMatrixBase classes)


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot], ourcraft