Show
Ignore:
Timestamp:
05/19/10 03:56:03 (14 years ago)
Author:
sarka
Message:

to_setting

Files:
1 modified

Legend:

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

    r799 r956  
    166166 
    167167        //! load from setting 
    168         void from_setting ( const Setting& set ) { 
    169                 // get support 
    170                 // find which method to use 
    171                 string meth_str; 
    172                 UI::get<string> ( meth_str, set, "method", UI::compulsory ); 
    173                 if ( !strcmp ( meth_str.c_str(), "arithmetic" ) ) 
    174                         set_method ( ARITHMETIC ); 
    175                 else { 
    176                         if ( !strcmp ( meth_str.c_str(), "geometric" ) ) 
    177                                 set_method ( GEOMETRIC ); 
    178                         else if ( !strcmp ( meth_str.c_str(), "lognormal" ) ) { 
    179                                 set_method ( LOGNORMAL ); 
    180                                 set.lookupValue ( "beta", beta ); 
    181                         } 
    182                 } 
    183                 string dbg_file; 
    184                 if ( UI::get ( dbg_file, set, "dbg_file" ) ) 
    185                         set_debug_file ( dbg_file ); 
    186                 //validate() - not used 
    187         } 
    188  
    189         void validate() { 
    190 //              bdm_assert ( eSmp._w().length() > 0, "Empty support, use set_support()." ); 
    191 //              bdm_assert ( dim == eSmp._samples() ( 0 ).length(), "Support points and rv are not compatible!" ); 
    192                 bdm_assert ( isnamed(), "mergers must be named" ); 
    193         } 
     168        void from_setting ( const Setting& set ); 
     169         
     170        void to_setting  (Setting  &set) const ; 
     171 
     172        void validate() ; 
    194173        //!@} 
    195174}; 
     
    268247        } 
    269248        //! from_settings 
    270         void from_setting ( const Setting& set ) { 
    271                 merger_base::from_setting ( set ); 
    272                 Ncoms=DFLT_Ncoms; 
    273                 UI::get( Ncoms, set, "ncoms", UI::optional ); 
    274                 effss_coef=DFLT_effss_coef; 
    275                 UI::get (effss_coef , set,  "effss_coef", UI::optional); 
    276                 stop_niter=10; 
    277                 UI::get ( stop_niter, set,"stop_niter", UI::optional ); 
    278                  
    279                 validate(); 
    280         } 
    281         void validate() { 
    282                 bdm_assert(Ncoms>0,"Ncoms too small"); 
    283         } 
     249        void from_setting ( const Setting& set ); 
     250        void    to_setting  (Setting  &set) const; 
     251        void validate(); 
    284252 
    285253        //! @}