Changeset 756 for applications

Show
Ignore:
Timestamp:
12/28/09 17:02:37 (15 years ago)
Author:
mido
Message:

odladen FindMatlab?.cmake
trida UImxConfig smazana a nahrazena statickou funkci UImxArray::create_mxArray(), a podle toho upravene zdrojaky
odstranen abort ze shared pointeru

Location:
applications/bdmtoolbox
Files:
9 modified

Legend:

Unmodified
Added
Removed
  • applications/bdmtoolbox/mex/config2mxstruct.cpp

    r706 r756  
    1 #include <mex/config2mxstruct.h> 
    21#include <base/user_info.h> 
     2#include <itpp/itmex.h> 
     3#include <mex/mex_parser.h> 
     4 
     5using namespace bdm; 
    36 
    47void mexFunction ( int n_output, mxArray *output[], int n_input, const mxArray *input[] ) { 
     
    69                string filename = mxArray2string ( input[0] ); 
    710                try { 
    8                         UImxConfig C ( filename.c_str() ); 
    911                        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                        } 
    1116                } catch ( SettingException xcptn ) { 
    1217                        cout<<"Error in:" + string ( xcptn.getPath() ) <<endl; 
  • applications/bdmtoolbox/mex/epdf_mean.cpp

    r728 r756  
    2323        RV::clear_all(); 
    2424        //CONFIG 
    25         if (!mxIsStruct(input[0])) mexErrMsgTxt("Given input is not a struct."); 
    26                  
    2725        UImxArray Cfg(input[0]); 
    2826        Cfg.writeFile("epdf_mean.cfg"); 
    2927 
    30         shared_ptr<epdf> ep=UI::build<epdf>(Cfg.getRoot()); 
     28        shared_ptr<epdf> ep=UI::build<epdf>(Cfg); 
    3129         
    3230         
  • applications/bdmtoolbox/mex/epdf_sample_mat.cpp

    r730 r756  
    2424        RV::clear_all(); 
    2525        //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); 
    2729 
    2830        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]));}        
    3532         
    3633        if ( n_output<1 ) mexErrMsgTxt ( "No output - nothing to do!" ); 
  • applications/bdmtoolbox/mex/estimator.cpp

    r728 r756  
    209209                if ( n_output<1 ) mexErrMsgTxt ( "Wrong number of output variables!" ); 
    210210                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()); 
    215213        } 
    216214#endif 
  • applications/bdmtoolbox/mex/lqg_redesign.cpp

    r733 r756  
    1212#ifdef MEX 
    1313#include <mex/mex_parser.h> 
    14 #include <mex/config2mxstruct.h> 
    1514 
    1615void mexFunction ( int n_output, mxArray *output[], int n_input, const mxArray *input[] ) { 
     
    7170        mat2mxArray(L, output[0]); 
    7271        if (n_output>1){ 
    73                 Config C;  
    74                 rv.to_setting(C.getRoot()); 
    75                 UImxConfig ui(C.getRoot()); 
    76                 output[1] = ui.mxconfig; 
     72 
     73                UImxArray out; 
     74                UI::save( &rv, out ); 
     75                output[1]= out.create_mxArray(); 
    7776        } 
    7877                 
  • applications/bdmtoolbox/mex/merger.cpp

    r706 r756  
    55#include <mex/mex_logger.h> 
    66#include <mex/mex_parser.h> 
    7 #include <mex/config2mxstruct.h> 
    87#endif 
    98 
  • applications/bdmtoolbox/mex/mixef_init.cpp

    r746 r756  
    2525        //input check 
    2626        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."); 
    2828        if (!mxIsStruct(input[1])) mexErrMsgTxt("Given input #2 is not a struct."); 
    2929        //output check 
     
    5050         
    5151#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(); 
    5655#else 
    5756        UIFile out; 
  • applications/bdmtoolbox/mex/simulator.cpp

    r706 r756  
    9898                fname = argv[1]; 
    9999        } else { 
    100                 fname="estimator.cfg"; 
     100                fname="simulator.cfg"; 
    101101        } 
    102102        UIFile Cfg ( fname ); 
  • applications/bdmtoolbox/tutorial/userguide/arx_selection_example.m

    r754 r756  
    1 % load data created by the MpdfDS_example 
     1% load data created by the pdfDS_example 
    22load pdfds_results 
    33