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/bdm/stat/merger.cpp

    r487 r504  
    157157                                if ( mpdfs ( i )->dimensionc() > 0 ) { 
    158158                                        // Make marginal on rvc_i 
    159                                         epdf* tmp_marg = Mpred->marginal ( mpdfs ( i )->_rvc() ); 
     159                                        shared_ptr<epdf> tmp_marg = Mpred->marginal ( mpdfs ( i )->_rvc() ); 
    160160                                        //compute vector of lw_src 
    161161                                        for ( int k = 0; k < Npoints; k++ ) { 
     
    163163                                                lw_src ( k ) += tmp_marg->evallog ( dls ( i )->get_cond ( Smp ( k ) ) ); 
    164164                                        } 
    165                                         delete tmp_marg; 
    166165 
    167166//                                      sprintf ( str,"marg%d",niter ); 
     
    173172                                        /////////////// 
    174173                                        // There are variales unknown to mpdfs(i) : rvzs 
    175                                         mpdf* tmp_cond = Mpred->condition ( rvzs ( i ) ); 
     174                                        shared_ptr<mpdf> tmp_cond = Mpred->condition ( rvzs ( i ) ); 
    176175                                        // Compute likelihood 
    177176                                        vec lw_dbg = lw_src; 
     
    186185                                                } 
    187186                                        } 
    188                                         delete tmp_cond; 
    189187                                } 
    190188                                // Compute likelihood of the partial source