Changeset 660
- Timestamp:
- 10/15/09 00:04:30 (15 years ago)
- Location:
- library
- Files:
-
- 17 modified
Legend:
- Unmodified
- Added
- Removed
-
library/Doxyfile
r617 r660 564 564 # to stderr. 565 565 566 WARN_LOGFILE = 566 WARN_LOGFILE = doxwarn.txt 567 567 568 568 #--------------------------------------------------------------------------- … … 601 601 *.hxx \ 602 602 *.dox \ 603 *.m \604 603 *.doc 605 604 … … 616 615 EXCLUDE = system \ 617 616 .git \ 617 bdm/dirent.h \ 618 bdm/dirent.c \ 618 619 applications \ 619 620 bdm/base/libconfig \ 620 621 tests 621 622 622 623 # The EXCLUDE_SYMLINKS tag can be used select whether or not files or … … 648 649 EXAMPLE_PATH = ./doc/tutorial/src \ 649 650 ./tests \ 650 ./tests/tutorial \ 651 ./library/tutorial \ 652 ./library/mex 653 651 ./tests/tutorial 652 654 653 # If the value of the EXAMPLE_PATH tag contains directories, you can use the 655 654 # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -
library/bdm/base/bdmbase.h
r652 r660 238 238 return tmp; 239 239 } 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$ 241 241 RV expand_delayes() const { 242 242 RV rvt = this->remove_time(); //rv at t=0 … … 764 764 class datalink_2to1_buffered { 765 765 protected: 766 //! link 1st vector to down 766 767 datalink_buffered dl1; 768 //! link 2nd vector to down 767 769 datalink_buffered dl2; 768 770 public: … … 772 774 dl2.set_connection ( rv, rv_up2 ); 773 775 } 776 //! fill values of down from the values of the two up vectors 774 777 void filldown ( const vec &val1, const vec &val2, vec &val_down ) { 775 778 bdm_assert_debug ( val_down.length() >= dl1._downsize() + dl2._downsize(), "short val_down" ); … … 777 780 dl2.filldown ( val2, val_down ); 778 781 } 782 //! update buffer 779 783 void step ( const vec &dt, const vec &ut ) { 780 784 dl1.step ( dt ); … … 962 966 //!Description of output data 963 967 RV Yrv; // 964 //! Remember its own index in Logger L 965 i nt L_dt, L_ut;968 //! Remember its own index in Logger L, [0=dt, 1=ut] 969 ivec LIDs; 966 970 public: 967 971 //! default constructors 968 DS() : Drv(), Urv(),Yrv() {};972 DS() : Drv(), Urv(),Yrv(), LIDs(2) {}; 969 973 970 974 //! 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(). … … 980 984 981 985 //! Accepts action variable and schedule it for application. 982 virtual void write ( vec &ut ) {986 virtual void write (const vec &ut ) { 983 987 bdm_error ( "abstract class" ); 984 988 } 985 989 986 990 //! 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 ) { 988 992 bdm_error ( "abstract class" ); 989 993 } … … 1000 1004 bdm_assert ( utsize == Urv._dsize(), "invalid DS: utsize (" + num2str ( utsize ) + ") different from Urv " + num2str ( Urv._dsize() ) ); 1001 1005 1002 L _dt= L.add ( Drv, "" );1003 L _ut= L.add ( Urv, "" );1006 LIDs(0) = L.add ( Drv, "" ); 1007 LIDs(1) = L.add ( Urv, "" ); 1004 1008 } 1005 1009 //! Register DS for logging into logger L … … 1008 1012 getdata ( tmp ); 1009 1013 // d is first in getdata 1010 L.logit ( L _dt, tmp.left ( Drv._dsize() ) );1014 L.logit ( LIDs(0), tmp.left ( Drv._dsize() ) ); 1011 1015 // 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() ) ); 1013 1017 } 1014 1018 //!access function … … 1072 1076 }; 1073 1077 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! 1075 1079 //! Prototype: \code BM* _copy_() const {return new BM(*this);} \endcode 1076 1080 virtual BM* _copy_() const { … … 1138 1142 //! \name Access to attributes 1139 1143 //!@{ 1140 1144 //! access function 1141 1145 const RV& _drv() const { 1142 1146 return drv; 1143 1147 } 1148 //! access function 1144 1149 void set_drv ( const RV &rv ) { 1145 1150 drv = rv; 1146 1151 } 1152 //! access to rv of the posterior 1147 1153 void set_rv ( const RV &rv ) { 1148 1154 const_cast<epdf&> ( posterior() ).set_rv ( rv ); 1149 1155 } 1156 //! return internal log-likelihood of the last data vector 1150 1157 double _ll() const { 1151 1158 return ll; 1152 1159 } 1160 //! switch evaluation of log-likelihood on/off 1153 1161 void set_evalll ( bool evl0 ) { 1154 1162 evalll = evl0; 1155 1163 } 1164 //! return posterior density 1156 1165 virtual const epdf& posterior() const = 0; 1157 1166 //!@} … … 1216 1225 1217 1226 }; 1218 1227 //! array of pointers to epdf 1219 1228 typedef Array<shared_ptr<epdf> > epdf_array; 1220 1229 //! array of pointers to mpdf 1221 1230 typedef Array<shared_ptr<mpdf> > mpdf_array; 1222 1231 -
library/bdm/base/datasources.cpp
r609 r660 28 28 } 29 29 30 void MemDS::set_ rvs ( RV &drv,RV &urv ) {30 void MemDS::set_drv (const RV &drv, const RV &urv ) { 31 31 bdm_assert_debug ( drv._dsize() == rowid.length(), "MemDS::set_rvs incompatible drv" ); 32 32 bdm_assert_debug ( urv._dsize() == 0, "MemDS does not support urv." ); 33 33 34 D rv = drv;34 DS::set_drv(drv,urv); 35 35 } 36 36 … … 42 42 } 43 43 44 void ArxDS::step() {45 //shift history46 H.shift_right ( 0, dt_size );47 48 H.set_subvector ( dt_size - utsize, U ); // write U after Drv49 50 //get regressor51 rgr = rgrlnk.pushdown ( H );52 // Eval Y53 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 // } 77 77 78 78 CsvFileDS::CsvFileDS ( const string& fname, const string& orientation ) : FileDS() { -
library/bdm/base/datasources.h
r618 r660 40 40 void getdata ( vec &dt ); 41 41 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 ) { 45 45 bdm_error ( "MemDS::write is not supported" ); 46 46 } 47 47 48 void write ( vec &ut,ivec &indices ) {48 void write ( const vec &ut, const ivec &indices ) { 49 49 bdm_error ( "MemDS::write is not supported" ); 50 50 } … … 53 53 //!Default constructor 54 54 MemDS () {}; 55 //! Convenience constructor 55 56 MemDS ( mat &Dat, ivec &rowid0); 56 57 /*! Create object from the following structure … … 114 115 dt_out = dt ( ids ); 115 116 } 116 const RV& _drv() {117 const RV& _drv() const { 117 118 return iepdf->_rv(); 118 119 } … … 262 263 263 264 public: 265 //! Convenience constructor 264 266 ITppFileDS ( const string &fname, const string &varname ) : FileDS() { 265 267 it_file it ( fname ); … … 298 300 299 301 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 443 305 class stateDS : public DS { 444 306 private: … … 467 329 dt0 = dt ( indices ); 468 330 } 469 331 //! convenience constructor 470 332 stateDS ( const shared_ptr<mpdf> &IM0, const shared_ptr<mpdf> &OM0, int usize ) : IM ( IM0 ), OM ( OM0 ), 471 333 dt ( OM0->dimension() ), xt ( IM0->dimension() ), -
library/bdm/base/loggers.h
r620 r660 35 35 string itfilename; 36 36 public: 37 //! convenience constructor 37 38 memlog ( int maxlen0, string itf = "" ) : maxlen ( maxlen0 ), ind ( 0 ), vectors ( 0 ), itfilename ( itf ) {} 38 39 -
library/bdm/design/ctrlbase.h
r649 r660 89 89 //! refresh temporary storage - inefficient can be improved 90 90 void initialize(); 91 //! validation procedure 91 92 void validate(); 92 93 //! function for future use which is called at each time td; Should call initialize()! … … 111 112 L = -inv(post_qr.get(0,dimu-1, 0,dimu-1)) * post_qr.get(0,dimu-1, dimu, 2*dimu+dimx+dimy-1); 112 113 } 114 //! compute control action 113 115 vec apply(const vec &state, const vec &ukm){vec pom=concat(state, ones(dimy), ukm); return L*pom;} 114 116 } ; -
library/bdm/estim/arx.h
r649 r660 124 124 //!\name Access attributes 125 125 //!@{ 126 const egiw& posterior() const { 126 //! return correctly typed posterior (covariant return) 127 const egiw& posterior() const { 127 128 return est; 128 129 } … … 189 190 public: 190 191 ARXfrg():ARX(){}; 192 //! copy constructor 191 193 ARXfrg(const ARXfrg &A0):ARX(A0){}; 192 194 ARXfrg* _copy_() const {ARXfrg *A = new ARXfrg(*this); return A;} -
library/bdm/estim/kalman.h
r653 r660 54 54 public: 55 55 StateSpace() : dimx (0), dimy (0), dimu (0), A(), B(), C(), D(), Q(), R() {} 56 //!copy constructor 56 57 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 57 59 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 58 61 void validate(); 59 62 //! not virtual in this case … … 116 119 public: 117 120 Kalman<sq_T>() : BM(), StateSpace<sq_T>(), yrv(),urv(), _K(), est(new enorm<sq_T>){} 121 //! Copy constructor 118 122 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 119 124 void set_statistics (const vec &mu0, const mat &P0) {est->set_parameters (mu0, P0); }; 125 //!set statistics of the posterior 120 126 void set_statistics (const vec &mu0, const sq_T &P0) {est->set_parameters (mu0, P0); }; 121 //! posterior127 //! return correctly typed posterior (covariant return) 122 128 const enorm<sq_T>& posterior() const {return *est.get();} 123 129 //! shared posterior … … 138 144 validate(); 139 145 } 146 //! validate object 140 147 void validate() { 141 148 StateSpace<sq_T>::validate(); … … 242 249 est->set_parameters (mu0, P0); 243 250 }; 251 //! access function 244 252 const mat _R() { 245 253 return est->_R().to_mat(); … … 371 379 enorm<chmat> est; 372 380 public: 381 //! set internal parameters 373 382 void set_parameters (Array<EKFCh*> A, int pol0 = 1) { 374 383 Models = A;//TODO: test if evalll is set … … 406 415 } 407 416 } 408 //! posterior density417 //! return correctly typed posterior (covariant return) 409 418 const enorm<chmat>& posterior() const { 410 419 return est; -
library/bdm/estim/mixtures.h
r565 r660 111 111 //! EM algorithm 112 112 void bayes ( const mat &dt ); 113 //! batch weighted Bayes rule 113 114 void bayesB ( const mat &dt, const vec &wData ); 114 115 double logpred ( const vec &dt ) const; 115 const epdf& posterior() const { 116 //! return correctly typed posterior (covariant return) 117 const eprod& posterior() const { 116 118 return *est; 117 119 } -
library/bdm/estim/particles.h
r653 r660 106 106 //!access function 107 107 vec& _lls() { return lls; } 108 //!access function 108 109 RESAMPLING_METHOD _resmethod() const { return resmethod; } 109 //! access function110 //! return correctly typed posterior (covariant return) 110 111 const eEmp& posterior() const {return est;} 111 112 … … 190 191 est.resample(ind,resmethod); 191 192 } 193 //! access function 192 194 Array<vec>& __samples(){return _samples;} 193 195 }; … … 203 205 class MPF : public BM { 204 206 protected: 207 //! particle filter on non-linear variable 205 208 shared_ptr<PF> pf; 209 //! Array of Bayesian models 206 210 Array<BM*> BMs; 207 211 … … 209 213 210 214 class mpfepdf : public epdf { 215 //! pointer to particle filter 211 216 shared_ptr<PF> &pf; 217 //! pointer to Array of BMs 212 218 Array<BM*> &BMs; 213 219 public: 220 //! constructor 214 221 mpfepdf (shared_ptr<PF> &pf0, Array<BM*> &BMs0): epdf(), pf(pf0), BMs(BMs0) { }; 215 222 //! a variant of set parameters - this time, parameters are read from BMs and pf … … 300 307 //! Default constructor. 301 308 MPF () : jest (pf,BMs) {}; 309 //! set all parameters at once 302 310 void set_parameters ( shared_ptr<mpdf> par0, shared_ptr<mpdf> obs0, int n0, RESAMPLING_METHOD rm = SYSTEMATIC ) { 303 311 pf->set_model ( par0, obs0); … … 305 313 BMs.set_length ( n0 ); 306 314 } 315 //! set a prototype of BM, copy it to as many times as there is particles in pf 307 316 void set_BM ( const BM &BMcond0 ) { 308 317 … … 313 322 for ( int i = 0; i < n; i++ ) { 314 323 BMs ( i ) = BMcond0._copy_(); 315 BMs ( i )->condition ( pf->posterior()._sample ( i ) );316 324 } 317 325 }; … … 374 382 } 375 383 jest.read_parameters(); 384 for ( int i = 0; i < pf->__w().length(); i++ ) { 385 BMs ( i )->condition ( pf->posterior()._sample ( i ) ); 386 } 376 387 } 377 388 -
library/bdm/math/chmat.h
r565 r660 34 34 mat to_mat() const; 35 35 void mult_sym ( const mat &C ); 36 //! mult_sym with return value in parameter \c U 36 37 void mult_sym ( const mat &C , chmat &U ) const; 37 38 void mult_sym_t ( const mat &C ); 39 //! mult_sym with return value in parameter \c U 38 40 void mult_sym_t ( const mat &C, chmat &U ) const; 39 41 double logdet() const; … … 112 114 } 113 115 114 //! Operator s116 //! Operator 115 117 chmat& operator += ( const chmat &A2 ); 118 //! Operator 116 119 chmat& operator -= ( const chmat &A2 ); 120 //! Operator 117 121 chmat& operator * ( const double &d ) { 118 122 Ch*sqrt ( d ); 119 123 return *this; 120 124 }; 125 //! Operator 121 126 chmat& operator = ( const chmat &A2 ) { 122 127 Ch = A2.Ch; … … 124 129 return *this; 125 130 } 131 //! Operator 126 132 chmat& operator *= ( double x ) { 127 133 Ch *= sqrt ( x ); -
library/bdm/mex/mex_BM.h
r599 r660 15 15 using namespace bdm; 16 16 17 //! epdf with functions implemented in matlab 17 18 class mexEpdf: public epdf{ 18 19 protected: 20 //! prefix of matlab functions 19 21 string name; 22 //! pointer to storage structure 20 23 mxArray *data; 21 24 public: … … 40 43 UIREGISTER(mexEpdf); 41 44 45 //! BM with functions implemented in matlab 42 46 class mexBM: public BM{ 43 47 protected : 48 //! prefix of matlab functions 44 49 string name; 50 //! internal estimator 45 51 mexEpdf est; 52 //! mxArray with attributes of this object 46 53 mxArray *data; 47 54 public: 48 55 mexBM() {} 49 56 57 //! duplicate internal data pointer? 50 58 mxArray *get_data() { 51 59 //mexCallMATLAB(0, NULL, 1, &data, "dump"); … … 81 89 //mexCallMATLAB(0, NULL, 1, &data, "dump"); 82 90 } 91 //! return correctly typed posterior (covariant return) 83 92 const mexEpdf& posterior() const { 84 93 return est; 85 } //tohle by melo zustat!!86 const mexEpdf* _e() const {87 return &est;88 94 } //tohle by melo zustat!! 89 95 }; -
library/bdm/mex/mex_datasource.h
r609 r660 50 50 RV ru = RV(); 51 51 if (r){ 52 set_ rvs( *r, ru );52 set_drv ( *r, ru ); 53 53 } else { 54 54 RV def((const char*)set["varname"],Data.rows()); 55 set_ rvs(def, ru);55 set_drv(def, ru); 56 56 } 57 57 } … … 125 125 dt=mxArray2vec(tmp); 126 126 } 127 void write( vec &ut0){ ut=ut0;}127 void write(const vec &ut0){ ut=ut0;} 128 128 void getdata(vec &dt_out){dt_out = dt; } 129 129 -
library/bdm/mex/mex_logger.h
r609 r660 49 49 //! constructor 50 50 mexlog(long maxlen0) : memlog ( maxlen0, "" ) {}; 51 //! 51 //! copy internal data to output mxArray 52 52 mxArray* toCell() { 53 53 mxArray* tmp = mxCreateStructMatrix ( 1, 1, 0, NULL ); -
library/bdm/stat/discrete.h
r643 r660 125 125 UIREGISTER ( discrete_support ); 126 126 127 //! Function defined by values on a fixed grid and interpolated inbetween them 127 128 class grid_fnc: public fnc { 128 129 protected: 130 //! grid - function support 129 131 rectangular_support sup; 132 //! function values on the grid 130 133 vec values; 131 134 public: … … 154 157 class egrid: public epdf { 155 158 protected: 159 //! support of the pdf - grid 156 160 rectangular_support sup; 161 //! values at the grid 157 162 vec values; 158 163 public: -
library/bdm/stat/emix.h
r565 r660 239 239 240 240 shared_ptr<epdf> marginal ( const RV &rv ) const; 241 //! marginal density update 241 242 void marginal ( const RV &rv, emix &target ) const; 242 243 -
library/bdm/stat/exp_family.h
r644 r660 451 451 if (evalll) {last_lognc = est.lognc();} 452 452 } 453 //! re implemnetation of BM::posterior()453 //! return correctly typed posterior (covariant return) 454 454 const eDirich& posterior() const {return est;}; 455 455 //! constructor function