Changeset 13375
- Timestamp:
- 09/14/12 15:36:14 (13 years ago)
- Location:
- issm/trunk-jpl/src/c
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/matlab/io/FetchMatlabData.cpp
r13353 r13375 72 72 outmatrix=NULL; 73 73 } 74 else if (mxIsClass(dataref,"double") ){ 74 else if( mxIsClass(dataref,"double") || 75 mxIsClass(dataref,"single") || 76 mxIsClass(dataref,"int16") || 77 mxIsClass(dataref,"int8") || 78 mxIsClass(dataref,"uint8")){ 75 79 76 80 /*Check dataref is not pointing to NaN: */ … … 82 86 } 83 87 else{ 84 88 if(!mxIsClass(dataref,"double") && !mxIsClass(dataref,"single")){ 89 _printLine_("Warning: converting matlab data from '" << mxGetClassName(dataref) << "' to 'double'"); 90 } 85 91 /*Convert matlab n-dim array to double* matrix: */ 86 92 MatlabNArrayToNArray(&outmatrix,&outmatrix_numel,&outmatrix_ndims,&outmatrix_size,dataref); … … 114 120 outmatrix=NULL; 115 121 } 116 else if (mxIsClass(dataref,"double") ){ 122 else if( mxIsClass(dataref,"double") || 123 mxIsClass(dataref,"single") || 124 mxIsClass(dataref,"int16") || 125 mxIsClass(dataref,"int8") || 126 mxIsClass(dataref,"uint8")){ 117 127 118 128 /*Check dataref is not pointing to NaN: */ … … 123 133 } 124 134 else{ 125 135 if(!mxIsClass(dataref,"double") && !mxIsClass(dataref,"single")){ 136 _printLine_("Warning: converting matlab data from '" << mxGetClassName(dataref) << "' to 'double'"); 137 } 126 138 /*Convert matlab matrix to double* matrix: */ 127 139 MatlabMatrixToDoubleMatrix(&doublematrix,&outmatrix_rows,&outmatrix_cols,dataref); -
issm/trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp
r13364 r13375 25 25 void SolverxSeq(SeqVec<IssmDouble>** puf,SeqMat<IssmDouble>* Kff, SeqVec<IssmDouble>* pf, Parameters* parameters){/*{{{*/ 26 26 27 27 #ifdef _HAVE_GSL_ 28 28 /*Intermediary: */ 29 29 int M,N,N2,s; … … 35 35 if(N!=N2)_error_("Right hand side vector of size " << N2 << ", when matrix is of size " << M << "-" << N << " !"); 36 36 if(M!=N)_error_("Stiffness matrix should be square!"); 37 IssmDouble *x = xNew<IssmDouble>(N); 37 IssmDouble *x = xNew<IssmDouble>(N); 38 38 39 #ifdef _HAVE_ADOLC_ 39 40 SolverxSeq(x,Kff->matrix,pf->vector,N,parameters); … … 41 42 SolverxSeq(x,Kff->matrix,pf->vector,N); 42 43 #endif 44 43 45 uf=new SeqVec<IssmDouble>(x,N); 44 46 xDelete(x); … … 47 49 *puf=uf; 48 50 49 50 51 51 #else 52 _error_("GSL support not compiled in!"); 53 #endif 52 54 53 55 }/*}}}*/
Note:
See TracChangeset
for help on using the changeset viewer.