Added some debug code triggered by adding -DDEBUG_WRAP to mex command

release/4.3a0
Frank Dellaert 2011-10-21 02:19:23 +00:00
parent 301ec3d2f4
commit 27fd87ce8d
1 changed files with 6 additions and 0 deletions

View File

@ -228,9 +228,15 @@ template<>
Vector unwrap< Vector >(const mxArray* array) {
int m = mxGetM(array), n = mxGetN(array);
if (mxIsDouble(array)==false || n!=1) error("unwrap<vector>: not a vector");
#ifdef DEBUG_WRAP
mexPrintf("unwrap< Vector > called with %dx%d argument\n", m,n);
#endif
double* data = (double*)mxGetData(array);
Vector v(m);
for (int i=0;i<m;i++,data++) v(i) = *data;
#ifdef DEBUG_WRAP
gtsam::print(v);
#endif
return v;
}