| 75 | /*! \brief Mixture of mpdfs with constant weights |
| 76 | |
| 77 | */ |
| 78 | class mmix : public mpdf { |
| 79 | protected: |
| 80 | //! Component (epdfs) |
| 81 | Array<mpdf*> Coms; |
| 82 | //!Internal epdf |
| 83 | emix Epdf; |
| 84 | public: |
| 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 | }; |