root/tests/merger_test.cpp @ 262

Revision 262, 1.0 kB (checked in by smidl, 15 years ago)

cleanup of include files

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