Changeset 12473


Ignore:
Timestamp:
06/20/12 09:30:44 (13 years ago)
Author:
utke
Message:

type renames

Location:
issm/trunk-jpl/src/c/objects/Options
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/objects/Options/Option.h

    r12365 r12473  
    4343                virtual int*  Size()=0;
    4444                virtual void  Get(int* pvalue)=0;
    45                 virtual void  Get(double* pvalue)=0;
     45                virtual void  Get(IssmPDouble* pvalue)=0;
    4646                virtual void  Get(bool* pvalue)=0;
    4747                virtual void  Get(char** pvalue)=0;
    4848                virtual void  Get(char*** ppvalue,int *pnumel)=0;
    49                 virtual void  Get(double** pvalue,int *pnumel)=0;
     49                virtual void  Get(IssmPDouble** pvalue,int *pnumel)=0;
    5050                virtual void  Get(Options** pvalue)=0;
    5151                virtual void  Get(Options*** ppvalue,int *pnumel)=0;
  • issm/trunk-jpl/src/c/objects/Options/OptionCell.cpp

    r12454 r12473  
    7878        Option::DeepEcho(indent);
    7979
    80         memcpy(indent2,indent,(strlen(indent)+1)*sizeof(char));
     80        xMemCpy<char>(indent2,indent,(strlen(indent)+1));
    8181        strcat(indent2,"  ");
    8282
  • issm/trunk-jpl/src/c/objects/Options/OptionCell.h

    r12365 r12473  
    4040                int*  Size();
    4141                void  Get(int* pvalue){_error_("An OptionCell object cannot return a int");};
    42                 void  Get(double* pvalue){_error_("An OptionCell object cannot return a double");};
     42                void  Get(IssmPDouble* pvalue){_error_("An OptionCell object cannot return a IssmPDouble");};
    4343                void  Get(bool* pvalue){  _error_("An OptionCell object cannot return a bool");};
    4444                void  Get(char** pvalue){ _error_("An OptionCell object cannot return a string");};
    4545                void  Get(char*** ppvalue,int *pnumel){ _error_("An OptionCell object cannot return a string vec");};
    46                 void  Get(double** pvalue,int *pnumel){ _error_("An OptionCell object cannot return a double vec");};
     46                void  Get(IssmPDouble** pvalue,int *pnumel){ _error_("An OptionCell object cannot return a IssmPDouble vec");};
    4747                void  Get(Options** pvalue);
    4848                void  Get(Options*** ppvalue,int *pnumel){ _error_("An OptionCell object cannot return an Options DataSet vec");};
  • issm/trunk-jpl/src/c/objects/Options/OptionChar.cpp

    r12454 r12473  
    8282        Option::DeepEcho(indent);
    8383
    84         memcpy(indent2,indent,(strlen(indent)+1)*sizeof(char));
     84        xMemCpy<char>(indent2,indent,(strlen(indent)+1));
    8585        strcat(indent2,"  ");
    8686
     
    139139
    140140        outstring=xNew<char>(stringsize);
    141         memcpy(outstring,this->values,stringsize*sizeof(char));
     141        xMemCpy<char>(outstring,this->values,stringsize);
    142142
    143143        *pvalue=outstring;
     
    165165        for (i=0; i<nstr; i++) {
    166166                outstring=xNew<char>(stringsize);
    167                 memcpy(outstring,&(this->values[ipt]),(stringsize-1)*sizeof(char));
     167                xMemCpy<char>(outstring,&(this->values[ipt]),(stringsize-1));
    168168                outstring[stringsize-1]='\0';
    169169                (*ppvalue)[i]=outstring;
  • issm/trunk-jpl/src/c/objects/Options/OptionChar.h

    r12365 r12473  
    4040                int*  Size();
    4141                void  Get(int* pvalue){_error_("An OptionChar object cannot return a int");};
    42                 void  Get(double* pvalue){_error_("An OptionChar object cannot return a double");};
     42                void  Get(IssmPDouble* pvalue){_error_("An OptionChar object cannot return a IssmPDouble");};
    4343                void  Get(bool* pvalue){  _error_("An OptionChar object cannot return a bool");};
    4444                void  Get(char** pvalue);
    4545                void  Get(char*** ppvalue,int *pnumel);
    46                 void  Get(double** pvalue,int *pnumel){ _error_("An OptionChar object cannot return a double vec");};
     46                void  Get(IssmPDouble** pvalue,int *pnumel){ _error_("An OptionChar object cannot return a IssmPDouble vec");};
    4747                void  Get(Options** pvalue){ _error_("An OptionChar object cannot return an Options DataSet");};
    4848                void  Get(Options*** ppvalue,int *pnumel){ _error_("An OptionChar object cannot return an Options DataSet vec");};
  • issm/trunk-jpl/src/c/objects/Options/OptionDouble.cpp

    r12454 r12473  
    11/*!\file OptionDouble.cpp
    2  * \brief: implementation of the optionsdouble object
     2 * \brief: implementation of the optionsIssmPDouble object
    33 */
    44
     
    3131OptionDouble::~OptionDouble(){
    3232
    33         if (values) xDelete<double>(values);
     33        if (values) xDelete<IssmPDouble>(values);
    3434
    3535}
     
    5050                else {
    5151                        StringFromSize(cstr,size,ndims);
    52                         _printf_(flag,"        values: %s %s\n" ,cstr,"double");
     52                        _printf_(flag,"        values: %s %s\n" ,cstr,"IssmPDouble");
    5353                }
    5454        }
     
    7878        Option::DeepEcho(indent);
    7979
    80         memcpy(indent2,indent,(strlen(indent)+1)*sizeof(char));
     80        xMemCpy<char>(indent2,indent,(strlen(indent)+1));
    8181        strcat(indent2,"  ");
    8282
     
    132132}
    133133/*}}}*/
    134 /*FUNCTION OptionDouble::Get(double* pvalue) {{{*/
    135 void OptionDouble::Get(double* pvalue){
     134/*FUNCTION OptionDouble::Get(IssmPDouble* pvalue) {{{*/
     135void OptionDouble::Get(IssmPDouble* pvalue){
    136136
    137137        /*We should first check that the size is one*/
    138138        if(this->NumEl()!=1){
    139                 _error_("option \"%s\" has %i elements and cannot return a single double",this->name,this->NumEl());
     139                _error_("option \"%s\" has %i elements and cannot return a single IssmPDouble",this->name,this->NumEl());
    140140        }
    141141
     
    144144}
    145145/*}}}*/
    146 /*FUNCTION OptionDouble::Get(double** pvalue,int* numel) {{{*/
    147 void OptionDouble::Get(double** pvalue,int* numel){
     146/*FUNCTION OptionDouble::Get(IssmPDouble** pvalue,int* numel) {{{*/
     147void OptionDouble::Get(IssmPDouble** pvalue,int* numel){
    148148
    149149        /*We should first check that the size is at least one*/
    150150        if(this->NumEl()<=0){
    151                 _error_("option \"%s\" is empty and cannot return a double vector",this->name);
     151                _error_("option \"%s\" is empty and cannot return a IssmPDouble vector",this->name);
    152152        }
    153153
    154154        /*Copy vector*/
    155         double* outvalue=xNew<double>(this->NumEl());
     155        IssmPDouble* outvalue=xNew<IssmPDouble>(this->NumEl());
    156156        for(int i=0;i<this->NumEl();i++) outvalue[i]=this->values[i];
    157157
  • issm/trunk-jpl/src/c/objects/Options/OptionDouble.h

    r12365 r12473  
    11/*! \file OptionDouble.h
    2  *  \brief: header file for optiondouble object
     2 *  \brief: header file for optionIssmPDouble object
    33 */
    44
     
    1818        public:
    1919
    20                 double* values;
     20                IssmPDouble* values;
    2121
    2222                /*OptionDouble constructors, destructors {{{*/
     
    4040                int*  Size();
    4141                void  Get(int* pvalue);
    42                 void  Get(double* pvalue);
     42                void  Get(IssmPDouble* pvalue);
    4343                void  Get(bool* pvalue){  _error_("An OptionDouble object cannot return a bool");};
    4444                void  Get(char** pvalue){ _error_("An OptionDouble object cannot return a string");};
    4545                void  Get(char*** ppvalue,int *pnumel){ _error_("An OptionDouble object cannot return a string vec");};
    46                 void  Get(double** pvalue,int* pnumel);
     46                void  Get(IssmPDouble** pvalue,int* pnumel);
    4747                void  Get(Options** pvalue){ _error_("An OptionDouble object cannot return an Options DataSet");};
    4848                void  Get(Options*** ppvalue,int *pnumel){ _error_("An OptionDouble object cannot return an Options DataSet vec");};
  • issm/trunk-jpl/src/c/objects/Options/OptionLogical.cpp

    r12454 r12473  
    7878        Option::DeepEcho(indent);
    7979
    80         memcpy(indent2,indent,(strlen(indent)+1)*sizeof(char));
     80        xMemCpy<char>(indent2,indent,(strlen(indent)+1));
    8181        strcat(indent2,"  ");
    8282
  • issm/trunk-jpl/src/c/objects/Options/OptionLogical.h

    r12365 r12473  
    4040                int*  Size();
    4141                void  Get(int* pvalue){_error_("An OptionLogical object cannot return a int");};
    42                 void  Get(double* pvalue){_error_("An OptionLogical object cannot return a double");};
     42                void  Get(IssmPDouble* pvalue){_error_("An OptionLogical object cannot return a IssmPDouble");};
    4343                void  Get(bool* pvalue);
    4444                void  Get(char** pvalue){ _error_("An OptionLogical object cannot return a string");};
    4545                void  Get(char*** ppvalue,int *pnumel){ _error_("An OptionLogical object cannot return a string vec");};
    46                 void  Get(double** pvalue,int *pnumel){ _error_("An OptionLogical object cannot return a double vec");};
     46                void  Get(IssmPDouble** pvalue,int *pnumel){ _error_("An OptionLogical object cannot return a IssmPDouble vec");};
    4747                void  Get(Options** pvalue){ _error_("An OptionLogical object cannot return an Options DataSet");};
    4848                void  Get(Options*** ppvalue,int *pnumel){ _error_("An OptionLogical object cannot return an Options DataSet vec");};
  • issm/trunk-jpl/src/c/objects/Options/OptionStruct.cpp

    r12454 r12473  
    8383        Option::DeepEcho(indent);
    8484
    85         memcpy(indent2,indent,(strlen(indent)+1)*sizeof(char));
     85        xMemCpy<char>(indent2,indent,(strlen(indent)+1));
    8686        strcat(indent2,"  ");
    8787
  • issm/trunk-jpl/src/c/objects/Options/OptionStruct.h

    r12365 r12473  
    4040                int*  Size();
    4141                void  Get(int* pvalue){_error_("An OptionStruct object cannot return a int");};
    42                 void  Get(double* pvalue){_error_("An OptionStruct object cannot return a double");};
     42                void  Get(IssmPDouble* pvalue){_error_("An OptionStruct object cannot return a IssmPDouble");};
    4343                void  Get(bool* pvalue){  _error_("An OptionStruct object cannot return a bool");};
    4444                void  Get(char** pvalue){ _error_("An OptionStruct object cannot return a string");};
    4545                void  Get(char*** ppvalue,int *pnumel){ _error_("An OptionStruct object cannot return a string vec");};
    46                 void  Get(double** pvalue,int *pnumel){ _error_("An OptionStruct object cannot return a double vec");};
     46                void  Get(IssmPDouble** pvalue,int *pnumel){ _error_("An OptionStruct object cannot return a IssmPDouble vec");};
    4747                void  Get(Options** pvalue);
    4848                void  Get(Options*** ppvalue,int *pnumel);
  • issm/trunk-jpl/src/c/objects/Options/OptionUtilities.cpp

    r12365 r12473  
    3131        /*calculate the dimensions (being careful of integer division)  */
    3232        for (i=ndims-1; i>=0; i--) {
    33                 aprod=(int)(((double)aprod+0.5)/(double)size[i]);
    34                 dims[i]=(int)floor(((double)index+0.5)/(double)aprod);
     33                aprod=(int)(((IssmPDouble)aprod+0.5)/(IssmPDouble)size[i]);
     34                dims[i]=(int)floor(((IssmPDouble)index+0.5)/(IssmPDouble)aprod);
    3535                index-=dims[i]*aprod;
    3636        }
     
    6969        /*calculate the dimensions (being careful of integer division)  */
    7070        for (i=0; i<ndims; i++) {
    71                 aprod=(int)(((double)aprod+0.5)/(double)size[i]);
    72                 dims[i]=(int)floor(((double)index+0.5)/(double)aprod);
     71                aprod=(int)(((IssmPDouble)aprod+0.5)/(IssmPDouble)size[i]);
     72                dims[i]=(int)floor(((IssmPDouble)index+0.5)/(IssmPDouble)aprod);
    7373                index-=dims[i]*aprod;
    7474        }
Note: See TracChangeset for help on using the changeset viewer.