Changeset 660

Show
Ignore:
Timestamp:
10/15/09 00:04:30 (15 years ago)
Author:
smidl
Message:

doc - doxygen warnings

Location:
library
Files:
17 modified

Legend:

Unmodified
Added
Removed
  • library/Doxyfile

    r617 r660  
    564564# to stderr. 
    565565 
    566 WARN_LOGFILE           =  
     566WARN_LOGFILE           = doxwarn.txt 
    567567 
    568568#--------------------------------------------------------------------------- 
     
    601601                         *.hxx \ 
    602602                         *.dox \ 
    603                          *.m \ 
    604603                         *.doc 
    605604 
     
    616615EXCLUDE                = system \ 
    617616                         .git \ 
     617                         bdm/dirent.h \ 
     618                         bdm/dirent.c \ 
    618619                         applications \ 
    619620                         bdm/base/libconfig \ 
    620                         tests 
     621                        tests 
    621622 
    622623# The EXCLUDE_SYMLINKS tag can be used select whether or not files or  
     
    648649EXAMPLE_PATH           = ./doc/tutorial/src \ 
    649650                         ./tests \ 
    650                          ./tests/tutorial \ 
    651                          ./library/tutorial \ 
    652                          ./library/mex 
    653  
     651                         ./tests/tutorial  
     652                                                                  
    654653# If the value of the EXAMPLE_PATH tag contains directories, you can use the  
    655654# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp  
  • library/bdm/base/bdmbase.h

    r652 r660  
    238238                return tmp; 
    239239        } 
    240         //! return rvs with expanded delayes and sorted in the order of: \f$ [ rv_{0}, rv_{-1}, rv_{ 
     240        //! return rvs with expanded delayes and sorted in the order of: \f$ [ rv_{0}, rv_{-1},\ldots  rv_{max_delay}]\f$ 
    241241        RV expand_delayes() const { 
    242242                RV rvt = this->remove_time(); //rv at t=0 
     
    764764class datalink_2to1_buffered { 
    765765protected: 
     766        //! link 1st vector to down 
    766767        datalink_buffered dl1; 
     768        //! link 2nd vector to down 
    767769        datalink_buffered dl2; 
    768770public: 
     
    772774                dl2.set_connection ( rv, rv_up2 ); 
    773775        } 
     776        //! fill values of down from the values of the two up vectors 
    774777        void filldown ( const vec &val1, const vec &val2, vec &val_down ) { 
    775778                bdm_assert_debug ( val_down.length() >= dl1._downsize() + dl2._downsize(), "short val_down" ); 
     
    777780                dl2.filldown ( val2, val_down ); 
    778781        } 
     782        //! update buffer 
    779783        void step ( const vec &dt, const vec &ut ) { 
    780784                dl1.step ( dt ); 
     
    962966                //!Description of output data 
    963967                RV Yrv; // 
    964         //! Remember its own index in Logger L 
    965         int L_dt, L_ut; 
     968        //! Remember its own index in Logger L, [0=dt, 1=ut] 
     969        ivec LIDs; 
    966970public: 
    967971        //! default constructors 
    968                 DS() : Drv(), Urv(),Yrv() {}; 
     972                DS() : Drv(), Urv(),Yrv(), LIDs(2) {}; 
    969973 
    970974        //! Returns maximum number of provided data, by default it is set to maximum allowed length, shorter DS should overload this method! See, MemDS.max_length(). 
     
    980984 
    981985        //! Accepts action variable and schedule it for application. 
    982         virtual void write ( vec &ut ) { 
     986        virtual void write (const vec &ut ) { 
    983987                bdm_error ( "abstract class" ); 
    984988        } 
    985989 
    986990        //! Accepts action variables at specific indeces 
    987         virtual void write ( vec &ut, const ivec &indeces ) { 
     991        virtual void write (const vec &ut, const ivec &indeces ) { 
    988992                bdm_error ( "abstract class" ); 
    989993        } 
     
    10001004                bdm_assert ( utsize == Urv._dsize(), "invalid DS: utsize (" + num2str ( utsize ) + ") different from Urv " + num2str ( Urv._dsize() ) ); 
    10011005 
    1002                 L_dt = L.add ( Drv, "" ); 
    1003                 L_ut = L.add ( Urv, "" ); 
     1006                LIDs(0) = L.add ( Drv, "" ); 
     1007                LIDs(1) = L.add ( Urv, "" ); 
    10041008        } 
    10051009        //! Register DS for logging into logger L 
     
    10081012                getdata ( tmp ); 
    10091013                // d is first in getdata 
    1010                 L.logit ( L_dt, tmp.left ( Drv._dsize() ) ); 
     1014                L.logit ( LIDs(0), tmp.left ( Drv._dsize() ) ); 
    10111015                // u follows after d in getdata 
    1012                 L.logit ( L_ut, tmp.mid ( Drv._dsize(), Urv._dsize() ) ); 
     1016                L.logit ( LIDs(1), tmp.mid ( Drv._dsize(), Urv._dsize() ) ); 
    10131017        } 
    10141018        //!access function 
     
    10721076        }; 
    10731077        BM ( const BM &B ) :  drv ( B.drv ), ll ( B.ll ), evalll ( B.evalll ) {} 
    1074         //! Copy function required in vectors, Arrays of BM etc. Have to be DELETED manually! 
     1078        //! \brief Copy function required in vectors, Arrays of BM etc. Have to be DELETED manually! 
    10751079        //! Prototype: \code BM* _copy_() const {return new BM(*this);} \endcode 
    10761080        virtual BM* _copy_() const { 
     
    11381142        //! \name Access to attributes 
    11391143        //!@{ 
    1140  
     1144        //! access function 
    11411145        const RV& _drv() const { 
    11421146                return drv; 
    11431147        } 
     1148        //! access function 
    11441149        void set_drv ( const RV &rv ) { 
    11451150                drv = rv; 
    11461151        } 
     1152        //! access to rv of the posterior 
    11471153        void set_rv ( const RV &rv ) { 
    11481154                const_cast<epdf&> ( posterior() ).set_rv ( rv ); 
    11491155        } 
     1156        //! return internal log-likelihood of the last data vector 
    11501157        double _ll() const { 
    11511158                return ll; 
    11521159        } 
     1160        //! switch evaluation of log-likelihood on/off 
    11531161        void set_evalll ( bool evl0 ) { 
    11541162                evalll = evl0; 
    11551163        } 
     1164        //! return posterior density 
    11561165        virtual const epdf& posterior() const = 0; 
    11571166        //!@} 
     
    12161225 
    12171226}; 
    1218  
     1227//! array of pointers to epdf 
    12191228typedef Array<shared_ptr<epdf> > epdf_array; 
    1220  
     1229//! array of pointers to mpdf 
    12211230typedef Array<shared_ptr<mpdf> > mpdf_array; 
    12221231 
  • library/bdm/base/datasources.cpp

    r609 r660  
    2828} 
    2929 
    30 void MemDS::set_rvs ( RV &drv, RV &urv ) { 
     30void MemDS::set_drv (const RV &drv, const RV &urv ) { 
    3131        bdm_assert_debug ( drv._dsize() == rowid.length(), "MemDS::set_rvs incompatible drv" ); 
    3232        bdm_assert_debug ( urv._dsize() == 0, "MemDS does not support urv." ); 
    3333 
    34         Drv = drv; 
     34        DS::set_drv(drv,urv); 
    3535} 
    3636 
     
    4242} 
    4343 
    44 void ArxDS::step() { 
    45         //shift history 
    46         H.shift_right ( 0, dt_size ); 
    47  
    48         H.set_subvector ( dt_size - utsize, U ); // write U after Drv 
    49  
    50         //get regressor 
    51         rgr = rgrlnk.pushdown ( H ); 
    52         // Eval Y 
    53         H.set_subvector ( 0, model.samplecond ( rgr ) ); 
    54  
    55 } 
    56  
    57 void ArxDS::from_setting ( const Setting &set ) { 
    58         shared_ptr<RV> yrv = UI::build<RV> ( set, "y" , UI::compulsory ); 
    59         shared_ptr<RV> urv = UI::build<RV> ( set, "u" , UI::compulsory ); 
    60         shared_ptr<RV> rrv = UI::build<RV> ( set, "rgr" , UI::compulsory ); 
    61  
    62         mat Th; 
    63         UI::get ( Th, set, "theta", UI::compulsory ); 
    64  
    65         vec mu0; 
    66         if ( !UI::get ( mu0, set, "offset" ) ) 
    67                 mu0 = zeros ( yrv->_dsize() ); 
    68  
    69         mat sqR; 
    70         UI::get ( sqR, set, "r", UI::compulsory ); 
    71         set_parameters ( Th, mu0, sqR ); 
    72         set_drv ( *yrv, *urv, *rrv ); 
    73  
    74         if ( set.exists ( "opt" ) ) 
    75                 set_options ( set["opt"] ); 
    76 } 
     44// void ArxDS::step() { 
     45//      //shift history 
     46//      H.shift_right ( 0, dt_size ); 
     47//  
     48//      H.set_subvector ( dt_size - utsize, U ); // write U after Drv 
     49//  
     50//      //get regressor 
     51//      rgr = rgrlnk.pushdown ( H ); 
     52//      // Eval Y 
     53//      H.set_subvector ( 0, model.samplecond ( rgr ) ); 
     54//  
     55// } 
     56//  
     57// void ArxDS::from_setting ( const Setting &set ) { 
     58//      shared_ptr<RV> yrv = UI::build<RV> ( set, "y" , UI::compulsory ); 
     59//      shared_ptr<RV> urv = UI::build<RV> ( set, "u" , UI::compulsory ); 
     60//      shared_ptr<RV> rrv = UI::build<RV> ( set, "rgr" , UI::compulsory ); 
     61//  
     62//      mat Th; 
     63//      UI::get ( Th, set, "theta", UI::compulsory ); 
     64//  
     65//      vec mu0; 
     66//      if ( !UI::get ( mu0, set, "offset" ) ) 
     67//              mu0 = zeros ( yrv->_dsize() ); 
     68//  
     69//      mat sqR; 
     70//      UI::get ( sqR, set, "r", UI::compulsory ); 
     71//      set_parameters ( Th, mu0, sqR ); 
     72//      set_drv ( *yrv, *urv, *rrv ); 
     73//  
     74//      if ( set.exists ( "opt" ) ) 
     75//              set_options ( set["opt"] ); 
     76// } 
    7777 
    7878CsvFileDS::CsvFileDS ( const string& fname, const string& orientation ) : FileDS() { 
  • library/bdm/base/datasources.h

    r618 r660  
    4040                void getdata ( vec &dt ); 
    4141                void getdata ( vec &dt, const ivec &indeces ); 
    42                 void set_rvs ( RV &drv, RV &urv ); 
    43  
    44                 void write ( vec &ut ) { 
     42                void set_drv (const RV &drv,const RV &urv ); 
     43 
     44                void write ( const vec &ut ) { 
    4545                        bdm_error ( "MemDS::write is not supported" ); 
    4646                } 
    4747 
    48                 void write ( vec &ut, ivec &indices ) { 
     48                void write ( const vec &ut, const ivec &indices ) { 
    4949                        bdm_error ( "MemDS::write is not supported" ); 
    5050                } 
     
    5353                //!Default constructor 
    5454                MemDS () {}; 
     55                //! Convenience constructor 
    5556                MemDS ( mat &Dat, ivec &rowid0); 
    5657                /*! Create object from the following structure 
     
    114115                        dt_out = dt ( ids ); 
    115116                } 
    116                 const RV& _drv() { 
     117                const RV& _drv() const { 
    117118                        return iepdf->_rv(); 
    118119                } 
     
    262263 
    263264        public: 
     265                //! Convenience constructor 
    264266                ITppFileDS ( const string &fname, const string &varname ) : FileDS() { 
    265267                        it_file it ( fname ); 
     
    298300 
    299301 
    300 /*! 
    301 \brief Generator of ARX data 
    302  
    303 */ 
    304 class ArxDS : public DS { 
    305         protected: 
    306                 //! Rv of the regressor 
    307                 RV Rrv; 
    308                 //! History, ordered as \f$[y_t, u_t, y_{t-1 }, u_{t-1}, \ldots]\f$ 
    309                 vec H; 
    310                 //! (future) input 
    311                 vec U; 
    312                 //! temporary variable for regressor 
    313                 vec rgr; 
    314                 //! data link: H -> rgr 
    315                 datalink rgrlnk; 
    316                 //! model of Y - linear Gaussian 
    317                 mlnorm<chmat> model; 
    318                 //! options 
    319                 bool opt_L_theta; 
    320                 //! loggers 
    321                 int L_theta; 
    322                 int L_R; 
    323                 int dt_size; 
    324         public: 
    325                 void getdata ( vec &dt ) { 
    326                         dt = H; 
    327                 } 
    328  
    329                 void getdata ( vec &dt, const ivec &indices ) { 
    330                         dt = H ( indices ); 
    331                 } 
    332  
    333                 void write ( vec &ut ) { 
    334                         U = ut; 
    335                 } 
    336  
    337                 void write ( vec &ut, const ivec &indices ) { 
    338                         bdm_assert_debug ( ut.length() == indices.length(), "ArxDS" ); 
    339                         set_subvector ( U, indices, ut ); 
    340                 } 
    341  
    342                 void step(); 
    343  
    344                 //!Default constructor 
    345                 ArxDS ( ) {}; 
    346                 //! Set parameters of the internal model, H is maximum time delay 
    347                 void set_parameters ( const mat &Th0, const vec mu0, const chmat &sqR0 ) { 
    348                         model.set_parameters ( Th0, mu0, sqR0 ); 
    349                 }; 
    350                 //! Set 
    351                 void set_drv ( const RV &yrv, const RV &urv, const RV &rrv ) { 
    352                         Rrv = rrv; 
    353                         Urv = urv; 
    354                         dt_size = yrv._dsize() + urv._dsize(); 
    355  
    356                         RV drv = concat ( yrv, urv ); 
    357                         Drv = drv; 
    358                         int td = rrv.mint(); 
    359                         H.set_size ( drv._dsize() * ( -td + 1 ) ); 
    360                         U.set_size ( Urv._dsize() ); 
    361                         for ( int i = -1; i >= td; i-- ) { 
    362                                 drv.t_plus ( -1 ); 
    363                                 Drv.add ( drv ); //shift u1 
    364                         } 
    365                         rgrlnk.set_connection ( rrv, Drv ); 
    366  
    367                         dtsize = Drv._dsize(); 
    368                         utsize = Urv._dsize(); 
    369                 } 
    370                 //! set options from a string 
    371                 void set_options ( const string &s ) { 
    372                         opt_L_theta = ( s.find ( "L_theta" ) != string::npos ); 
    373                 }; 
    374                 virtual void log_add ( logger &L ) { 
    375                         //DS::log_add ( L ); too long!! 
    376                         L_dt = L.add ( Drv ( 0, dt_size ), "" ); 
    377                         L_ut = L.add ( Urv, "" ); 
    378  
    379                         const mat &A = model._A(); 
    380                         const mat R = model._R(); 
    381                         if ( opt_L_theta ) { 
    382                                 L_theta = L.add ( RV ( "{th }", vec_1 ( A.rows() * A.cols() ) ), "t" ); 
    383                         } 
    384                         if ( opt_L_theta ) { 
    385                                 L_R = L.add ( RV ( "{R }", vec_1 ( R.rows() * R.cols() ) ), "r" ); 
    386                         } 
    387                 } 
    388                 virtual void logit ( logger &L ) { 
    389                         //DS::logit ( L ); 
    390                         L.logit ( L_dt, H.left ( dt_size ) ); 
    391                         L.logit ( L_ut, U ); 
    392  
    393                         const mat &A = model._A(); 
    394                         const mat R = model._R(); 
    395                         if ( opt_L_theta ) { 
    396                                 L.logit ( L_theta, vec ( A._data(), A.rows() *A.cols() ) ); 
    397                         }; 
    398                         if ( opt_L_theta ) { 
    399                                 L.logit ( L_R, vec ( R._data(), R.rows() *R.rows() ) ); 
    400                         }; 
    401                 } 
    402  
    403                 // TODO dokumentace - aktualizovat 
    404                 /*! UI for ArxDS using factorized description! 
    405  
    406                 The ArxDS is constructed from a structure with fields: 
    407                 \code 
    408                 system = { 
    409                         type = "ArxDS"; 
    410                         // description of y variables 
    411                         y = {type="rv"; names=["y", "u"];}; 
    412                         // description of u variable 
    413                         u = {type="rv"; names=[];} 
    414                         // description of regressor 
    415                         rgr = {type="rv"; 
    416                                 names = ["y","y","y","u"]; 
    417                                 times = [-1, -2, -3, -1]; 
    418                         } 
    419  
    420                         // theta 
    421                         theta = [0.8, -0.3, 0.4, 1.0, 
    422                                          0.0, 0.0, 0.0, 0.0]; 
    423                         // offset (optional) 
    424                         offset = [0.0, 0.0]; 
    425                         //variance 
    426                         r = [0.1, 0.0, 
    427                                  0.0, 1.0]; 
    428                         //options: L_theta = log value of theta, 
    429                         opt = "L_theta"; 
    430                 }; 
    431                 \endcode 
    432  
    433                 Result is ARX data source offering with full history as Drv. 
    434                 */ 
    435                 void from_setting ( const Setting &set ); 
    436  
    437                 // TODO dodelat void to_setting( Setting &set ) const; 
    438 }; 
    439  
    440 UIREGISTER ( ArxDS ); 
    441 SHAREDPTR ( ArxDS ); 
    442  
     302// ARXDs - DELETED 
     303 
     304//! State-space data source simulating two densities 
    443305class stateDS : public DS { 
    444306        private: 
     
    467329                        dt0 = dt ( indices ); 
    468330                } 
    469  
     331                //! convenience constructor 
    470332                stateDS ( const shared_ptr<mpdf> &IM0, const shared_ptr<mpdf> &OM0, int usize ) : IM ( IM0 ), OM ( OM0 ), 
    471333                                dt ( OM0->dimension() ), xt ( IM0->dimension() ), 
  • library/bdm/base/loggers.h

    r620 r660  
    3535        string itfilename; 
    3636public: 
     37        //! convenience constructor 
    3738        memlog ( int maxlen0, string itf = "" ) : maxlen ( maxlen0 ), ind ( 0 ), vectors ( 0 ), itfilename ( itf ) {} 
    3839 
  • library/bdm/design/ctrlbase.h

    r649 r660  
    8989                //! refresh temporary storage - inefficient can be improved 
    9090                void initialize(); 
     91                //! validation procedure 
    9192                void validate(); 
    9293                //! function for future use which is called at each time td; Should call initialize()! 
     
    111112                        L = -inv(post_qr.get(0,dimu-1, 0,dimu-1)) * post_qr.get(0,dimu-1, dimu, 2*dimu+dimx+dimy-1); 
    112113                } 
     114                //! compute control action 
    113115                vec apply(const vec &state, const vec &ukm){vec pom=concat(state, ones(dimy), ukm); return L*pom;} 
    114116        } ; 
  • library/bdm/estim/arx.h

    r649 r660  
    124124        //!\name Access attributes 
    125125        //!@{ 
    126         const egiw& posterior() const { 
     126                //! return correctly typed posterior (covariant return) 
     127                const egiw& posterior() const { 
    127128                return est; 
    128129        } 
     
    189190        public: 
    190191                ARXfrg():ARX(){}; 
     192                //! copy constructor 
    191193                ARXfrg(const ARXfrg &A0):ARX(A0){}; 
    192194                ARXfrg* _copy_() const {ARXfrg *A = new ARXfrg(*this); return A;} 
  • library/bdm/estim/kalman.h

    r653 r660  
    5454        public: 
    5555                StateSpace() : dimx (0), dimy (0), dimu (0), A(), B(), C(), D(), Q(), R() {} 
     56                //!copy constructor 
    5657                StateSpace(const StateSpace<sq_T> &S0) : dimx (S0.dimx), dimy (S0.dimy), dimu (S0.dimu), A(S0.A), B(S0.B), C(S0.C), D(S0.D), Q(S0.Q), R(S0.R) {} 
     58                //! set all matrix parameters 
    5759                void set_parameters (const mat &A0, const  mat &B0, const  mat &C0, const  mat &D0, const  sq_T &Q0, const sq_T &R0); 
     60                //! validation 
    5861                void validate(); 
    5962                //! not virtual in this case 
     
    116119        public: 
    117120                Kalman<sq_T>() : BM(), StateSpace<sq_T>(), yrv(),urv(), _K(),  est(new enorm<sq_T>){} 
     121                //! Copy constructor 
    118122                Kalman<sq_T>(const Kalman<sq_T> &K0) : BM(K0), StateSpace<sq_T>(K0), yrv(K0.yrv),urv(K0.urv), _K(K0._K),  est(new enorm<sq_T>(*K0.est)), fy(K0.fy){} 
     123                //!set statistics of the posterior 
    119124                void set_statistics (const vec &mu0, const mat &P0) {est->set_parameters (mu0, P0); }; 
     125                //!set statistics of the posterior 
    120126                void set_statistics (const vec &mu0, const sq_T &P0) {est->set_parameters (mu0, P0); }; 
    121                 //! posterior 
     127                //! return correctly typed posterior (covariant return) 
    122128                const enorm<sq_T>& posterior() const {return *est.get();} 
    123129                //! shared posterior 
     
    138144                        validate(); 
    139145                } 
     146                //! validate object 
    140147                void validate() { 
    141148                        StateSpace<sq_T>::validate(); 
     
    242249                        est->set_parameters (mu0, P0); 
    243250                }; 
     251                //! access function 
    244252                const mat _R() { 
    245253                        return est->_R().to_mat(); 
     
    371379                enorm<chmat> est; 
    372380        public: 
     381                //! set internal parameters 
    373382                void set_parameters (Array<EKFCh*> A, int pol0 = 1) { 
    374383                        Models = A;//TODO: test if evalll is set 
     
    406415                        } 
    407416                } 
    408                 //! posterior density 
     417                //! return correctly typed posterior (covariant return) 
    409418                const enorm<chmat>& posterior() const { 
    410419                        return est; 
  • library/bdm/estim/mixtures.h

    r565 r660  
    111111        //! EM algorithm 
    112112        void bayes ( const mat &dt ); 
     113        //! batch weighted Bayes rule  
    113114        void bayesB ( const mat &dt, const vec &wData ); 
    114115        double logpred ( const vec &dt ) const; 
    115         const epdf& posterior() const { 
     116        //! return correctly typed posterior (covariant return) 
     117        const eprod& posterior() const { 
    116118                return *est; 
    117119        } 
  • library/bdm/estim/particles.h

    r653 r660  
    106106        //!access function 
    107107        vec& _lls() { return lls; } 
     108        //!access function 
    108109        RESAMPLING_METHOD _resmethod() const { return resmethod; } 
    109         //!access function 
     110        //! return correctly typed posterior (covariant return) 
    110111        const eEmp& posterior() const {return est;} 
    111112         
     
    190191                est.resample(ind,resmethod); 
    191192        } 
     193        //! access function 
    192194        Array<vec>& __samples(){return _samples;} 
    193195}; 
     
    203205class MPF : public BM  { 
    204206        protected: 
     207                //! particle filter on non-linear variable 
    205208        shared_ptr<PF> pf; 
     209        //! Array of Bayesian models 
    206210        Array<BM*> BMs; 
    207211 
     
    209213 
    210214        class mpfepdf : public epdf  { 
     215                //! pointer to particle filter 
    211216                shared_ptr<PF> &pf; 
     217                //! pointer to Array of BMs 
    212218                Array<BM*> &BMs; 
    213219        public: 
     220                //! constructor 
    214221                mpfepdf (shared_ptr<PF> &pf0, Array<BM*> &BMs0): epdf(), pf(pf0), BMs(BMs0) { }; 
    215222                //! a variant of set parameters - this time, parameters are read from BMs and pf 
     
    300307        //! Default constructor. 
    301308        MPF () :  jest (pf,BMs) {}; 
     309        //! set all parameters at once 
    302310        void set_parameters ( shared_ptr<mpdf> par0, shared_ptr<mpdf> obs0, int n0, RESAMPLING_METHOD rm = SYSTEMATIC ) { 
    303311                pf->set_model ( par0, obs0);  
     
    305313                BMs.set_length ( n0 ); 
    306314        } 
     315        //! set a prototype of BM, copy it to as many times as there is particles in pf 
    307316        void set_BM ( const BM &BMcond0 ) { 
    308317 
     
    313322                for ( int i = 0; i < n; i++ ) { 
    314323                        BMs ( i ) = BMcond0._copy_(); 
    315                         BMs ( i )->condition ( pf->posterior()._sample ( i ) ); 
    316324                } 
    317325        }; 
     
    374382                } 
    375383                jest.read_parameters(); 
     384                for ( int i = 0; i < pf->__w().length(); i++ ) { 
     385                        BMs ( i )->condition ( pf->posterior()._sample ( i ) ); 
     386                } 
    376387        } 
    377388         
  • library/bdm/math/chmat.h

    r565 r660  
    3434        mat to_mat() const; 
    3535        void mult_sym ( const mat &C ); 
     36        //! mult_sym with return value in parameter \c U 
    3637        void mult_sym ( const mat &C , chmat &U ) const; 
    3738        void mult_sym_t ( const mat &C ); 
     39        //! mult_sym with return value in parameter \c U 
    3840        void mult_sym_t ( const mat &C, chmat &U ) const; 
    3941        double logdet() const; 
     
    112114        } 
    113115 
    114         //! Operators 
     116        //! Operator  
    115117        chmat& operator += ( const chmat &A2 ); 
     118        //! Operator  
    116119        chmat& operator -= ( const chmat &A2 ); 
     120        //! Operator  
    117121        chmat& operator * ( const double &d ) { 
    118122                Ch*sqrt ( d ); 
    119123                return *this; 
    120124        }; 
     125        //! Operator  
    121126        chmat& operator = ( const chmat &A2 ) { 
    122127                Ch = A2.Ch; 
     
    124129                return *this; 
    125130        } 
     131        //! Operator  
    126132        chmat& operator *= ( double x ) { 
    127133                Ch *= sqrt ( x ); 
  • library/bdm/mex/mex_BM.h

    r599 r660  
    1515using namespace bdm; 
    1616 
     17//! epdf with functions implemented in matlab 
    1718class mexEpdf: public epdf{ 
    1819        protected: 
     20                //! prefix of matlab functions 
    1921                string name; 
     22                //! pointer to storage structure 
    2023                mxArray *data; 
    2124        public: 
     
    4043UIREGISTER(mexEpdf); 
    4144 
     45//! BM with functions implemented in matlab 
    4246class mexBM: public BM{ 
    4347        protected : 
     48                //! prefix of matlab functions 
    4449                string name; 
     50                //! internal estimator 
    4551                mexEpdf est; 
     52                //! mxArray with attributes of this object 
    4653                mxArray *data; 
    4754        public: 
    4855                mexBM() {} 
    4956 
     57                //! duplicate internal data pointer? 
    5058                mxArray *get_data() { 
    5159                        //mexCallMATLAB(0, NULL, 1, &data, "dump"); 
     
    8189                        //mexCallMATLAB(0, NULL, 1, &data, "dump"); 
    8290                }  
     91                //! return correctly typed posterior (covariant return) 
    8392                const mexEpdf& posterior() const  { 
    8493                        return est; 
    85                 } //tohle by melo zustat!! 
    86                 const mexEpdf* _e() const  { 
    87                         return &est; 
    8894                } //tohle by melo zustat!! 
    8995}; 
  • library/bdm/mex/mex_datasource.h

    r609 r660  
    5050                RV ru = RV(); 
    5151                if (r){ 
    52                         set_rvs ( *r, ru ); 
     52                        set_drv ( *r, ru ); 
    5353                } else { 
    5454                        RV def((const char*)set["varname"],Data.rows()); 
    55                         set_rvs(def, ru); 
     55                        set_drv(def, ru); 
    5656                } 
    5757        } 
     
    125125                dt=mxArray2vec(tmp); 
    126126        } 
    127         void write(vec &ut0){ ut=ut0;} 
     127        void write(const vec &ut0){ ut=ut0;} 
    128128        void getdata(vec &dt_out){dt_out = dt;  } 
    129129 
  • library/bdm/mex/mex_logger.h

    r609 r660  
    4949        //! constructor 
    5050        mexlog(long maxlen0) : memlog ( maxlen0, "" ) {}; 
    51         //! 
     51        //! copy internal data to output mxArray 
    5252        mxArray* toCell() { 
    5353                mxArray* tmp = mxCreateStructMatrix ( 1, 1, 0, NULL ); 
  • library/bdm/stat/discrete.h

    r643 r660  
    125125UIREGISTER ( discrete_support ); 
    126126 
     127//! Function defined by values on a fixed grid and interpolated inbetween them 
    127128class grid_fnc: public fnc { 
    128129protected: 
     130        //! grid - function support 
    129131        rectangular_support sup; 
     132        //! function values on the grid 
    130133        vec values; 
    131134public: 
     
    154157class egrid: public epdf { 
    155158protected: 
     159        //! support of the pdf - grid 
    156160        rectangular_support sup; 
     161        //! values at the grid 
    157162        vec values; 
    158163public: 
  • library/bdm/stat/emix.h

    r565 r660  
    239239 
    240240        shared_ptr<epdf> marginal ( const RV &rv ) const; 
     241        //! marginal density update 
    241242        void marginal ( const RV &rv, emix &target ) const; 
    242243 
  • library/bdm/stat/exp_family.h

    r644 r660  
    451451                        if (evalll) {last_lognc = est.lognc();} 
    452452                } 
    453                 //! reimplemnetation of BM::posterior() 
     453                //! return correctly typed posterior (covariant return) 
    454454                const eDirich& posterior() const {return est;}; 
    455455                //! constructor function