- Timestamp:
- 02/22/08 16:40:12 (17 years ago)
- Location:
- tests
- Files:
-
- 3 modified
Legend:
- Unmodified
- Added
- Removed
-
tests/test0.cpp
r24 r28 14 14 RV th = RV ( "1 2","{a b }","1 1","0 0","0 0" ); 15 15 RV r = RV ( "3 4" ); 16 int i =0;17 16 18 17 cout << th << r << endl; … … 42 41 43 42 cout << "Test ldform()"<<endl; 44 mat V = "1 2; 2 3";43 mat V = "1 2; 2 13"; 45 44 ldmat lV(V); 46 45 ldmat ilV(V); -
tests/testKF.cpp
r22 r28 22 22 23 23 bool xxx= fin.seek( "d" ); 24 if (!xxx){ it_error("testKF.it not found");} 24 25 fin >>Dt; 25 26 fin.seek( "A" ); … … 43 44 XtE=zeros( 2,Ndat ); 44 45 45 Kalman<fsqmat> KF( A,B,C,D,fsqmat(R),fsqmat(Q),fsqmat(P0),mu0 );46 46 // cout << KF; 47 KalmanFull KF2( A,B,C,D,R,Q,P0,mu0 );48 47 RV rx("1","{x}","2","0","0"); 49 48 RV ru("2","{u}","1","0","0"); 50 49 RV ry("3","{y}","1","0","0"); 50 // 51 Kalman<ldmat> KF(rx,ry,ru); 52 KF.set_parameters(A,B,C,D,ldmat(R),ldmat(Q)); 53 KF.set_est(mu0,ldmat(P0) ); 54 // 55 Kalman<fsqmat> KFf(rx,ry,ru); 56 KFf.set_parameters(A,B,C,D,fsqmat(R),fsqmat(Q)); 57 KFf.set_est(mu0,fsqmat(P0) ); 58 // 59 KalmanFull KF2( A,B,C,D,R,Q,P0,mu0 ); 60 // 51 61 bilinfn fxu(rx,ru,A,B); 52 62 bilinfn hxu(rx,ru,C,D); 53 EKF<fsqmat> KFE(&fxu,&hxu,Q,R,mu0,P0); 63 EKF<ldmat> KFE(rx,ry,ru); 64 KFE.set_parameters(&fxu,&hxu,Q,R); 65 KFE.set_est(mu0,P0); 54 66 55 Xt.set_col( 0, KF.mu);56 Xt2.set_col( 0,KF .mu );57 XtE.set_col( 0, KF.mu);67 Xt.set_col( 0,*((enorm<ldmat>*)(KF._epdf()))->_mu() ); 68 Xt2.set_col( 0,KF2.mu ); 69 XtE.set_col( 0,*((enorm<ldmat>*)(KFE._epdf()))->_mu() ); 58 70 for ( int t=1;t<Ndat;t++ ) { 71 KFf.bayes( Dt.get_col( t )); 59 72 KF.bayes( Dt.get_col( t )); 60 73 KF2.bayes( Dt.get_col( t )); 61 KFE.bayes( Dt.get_col( t ));62 Xt.set_col(t, KF.mu);74 // KFE.bayes( Dt.get_col( t )); 75 Xt.set_col(t,*((enorm<ldmat>*)(KF._epdf()))->_mu()); 63 76 Xt2.set_col(t,KF2.mu); 64 XtE.set_col(t,KFE.mu); 65 // Kmu = KF.mu; 66 // cout << "t:" <<t<< " " << dt<<" "<<Kmu <<endl; 77 XtE.set_col(t,*((enorm<ldmat>*)(KFE._epdf()))->_mu()); 67 78 } 68 79 -
tests/testSmp.cpp
r22 r28 17 17 mat V0("1.2 0.3; 0.3 5"); 18 18 ldmat R = ldmat(V0); 19 enorm<ldmat> eN(rv,mu0,R); 19 enorm<ldmat> eN(rv); 20 eN.set_parameters(mu0,R); 20 21 21 22 mat Smp = eN.sample(N);