Changeset 527 for library/bdm/base/datasources.h
- Timestamp:
- 08/13/09 15:58:32 (15 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
library/bdm/base/datasources.h
r477 r527 173 173 }; 174 174 //! Set 175 void set_drv ( RV &yrv, RV &urv,RV &rrv ) {175 void set_drv ( const RV &yrv, const RV &urv, const RV &rrv ) { 176 176 Rrv = rrv; 177 177 Urv = urv; … … 265 265 266 266 class stateDS : public DS { 267 private: 268 //!conditional pdf of the state evolution \f$ f(x_t|x_{t-1}) \f$ 269 shared_ptr<mpdf> IM; 270 271 //!conditional pdf of the observations \f$ f(d_t|x_t) \f$ 272 shared_ptr<mpdf> OM; 273 267 274 protected: 268 //!conditional pdf of the state evolution \f$ f(x_t|x_{t-1}) \f$269 mpdf* IM;270 //!conditional pdf of the observations \f$ f(d_t|x_t) \f$271 mpdf* OM;272 275 //! result storage 273 276 vec dt; … … 278 281 //! Logger 279 282 int L_xt; 283 280 284 public: 281 285 void getdata ( vec &dt0 ) { … … 286 290 } 287 291 288 stateDS ( mpdf* IM0, mpdf* OM0, int usize ) : DS ( ), IM ( IM0 ), OM ( OM0 ), 289 dt ( OM0->dimension() ), xt ( IM0->dimension() ), ut ( usize ) {} 290 291 stateDS() {} 292 293 ~stateDS() { 294 delete IM; 295 delete OM; 296 } 292 stateDS ( const shared_ptr<mpdf> &IM0, const shared_ptr<mpdf> &OM0, int usize ) : IM ( IM0 ), OM ( OM0 ), 293 dt ( OM0->dimension() ), xt ( IM0->dimension() ), 294 ut ( usize ), L_xt(0) { } 295 296 stateDS() : L_xt(0) { } 297 297 298 virtual void step() { 298 299 xt = IM->samplecond ( concat ( xt, ut ) ); 299 300 dt = OM->samplecond ( concat ( xt, ut ) ); 300 } ;301 } 301 302 302 303 virtual void log_add ( logger &L ) {