Changeset 850 for library/bdm/base/bdmbase.h
- Timestamp:
- 03/04/10 16:41:30 (14 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
library/bdm/base/bdmbase.h
r822 r850 26 26 27 27 namespace bdm { 28 28 29 //! Structure of RV, i.e. RVs expanded into a flat list of IDs, used for debugging. 29 30 class str { … … 346 347 347 348 349 348 350 //! Class representing function \f$f(x)\f$ of variable \f$x\f$ represented by \c rv 349 class fnc : public root { 351 class fnc : public root { 350 352 protected: 351 353 //! Length of the output vector … … 490 492 //! Probability density function with numerical statistics, e.g. posterior density. 491 493 class epdf : public pdf { 494 LOG_LEVEL(epdf,jedna,dva,tri,deset); 492 495 493 496 public: … … 505 508 epdf() {}; 506 509 epdf ( const epdf &e ) : pdf ( e ) {}; 507 510 511 508 512 //!@} 509 513 … … 887 891 888 892 class DS : public root { 893 LOG_LEVEL(DS,jednicka); 889 894 protected: 890 895 //! size of data returned by \c getdata() … … 903 908 //! default constructors 904 909 DS() : dtsize ( 0 ), utsize ( 0 ), ytsize ( 0 ), Drv(), Urv(), Yrv() { 905 log_level = 1;910 log_level[jednicka] = true; 906 911 }; 907 912 … … 971 976 \f] 972 977 973 974 978 */ 975 979 976 980 class BM : public root { 981 LOG_LEVEL(BM,full,likelihood,bounds); 982 977 983 protected: 978 984 //! Random variable of the data (optional) … … 995 1001 996 1002 BM() : yrv(), dimy ( 0 ), rvc(), dimc ( 0 ), ll ( 0 ), evalll ( true ) { }; 997 // BM ( const BM &B ) : yrv ( B.yrv ), dimy(B.dimy), rvc ( B.rvc ),dimc(B.dimc), ll ( B.ll ), evalll ( B.evalll ) {}1003 // BM ( const BM &B ) : yrv ( B.yrv ), dimy(B.dimy), rvc ( B.rvc ),dimc(B.dimc), ll ( B.ll ), evalll ( B.evalll ) {} 998 1004 //! \brief Copy function required in vectors, Arrays of BM etc. Have to be DELETED manually! 999 1005 //! Prototype: \code BM* _copy() const {return new BM(*this);} \endcode 1000 virtual BM* _copy() const { return NULL; }; // TODO NEBUDE TU TAKY LEPSI BDM_ERROR??!1006 virtual BM* _copy() const NOT_IMPLEMENTED(NULL); 1001 1007 //!@} 1002 1008 … … 1089 1095 //!@{ 1090 1096 1091 //! Set boolean options from a string, recognized are: "logbounds,logll"1092 virtual void set_options ( const string &opt );1093 1094 1097 //! Add all logged variables to a logger 1095 1098 //! Log levels two digits: xy where … … 1116 1119 } 1117 1120 1118 string opt; 1119 if ( UI::get ( opt, set, "options", UI::optional ) ) { 1120 set_options ( opt ); 1121 } 1121 UI::get ( log_level, set, "log_level", UI::optional ); 1122 1122 1123 } 1123 1124 … … 1127 1128 UI::save( &rvc, set, "rvc" ); 1128 1129 UI::save( &posterior()._rv(), set, "rv" ); 1129 1130 string opt; 1131 switch( posterior()._log_level() ) 1132 { 1133 case 2: 1134 opt = "logbounds "; 1135 break; 1136 case 10: 1137 opt = "logfull "; 1138 break; 1139 default: 1140 opt = ""; 1141 break; 1130 UI::save( log_level, set ); 1131 } 1132 1133 void validate() 1134 { 1135 if ( log_level[full] ) { 1136 const_cast<epdf&> ( posterior() ).log_level[epdf::deset] = true; 1137 } else { 1138 if ( log_level[bounds] ) { 1139 const_cast<epdf&> ( posterior() ).log_level[epdf::dva] = true; 1140 } else { 1141 const_cast<epdf&> ( posterior() ).log_level[epdf::jedna] = true;; 1142 } 1143 if ( log_level[likelihood] ) { 1144 // TODO testovat tedy likelyhood misto 1.. log_level = 1; 1145 } 1142 1146 } 1143 if( log_level == 1 ) opt = opt + "logll";1144 if( !opt.empty() )1145 UI::save( opt, set, "options" );1146 1147 } 1147 1148 };