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

Eigensolver Compile Error

Tags: None
(comma "," separated)
moler
Registered Member
Posts
1
Karma
0

Eigensolver Compile Error

Thu Nov 27, 2014 3:45 am
Hey Everyone,

I tried some example code to solve for the eigenvalues/vectors of a matrix but my compiler keeps saying that EigenSolver is not defined in this scope.

This is my code

Code: Select all
#include <iostream>
#include "Eigen/Core"
#include "Eigen/Eigenvalues"

using namespace std;
using Eigen::MatrixXd;

int main()
{
   MatrixXd A = MatrixXd::Random(6,6);
   cout << A << endl;
   EigenSolver <MatrixXd> es(A);
   cout << "The eigenvalues of A are:" << endl << es.eigenvalues() << endl;
   cout << "The matrix of eigenvectors, V, is:" << endl << es.eigenvectors() << endl << endl;
}


My compiler errors are
testing.cpp: In function ‘int main()’:
testing.cpp:19:2: error: ‘EigenSolver’ was not declared in this scope
EigenSolver<MatrixXd> es(A);
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: Eigensolver Compile Error

Thu Nov 27, 2014 8:30 am
You are missing the Eigen:: namespace.


Bookmarks



Who is online

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