Changeset 925
- Timestamp:
- 05/05/10 20:51:39 (15 years ago)
- Files:
-
- 1 added
- 4 modified
Legend:
- Unmodified
- Added
- Removed
-
applications/bdmtoolbox/mex/CMakeLists.txt
r809 r925 22 22 ## WRAPPERS 23 23 24 25 MEX(my_isobj) 24 26 MEX(epdf_mean) 25 27 MEX(epdf_variance) -
applications/bdmtoolbox/mex/epdf_mean.cpp
r801 r925 12 12 #ifdef MEX 13 13 #include <mex/mex_parser.h> 14 #include "mexPdf.h" 14 15 15 16 void mexFunction ( int n_output, mxArray *output[], int n_input, const mxArray *input[] ) { … … 24 25 //CONFIG 25 26 UImxArray Cfg(input[0]); 26 //Cfg.writeFile("epdf_mean.cfg");27 Cfg.writeFile("epdf_mean.cfg"); 27 28 28 29 shared_ptr<epdf> ep=UI::build<epdf>(Cfg); -
applications/bdmtoolbox/mex/mexBM.cpp
r706 r925 7 7 class mexEpdf: public epdf{ 8 8 protected: 9 string name;10 9 mxArray *data; 11 10 public: 12 11 mexEpdf() {}; 13 12 void from_setting(const Setting &S) { 14 name = (const char *) S["name"]; 15 UImxConfig conf(S); 16 data = mxDuplicateArray(conf.mxconfig); 17 //mexCallMATLAB(1, &data, 0, 0, (name+"_new").c_str()); 18 //TODO (future...): 19 //mxArray * init_data = setting2mxarray S["init_data"]; 20 //mexCallMATLAB(1, &data, 1, &init_data, name+"_from_setting"); 21 //delete init_data; 13 data = S["object"]; 22 14 } 15 void validate() { 16 mexCallMATLAB(1, &data, 0, 0, ("validate").c_str()); 17 dim = mexCallMATLAB(1, &data, 0, 0, ("dimension").c_str()); 18 } 23 19 vec mean() const { 24 20 mxArray *tmp; 25 string fname = name+"_mean"; 26 mexCallMATLAB(1, &tmp, 1, (mxArray **) &data, fname.c_str()); 21 mexCallMATLAB(1, &tmp, 1, (mxArray **) &data, "mean".c_str()); 27 22 return mxArray2vec(tmp); 28 } 23 } 24 29 25 }; 30 26 UIREGISTER(mexEpdf); -
library/bdm/mex/mex_parser.h
r796 r925 107 107 storeNumeric ( setting, value, ( string ) key ); 108 108 } 109 if (mxIsObject(value)){ 110 Setting &child = setting.add(key, Setting::TypeInt64); 111 child = (long)value; 112 } 109 113 } 110 114 }