Changeset 1079
- Timestamp:
- 06/10/10 21:54:57 (15 years ago)
- Files:
-
- 13 modified
Legend:
- Unmodified
- Added
- Removed
-
applications/bdmtoolbox/mex/merger.cpp
r801 r1079 59 59 Array<shared_ptr<pdf> > Sources; 60 60 UI::get(Sources, Cfg, "Sources", UI::compulsory); 61 shared_ptr< merger_base> Merger = UI::build<merger_base> ( Cfg, "Merger" );61 shared_ptr<MergerDiscrete> Merger = UI::build<MergerDiscrete> ( Cfg, "Merger" ); 62 62 63 63 // Support … … 82 82 for ( int i = 0;i < Sources.length();i++ ) { 83 83 datalink_m2e dl; 84 dl.set_connection ( Sources ( i )->_rv(), Sources ( i )->_rvc(), Merger-> _rv() );84 dl.set_connection ( Sources ( i )->_rv(), Sources ( i )->_rvc(), Merger->merger()._rv() ); 85 85 86 86 vec ll ( Merger->_Smp()._samples().length() ); … … 102 102 vec ll ( Merger->_Smp()._samples().length() ); 103 103 for ( int j = 0; j < Merger->_Smp()._samples().length(); j++ ) { 104 ll ( j ) = Mer ger->evallog ( Merger->_Smp()._samples() ( j ));104 ll ( j ) = MerMix->merger()._w ()(j); 105 105 } 106 106 -
applications/bdmtoolbox/tutorial/merging/merge_grid.m
r706 r1079 6 6 7 7 % merger 8 Merger.class=' merger_base';8 Merger.class='MergerDiscrete'; 9 9 Merger.beta=1; 10 10 … … 48 48 49 49 % 2D support 50 type= 1;50 type=0; 51 51 if type==0 52 52 support2.class='rectangular_support'; -
applications/bdmtoolbox/tutorial/merging/merge_mix.m
r706 r1079 1 1 % Random Variables 2 a= struct('class','RV','names',{{'a'}});3 b= struct('class','RV','names',{{'b'}});4 ab= struct('class','RV','names',{{'a','b'}});2 a=RV('a'); 3 b=RV('b'); 4 ab=RV({'a','b'}); 5 5 6 6 % Sources … … 17 17 18 18 % merger 19 merger.class='merger_mix';20 merger.method='lognormal';21 merger.beta=2;22 merger.ncoms=20;23 merger.stop_niter=5;24 merger.effss_coef=1;19 M.class='merger_mix'; 20 M.method='lognormal'; 21 M.beta=2; 22 M.ncoms=20; 23 M.stop_niter=5; 24 M.effss_coef=1; 25 25 %merger.dbg_file='merger_mix_dbg'; 26 26 27 27 % support 28 support.grid={[-5,5]}; 29 support.nbins=[100]; 28 support.class='rectangular_support'; 29 support.ranges={[-5,5]}; 30 support.gridsizes=[100]; 30 31 31 32 % 1D 32 [vy]=merger _mx({f1,f2},support,merger)33 [vy]=merger({f1,f2},support,M) 33 34 figure(1) 34 35 hold off … … 48 49 'rv', ab); 49 50 f4 = struct('class','egiw',... 50 ' V',4*[5 2; 2 1],...51 'fV',4*[5 2; 2 1],... 51 52 'nu', 4,... 52 53 'dimx', 1,... 53 54 'rv', ab); 54 55 % 2D support 55 support2.grid={[-5,5],[0.001,5]}; 56 support2.nbins=[20,20]; 56 support2.class='rectangular_support'; 57 support2.ranges={[-5,5],[0.001,5]}; 58 support2.gridsizes=[20,20]; 57 59 58 60 % 2D 59 vy2=merger _mx({f3,f4},support2,merger)60 X=zeros(support2. nbins(1));61 Y=zeros(support2. nbins(1));62 Z=zeros(support2. nbins(1));61 vy2=merger({f3,f4},support2,M) 62 X=zeros(support2.gridsizes(1)); 63 Y=zeros(support2.gridsizes(1)); 64 Z=zeros(support2.gridsizes(1)); 63 65 64 66 figure(2); -
applications/bdmtoolbox/tutorial/merging/pdfs.m
r803 r1079 33 33 'rv', ab); 34 34 GiW = struct('class','egiw',... 35 ' V',4*[2^2+1 2; 2 1],...35 'fV',4*[2^2+1 2; 2 1],... 36 36 'nu', 8,... 37 37 'dimx', 1,... -
library/bdm/base/user_info.cpp
r1064 r1079 382 382 if(element.exists("L")) { 383 383 UI::from_setting(matrix.__L(), element["L"]); 384 } 384 } else { 385 throw UISettingException ( "UIException: ldmat must contain matrix L.", element); 386 } 385 387 if(element.exists("D")) { 386 388 UI::from_setting(matrix.__D(), element["D"]); 387 } 389 } else { 390 throw UISettingException ( "UIException: ldmat must contain vector D.", element); 391 } 388 392 matrix.validate(); 389 393 } -
library/bdm/math/square_mat.h
r1064 r1079 324 324 } 325 325 void validate() { 326 bdm_assert(L.rows()==D.length(),"Incompatible L and D in ldmat"); 326 327 dim= L.rows(); 327 328 } -
library/bdm/mpdm/arx_agent.h
r1064 r1079 86 86 merger->merge(); 87 87 enorm<chmat> joint_pred; 88 mat Cov=merger-> covariance();88 mat Cov=merger->merger().covariance(); 89 89 if (sumsum(Cov)==0.0) { 90 90 bdm_error("merging failed"); 91 91 } 92 joint_pred.set_parameters(merger->me an(), Cov);93 joint_pred.set_rv(merger-> _rv());92 joint_pred.set_parameters(merger->merger().mean(), Cov); 93 joint_pred.set_rv(merger->merger()._rv()); 94 94 95 95 enorm<chmat> marg_pred; // remove rvs taht should not be there -
library/bdm/stat/exp_family.cpp
r1068 r1079 323 323 } 324 324 mat Vful; 325 if (!UI::get(V, set, "V", UI::optional)) { 326 if ( !UI::get ( Vful, set, "V", UI::optional ) ) { 325 if (set.exists("V.L")){ 326 UI::get(V, set, "V", UI::optional); 327 } else { 328 if ( !UI::get ( Vful, set, "fV", UI::optional ) ) { 327 329 vec dV; 328 330 UI::get ( dV, set, "dV", UI::compulsory ); … … 346 348 nPsi = V.rows() - dimx; 347 349 dim = dimx * ( dimx + nPsi ); 348 350 if (dim<dimx) {bdm_error("Check if matrix V has correct dimension");} 351 349 352 if ( nu < 0 ) { 350 353 nu = 0.1 + nPsi + 2 * dimx + 2; // +2 assures finite expected value of R -
library/bdm/stat/exp_family.h
r1077 r1079 484 484 V.L = [...]; % L part of matrix V 485 485 V.D = [...]; % D part of matrix V 486 -or- V= [...]; % full matrix V486 -or- fV = [...]; % full matrix V 487 487 -or- dV = [...]; % vector of diagonal of V (when V not given) 488 488 -
library/bdm/stat/merger.cpp
r1068 r1079 5 5 namespace bdm { 6 6 7 merger_base::merger_base ( const Array<shared_ptr<pdf> > &S ) :7 MergerDiscrete::MergerDiscrete ( const Array<shared_ptr<pdf> > &S ) : 8 8 Npoints ( 0 ), DBG ( false ), dbg_file ( 0 ) { 9 9 set_sources ( S ); … … 11 11 12 12 13 void merger_base::set_sources ( const Array<shared_ptr<pdf> > &Sources ) {14 p dfs =Sources;15 Nsources = p dfs.length();13 void MergerDiscrete::set_sources ( const Array<shared_ptr<pdf> > &PartSources ) { 14 part_sources = PartSources; 15 Nsources = part_sources.length(); 16 16 //set sizes 17 dls.set_size ( Sources.length() ); 18 rvzs.set_size ( Sources.length() ); 19 zdls.set_size ( Sources.length() ); 20 21 rv = get_composite_rv ( pdfs, /* checkoverlap = */ false ); 17 sources.set_size ( Nsources); 18 dls.set_size ( Nsources ); 19 rvzs.set_size ( Nsources ); 20 zdls.set_size ( Nsources ); 21 22 RV rv = get_composite_rv ( part_sources, /* checkoverlap = */ false ); 22 23 23 24 RV rvc; 24 25 // Extend rv by rvc! 25 for ( int i = 0; i < pdfs.length(); i++ ) {26 RV rvx = p dfs ( i )->_rvc().subt ( rv );26 for ( int i = 0; i < sources.length(); i++ ) { 27 RV rvx = part_sources ( i )->_rvc().subt ( rv ); 27 28 rvc.add ( rvx ); // add rv to common rvc 28 29 } … … 30 31 // join rv and rvc - see descriprion 31 32 rv.add ( rvc ); 32 // get dimension 33 dim = rv._dsize(); 34 33 35 34 // create links between sources and common rv 36 35 RV xytmp; 37 for ( int i = 0; i < p dfs.length(); i++ ) {36 for ( int i = 0; i < part_sources.length(); i++ ) { 38 37 //Establich connection between pdfs and merger 39 38 dls ( i ) = new datalink_m2e; 40 dls ( i )->set_connection ( pdfs ( i )->_rv(), pdfs( i )->_rvc(), rv );39 dls ( i )->set_connection ( part_sources ( i )->_rv(), part_sources( i )->_rvc(), rv ); 41 40 42 41 // find out what is missing in each pdf 43 xytmp = p dfs ( i )->_rv();44 xytmp.add ( pdfs ( i )->_rvc() );42 xytmp = part_sources ( i )->_rv(); 43 xytmp.add ( part_sources ( i )->_rvc() ); 45 44 // z_i = common_rv-xy 46 45 rvzs ( i ) = rv.subt ( xytmp ); … … 49 48 zdls ( i )->set_connection ( rvzs ( i ), xytmp, rv ) ; 50 49 }; 51 } 52 53 void merger_base::set_support ( rectangular_support &Sup ) { 50 51 // 52 merger().set_rv(rv); 53 } 54 55 void MergerDiscrete::set_support ( rectangular_support &Sup ) { 54 56 Npoints = Sup.points(); 55 57 eSmp.set_parameters ( Npoints, false ); … … 61 63 samples ( j ) = Sup.next_vec(); 62 64 } 63 } 64 65 void merger_base::merge () { 65 eSmp.validate(); 66 } 67 68 void MergerDiscrete::merge () { 66 69 validate(); 67 70 68 71 //check if sources overlap: 69 72 bool OK = true; 70 for ( int i = 0; i < p dfs.length(); i++ ) {73 for ( int i = 0; i < part_sources.length(); i++ ) { 71 74 OK &= ( rvzs ( i )._dsize() == 0 ); // z_i is empty 72 OK &= ( p dfs ( i )->_rvc()._dsize() == 0 ); // y_i is empty75 OK &= ( part_sources ( i )->_rvc()._dsize() == 0 ); // y_i is empty 73 76 } 74 77 75 78 if ( OK ) { 76 mat lW = zeros ( p dfs.length(), eSmp._w().length() );79 mat lW = zeros ( part_sources.length(), eSmp._w().length() ); 77 80 78 81 vec emptyvec ( 0 ); 79 for ( int i = 0; i < p dfs.length(); i++ ) {82 for ( int i = 0; i < part_sources.length(); i++ ) { 80 83 for ( int j = 0; j < eSmp._w().length(); j++ ) { 81 lW ( i, j ) = p dfs ( i )->evallogcond ( eSmp._samples() ( j ), emptyvec );84 lW ( i, j ) = part_sources ( i )->evallogcond ( eSmp._samples() ( j ), emptyvec ); 82 85 } 83 86 } … … 92 95 } 93 96 94 vec merger_base::merge_points ( mat &lW ) {97 vec MergerDiscrete::merge_points ( mat &lW ) { 95 98 int nu = lW.rows(); 96 99 vec result; … … 144 147 } 145 148 146 vec merger_base::mean() const { 147 const Vec<double> &w = eSmp._w(); 148 const Array<vec> &S = eSmp._samples(); 149 vec tmp = zeros ( dim ); 150 for ( int i = 0; i < Npoints; i++ ) { 151 tmp += w ( i ) * S ( i ); 152 } 153 return tmp; 154 } 155 156 mat merger_base::covariance() const { 157 const vec &w = eSmp._w(); 158 const Array<vec> &S = eSmp._samples(); 159 160 vec mea = mean(); 161 162 // cout << sum (w) << "," << w*w << endl; 163 164 mat Tmp = zeros ( dim, dim ); 165 for ( int i = 0; i < Npoints; i++ ) { 166 vec tmp=S ( i )-mea; //inefficient but numerically stable 167 Tmp += w ( i ) * outer_product (tmp , tmp ); 168 } 169 return Tmp; 170 } 171 172 vec merger_base::variance() const { 173 return eSmp.variance(); 174 } 175 176 177 void merger_base::from_setting ( const Setting& set ) { 149 void MergerDiscrete::from_setting ( const Setting& set ) { 178 150 // get support 179 151 // find which method to use 180 epdf::from_setting (set);181 152 string meth_str; 182 153 UI::get( meth_str, set, "method", UI::compulsory ); … … 197 168 } 198 169 199 void merger_base::to_setting (Setting &set) const { 200 epdf::to_setting(set); 201 170 void MergerDiscrete::to_setting (Setting &set) const { 202 171 UI::save( METHOD, set, "method"); 203 172 … … 209 178 } 210 179 211 void merger_base::validate() {180 void MergerDiscrete::validate() { 212 181 // bdm_assert ( eSmp._w().length() > 0, "Empty support, use set_support()." ); 213 182 // bdm_assert ( dim == eSmp._samples() ( 0 ).length(), "Support points and rv are not compatible!" ); 214 epdf::validate(); 215 bdm_assert ( isnamed(), "mergers must be named" ); 216 } 217 218 // DEFAULTS FOR MERGER_BASE 219 const MERGER_METHOD merger_base::DFLT_METHOD = LOGNORMAL; 220 const double merger_base::DFLT_beta = 1.2; 183 MergerBase::validate(); 184 //bdm_assert ( merger().isnamed(), "mergers must be named" ); 185 } 221 186 222 187 void merger_mix::merge ( ) { 188 int dim = eSmp.dimension(); 223 189 if(Npoints<1) { 224 190 set_support(enorm<fsqmat>(zeros(dim), eye(dim)), 1000); … … 231 197 vec &w = eSmp._w(); //aux 232 198 233 mat Smp_ex = ones ( dim + 1, Npoints ); // Extended samples for the ARX model - the last row is ones199 mat Smp_ex = ones ( dim, Npoints ); // Extended samples for the ARX model 234 200 for ( int i = 0; i < Npoints; i++ ) { 235 201 set_col_part ( Smp_ex, i, Smp ( i ) ); … … 242 208 vec lw_mix ( Npoints ); // weights of the approximating mixture 243 209 vec lw ( Npoints ); // tmp 244 mat lW = zeros ( Nsources, Npoints ); // array of weights of all sources210 mat lW = zeros ( Nsources, Npoints ); // array of weights of all part_sources 245 211 vec vec0 ( 0 ); 246 212 … … 263 229 char dbg_str[100]; 264 230 265 emix*Mpred = Mix.epredictor ( );231 emix *Mpred = Mix.epredictor ( ); 266 232 vec Mix_pdf ( Npoints ); 267 233 while ( !converged ) { … … 272 238 delete Mpred; 273 239 Mpred = Mix.epredictor ( ); // Allocation => must be deleted at the end!! 274 Mpred->set_rv ( rv); //the predictor predicts rv of this merger240 Mpred->set_rv ( merger()._rv() ); //the predictor predicts rv of this merger 275 241 276 242 // This will be active only later in iterations!!! … … 299 265 *dbg_file << Name ( dbg_str ) << Mpred->variance(); 300 266 sprintf ( dbg_str, "Mpred_cov%d", niter ); 301 *dbg_file << Name ( dbg_str ) << covariance();267 *dbg_file << Name ( dbg_str ) << Mpred->covariance(); 302 268 303 269 … … 313 279 } 314 280 //Importace weighting 315 for ( int i = 0; i < p dfs.length(); i++ ) {281 for ( int i = 0; i < part_sources.length(); i++ ) { 316 282 lw_src = 0.0; 317 283 //======== Same RVs =========== 318 284 //Split according to dependency in rvs 319 if ( p dfs ( i )->dimension() == dim ) {285 if ( part_sources ( i )->dimension() == dim ) { 320 286 // no need for conditioning or marginalization 321 lw_src = p dfs ( i )->evallogcond_mat ( Smp , vec ( 0 ) );287 lw_src = part_sources ( i )->evallogcond_mat ( Smp , vec ( 0 ) ); 322 288 } else { 323 289 // compute likelihood of marginal on the conditional variable 324 if ( p dfs ( i )->dimensionc() > 0 ) {290 if ( part_sources ( i )->dimensionc() > 0 ) { 325 291 // Make marginal on rvc_i 326 shared_ptr<epdf> tmp_marg = Mpred->marginal ( p dfs ( i )->_rvc() );292 shared_ptr<epdf> tmp_marg = Mpred->marginal ( part_sources ( i )->_rvc() ); 327 293 //compute vector of lw_src 328 294 for ( int k = 0; k < Npoints; k++ ) { … … 336 302 } 337 303 // Compute likelihood of the missing variable 338 if ( dim > ( p dfs ( i )->dimension() + pdfs ( i )->dimensionc() ) ) {304 if ( dim > ( part_sources ( i )->dimension() + part_sources ( i )->dimensionc() ) ) { 339 305 /////////////// 340 306 // There are variales unknown to pdfs(i) : rvzs … … 355 321 // Compute likelihood of the partial source 356 322 for ( int k = 0; k < Npoints; k++ ) { 357 lw_src ( k ) += p dfs ( i )->evallogcond ( dls ( i )->pushdown ( Smp ( k ) ),323 lw_src ( k ) += part_sources ( i )->evallogcond ( dls ( i )->pushdown ( Smp ( k ) ), 358 324 dls ( i )->get_cond ( Smp ( k ) ) ); 359 325 } … … 363 329 lW.set_row ( i, lw_src ); // do not divide by mix 364 330 } 365 lw = merger_base::merge_points ( lW ); //merge331 lw = MergerDiscrete::merge_points ( lW ); //merge 366 332 367 333 //Importance weighting … … 391 357 } 392 358 delete Mpred; 393 // cout << endl;394 395 359 } 396 360 397 361 void merger_mix::from_setting ( const Setting& set ) { 398 merger_base::from_setting ( set );362 MergerDiscrete::from_setting ( set ); 399 363 Ncoms=DFLT_Ncoms; 400 364 UI::get( Ncoms, set, "ncoms", UI::optional ); … … 406 370 407 371 void merger_mix::to_setting (Setting &set) const { 408 merger_base::to_setting(set);372 MergerDiscrete::to_setting(set); 409 373 UI::save( Ncoms, set, "ncoms"); 410 374 UI::save (effss_coef , set, "effss_coef"); … … 413 377 414 378 void merger_mix::validate() { 415 merger_base::validate();379 MergerDiscrete::validate(); 416 380 bdm_assert(Ncoms>0,"Ncoms too small"); 417 381 } -
library/bdm/stat/merger.h
r1072 r1079 32 32 //! weights of the sources -- no restrictions 33 33 vec w; 34 //! get ith source34 //! source pdfs -- conditioning allowed 35 35 Array<shared_ptr<epdf> > sources; 36 36 //! merge 37 v oid merge() NOT_IMPLEMENTED_VOID;37 virtual void merge() NOT_IMPLEMENTED_VOID; 38 38 //! 39 39 //! check if all epdfs are on the same support 40 void validate () {40 void validate_sources() { 41 41 int n=sources.length(); 42 42 … … 75 75 vec mea=zeros(dim); 76 76 // go through all sources 77 epdf * si; 77 78 for (int i=0; i<n; i++){ 78 sq_T Ci = sources(i)->covariance(); 79 si = dynamic_cast<epdf*>(sources(i).get()); // transform pdf into epdf 80 81 if (!si) {bdm_error("Can't merger this type of pdf: " + sources(i)->to_string());} 82 83 sq_T Ci = si->covariance(); 79 84 sq_T wCi = Ci; wCi*=w(i); 80 vec mi = s ources(i)->mean();85 vec mi = si->mean(); 81 86 switch (method) { 82 87 case ARITHMETIC:{ … … 133 138 However, these operations can not be performed in general. Hence, this class merges only sources on common support, \f$ y_i={}, z_i={}, \forall i \f$. 134 139 For merging of more general cases, use offsprings merger_mix and merger_grid. 140 141 \TODO use sources for extensions 135 142 */ 136 class merger_base : public epdf{143 class MergerDiscrete : public MergerBase { 137 144 protected: 138 //! Elements of composition 139 Array<shared_ptr<pdf> > pdfs;140 145 //! partial sources 146 Array<shared_ptr< pdf > > part_sources; 147 141 148 //! Data link for each pdf in pdfs 142 149 Array<datalink_m2e*> dls; … … 177 184 178 185 //! Default constructor 179 merger_base () : Npoints ( 0 ), Nsources ( 0 ), DBG ( false ), dbg_file ( 0 ) {186 MergerDiscrete () : Npoints ( 0 ), Nsources ( 0 ), DBG ( false ), dbg_file ( 0 ) { 180 187 } 181 188 182 189 //!Constructor from sources 183 merger_base ( const Array<shared_ptr<pdf> > &S );190 MergerDiscrete ( const Array<shared_ptr<pdf> > &S ); 184 191 185 192 //! Function setting the main internal structures 186 void set_sources ( const Array<shared_ptr<pdf> > & Sources );193 void set_sources ( const Array<shared_ptr<pdf> > &PartSources ); 187 194 188 195 //! Set support points from rectangular grid … … 205 212 206 213 //! Set internal parameters used in approximation 207 void set_method ( MERGER_METHOD MTH = DFLT_METHOD, double beta0 = DFLT_beta) {214 void set_method ( MERGER_METHOD MTH = GEOMETRIC, double beta0 = 1.2 ) { 208 215 METHOD = MTH; 209 216 beta = beta0; … … 216 223 217 224 //! Destructor 218 virtual ~ merger_base() {225 virtual ~MergerDiscrete() { 219 226 for ( int i = 0; i < Nsources; i++ ) { 220 227 delete dls ( i ); … … 229 236 230 237 //!Merge given sources in given points 231 v irtual void merge ();238 void merge (); 232 239 233 240 //! Merge log-likelihood values in points using method specified by parameter METHOD 234 241 vec merge_points ( mat &lW ); 235 242 236 237 //! sample from merged density 238 //! weight w is a 239 vec mean() const; 240 241 mat covariance() const; 242 243 vec variance() const; 244 245 //! Compute log-probability of argument \c val 246 virtual double evallog ( const vec &val ) const NOT_IMPLEMENTED(0); 247 248 //! Returns a sample, \f$ x \f$ from density \f$ f_x()\f$ 249 virtual vec sample() const NOT_IMPLEMENTED(0); 250 251 //!@} 243 //!@} 252 244 253 245 //! \name Access to attributes … … 258 250 return eSmp; 259 251 } 252 253 eEmp & merger() {return eSmp;} 260 254 261 255 /*! Create object from the following structure … … 279 273 //!@} 280 274 }; 281 UIREGISTER ( merger_base );282 SHAREDPTR ( merger_base );275 UIREGISTER ( MergerDiscrete ); 276 SHAREDPTR ( MergerDiscrete ); 283 277 284 278 //! \brief Merger using importance sampling with mixture proposal density 285 class merger_mix : public merger_base {279 class merger_mix : public MergerDiscrete { 286 280 protected: 287 281 //!Internal mixture of EF models … … 311 305 //! Set sources and prepare all internal structures 312 306 void set_sources ( const Array<shared_ptr<pdf> > &S ) { 313 merger_base::set_sources ( S );307 MergerDiscrete::set_sources ( S ); 314 308 //Nsources = S.length(); 315 309 } … … 349 343 emix* proposal() { 350 344 emix* tmp = Mix.epredictor(); 351 tmp->set_rv ( rv);345 tmp->set_rv ( merger()._rv() ); 352 346 return tmp; 353 347 } … … 376 370 void validate(); 377 371 372 // const emix &merger(){return *Mpred;} 378 373 //! @} 379 374 }; -
library/tests/testsuite/merger.cfg
r717 r1079 12 12 { 13 13 class = "egiw"; 14 V = ( "matrix", 2, 2, [ 20.0, 8.0, 8.0, 4.0 ] );14 fV = ( "matrix", 2, 2, [ 20.0, 8.0, 8.0, 4.0 ] ); 15 15 nu = 4.0; 16 16 dimx = 1.0; … … 29 29 Merger : 30 30 { 31 class = " merger_base";31 class = "MergerDiscrete"; 32 32 beta = 1.0; 33 33 method = "geometric"; -
library/tests/testsuite/merger_test.cpp
r1072 r1079 47 47 lW.set_row ( 1, l_f2 ); 48 48 49 merger_base M ( A );49 MergerDiscrete M ( A ); 50 50 enorm<fsqmat> g0; 51 51 g0.set_rv ( x ); … … 153 153 UIFile in ( "merger.cfg" ); 154 154 155 shared_ptr< merger_base> mb =156 UI::build< merger_base> ( in, "Merger", UI::compulsory );155 shared_ptr<MergerDiscrete> mb = 156 UI::build<MergerDiscrete> ( in, "Merger", UI::compulsory ); 157 157 158 158 pdf_array sources; … … 165 165 166 166 mb->merge(); 167 vec m = mb->me an();167 vec m = mb->merger().mean(); 168 168 CHECK_EQUAL ( 2, m.size() ); 169 169 }