Changeset 4566 in orxonox.OLD for orxonox/trunk/src/util
- Timestamp:
- Jun 9, 2005, 5:40:47 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/util/newmat/eigen.cpp
r4565 r4566 35 35 int main(int argc, char **argv) { 36 36 37 cout << "start test: composing matrix" << endl; 38 39 SymmetricMatrix C(3); 40 41 C(1,1) = 1; 42 C(1,2) = 4; 43 C(1,3) = 4; 44 C(2,1) = 4; 45 C(2,2) = 2; 46 C(2,3) = 4; 47 C(3,1) = 4; 48 C(3,2) = 4; 49 C(3,3) = 3; 50 51 cout << "matrix composed" << endl; 52 53 54 //SymmetricMatrix X; 55 //X << C; 56 57 cout << "The symmetrix matrix C" << endl; 58 cout << setw(5) << setprecision(0) << C << endl; 59 60 Matrix V(3,3); // for eigenvectors 61 DiagonalMatrix D(3); // for eigenvalues 62 63 // the decomposition 64 Jacobi(C, D, V); 65 66 67 // Print the result 68 cout << "The eigenvalues matrix:" << endl; 69 cout << setw(10) << setprecision(5) << D << endl; 70 cout << "The eigenvectors matrix:" << endl; 71 cout << setw(10) << setprecision(5) << V << endl; 72 73 return 0; 74 /* 37 75 int M = 3, N = 5; 38 76 Matrix X(M,N); // Define an M x N general matrix … … 103 141 cout << "solution for right hand side r2" << endl; 104 142 cout << setw(10) << setprecision(5) << s2 << endl; 105 143 */ 144 106 145 return 0; 107 146 }
Note: See TracChangeset
for help on using the changeset viewer.