Changeset 162 for tests/test0.cpp
- Timestamp:
- 09/04/08 20:27:01 (16 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
tests/test0.cpp
r101 r162 12 12 int main() 13 13 { 14 RV th = RV ( " 1 2","{a b }","1 1","0 0");15 RV r = RV ( " 3 4" );14 RV th = RV ( "{a b }"); 15 RV r = RV ( "{r1 r2 }" ); 16 16 17 17 cout << th << r << endl; 18 18 19 ldmat ld = ldmat("1 0;0.5 1","1.1 1.3"); 20 vec v = "1 -0.1"; 19 ldmat ld = ldmat("1 0 0 0; 0.2 1 0 0; 0.1 -0.1 1 0; -0.9 0.3 -0.1 1", 20 "3 4 5 6"); 21 vec v = "1 -1 3 -1"; 21 22 22 23 cout << "Test to_mat"<<endl; 23 24 // cout << ld << endl; 24 cout << ld.to_mat()<<endl; 25 mat L = ld.to_mat(); 26 cout << L <<endl; 25 27 26 28 cout << "Test opupdt" <<endl; 29 cout << "w=1" <<endl; 27 30 ldmat ldup = ld; 28 31 ldup.opupdt(v,1); 29 32 cout << ldup.to_mat()<<endl; 33 cout << L + outer_product(v,v) <<endl; 34 ldup = ld; 35 cout << "w=0.1" <<endl; 36 ldup.opupdt(v,0.1); 37 cout << ldup.to_mat()<<endl; 38 cout << L + 0.1*outer_product(v,v) <<endl; 30 39 31 40 cout << "Test +="<<endl; 32 41 ldmat ld2x = ld; 33 42 ld2x+=ld; 34 cout << ld.to_mat() << ld2x.to_mat() <<endl;43 cout << ld.to_mat() <<endl << ld2x.to_mat() <<endl; 35 44 45 cout << "Test *="<<endl; 46 ld2x = ld; 47 ld2x*=2; 48 cout << ld.to_mat() <<endl << ld2x.to_mat() <<endl; 49 36 50 cout << "Test ldinv()"<<endl; 37 51 ldmat Il = ld;