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

How to setup Eigen correctly in Netbeans

Tags: None
(comma "," separated)
sodjaj
Registered Member
Posts
2
Karma
0
Hi,

I am using Eigen numerical library with Netbeans IDE to develop my code. As I worked through the examples I noticed some of the functions are not recognized by Netbeans. For instance:

1) When I want to set the elements of a 3by3 matrix to random numbers:
Code: Select all
 MatrixXd mm = MatrixXd::Random(3, 3);

The project compiles and runs fine, however NetBeans displays an error next to the line: Unable to resolve identifier Random.

2) Or when reading the size of a vector:
Code: Select all
int n = boundary.size();  // boundary is of type VectorXd

Again the project compiles fine, however Netbeans issues the same error again next to this line of code : Unable to resolve identifier size.



In the case of 1) I could solve the problem by writing:
Code: Select all
MatrixXd mm(3,3);
 mm.setRandom();


However in case of 2) I couldn't find an alternative function.

My question is: Why are certain functions of Eigen not identified by my IDE (Netbeans)? <- Is there something wrong with my installation of Eigen (I have installed Eigen on my Ubuntu 13.10 using cmake into the default directory (usr/local/include/eigen3/Eigen)) Or am I missing some settings in Netbeans?

Thank you for your help!

Kind regards,
Jurij Sodja
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
NetBeans's C++ parser is probably not perfect. Moreover in case of templates the IDE also has to instantiate them to resolve identifiers.
sodjaj
Registered Member
Posts
2
Karma
0
Hi!

Thank you for a bit of explanation!

In the mean time I have found out, that if I define the following in the beginning of the file:
Code: Select all
typedef MatrixBase<MatrixXd> MXD;


I can access the methods like Random() or random in the following manner:
Code: Select all
MatrixXd X = MXD::Constant(nely, nelx, volfrac);


Could you please explain a bit more by what you mean:
ggael wrote:in case of templates the IDE also has to instantiate them to resolve identifiers.

Can I configure NetBeans to do so? Or would you recommend some other IDE (like eclipse)?

Thank you very much for your help!

Best!
Jurij


Bookmarks



Who is online

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