Changeset 14005


Ignore:
Timestamp:
11/27/12 09:46:14 (12 years ago)
Author:
Mathieu Morlighem
Message:

NEW: use FecthDataMatrix for Vectors

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/wrappers/matlab/io/FetchMatlabData.cpp

    r13749 r14005  
    264264
    265265        double* outvector=NULL;
    266         int outvector_rows;
    267 
    268         if(mxIsEmpty(dataref)){
    269                 /*Nothing to pick up. Just initialize matrix pointer to NULL: */
    270                 outvector_rows=0;
    271                 outvector=NULL;
    272         }
    273         else if (mxIsClass(dataref,"double") ){
    274 
    275                 /*Convert matlab vector to double*  vector: */
    276                 MatlabVectorToDoubleVector(&outvector,&outvector_rows,dataref);
    277 
    278         }
    279         else{
    280                 /*This is an error: we don't have the correct input!: */
    281                 _error_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
     266        int M,N;
     267
     268        /*Use Fetch matrix*/
     269        FetchData(pvector,&M,&N,dataref) ;
     270
     271        /*Check that it is a vector*/
     272        if(M>0){
     273                if(N!=1) _error_("input vector of size " << M << "x" << N << " should have only one column");
    282274        }
    283275
    284276        /*Assign output pointers:*/
    285277        *pvector=outvector;
    286         if (pM)*pM=outvector_rows;
     278        if(pM)*pM=M;
    287279}
    288280/*}}}*/
Note: See TracChangeset for help on using the changeset viewer.