Changeset 878 for library/tests/testsuite
- Timestamp:
- 03/24/10 14:30:43 (15 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
library/tests/testsuite/epdf_test.cpp
r802 r878 13 13 14 14 TEST ( enorm_test ) { 15 epdf_harness::test_config ( "enorm.cfg" ); 15 epdf_harness::test_config ( "enorm.cfg" ); 16 16 } 17 17 … … 22 22 // not using epdf_harness because eprod isn't configurable (yet?) 23 23 TEST ( eprod_test ) { 24 24 25 25 RV a ( "{eprod_a }", "1" ); 26 26 RV b ( "{eprod_b }", "2" ); 27 27 28 28 egamma_ptr g0; 29 29 g0->set_parameters ( vec ( "2" ), vec ( "2" ) ); 30 g0->validate(); 30 31 g0->set_rv ( a ); 31 32 32 33 egamma_ptr g1; 33 34 g1->set_parameters ( vec ( "100000 10000" ), vec ( "10000 1000" ) ); 35 g1->validate(); 34 36 g1->set_rv ( b ); 35 37 36 38 Array<const epdf*> coms ( 2 ); 37 39 coms ( 0 ) = g0.get(); 38 40 coms ( 1 ) = g1.get(); 39 41 40 42 eprod p; 41 43 // set_parameters doesn't say so, but it actually requires 42 44 // pointers in the array to outlast the eprod instance... 43 45 p.set_parameters ( coms ); 44 46 45 47 CHECK_EQUAL ( vec ( "1 10 10" ), p.mean() ); 46 48 CHECK_EQUAL ( vec ( "0 0 0" ), p.variance() ); … … 51 53 eWishartCh eW; 52 54 eW.set_parameters ( wM / 100, 100 ); 55 eW.validate(); 53 56 mat mea = zeros ( 2, 2 ); 54 57 mat Ch; … … 57 60 mea += Ch.T() * Ch; 58 61 } 59 62 60 63 mat actual = mea / 100; 61 64 CHECK_CLOSE ( wM, actual, 0.1 ); … … 77 80 78 81 } 79 82 80 83 mat observed ( "0.99464 0.885458; 0.885458 1.01853" ); 81 84 mat actual = mea / 100;