Ignore:
Timestamp:
03/13/12 19:59:59 (13 years ago)
Author:
Eric.Larour
Message:

Completed separation of Petsc from ISSM. Matrix and Vector
are now the vehicles for Mat and Vec objects when running with
Petsc, or double* when running with a custom made type of matrix (still
to be finished).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/io/Matlab/FetchMatlabData.cpp

    r11675 r11695  
    276276}
    277277/*}}}*/
    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 /*}}}*/
    305278/*FUNCTION FetchMatlabData(Matrix** pmatrix,const mxArray* dataref){{{1*/
    306279void FetchMatlabData(Matrix** pmatrix,const mxArray* dataref){
     
    451424        *pvector=outvector;
    452425        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;
    477426}
    478427/*}}}*/
Note: See TracChangeset for help on using the changeset viewer.