00001 00002 #include <iostream> 00003 00004 using namespace std; 00005 00006 #include <TooN/SymEigen.h> 00007 00008 int main(int, char **){ 00009 00010 TooN::Matrix<> mt(3,3); 00011 cout << mt * TooN::makeVector(0,1,2) << endl; 00012 00013 TooN::Matrix<2> tt; 00014 tt[0] = TooN::makeVector(1,2); 00015 tt[1] = TooN::makeVector(2,1); 00016 00017 TooN::SymEigen<2> symt(tt); 00018 cout << symt.get_evectors() << symt.get_evalues() << endl; 00019 00020 TooN::Matrix<3> t; 00021 00022 t[0] = TooN::makeVector(1,0.5, 0.5); 00023 t[1] = TooN::makeVector(0.5, 2, 0.7); 00024 t[2] = TooN::makeVector(0.5,0.7, 3); 00025 00026 TooN::SymEigen<3> sym(t); 00027 cout << sym.backsub(TooN::makeVector(0,1,2)) << endl; 00028 00029 TooN::Matrix<> t2(3,3); 00030 00031 t2[0] = TooN::makeVector(1,0.5, 0.5); 00032 t2[1] = TooN::makeVector(0.5, 2, 0.7); 00033 t2[2] = TooN::makeVector(0.5,0.7, 3); 00034 00035 TooN::SymEigen<> sym2(t2); 00036 cout << sym2.backsub(TooN::makeVector(0,1,2)) << endl; 00037 00038 00039 TooN::Matrix<-1, -1, float> t2f(3,3); 00040 00041 t2f[0] = TooN::makeVector(1,0.5, 0.5); 00042 t2f[1] = TooN::makeVector(0.5, 2, 0.7); 00043 t2f[2] = TooN::makeVector(0.5,0.7, 3); 00044 00045 TooN::SymEigen<TooN::Dynamic,float> symf(t2f); 00046 cout << symf.backsub(TooN::makeVector(0,1,2)) << endl; 00047 }