Changeset 384 for library/bdm/base

Show
Ignore:
Timestamp:
06/19/09 10:17:25 (15 years ago)
Author:
mido
Message:

possibly broken?

Location:
library/bdm
Files:
1 added
10 moved

Legend:

Unmodified
Added
Removed
  • library/bdm/base/bdmbase.cpp

    r377 r384  
    11 
    2 #include "libBM.h" 
     2#include "bdmbase.h" 
    33 
    44//! Space of basic BDM structures 
     
    255255        RV rv; //empty rv 
    256256        bool rvaddok; 
    257         for ( int i = 0;i < n;i++ ) { 
     257        for ( int i = 0;i < mpdfs.length();i++ ) { 
    258258                rvaddok=rv.add ( mpdfs ( i )->_rv() ); //add rv to common rvs. 
    259259                // If rvaddok==false, mpdfs overlap => assert error. 
     
    264264 
    265265void compositepdf::setrvc ( const RV &rv, RV &rvc ) { 
    266         for ( int i = 0;i < n;i++ ) { 
     266        for ( int i = 0;i < mpdfs.length();i++ ) { 
    267267                RV rvx = mpdfs ( i )->_rvc().subt ( rv ); 
    268268                rvc.add ( rvx ); //add rv to common rvc 
  • library/bdm/base/bdmbase.h

    r377 r384  
    1111*/ 
    1212 
    13 #ifndef BM_H 
    14 #define BM_H 
     13#ifndef BDMBASE_H 
     14#define BDMBASE_H 
    1515 
    1616#include <map> 
     
    1818#include "../itpp_ext.h" 
    1919#include "../bdmroot.h" 
    20 #include "../user_info.h" 
     20#include "user_info.h" 
    2121 
    2222 
     
    566566 
    567567*/ 
    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 
     568class mepdf : public mpdf { 
     569        bool owning_ep; // flag trigers deleting ep by destructor 
     570public: 
     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.  
    578579//!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); ?? 
     581class compositepdf { 
    581582protected: 
    582583  //!Number of mpdfs in the composite 
     
    786787 
    787788}; //namespace 
    788 #endif // BM_H 
     789#endif // BDMBASE_H 
  • library/bdm/base/datasources.cpp

    r377 r384  
    11 
    2 #include "libDS.h" 
     2#include "datasources.h" 
    33 
    44using namespace bdm; 
  • library/bdm/base/datasources.h

    r377 r384  
    1111*/ 
    1212 
    13 #ifndef DS_H 
    14 #define DS_H 
    15  
    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" 
    2020 
    2121namespace bdm { 
  • library/bdm/base/loggers.h

    r377 r384  
    1414#define LGR_H 
    1515 
    16 #include "libBM.h" 
    17 #include "../user_info.h" 
     16#include "base/bdmbase.h" 
     17#include "../base/user_info.h" 
    1818 
    1919namespace bdm{ 
  • library/bdm/base/user_info.cpp

    r377 r384  
    106106const Setting& UI::SettingResolver::initialize_reference(UI_File *&file, const Setting &potential_link) 
    107107{ 
     108        file = NULL; 
     109 
    108110    if ( potential_link.getType() !=  Setting::TypeString ) 
    109111            return potential_link; 
     
    122124    else 
    123125        { 
    124                 file = NULL; 
    125126                result = &potential_link; 
    126127        while ( !result->isRoot() ) 
  • library/bdm/base/user_info.h

    r377 r384  
    88 
    99#include "libconfig/libconfig.h++" 
    10 #include "bdmroot.h" 
     10#include "../bdmroot.h" 
    1111#include "itpp/itbase.h" 
    1212 
     
    1717 
    1818#ifndef BDMLIB  
     19//!Macro for registration of classes into map of UserInfos -- registered class is scriptable  
    1920#define UIREGISTER(class_name) template<> const Particular_UI<class_name>& Particular_UI<class_name>::ui = Particular_UI<class_name>(#class_name)  
    2021#else 
     
    231232        { 
    232233                T* instance; 
    233                 from_setting<T>( to_child_setting( element, index ) ); 
     234                from_setting<T>( instance, to_child_setting( element, index ) ); 
    234235                return instance; 
    235236        }