Changeset 374


Ignore:
Timestamp:
05/13/09 08:37:06 (16 years ago)
Author:
Eric.Larour
Message:

Empty matrix bug fix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/toolkits/petsc/patches/PetscMatrixToMatlabMatrix.cpp

    r1 r374  
    106106                /*Ok, allocate arrays: */
    107107                dataref = mxCreateSparse((mwSize)0,(mwSize)0,(mwSize)0,mxREAL);
    108                
     108       
     109                mxSetM(dataref,(mwSize)cols);
     110                mxSetN(dataref,(mwSize)rows);
     111                mxSetNzmax(dataref,(mwSize)nzmax);
     112       
    109113                if(nnz){
    110114                        /* free first to avoid mem leaks...: */
     
    114118
    115119                        /* ...then set data: */
    116                         mxSetM(dataref,(mwSize)cols);
    117                         mxSetN(dataref,(mwSize)rows);
    118                         mxSetNzmax(dataref,(mwSize)nzmax);
    119120                        mxSetData( dataref, val);
    120121                        mxSetIr(dataref,col_ind);
Note: See TracChangeset for help on using the changeset viewer.