Show
Ignore:
Timestamp:
11/08/09 22:07:31 (15 years ago)
Author:
mido
Message:

definitivne odstraneno epdf2mpdf a mepdf, rozpravano zacleneni testu mmixu pod pdf_harness

Files:
1 modified

Legend:

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

    r693 r711  
    496496        vec samplecond (const vec &cond); 
    497497 
     498        //! Load from structure with elements: 
     499        //!  \code 
     500        //! { class='mmix'; 
     501        //!   pdfs = (..., ...);     // list of pdfs in the mixture 
     502        //!   weights = ( 0.5, 0.5 ); // weights of pdfs in the mixture 
     503        //! } 
     504        //! \endcode 
     505        //!@} 
     506        void from_setting ( const Setting &set ) { 
     507                UI::get ( Coms, set, "pdfs", UI::compulsory ); 
     508 
     509                if( !UI::get( w, set, "weights", UI::optional ) ) 
     510                { 
     511                        int len = Coms.length(); 
     512                        w.set_length( len ); 
     513                        double default_weight = 1.0 / len; 
     514                        for( int i=0; i < len; i++) 
     515                                w(i) = default_weight; 
     516                } 
     517        } 
    498518}; 
     519UIREGISTER ( mmix ); 
    499520 
    500521}