Changeset 536 for library/bdm/base/bdmbase.h
- Timestamp:
- 08/16/09 18:13:31 (15 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
library/bdm/base/bdmbase.h
r532 r536 29 29 30 30 typedef std::map<string, int> RVmap; 31 //! Internal global variable storing sizes of RVs 31 32 extern ivec RV_SIZES; 33 //! Internal global variable storing names of RVs 32 34 extern Array<string> RV_NAMES; 33 35 … … 160 162 } 161 163 //!@} 162 163 //TODO why not inline and later??164 164 165 165 //! \name Algebra on Random Variables … … 192 192 //!@{ 193 193 194 //! generate \c str from rv, by expanding sizes TODO to_string..194 //! generate \c str from rv, by expanding sizes 195 195 str tostr() const; 196 196 //! when this rv is a part of bigger rv, this function returns indices of self in the data vector of the bigger crv. … … 223 223 224 224 // TODO dodelat void to_setting( Setting &set ) const; 225 226 225 //! Invalidate all named RVs. Use before initializing any RV instances, with care... 227 226 static void clear_all(); … … 391 390 SHAREDPTR(epdf); 392 391 393 //! Conditional probability density, e.g. modeling some dependencies. 394 //TODO Samplecond can be generalized 392 //! Conditional probability density, e.g. modeling \f$ f( x | y) \f$, where \f$ x \f$ is random variable, \c rv, and \f$ y \f$ is conditioning variable, \c rvc. 395 393 class mpdf : public root 396 394 { … … 405 403 406 404 protected: 405 //! set internal pointer \c ep to point to given \c iepdf 407 406 void set_ep (epdf &iepdf) { 408 407 ep = &iepdf; 409 408 } 409 //! set internal pointer \c ep to point to given \c iepdf 410 410 void set_ep (epdf *iepdfp) { 411 411 ep = iepdfp; … … 487 487 SHAREDPTR(mpdf); 488 488 489 //! Mpdf with internal epdf that is modified by function \c condition 489 490 template <class EPDF> 490 491 class mpdf_internal: public mpdf 491 492 { 492 493 protected : 494 //! Internal epdf used for sampling 493 495 EPDF iepdf; 494 496 public: … … 555 557 //! Constructor 556 558 datalink() : downsize (0), upsize (0) { } 559 //! Conevnience constructor 557 560 datalink (const RV &rv, const RV &rv_up) { 558 561 set_connection (rv, rv_up); … … 607 610 //! Constructor 608 611 datalink_m2e() : condsize (0) { } 609 612 //! Set connection between vectors 610 613 void set_connection (const RV &rv, const RV &rvc, const RV &rv_up) { 611 614 datalink::set_connection (rv, rv_up); … … 621 624 return tmp; 622 625 } 623 626 //! Copy corresponding values to Up.condition 624 627 void pushup_cond (vec &val_up, const vec &val, const vec &cond) { 625 628 it_assert_debug (downsize == val.length(), "Wrong val"); … … 643 646 //! Constructor 644 647 datalink_m2m() {}; 648 //! Set connection between the vectors 645 649 void set_connection (const RV &rv, const RV &rvc, const RV &rv_up, const RV &rvc_up) { 646 650 datalink_m2e::set_connection (rv, rvc, rv_up); … … 713 717 class mepdf : public mpdf 714 718 { 715 719 //! Internal shared pointer to epdf 716 720 shared_ptr<epdf> iepdf; 717 721 public: 718 722 //!Default constructor 719 723 mepdf() { } 720 724 //! Set internal shared pointer 721 725 mepdf (shared_ptr<epdf> em) { 722 726 iepdf = em; … … 893 897 return NULL; 894 898 }; 895 //!Constructs a conditional density 1-step ahead predictor \f$ f(d_{t+1} |d_{t+h-1}, \ldots d_{t})899 //!Constructs conditional density of 1-step ahead predictor \f$ f(d_{t+1} |d_{t+h-1}, \ldots d_{t}) \f$ 896 900 virtual mpdf* predictor() const { 897 901 it_error ("Not implemented"); … … 939 943 } 940 944 virtual const epdf& posterior() const = 0; 941 virtual const epdf* _e() const = 0;942 945 //!@} 943 946