Changeset 204 for bdm/stat/emix.h
- Timestamp:
- 11/10/08 15:40:29 (16 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
bdm/stat/emix.h
r193 r204 47 47 //!Default constructor. By default, the given epdf is not copied! 48 48 //! It is assumed that this function will be used only temporarily. 49 mratio ( const epdf* nom0, const RV &rv, bool copy=false ) :mpdf ( rv,nom0->_rv().subt (rv) ), dl(rv,rvc,nom0->_rv()) {49 mratio ( const epdf* nom0, const RV &rv, bool copy=false ) :mpdf ( rv,nom0->_rv().subt ( rv ) ), dl ( rv,rvc,nom0->_rv() ) { 50 50 if ( copy ) { 51 51 // nom = nom0->_copy_(); 52 it_error ("todo");52 it_error ( "todo" ); 53 53 destroynom=true; 54 54 } … … 61 61 }; 62 62 double evalcond ( const vec &val, const vec &cond ) { 63 vec nom_val (rv.count()+rvc.count());64 dl.fill_val_cond (nom_val,val,cond);63 vec nom_val ( rv.count() +rvc.count() ); 64 dl.fill_val_cond ( nom_val,val,cond ); 65 65 return exp ( nom->evalpdflog ( nom_val ) - den->evalpdflog ( cond ) ); 66 66 } … … 132 132 //! Auxiliary function for taking ownership of the Coms() 133 133 void ownComs() {destroyComs=true;} 134 134 135 135 //!access function 136 epdf* _Coms (int i){return Coms(i);}136 epdf* _Coms ( int i ) {return Coms ( i );} 137 137 }; 138 138 … … 175 175 // add logarithms 176 176 res += epdfs ( i )->evalpdflog ( dls ( i )->get_val ( val ) );*/ 177 res *= mpdfs ( i )->evalcond ( 178 179 dls ( i )->get_cond ( val, cond )180 177 res *= mpdfs ( i )->evalcond ( 178 dls ( i )->get_val ( val ), 179 dls ( i )->get_cond ( val, cond ) 180 ); 181 181 } 182 182 return res; … … 222 222 independent=rv.add ( epdfs ( i )->_rv() ); 223 223 it_assert_debug ( independent==true, "eprod:: given components are not independent ." ); 224 dls ( i ) = new datalink_e2e( epdfs ( i )->_rv() , rv ); 224 } 225 for ( int i=0;i<epdfs.length();i++ ) { 226 dls ( i ) = new datalink_e2e ( epdfs ( i )->_rv() , rv ); 225 227 } 226 228 } … … 230 232 for ( int i=0;i<epdfs.length();i++ ) { 231 233 vec pom = epdfs ( i )->mean(); 232 dls (i)->fill_val(tmp, pom );234 dls ( i )->fill_val ( tmp, pom ); 233 235 } 234 236 return tmp; … … 238 240 for ( int i=0;i<epdfs.length();i++ ) { 239 241 vec pom = epdfs ( i )->sample(); 240 dls (i)->fill_val(tmp, pom );242 dls ( i )->fill_val ( tmp, pom ); 241 243 } 242 244 return tmp; … … 245 247 double tmp=0; 246 248 for ( int i=0;i<epdfs.length();i++ ) { 247 tmp+=epdfs ( i )->evalpdflog ( dls (i)->get_val ( val ) );249 tmp+=epdfs ( i )->evalpdflog ( dls ( i )->get_val ( val ) ); 248 250 } 249 251 return tmp; … … 251 253 //!access function 252 254 const epdf* operator () ( int i ) const {it_assert_debug ( i<epdfs.length(),"wrong index" );return epdfs ( i );} 253 255 254 256 //!Destructor 255 ~eprod() {for(int i=0;i<epdfs.length();i++){delete dls(i);}}257 ~eprod() {for ( int i=0;i<epdfs.length();i++ ) {delete dls ( i );}} 256 258 }; 257 259