Changeset 693 for library/bdm/stat

Show
Ignore:
Timestamp:
11/02/09 17:27:29 (15 years ago)
Author:
mido
Message:

mpdf renamed to pdf in the whole library

Location:
library/bdm/stat
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • library/bdm/stat/emix.cpp

    r675 r693  
    5454} 
    5555 
    56 shared_ptr<mpdf> emix::condition ( const RV &rv ) const { 
     56shared_ptr<pdf> emix::condition ( const RV &rv ) const { 
    5757        bdm_assert ( isnamed(), "rvs are not assigned" ); 
    5858        mratio *tmp = new mratio ( this, rv ); 
    59         return shared_ptr<mpdf>(tmp); 
     59        return shared_ptr<pdf>(tmp); 
    6060} 
    6161 
     
    203203}; 
    204204 
    205 void mprod::set_elements (const Array<shared_ptr<mpdf> > &mFacs ) { 
    206         mpdfs = mFacs; 
     205void mprod::set_elements (const Array<shared_ptr<pdf> > &mFacs ) { 
     206        pdfs = mFacs; 
    207207        dls.set_size ( mFacs.length() ); 
    208208 
    209         rv = get_composite_rv ( mpdfs, true ); 
     209        rv = get_composite_rv ( pdfs, true ); 
    210210        dim = rv._dsize(); 
    211211 
    212         for ( int i = 0; i < mpdfs.length(); i++ ) { 
    213                 RV rvx = mpdfs ( i )->_rvc().subt ( rv ); 
     212        for ( int i = 0; i < pdfs.length(); i++ ) { 
     213                RV rvx = pdfs ( i )->_rvc().subt ( rv ); 
    214214                rvc.add ( rvx ); // add rv to common rvc 
    215215        } 
    216216        dimc=rvc._dsize(); 
    217217 
    218         // rv and rvc established = > we can link them with mpdfs 
    219         for ( int i = 0; i < mpdfs.length(); i++ ) { 
     218        // rv and rvc established = > we can link them with pdfs 
     219        for ( int i = 0; i < pdfs.length(); i++ ) { 
    220220                dls ( i ) = new datalink_m2m; 
    221                 dls ( i )->set_connection ( mpdfs ( i )->_rv(), mpdfs ( i )->_rvc(), _rv(), _rvc() ); 
     221                dls ( i )->set_connection ( pdfs ( i )->_rv(), pdfs ( i )->_rvc(), _rv(), _rvc() ); 
    222222        } 
    223223} 
     
    239239 
    240240} 
    241 // mprod::mprod ( Array<mpdf*> mFacs, bool overlap) : mpdf ( RV(), RV() ), n ( mFacs.length() ), epdfs ( n ), mpdfs ( mFacs ), rvinds ( n ), rvcinrv ( n ), irvcs_rvc ( n ) { 
     241// mprod::mprod ( Array<pdf*> mFacs, bool overlap) : pdf ( RV(), RV() ), n ( mFacs.length() ), epdfs ( n ), pdfs ( mFacs ), rvinds ( n ), rvcinrv ( n ), irvcs_rvc ( n ) { 
    242242//              int i; 
    243243//              bool rvaddok; 
    244244//              // Create rv 
    245245//              for ( i = 0;i < n;i++ ) { 
    246 //                      rvaddok=rv.add ( mpdfs ( i )->_rv() ); //add rv to common rvs. 
    247 //                      // If rvaddok==false, mpdfs overlap => assert error. 
    248 //                      epdfs ( i ) = & ( mpdfs ( i )->posterior() ); // add pointer to epdf 
     246//                      rvaddok=rv.add ( pdfs ( i )->_rv() ); //add rv to common rvs. 
     247//                      // If rvaddok==false, pdfs overlap => assert error. 
     248//                      epdfs ( i ) = & ( pdfs ( i )->posterior() ); // add pointer to epdf 
    249249//              }; 
    250250//              // Create rvc 
    251251//              for ( i = 0;i < n;i++ ) { 
    252 //                      rvc.add ( mpdfs ( i )->_rvc().subt ( rv ) ); //add rv to common rvs. 
     252//                      rvc.add ( pdfs ( i )->_rvc().subt ( rv ) ); //add rv to common rvs. 
    253253//              }; 
    254254// 
    255255// //           independent = true; 
    256 //              //test rvc of mpdfs and fill rvinds 
     256//              //test rvc of pdfs and fill rvinds 
    257257//              for ( i = 0;i < n;i++ ) { 
    258258//                      // find ith rv in common rv 
    259 //                      rvsinrv ( i ) = mpdfs ( i )->_rv().dataind ( rv ); 
     259//                      rvsinrv ( i ) = pdfs ( i )->_rv().dataind ( rv ); 
    260260//                      // find ith rvc in common rv 
    261 //                      rvcinrv ( i ) = mpdfs ( i )->_rvc().dataind ( rv ); 
     261//                      rvcinrv ( i ) = pdfs ( i )->_rvc().dataind ( rv ); 
    262262//                      // find ith rvc in common rv 
    263 //                      irvcs_rvc ( i ) = mpdfs ( i )->_rvc().dataind ( rvc ); 
     263//                      irvcs_rvc ( i ) = pdfs ( i )->_rvc().dataind ( rvc ); 
    264264//                      // 
    265265// /*                   if ( rvcinrv ( i ).length() >0 ) {independent = false;} 
  • library/bdm/stat/emix.h

    r675 r693  
    3535At present the only supported operation is evallogcond(). 
    3636 */ 
    37 class mratio: public mpdf { 
     37class mratio: public pdf { 
    3838protected: 
    39         //! Nominator in the form of mpdf 
     39        //! Nominator in the form of pdf 
    4040        const epdf* nom; 
    4141 
     
    5050        //!Default constructor. By default, the given epdf is not copied! 
    5151        //! It is assumed that this function will be used only temporarily. 
    52         mratio ( const epdf* nom0, const RV &rv, bool copy = false ) : mpdf ( ), dl ( ) { 
     52        mratio ( const epdf* nom0, const RV &rv, bool copy = false ) : pdf ( ), dl ( ) { 
    5353                // adjust rv and rvc 
    5454 
     
    178178        //! Update already existing marginal density  \c target 
    179179        void marginal ( const RV &rv, emix &target ) const; 
    180         shared_ptr<mpdf> condition ( const RV &rv ) const; 
     180        shared_ptr<pdf> condition ( const RV &rv ) const; 
    181181 
    182182//Access methods 
     
    283283Note that 
    284284*/ 
    285 class mprod: public mpdf { 
     285class mprod: public pdf { 
    286286private: 
    287         Array<shared_ptr<mpdf> > mpdfs; 
    288  
    289         //! Data link for each mpdfs 
     287        Array<shared_ptr<pdf> > pdfs; 
     288 
     289        //! Data link for each pdfs 
    290290        Array<shared_ptr<datalink_m2m> > dls; 
    291291 
     
    300300        /*!\brief Constructor from list of mFacs 
    301301        */ 
    302         mprod ( const Array<shared_ptr<mpdf> > &mFacs ) { 
     302        mprod ( const Array<shared_ptr<pdf> > &mFacs ) { 
    303303                set_elements ( mFacs ); 
    304304        } 
    305         //! Set internal \c mpdfs from given values 
    306         void set_elements (const Array<shared_ptr<mpdf> > &mFacs ); 
     305        //! Set internal \c pdfs from given values 
     306        void set_elements (const Array<shared_ptr<pdf> > &mFacs ); 
    307307 
    308308        double evallogcond ( const vec &val, const vec &cond ) { 
    309309                int i; 
    310310                double res = 0.0; 
    311                 for ( i = mpdfs.length() - 1; i >= 0; i-- ) { 
    312                         /*                      if ( mpdfs(i)->_rvc().count() >0) { 
    313                                                         mpdfs ( i )->condition ( dls ( i )->get_cond ( val,cond ) ); 
     311                for ( i = pdfs.length() - 1; i >= 0; i-- ) { 
     312                        /*                      if ( pdfs(i)->_rvc().count() >0) { 
     313                                                        pdfs ( i )->condition ( dls ( i )->get_cond ( val,cond ) ); 
    314314                                                } 
    315315                                                // add logarithms 
    316316                                                res += epdfs ( i )->evallog ( dls ( i )->pushdown ( val ) );*/ 
    317                         res += mpdfs ( i )->evallogcond ( 
     317                        res += pdfs ( i )->evallogcond ( 
    318318                                   dls ( i )->pushdown ( val ), 
    319319                                   dls ( i )->get_cond ( val, cond ) 
     
    344344                vec smpi; 
    345345                // Hard assumption here!!! We are going backwards, to assure that samples that are needed from smp are already generated! 
    346                 for ( int i = ( mpdfs.length() - 1 ); i >= 0; i-- ) { 
    347                         // generate contribution of this mpdf 
    348                         smpi = mpdfs(i)->samplecond(dls ( i )->get_cond ( smp , cond ));                         
     346                for ( int i = ( pdfs.length() - 1 ); i >= 0; i-- ) { 
     347                        // generate contribution of this pdf 
     348                        smpi = pdfs(i)->samplecond(dls ( i )->get_cond ( smp , cond ));                  
    349349                        // copy contribution of this pdf into smp 
    350350                        dls ( i )->pushup ( smp, smpi ); 
     
    356356        //!  \code 
    357357        //! { class='mprod'; 
    358         //!   mpdfs = (..., ...);     // list of mpdfs in the order of chain rule 
     358        //!   pdfs = (..., ...);     // list of pdfs in the order of chain rule 
    359359        //! } 
    360360        //! \endcode 
    361361        //!@} 
    362362        void from_setting ( const Setting &set ) { 
    363                 Array<shared_ptr<mpdf> > atmp; //temporary Array 
    364                 UI::get ( atmp, set, "mpdfs", UI::compulsory ); 
     363                Array<shared_ptr<pdf> > atmp; //temporary Array 
     364                UI::get ( atmp, set, "pdfs", UI::compulsory ); 
    365365                set_elements ( atmp ); 
    366366        } 
     
    460460 
    461461 
    462 /*! \brief Mixture of mpdfs with constant weights, all mpdfs are of equal RV and RVC 
     462/*! \brief Mixture of pdfs with constant weights, all pdfs are of equal RV and RVC 
    463463 
    464464*/ 
    465 class mmix : public mpdf { 
     465class mmix : public pdf { 
    466466protected: 
    467         //! Component (mpdfs) 
    468         Array<shared_ptr<mpdf> > Coms; 
     467        //! Component (pdfs) 
     468        Array<shared_ptr<pdf> > Coms; 
    469469        //!weights of the components 
    470470        vec w; 
     
    474474 
    475475        //! Set weights \c w and components \c R 
    476         void set_parameters ( const vec &w0, const Array<shared_ptr<mpdf> > &Coms0 ) { 
     476        void set_parameters ( const vec &w0, const Array<shared_ptr<pdf> > &Coms0 ) { 
    477477                //!\todo check if all components are OK 
    478478                Coms = Coms0; 
  • library/bdm/stat/exp_family.h

    r679 r693  
    163163                vec variance() const {return diag (R.to_mat());} 
    164164//      mlnorm<sq_T>* condition ( const RV &rvn ) const ; <=========== fails to cmpile. Why? 
    165                 shared_ptr<mpdf> condition ( const RV &rvn ) const; 
     165                shared_ptr<pdf> condition ( const RV &rvn ) const; 
    166166 
    167167                // target not typed to mlnorm<sq_T, enorm<sq_T> > & 
     
    169169                // haven't finished defining enorm yet), but the type 
    170170                // is required 
    171                 void condition ( const RV &rvn, mpdf &target ) const; 
     171                void condition ( const RV &rvn, pdf &target ) const; 
    172172 
    173173                shared_ptr<epdf> marginal (const RV &rvn ) const; 
     
    367367*/ 
    368368 
    369 class mDirich: public mpdf_internal<eDirich> { 
     369class mDirich: public pdf_internal<eDirich> { 
    370370        protected: 
    371371                //! constant \f$ k \f$ of the random walk 
     
    376376                vec betac; 
    377377        public: 
    378                 mDirich(): mpdf_internal<eDirich>(), _beta(iepdf._beta()){}; 
     378                mDirich(): pdf_internal<eDirich>(), _beta(iepdf._beta()){}; 
    379379                void condition (const vec &val) {_beta =  val/k+betac; }; 
    380380                /*! Create Dirichlet random walk  
     
    391391                */ 
    392392                void from_setting (const Setting &set) { 
    393                         mpdf::from_setting (set); // reads rv and rvc 
     393                        pdf::from_setting (set); // reads rv and rvc 
    394394                        if (_rv()._dsize()>0){ 
    395395                                rvc = _rv().copy_t(-1); 
     
    408408                } 
    409409                void validate() {  
    410                         mpdf_internal<eDirich>::validate(); 
     410                        pdf_internal<eDirich>::validate(); 
    411411                        bdm_assert(_beta.length()==betac.length(),"beta0 and betac are not compatible"); 
    412412                        if (_rv()._dsize()>0){ 
     
    644644 
    645645//! Uniform density with conditional mean value 
    646 class mguni : public mpdf_internal<euni>{ 
     646class mguni : public pdf_internal<euni>{ 
    647647        //! function of the mean value 
    648648        shared_ptr<fnc> mean; 
     
    656656                //! load from 
    657657                void from_setting(const Setting &set){ 
    658                         mpdf::from_setting(set); //reads rv and rvc 
     658                        pdf::from_setting(set); //reads rv and rvc 
    659659                        UI::get(delta,set,"delta",UI::compulsory); 
    660660                        mean = UI::build<fnc>(set,"mean",UI::compulsory); 
     
    672672*/ 
    673673template < class sq_T, template <typename> class TEpdf = enorm > 
    674 class mlnorm : public mpdf_internal< TEpdf<sq_T> > 
     674class mlnorm : public pdf_internal< TEpdf<sq_T> > 
    675675{ 
    676676        protected: 
     
    683683                //! \name Constructors 
    684684                //!@{ 
    685                 mlnorm() : mpdf_internal< TEpdf<sq_T> >() {}; 
    686                 mlnorm (const mat &A, const vec &mu0, const sq_T &R) : mpdf_internal< TEpdf<sq_T> >() { 
     685                mlnorm() : pdf_internal< TEpdf<sq_T> >() {}; 
     686                mlnorm (const mat &A, const vec &mu0, const sq_T &R) : pdf_internal< TEpdf<sq_T> >() { 
    687687                        set_parameters (A, mu0, R); 
    688688                } 
     
    724724                */ 
    725725                void from_setting (const Setting &set) { 
    726                         mpdf::from_setting (set); 
     726                        pdf::from_setting (set); 
    727727 
    728728                        UI::get (A, set, "A", UI::compulsory); 
     
    734734                }; 
    735735                void validate() { 
    736                         mpdf_internal<TEpdf<sq_T> >::validate(); 
     736                        pdf_internal<TEpdf<sq_T> >::validate(); 
    737737                        bdm_assert (A.rows() == mu_const.length(), "mlnorm: A vs. mu mismatch"); 
    738738                        bdm_assert (A.rows() == _R().rows(), "mlnorm: A vs. R mismatch"); 
     
    747747SHAREDPTR2 ( mlnorm, chmat ); 
    748748 
    749 //! Mpdf with general function for mean value 
     749//! pdf with general function for mean value 
    750750template<class sq_T> 
    751 class mgnorm : public mpdf_internal< enorm< sq_T > > 
     751class mgnorm : public pdf_internal< enorm< sq_T > > 
    752752{ 
    753753        private: 
     
    757757        public: 
    758758                //!default constructor 
    759                 mgnorm() : mpdf_internal<enorm<sq_T> >() { } 
     759                mgnorm() : pdf_internal<enorm<sq_T> >() { } 
    760760                //!set mean function 
    761761                inline void set_parameters (const shared_ptr<fnc> &g0, const sq_T &R0); 
     
    782782 
    783783                void from_setting (const Setting &set) { 
    784                         mpdf::from_setting(set); 
     784                        pdf::from_setting(set); 
    785785                        shared_ptr<fnc> g = UI::build<fnc> (set, "g", UI::compulsory); 
    786786 
     
    863863The standard deviation of the walk is then: \f$\mu/\sqrt(k)\f$. 
    864864*/ 
    865 class mgamma : public mpdf_internal<egamma> 
     865class mgamma : public pdf_internal<egamma> 
    866866{ 
    867867        protected: 
     
    875875        public: 
    876876                //! Constructor 
    877                 mgamma() : mpdf_internal<egamma>(), k (0), 
     877                mgamma() : pdf_internal<egamma>(), k (0), 
    878878                                _beta (iepdf._beta()) { 
    879879                } 
     
    895895                */ 
    896896                void from_setting (const Setting &set) { 
    897                         mpdf::from_setting (set); // reads rv and rvc 
     897                        pdf::from_setting (set); // reads rv and rvc 
    898898                        vec betatmp; // ugly but necessary 
    899899                        UI::get (betatmp, set, "beta", UI::compulsory); 
     
    903903                } 
    904904                void validate() { 
    905                         mpdf_internal<egamma>::validate(); 
     905                        pdf_internal<egamma>::validate(); 
    906906                         
    907907                        dim = _beta.length(); 
     
    921921The standard deviation of the walk is then: \f$ \mu/\sqrt(k)\f$. 
    922922 */ 
    923 class migamma : public mpdf_internal<eigamma> 
     923class migamma : public pdf_internal<eigamma> 
    924924{ 
    925925        protected: 
     
    936936                //! \name Constructors 
    937937                //!@{ 
    938                 migamma() : mpdf_internal<eigamma>(), 
     938                migamma() : pdf_internal<eigamma>(), 
    939939                                k (0), 
    940940                                _alpha (iepdf._alpha()), 
     
    942942                } 
    943943 
    944                 migamma (const migamma &m) : mpdf_internal<eigamma>(), 
     944                migamma (const migamma &m) : pdf_internal<eigamma>(), 
    945945                                k (0), 
    946946                                _alpha (iepdf._alpha()), 
     
    10741074 
    10751075 */ 
    1076 class mlognorm : public mpdf_internal<elognorm> 
     1076class mlognorm : public pdf_internal<elognorm> 
    10771077{ 
    10781078        protected: 
     
    10841084        public: 
    10851085                //! Constructor 
    1086                 mlognorm() : mpdf_internal<elognorm>(), 
     1086                mlognorm() : pdf_internal<elognorm>(), 
    10871087                                sig2 (0), 
    10881088                                mu (iepdf._mu()) { 
     
    12211221 
    12221222//! Random Walk on inverse Wishart 
    1223 class rwiWishartCh : public mpdf_internal<eiWishartCh> 
     1223class rwiWishartCh : public pdf_internal<eiWishartCh> 
    12241224{ 
    12251225        protected: 
     
    14741474 
    14751475template<class sq_T> 
    1476 shared_ptr<mpdf> enorm<sq_T>::condition ( const RV &rvn ) const 
     1476shared_ptr<pdf> enorm<sq_T>::condition ( const RV &rvn ) const 
    14771477{ 
    14781478        mlnorm<sq_T> *tmp = new mlnorm<sq_T> (); 
    1479         shared_ptr<mpdf> narrow(tmp); 
     1479        shared_ptr<pdf> narrow(tmp); 
    14801480        condition ( rvn, *tmp ); 
    14811481        return narrow; 
     
    14831483 
    14841484template<class sq_T> 
    1485 void enorm<sq_T>::condition ( const RV &rvn, mpdf &target ) const 
     1485void enorm<sq_T>::condition ( const RV &rvn, pdf &target ) const 
    14861486{ 
    14871487        typedef mlnorm<sq_T> TMlnorm; 
  • library/bdm/stat/merger.cpp

    r682 r693  
    55namespace bdm { 
    66 
    7 merger_base::merger_base ( const Array<shared_ptr<mpdf> > &S ): 
     7merger_base::merger_base ( const Array<shared_ptr<pdf> > &S ): 
    88        Npoints(0), DBG(false), dbg_file(0) { 
    99        set_sources ( S ); 
     
    134134 
    135135 
    136                         sprintf ( dbg_str, "Mpdf%d", niter ); 
     136                        sprintf ( dbg_str, "pdf%d", niter ); 
    137137                        for ( int i = 0; i < Npoints; i++ ) { 
    138138                                Mix_pdf ( i ) = Mix.logpred ( Smp_ex.get_col ( i ) ); 
     
    145145                } 
    146146                //Importace weighting 
    147                 for ( int i = 0; i < mpdfs.length(); i++ ) { 
     147                for ( int i = 0; i < pdfs.length(); i++ ) { 
    148148                        lw_src = 0.0; 
    149149                        //======== Same RVs =========== 
    150150                        //Split according to dependency in rvs 
    151                         if ( mpdfs ( i )->dimension() == dim ) { 
     151                        if ( pdfs ( i )->dimension() == dim ) { 
    152152                                // no need for conditioning or marginalization 
    153                                 lw_src = mpdfs ( i )->evallogcond_m ( Smp , vec(0)); 
     153                                lw_src = pdfs ( i )->evallogcond_m ( Smp , vec(0)); 
    154154                        } else { 
    155155                                // compute likelihood of marginal on the conditional variable 
    156                                 if ( mpdfs ( i )->dimensionc() > 0 ) { 
     156                                if ( pdfs ( i )->dimensionc() > 0 ) { 
    157157                                        // Make marginal on rvc_i 
    158                                         shared_ptr<epdf> tmp_marg = Mpred->marginal ( mpdfs ( i )->_rvc() ); 
     158                                        shared_ptr<epdf> tmp_marg = Mpred->marginal ( pdfs ( i )->_rvc() ); 
    159159                                        //compute vector of lw_src 
    160160                                        for ( int k = 0; k < Npoints; k++ ) { 
    161                                                 // Here val of tmp_marg = cond of mpdfs(i) ==> calling dls->get_cond 
     161                                                // Here val of tmp_marg = cond of pdfs(i) ==> calling dls->get_cond 
    162162                                                lw_src ( k ) += tmp_marg->evallog ( dls ( i )->get_cond ( Smp ( k ) ) ); 
    163163                                        } 
     
    168168                                } 
    169169                                // Compute likelihood of the missing variable 
    170                                 if ( dim > ( mpdfs ( i )->dimension() + mpdfs ( i )->dimensionc() ) ) { 
     170                                if ( dim > ( pdfs ( i )->dimension() + pdfs ( i )->dimensionc() ) ) { 
    171171                                        /////////////// 
    172                                         // There are variales unknown to mpdfs(i) : rvzs 
    173                                         shared_ptr<mpdf> tmp_cond = Mpred->condition ( rvzs ( i ) ); 
     172                                        // There are variales unknown to pdfs(i) : rvzs 
     173                                        shared_ptr<pdf> tmp_cond = Mpred->condition ( rvzs ( i ) ); 
    174174                                        // Compute likelihood 
    175175                                        vec lw_dbg = lw_src; 
     
    187187                                // Compute likelihood of the partial source 
    188188                                for ( int k = 0; k < Npoints; k++ ) { 
    189                                         lw_src ( k ) += mpdfs ( i )->evallogcond ( dls ( i )->pushdown ( Smp ( k ) ),   
     189                                        lw_src ( k ) += pdfs ( i )->evallogcond ( dls ( i )->pushdown ( Smp ( k ) ),   
    190190                                                         dls ( i )->get_cond ( Smp ( k ) )); 
    191191                                } 
  • library/bdm/stat/merger.h

    r679 r693  
    4646protected: 
    4747        //! Elements of composition 
    48         Array<shared_ptr<mpdf> > mpdfs; 
    49  
    50         //! Data link for each mpdf in mpdfs 
     48        Array<shared_ptr<pdf> > pdfs; 
     49 
     50        //! Data link for each pdf in pdfs 
    5151        Array<datalink_m2e*> dls; 
    5252 
    53         //! Array of rvs that are not modelled by mpdfs at all, \f$ z_i \f$ 
     53        //! Array of rvs that are not modelled by pdfs at all, \f$ z_i \f$ 
    5454        Array<RV> rvzs; 
    5555 
     
    9090 
    9191        //!Constructor from sources 
    92         merger_base ( const Array<shared_ptr<mpdf> > &S ); 
     92        merger_base ( const Array<shared_ptr<pdf> > &S ); 
    9393 
    9494        //! Function setting the main internal structures 
    95         void set_sources ( const Array<shared_ptr<mpdf> > &Sources ) { 
    96                 mpdfs = Sources; 
    97                 Nsources = mpdfs.length(); 
     95        void set_sources ( const Array<shared_ptr<pdf> > &Sources ) { 
     96                pdfs = Sources; 
     97                Nsources = pdfs.length(); 
    9898                //set sizes 
    9999                dls.set_size ( Sources.length() ); 
     
    101101                zdls.set_size ( Sources.length() ); 
    102102 
    103                 rv = get_composite_rv ( mpdfs, /* checkoverlap = */ false ); 
     103                rv = get_composite_rv ( pdfs, /* checkoverlap = */ false ); 
    104104 
    105105                RV rvc; 
    106106                // Extend rv by rvc! 
    107                 for ( int i = 0; i < mpdfs.length(); i++ ) { 
    108                         RV rvx = mpdfs ( i )->_rvc().subt ( rv ); 
     107                for ( int i = 0; i < pdfs.length(); i++ ) { 
     108                        RV rvx = pdfs ( i )->_rvc().subt ( rv ); 
    109109                        rvc.add ( rvx ); // add rv to common rvc 
    110110                } 
     
    117117                // create links between sources and common rv 
    118118                RV xytmp; 
    119                 for ( int i = 0; i < mpdfs.length(); i++ ) { 
    120                         //Establich connection between mpdfs and merger 
     119                for ( int i = 0; i < pdfs.length(); i++ ) { 
     120                        //Establich connection between pdfs and merger 
    121121                        dls ( i ) = new datalink_m2e; 
    122                         dls ( i )->set_connection ( mpdfs ( i )->_rv(), mpdfs ( i )->_rvc(), rv ); 
    123  
    124                         // find out what is missing in each mpdf 
    125                         xytmp = mpdfs ( i )->_rv(); 
    126                         xytmp.add ( mpdfs ( i )->_rvc() ); 
     122                        dls ( i )->set_connection ( pdfs ( i )->_rv(), pdfs ( i )->_rvc(), rv ); 
     123 
     124                        // find out what is missing in each pdf 
     125                        xytmp = pdfs ( i )->_rv(); 
     126                        xytmp.add ( pdfs ( i )->_rvc() ); 
    127127                        // z_i = common_rv-xy 
    128128                        rvzs ( i ) = rv.subt ( xytmp ); 
     
    185185                //check if sources overlap: 
    186186                bool OK = true; 
    187                 for ( int i = 0; i < mpdfs.length(); i++ ) { 
     187                for ( int i = 0; i < pdfs.length(); i++ ) { 
    188188                        OK &= ( rvzs ( i )._dsize() == 0 ); // z_i is empty 
    189                         OK &= ( mpdfs ( i )->_rvc()._dsize() == 0 ); // y_i is empty 
     189                        OK &= ( pdfs ( i )->_rvc()._dsize() == 0 ); // y_i is empty 
    190190                } 
    191191 
    192192                if ( OK ) { 
    193                         mat lW = zeros ( mpdfs.length(), eSmp._w().length() ); 
     193                        mat lW = zeros ( pdfs.length(), eSmp._w().length() ); 
    194194 
    195195                        vec emptyvec ( 0 ); 
    196                         for ( int i = 0; i < mpdfs.length(); i++ ) { 
     196                        for ( int i = 0; i < pdfs.length(); i++ ) { 
    197197                                for ( int j = 0; j < eSmp._w().length(); j++ ) { 
    198                                         lW ( i, j ) = mpdfs ( i )->evallogcond ( eSmp._samples() ( j ), emptyvec ); 
     198                                        lW ( i, j ) = pdfs ( i )->evallogcond ( eSmp._samples() ( j ), emptyvec ); 
    199199                                } 
    200200                        } 
     
    313313        merger_mix ():Ncoms(0), effss_coef(0), stop_niter(0) { } 
    314314 
    315         merger_mix ( const Array<shared_ptr<mpdf> > &S ): 
     315        merger_mix ( const Array<shared_ptr<pdf> > &S ): 
    316316                Ncoms(0), effss_coef(0), stop_niter(0) { 
    317317                set_sources ( S ); 
     
    319319 
    320320        //! Set sources and prepare all internal structures 
    321         void set_sources ( const Array<shared_ptr<mpdf> > &S ) { 
     321        void set_sources ( const Array<shared_ptr<pdf> > &S ) { 
    322322                merger_base::set_sources ( S ); 
    323323                Nsources = S.length();