Show
Ignore:
Timestamp:
05/27/10 13:08:31 (14 years ago)
Author:
smidl
Message:

new mexes + cleanup

Files:
1 modified

Legend:

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

    r978 r1002  
    1414#include <estim/kalman.h> 
    1515#include <estim/particles.h> 
     16#include <estim/mixtures.h> 
    1617#include <mex/mex_BM.h> 
    1718 
    1819void mexFunction ( int n_output, mxArray *output[], int n_input, const mxArray *input[] ) { 
    1920        // Check the number of inputs and output arguments 
    20         if ( n_input<1 ) mexErrMsgTxt ( "Usage:\n" 
    21                                                 "bm_struct=bm_bayes(BM_struct, yt, cond)\n" 
    22                                                 "  bm_struct = struct('class','BM_offspring',...);    % description of Bayesian Model (BM)\n" 
    23                                                 "  yt = [...];                                        % vector of observed data\n" 
    24                                                 "  cond = [...];                                      % vector of conditioning variables\n" 
    25                                                 "output:\n" 
    26                                                 "  bm_struct = struct('class','BM_offsprin',...);     % description of BM afret update." ); 
     21        if ( n_input<1 ) mexErrMsgTxt (  
     22                "Usage:\n" 
     23                "[bm_struct,logevidence]=bm_bayes(BM_struct, yt, cond)\n" 
     24                "  BM_struct = struct('class','BM_offspring',...);    % description of Bayesian Model (BM)\n" 
     25                "  yt = [...];                                        % vector of observed data\n" 
     26                "  cond = [...];                                      % vector of conditioning variables\n" 
     27                "output:\n" 
     28                "  bm_struct = struct('class','BM_offsprin',...);     % description of BM afret update.\n" 
     29                "  logevidence  = 0.0;                                % logarithm of normalizing constant f(yt|cond)" 
     30                ); 
    2731 
    2832        RV::clear_all(); 
     
    5054                UI::save(bm.get(), Out); 
    5155                output[0]=UImxArray::create_mxArray(Out); 
     56                if (n_output>1){ 
     57                        mxArray *le=mxCreateDoubleScalar(mxREAL); 
     58                        double2mxArray(bm->_ll(), le); 
     59                        output[1]=le; 
     60                } 
    5261        } else {  
    5362                mexErrMsgTxt ( "Given object is not BM" );