00001 #include <TooN/TooN.h> 00002 #include <TooN/helpers.h> 00003 00004 using namespace std; 00005 using namespace TooN; 00006 00007 template<class C> void type(const C&) 00008 { 00009 cout << __PRETTY_FUNCTION__ << endl; 00010 } 00011 00012 int main() 00013 { 00014 Matrix<3> m1(Zeros); 00015 Matrix<3> m2(Zeros); 00016 00017 m1.slice<0,0,2,2>()+=3; 00018 m2.slice<1,1,2,2>()+=2; 00019 00020 cout << m1 << endl; 00021 cout << m2 << endl; 00022 00023 m1+=m2; 00024 cout << m1 << endl; 00025 00026 cout << (m1+m2) << endl; 00027 cout << (m1+m2) << endl; 00028 00029 Matrix<2,3> m3; 00030 m3[0] = makeVector(0, 1, 2); 00031 m3[1] = makeVector(3, 4, 5); 00032 Matrix<3,2> m4; 00033 m4[0] = makeVector(6, 7); 00034 m4[1] = makeVector(8, 9); 00035 m4[2] = makeVector(10, 11); 00036 00037 cout << m3<<endl; 00038 cout << m4<<endl; 00039 cout << m3*m4; 00040 00041 00042 cout << makeVector(1,2).as_col() * makeVector(3,4).as_row() << endl; 00043 } 00044