Changeset 11695 for issm/trunk-jpl/src/c/io/Matlab/FetchMatlabData.cpp
- Timestamp:
- 03/13/12 19:59:59 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/io/Matlab/FetchMatlabData.cpp
r11675 r11695 276 276 } 277 277 /*}}}*/ 278 /*FUNCTION FetchMatlabData(Mat* pmatrix,const mxArray* dataref){{{1*/279 void FetchMatlabData(Mat* pmatrix,const mxArray* dataref){280 281 Mat outmatrix=NULL;282 int dummy=0;283 284 if (mxIsClass(dataref,"double") ){285 286 /*Check dataref is not pointing to NaN: */287 if ( mxIsNaN(*(mxGetPr(dataref))) && (mxGetM(dataref)==1) && (mxGetN(dataref)==1) ){288 outmatrix=NULL;289 }290 else{291 292 /*Convert matlab matrix to petsc matrix: */293 MatlabMatrixToPetscMatrix(&outmatrix,&dummy,&dummy,dataref);294 }295 }296 else{297 /*This is an error: we don't have the correct input!: */298 _error_("Input parameter of class %s not supported yet",mxGetClassName(dataref));299 }300 301 /*Assign output pointers:*/302 *pmatrix=outmatrix;303 }304 /*}}}*/305 278 /*FUNCTION FetchMatlabData(Matrix** pmatrix,const mxArray* dataref){{{1*/ 306 279 void FetchMatlabData(Matrix** pmatrix,const mxArray* dataref){ … … 451 424 *pvector=outvector; 452 425 if (pM)*pM=outvector_rows; 453 }454 /*}}}*/455 /*FUNCTION FetchMatlabData(Vec* pvector,const mxArray* dataref){{{1*/456 void FetchMatlabData(Vec* pvector,const mxArray* dataref){457 458 Vec vector=NULL;459 int dummy;460 461 if(mxIsEmpty(dataref)){462 /*Nothing to pick up. Just initialize matrix pointer to NULL: */463 vector=NULL;464 }465 else if (mxIsClass(dataref,"double") ){466 467 /*Convert matlab vector to petsc vector: */468 MatlabVectorToPetscVector(&vector,&dummy,dataref);469 }470 else{471 /*This is an error: we don't have the correct input!: */472 _error_("Input parameter of class %s not supported yet",mxGetClassName(dataref));473 }474 475 /*Assign output pointers:*/476 *pvector=vector;477 426 } 478 427 /*}}}*/
Note:
See TracChangeset
for help on using the changeset viewer.