Changeset 756 for applications/bdmtoolbox/mex
- Timestamp:
- 12/28/09 17:02:37 (15 years ago)
- Location:
- applications/bdmtoolbox/mex
- Files:
-
- 8 modified
Legend:
- Unmodified
- Added
- Removed
-
applications/bdmtoolbox/mex/config2mxstruct.cpp
r706 r756 1 #include <mex/config2mxstruct.h>2 1 #include <base/user_info.h> 2 #include <itpp/itmex.h> 3 #include <mex/mex_parser.h> 4 5 using namespace bdm; 3 6 4 7 void mexFunction ( int n_output, mxArray *output[], int n_input, const mxArray *input[] ) { … … 6 9 string filename = mxArray2string ( input[0] ); 7 10 try { 8 UImxConfig C ( filename.c_str() );9 11 if ( n_output>0 ) 10 output[0] = mxDuplicateArray ( C.mxconfig ); 12 { 13 UIFile C ( filename.c_str() ); 14 output[0] = UImxArray::create_mxArray( C ); 15 } 11 16 } catch ( SettingException xcptn ) { 12 17 cout<<"Error in:" + string ( xcptn.getPath() ) <<endl; -
applications/bdmtoolbox/mex/epdf_mean.cpp
r728 r756 23 23 RV::clear_all(); 24 24 //CONFIG 25 if (!mxIsStruct(input[0])) mexErrMsgTxt("Given input is not a struct.");26 27 25 UImxArray Cfg(input[0]); 28 26 Cfg.writeFile("epdf_mean.cfg"); 29 27 30 shared_ptr<epdf> ep=UI::build<epdf>(Cfg .getRoot());28 shared_ptr<epdf> ep=UI::build<epdf>(Cfg); 31 29 32 30 -
applications/bdmtoolbox/mex/epdf_sample_mat.cpp
r730 r756 24 24 RV::clear_all(); 25 25 //CONFIG 26 if (!mxIsStruct(input[0])) mexErrMsgTxt("Given input is not a struct."); 26 UImxArray Cfg(input[0]); 27 Cfg.writeFile("epdf_sample_mat.cfg"); 28 shared_ptr<epdf> ep=UI::build<epdf>(Cfg); 27 29 28 30 int nos=10; 29 if (n_input>1) {nos = (int)(*mxGetPr(input[1]));} 30 31 UImxArray Cfg(input[0]); 32 Cfg.writeFile("epdf_sample_mat.cfg"); 33 34 shared_ptr<epdf> ep=UI::build<epdf>(Cfg.getRoot()); 31 if (n_input>1) {nos = (int)(*mxGetPr(input[1]));} 35 32 36 33 if ( n_output<1 ) mexErrMsgTxt ( "No output - nothing to do!" ); -
applications/bdmtoolbox/mex/estimator.cpp
r728 r756 209 209 if ( n_output<1 ) mexErrMsgTxt ( "Wrong number of output variables!" ); 210 210 output[0] = mL->toCell(); 211 if (n_output>1) { 212 UImxConfig UIc(mL->_setting_conf().getRoot()); 213 output[1]=UIc.mxconfig; 214 } 211 if (n_output>1) 212 output[1]= UImxArray::create_mxArray(mL->_setting_conf().getRoot()); 215 213 } 216 214 #endif -
applications/bdmtoolbox/mex/lqg_redesign.cpp
r733 r756 12 12 #ifdef MEX 13 13 #include <mex/mex_parser.h> 14 #include <mex/config2mxstruct.h>15 14 16 15 void mexFunction ( int n_output, mxArray *output[], int n_input, const mxArray *input[] ) { … … 71 70 mat2mxArray(L, output[0]); 72 71 if (n_output>1){ 73 Config C; 74 rv.to_setting(C.getRoot());75 UI mxConfig ui(C.getRoot());76 output[1] = ui.mxconfig;72 73 UImxArray out; 74 UI::save( &rv, out ); 75 output[1]= out.create_mxArray(); 77 76 } 78 77 -
applications/bdmtoolbox/mex/merger.cpp
r706 r756 5 5 #include <mex/mex_logger.h> 6 6 #include <mex/mex_parser.h> 7 #include <mex/config2mxstruct.h>8 7 #endif 9 8 -
applications/bdmtoolbox/mex/mixef_init.cpp
r746 r756 25 25 //input check 26 26 if (!mxIsNumeric(input[0])) mexErrMsgTxt("Given input #1 is not a data matrix."); 27 if (n_input<2) mexErrMsgTxt("No initial component, dont what type of mixture to fit.");27 if (n_input<2) mexErrMsgTxt("No initial component, dont know what type of mixture to fit."); 28 28 if (!mxIsStruct(input[1])) mexErrMsgTxt("Given input #2 is not a struct."); 29 29 //output check … … 50 50 51 51 #ifdef MEX 52 mxArray* tmp= mxCreateStructMatrix(1,1,0, NULL); 53 UImxArray out(tmp); 54 mix.to_setting(out); 55 output[0]=tmp; 52 UImxArray out; 53 UI::save( &mix, out ); 54 output[0]= out.create_mxArray(); 56 55 #else 57 56 UIFile out; -
applications/bdmtoolbox/mex/simulator.cpp
r706 r756 98 98 fname = argv[1]; 99 99 } else { 100 fname=" estimator.cfg";100 fname="simulator.cfg"; 101 101 } 102 102 UIFile Cfg ( fname );