Changeset 568 for applications/bdmtoolbox
- Timestamp:
- 08/20/09 00:54:44 (15 years ago)
- Location:
- applications/bdmtoolbox
- Files:
-
- 6 modified
Legend:
- Unmodified
- Added
- Removed
-
applications/bdmtoolbox/mex/config2mxstruct.cpp
r411 r568 13 13 } 14 14 catch(exception e){ 15 cout << e.what() <<endl;15 cout <<"Error: " << e.what() <<endl; 16 16 } 17 17 } -
applications/bdmtoolbox/mex/estimator.cpp
r490 r568 109 109 #endif 110 110 111 logger*L = UI::build<logger>( Cfg, "logger");112 ArxDS *DS = UI::build<ArxDS>( Cfg, "system" );113 Array< BM*> Es; UI::get(Es,Cfg, "estimators" );111 shared_ptr<logger> L = UI::build<logger>( Cfg, "logger"); 112 shared_ptr<ArxDS> DS = UI::build<ArxDS>( Cfg, "system" ); 113 Array<shared_ptr<BM> > Es; UI::get(Es,Cfg, "estimators" ); 114 114 int Ndat; 115 115 Cfg.lookupValue ( "experiment.ndat",Ndat ); … … 151 151 152 152 #ifdef MEX 153 mexlog* mL=dynamic_cast<mexlog*>(L );153 mexlog* mL=dynamic_cast<mexlog*>(L.get()); 154 154 155 155 if (mL) { // user wants output!! … … 158 158 } 159 159 #endif 160 ///////161 delete L;162 delete DS;163 for (int i;i<Es.length();i++){delete Es(i);delete Dls(i);}164 160 } -
applications/bdmtoolbox/mex/merger.cpp
r490 r568 59 59 #endif 60 60 // Sources 61 Array< mpdf*> Sources;61 Array<shared_ptr<mpdf> > Sources; 62 62 //abuse Mer to store sources 63 63 Setting& _Sources = Cfg.lookup ("Sources"); … … 66 66 for (int i = 0; i < Slen; i++) { 67 67 try { 68 mpdf*mtmp = UI::build<mpdf> (_Sources, i);68 shared_ptr<mpdf> mtmp = UI::build<mpdf> (_Sources, i); 69 69 Sources (i) = mtmp; 70 70 } catch (UIException) { … … 73 73 shared_ptr<epdf> etmp = UI::build<epdf> (_Sources, i); 74 74 if (etmp) { 75 Sources (i) = new mepdf (etmp); 75 Sources (i) = new mepdf (etmp); // hopefully OK 76 76 } 77 } catch (UIException e) {77 } catch (UIException &e) { 78 78 it_error ("No mpdfs or epdfs found! " + string (e.what())); 79 79 } catch (std::exception e) { 80 80 it_error ("Error in UI at " + _Sources[i].getPath()); 81 81 } 82 } catch (std::exception e) {82 } catch (std::exception &e) { 83 83 it_error ("Error in UI at " + _Sources[i].getPath()); 84 84 } 85 85 } 86 86 87 merger_base*Merger = UI::build<merger_base> (Cfg, "Merger");87 shared_ptr<merger_base> Merger = UI::build<merger_base> (Cfg, "Merger"); 88 88 89 89 // Support 90 Setting & _Supp = Cfg.lookup ("Support"); 91 92 if (_Supp.exists ("grid") && _Supp.exists ("nbins")) { 93 Array<vec> bounds (0); 94 UI::get (bounds, _Supp, "grid"); 95 ivec nbins (0); 96 UI::get (nbins, _Supp, "nbins"); 97 Merger->set_support (bounds, nbins); 98 99 } else { 100 if (_Supp.exists ("pdf") && _Supp.exists ("nsamples")) { 101 epdf *g0 = UI::build<epdf> (_Supp, "pdf"); 102 int npoints = 100; 103 _Supp.lookupValue ("nsamples", npoints); 104 Merger->set_support (*g0, npoints); 105 delete g0; 106 } else it_error ("Use either [grid,nbins] or [pdf,nsamples]."); 90 try { 91 shared_ptr<rectangular_support> RecSup = UI::build<rectangular_support> (Cfg, "Support"); 92 Merger->set_support(*RecSup); 93 } 94 catch (UIException &e) { 95 shared_ptr<epdf> g0 = UI::build<epdf> (Cfg, "Support"); 96 Merger->set_support (*g0, 100); 107 97 } 108 98 // COMPUTE RESULTS 109 Merger->set_sources (Sources , true); // takes care of deletion of sources99 Merger->set_sources (Sources); 110 100 Merger->merge(); 111 101 … … 128 118 } 129 119 130 merger_mix* MerMix=dynamic_cast<merger_mix*>(Merger );120 merger_mix* MerMix=dynamic_cast<merger_mix*>(Merger.get()); 131 121 vec mix_val; 132 122 -
applications/bdmtoolbox/tutorial/arx_mex_test.cfg
r357 r568 19 19 20 20 //optional fields 21 dV0 = [1e-3, 1e-5, 1e-5, 1e-5, 1e-5]; //default: 1e-3 for y, 1e-5 for rgr21 dV0 = matrix(5,1,[1e-3, 1e-5, 1e-5, 1e-5, 1e-5]); //default: 1e-3 for y, 1e-5 for rgr 22 22 //nu0 = 8.; //default: rgrlen + 2 23 23 frg = .9991; // forgetting, default frg=1.0 -
applications/bdmtoolbox/tutorial/merging/merge_grid.m
r409 r568 10 10 11 11 % support 12 support.grid={[-5,5]}; 13 support.nbins=[100]; 12 support.class='rectangular_support'; 13 support.ranges={[-5,5]}; 14 support.gridsizes=[100]; 14 15 15 16 % 1D … … 49 50 type=0; 50 51 if type==0 51 support2.grid={[-5,5],[0.001,5]}; 52 support2.nbins=[10,10]; 52 support2.class='rectangular_support'; 53 support2.ranges={[-5,5],[0.001,5]}; 54 support2.gridsizes=[10,10]; 53 55 else 54 56 support2=struct('pdf',... -
applications/bdmtoolbox/tutorial/merging/pdfs.m
r409 r568 40 40 Ga_ =struct('class','mepdf','epdf',Ga); % convert f(a) to f(a|) 41 41 Gba = struct('class','mprod', 'mpdfs',{{Gb_a,Ga_}}); 42 43 pd.Ga=Ga; 44 pd.N1a=N1a; 45 pd.N1b=N1b; 46 pd.N2a=N2a; 47 pd.Nab=Nab; 48 pd.GiW=GiW; 49 pd.Gba=Gba; 50