Show
Ignore:
Timestamp:
11/13/09 09:15:50 (15 years ago)
Author:
mido
Message:

stresssuite - halfway point

Location:
library/tests/stresssuite
Files:
1 added
1 modified
16 moved

Legend:

Unmodified
Added
Removed
  • library/tests/stresssuite/CMakeLists.txt

    r717 r721  
    99LINK_EXEC(square_mat_prep) 
    1010 
    11 EXEC(testResample) 
    1211 
    13 # ESTIM EXECS 
    14 EXEC(arx_test) 
    15 EXEC(arx_elem_test) 
     12# using UnitTest++ 
    1613 
    17 EXEC(merger_2d_test) 
    18 EXEC(merger_iter_test) 
    19 EXEC(mixtures_test) 
     14add_executable(stresssuite stresssuite.cpp resample_stress.cpp arx_stress.cpp arx_elem_stress.cpp merger_2d_stress.cpp merger_iter_stress.cpp mixtures_stress.cpp kalman_stress.cpp particle_stress.cpp  
     15#kalman_QR_stress.cpp kalman_QRexh_stress.cpp  
     16blas_stress.cpp ) 
    2017 
    21 EXEC(test_kalman) 
    22 EXEC(test_particle) 
    23 #EXEC(test_kalman_QR) 
    24 #EXEC(test_kalman_QRexh) 
     18target_link_libraries(stresssuite testutil unittest) 
     19LINK_EXEC(stresssuite) 
    2520 
    26 EXEC(blas_test) 
     21 
  • library/tests/stresssuite/arx_elem_stress.cpp

    r717 r721  
    11#include "estim/arx.h" 
     2#include "../mat_checks.h" 
     3 
    24using namespace bdm; 
    35 
    4 int main() { 
     6TEST ( arx_elem_stress ) { 
    57        // Setup model : ARX for 1D Gaussian 
    68        //Test constructor 
  • library/tests/stresssuite/arx_stress.cpp

    r717 r721  
    1212 
    1313#include "estim/arx.h" 
     14#include "../mat_checks.h" 
     15 
    1416using namespace bdm; 
    1517 
    16 int main() { 
     18TEST ( arx_stress ) { 
    1719        // Setup model 
    1820        vec th ( "0.8 -0.3 0.4 0.01" ); 
  • library/tests/stresssuite/blas_stress.cpp

    r717 r721  
    1  
     1#include "../mat_checks.h" 
    22#include <itpp/itbase.h> 
    33using namespace itpp; 
     
    4242} 
    4343 
    44 int main() { 
     44TEST ( blas_stress ) { 
    4545        Real_Timer tt; 
    4646        vec exec_times ( 4 ); 
     
    8787        itf << Name ( "exec_times_b" ) << exec_times_b; 
    8888        itf << Name ( "exec_times_c" ) << exec_times_c; 
    89  
    90         return 0; 
    9189} 
  • library/tests/stresssuite/kalman_QR_stress.cpp

    r717 r721  
    22#include <estim/kalman.h> 
    33#include <estim/particles.h> 
     4#include "../mat_checks.h" 
    45 
    56using namespace bdm; 
     
    910using std::endl; 
    1011 
    11 int main() { 
     12TEST ( kalman_QR_stress ) { 
    1213        // Klaman filter 
    1314        mat A, B, C, D, R, Q, P0; 
     
    1516        mat Mu0;// read from matlab 
    1617        // input from Matlab 
    17         it_file fin ( "testKF.it" ); 
     18        it_file fin ( "kalman_stress.it" ); 
    1819 
    1920        mat Dt, XQRt, eR, eQ; 
     
    2223        bool xxx = fin.seek ( "d" ); 
    2324        if ( !xxx ) { 
    24                 bdm_error ( "testKF.it not found" ); 
     25                bdm_error ( "kalman_stress.it not found" ); 
    2526        } 
    2627        fin >> Dt; 
     
    8485        } 
    8586 
    86         it_file fou ( "testKF_QR_res.it" ); 
     87        it_file fou ( "kalman_stress_QR_res.it" ); 
    8788        fou << Name ( "xqrth" ) << XQRt; 
    8889        fou << Name ( "xth" ) << Xt; 
    89         //Exit program: 
    90         return 0; 
    91  
    9290} 
  • library/tests/stresssuite/kalman_QRexh_stress.cpp

    r717 r721  
    22#include <estim/kalman.h> 
    33#include <estim/particles.h> 
     4#include "../mat_checks.h" 
    45 
    56using namespace bdm; 
     
    910using std::endl; 
    1011 
    11 int main() { 
     12TEST ( kalman_QRexh_stress ) { 
    1213        // Klaman filter 
    1314        mat A, B, C, D, R, Q, P0; 
     
    1516        mat Mu0;// read from matlab 
    1617        // input from Matlab 
    17         it_file fin ( "testKF.it" ); 
     18        it_file fin ( "kalman_stress.it" ); 
    1819 
    1920        mat Dt, XQRt, eR, eQ; 
     
    2324 
    2425        if ( !xxx ) { 
    25                 bdm_error ( "testKF.it not found" ); 
     26                bdm_error ( "kalman_stress.it not found" ); 
    2627        } 
    2728 
     
    7778        } 
    7879 
    79         it_file fou ( "testKF_QR_exh.it" ); 
     80        it_file fou ( "kalman_stress_QR_exh.it" ); 
    8081 
    8182        fou << Name ( "LL" ) << LL; 
    8283        fou << Name ( "Q1" ) << vQ1; 
    8384        fou << Name ( "Q2" ) << vQ2; 
    84         //Exit program: 
    85         return 0; 
    86  
    8785} 
  • library/tests/stresssuite/kalman_stress.cpp

    r717 r721  
    11 
    22#include <estim/kalman.h> 
     3#include "../mat_checks.h" 
    34 
    45using namespace bdm; 
     
    89using std::endl; 
    910 
    10 int main() { 
     11TEST ( kalman_stress ) { 
    1112        // Kalman filter 
    1213        mat A, B, C, D, R, Q, P0; 
     
    1415        mat Mu0;; 
    1516        // input from Matlab 
    16         it_file fin ( "testKF.it" ); 
     17        it_file fin ( "kalman_stress.it" ); 
    1718 
    1819        mat Dt; 
     
    2122        bool xxx = fin.seek ( "d" ); 
    2223        if ( !xxx ) { 
    23                 bdm_error ( "testKF.it not found" ); 
     24                bdm_error ( "kalman_stress.it not found" ); 
    2425        } 
    2526        fin >> Dt; 
     
    120121 
    121122 
    122         it_file fou ( "testKF_res.it" ); 
     123        it_file fou ( "kalman_stress_res.it" ); 
    123124        fou << Name ( "xth" ) << Xt; 
    124125        fou << Name ( "xth2" ) << Xt2; 
    125126        fou << Name ( "xthE" ) << XtE; 
    126127        fou << Name ( "exec_times" ) << exec_times; 
    127         //Exit program: 
    128         return 0; 
    129  
    130128} 
  • library/tests/stresssuite/kalman_stress.m

    r717 r721  
    3030 
    3131        d=[y;u]; 
    32         itsave('testKF.it',d,A,B,C,D,Q,R,P0,mu0) 
     32        itsave('kalman_stress.it',d,A,B,C,D,Q,R,P0,mu0) 
    3333        save testKF 
    3434else 
  • library/tests/stresssuite/kalman_stress_big.m

    r717 r721  
    3333 
    3434        d=[y;u]; 
    35         itsave('testKF.it',d,A,B,C,D,Q,R,P0,mu0) 
     35        itsave('kalman_stress.it',d,A,B,C,D,Q,R,P0,mu0) 
    3636        save testKF 
    3737else 
  • library/tests/stresssuite/merger_2d_stress.cpp

    r717 r721  
    22#include "stat/exp_family.h" 
    33#include "stat/merger.h" 
    4  
    5 using namespace bdm; 
     4#include "../mat_checks.h" 
    65 
    76using namespace bdm; 
     
    1110using std::endl; 
    1211 
    13 int main() { 
     12TEST ( merger_2d_stress ) { 
    1413 
    1514        RNG_randomize(); 
  • library/tests/stresssuite/merger_iter_stress.cpp

    r717 r721  
    1  
    21#include "stat/exp_family.h" 
    32#include "stat/merger.h" 
    4  
    5 using namespace bdm; 
     3#include "../mat_checks.h" 
    64 
    75using namespace bdm; 
     
    119using std::endl; 
    1210 
    13 int main() { 
     11TEST ( merger_iter_stress ) { 
    1412 
    1513        RNG_randomize(); 
  • library/tests/stresssuite/mixtures_stress.cpp

    r717 r721  
    22#include "estim/arx.h" 
    33#include "stat/exp_family.h" 
     4#include "../mat_checks.h" 
     5 
    46using namespace bdm; 
    57 
     
    3941} 
    4042 
    41 int main() { 
     43TEST ( mixtures_stress ) { 
    4244        RV x ( "{x }", "2" ); 
    4345 
  • library/tests/stresssuite/particle_stress.cpp

    r717 r721  
    1  
    21#include <estim/particles.h> 
    32#include <math/square_mat.h> 
    43#include "stat/exp_family.h" 
     4#include "../mat_checks.h" 
    55 
    66using namespace bdm; 
     
    1010using std::endl; 
    1111 
    12 int main() { 
    13  
     12TEST ( particle_stress ) { 
    1413        RV x ( "1" ); 
    1514        RV xm = x; 
     
    4140 
    4241        cout << ind << endl; 
    43  
    44         //Exit program: 
    45         return 0; 
    46  
    4742} 
  • library/tests/stresssuite/resample_stress.cpp

    r717 r721  
    1  
     1#include "../mat_checks.h" 
    22#include "estim/particles.h" 
    33#include "math/square_mat.h" 
     
    1010using std::endl; 
    1111 
    12 int main() { 
     12TEST ( resample_stress ) { 
    1313 
    1414        RV x ( "1" ); 
     
    4141 
    4242        cout << ind << endl; 
    43  
    44         //Exit program: 
    45         return 0; 
    46  
    4743}