Changeset 33 for bdm/stat/libBM.h

Show
Ignore:
Timestamp:
03/05/08 16:01:56 (16 years ago)
Author:
smidl
Message:

Oprava PF a MPF + jejich implementace pro pmsm system

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • bdm/stat/libBM.h

    r32 r33  
    3131        //! len = number of individual rvs 
    3232        int len; 
     33        //! Vector of unique IDs  
    3334        ivec ids; 
     35        //! Vector of sizes 
    3436        ivec sizes; 
     37        //! Vector of shifts from current time 
    3538        ivec times; 
    36         ivec obs; 
     39        //! Array of names 
    3740        Array<std::string> names; 
    3841 
    3942private: 
     43        //! auxiliary function used in constructor 
    4044        void init ( ivec in_ids, Array<std::string> in_names, ivec in_sizes, ivec in_times); 
    4145public: 
     
    7882class fnc { 
    7983protected: 
     84        //! Length of the output vector 
    8085        int dimy; 
    8186public: 
     
    8388        virtual vec eval ( const vec &cond ) { 
    8489                return vec ( 0 ); 
    85         }; //Fixme: virtual? 
     90        };  
    8691 
    8792        //! access function 
     
    97102class epdf { 
    98103protected: 
     104        //! Identified of the random variable 
    99105        RV rv; 
    100106public: 
     
    140146        //! Returns the required moment of the epdf 
    141147//      virtual fnc moment ( const int order = 1 ); 
    142         //! Returns a sample from the density conditioned on \c cond, $x \sim epdf(rv|cond)$. \param ll is a return value of log-likelihood of the sample. 
     148        //! Returns a sample from the density conditioned on \c cond, \f$x \sim epdf(rv|cond)\f$. \param cond is numeric value of \c rv \param ll is a return value of log-likelihood of the sample. 
    143149        virtual vec samplecond ( vec &cond, double &ll ) {this->condition(cond);vec temp= ep->sample();ll=ep->evalpdflog(temp);return temp;}; 
    144  
     150        //! Update \c ep so that it represents this mpdf conditioned on \c rvc = cond 
    145151        virtual void condition ( const vec &cond ) {}; 
    146152         
     153        //! Shortcut for conditioning and evaluation of the internal epdf. In some cases,  this operation can be implemented efficiently. 
    147154        virtual double evalcond (const vec &dt, const vec &cond ) {this->condition(cond);return ep->eval(dt);}; 
    148155 
     
    238245class BMcond { 
    239246protected: 
     247        //! Identificator of the conditioning variable 
    240248        RV rvc; 
    241249public: 
    242250        //! Substitute \c val for \c rvc. 
    243251        virtual void condition ( const vec &val ) =0; 
     252        //! Default constructor 
    244253        BMcond(RV &rv0):rvc(rv0){}; 
     254        //! Destructor for future use 
    245255        virtual ~BMcond(){}; 
     256        //! access function 
    246257        const RV& _rvc() const {return rvc;} 
    247258};