Changeset 925

Show
Ignore:
Timestamp:
05/05/10 20:51:39 (14 years ago)
Author:
smidl
Message:

new mexpdf

Files:
1 added
4 modified

Legend:

Unmodified
Added
Removed
  • applications/bdmtoolbox/mex/CMakeLists.txt

    r809 r925  
    2222## WRAPPERS 
    2323 
     24 
     25MEX(my_isobj) 
    2426MEX(epdf_mean) 
    2527MEX(epdf_variance) 
  • applications/bdmtoolbox/mex/epdf_mean.cpp

    r801 r925  
    1212#ifdef MEX 
    1313#include <mex/mex_parser.h> 
     14#include "mexPdf.h" 
    1415 
    1516void mexFunction ( int n_output, mxArray *output[], int n_input, const mxArray *input[] ) { 
     
    2425        //CONFIG 
    2526        UImxArray Cfg(input[0]); 
    26 //      Cfg.writeFile("epdf_mean.cfg"); 
     27        Cfg.writeFile("epdf_mean.cfg"); 
    2728 
    2829        shared_ptr<epdf> ep=UI::build<epdf>(Cfg); 
  • applications/bdmtoolbox/mex/mexBM.cpp

    r706 r925  
    77class mexEpdf: public epdf{ 
    88        protected: 
    9                 string name; 
    109                mxArray *data; 
    1110        public: 
    1211                mexEpdf() {}; 
    1312                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"]; 
    2214                }  
     15                void validate() { 
     16                        mexCallMATLAB(1, &data, 0, 0, ("validate").c_str()); 
     17                        dim = mexCallMATLAB(1, &data, 0, 0, ("dimension").c_str()); 
     18                } 
    2319                vec mean() const { 
    2420                        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()); 
    2722                        return mxArray2vec(tmp); 
    28                 }  
     23                } 
     24                 
    2925}; 
    3026UIREGISTER(mexEpdf); 
  • library/bdm/mex/mex_parser.h

    r796 r925  
    107107                                storeNumeric ( setting, value, ( string ) key ); 
    108108                        } 
     109                        if (mxIsObject(value)){ 
     110                                Setting &child = setting.add(key, Setting::TypeInt64); 
     111                                child = (long)value; 
     112                        } 
    109113                } 
    110114        }