- Timestamp:
- 03/12/09 22:18:43 (16 years ago)
- Location:
- tests
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
tests/chmat_test.cpp
r262 r294 17 17 cout << "Testing constructors:" << endl 18 18 << "A = " << A << endl 19 << "Ch = " << Ch._Ch() << endl 19 20 << "Ch.to_mat() = " << Ch.to_mat() << endl << endl; 20 21 … … 49 50 cout << "A+vv' = " << A+outer_product(v,v) << endl 50 51 << "opupdt(Ch,v) = " << Ch2.to_mat() << endl <<endl; 51 52 53 vec vCh=vec(Ch._Ch()._data(),9); 54 cout << "vectorized Ch: " << vCh <<endl; 55 chmat nCh(3); 56 nCh.setCh(vCh); 57 cout << "Ch from vec: " << nCh._Ch() <<endl; 58 52 59 } -
tests/testSmp.cpp
r278 r294 116 116 disp(concat(eN.mean(),eG.mean()), epV,Smp); 117 117 118 cout << "======= eWishart ======== " << endl; 119 mat wM="1.0 0.9; 0.9 1.0"; 120 eWishartCh eW; eW.set_parameters(wM/100,100); 121 mat mea=zeros(2,2); 122 mat Ch(2,2); 123 for (int i=0;i<100;i++){Ch=eW.sample_mat(); mea+=Ch.T()*Ch;} 124 cout << mea /100 <<endl; 125 126 cout << "======= rwiWishart ======== " << endl; 127 rwiWishartCh rwW; rwW.set_parameters(2,0.1,"1 1",0.9); 128 mea=zeros(2,2); 129 mat wMch=chol(wM); 130 for (int i=0;i<100;i++){ 131 vec tmp=rwW.samplecond(vec(wMch._data(),4)); 132 copy_vector(4,tmp._data(), Ch._data()); 133 mea+=Ch.T()*Ch; 134 } 135 cout << mea /100 <<endl; 118 136 //Exit program: 119 137 return 0;