Changeset 13267
- Timestamp:
- 09/05/12 13:55:27 (13 years ago)
- Location:
- issm/trunk-jpl/src/c
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/Container/Observations.cpp
r13261 r13267 42 42 int i,j,maxdepth,level,counter,index; 43 43 int xi,yi; 44 IssmPDouble 45 IssmPDouble 44 IssmPDouble xmin,xmax,ymin,ymax; 45 IssmPDouble offset,minlength,minspacing,mintrimming,maxtrimming; 46 46 Observation *observation = NULL; 47 47 -
issm/trunk-jpl/src/c/classes/IoModel.cpp
r13222 r13267 888 888 switch(code){ 889 889 case 3: {//IssmDouble 890 GenericOption<IssmDouble*>* option; 891 IssmDouble *value = NULL; 892 value=xNew<IssmDouble>(1); 893 FetchData(value,index+1); 894 option = new GenericOption<IssmDouble*>(); 890 GenericOption<IssmDouble>* option; 891 IssmPDouble value; 892 FetchData(&value,index+1); 893 option = new GenericOption<IssmDouble>(); 895 894 option->value = value; 896 895 option->name = name; -
issm/trunk-jpl/src/c/classes/objects/Options/Option.h
r13216 r13267 23 23 ~Option(){}; 24 24 /*}}}*/ 25 26 25 /*Object virtual functions definitions:{{{*/ 27 virtual void Echo()= 0;28 virtual void DeepEcho()= 0;29 virtual void DeepEcho(char *indent)=0;30 int Id(){_error_("Not implemented yet");};31 int MyRank(){_error_("Not implemented yet");};32 int ObjectEnum(){return OptionEnum;};33 Object * copy(){_error_("Not implemented yet");};26 virtual void Echo()= 0; 27 virtual void DeepEcho()= 0; 28 virtual void DeepEcho(char *indent)=0; 29 int Id(){_error_("Not implemented yet"); }; 30 int MyRank(){_error_("Not implemented yet"); }; 31 int ObjectEnum(){return OptionEnum; }; 32 Object *copy(){_error_("Not implemented yet"); }; 34 33 /*}}}*/ 35 34 -
issm/trunk-jpl/src/c/matlab/io/OptionParse.cpp
r13216 r13267 15 15 #include "./matlabio.h" 16 16 17 GenericOption<double*>* OptionDoubleParse( char* name, const mxArray* prhs[]){ /*{{{*/ 17 GenericOption<double>* OptionDoubleParse( char* name, const mxArray* prhs[]){ /*{{{*/ 18 19 GenericOption<double> *odouble = NULL; 20 21 /*check and parse the name */ 22 odouble=new GenericOption<double>(); 23 odouble->name =xNew<char>(strlen(name)+1); 24 memcpy(odouble->name,name,(strlen(name)+1)*sizeof(char)); 25 FetchData(&odouble->value,prhs[0]); 26 odouble->numel=1; 27 odouble->ndims=1; 28 odouble->size=NULL; 29 30 return(odouble); 31 }/*}}}*/ 32 GenericOption<double*>* OptionDoubleArrayParse( char* name, const mxArray* prhs[]){ /*{{{*/ 18 33 19 34 GenericOption<double*> *odouble = NULL; … … 160 175 Option* OptionParse(char* name, const mxArray* prhs[]){ /*{{{*/ 161 176 162 Option *option = NULL;163 mxArray 177 Option *option = NULL; 178 mxArray *lhs[1]; 164 179 165 180 /*parse the value according to the matlab data type */ 166 if (mxIsClass(prhs[0],"double")) option=(Option*)OptionDoubleParse(name,prhs); 167 else if(mxIsClass(prhs[0],"logical")) option=(Option*)OptionLogicalParse(name,prhs); 168 else if(mxIsClass(prhs[0],"char")) option=(Option*)OptionCharParse(name,prhs); 169 else if(mxIsClass(prhs[0],"struct")) option=(Option*)OptionStructParse(name,prhs); 170 else if(mxIsClass(prhs[0],"cell")) option=(Option*)OptionCellParse(name,prhs); 181 if (mxIsClass(prhs[0],"double") && (mxGetNumberOfElements(prhs[0])==1)) 182 option=(Option*)OptionDoubleParse(name,prhs); 183 else if(mxIsClass(prhs[0],"double") && (mxGetNumberOfElements(prhs[0])!=1)) 184 option=(Option*)OptionDoubleArrayParse(name,prhs); 185 else if(mxIsClass(prhs[0],"logical")) 186 option=(Option*)OptionLogicalParse(name,prhs); 187 else if(mxIsClass(prhs[0],"char")) 188 option=(Option*)OptionCharParse(name,prhs); 189 else if(mxIsClass(prhs[0],"struct")) 190 option=(Option*)OptionStructParse(name,prhs); 191 else if(mxIsClass(prhs[0],"cell")) 192 option=(Option*)OptionCellParse(name,prhs); 171 193 else { 172 194 _pprintLine_(" Converting value of option \"" << name << "\" from unrecognized class \"" << mxGetClassName(prhs[0]) << "\" to class \"" << "struct" << "\"."); -
issm/trunk-jpl/src/c/matlab/io/matlabio.h
r13242 r13267 51 51 52 52 Option* OptionParse(char* name, const mxArray* prhs[]); 53 GenericOption<double*>* OptionDoubleParse( char* name, const mxArray* prhs[]); 53 GenericOption<double>* OptionDoubleParse( char* name, const mxArray* prhs[]); 54 GenericOption<double*>* OptionDoubleArrayParse( char* name, const mxArray* prhs[]); 54 55 GenericOption<bool*>* OptionLogicalParse( char* name, const mxArray* prhs[]); 55 56 GenericOption<char*>* OptionCharParse( char* name, const mxArray* prhs[]); -
issm/trunk-jpl/src/c/solutions/kriging.cpp
r13056 r13267 23 23 24 24 /*Input*/ 25 int ninterp,nobs;26 IssmDouble 27 IssmDouble 28 IssmDouble 29 IssmDouble 30 IssmDouble 31 Options *options = NULL;25 int ninterp,nobs; 26 IssmDouble *x = NULL; 27 IssmDouble *y = NULL; 28 IssmDouble *data = NULL; 29 IssmDouble *x_interp = NULL; 30 IssmDouble *y_interp = NULL; 31 Options *options = NULL; 32 32 33 33 /*Output*/
Note:
See TracChangeset
for help on using the changeset viewer.