Show
Ignore:
Timestamp:
08/14/09 09:03:02 (15 years ago)
Author:
vbarta
Message:

defined *_ptr wrappers of shared pointers

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • library/tests/emix_test.cpp

    r522 r529  
    1 #include "shared_ptr.h" 
    21#include "stat/exp_family.h" 
    32#include "stat/emix.h" 
     
    2019        vec mu0 ( "1.00054 1.0455" ); 
    2120 
    22         shared_ptr<enorm<ldmat> > E1 = new enorm<ldmat>(); 
     21        enorm_ldmat_ptr E1; 
    2322        E1->set_rv ( xy ); 
    2423        E1->set_parameters ( mu0 , mat ( "0.740142 -0.259015; -0.259015 1.0302" ) ); 
    2524 
    26         shared_ptr<enorm<ldmat> > E2 = new enorm<ldmat>(); 
     25        enorm_ldmat_ptr E2; 
    2726        E2->set_rv ( xy ); 
    2827        E2->set_parameters ( "-1.2 -0.1" , mat ( "1 0.4; 0.4 0.5" ) ); 
    2928 
    30         Array<shared_ptr<epdf> > A1 ( 1 ); 
     29        epdf_array A1 ( 1 ); 
    3130        A1 ( 0 ) = E1; 
    3231 
     
    3635 
    3736        // test if ARX and emix with one ARX are the same 
    38         shared_ptr<epdf> Mm = M1.marginal ( y ); 
    39         shared_ptr<epdf> Am = E1->marginal ( y ); 
    40         shared_ptr<mpdf> Mc = M1.condition ( y ); 
    41         shared_ptr<mpdf> Ac = E1->condition ( y ); 
     37        epdf_ptr Mm = M1.marginal ( y ); 
     38        epdf_ptr Am = E1->marginal ( y ); 
     39        mpdf_ptr Mc = M1.condition ( y ); 
     40        mpdf_ptr Ac = E1->condition ( y ); 
    4241 
    4342        mlnorm<ldmat> *wacnd = dynamic_cast<mlnorm<ldmat> *>( Ac.get() ); 
     
    5655 
    5756        // mixture with two components 
    58         Array<shared_ptr<epdf> > A2 ( 2 ); 
     57        epdf_array A2 ( 2 ); 
    5958        A2 ( 0 ) = E1; 
    6059        A2 ( 1 ) = E2; 
     
    8079        check_covariance ( M2, N, observedR, 2.0); 
    8180 
    82         shared_ptr<epdf> Mg = M2.marginal ( y ); 
     81        epdf_ptr Mg = M2.marginal ( y ); 
    8382        CHECK ( Mg.get() ); 
    84         shared_ptr<mpdf> Cn = M2.condition ( x ); 
     83        mpdf_ptr Cn = M2.condition ( x ); 
    8584        CHECK ( Cn.get() ); 
    8685 
     
    9089 
    9190TEST ( test_emix_2 ) { 
    92         int N = 10000; //number of samples 
     91        int N = 10000; // number of samples 
    9392        vec mu0 ( "1.5 1.7" ); 
    9493        mat V0 ( "1.2 0.3; 0.3 5" ); 
    9594        ldmat R = ldmat ( V0 ); 
    9695 
    97         shared_ptr<enorm<ldmat> > eN = new enorm<ldmat>(); 
     96        enorm_ldmat_ptr eN; 
    9897        eN->set_parameters ( mu0, R ); 
    9998 
    10099        vec a = "100000,10000"; 
    101100        vec b = a / 10.0; 
    102         shared_ptr<egamma> eG = new egamma(); 
     101        egamma_ptr eG; 
    103102        eG->set_parameters ( a, b ); 
    104103 
    105104        emix eMix; 
    106         Array<shared_ptr<epdf> > Coms ( 2 ); 
     105        epdf_array Coms ( 2 ); 
    107106        Coms ( 0 ) = eG; 
    108107        Coms ( 1 ) = eN;