Changeset 722 for library/tests

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

astyler run over all test sources
general_suite added
cleanup of \test directory finished

Location:
library/tests
Files:
2 added
33 modified

Legend:

Unmodified
Added
Removed
  • library/tests/CMakeLists.txt

    r717 r722  
    77link_directories (./unittest-cpp) 
    88 
    9 SET(testutil_src epdf_harness.cpp epdf_harness.h mat_checks.cpp mat_checks.h  
     9SET(testutil_src general_suite.cpp general_suite.h epdf_harness.cpp epdf_harness.h mat_checks.cpp mat_checks.h  
    1010        pdf_harness.cpp pdf_harness.h square_mat_point.cpp square_mat_point.h test_util.cpp test_util.h) 
    1111 
  • library/tests/epdf_harness.cpp

    r713 r722  
    2828        UI::get ( variance, set, "variance", UI::compulsory ); 
    2929 
    30         UI::get (support, set, "support", UI::optional ); 
    31         UI::get (nbins, set, "nbins", UI::optional ); 
    32         UI::get (nsamples, set, "nsamples", UI::optional ); 
    33         UI::get (R, set, "R", UI::optional ); 
    34  
    35         mrv = UI::build<RV> (set, "marginal_rv", UI::optional ); 
     30        UI::get ( support, set, "support", UI::optional ); 
     31        UI::get ( nbins, set, "nbins", UI::optional ); 
     32        UI::get ( nsamples, set, "nsamples", UI::optional ); 
     33        UI::get ( R, set, "R", UI::optional ); 
     34 
     35        mrv = UI::build<RV> ( set, "marginal_rv", UI::optional ); 
    3636 
    3737        UI::get ( tolerance, set, "tolerance", UI::optional ); 
     
    7474                mprod mEp ( aa ); 
    7575 
    76                 check_cond_mean(mEp); 
     76                check_cond_mean ( mEp ); 
    7777                if ( R.rows() > 0 ) { 
    78                         check_cond_covariance( mEp ); 
     78                        check_cond_covariance ( mEp ); 
    7979                } 
    8080 
    8181                // test of pdflog at zero 
    8282                vec zero ( 0 ); 
    83                 vec zeron=zeros ( hepdf->dimension() ); 
     83                vec zeron = zeros ( hepdf->dimension() ); 
    8484 
    8585                double lpz = hepdf->evallog ( zeron ); 
    86                 double lpzc=mEp.evallogcond ( zeron, zero ); 
     86                double lpzc = mEp.evallogcond ( zeron, zero ); 
    8787                CHECK_CLOSE_EX ( lpz, lpzc, tolerance ); 
    8888 
    89                 vec lpzv(1); 
    90                 lpzv(0) = lpz; 
     89                vec lpzv ( 1 ); 
     90                lpzv ( 0 ) = lpz; 
    9191 
    9292                mat zero1n ( hepdf->dimension(), 1 ); 
     
    9898                CHECK_CLOSE_EX ( lpzv, lpzv_act, tolerance ); 
    9999 
    100                 Array<vec> zeroa(3); 
    101                 lpzv = vec( zeroa.size() ); 
     100                Array<vec> zeroa ( 3 ); 
     101                lpzv = vec ( zeroa.size() ); 
    102102                for ( int i = 0; i < zeroa.size(); ++i ) { 
    103                         zeroa(i) = zeron; 
    104                         lpzv(i) = lpz; 
     103                        zeroa ( i ) = zeron; 
     104                        lpzv ( i ) = lpz; 
    105105                } 
    106106 
     
    115115 
    116116        int tc = 0; 
    117         Array<vec> actual(CurrentContext::max_trial_count); 
     117        Array<vec> actual ( CurrentContext::max_trial_count ); 
    118118        do { 
    119119                vec emu = num_mean2 ( hepdf.get(), xb, yb, nbins ( 0 ), nbins ( 1 ) ); 
    120                 actual( tc ) = emu; 
    121                 ++tc; 
    122         } while ( ( tc < CurrentContext::max_trial_count ) && 
    123                   !UnitTest::AreClose ( mean, actual( tc - 1 ), tolerance ) ); 
    124         if ( ( tc == CurrentContext::max_trial_count ) && 
    125              ( !UnitTest::AreClose ( mean, actual( CurrentContext::max_trial_count - 1 ), tolerance ) ) ) { 
    126                 UnitTest::MemoryOutStream stream; 
    127                 stream << CurrentContext::format_context(__LINE__) << "expected " << mean << " +/- " << tolerance << " but was " << actual; 
    128  
    129                 UnitTest::TestDetails details(*UnitTest::CurrentTest::Details(), 0, false); 
    130  
    131                 UnitTest::CurrentTest::Results()->OnTestFailure ( details, stream.GetText() ); 
    132        } 
     120                actual ( tc ) = emu; 
     121                ++tc; 
     122        } while ( ( tc < CurrentContext::max_trial_count ) && 
     123                  !UnitTest::AreClose ( mean, actual ( tc - 1 ), tolerance ) ); 
     124        if ( ( tc == CurrentContext::max_trial_count ) && 
     125                ( !UnitTest::AreClose ( mean, actual ( CurrentContext::max_trial_count - 1 ), tolerance ) ) ) { 
     126                UnitTest::MemoryOutStream stream; 
     127                stream << CurrentContext::format_context ( __LINE__ ) << "expected " << mean << " +/- " << tolerance << " but was " << actual; 
     128 
     129                UnitTest::TestDetails details ( *UnitTest::CurrentTest::Details(), 0, false ); 
     130 
     131                UnitTest::CurrentTest::Results()->OnTestFailure ( details, stream.GetText() ); 
     132        } 
    133133} 
    134134 
     
    138138 
    139139        int tc = 0; 
    140         Array<double> actual(CurrentContext::max_trial_count); 
     140        Array<double> actual ( CurrentContext::max_trial_count ); 
    141141        do { 
    142142                double nc = normcoef ( hepdf.get(), xb, yb, nbins ( 0 ), nbins ( 1 ) ); 
    143                 actual( tc ) = nc; 
    144                 ++tc; 
    145         } while ( ( tc < CurrentContext::max_trial_count ) && 
    146                   !UnitTest::AreClose ( 1.0, actual( tc - 1 ), tolerance ) ); 
    147         if ( ( tc == CurrentContext::max_trial_count ) && 
    148              ( !UnitTest::AreClose ( 1.0, actual( CurrentContext::max_trial_count - 1 ), tolerance ) ) ) { 
    149                 UnitTest::MemoryOutStream stream; 
    150                 stream << CurrentContext::format_context(__LINE__) << "expected " << mean << " +/- " << tolerance << " but was " << actual; 
    151  
    152                 UnitTest::TestDetails details(*UnitTest::CurrentTest::Details(), 0, false); 
    153  
    154                 UnitTest::CurrentTest::Results()->OnTestFailure ( details, stream.GetText() ); 
    155        } 
     143                actual ( tc ) = nc; 
     144                ++tc; 
     145        } while ( ( tc < CurrentContext::max_trial_count ) && 
     146                  !UnitTest::AreClose ( 1.0, actual ( tc - 1 ), tolerance ) ); 
     147        if ( ( tc == CurrentContext::max_trial_count ) && 
     148                ( !UnitTest::AreClose ( 1.0, actual ( CurrentContext::max_trial_count - 1 ), tolerance ) ) ) { 
     149                UnitTest::MemoryOutStream stream; 
     150                stream << CurrentContext::format_context ( __LINE__ ) << "expected " << mean << " +/- " << tolerance << " but was " << actual; 
     151 
     152                UnitTest::TestDetails details ( *UnitTest::CurrentTest::Details(), 0, false ); 
     153 
     154                UnitTest::CurrentTest::Results()->OnTestFailure ( details, stream.GetText() ); 
     155        } 
    156156} 
    157157 
     
    160160 
    161161        int tc = 0; 
    162         Array<vec> actual(CurrentContext::max_trial_count); 
     162        Array<vec> actual ( CurrentContext::max_trial_count ); 
    163163        do { 
    164164                mat smp = hepdf->sample_mat ( nsamples ); 
    165165                vec emu = smp * ones ( nsamples ) / nsamples; 
    166                 actual( tc ) = emu; 
    167                 ++tc; 
    168         } while ( ( tc < CurrentContext::max_trial_count ) && 
    169                   !UnitTest::AreClose ( mean, actual( tc - 1 ), delta ) ); 
    170         if ( ( tc == CurrentContext::max_trial_count ) && 
    171              ( !UnitTest::AreClose ( mean, actual( CurrentContext::max_trial_count - 1 ), delta ) ) ) { 
    172                 UnitTest::MemoryOutStream stream; 
    173                 stream << CurrentContext::format_context(__LINE__) << "expected " << mean << " +/- " << delta << " but was " << actual; 
    174  
    175                 UnitTest::TestDetails details(*UnitTest::CurrentTest::Details(), 0, false); 
    176  
    177                 UnitTest::CurrentTest::Results()->OnTestFailure ( details, stream.GetText() ); 
    178        } 
     166                actual ( tc ) = emu; 
     167                ++tc; 
     168        } while ( ( tc < CurrentContext::max_trial_count ) && 
     169                  !UnitTest::AreClose ( mean, actual ( tc - 1 ), delta ) ); 
     170        if ( ( tc == CurrentContext::max_trial_count ) && 
     171                ( !UnitTest::AreClose ( mean, actual ( CurrentContext::max_trial_count - 1 ), delta ) ) ) { 
     172                UnitTest::MemoryOutStream stream; 
     173                stream << CurrentContext::format_context ( __LINE__ ) << "expected " << mean << " +/- " << delta << " but was " << actual; 
     174 
     175                UnitTest::TestDetails details ( *UnitTest::CurrentTest::Details(), 0, false ); 
     176 
     177                UnitTest::CurrentTest::Results()->OnTestFailure ( details, stream.GetText() ); 
     178        } 
    179179} 
    180180 
    181181void epdf_harness::check_covariance() { 
    182182        int tc = 0; 
    183         Array<mat> actual(CurrentContext::max_trial_count); 
     183        Array<mat> actual ( CurrentContext::max_trial_count ); 
    184184        do { 
    185185                mat smp = hepdf->sample_mat ( nsamples ); 
    186186                vec emu = smp * ones ( nsamples ) / nsamples; 
    187187                mat er = ( smp * smp.T() ) / nsamples - outer_product ( emu, emu ); 
    188                 actual( tc ) = er; 
    189                 ++tc; 
    190         } while ( ( tc < CurrentContext::max_trial_count ) && 
    191                   !UnitTest::AreClose ( R, actual( tc - 1 ), tolerance ) ); 
    192          
    193         if ( ( tc == CurrentContext::max_trial_count ) && 
    194              ( !UnitTest::AreClose ( R, actual( CurrentContext::max_trial_count - 1 ), tolerance ) ) ) { 
    195                 UnitTest::MemoryOutStream stream; 
    196                 stream << CurrentContext::format_context(__LINE__) << "expected " << R << " +/- " << tolerance << " but was " << actual; 
    197  
    198                 UnitTest::TestDetails details(*UnitTest::CurrentTest::Details(), 0, false); 
    199  
    200                 UnitTest::CurrentTest::Results()->OnTestFailure ( details, stream.GetText() ); 
    201        } 
    202 } 
    203  
    204 void epdf_harness::check_cond_mean( mprod &mep ) { 
     188                actual ( tc ) = er; 
     189                ++tc; 
     190        } while ( ( tc < CurrentContext::max_trial_count ) && 
     191                  !UnitTest::AreClose ( R, actual ( tc - 1 ), tolerance ) ); 
     192 
     193        if ( ( tc == CurrentContext::max_trial_count ) && 
     194                ( !UnitTest::AreClose ( R, actual ( CurrentContext::max_trial_count - 1 ), tolerance ) ) ) { 
     195                UnitTest::MemoryOutStream stream; 
     196                stream << CurrentContext::format_context ( __LINE__ ) << "expected " << R << " +/- " << tolerance << " but was " << actual; 
     197 
     198                UnitTest::TestDetails details ( *UnitTest::CurrentTest::Details(), 0, false ); 
     199 
     200                UnitTest::CurrentTest::Results()->OnTestFailure ( details, stream.GetText() ); 
     201        } 
     202} 
     203 
     204void epdf_harness::check_cond_mean ( mprod &mep ) { 
    205205        vec delta = make_close_tolerance ( variance, nsamples ); 
    206206 
    207207        int tc = 0; 
    208         Array<vec> actual(CurrentContext::max_trial_count); 
     208        Array<vec> actual ( CurrentContext::max_trial_count ); 
    209209        do { 
    210210                mat smp = mep.samplecond_mat ( vec ( 0 ), nsamples ); 
    211211                vec emu = sum ( smp, 2 ) / nsamples; 
    212                 actual( tc ) = emu; 
    213                 ++tc; 
    214         } while ( ( tc < CurrentContext::max_trial_count ) && 
    215                   !UnitTest::AreClose ( mean, actual( tc - 1 ), delta ) ); 
    216         if ( ( tc == CurrentContext::max_trial_count ) && 
    217              ( !UnitTest::AreClose ( mean, actual( CurrentContext::max_trial_count - 1 ), delta ) ) ) { 
    218                 UnitTest::MemoryOutStream stream; 
    219                 stream << CurrentContext::format_context(__LINE__) << "expected " << mean << " +/- " << delta << " but was " << actual; 
    220  
    221                 UnitTest::TestDetails details(*UnitTest::CurrentTest::Details(), 0, false); 
    222  
    223                 UnitTest::CurrentTest::Results()->OnTestFailure ( details, stream.GetText() ); 
    224        } 
    225 } 
    226  
    227 void epdf_harness::check_cond_covariance( mprod &mep ) { 
    228         int tc = 0; 
    229         Array<mat> actual(CurrentContext::max_trial_count); 
     212                actual ( tc ) = emu; 
     213                ++tc; 
     214        } while ( ( tc < CurrentContext::max_trial_count ) && 
     215                  !UnitTest::AreClose ( mean, actual ( tc - 1 ), delta ) ); 
     216        if ( ( tc == CurrentContext::max_trial_count ) && 
     217                ( !UnitTest::AreClose ( mean, actual ( CurrentContext::max_trial_count - 1 ), delta ) ) ) { 
     218                UnitTest::MemoryOutStream stream; 
     219                stream << CurrentContext::format_context ( __LINE__ ) << "expected " << mean << " +/- " << delta << " but was " << actual; 
     220 
     221                UnitTest::TestDetails details ( *UnitTest::CurrentTest::Details(), 0, false ); 
     222 
     223                UnitTest::CurrentTest::Results()->OnTestFailure ( details, stream.GetText() ); 
     224        } 
     225} 
     226 
     227void epdf_harness::check_cond_covariance ( mprod &mep ) { 
     228        int tc = 0; 
     229        Array<mat> actual ( CurrentContext::max_trial_count ); 
    230230        do { 
    231231                mat smp = mep.samplecond_mat ( vec ( 0 ), nsamples ); 
    232232                vec emu = sum ( smp, 2 ) / nsamples; 
    233233                mat er = ( smp * smp.T() ) / nsamples - outer_product ( emu, emu ); 
    234                 actual( tc ) = er; 
    235                 ++tc; 
    236         } while ( ( tc < CurrentContext::max_trial_count ) && 
    237                   !UnitTest::AreClose ( R, actual( tc - 1 ), tolerance ) ); 
    238         if ( ( tc == CurrentContext::max_trial_count ) && 
    239              ( !UnitTest::AreClose ( R, actual( CurrentContext::max_trial_count - 1 ), tolerance ) ) ) { 
    240                 UnitTest::MemoryOutStream stream; 
    241                 stream << CurrentContext::format_context(__LINE__) << "expected " << mean << " +/- " << tolerance << " but was " << actual; 
    242  
    243                 UnitTest::TestDetails details(*UnitTest::CurrentTest::Details(), 0, false); 
    244  
    245                 UnitTest::CurrentTest::Results()->OnTestFailure ( details, stream.GetText() ); 
    246        } 
    247 } 
    248  
    249 } 
     234                actual ( tc ) = er; 
     235                ++tc; 
     236        } while ( ( tc < CurrentContext::max_trial_count ) && 
     237                  !UnitTest::AreClose ( R, actual ( tc - 1 ), tolerance ) ); 
     238        if ( ( tc == CurrentContext::max_trial_count ) && 
     239                ( !UnitTest::AreClose ( R, actual ( CurrentContext::max_trial_count - 1 ), tolerance ) ) ) { 
     240                UnitTest::MemoryOutStream stream; 
     241                stream << CurrentContext::format_context ( __LINE__ ) << "expected " << mean << " +/- " << tolerance << " but was " << actual; 
     242 
     243                UnitTest::TestDetails details ( *UnitTest::CurrentTest::Details(), 0, false ); 
     244 
     245                UnitTest::CurrentTest::Results()->OnTestFailure ( details, stream.GetText() ); 
     246        } 
     247} 
     248 
     249} 
  • library/tests/epdf_harness.h

    r706 r722  
    6969 
    7070        // assumes marginal_rv is valid 
    71         void check_cond_mean( mprod &mep ); 
     71        void check_cond_mean ( mprod &mep ); 
    7272 
    7373        // assumes marginal_rv and R are valid 
    74         void check_cond_covariance( mprod &mep ); 
     74        void check_cond_covariance ( mprod &mep ); 
    7575}; 
    76 UIREGISTER(epdf_harness); 
     76UIREGISTER ( epdf_harness ); 
    7777 
    7878} 
  • library/tests/mat_checks.cpp

    r706 r722  
    6868} 
    6969 
    70 std::string CurrentContext::format_context(int ln) { 
     70std::string CurrentContext::format_context ( int ln ) { 
    7171        std::stringstream ss; 
    7272        ss << "error at " << config_name << '[' << index << ']'; 
    7373 
    7474        if ( ln >= 0 ) { 
    75                 ss << ", harness line " << ln; 
     75                ss << ", harness line " << ln; 
    7676        } 
    7777 
  • library/tests/mat_checks.h

    r706 r722  
    8181           __LINE__ (and it is included in the returned string). 
    8282        */ 
    83         static std::string format_context( int ln = -1 ); 
     83        static std::string format_context ( int ln = -1 ); 
    8484 
    8585        template<typename Expected, typename Actual> 
  • library/tests/pdf_harness.cpp

    r713 r722  
    4848 
    4949        int tc = 0; 
    50         Array<vec> actual(CurrentContext::max_trial_count); 
     50        Array<vec> actual ( CurrentContext::max_trial_count ); 
    5151        do { 
    5252                mat smp = hpdf->samplecond_mat ( cond, nsamples ); 
    5353                vec emu = smp * ones ( nsamples ) / nsamples; 
    54                 actual( tc ) = emu; 
     54                actual ( tc ) = emu; 
    5555                ++tc; 
    5656        } while ( ( tc < CurrentContext::max_trial_count ) && 
    57                   !UnitTest::AreClose ( mean, actual( tc - 1 ), delta ) ); 
     57                  !UnitTest::AreClose ( mean, actual ( tc - 1 ), delta ) ); 
    5858        if ( ( tc == CurrentContext::max_trial_count ) && 
    59              ( !UnitTest::AreClose ( mean, actual( CurrentContext::max_trial_count - 1 ), delta ) ) ) { 
     59                ( !UnitTest::AreClose ( mean, actual ( CurrentContext::max_trial_count - 1 ), delta ) ) ) { 
    6060                UnitTest::MemoryOutStream stream; 
    61                 stream << CurrentContext::format_context(__LINE__) << "expected " << mean << " +/- " << delta << " but was " << actual; 
     61                stream << CurrentContext::format_context ( __LINE__ ) << "expected " << mean << " +/- " << delta << " but was " << actual; 
    6262 
    63                 UnitTest::TestDetails details(*UnitTest::CurrentTest::Details(), 0, false); 
     63                UnitTest::TestDetails details ( *UnitTest::CurrentTest::Details(), 0, false ); 
    6464 
    6565                UnitTest::CurrentTest::Results()->OnTestFailure ( details, stream.GetText() ); 
    66        } 
     66        } 
    6767} 
    6868 
    6969void pdf_harness::check_covariance() { 
    7070        int tc = 0; 
    71         Array<mat> actual(CurrentContext::max_trial_count); 
     71        Array<mat> actual ( CurrentContext::max_trial_count ); 
    7272        do { 
    7373                mat smp = hpdf->samplecond_mat ( cond, nsamples ); 
    7474                vec emu = smp * ones ( nsamples ) / nsamples; 
    7575                mat er = ( smp * smp.T() ) / nsamples - outer_product ( emu, emu ); 
    76                 actual( tc ) = er; 
     76                actual ( tc ) = er; 
    7777                ++tc; 
    7878        } while ( ( tc < CurrentContext::max_trial_count ) && 
    79                   !UnitTest::AreClose ( R, actual( tc - 1 ), tolerance ) ); 
     79                  !UnitTest::AreClose ( R, actual ( tc - 1 ), tolerance ) ); 
    8080        if ( ( tc == CurrentContext::max_trial_count ) && 
    81              ( !UnitTest::AreClose ( R, actual( CurrentContext::max_trial_count - 1 ), tolerance ) ) ) { 
     81                ( !UnitTest::AreClose ( R, actual ( CurrentContext::max_trial_count - 1 ), tolerance ) ) ) { 
    8282                UnitTest::MemoryOutStream stream; 
    83                 stream << CurrentContext::format_context(__LINE__) << "expected " << R << " +/- " << tolerance << " but was " << actual; 
     83                stream << CurrentContext::format_context ( __LINE__ ) << "expected " << R << " +/- " << tolerance << " but was " << actual; 
    8484 
    85                 UnitTest::TestDetails details(*UnitTest::CurrentTest::Details(), 0, false); 
     85                UnitTest::TestDetails details ( *UnitTest::CurrentTest::Details(), 0, false ); 
    8686 
    8787                UnitTest::CurrentTest::Results()->OnTestFailure ( details, stream.GetText() ); 
    88        } 
     88        } 
    8989} 
    9090 
  • library/tests/pdf_harness.h

    r706 r722  
    5252        void check_covariance(); 
    5353}; 
    54 UIREGISTER(pdf_harness); 
     54UIREGISTER ( pdf_harness ); 
    5555 
    5656} 
  • library/tests/stresssuite/arx_elem_stress.cpp

    r721 r722  
    1111        ARX Ar; 
    1212        Ar.set_statistics ( 1, V0, -1.0 ); 
    13         Ar.set_constant(true); 
     13        Ar.set_constant ( true ); 
    1414        Ar.validate(); 
    1515 
  • library/tests/stresssuite/arx_stress.cpp

    r721 r722  
    2929        ARX Ar; 
    3030        Ar.set_statistics ( 1, V0, nu0 );               // Estimator 
    31         Ar.set_constant(false); 
     31        Ar.set_constant ( false ); 
    3232        Ar.validate(); 
    3333        const epdf& f_thr = Ar.posterior();          // refrence to posterior of the estimator 
     
    5252                Yt ( t ) = th * rgr + sqr * NorRNG(); 
    5353 
    54                 Ar.bayes ( vec_1(Yt(t)), rgr );             // Bayes rule 
     54                Ar.bayes ( vec_1 ( Yt ( t ) ), rgr );       // Bayes rule 
    5555 
    5656                // Build predictor 
  • library/tests/stresssuite/kalman_QR_stress.cpp

    r721 r722  
    7070        KF_QR.set_parameters ( &evolQR, &evolQR, 100 ); 
    7171        evolQR.condition ( "1 1 1" ); 
    72         egamma kfinit=egamma("10 10 10","1 1 1"); 
    73         KF_QR.set_statistics ( egamma("10 10 10","1 1 1"), &KF ); 
     72        egamma kfinit = egamma ( "10 10 10", "1 1 1" ); 
     73        KF_QR.set_statistics ( egamma ( "10 10 10", "1 1 1" ), &KF ); 
    7474        const epdf& mpost = KF_QR.posterior(); 
    7575        const epdf& mposttr = KFtr.posterior(); 
  • library/tests/stresssuite/kalman_stress.cpp

    r721 r722  
    6363        KF.set_parameters ( A, B, C, D, chmat ( Q ), chmat ( R ) ); 
    6464        KF.set_statistics ( mu0, chmat ( P0 ) ); //prediction! 
    65         KF.set_evalll(false); 
     65        KF.set_evalll ( false ); 
    6666        KF.validate(); 
    6767        const epdf& KFep = KF.posterior(); 
     
    7171        // FULL 
    7272        KalmanFull KF2; 
    73         KF2.set_parameters( A, B, C, D,  Q, R); 
    74         KF2.set_statistics( mu0, P0 ); 
    75         KF2.set_evalll(false); 
     73        KF2.set_parameters ( A, B, C, D,  Q, R ); 
     74        KF2.set_statistics ( mu0, P0 ); 
     75        KF2.set_evalll ( false ); 
    7676        KF2.validate(); 
    7777        mat Xt2 ( dimx, Ndat ); 
     
    8585        KFE.set_parameters ( fxu, hxu, Q, R ); 
    8686        KFE.set_statistics ( mu0, chmat ( P0 ) ); 
    87         KFE.set_evalll(false); 
     87        KFE.set_evalll ( false ); 
    8888        KFE.validate(); 
    8989        const epdf& KFEep = KFE.posterior(); 
     
    9898        tt.tic(); 
    9999        for ( int t = 1; t < Ndat; t++ ) { 
    100                 dt = Dt.get_col(t); 
    101                 KF.bayes ( dt.get(0,C.rows()-1), dt.get(C.rows(), dt.length()-1) ); 
     100                dt = Dt.get_col ( t ); 
     101                KF.bayes ( dt.get ( 0, C.rows() - 1 ), dt.get ( C.rows(), dt.length() - 1 ) ); 
    102102                Xt.set_col ( t, KFep.mean() ); 
    103103        } 
     
    106106        tt.tic(); 
    107107        for ( int t = 1; t < Ndat; t++ ) { 
    108                 dt = Dt.get_col(t); 
    109                 KF2.bayes ( dt.get(0,C.rows()-1), dt.get(C.rows(), dt.length()-1) ); 
     108                dt = Dt.get_col ( t ); 
     109                KF2.bayes ( dt.get ( 0, C.rows() - 1 ), dt.get ( C.rows(), dt.length() - 1 ) ); 
    110110                Xt2.set_col ( t, KF2.posterior().mean() ); 
    111111        } 
     
    114114        tt.tic(); 
    115115        for ( int t = 1; t < Ndat; t++ ) { 
    116                 dt = Dt.get_col(t); 
    117                 KFE.bayes ( dt.get(0,C.rows()-1), dt.get(C.rows(), dt.length()-1) ); 
     116                dt = Dt.get_col ( t ); 
     117                KFE.bayes ( dt.get ( 0, C.rows() - 1 ), dt.get ( C.rows(), dt.length() - 1 ) ); 
    118118                XtE.set_col ( t, KFEep.mean() ); 
    119119        } 
  • library/tests/stresssuite/mixtures_stress.cpp

    r721 r722  
    101101        // Add ones for constant coefficients 
    102102        mat Data = concat_vertical ( Smp, ones ( 1, Smp.cols() ) ); 
    103         Post.bayes ( Data , empty_vec); 
     103        Post.bayes ( Data , empty_vec ); 
    104104 
    105105        cout << "Posterior mixture:" << endl; 
  • library/tests/stresssuite/particle_stress.cpp

    r721 r722  
    3737 
    3838        ivec ind; 
    39         emp.resample(ind); 
     39        emp.resample ( ind ); 
    4040 
    4141        cout << ind << endl; 
  • library/tests/stresssuite/resample_stress.cpp

    r721 r722  
    3838 
    3939        ivec ind; 
    40         emp.resample(ind); 
     40        emp.resample ( ind ); 
    4141 
    4242        cout << ind << endl; 
  • library/tests/stresssuite/size_generator.cpp

    r717 r722  
    55using bdm::UI; 
    66 
    7 void size_generator::from_setting(const Setting &set) { 
    8         UI::get( sz, set, "size", UI::optional ); 
    9         UI::get( step, set, "step", UI::optional ); 
     7void size_generator::from_setting ( const Setting &set ) { 
     8        UI::get ( sz, set, "size", UI::optional ); 
     9        UI::get ( step, set, "step", UI::optional ); 
    1010} 
    1111 
  • library/tests/stresssuite/stresssuite.cpp

    r721 r722  
    55#include "itpp_ext.h" 
    66#include <string.h> 
     7#include "../general_suite.h" 
    78 
    8 using std::cout; 
    9 using std::cerr; 
    10 using std::endl; 
    11  
    12 using namespace itpp; 
    13  
    14 Array<const char *> selected_tests; 
    15  
    16 bool is_selected_test ( const UnitTest::Test *test ) { 
    17         bdm_assert_debug ( test, "NULL test" ); 
    18  
    19         if ( !selected_tests.length() ) { 
    20                 return true; 
    21         } 
    22  
    23         for ( int i = 0; i < selected_tests.length(); ++i ) { 
    24                 const char *n = test->m_details.testName; 
    25                 bdm_assert_debug ( n, "NULL test name" ); 
    26                 const char *sname = selected_tests ( i ); 
    27                 bdm_assert_debug ( sname, "NULL selected test name" ); 
    28                 if ( !strcmp ( n, sname ) ) { 
    29                         return true; 
    30                 } 
    31         } 
    32  
    33         return false; 
    34 } 
     9using namespace UnitTest; 
    3510 
    3611int main ( int argc, char const *argv[] ) { 
    3712        if ( argc > 1 ) { 
    38                 if ( !strcmp ( argv[1], "print" ) ) { 
    39                         UnitTest::Test* curTest = UnitTest::Test::GetTestList().GetHead(); 
    40  
    41                         while ( curTest != 0 ) { 
    42                                 const char *n = curTest->m_details.testName; 
    43                                 printf ( "%s\n", n ); 
    44                                 curTest = curTest->next; 
    45                         } 
    46                         return 0; 
    47                 } else { 
    48                         selected_tests.set_length ( argc - 1 ); 
    49                         const char **param = argv + 1; 
    50                         int i = 0; 
    51                         while ( *param ) { 
    52                                 selected_tests ( i ) = *param; 
    53                                 ++i; 
    54                                 ++param; 
    55                         } 
    56                 } 
     13                if ( !strcmp ( argv[1], "print" ) ) 
     14                        print_test_list(); 
     15                else 
     16                        pick_selected_tests ( argc, argv ); 
    5717        } else { 
    58                 cout << endl << "STRESSSUITE - a program covering all BDM stress tests." << endl << endl  
    59                      << argv[0] << " ....................................... run all stress tests" << endl  
    60                      << argv[0] << " particular_test_1 particular_test_2 ... run selected stress tests" << endl  
     18                cout << endl << "STRESSSUITE - a program covering all BDM stress tests." << endl << endl 
     19                     << argv[0] << " ....................................... run all stress tests" << endl 
     20                     << argv[0] << " particular_test_1 particular_test_2 ... run selected stress tests" << endl 
    6121                     << argv[0] << " print ................................. print all the implemented stress tests" << endl; 
    6222        } 
    6323 
    64         itpp::RNG_randomize(); 
    65  
    66         UnitTest::TestReporterStdout reporter; 
    67         UnitTest::TestRunner runner ( reporter ); 
    68         return runner.RunTestsIf ( UnitTest::Test::GetTestList(), 
    69                                    0, 
    70                                    is_selected_test, 
    71                                    0 ); 
     24        return run_selected_tests(); 
    7225} 
  • library/tests/testsuite/LQG_test.cpp

    r717 r722  
    55using namespace bdm; 
    66 
    7 TEST(LQG_test) { 
     7TEST ( LQG_test ) { 
    88        LQG reg; 
    9         shared_ptr<StateSpace<fsqmat> > stsp=new StateSpace<fsqmat>; 
     9        shared_ptr<StateSpace<fsqmat> > stsp = new StateSpace<fsqmat>; 
    1010        // 2 x 1 x 1 
    11         stsp-> set_parameters(eye(2), ones(2,1), ones(1,2), ones(1,1), /* Q,R */ eye(2), eye(1)); 
    12         reg.set_system(stsp); // A, B, C 
    13         reg.set_control_parameters(eye(1), eye(1),  vec_1(1.0), 6); //Qy, Qu, horizon 
     11        stsp-> set_parameters ( eye ( 2 ), ones ( 2, 1 ), ones ( 1, 2 ), ones ( 1, 1 ), /* Q,R */ eye ( 2 ), eye ( 1 ) ); 
     12        reg.set_system ( stsp ); // A, B, C 
     13        reg.set_control_parameters ( eye ( 1 ), eye ( 1 ),  vec_1 ( 1.0 ), 6 ); //Qy, Qu, horizon 
    1414 
    1515        reg.redesign(); 
    16         double reg_apply=reg.ctrlaction("0.5, 1.1","0.0")(0); /*convert vec to double*/ 
    17         CHECK_CLOSE(reg_apply, -0.248528137234392, 0.0001); 
     16        double reg_apply = reg.ctrlaction ( "0.5, 1.1", "0.0" ) ( 0 ); /*convert vec to double*/ 
     17        CHECK_CLOSE ( reg_apply, -0.248528137234392, 0.0001 ); 
    1818} 
    1919 
    20 TEST(to_state_test) { 
     20TEST ( to_state_test ) { 
    2121        mlnorm<fsqmat> ml; 
    22         mat A="1.1, 2.3"; 
    23         ml.set_parameters(A, vec_1(1.3), eye(1)); 
    24         RV yr=RV("y",1); 
    25         RV ur=RV("u",1); 
    26         ml.set_rv(yr); 
    27         yr.t_plus(-1); 
    28         ml.set_rvc(concat(yr, ur)); 
    29          
    30         shared_ptr<StateCanonical > Stsp=new StateCanonical; 
    31         Stsp->connect_mlnorm(ml); 
    32          
    33         /* results from  
     22        mat A = "1.1, 2.3"; 
     23        ml.set_parameters ( A, vec_1 ( 1.3 ), eye ( 1 ) ); 
     24        RV yr = RV ( "y", 1 ); 
     25        RV ur = RV ( "u", 1 ); 
     26        ml.set_rv ( yr ); 
     27        yr.t_plus ( -1 ); 
     28        ml.set_rvc ( concat ( yr, ur ) ); 
     29 
     30        shared_ptr<StateCanonical > Stsp = new StateCanonical; 
     31        Stsp->connect_mlnorm ( ml ); 
     32 
     33        /* results from 
    3434        [A,B,C,D]=tf2ss([2.3 0],[1 -1.1]) 
    3535        */ 
    36         CHECK_CLOSE_EX(Stsp->_A().get_row(0), vec("1.1"), 0.0001); 
    37         CHECK_CLOSE_EX(Stsp->_C().get_row(0), vec("2.53"), 0.0001); 
    38         CHECK_CLOSE_EX(Stsp->_D().get_row(0), vec("2.30"), 0.0001); 
     36        CHECK_CLOSE_EX ( Stsp->_A().get_row ( 0 ), vec ( "1.1" ), 0.0001 ); 
     37        CHECK_CLOSE_EX ( Stsp->_C().get_row ( 0 ), vec ( "2.53" ), 0.0001 ); 
     38        CHECK_CLOSE_EX ( Stsp->_D().get_row ( 0 ), vec ( "2.30" ), 0.0001 ); 
    3939} 
    4040 
    41 TEST(to_state_arx_test) { 
     41TEST ( to_state_arx_test ) { 
    4242        mlnorm<fsqmat> ml; 
    43         mat A="1.1, 2.3"; 
    44         ml.set_parameters(A, vec_1(1.3), eye(1)); 
    45         RV yr=RV("y",1); 
    46         RV ur=RV("u",1); 
    47         ml.set_rv(yr); 
    48         yr.t_plus(-1); 
    49         ml.set_rvc(concat(yr, ur)); 
    50          
    51         shared_ptr<StateFromARX> Stsp=new StateFromARX; 
    52         Stsp->connect_mlnorm(ml); 
    53          
    54         /* results from  
     43        mat A = "1.1, 2.3"; 
     44        ml.set_parameters ( A, vec_1 ( 1.3 ), eye ( 1 ) ); 
     45        RV yr = RV ( "y", 1 ); 
     46        RV ur = RV ( "u", 1 ); 
     47        ml.set_rv ( yr ); 
     48        yr.t_plus ( -1 ); 
     49        ml.set_rvc ( concat ( yr, ur ) ); 
     50 
     51        shared_ptr<StateFromARX> Stsp = new StateFromARX; 
     52        Stsp->connect_mlnorm ( ml ); 
     53 
     54        /* results from 
    5555        [A,B,C,D]=tf2ss([2.3 0],[1 -1.1]) 
    5656        */ 
     
    5858} 
    5959 
    60 TEST(arx_LQG_test){ 
     60TEST ( arx_LQG_test ) { 
    6161        mlnorm<fsqmat> ml; 
    62         mat A="1.81, -.8189, .00468, .00438"; 
    63         ml.set_parameters(A, vec_1(0.0), 0.00001*eye(1)); 
    64         RV yr=RV("y",1); 
    65         RV ur=RV("u",1); 
    66         RV rgr = yr.copy_t(-1); 
    67         rgr.add(yr.copy_t(-2)); 
    68         rgr.add(yr.copy_t(-2)); 
    69         rgr.add(ur.copy_t(-2)); 
    70         rgr.add(ur.copy_t(-1)); 
    71          
    72         ml.set_rv(yr); 
    73         ml.set_rvc(rgr); 
     62        mat A = "1.81, -.8189, .00468, .00438"; 
     63        ml.set_parameters ( A, vec_1 ( 0.0 ), 0.00001*eye ( 1 ) ); 
     64        RV yr = RV ( "y", 1 ); 
     65        RV ur = RV ( "u", 1 ); 
     66        RV rgr = yr.copy_t ( -1 ); 
     67        rgr.add ( yr.copy_t ( -2 ) ); 
     68        rgr.add ( yr.copy_t ( -2 ) ); 
     69        rgr.add ( ur.copy_t ( -2 ) ); 
     70        rgr.add ( ur.copy_t ( -1 ) ); 
     71 
     72        ml.set_rv ( yr ); 
     73        ml.set_rvc ( rgr ); 
    7474        ml.validate(); 
    75          
    76         shared_ptr<StateCanonical > Stsp=new StateCanonical; 
    77         Stsp->connect_mlnorm(ml); 
    78          
     75 
     76        shared_ptr<StateCanonical > Stsp = new StateCanonical; 
     77        Stsp->connect_mlnorm ( ml ); 
     78 
    7979        LQG L; 
    80         L.set_system(Stsp); 
    81         L.set_control_parameters(eye(1), eye(1), vec_1(0.0), 100); 
     80        L.set_system ( Stsp ); 
     81        L.set_control_parameters ( eye ( 1 ), eye ( 1 ), vec_1 ( 0.0 ), 100 ); 
    8282        L.validate(); 
    83          
     83 
    8484        L.redesign(); 
    85         cout << L.to_string()<<endl; 
     85        cout << L.to_string() << endl; 
    8686} 
  • library/tests/testsuite/arx_straux_test.cpp

    r717 r722  
    88        UIFile F ( "arx_straux_test.cfg" ); 
    99 
    10         Setting &tests=F.getRoot() ["tests"]; 
    11         for ( int i=0;i<tests.getLength(); i++ ) { 
     10        Setting &tests = F.getRoot() ["tests"]; 
     11        for ( int i = 0; i < tests.getLength(); i++ ) { 
    1212                mat A; 
    1313                mat B; 
    1414                ivec o1_ok; 
    15                 UI::get ( A,tests[i],"A",UI::compulsory ); 
    16                 UI::get ( B,tests[i],"B",UI::compulsory ); 
    17                 UI::get ( o1_ok,tests[i],"o1",UI::compulsory ); 
     15                UI::get ( A, tests[i], "A", UI::compulsory ); 
     16                UI::get ( B, tests[i], "B", UI::compulsory ); 
     17                UI::get ( o1_ok, tests[i], "o1", UI::compulsory ); 
    1818 
    1919//when updateing matrices do not forget to update CHECK_EQUAL below!!! 
    2020 
    21                 ldmat Ld0 ( 3 ); Ld0.ldform ( A,ones ( A.rows() ) ); 
    22                 ldmat Ld1 ( 3 ); Ld1.ldform ( A+B,ones ( A.rows() ) ); 
     21                ldmat Ld0 ( 3 ); 
     22                Ld0.ldform ( A, ones ( A.rows() ) ); 
     23                ldmat Ld1 ( 3 ); 
     24                Ld1.ldform ( A + B, ones ( A.rows() ) ); 
    2325 
    2426 
     
    2729                int nrep = 5;         // nrep: number of random repetions of structure estimation 
    2830                double lambda   = 0.9; 
    29                 int k=2; 
     31                int k = 2; 
    3032 
    3133//[strout, rgrsout, statistics] = 
     
    3335//          order_k); 
    3436                Array<str_aux> o2; 
    35                 ivec o1 = straux1 ( Ld1,20, Ld0, 10,  belief, nbest, nrep, lambda, k, o2 ); 
     37                ivec o1 = straux1 ( Ld1, 20, Ld0, 10,  belief, nbest, nrep, lambda, k, o2 ); 
    3638 
    3739//o1 is messed up in matlab's straux 
  • library/tests/testsuite/datalink_test.cpp

    r717 r722  
    9191        RV a = RV ( "{dl_a }" ); 
    9292        RV b = RV ( "{dlb }" ); 
    93         RV ab=concat(a,b); 
     93        RV ab = concat ( a, b ); 
    9494        RV aa = a; 
    95         a.t_plus(-1); 
    96         aa.add(a);  
     95        a.t_plus ( -1 ); 
     96        aa.add ( a ); 
    9797 
    98          
     98 
    9999        datalink_buffered dl; 
    100         dl.set_connection ( concat(aa,b), ab); 
     100        dl.set_connection ( concat ( aa, b ), ab ); 
    101101 
    102102        vec val_up ( "1 2" ); 
    103         dl.step(val_up); 
    104         val_up="3 4"; 
    105          
    106          
     103        dl.step ( val_up ); 
     104        val_up = "3 4"; 
     105 
     106 
    107107        vec p = dl.pushdown ( val_up ); 
    108108        vec exp_p = " 3, 1, 4 "; 
  • library/tests/testsuite/datasource_test.cpp

    r717 r722  
    77 
    88TEST ( EpdfDS_test ) { 
    9         UIFile uif("epdfds.cfg"); 
     9        UIFile uif ( "epdfds.cfg" ); 
    1010 
    11         shared_ptr<EpdfDS> ds=UI::build<EpdfDS>(uif, "ds"); 
    12          
    13         vec mean = zeros(2); 
    14         vec dt = zeros(2); 
    15         for (int i=0; i<100; i++){ 
     11        shared_ptr<EpdfDS> ds = UI::build<EpdfDS> ( uif, "ds" ); 
     12 
     13        vec mean = zeros ( 2 ); 
     14        vec dt = zeros ( 2 ); 
     15        for ( int i = 0; i < 100; i++ ) { 
    1616                ds->step(); 
    17                 ds->getdata(dt); 
     17                ds->getdata ( dt ); 
    1818                mean += dt; 
    1919        } 
    20         CHECK_CLOSE_EX (  vec_2(1.0,2.0) ,mean/100, 1e-2); 
     20        CHECK_CLOSE_EX ( vec_2 ( 1.0, 2.0 ) , mean / 100, 1e-2 ); 
    2121} 
    2222 
    2323TEST ( PdfDS_test ) { 
    24         UIFile uif("pdfds.cfg"); 
     24        UIFile uif ( "pdfds.cfg" ); 
    2525 
    26         shared_ptr<PdfDS> ds=UI::build<PdfDS>(uif, "ds", UI::compulsory); 
    27          
    28         vec dt = zeros(2); 
    29         vec ut="1.0"; 
    30         ds->write(ut); 
    31         for (int i=0; i<100; i++){ 
     26        shared_ptr<PdfDS> ds = UI::build<PdfDS> ( uif, "ds", UI::compulsory ); 
     27 
     28        vec dt = zeros ( 2 ); 
     29        vec ut = "1.0"; 
     30        ds->write ( ut ); 
     31        for ( int i = 0; i < 100; i++ ) { 
    3232                ds->step(); 
    3333        } 
    34         ds->getdata(dt); 
    35         CHECK_CLOSE ( -0.2 , dt(0), 1e-4); 
     34        ds->getdata ( dt ); 
     35        CHECK_CLOSE ( -0.2 , dt ( 0 ), 1e-4 ); 
    3636 
    37         ut="2.0"; 
    38         ds->write(ut); 
    39         for (int i=0; i<100; i++){ 
     37        ut = "2.0"; 
     38        ds->write ( ut ); 
     39        for ( int i = 0; i < 100; i++ ) { 
    4040                ds->step(); 
    4141        } 
    42         ds->getdata(dt); 
    43         CHECK_CLOSE ( -0.4 , dt(0), 1e-4); 
     42        ds->getdata ( dt ); 
     43        CHECK_CLOSE ( -0.4 , dt ( 0 ), 1e-4 ); 
    4444} 
    4545 
    46 TEST(StateDS_test){ 
    47         RV y("y",1); 
    48         RV u("u",1); 
    49         RV x("x",2); 
    50          
     46TEST ( StateDS_test ) { 
     47        RV y ( "y", 1 ); 
     48        RV u ( "u", 1 ); 
     49        RV x ( "x", 2 ); 
     50 
    5151        shared_ptr<mlnorm<fsqmat> > IM = new mlnorm<fsqmat>; 
    52         IM->set_parameters(mat("1 2 0.5; 0 1 0.3"), zeros(2), fsqmat(1e-10*eye(2))); 
    53         IM->set_rv(x); 
    54         IM->set_rvc(concat(x.copy_t(-1), u)); 
     52        IM->set_parameters ( mat ( "1 2 0.5; 0 1 0.3" ), zeros ( 2 ), fsqmat ( 1e-10*eye ( 2 ) ) ); 
     53        IM->set_rv ( x ); 
     54        IM->set_rvc ( concat ( x.copy_t ( -1 ), u ) ); 
    5555        IM->validate(); 
    5656 
    5757        shared_ptr<mlnorm<fsqmat> > OM = new mlnorm<fsqmat>; 
    58         OM->set_parameters(mat("1 0"), zeros(1), fsqmat(1e-10*eye(1))); 
    59         OM->set_rv(y); 
    60         OM->set_rvc(x); 
     58        OM->set_parameters ( mat ( "1 0" ), zeros ( 1 ), fsqmat ( 1e-10*eye ( 1 ) ) ); 
     59        OM->set_rv ( y ); 
     60        OM->set_rvc ( x ); 
    6161        OM->validate(); 
    62          
     62 
    6363        StateDS sds; 
    64         sds.set_parameters(IM,OM); 
     64        sds.set_parameters ( IM, OM ); 
    6565        sds.validate(); 
    66          
    67         for (int t=1; t<10;t++){ 
    68                 sds.write(vec_1(double(t))); 
     66 
     67        for ( int t = 1; t < 10; t++ ) { 
     68                sds.write ( vec_1 ( double ( t ) ) ); 
    6969                sds.step(); 
    7070        } 
    7171 
    72         vec dt; sds.getdata(dt); 
    73         CHECK_CLOSE(vec("94.5, 94.5, 13.5, 9"), dt, 1e-2);       
     72        vec dt; 
     73        sds.getdata ( dt ); 
     74        CHECK_CLOSE ( vec ( "94.5, 94.5, 13.5, 9" ), dt, 1e-2 ); 
    7475} 
  • library/tests/testsuite/egiw_test.cpp

    r717 r722  
    4545        int n = 100; 
    4646        rectangular_support Sup; 
    47         Sup.set_parameters("{[-2.,4.], [1.,5.], [0.,2.]} ", n*ones_i(E.dimension())); 
    48          
    49         double summ = exp(E.evallog(Sup.first_vec())); 
     47        Sup.set_parameters ( "{[-2.,4.], [1.,5.], [0.,2.]} ", n*ones_i ( E.dimension() ) ); 
     48 
     49        double summ = exp ( E.evallog ( Sup.first_vec() ) ); 
    5050        // sum all likelihood at all points of support 
    5151        for ( int k = 1; k < Sup.points(); k++ ) { // ALL b 
    52                 summ += exp (E.evallog(Sup.next_vec())); 
     52                summ += exp ( E.evallog ( Sup.next_vec() ) ); 
    5353        } 
    5454 
    55         CHECK_CLOSE ( 1.0, summ*prod(Sup._steps()), 0.01 ); 
     55        CHECK_CLOSE ( 1.0, summ*prod ( Sup._steps() ), 0.01 ); 
    5656} 
    5757 
  • library/tests/testsuite/emix_test.cpp

    r721 r722  
    1313static void check_mean ( emix &distrib_obj, int nsamples, const vec &mean, double tolerance ); 
    1414 
    15 static void check_covariance ( emix &distrib_obj, int nsamples, const mat &R, double tolerance); 
     15static void check_covariance ( emix &distrib_obj, int nsamples, const mat &R, double tolerance ); 
    1616 
    1717TEST ( emix_test ) { 
     
    4646        pdf_ptr Ac = E1->condition ( y ); 
    4747 
    48         mlnorm<ldmat> *wacnd = dynamic_cast<mlnorm<ldmat> *>( Ac.get() ); 
    49         CHECK(wacnd); 
     48        mlnorm<ldmat> *wacnd = dynamic_cast<mlnorm<ldmat> *> ( Ac.get() ); 
     49        CHECK ( wacnd ); 
    5050        if ( wacnd ) { 
    5151                CHECK_CLOSE ( mat ( "-0.349953" ), wacnd->_A(), epsilon ); 
     
    8383 
    8484        mat observedR ( "0.740142 -0.259015; -0.259015 1.0302" ); 
    85         check_covariance ( M2, N, observedR, 2.0); 
     85        check_covariance ( M2, N, observedR, 2.0 ); 
    8686 
    8787        epdf_ptr Mg = M2.marginal ( y ); 
     
    9797static void check_mean ( emix &distrib_obj, int nsamples, const vec &mean, double tolerance ) { 
    9898        int tc = 0; 
    99         Array<vec> actual(CurrentContext::max_trial_count); 
     99        Array<vec> actual ( CurrentContext::max_trial_count ); 
    100100        do { 
    101101                mat smp = distrib_obj.sample_mat ( nsamples ); 
    102102                vec emu = sum ( smp, 2 ) / nsamples; 
    103                 actual( tc ) = emu; 
     103                actual ( tc ) = emu; 
    104104                ++tc; 
    105105        } while ( ( tc < CurrentContext::max_trial_count ) && 
    106                   !UnitTest::AreClose ( mean, actual( tc - 1 ), tolerance ) ); 
     106                  !UnitTest::AreClose ( mean, actual ( tc - 1 ), tolerance ) ); 
    107107        if ( ( tc == CurrentContext::max_trial_count ) && 
    108              ( !UnitTest::AreClose ( mean, actual( CurrentContext::max_trial_count - 1 ), tolerance ) ) ) { 
     108                ( !UnitTest::AreClose ( mean, actual ( CurrentContext::max_trial_count - 1 ), tolerance ) ) ) { 
    109109                UnitTest::MemoryOutStream stream; 
    110                 UnitTest::TestDetails details(*UnitTest::CurrentTest::Details(), __LINE__); 
     110                UnitTest::TestDetails details ( *UnitTest::CurrentTest::Details(), __LINE__ ); 
    111111                stream << "Expected " << mean << " +/- " << tolerance << " but was " << actual; 
    112112 
     
    115115} 
    116116 
    117 static void check_covariance ( emix &distrib_obj, int nsamples, const mat &R, double tolerance) { 
     117static void check_covariance ( emix &distrib_obj, int nsamples, const mat &R, double tolerance ) { 
    118118        int tc = 0; 
    119         Array<mat> actual(CurrentContext::max_trial_count); 
     119        Array<mat> actual ( CurrentContext::max_trial_count ); 
    120120        do { 
    121121                mat smp = distrib_obj.sample_mat ( nsamples ); 
    122122                vec emu = sum ( smp, 2 ) / nsamples; 
    123123                mat er = ( smp * smp.T() ) / nsamples - outer_product ( emu, emu ); 
    124                 actual( tc ) = er; 
     124                actual ( tc ) = er; 
    125125                ++tc; 
    126126        } while ( ( tc < CurrentContext::max_trial_count ) && 
    127                   !UnitTest::AreClose ( R, actual( tc - 1 ), tolerance ) ); 
     127                  !UnitTest::AreClose ( R, actual ( tc - 1 ), tolerance ) ); 
    128128        if ( ( tc == CurrentContext::max_trial_count ) && 
    129              ( !UnitTest::AreClose ( R, actual( CurrentContext::max_trial_count - 1 ), tolerance ) ) ) { 
     129                ( !UnitTest::AreClose ( R, actual ( CurrentContext::max_trial_count - 1 ), tolerance ) ) ) { 
    130130                UnitTest::MemoryOutStream stream; 
    131                 UnitTest::TestDetails details(*UnitTest::CurrentTest::Details(), __LINE__); 
     131                UnitTest::TestDetails details ( *UnitTest::CurrentTest::Details(), __LINE__ ); 
    132132                stream << "Expected " << R << " +/- " << tolerance << " but was " << actual; 
    133133 
    134134                UnitTest::CurrentTest::Results()->OnTestFailure ( details, stream.GetText() ); 
    135        } 
     135        } 
    136136} 
  • library/tests/testsuite/epdf_test.cpp

    r717 r722  
    7676} 
    7777 
    78 TEST(dirich_test){ 
     78TEST ( dirich_test ) { 
    7979        epdf_harness::test_config ( "edirich.cfg" ); 
    8080} 
  • library/tests/testsuite/logger_test.cpp

    r721 r722  
    2222        } 
    2323 
    24         int sz = static_cast<int>(st.st_size); 
     24        int sz = static_cast<int> ( st.st_size ); 
    2525        if ( sz != st.st_size ) { 
    2626                std::string msg = fname; 
  • library/tests/testsuite/merger_test.cpp

    r717 r722  
    4747 
    4848        vec exp_f1 ( "-7.51551 -7.02066 " 
    49                      "-6.54622 -6.09219 " 
    50                      "-5.65856 -5.24534 " 
    51                      "-4.85252 -4.48011 -4.1281 " 
    52                      "-3.7965 -3.48531 -3.19452 " 
    53                      "-2.92414 -2.67417 -2.4446 -2.23544 -2.04668 " 
    54                      "-1.87833 -1.73039 -1.60285 -1.49572 -1.40899 -1.34267 -1.29676 -1.27125 -1.26615 -1.28145 -1.31717 -1.37328 -1.4498 -1.54673 -1.66407 -1.80181 -1.95996 " 
    55                      "-2.13851 -2.33747 -2.55683 -2.79661 " 
    56                      "-3.05678 -3.33737 -3.63836 -3.95975 " 
    57                      "-4.30155 -4.66376 " 
    58                      "-5.04638 -5.4494 -5.87282 " 
    59                      "-6.31665 -6.78089 " 
    60                      "-7.26554 -7.77059 " 
    61                      "-8.29604 -8.84191 " 
    62                      "-9.40818 -9.99485 " 
    63                      "-10.6019 " 
    64                      "-11.2294 -11.8773 " 
    65                      "-12.5456 " 
    66                      "-13.2343 -13.9434 " 
    67                      "-14.6729 " 
    68                      "-15.4229 " 
    69                      "-16.1932 -16.9839 " 
    70                      "-17.7951 " 
    71                      "-18.6266 " 
    72                      "-19.4786 " 
    73                      "-20.3509 " 
    74                      "-21.2437 " 
    75                      "-22.1569 " 
    76                      "-23.0905 " 
    77                      "-24.0444 " 
    78                      "-25.0188 " 
    79                      "-26.0136 " 
    80                      "-27.0288 " 
    81                      "-28.0644 " 
    82                      "-29.1205 " 
    83                      "-30.1969 " 
    84                      "-31.2937 " 
    85                      "-32.4109 " 
    86                      "-33.5486 " 
    87                      "-34.7066 " 
    88                      "-35.8851 " 
    89                      "-37.0839 " 
    90                      "-38.3032 " 
    91                      "-39.5429 " 
    92                      "-40.8029 " 
    93                      "-42.0834 " 
    94                      "-43.3843 " 
    95                      "-44.7056 " 
    96                      "-46.0473 " 
    97                      "-47.4094 " 
    98                      "-48.7919 " 
    99                      "-50.1948 " 
    100                      "-51.6182 " 
    101                      "-53.0619 " 
    102                      "-54.526 " 
    103                      "-56.0106 " 
    104                      "-57.5155" ); 
    105         CHECK_CLOSE(exp_f1, l_f1, epsilon); 
     49                     "-6.54622 -6.09219 " 
     50                     "-5.65856 -5.24534 " 
     51                     "-4.85252 -4.48011 -4.1281 " 
     52                     "-3.7965 -3.48531 -3.19452 " 
     53                     "-2.92414 -2.67417 -2.4446 -2.23544 -2.04668 " 
     54                     "-1.87833 -1.73039 -1.60285 -1.49572 -1.40899 -1.34267 -1.29676 -1.27125 -1.26615 -1.28145 -1.31717 -1.37328 -1.4498 -1.54673 -1.66407 -1.80181 -1.95996 " 
     55                     "-2.13851 -2.33747 -2.55683 -2.79661 " 
     56                     "-3.05678 -3.33737 -3.63836 -3.95975 " 
     57                     "-4.30155 -4.66376 " 
     58                     "-5.04638 -5.4494 -5.87282 " 
     59                     "-6.31665 -6.78089 " 
     60                     "-7.26554 -7.77059 " 
     61                     "-8.29604 -8.84191 " 
     62                     "-9.40818 -9.99485 " 
     63                     "-10.6019 " 
     64                     "-11.2294 -11.8773 " 
     65                     "-12.5456 " 
     66                     "-13.2343 -13.9434 " 
     67                     "-14.6729 " 
     68                     "-15.4229 " 
     69                     "-16.1932 -16.9839 " 
     70                     "-17.7951 " 
     71                     "-18.6266 " 
     72                     "-19.4786 " 
     73                     "-20.3509 " 
     74                     "-21.2437 " 
     75                     "-22.1569 " 
     76                     "-23.0905 " 
     77                     "-24.0444 " 
     78                     "-25.0188 " 
     79                     "-26.0136 " 
     80                     "-27.0288 " 
     81                     "-28.0644 " 
     82                     "-29.1205 " 
     83                     "-30.1969 " 
     84                     "-31.2937 " 
     85                     "-32.4109 " 
     86                     "-33.5486 " 
     87                     "-34.7066 " 
     88                     "-35.8851 " 
     89                     "-37.0839 " 
     90                     "-38.3032 " 
     91                     "-39.5429 " 
     92                     "-40.8029 " 
     93                     "-42.0834 " 
     94                     "-43.3843 " 
     95                     "-44.7056 " 
     96                     "-46.0473 " 
     97                     "-47.4094 " 
     98                     "-48.7919 " 
     99                     "-50.1948 " 
     100                     "-51.6182 " 
     101                     "-53.0619 " 
     102                     "-54.526 " 
     103                     "-56.0106 " 
     104                     "-57.5155" ); 
     105        CHECK_CLOSE ( exp_f1, l_f1, epsilon ); 
    106106 
    107107        vec exp_f2 ( "-13.3202 -13.0192 " 
    108                      "-12.7223 -12.4295 -12.1408 " 
    109                      "-11.8561 -11.5755 -11.299 -11.0266 " 
    110                      "-10.7582 -10.494 -10.2338 " 
    111                      "-9.97772 -9.7257 -9.47777 -9.23391 " 
    112                      "-8.99414 -8.75845 -8.52684 -8.29931 -8.07587 " 
    113                      "-7.8565 -7.64122 -7.43002 -7.22289 -7.01985 " 
    114                      "-6.82089 -6.62602 -6.43522 -6.2485 -6.06587 " 
    115                      "-5.88732 -5.71284 -5.54245 -5.37614 -5.21392 -5.05577 " 
    116                      "-4.9017 -4.75172 -4.60581 -4.46399 -4.32625 -4.19259 -4.06301 " 
    117                      "-3.93752 -3.8161 -3.69876 -3.58551 -3.47634 -3.37125 -3.27024 -3.17331 -3.08046 " 
    118                      "-2.99169 -2.90701 -2.8264 -2.74988 -2.67744 -2.60908 -2.5448 -2.4846 -2.42849 -2.37645 -2.3285 -2.28462 -2.24483 -2.20912 -2.17749 -2.14994 -2.12648 -2.10709 -2.09179 -2.08056 -2.07342 -2.07036 -2.07138 -2.07648 -2.08566 -2.09893 -2.11627 -2.1377 -2.16321 -2.1928 -2.22647 -2.26422 -2.30605 -2.35196 -2.40196 -2.45603 -2.51419 -2.57643 -2.64275 -2.71315 -2.78763 -2.8662 -2.94884 " 
    119                      "-3.03557 -3.12637 -3.22126 -3.32023" ); 
    120         CHECK_CLOSE(exp_f2, l_f2, epsilon); 
     108                     "-12.7223 -12.4295 -12.1408 " 
     109                     "-11.8561 -11.5755 -11.299 -11.0266 " 
     110                     "-10.7582 -10.494 -10.2338 " 
     111                     "-9.97772 -9.7257 -9.47777 -9.23391 " 
     112                     "-8.99414 -8.75845 -8.52684 -8.29931 -8.07587 " 
     113                     "-7.8565 -7.64122 -7.43002 -7.22289 -7.01985 " 
     114                     "-6.82089 -6.62602 -6.43522 -6.2485 -6.06587 " 
     115                     "-5.88732 -5.71284 -5.54245 -5.37614 -5.21392 -5.05577 " 
     116                     "-4.9017 -4.75172 -4.60581 -4.46399 -4.32625 -4.19259 -4.06301 " 
     117                     "-3.93752 -3.8161 -3.69876 -3.58551 -3.47634 -3.37125 -3.27024 -3.17331 -3.08046 " 
     118                     "-2.99169 -2.90701 -2.8264 -2.74988 -2.67744 -2.60908 -2.5448 -2.4846 -2.42849 -2.37645 -2.3285 -2.28462 -2.24483 -2.20912 -2.17749 -2.14994 -2.12648 -2.10709 -2.09179 -2.08056 -2.07342 -2.07036 -2.07138 -2.07648 -2.08566 -2.09893 -2.11627 -2.1377 -2.16321 -2.1928 -2.22647 -2.26422 -2.30605 -2.35196 -2.40196 -2.45603 -2.51419 -2.57643 -2.64275 -2.71315 -2.78763 -2.8662 -2.94884 " 
     119                     "-3.03557 -3.12637 -3.22126 -3.32023" ); 
     120        CHECK_CLOSE ( exp_f2, l_f2, epsilon ); 
    121121 
    122122        vec exp_m2 ( "-7.95304 -7.47281 -7.01175 " 
    123                      "-6.56987 -6.14716 " 
    124                      "-5.74362 -5.35927 " 
    125                      "-4.99408 -4.64808 -4.32125 -4.01359 " 
    126                      "-3.72511 -3.45581 -3.20568 " 
    127                      "-2.97473 -2.76295 -2.57035 -2.39692 -2.24267 -2.1076 " 
    128                      "-1.9917 -1.89498 -1.81743 -1.75905 -1.71986 -1.69984 -1.69899 -1.71732 -1.75483 -1.81151 -1.88736 -1.9824 " 
    129                      "-2.0966 -2.22999 -2.38255 -2.55428 -2.74519 -2.95528 " 
    130                      "-3.18454 -3.43298 -3.70059 -3.98738 " 
    131                      "-4.2008 -4.10829 -4.0211 " 
    132                      "-3.93921 -3.86263 -3.79137 -3.72542 -3.66478 -3.60945 -3.55944 -3.51473 -3.47534 -3.44126 -3.41249 -3.38903 -3.37088 -3.35805 -3.35053 -3.34831 -3.35141 -3.35983 -3.37355 -3.39259 -3.41693 -3.44659 -3.48156 -3.52185 -3.56744 -3.61835 -3.67457 -3.73609 -3.80294 -3.87509 -3.95255 " 
    133                      "-4.03533 -4.12342 -4.21682 -4.31553 -4.41955 -4.52889 -4.64353 -4.76349 -4.88876 " 
    134                      "-5.01934 -5.15524 -5.29644 -5.44296 -5.59479 -5.75193 -5.91438 " 
    135                      "-6.08214 -6.25522 -6.4336 -6.6173 -6.80631 " 
    136                      "-7.00064 -7.20027 -7.40522" ); 
    137         CHECK_CLOSE(exp_m2, m2, epsilon); 
     123                     "-6.56987 -6.14716 " 
     124                     "-5.74362 -5.35927 " 
     125                     "-4.99408 -4.64808 -4.32125 -4.01359 " 
     126                     "-3.72511 -3.45581 -3.20568 " 
     127                     "-2.97473 -2.76295 -2.57035 -2.39692 -2.24267 -2.1076 " 
     128                     "-1.9917 -1.89498 -1.81743 -1.75905 -1.71986 -1.69984 -1.69899 -1.71732 -1.75483 -1.81151 -1.88736 -1.9824 " 
     129                     "-2.0966 -2.22999 -2.38255 -2.55428 -2.74519 -2.95528 " 
     130                     "-3.18454 -3.43298 -3.70059 -3.98738 " 
     131                     "-4.2008 -4.10829 -4.0211 " 
     132                     "-3.93921 -3.86263 -3.79137 -3.72542 -3.66478 -3.60945 -3.55944 -3.51473 -3.47534 -3.44126 -3.41249 -3.38903 -3.37088 -3.35805 -3.35053 -3.34831 -3.35141 -3.35983 -3.37355 -3.39259 -3.41693 -3.44659 -3.48156 -3.52185 -3.56744 -3.61835 -3.67457 -3.73609 -3.80294 -3.87509 -3.95255 " 
     133                     "-4.03533 -4.12342 -4.21682 -4.31553 -4.41955 -4.52889 -4.64353 -4.76349 -4.88876 " 
     134                     "-5.01934 -5.15524 -5.29644 -5.44296 -5.59479 -5.75193 -5.91438 " 
     135                     "-6.08214 -6.25522 -6.4336 -6.6173 -6.80631 " 
     136                     "-7.00064 -7.20027 -7.40522" ); 
     137        CHECK_CLOSE ( exp_m2, m2, epsilon ); 
    138138} 
    139139 
     
    142142 
    143143        shared_ptr<merger_base> mb = 
    144                 UI::build<merger_base> ( in, "Merger", UI::compulsory ); 
     144            UI::build<merger_base> ( in, "Merger", UI::compulsory ); 
    145145 
    146146        pdf_array sources; 
     
    148148        mb->set_sources ( sources ); 
    149149 
    150         shared_ptr<rectangular_support> support =  
    151                 UI::build<rectangular_support> ( in, "Support", UI::compulsory ); 
    152         mb->set_support( *support ); 
     150        shared_ptr<rectangular_support> support = 
     151            UI::build<rectangular_support> ( in, "Support", UI::compulsory ); 
     152        mb->set_support ( *support ); 
    153153 
    154154        mb->merge(); 
  • library/tests/testsuite/randun_test.cpp

    r717 r722  
    55using namespace itpp; 
    66 
    7  TEST(test_randun) { 
     7TEST ( test_randun ) { 
    88        // matlab output obtained by 
    99        // >>clear all 
    1010        // >>randun(10); 
    11          vec matlab_out=" 0.695964974209650, 0.083321541586575, 0.385149445564090, 0.206731595660901, 0.537928272754852, 0.960480190795139, 0.790566693893898, 0.054424274738144, 0.708785523990535, 0.558301708920999"; 
     11        vec matlab_out = " 0.695964974209650, 0.083321541586575, 0.385149445564090, 0.206731595660901, 0.537928272754852, 0.960480190795139, 0.790566693893898, 0.054424274738144, 0.708785523990535, 0.558301708920999"; 
    1212 
    1313        //ASSUMING randun was not used yet! 
    14          vec x = randun(10); 
    15          CHECK_CLOSE(matlab_out, x, 1e-6); 
    16  } 
     14        vec x = randun ( 10 ); 
     15        CHECK_CLOSE ( matlab_out, x, 1e-6 ); 
     16} 
    1717 
  • library/tests/testsuite/rectangular_support_test.cpp

    r717 r722  
    2020        CHECK_EQUAL ( 200, rs.points() ); 
    2121 
    22         vec v = rs.get_vec ( ivec ( "1 2") ); 
    23         CHECK_CLOSE (vec ( "0.15 -0.75" ), v, epsilon ); 
     22        vec v = rs.get_vec ( ivec ( "1 2" ) ); 
     23        CHECK_CLOSE ( vec ( "0.15 -0.75" ), v, epsilon ); 
    2424} 
    2525 
  • library/tests/testsuite/rv_test.cpp

    r717 r722  
    88TEST ( rv_test ) { 
    99        RV::clear_all(); 
    10          
     10 
    1111        RV a = RV ( "{a_in_test_rv }", "3" ); 
    1212        CHECK ( a.equal ( a ) ); 
     
    133133                CHECK_EQUAL ( exp_bi[i], bi ( i ) ); 
    134134        } 
    135          
     135 
    136136        // check uniqueness 
    137         RV join=a; 
    138         join.add(b); 
    139         RV tmp=a; tmp.t_plus(1); 
    140         join.add(tmp); 
    141         tmp=b; tmp.t_plus(-1); 
    142         join.add(tmp); 
    143          
    144         CHECK_EQUAL(unique(join._ids()), vec_2(a.id(0), b.id(0))); // find only ids of a and b 
    145         CHECK_EQUAL(unique_complement(join._ids(), vec_1(a.id(0))), vec_1(b.id(0))); // complemnet of a in previous is b 
     137        RV join = a; 
     138        join.add ( b ); 
     139        RV tmp = a; 
     140        tmp.t_plus ( 1 ); 
     141        join.add ( tmp ); 
     142        tmp = b; 
     143        tmp.t_plus ( -1 ); 
     144        join.add ( tmp ); 
     145 
     146        CHECK_EQUAL ( unique ( join._ids() ), vec_2 ( a.id ( 0 ), b.id ( 0 ) ) ); // find only ids of a and b 
     147        CHECK_EQUAL ( unique_complement ( join._ids(), vec_1 ( a.id ( 0 ) ) ), vec_1 ( b.id ( 0 ) ) ); // complemnet of a in previous is b 
    146148 
    147149        //test if unique names work 
    148         RV uniq1("y",1); 
    149         RV uniq2("y",1); 
    150          
    151         CHECK_EQUAL(uniq1.id(0), uniq2.id(0)); 
    152          
     150        RV uniq1 ( "y", 1 ); 
     151        RV uniq2 ( "y", 1 ); 
     152 
     153        CHECK_EQUAL ( uniq1.id ( 0 ), uniq2.id ( 0 ) ); 
     154 
    153155        // check scalarname 
    154         CHECK_EQUAL("a_in_test_rv_2", abc.scalarname(2)); 
    155         CHECK_EQUAL("b_in_test_rv_0", abc.scalarname(3)); 
     156        CHECK_EQUAL ( "a_in_test_rv_2", abc.scalarname ( 2 ) ); 
     157        CHECK_EQUAL ( "b_in_test_rv_0", abc.scalarname ( 3 ) ); 
    156158} 
  • library/tests/testsuite/shared_ptr_test.cpp

    r717 r722  
    9393        bdm::shared_ptr<Foo> empty; 
    9494        try { 
    95                 Foo x(*empty); 
     95                Foo x ( *empty ); 
    9696                CHECK ( false ); 
    9797        } catch ( std::runtime_error &exc ) { 
  • library/tests/testsuite/testsuite.cpp

    r721 r722  
    55#include "itpp_ext.h" 
    66#include <string.h> 
     7#include "../general_suite.h" 
    78 
    8 using std::cout; 
    9 using std::cerr; 
    10 using std::endl; 
    11  
    12 using namespace itpp; 
    13  
    14 Array<const char *> selected_tests; 
    15  
    16 bool is_selected_test ( const UnitTest::Test *test ) { 
    17         bdm_assert_debug ( test, "NULL test" ); 
    18  
    19         if ( !selected_tests.length() ) { 
    20                 return true; 
    21         } 
    22  
    23         for ( int i = 0; i < selected_tests.length(); ++i ) { 
    24                 const char *n = test->m_details.testName; 
    25                 bdm_assert_debug ( n, "NULL test name" ); 
    26                 const char *sname = selected_tests ( i ); 
    27                 bdm_assert_debug ( sname, "NULL selected test name" ); 
    28                 if ( !strcmp ( n, sname ) ) { 
    29                         return true; 
    30                 } 
    31         } 
    32  
    33         return false; 
    34 } 
     9using namespace UnitTest; 
    3510 
    3611int main ( int argc, char const *argv[] ) { 
    3712        if ( argc > 1 ) { 
    38                 if ( !strcmp ( argv[1], "print" ) ) { 
    39                         UnitTest::Test* curTest = UnitTest::Test::GetTestList().GetHead(); 
    40  
    41                         while ( curTest != 0 ) { 
    42                                 const char *n = curTest->m_details.testName; 
    43                                 printf ( "%s\n", n ); 
    44                                 curTest = curTest->next; 
    45                         } 
    46                         return 0; 
    47                 } else { 
    48                         selected_tests.set_length ( argc - 1 ); 
    49                         const char **param = argv + 1; 
    50                         int i = 0; 
    51                         while ( *param ) { 
    52                                 selected_tests ( i ) = *param; 
    53                                 ++i; 
    54                                 ++param; 
    55                         } 
    56                 } 
     13                if ( !strcmp ( argv[1], "print" ) ) 
     14                        print_test_list(); 
     15                else 
     16                        pick_selected_tests ( argc, argv ); 
    5717        } else { 
    58                 cout << endl << "TESTSUITE - a program covering all BDM unit tests." << endl << endl  
    59                      << argv[0] << " ....................................... run all unit tests" << endl  
    60                      << argv[0] << " particular_test_1 particular_test_2 ... run selected unit tests" << endl  
     18                cout << endl << "TESTSUITE - a program covering all BDM unit tests." << endl << endl 
     19                     << argv[0] << " ....................................... run all unit tests" << endl 
     20                     << argv[0] << " particular_test_1 particular_test_2 ... run selected unit tests" << endl 
    6121                     << argv[0] << " print ................................. print all the implemented unit tests" << endl; 
    6222        } 
    6323 
    64         itpp::RNG_randomize(); 
    65  
    66         UnitTest::TestReporterStdout reporter; 
    67         UnitTest::TestRunner runner ( reporter ); 
    68         return runner.RunTestsIf ( UnitTest::Test::GetTestList(), 
    69                                    0, 
    70                                    is_selected_test, 
    71                                    0 ); 
     24        return run_selected_tests(); 
    7225} 
  • library/tests/testsuite/user_info_test.cpp

    r721 r722  
    3333        } 
    3434 
    35 string to_string()  const { 
     35        string to_string()  const { 
    3636                return name; 
    3737        } 
     
    6161        } 
    6262 
    63 string to_string()  const { 
     63        string to_string()  const { 
    6464                stringstream stream; 
    6565                stream << number; 
     
    7777        string manufacturer; 
    7878 
    79         Transport() : year( 1900 ), manufacturer( "unknown" ) { 
     79        Transport() : year ( 1900 ), manufacturer ( "unknown" ) { 
    8080        } 
    8181 
    8282        Transport ( int year, string manufacturer ) : 
    83                 year ( year ), manufacturer ( manufacturer ) { 
     83                        year ( year ), manufacturer ( manufacturer ) { 
    8484        } 
    8585 
     
    128128        } 
    129129 
    130 string to_string()  const { 
     130        string to_string()  const { 
    131131                stringstream stream; 
    132132                stream << "A car made in " << year << " by " << manufacturer << ", having " << kilometers << " kilometers on the clock."; 
     
    163163                int elights; 
    164164                if ( UI::get ( elights, set, "electricLights", UI::optional ) ) { 
    165                     electricLights = !!elights; 
     165                        electricLights = !!elights; 
    166166                } 
    167167 
     
    178178        } 
    179179 
    180 string to_string()  const { 
     180        string to_string()  const { 
    181181                stringstream stream; 
    182182                stream << "a bike made in " << year << " by " << manufacturer; 
  • library/tests/tutorial/arx_simple.cpp

    r682 r722  
    99        ARX Ar; 
    1010        Ar.set_statistics ( 1, V0 ); //nu is default (set to have finite moments) 
    11         Ar.set_constant(true); 
     11        Ar.set_constant ( true ); 
    1212        Ar.validate(); 
    1313        // forgetting is default: 1.0 
  • library/tests/tutorial/kalman_simple.cpp

    r679 r722  
    2323        // Estimation loop 
    2424        for ( int i = 0; i < 100; i++ ) { 
    25                 KF.bayes ( randn ( dy), randn( du ) ); 
     25                KF.bayes ( randn ( dy ), randn ( du ) ); 
    2626        } 
    2727        //print results