Changeset 7740
- Timestamp:
- 03/31/11 16:40:45 (14 years ago)
- Location:
- issm/trunk/src/c/io
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/io/FetchData.cpp
r7218 r7740 24 24 25 25 /*First, check that our reference is a double, otherwise, error out: */ 26 if (mxIs Double(dataref)){26 if (mxIsClass(dataref,"double")){ 27 27 28 28 /*We need to copy the data pointed by dataref, so that our dataset is not actually a pointer!:*/ … … 61 61 outmatrix=NULL; 62 62 } 63 else if (mxIs Double(dataref) ){63 else if (mxIsClass(dataref,"double") ){ 64 64 65 65 /*Check dataref is not pointing to NaN: */ … … 100 100 outmatrix=NULL; 101 101 } 102 else if (mxIs Double(dataref) ){102 else if (mxIsClass(dataref,"double") ){ 103 103 104 104 /*Check dataref is not pointing to NaN: */ … … 142 142 outmatrix=NULL; 143 143 } 144 else if (mxIs Double(dataref) ){144 else if (mxIsClass(dataref,"double") ){ 145 145 146 146 /*Check dataref is not pointing to NaN: */ … … 177 177 int dummy=0; 178 178 179 if (mxIs Double(dataref) ){179 if (mxIsClass(dataref,"double") ){ 180 180 181 181 /*Check dataref is not pointing to NaN: */ … … 209 209 outvector=NULL; 210 210 } 211 else if (mxIs Double(dataref) ){211 else if (mxIsClass(dataref,"double") ){ 212 212 213 213 /*Convert matlab vector to double* vector: */ … … 238 238 outvector=NULL; 239 239 } 240 else if (mxIs Double(dataref) ){240 else if (mxIsClass(dataref,"double") ){ 241 241 242 242 /*Convert matlab vector to double* vector: */ … … 270 270 outvector=NULL; 271 271 } 272 else if (mxIs Double(dataref) ){272 else if (mxIsClass(dataref,"double") ){ 273 273 274 274 /*Convert matlab vector to double* vector: */ … … 302 302 outvector=NULL; 303 303 } 304 else if (mxIs Double(dataref) ){304 else if (mxIsClass(dataref,"double") ){ 305 305 306 306 /*Convert matlab vector to double* vector: */ … … 331 331 vector=NULL; 332 332 } 333 else if (mxIs Double(dataref) ){333 else if (mxIsClass(dataref,"double") ){ 334 334 335 335 /*Convert matlab vector to petsc vector: */ … … 352 352 353 353 /*Ok, the string should be coming directly from the matlab workspace: */ 354 if (!mxIsC har(dataref)){354 if (!mxIsClass(dataref,"char")){ 355 355 _error_("input data_type is not a string!"); 356 356 } … … 373 373 double scalar; 374 374 375 if (!mxIs Double(dataref)){375 if (!mxIsClass(dataref,"double")){ 376 376 _error_("input data_type is not a double!"); 377 377 } … … 390 390 int integer; 391 391 392 if (!mxIs Double(dataref)){392 if (!mxIsClass(dataref,"double")){ 393 393 _error_("input data_type is not a scalar!"); 394 394 } -
issm/trunk/src/c/io/FetchParams.cpp
r6412 r7740 58 58 59 59 /*Check type of field: */ 60 if (mxIs Double(pfield)){60 if (mxIsClass(pfield,"double")){ 61 61 62 62 /*could be DOUBLE, DOUBLEVEC or DOUBLEMAT, depends on dimensions: */ … … 100 100 101 101 } 102 else if (mxIsC har(pfield)){102 else if (mxIsClass(pfield,"char")){ 103 103 /* we have a string parameter:*/ 104 104 … … 115 115 xfree((void**)&string); 116 116 } 117 else if (mxIsC ell(pfield)){117 else if (mxIsClass(pfield,"cell")){ 118 118 119 119 /*This can be a string array, or a matrix array. Check the first 120 120 *element type to decide: */ 121 121 pfield2=mxGetCell(pfield,0); 122 if (mxIsC har(pfield2)){122 if (mxIsClass(pfield2,"char")){ 123 123 124 124 /*string array: */ -
issm/trunk/src/c/io/OptionParse.cpp
r7739 r7740 22 22 23 23 /*parse the value according to the matlab data type */ 24 if (mxIsDouble(prhs[0])) 25 oobject=(Option*)OptionDoubleParse(name,prhs); 26 else if (mxIsLogical(prhs[0])) 27 oobject=(Option*)OptionLogicalParse(name,prhs); 28 else if (mxIsChar(prhs[0])) 29 oobject=(Option*)OptionCharParse(name,prhs); 30 else if (mxIsStruct(prhs[0])) 31 oobject=(Option*)OptionStructParse(name,prhs); 32 else if (mxIsCell(prhs[0])) 33 oobject=(Option*)OptionCellParse(name,prhs); 24 if (mxIsClass(prhs[0],"double")) oobject=(Option*)OptionDoubleParse(name,prhs); 25 else if(mxIsClass(prhs[0],"logical")) oobject=(Option*)OptionLogicalParse(name,prhs); 26 else if(mxIsClass(prhs[0],"char")) oobject=(Option*)OptionCharParse(name,prhs); 27 else if(mxIsClass(prhs[0],"struct")) oobject=(Option*)OptionStructParse(name,prhs); 28 else if(mxIsClass(prhs[0],"cell")) oobject=(Option*)OptionCellParse(name,prhs); 34 29 else { 35 30 _printf_(true," Converting value of option \"%s\" from unrecognized class \"%s\" to class \"%s\".\n",name,mxGetClassName(prhs[0]),"struct"); … … 55 50 56 51 /*check and parse the value */ 57 if (!mxIs Double(prhs[0])){52 if (!mxIsClass(prhs[0],"double")){ 58 53 _error_("Value of option \"%s\" must be class \"%s\", not class \"%s\".",odouble->name,"double",odouble->name,mxGetClassName(prhs[0])); 59 54 } … … 86 81 87 82 /*check and parse the value */ 88 if (!mxIs Logical(prhs[0])){83 if (!mxIsClass(prhs[0],"logical")){ 89 84 _error_("Value of option \"%s\" must be class \"%s\", not class \"%s\".",ological->name,"logical",ological->name,mxGetClassName(prhs[0])); 90 85 } … … 121 116 122 117 /*check and parse the value */ 123 if (!mxIsC har(prhs[0])){118 if (!mxIsClass(prhs[0],"char")){ 124 119 _error_("Value of option \"%s\" must be class \"%s\", not class \"%s\".",ochar->name,"char",ochar->name,mxGetClassName(prhs[0])); 125 120 } … … 156 151 157 152 /*check and parse the value */ 158 if (!mxIs Struct(prhs[0])){153 if (!mxIsClass(prhs[0],"struct")){ 159 154 _error_("Value of option \"%s\" must be class \"%s\", not class \"%s\".",ostruct->name,"struct",ostruct->name,mxGetClassName(prhs[0])); 160 155 } … … 203 198 204 199 /*check and parse the value */ 205 if (!mxIsC ell(prhs[0])){200 if (!mxIsClass(prhs[0],"cell")){ 206 201 _error_("Value of option \"%s\" must be class \"%s\", not class \"%s\".",ocell->name,"cell",ocell->name,mxGetClassName(prhs[0])); 207 202 }
Note:
See TracChangeset
for help on using the changeset viewer.