00001 #include <TooN/TooN.h> 00002 #include <TooN/helpers.h> 00003 using namespace TooN; 00004 using namespace std; 00005 int main() 00006 { 00007 Vector<> v = Ones(5); 00008 00009 cout << v << endl; 00010 00011 cout << v + Ones*3 << endl; 00012 00013 cout << v.slice(2,3) + Ones*3 << endl; 00014 00015 v+= Ones; 00016 cout << v << endl; 00017 v.slice(0,3) += Ones * 3; 00018 cout << v << endl; 00019 00020 Matrix<> m = 3*Ones(4,4) * 2; 00021 cout << m << endl; 00022 cout << m.slice<0,0,2,3>() - 2*Ones << endl; 00023 00024 m+= Ones; 00025 cout << m << endl; 00026 m.slice<0,0,3,2>() += Ones*2; 00027 cout << m << endl; 00028 00029 00030 Matrix<3> p = Identity; 00031 cout << p - Ones << endl; 00032 cout << Ones - p << endl; 00033 }