Changeset 124 for bdm/stat/emix.h

Show
Ignore:
Timestamp:
06/20/08 11:16:12 (16 years ago)
Author:
smidl
Message:

zmeny v mmix

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • bdm/stat/emix.h

    r115 r124  
    6969        Array<mpdf*> mpdfs; 
    7070public: 
    71          
    72          
     71 
     72 
    7373}; 
    7474 
     75/*! \brief Mixture of mpdfs with constant weights 
     76 
     77*/ 
     78class mmix : public mpdf { 
     79protected: 
     80        //! Component (epdfs) 
     81        Array<mpdf*> Coms; 
     82        //!Internal epdf 
     83        emix Epdf; 
     84public: 
     85        //!Default constructor 
     86        mmix ( RV &rv, RV &rvc ) : mpdf ( rv, rvc ), Epdf ( rv ) {ep=&Epdf;}; 
     87        //! Set weights \c w and components \c R 
     88        void set_parameters ( const vec &w, const Array<mpdf*> &Coms ) { 
     89                Array<epdf*> Eps ( Coms.length()); 
     90 
     91                for ( int i=0;i<Coms.length();i++ ) {mpdf* Ci=Coms(i); 
     92                 Eps ( i ) =& ( Coms ( i )->_epdf() );} 
     93                Epdf.set_parameters ( w,Eps ); 
     94        }; 
     95 
     96        void condition ( const vec &cond ) { 
     97                for ( int i=0;i<Coms.length();i++ ) {Coms ( i )->condition ( cond );} 
     98        }; 
     99}; 
    75100#endif //MX_H