Changeset 443
- Timestamp:
- 07/29/09 09:44:15 (15 years ago)
- Location:
- library/tests
- Files:
-
- 1 added
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
library/tests/enorm_test.cpp
r436 r443 2 2 #include "stat/exp_family.h" 3 3 #include "stat/emix.h" 4 #include "epdf_harness.h" 4 5 #include "mat_checks.h" 5 6 #include "test_util.h" … … 37 38 } 38 39 40 template<> 41 const ParticularUI<enorm<ldmat> > &ParticularUI<enorm<ldmat> >::factory( 42 ParticularUI<enorm<ldmat> >("enorm<ldmat>")); 43 44 template<> 45 const ParticularUI<enorm<fsqmat> > &ParticularUI<enorm<fsqmat> >::factory( 46 ParticularUI<enorm<fsqmat> >("enorm<fsqmat>")); 47 39 48 TEST(test_enorm) { 49 RV::clear_all(); 50 UIFile in("enorm.cfg"); 51 Array<epdf_harness *> input; 52 UI::get(input, in, "data"); 53 int sz = input.size(); 54 CHECK(sz > 0); 55 for (int i = 0; i < sz; ++i) { 56 input(i)->test(); 57 } 58 } 59 60 TEST(test_enorm_sample) { 40 61 RNG_randomize(); 41 62 … … 48 69 49 70 enorm<ldmat> E; 50 E.set_rv(concat(x, y));71 E.set_rv(concat(x, y)); 51 72 E.set_parameters(mu, R); 52 CHECK_EQUAL(mu, E.mean());53 CHECK_CLOSE(2.11768, E.lognc(), epsilon);54 CHECK_CLOSE(1.0, normcoef(&E, vec("-5 5"), vec("-5 5")), 0.01);55 73 56 74 int N = 1000; … … 86 104 } 87 105 106 #if false 88 107 // from testEpdf 89 108 TEST(test_enorm_sum) { … … 112 131 CHECK_CLOSE(100, suma, 0.1); 113 132 } 133 #endif