Changeset 1064 for library/tests/testsuite/arx_straux_test.cpp
- Timestamp:
- 06/09/10 14:00:40 (16 years ago)
- Files:
-
- 1 modified
-
library/tests/testsuite/arx_straux_test.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
library/tests/testsuite/arx_straux_test.cpp
r722 r1064 6 6 TEST ( arx_straux_test ) { 7 7 8 UIFile F ( "arx_straux_test.cfg" );8 UIFile F ( "arx_straux_test.cfg" ); 9 9 10 Setting &tests = F.getRoot() ["tests"];11 for ( int i = 0; i < tests.getLength(); i++ ) {12 mat A;13 mat B;14 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 );10 Setting &tests = F.getRoot() ["tests"]; 11 for ( int i = 0; i < tests.getLength(); i++ ) { 12 mat A; 13 mat B; 14 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 ); 18 18 19 19 //when updateing matrices do not forget to update CHECK_EQUAL below!!! 20 20 21 ldmat Ld0 ( 3 );22 Ld0.ldform ( A, ones ( A.rows() ) );23 ldmat Ld1 ( 3 );24 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() ) ); 25 25 26 26 27 ivec belief = vec_1 ( 2 ); // default belief28 int nbest = 3; // nbest: how many regressors are returned29 int nrep = 5; // nrep: number of random repetions of structure estimation30 double lambda = 0.9;31 int k = 2;27 ivec belief = vec_1 ( 2 ); // default belief 28 int nbest = 3; // nbest: how many regressors are returned 29 int nrep = 5; // nrep: number of random repetions of structure estimation 30 double lambda = 0.9; 31 int k = 2; 32 32 33 33 //[strout, rgrsout, statistics] = 34 34 // straux1(L, d, nu, L0, d0, nu0, belief, nbest, max_nrep, lambda, 35 35 // order_k); 36 Array<str_aux> o2;37 ivec o1 = straux1 ( Ld1, 20, Ld0, 10, belief, nbest, nrep, lambda, k, o2 );36 Array<str_aux> o2; 37 ivec o1 = straux1 ( Ld1, 20, Ld0, 10, belief, nbest, nrep, lambda, k, o2 ); 38 38 39 39 //o1 is messed up in matlab's straux 40 sort ( o1_ok );41 sort ( o1 );42 CHECK_EQUAL ( o1_ok, o1 );43 }40 sort ( o1_ok ); 41 sort ( o1 ); 42 CHECK_EQUAL ( o1_ok, o1 ); 43 } 44 44 45 45 }
