Changeset 411

Show
Ignore:
Timestamp:
07/02/09 22:16:20 (15 years ago)
Author:
smidl
Message:

merger finalization

Location:
applications/bdmtoolbox
Files:
3 modified

Legend:

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

    r391 r411  
    11#include <mex/config2mxstruct.h> 
     2#include <base/user_info.h> 
    23 
    34void mexFunction ( int n_output, mxArray *output[], int n_input, const mxArray *input[] ) { 
    4         string filename = mxArray2string(input[0]); 
    5         UImxConfig C (filename.c_str()); 
    6         output[0] = mxDuplicateArray(C.mxconfig); 
     5        if (n_input>0){ 
     6                string filename = mxArray2string(input[0]); 
     7                try{ 
     8                        UImxConfig C (filename.c_str()); 
     9                        if (n_output>0) 
     10                                output[0] = mxDuplicateArray(C.mxconfig); 
     11                }catch(SettingException xcptn){ 
     12                        cout<<"Error in:" + string(xcptn.getPath()) <<endl; 
     13                } 
     14                catch(exception e){ 
     15                        cout <<e.what() <<endl; 
     16                } 
     17        } 
    718} 
  • applications/bdmtoolbox/mex/merger.cpp

    r407 r411  
    88#endif 
    99 
     10/*! \file  
     11\brief Merging static pdfs 
     12Merger is a program/mex-function for static merging of given pdfs on given support. 
     13 
     14In command line, it expected config file with the following structure: 
     15\code 
     16Sources = (... any epdf or mpdf  ...); 
     17Support = {grid=([low1d,high1d],[low2d,high2d],...); 
     18                   nbins=[bins1d,bins2d,... ]};  
     19// OR 
     20Support = {pdf={class='epdf',...}; 
     21                   nsamples=2};  
     22Merger = {class="merger_base",...} 
     23\endcode 
     24 
     25In mex-file, the above structures (Sources,Support,Merger) are input arguments. Type >>merger for help. 
     26*/ 
     27 
    1028using namespace bdm; 
    1129 
    12 #ifdef MEX 
     30#ifdef MEX  
    1331void mexFunction(int n_output, mxArray *output[], int n_input, const mxArray *input[]) 
    1432{ 
  • applications/bdmtoolbox/tutorial/merging/merge_frag.m

    r409 r411  
    1111 
    1212% merger  
    13 merger.class='merger_mix'; 
    14 merger.method='lognormal'; 
    15 merger.beta=2; 
    16 merger.ncoms=20; 
    17 merger.stop_niter=5; 
    18 merger.effss_coef=1; 
    19 %merger.dbg_file='merger_mix_dbg'; 
     13Merger.class='merger_mix'; 
     14Merger.method='lognormal'; 
     15Merger.beta=2; 
     16Merger.ncoms=20; 
     17Merger.stop_niter=5; 
     18Merger.effss_coef=1; 
     19%Merger.dbg_file='merger_mix_dbg'; 
    2020 
    2121 
     
    3535 
    3636% 2D 
    37 vy2=merger_mx({f3,f1}, support2, merger) 
     37vy2=merger({f3,f1}, support2, Merger) 
    3838X=zeros(support2.nbins(1)); 
    3939Y=zeros(support2.nbins(1));