Revision 24, 1.0 kB
(checked in by smidl, 17 years ago)
|
drobnosti v DC
|
Rev | Line | |
---|
[1] | 1 | #include <itpp/itbase.h> |
---|
[15] | 2 | #include "../bdm/stat/libBM.h" |
---|
| 3 | #include "../bdm/math/libDC.h" |
---|
[1] | 4 | |
---|
| 5 | using namespace itpp; |
---|
| 6 | |
---|
| 7 | //These lines are needed for use of cout and endl |
---|
| 8 | using std::cout; |
---|
| 9 | using std::endl; |
---|
| 10 | |
---|
| 11 | int main() |
---|
| 12 | { |
---|
| 13 | |
---|
[5] | 14 | RV th = RV ( "1 2","{a b }","1 1","0 0","0 0" ); |
---|
[7] | 15 | RV r = RV ( "3 4" ); |
---|
[5] | 16 | int i =0; |
---|
[1] | 17 | |
---|
[7] | 18 | cout << th << r << endl; |
---|
[1] | 19 | |
---|
[7] | 20 | ldmat ld = ldmat("1 0;-0.1 1","1.1 1.3"); |
---|
| 21 | vec v = "1 -0.1"; |
---|
| 22 | |
---|
| 23 | cout << "Test to_mat"<<endl; |
---|
| 24 | // cout << ld << endl; |
---|
| 25 | cout << ld.to_mat()<<endl; |
---|
| 26 | |
---|
| 27 | cout << "Test opupdt" <<endl; |
---|
| 28 | ldmat ldup = ld; |
---|
| 29 | ldup.opupdt(v,1); |
---|
| 30 | cout << ldup.to_mat()<<endl; |
---|
| 31 | |
---|
| 32 | cout << "Test +="<<endl; |
---|
| 33 | ldmat ld2x = ld; |
---|
| 34 | ld2x+=ld; |
---|
| 35 | cout << ld.to_mat() << ld2x.to_mat() <<endl; |
---|
| 36 | |
---|
| 37 | cout << "Test ldinv()"<<endl; |
---|
| 38 | ldmat Il = ld; |
---|
| 39 | ld.inv(Il); // |
---|
| 40 | mat I = Il.to_mat()*ld.to_mat(); |
---|
| 41 | cout << "ld:"<<Il.to_mat() << "eye:"<< I <<endl; |
---|
| 42 | |
---|
[18] | 43 | cout << "Test ldform()"<<endl; |
---|
| 44 | mat V = "1 2; 2 3"; |
---|
| 45 | ldmat lV(V); |
---|
[24] | 46 | ldmat ilV(V); |
---|
| 47 | lV.inv(ilV); |
---|
| 48 | cout << "ld:" << lV << "eye:"<< V*(ilV.to_mat()) <<endl; |
---|
[7] | 49 | |
---|
[18] | 50 | |
---|
[5] | 51 | //Exit program: |
---|
| 52 | return 0; |
---|
[1] | 53 | |
---|
| 54 | } |
---|