Changeset 700 for library/bdm/base

Show
Ignore:
Timestamp:
11/04/09 22:54:58 (15 years ago)
Author:
smidl
Message:

Making tutorial/userguide example work again (changes of mpdf and bayes)

Location:
library/bdm/base
Files:
3 modified

Legend:

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

    r693 r700  
    5353                id = iter->second; 
    5454                if (size>0){ 
    55                         bdm_assert ( SIZES ( id ) == size, "RV " + name + " of different size already exists" ); 
     55                        bdm_assert ( SIZES ( id ) == size, "RV " + name + " of size " + num2str(SIZES(id)) + " exists, requested size " + num2str(size) + "can not be assigned" ); 
    5656                } 
    5757        } 
  • library/bdm/base/bdmbase.h

    r693 r700  
    266266        //! Minimum time-offset 
    267267        int mint() const { 
    268                         return times.length()>0 ? min (times) : 0; 
     268                return times.length()>0 ? min (times) : 0; 
     269        } 
     270        //! Minimum time-offset of ids of given RVs 
     271        int mint(const RV &rv) const { 
     272                bvec belong=zeros_b(len); 
     273                for (int r=0; r<rv.length(); r++){ 
     274                        belong = belong | (ids == rv.id(r)); 
     275                } 
     276                return times.length()>0 ? min (times(belong)) : 0; 
    269277        } 
    270278        //!@} 
     
    598606                        logrec->L.logit( logrec->ids(0), mean() ); 
    599607                } 
    600                 if (log_level>2) { 
     608                if (log_level>1) { 
    601609                        vec lb; vec ub; 
    602610                        qbounds(lb,ub); 
     
    913921                //establish c2c connection 
    914922                rvc.dataind ( rvc_up, c2c_lo, c2c_up ); 
    915                 bdm_assert_debug ( c2c_lo.length() + v2c_lo.length() == condsize, "cond is not fully given" ); 
     923//              bdm_assert_debug ( c2c_lo.length() + v2c_lo.length() == condsize, "cond is not fully given" ); 
    916924        } 
    917925 
     
    919927        vec get_cond ( const vec &val_up, const vec &cond_up ) { 
    920928                vec tmp ( condsize ); 
    921                 set_subvector ( tmp, v2c_lo, val_up ( v2c_up ) ); 
    922                 set_subvector ( tmp, c2c_lo, cond_up ( c2c_up ) ); 
     929                fill_cond (val_up, cond_up, tmp ); 
    923930                return tmp; 
     931        } 
     932        //! fill condition  
     933        void fill_cond ( const vec &val_up, const vec &cond_up, vec& cond_out){ 
     934                bdm_assert_debug(cond_out.length()>=condsize,"dl.fill_cond: cond_out is too small"); 
     935                set_subvector ( cond_out, v2c_lo, val_up ( v2c_up ) ); 
     936                set_subvector ( cond_out, c2c_lo, cond_up ( c2c_up ) ); 
    924937        } 
    925938        //! Fill 
     
    10771090 
    10781091        BM() : yrv(),dimy(0),rvc(),dimc(0), ll ( 0 ), evalll ( true ) { }; 
    1079         BM ( const BM &B ) :  yrv ( B.yrv ), dimy(B.dimy), rvc ( B.rvc ), ll ( B.ll ), evalll ( B.evalll ) {} 
     1092//      BM ( const BM &B ) :  yrv ( B.yrv ), dimy(B.dimy), rvc ( B.rvc ),dimc(B.dimc), ll ( B.ll ), evalll ( B.evalll ) {} 
    10801093        //! \brief Copy function required in vectors, Arrays of BM etc. Have to be DELETED manually! 
    10811094        //! Prototype: \code BM* _copy_() const {return new BM(*this);} \endcode 
  • library/bdm/base/datasources.h

    r697 r700  
    132132                        dt =  zeros(iepdf->dimension()); 
    133133                        dtsize=dt.length(); 
     134                        ytsize=dt.length(); 
    134135                        set_drv(iepdf->_rv(),RV()); 
    135136                        utsize =0; 
     
    365366                class = "stateDS"; 
    366367                //Internal model 
    367                 IM = { type = "mpdf-offspring"; }; 
     368                IM = { type = "pdf-offspring"; }; 
    368369                //Observation model 
    369                 OM = { type = "mpdf-offspring"; } 
     370                OM = { type = "pdf-offspring"; } 
    370371                //initial state 
    371372                x0 = [...]; //vector of data