- Timestamp:
- 03/12/10 13:34:17 (15 years ago)
- Location:
- library/bdm
- Files:
-
- 5 modified
Legend:
- Unmodified
- Added
- Removed
-
library/bdm/base/bdmbase.cpp
r854 r863 461 461 462 462 // log full data 463 if ( log_level[ deset] ) {463 if ( log_level[logfull] ) { 464 464 logrec->ids.set_size ( 1 ); 465 465 logrec->ids ( 0 ) = logrec->L.add_setting ( prefix ); … … 467 467 // log only 468 468 logrec->ids.set_size ( 3 ); 469 if ( log_level .any()) {469 if ( log_level[logmean] ) { 470 470 logrec->ids ( 0 ) = logrec->L.add_vector ( r, prefix + logrec->L.prefix_sep() + "mean" ); 471 if ( !log_level[jedna] ) { 472 logrec->ids ( 1 ) = logrec->L.add_vector ( r, prefix + logrec->L.prefix_sep() + "lb" ); 473 logrec->ids ( 2 ) = logrec->L.add_vector ( r, prefix + logrec->L.prefix_sep() + "ub" ); 474 } 475 } 471 } 472 if ( log_level[loglb] ) { 473 logrec->ids ( 1 ) = logrec->L.add_vector ( r, prefix + logrec->L.prefix_sep() + "lb" ); 474 } 475 if ( log_level[logub] ) { 476 logrec->ids ( 2 ) = logrec->L.add_vector ( r, prefix + logrec->L.prefix_sep() + "ub" ); 477 } 478 476 479 } 477 480 } 478 481 479 482 void epdf::log_write() const { 480 if ( log_level[ deset] ) {483 if ( log_level[logfull] ) { 481 484 UI::save(this, logrec->L.log_to_setting ( logrec->ids ( 0 ) ) ); 482 485 } else { 483 if ( log_level .any()) {486 if ( log_level[logmean] ) { 484 487 logrec->L.log_vector ( logrec->ids ( 0 ), mean() ); 485 if ( !log_level[jedna] ) { 488 } 489 if ( log_level[loglb] || log_level[logub] ) { 486 490 vec lb; 487 491 vec ub; 488 492 qbounds ( lb, ub ); 489 logrec->L.log_vector ( logrec->ids ( 1 ), lb ); 490 logrec->L.log_vector ( logrec->ids ( 2 ), ub ); 493 if (log_level[loglb]) 494 logrec->L.log_vector ( logrec->ids ( 1 ), lb ); 495 if (log_level[logub]) 496 logrec->L.log_vector ( logrec->ids ( 2 ), ub ); 491 497 } 492 498 } 493 499 } 494 } 500 495 501 496 502 void datalink_buffered::set_connection ( const RV &rv, const RV &rv_up ) { … … 552 558 root::log_register ( L, prefix ); 553 559 554 const_cast<epdf&> ( posterior() ).log_register ( L, prefix + L.prefix_sep() + "apost" );555 556 560 if ( log_level.any() ) { 557 561 logrec->ids.set_size ( 1 ); 558 logrec->ids ( likelihood ) = L.add_vector ( RV ( "", 1 ), prefix + L.prefix_sep() + "ll" ); 559 } 562 logrec->ids ( 0) = L.add_vector ( RV ( "", 1 ), prefix + L.prefix_sep() + "ll" ); 563 } 564 565 if (log_level[bounds]){ 566 prior().log_level[epdf::loglb]=true; 567 prior().log_level[epdf::logub]=true; 568 } 569 if (log_level[full]){ 570 prior().log_level[epdf::logfull]=true; 571 } 572 const_cast<epdf&> ( posterior() ).log_register ( L, prefix + L.prefix_sep() + "apost" ); 560 573 } 561 574 … … 563 576 posterior().log_write(); 564 577 if ( log_level.any() ) { 565 logrec->L.logit ( logrec->ids ( likelihood), ll );578 logrec->L.logit ( logrec->ids ( 0 ), ll ); 566 579 } 567 580 } -
library/bdm/base/user_info.h
r850 r863 312 312 UI::get( true_options, element ); 313 313 for( int i = 0; i < true_options.length(); i++ ) 314 for( int j = 0; j < options.names().length(); j++ ) 314 for( int j = 0; j < options.names().length(); j++ ){ 315 315 if( true_options(i) == options.names()(j) ) 316 316 { … … 318 318 break; 319 319 } 320 } 320 321 } 321 322 -
library/bdm/bdmroot.h
r853 r863 76 76 77 77 // MUZEME INTERNE POUZIVAT ENUMY, A KLIDNE MENIT JEJICH PORADI, DIKY TOMUHLE MAKRU SE VZDY NAMAPUJI NA TY SPRAVNE STRINGY 78 #define LOG_LEVEL(CLASSNAME,...) private: friend class logged_options<CLASSNAME>; static const Array<string> & option_names() { static const Array<string> option_names( "{"#__VA_ARGS__"}" ); return option_names; }; public: enum possible_options { __VA_ARGS__ }; logged_options<CLASSNAME> log_level;78 #define LOG_LEVEL(CLASSNAME,...) private: friend class logged_options<CLASSNAME>; static const Array<string> &__option_names() { static const Array<string> option_names( "{"#__VA_ARGS__" }" ); return option_names; }; public: enum possible_options { __VA_ARGS__ }; logged_options<CLASSNAME> log_level; 79 79 80 80 //forward declaration -
library/bdm/estim/kalman.h
r850 r863 155 155 } 156 156 157 virtual double logpred ( const vec &yt ) const NOT_IMPLEMENTED(0);158 159 virtual epdf* epredictor() const NOT_IMPLEMENTED(NULL);160 161 virtual pdf* predictor() const NOT_IMPLEMENTED(NULL);162 157 }; 163 158 /*! … … 426 421 void from_setting ( const Setting &set ); 427 422 428 // TODO dodelat void to_setting( Setting &set ) const;429 430 virtual double logpred ( const vec &yt ) const NOT_IMPLEMENTED(0);431 432 virtual epdf* epredictor() const NOT_IMPLEMENTED(NULL);433 434 virtual pdf* predictor() const NOT_IMPLEMENTED(NULL);435 423 }; 436 424 -
library/bdm/mex/mex_BM.h
r766 r863 99 99 } //tohle by melo zustat!! 100 100 101 virtual double logpred ( const vec &yt ) const NOT_IMPLEMENTED(0);102 103 virtual epdf* epredictor() const NOT_IMPLEMENTED(NULL);104 105 virtual pdf* predictor() const NOT_IMPLEMENTED(NULL);106 101 }; 107 102 UIREGISTER ( mexBM );