Posted Wednesday, December 07, 2005 2:59 AM
|
|
|
|
Any examples out there on how to use Eigen members?
I got a matrix and I need to find the diagonal matrix, eigenvalue, and eigenvectors. I see all the member functions, but I don't know how to use them.
CMatrix *A = new CMatrix(3, 3);
A->Item[0][0] = -3.0; A->Item[0][1] = -2.0; A->Item[0][2] = 0.0;
A->Item[1][0] = 14.0; A->Item[1][1] = 7.0; A->Item[1][2] = -1.0;
A->Item[2][0] = -6.0; A->Item[2][1] = -3.0; A->Item[2][2] = 1.0;
|
|
Posted Wednesday, December 07, 2005 5:35 AM
|
|
|
|
|
|
Posted Wednesday, December 07, 2005 6:53 AM
|
|
|
|
Hello
The syntax isCMatrix *A = new CMatrix(3, 3);
A->set_Item(0, 0, Complex(-3.0, 0)); If there is only real part, you can also use:A->set_Item(0, 0,-3.0); since the Double structure can be directly casted into a Complex.
Trifon Triantafillidis | Lead Developer |
|
|
|
Posted Wednesday, December 07, 2005 7:02 AM
|
|
|
|
... and then you may use the CEigen class as follows:
CEigen* E = new CEigen(A);
Console::WriteLine(E->Eigenvectors );
Console::WriteLine(E->Eigenvalues );
Trifon Triantafillidis | Lead Developer |
|
|
|
|
|