Changeset 443

Show
Ignore:
Timestamp:
07/29/09 09:44:15 (15 years ago)
Author:
vbarta
Message:

converted some enorm tests to configurable

Location:
library/tests
Files:
1 added
1 modified

Legend:

Unmodified
Added
Removed
  • library/tests/enorm_test.cpp

    r436 r443  
    22#include "stat/exp_family.h" 
    33#include "stat/emix.h" 
     4#include "epdf_harness.h" 
    45#include "mat_checks.h" 
    56#include "test_util.h" 
     
    3738} 
    3839 
     40template<> 
     41const ParticularUI<enorm<ldmat> > &ParticularUI<enorm<ldmat> >::factory( 
     42    ParticularUI<enorm<ldmat> >("enorm<ldmat>")); 
     43 
     44template<> 
     45const ParticularUI<enorm<fsqmat> > &ParticularUI<enorm<fsqmat> >::factory( 
     46    ParticularUI<enorm<fsqmat> >("enorm<fsqmat>")); 
     47 
    3948TEST(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 
     60TEST(test_enorm_sample) { 
    4061    RNG_randomize(); 
    4162 
     
    4869 
    4970    enorm<ldmat> E; 
    50     E.set_rv(concat(x,y)); 
     71    E.set_rv(concat(x, y)); 
    5172    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); 
    5573 
    5674    int N = 1000; 
     
    86104} 
    87105 
     106#if false 
    88107// from testEpdf 
    89108TEST(test_enorm_sum) { 
     
    112131    CHECK_CLOSE(100, suma, 0.1); 
    113132} 
     133#endif