00001 #include <iostream>
00002 #include <TooN/TooN.h>
00003 #include <TooN/SymEigen.h>
00004
00005 using namespace std;
00006 using namespace TooN;
00007
00008 int main() {
00009
00010 Matrix<3> M = Data(4,0,2,
00011 0,5,3,
00012 2,3,6);
00013
00014 Vector<3> dg(makeVector(2,4,9));
00015
00016 SymEigen<3> eigM(M);
00017 cout << M << endl;
00018
00019 cout << endl;
00020
00021
00022 cout << eigM.get_evalues() << endl;
00023 cout << eigM.get_evectors() << endl << endl;
00024
00025
00026 cout << eigM.get_sqrtm() << endl << endl;
00027
00028
00029 cout << eigM.get_sqrtm().T() * eigM.get_sqrtm() << endl << endl;
00030
00031
00032 cout << eigM.get_pinv() << endl;
00033
00034
00035 cout << eigM.get_isqrtm() << endl;
00036
00037
00038 cout << eigM.get_isqrtm().T() * eigM.get_isqrtm() << endl;
00039
00040 return 0;
00041 }