work/mixpp/bdm/stat/libBM.h

Go to the documentation of this file.
00001 
00013 #ifndef BM_H
00014 #define BM_H
00015 
00016 #include <itpp/itbase.h>
00017 //#include <std>
00018 
00019 using namespace itpp;
00020 
00026 class RV {
00028         int size;
00030         int len;
00031         ivec ids;
00032         ivec sizes;
00033         ivec times;
00034         ivec obs;
00035         Array<std::string> names;
00036 
00037 private:
00038         void init ( ivec in_ids, Array<std::string> in_names, ivec in_sizes, ivec in_times, ivec in_obs );
00039 public:
00041         RV ( ivec in_ids, Array<std::string> in_names, ivec in_sizes, ivec in_times, ivec in_obs );
00043         RV ( ivec ids );
00045         RV ();
00046         
00048         friend std::ostream &operator<< ( std::ostream &os, const RV &rv );
00049 
00051         int count() const {return size;} ;
00052         //TODO why not inline and later??
00053         
00055         ivec find(RV rv2);
00057         RV add(RV rv2);
00059         RV subt(RV rv2);
00061         RV subselect(ivec ind);
00063         RV operator()(ivec ind);
00065         void t(int delta);
00067         ivec indexlist();
00068 };
00069 
00070 
00071 
00072 
00074 class fnc {
00075         int dimy;
00076 public: 
00078         virtual vec eval(const vec &cond){}; //Fixme: virtual?
00080         int _dimy()const{return dimy;}
00081 };
00082 
00084 class BM {
00085 public:
00087         double ll;
00088 
00090         BM(){ll=0;};
00091         
00096         virtual void bayes ( const vec &dt, bool evall=true ) = 0;
00098         void bayes ( mat Dt );
00099 };
00100 
00102 class epdf {
00103         RV rv;
00104 public:
00106 //      virtual vec moment ( const int order = 1 );
00108         virtual vec sample ()=0;
00110         virtual double eval(const vec &val){};
00111 };
00112 
00114 class mpdf {
00116         RV rv;
00118         RV rvc;
00119 public:
00120 
00122 //      virtual fnc moment ( const int order = 1 );
00124         virtual vec samplecond (vec &cond, double lik){};
00125         virtual void condition (vec &cond){};
00126 };
00127 
00134 class DS {
00135 protected:
00137         RV Drv; 
00139         RV Urv; //
00140 public:
00142         void getdata(vec &dt);
00144         void getdata(vec &dt, ivec &indeces);
00146         void write(vec &ut);
00148         void write(vec &ut, ivec &indeces);
00154         void linkrvs(RV &drv, RV &urv);
00155         
00157         void step();
00158 };
00159 
00160 
00161 #endif // BM_H

Generated on Sun Feb 17 16:14:14 2008 for mixpp by  doxygen 1.5.3