Changeset 12534
- Timestamp:
- 06/25/12 14:51:15 (13 years ago)
- Location:
- issm/trunk-jpl/src/c/objects/Options
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/objects/Options/Option.h
r12494 r12534 43 43 virtual int* Size()=0; 44 44 virtual void Get(int* pvalue)=0; 45 virtual void Get(Issm PDouble* pvalue)=0;45 virtual void Get(IssmDouble* pvalue)=0; 46 46 virtual void Get(bool* pvalue)=0; 47 47 virtual void Get(char** pvalue)=0; 48 48 virtual void Get(char*** ppvalue,int *pnumel)=0; 49 virtual void Get(Issm PDouble** pvalue,int *pnumel)=0;49 virtual void Get(IssmDouble** pvalue,int *pnumel)=0; 50 50 virtual void Get(Options** pvalue)=0; 51 51 virtual void Get(Options*** ppvalue,int *pnumel)=0; -
issm/trunk-jpl/src/c/objects/Options/OptionCell.h
r12494 r12534 40 40 int* Size(); 41 41 void Get(int* pvalue){_error2_("An OptionCell object cannot return a int");}; 42 void Get(Issm PDouble* pvalue){_error2_("An OptionCell object cannot return a IssmPDouble");};42 void Get(IssmDouble* pvalue){_error2_("An OptionCell object cannot return a IssmDouble");}; 43 43 void Get(bool* pvalue){ _error2_("An OptionCell object cannot return a bool");}; 44 44 void Get(char** pvalue){ _error2_("An OptionCell object cannot return a string");}; 45 45 void Get(char*** ppvalue,int *pnumel){ _error2_("An OptionCell object cannot return a string vec");}; 46 void Get(Issm PDouble** pvalue,int *pnumel){ _error2_("An OptionCell object cannot return a IssmPDouble vec");};46 void Get(IssmDouble** pvalue,int *pnumel){ _error2_("An OptionCell object cannot return a IssmDouble vec");}; 47 47 void Get(Options** pvalue); 48 48 void Get(Options*** ppvalue,int *pnumel){ _error2_("An OptionCell object cannot return an Options DataSet vec");}; -
issm/trunk-jpl/src/c/objects/Options/OptionChar.h
r12494 r12534 40 40 int* Size(); 41 41 void Get(int* pvalue){_error2_("An OptionChar object cannot return a int");}; 42 void Get(Issm PDouble* pvalue){_error2_("An OptionChar object cannot return a IssmPDouble");};42 void Get(IssmDouble* pvalue){_error2_("An OptionChar object cannot return a IssmDouble");}; 43 43 void Get(bool* pvalue){ _error2_("An OptionChar object cannot return a bool");}; 44 44 void Get(char** pvalue); 45 45 void Get(char*** ppvalue,int *pnumel); 46 void Get(Issm PDouble** pvalue,int *pnumel){ _error2_("An OptionChar object cannot return a IssmPDouble vec");};46 void Get(IssmDouble** pvalue,int *pnumel){ _error2_("An OptionChar object cannot return a IssmDouble vec");}; 47 47 void Get(Options** pvalue){ _error2_("An OptionChar object cannot return an Options DataSet");}; 48 48 void Get(Options*** ppvalue,int *pnumel){ _error2_("An OptionChar object cannot return an Options DataSet vec");}; -
issm/trunk-jpl/src/c/objects/Options/OptionDouble.cpp
r12520 r12534 1 1 /*!\file OptionDouble.cpp 2 * \brief: implementation of the optionsIssm PDouble object2 * \brief: implementation of the optionsIssmDouble object 3 3 */ 4 4 … … 31 31 OptionDouble::~OptionDouble(){ 32 32 33 if (values) xDelete<Issm PDouble>(values);33 if (values) xDelete<IssmDouble>(values); 34 34 35 35 } … … 50 50 else { 51 51 StringFromSize(cstr,size,ndims); 52 if(flag) _pprintLine_(" values: " << cstr << " " << "Issm PDouble");52 if(flag) _pprintLine_(" values: " << cstr << " " << "IssmDouble"); 53 53 } 54 54 } … … 132 132 } 133 133 /*}}}*/ 134 /*FUNCTION OptionDouble::Get(Issm PDouble* pvalue) {{{*/135 void OptionDouble::Get(Issm PDouble* pvalue){134 /*FUNCTION OptionDouble::Get(IssmDouble* pvalue) {{{*/ 135 void OptionDouble::Get(IssmDouble* pvalue){ 136 136 137 137 /*We should first check that the size is one*/ 138 138 if(this->NumEl()!=1){ 139 _error2_("option \"" << this->name << "\" has " << this->NumEl() << " elements and cannot return a single Issm PDouble");139 _error2_("option \"" << this->name << "\" has " << this->NumEl() << " elements and cannot return a single IssmDouble"); 140 140 } 141 141 … … 144 144 } 145 145 /*}}}*/ 146 /*FUNCTION OptionDouble::Get(Issm PDouble** pvalue,int* numel) {{{*/147 void OptionDouble::Get(Issm PDouble** pvalue,int* numel){146 /*FUNCTION OptionDouble::Get(IssmDouble** pvalue,int* numel) {{{*/ 147 void OptionDouble::Get(IssmDouble** pvalue,int* numel){ 148 148 149 149 /*We should first check that the size is at least one*/ 150 150 if(this->NumEl()<=0){ 151 _error2_("option \"" << this->name << "\" is empty and cannot return a Issm PDouble vector");151 _error2_("option \"" << this->name << "\" is empty and cannot return a IssmDouble vector"); 152 152 } 153 153 154 154 /*Copy vector*/ 155 Issm PDouble* outvalue=xNew<IssmPDouble>(this->NumEl());155 IssmDouble* outvalue=xNew<IssmDouble>(this->NumEl()); 156 156 for(int i=0;i<this->NumEl();i++) outvalue[i]=this->values[i]; 157 157 -
issm/trunk-jpl/src/c/objects/Options/OptionDouble.h
r12494 r12534 1 1 /*! \file OptionDouble.h 2 * \brief: header file for optionIssm PDouble object2 * \brief: header file for optionIssmDouble object 3 3 */ 4 4 … … 18 18 public: 19 19 20 Issm PDouble* values;20 IssmDouble* values; 21 21 22 22 /*OptionDouble constructors, destructors {{{*/ … … 40 40 int* Size(); 41 41 void Get(int* pvalue); 42 void Get(Issm PDouble* pvalue);42 void Get(IssmDouble* pvalue); 43 43 void Get(bool* pvalue){ _error2_("An OptionDouble object cannot return a bool");}; 44 44 void Get(char** pvalue){ _error2_("An OptionDouble object cannot return a string");}; 45 45 void Get(char*** ppvalue,int *pnumel){ _error2_("An OptionDouble object cannot return a string vec");}; 46 void Get(Issm PDouble** pvalue,int* pnumel);46 void Get(IssmDouble** pvalue,int* pnumel); 47 47 void Get(Options** pvalue){ _error2_("An OptionDouble object cannot return an Options DataSet");}; 48 48 void Get(Options*** ppvalue,int *pnumel){ _error2_("An OptionDouble object cannot return an Options DataSet vec");}; -
issm/trunk-jpl/src/c/objects/Options/OptionLogical.h
r12494 r12534 40 40 int* Size(); 41 41 void Get(int* pvalue){_error2_("An OptionLogical object cannot return a int");}; 42 void Get(Issm PDouble* pvalue){_error2_("An OptionLogical object cannot return a IssmPDouble");};42 void Get(IssmDouble* pvalue){_error2_("An OptionLogical object cannot return a IssmDouble");}; 43 43 void Get(bool* pvalue); 44 44 void Get(char** pvalue){ _error2_("An OptionLogical object cannot return a string");}; 45 45 void Get(char*** ppvalue,int *pnumel){ _error2_("An OptionLogical object cannot return a string vec");}; 46 void Get(Issm PDouble** pvalue,int *pnumel){ _error2_("An OptionLogical object cannot return a IssmPDouble vec");};46 void Get(IssmDouble** pvalue,int *pnumel){ _error2_("An OptionLogical object cannot return a IssmDouble vec");}; 47 47 void Get(Options** pvalue){ _error2_("An OptionLogical object cannot return an Options DataSet");}; 48 48 void Get(Options*** ppvalue,int *pnumel){ _error2_("An OptionLogical object cannot return an Options DataSet vec");}; -
issm/trunk-jpl/src/c/objects/Options/OptionStruct.h
r12494 r12534 40 40 int* Size(); 41 41 void Get(int* pvalue){_error2_("An OptionStruct object cannot return a int");}; 42 void Get(Issm PDouble* pvalue){_error2_("An OptionStruct object cannot return a IssmPDouble");};42 void Get(IssmDouble* pvalue){_error2_("An OptionStruct object cannot return a IssmDouble");}; 43 43 void Get(bool* pvalue){ _error2_("An OptionStruct object cannot return a bool");}; 44 44 void Get(char** pvalue){ _error2_("An OptionStruct object cannot return a string");}; 45 45 void Get(char*** ppvalue,int *pnumel){ _error2_("An OptionStruct object cannot return a string vec");}; 46 void Get(Issm PDouble** pvalue,int *pnumel){ _error2_("An OptionStruct object cannot return a IssmPDouble vec");};46 void Get(IssmDouble** pvalue,int *pnumel){ _error2_("An OptionStruct object cannot return a IssmDouble vec");}; 47 47 void Get(Options** pvalue); 48 48 void Get(Options*** ppvalue,int *pnumel); -
issm/trunk-jpl/src/c/objects/Options/OptionUtilities.cpp
r12493 r12534 31 31 /*calculate the dimensions (being careful of integer division) */ 32 32 for (i=ndims-1; i>=0; i--) { 33 aprod=(int)(((Issm PDouble)aprod+0.5)/(IssmPDouble)size[i]);34 dims[i]=(int)floor(((Issm PDouble)index+0.5)/(IssmPDouble)aprod);33 aprod=(int)(((IssmDouble)aprod+0.5)/(IssmDouble)size[i]); 34 dims[i]=(int)floor(((IssmDouble)index+0.5)/(IssmDouble)aprod); 35 35 index-=dims[i]*aprod; 36 36 } … … 69 69 /*calculate the dimensions (being careful of integer division) */ 70 70 for (i=0; i<ndims; i++) { 71 aprod=(int)(((Issm PDouble)aprod+0.5)/(IssmPDouble)size[i]);72 dims[i]=(int)floor(((Issm PDouble)index+0.5)/(IssmPDouble)aprod);71 aprod=(int)(((IssmDouble)aprod+0.5)/(IssmDouble)size[i]); 72 dims[i]=(int)floor(((IssmDouble)index+0.5)/(IssmDouble)aprod); 73 73 index-=dims[i]*aprod; 74 74 }
Note:
See TracChangeset
for help on using the changeset viewer.