Changeset 532
- Timestamp:
- 08/14/09 13:15:00 (15 years ago)
- Location:
- library/bdm/base
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
library/bdm/base/bdmbase.cpp
r527 r532 168 168 } 169 169 170 mat mpdf::samplecond_m (const vec &cond, int N) { 171 mat M( dimension(), N ); 172 for ( int i = 0; i < N; i++ ) { 173 M.set_col ( i, samplecond( cond ) ); 174 } 175 176 return M; 177 } 178 170 179 void mpdf::from_setting ( const Setting &set ) { 171 180 shared_ptr<RV> r = UI::build<RV> ( set, "rv", UI::optional ); -
library/bdm/base/bdmbase.h
r531 r532 121 121 //! Constructor of empty RV 122 122 RV() : dsize (0), len (0), ids (0), times (0) {} 123 123 124 //! Constructor of a single RV with given id 124 125 RV (string name, int sz, int tm = 0); 126 127 // compiler-generated copy constructor is used 125 128 //!@} 126 129 … … 425 428 426 429 //! Returns \param N samples from the density conditioned on \c cond, \f$x \sim epdf(rv|cond)\f$. \param cond is numeric value of \c rv 427 virtual mat samplecond_m (const vec &cond, int N) { 428 mat M(dimension(), N); 429 for(int i=0;i<N;i++){M.set_col(i, samplecond(cond));} 430 return M; 431 } 432 430 virtual mat samplecond_m (const vec &cond, int N); 433 431 434 432 //! Shortcut for conditioning and evaluation of the internal epdf. In some cases, this operation can be implemented efficiently.