root/tests/merger_test.cpp @ 194

Revision 182, 1.0 kB (checked in by smidl, 16 years ago)

compilation error!

Line 
1#include <itpp/itbase.h>
2#include <stat/libEF.h>
3#include <estim/merger.h>
4
5using namespace itpp;
6
7//These lines are needed for use of cout and endl
8using std::cout;
9using std::endl;
10
11int main() {
12
13        RV x ( "{x }","1" );
14
15        RV z(x);
16       
17        enorm<fsqmat> f1 ( x );
18        enorm<fsqmat> f2 ( x );
19
20        f1.set_parameters ( "-5",mat ( "2" ) );
21        f2.set_parameters ( "5",mat ( "10" ) );
22
23        Array<mpdf* > A ( 2 );
24        mepdf A1(f1);
25        mepdf A2(f2);
26        A ( 0 ) =&A1;
27        A ( 1 ) =&A2;
28       
29        int Npoints=100;
30        mat x_grid ( 1,Npoints );
31        x_grid.set_row ( 0,linspace ( -10.0, 10.0 ) );
32
33        vec l_f1=f1.evalpdflog_m ( x_grid );
34
35        vec l_f2=f2.evalpdflog_m ( x_grid );
36        mat lW(2,Npoints);
37        lW.set_row(0, l_f1);
38        lW.set_row(1, l_f2 );
39
40        merger M ( A );
41        enorm<fsqmat> g0(x);
42        g0.set_parameters(vec("0.0"),mat("100.0"));
43       
44        M.set_parameters(1.2,1000,3);
45        M.merge(&g0);
46       
47        vec m2 = M.lognorm_merge(lW);
48        vec mm2 = M.evalpdflog_m(x_grid);
49       
50        it_file it("merger_test.it");
51        it << Name("lf1") << l_f1;
52        it << Name("lf2") << l_f2;
53        it << Name("m2") << m2;
54        it << Name("mm2") << mm2;
55}
Note: See TracBrowser for help on using the browser.