Changeset 384 for library/bdm/base
- Timestamp:
- 06/19/09 10:17:25 (15 years ago)
- Location:
- library/bdm
- Files:
-
- 1 added
- 10 moved
Legend:
- Unmodified
- Added
- Removed
-
library/bdm/base/bdmbase.cpp
r377 r384 1 1 2 #include " libBM.h"2 #include "bdmbase.h" 3 3 4 4 //! Space of basic BDM structures … … 255 255 RV rv; //empty rv 256 256 bool rvaddok; 257 for ( int i = 0;i < n;i++ ) {257 for ( int i = 0;i < mpdfs.length();i++ ) { 258 258 rvaddok=rv.add ( mpdfs ( i )->_rv() ); //add rv to common rvs. 259 259 // If rvaddok==false, mpdfs overlap => assert error. … … 264 264 265 265 void compositepdf::setrvc ( const RV &rv, RV &rvc ) { 266 for ( int i = 0;i < n;i++ ) {266 for ( int i = 0;i < mpdfs.length();i++ ) { 267 267 RV rvx = mpdfs ( i )->_rvc().subt ( rv ); 268 268 rvc.add ( rvx ); //add rv to common rvc -
library/bdm/base/bdmbase.h
r377 r384 11 11 */ 12 12 13 #ifndef B M_H14 #define B M_H13 #ifndef BDMBASE_H 14 #define BDMBASE_H 15 15 16 16 #include <map> … … 18 18 #include "../itpp_ext.h" 19 19 #include "../bdmroot.h" 20 #include " ../user_info.h"20 #include "user_info.h" 21 21 22 22 … … 566 566 567 567 */ 568 class mepdf : public mpdf 569 { 570 public: 571 //!Default constructor 572 mepdf(epdf* em) : mpdf() {ep = em ;}; 573 mepdf(const epdf* em) : mpdf() {ep = const_cast<epdf*>(em);}; 574 void condition(const vec &cond) {} 575 }; 576 577 //!\brief Abstract composition of pdfs, will be used for specific classes 568 class mepdf : public mpdf { 569 bool owning_ep; // flag trigers deleting ep by destructor 570 public: 571 //!Default constructor 572 mepdf ( epdf* em, bool owning_ep0=false ) :mpdf ( ) {ep= em ;owning_ep=owning_ep0;}; 573 mepdf (const epdf* em ) :mpdf ( ) {ep=const_cast<epdf*>( em );}; 574 void condition ( const vec &cond ) {} 575 ~mepdf(){if (owning_ep) delete ep;} 576 }; 577 578 //!\brief Chain rule of pdfs - abstract part common for mprod and merger. 578 579 //!this abstract class is common to epdf and mpdf 579 class compositepdf 580 {580 //!\todo Think of better design - global functions rv=get_rv(Array<mpdf*> mpdfs); ?? 581 class compositepdf { 581 582 protected: 582 583 //!Number of mpdfs in the composite … … 786 787 787 788 }; //namespace 788 #endif // B M_H789 #endif // BDMBASE_H -
library/bdm/base/datasources.cpp
r377 r384 1 1 2 #include " libDS.h"2 #include "datasources.h" 3 3 4 4 using namespace bdm; -
library/bdm/base/datasources.h
r377 r384 11 11 */ 12 12 13 #ifndef D S_H14 #define D S_H15 16 17 #include " libBM.h"18 #include " libEF.h"19 #include "../ user_info.h"13 #ifndef DATASOURCE_H 14 #define DATASOURCE_H 15 16 17 #include "../base/bdmbase.h" 18 #include "../stat/exp_family.h" 19 #include "../base/user_info.h" 20 20 21 21 namespace bdm { -
library/bdm/base/loggers.h
r377 r384 14 14 #define LGR_H 15 15 16 #include " libBM.h"17 #include "../ user_info.h"16 #include "base/bdmbase.h" 17 #include "../base/user_info.h" 18 18 19 19 namespace bdm{ -
library/bdm/base/user_info.cpp
r377 r384 106 106 const Setting& UI::SettingResolver::initialize_reference(UI_File *&file, const Setting &potential_link) 107 107 { 108 file = NULL; 109 108 110 if ( potential_link.getType() != Setting::TypeString ) 109 111 return potential_link; … … 122 124 else 123 125 { 124 file = NULL;125 126 result = &potential_link; 126 127 while ( !result->isRoot() ) -
library/bdm/base/user_info.h
r377 r384 8 8 9 9 #include "libconfig/libconfig.h++" 10 #include " bdmroot.h"10 #include "../bdmroot.h" 11 11 #include "itpp/itbase.h" 12 12 … … 17 17 18 18 #ifndef BDMLIB 19 //!Macro for registration of classes into map of UserInfos -- registered class is scriptable 19 20 #define UIREGISTER(class_name) template<> const Particular_UI<class_name>& Particular_UI<class_name>::ui = Particular_UI<class_name>(#class_name) 20 21 #else … … 231 232 { 232 233 T* instance; 233 from_setting<T>( to_child_setting( element, index ) );234 from_setting<T>( instance, to_child_setting( element, index ) ); 234 235 return instance; 235 236 }