Show
Ignore:
Timestamp:
08/12/09 09:27:40 (15 years ago)
Author:
vbarta
Message:

returning shared pointers from epdf::marginal & epdf::condition; testsuite run leaks down from 8402 to 6510 bytes

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • library/tests/mixtures_test.cpp

    r477 r504  
    5353        fsqmat V2 ( mat ( "2 -0.1; -0.1 2" ) ); 
    5454 
    55         enorm<fsqmat> C1; 
    56         C1.set_rv ( x ); 
    57         C1.set_parameters ( m1, V1 ); 
    58         enorm<fsqmat> C2; 
    59         C2.set_rv ( x ); 
    60         C2.set_parameters ( m2, V2 ); 
     55        shared_ptr<enorm<fsqmat> > C1 = new enorm<fsqmat>(); 
     56        C1->set_rv ( x ); 
     57        C1->set_parameters ( m1, V1 ); 
     58        shared_ptr<enorm<fsqmat> > C2 = new enorm<fsqmat>(); 
     59        C2->set_rv ( x ); 
     60        C2->set_parameters ( m2, V2 ); 
    6161 
    62         Array<epdf*> Sim ( 2 ); 
    63         Sim ( 0 ) = &C1; 
    64         Sim ( 1 ) = &C2; 
     62        Array<shared_ptr<epdf> > Sim ( 2 ); 
     63        Sim ( 0 ) = C1; 
     64        Sim ( 1 ) = C2; 
    6565        emix Simul; 
    6666        Simul.set_rv ( x ); 
    67         Simul.set_parameters ( "0.5 0.6", Sim, false ); 
     67        Simul.set_parameters ( "0.5 0.6", Sim ); 
    6868 
    6969        // Sample parameters