Changeset 937
- Timestamp:
- 05/12/10 23:02:03 (15 years ago)
- Files:
-
- 4 added
- 8 modified
Legend:
- Unmodified
- Added
- Removed
-
applications/bdmtoolbox/mex/RV.m
r706 r937 2 2 % create RV from cell of names, vector of sizes and vector of time delayes 3 3 4 if nargin<1 5 names=''; 6 end 4 7 r.class='RV'; 5 8 if isstr(names) -
applications/bdmtoolbox/mex/epdf_covariance.cpp
r803 r937 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[] ) { -
applications/bdmtoolbox/mex/epdf_evallog_mat.cpp
r803 r937 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[] ) { -
applications/bdmtoolbox/mex/epdf_marginal.cpp
r803 r937 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[] ) { -
applications/bdmtoolbox/mex/epdf_sample_mat.cpp
r801 r937 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[] ) { -
applications/bdmtoolbox/mex/epdf_variance.cpp
r801 r937 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[] ) { -
applications/bdmtoolbox/mex/mexPdf.h
r936 r937 9 9 } 10 10 void validate() { 11 mexCallMATLAB(1, &data, 0, 0, "validate"); 12 dim = mexCallMATLAB(1, &data, 0, 0, "dimension"); 11 mexCallMATLAB(0, 0, 1, &data, "validate"); 12 mxArray *tmp; 13 mexCallMATLAB(1, &tmp, 1, &data, "dimension"); 14 dim = mxArray2double(tmp); 13 15 } 14 16 vec mean() const { … … 24 26 double evallog(const vec &dt) const { 25 27 mxArray *tmp; 26 mexCallMATLAB(1, &tmp, 1, (mxArray **) &data, "evallog"); 28 mxArray *in[2]; 29 in[0]=data; 30 in[1]=mxCreateDoubleMatrix(dimension(),1,mxREAL); 31 vec2mxArray(dt,in[1]); 32 mexCallMATLAB(1, &tmp, 2, in, "evallog"); 27 33 return mxArray2double(tmp); 28 34 } … … 34 40 }; 35 41 UIREGISTER(mexEpdf); 42 -
library/bdm/base/itpp/itmex.h
r813 r937 336 336 int i, size; 337 337 double* temp = (double*) mxGetPr(in); 338 if (temp == 0) mexErrMsgTxt("mxArray2ivec: Pointer to data is NULL");339 338 340 339 size = mxGetNumberOfElements(in); 341 if ( size == 0) mexErrMsgTxt("mxArray2ivec: Size of data is zero");340 if ((size > 0) && (temp == 0)) mexErrMsgTxt("mxArray2ivec: Size of data is zero"); 342 341 343 342 out.set_size(size, false); … … 356 355 int i, size; 357 356 double* temp = (double*) mxGetPr(in); 358 if (temp == 0) mexErrMsgTxt("mxArray2vec: Pointer to data is NULL");359 357 360 358 size = mxGetNumberOfElements(in); 361 if ( size == 0) mexErrMsgTxt("mxArray2vec: Size of data is zero");362 359 if ((size >0) && (temp == 0)) mexErrMsgTxt("mxArray2vec: Pointer to data is NULL"); 360 363 361 out.set_size(size, false); 364 362 … … 577 575 { 578 576 double* temp = (double *) mxGetPr(out); 579 if (temp == 0) mexErrMsgTxt("vec2mxArray: Pointer to data is NULL"); 580 if (in.size() == 0) mexErrMsgTxt("vec2mxArray: Size of data is zero"); 577 if ((in.size() > 0) && (temp == 0)) mexErrMsgTxt("vec2mxArray: Pointer to data is NULL"); 581 578 582 579 for (int i = 0; i < in.size(); i++) {