Changeset 889
- Timestamp:
- 03/30/10 00:01:05 (15 years ago)
- Location:
- library/bdm
- Files:
-
- 5 modified
Legend:
- Unmodified
- Added
- Removed
-
library/bdm/base/bdmbase.cpp
r881 r889 426 426 } 427 427 428 int logger::add_vector ( const RV &rv, string prefix) {428 int logger::add_vector ( const RV &rv, const string &prefix, const string &name ) { 429 429 int id; 430 430 if ( rv._dsize() > 0 ) { 431 431 id = entries.length(); 432 432 names = concat ( names, prefix ); // diff 433 if( name.length() > 0 ) 434 { 435 concat( names, separator ); 436 concat( names, name ); 437 } 433 438 entries.set_length ( id + 1, true ); 434 439 entries ( id ) = rv; … … 468 473 logrec->ids.set_size ( 3 ); 469 474 if ( log_level[logmean] ) { 470 logrec->ids ( 0 ) = logrec->L.add_vector ( r, prefix + logrec->L.prefix_sep() +"mean" );475 logrec->ids ( 0 ) = logrec->L.add_vector ( r, prefix, "mean" ); 471 476 } 472 477 if ( log_level[loglbound] ) { 473 logrec->ids ( 1 ) = logrec->L.add_vector ( r, prefix + logrec->L.prefix_sep() +"lb" );478 logrec->ids ( 1 ) = logrec->L.add_vector ( r, prefix, "lb" ); 474 479 } 475 480 if ( log_level[logubound] ) { 476 logrec->ids ( 2 ) = logrec->L.add_vector ( r, prefix + logrec->L.prefix_sep() +"ub" );481 logrec->ids ( 2 ) = logrec->L.add_vector ( r, prefix, "ub" ); 477 482 } 478 483 … … 561 566 if ( log_level.any() ) { 562 567 logrec->ids.set_size ( 1 ); 563 logrec->ids ( 0) = L.add_vector ( RV ( "", 1 ), prefix + L.prefix_sep() +"ll" );568 logrec->ids ( 0) = L.add_vector ( RV ( "", 1 ), prefix, "ll" ); 564 569 } 565 570 … … 571 576 prior().log_level[epdf::logfull]=true; 572 577 } 573 const_cast<epdf&> ( posterior() ).log_register ( L, prefix + L. prefix_sep()+ "apost" );578 const_cast<epdf&> ( posterior() ).log_register ( L, prefix + L.separator + "apost" ); 574 579 } 575 580 -
library/bdm/base/bdmbase.h
r871 r889 306 306 //! Names of logged quantities, e.g. names of algorithm variants 307 307 Array<string> names; 308 //!separator of prefixes of entries309 const string separator;310 308 //! Root Setting for storing Settings 311 309 Config setting_conf; … … 316 314 logger ( const string separator0 ) : entries ( 0 ), names ( 0 ), separator ( separator0 ) {} 317 315 316 //!separator of prefixes of entries 317 //! 318 //! It is a constant string, thus it can be safely declared as public without creating any accessor method 319 const string separator; 320 321 318 322 //! returns an identifier which will be later needed for calling the \c logit() function 319 323 //! For empty RV it returns -1, this entry will be ignored by \c logit(). 320 virtual int add_vector ( const RV &rv, string prefix= "" );324 virtual int add_vector ( const RV &rv, const string &prefix, const string &name = "" ); 321 325 322 326 virtual int add_setting ( const string &prefix ); … … 339 343 //! Initialize the storage 340 344 virtual void init() {}; 341 342 //!separator of prefixes for this logger343 const string& prefix_sep() {344 return separator;345 }346 345 }; 347 346 … … 512 511 513 512 The following constructors should be supported for convenience: 514 \li constructor followed by calling \c set_parameters() 513 \li constructor followed by calling \c set_parameters() WHICH IS OBSOLETE (TODO) 515 514 \li constructor accepting random variables calling \c set_rv() 516 515 517 All internal data structures are constructed as empty. Their values (including sizes) will be set by method \c set_parameters(). This way references can be initialized in constructors. 516 All internal data structures are constructed as empty. Their values (including sizes) will be 517 set by method \c set_parameters() WHICH IS OBSOLETE (TODO). This way references can be initialized in constructors. 518 518 @{*/ 519 519 epdf() {}; -
library/bdm/estim/kalman.h
r863 r889 422 422 423 423 }; 424 425 424 UIREGISTER ( MultiModel ); 426 425 SHAREDPTR ( MultiModel ); -
library/bdm/stat/exp_family.cpp
r887 r889 302 302 logrec->ids.set_length ( 2 ); 303 303 int th_dim = dimension() - dimx * ( dimx + 1 ) / 2; 304 logrec->ids ( 0 ) = L.add_vector ( RV ( "", th_dim ), prefix + logrec->L.prefix_sep() +"mean" );305 logrec->ids ( 1 ) = L.add_vector ( RV ( "", th_dim * th_dim ), prefix + logrec->L.prefix_sep() +"variance" );304 logrec->ids ( 0 ) = L.add_vector ( RV ( "", th_dim ), prefix, "mean" ); 305 logrec->ids ( 1 ) = L.add_vector ( RV ( "", th_dim * th_dim ), prefix, "variance" ); 306 306 } else { 307 307 epdf::log_register ( L, prefix ); -
library/bdm/stat/exp_family.h
r887 r889 451 451 rv = RV({'name'}) // description of RV 452 452 rvc = RV({'name'}) // description of RV in condition 453 log_level = 'tri'; // set the level of logged details 453 454 \endcode 455 456 \sa log_level_enums 454 457 */ 455 456 458 void from_setting ( const Setting &set ) { 457 459 epdf::from_setting ( set );