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 protected:
00076         int dimy;
00077 public: 
00079         virtual vec eval(const vec &cond){}; //Fixme: virtual?
00081         int _dimy()const{return dimy;}
00082 };
00083 
00087 class BM {
00088 public:
00090         double ll;
00092         bool evalll;
00093 
00095         BM():ll(0),evall(true){};
00096         
00100         virtual void bayes ( const vec &dt) = 0;
00102         void bayes ( mat Dt );
00104         epdf* _epdf();
00105 };
00106 
00108 class epdf {
00109         RV rv;
00110 public:
00112 //      virtual vec moment ( const int order = 1 );
00114         virtual vec sample ()=0;
00116         virtual double eval(const vec &val){};
00117 };
00118 
00120 class mpdf {
00122         RV rv;
00124         RV rvc;
00125 public:
00126 
00128 //      virtual fnc moment ( const int order = 1 );
00130         virtual vec samplecond (vec &cond, double lik){};
00131         virtual void condition (vec &cond){};
00132 };
00133 
00140 class DS {
00141 protected:
00143         RV Drv; 
00145         RV Urv; //
00146 public:
00148         void getdata(vec &dt);
00150         void getdata(vec &dt, ivec &indeces);
00152         void write(vec &ut);
00154         void write(vec &ut, ivec &indeces);
00160         void linkrvs(RV &drv, RV &urv);
00161         
00163         void step();
00164 };
00165 
00166 
00167 #endif // BM_H

Generated on Mon Feb 18 21:48:39 2008 for mixpp by  doxygen 1.5.3