Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4566 in orxonox.OLD for orxonox/trunk/src/util/newmat/eigen.cpp


Ignore:
Timestamp:
Jun 9, 2005, 5:40:47 PM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: made some tests with the newmat lib, now it should be no problem to solve all math problems in cd :)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/util/newmat/eigen.cpp

    r4565 r4566  
    3535int main(int argc, char **argv) {
    3636
     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  /*
    3775  int M = 3, N = 5;
    3876  Matrix X(M,N); // Define an M x N general matrix
     
    103141  cout << "solution for right hand side r2" << endl;
    104142  cout << setw(10) << setprecision(5) << s2 << endl;
    105        
     143  */
     144
    106145  return 0;
    107146}
Note: See TracChangeset for help on using the changeset viewer.