Changeset 12474 for issm/trunk-jpl/src
- Timestamp:
- 06/20/12 11:46:45 (13 years ago)
- Location:
- issm/trunk-jpl/src/c/objects/Params
- Files:
-
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/objects/Params/BoolParam.h
r12365 r12474 46 46 void GetParameterValue(int** pintarray,int* pM){_error_("Bool param of enum %i (%s) cannot return an array of integers",enum_type,EnumToStringx(enum_type));} 47 47 void GetParameterValue(int** pintarray,int* pM,int* pN){_error_("Bool param of enum %i (%s) cannot return an array of integers",enum_type,EnumToStringx(enum_type));} 48 void GetParameterValue( double* pdouble){_error_("Bool param of enum %i (%s) cannot return a double",enum_type,EnumToStringx(enum_type));}48 void GetParameterValue(IssmDouble* pIssmDouble){_error_("Bool param of enum %i (%s) cannot return a IssmDouble",enum_type,EnumToStringx(enum_type));} 49 49 void GetParameterValue(char** pstring){_error_("Bool param of enum %i (%s) cannot return a string",enum_type,EnumToStringx(enum_type));} 50 50 void GetParameterValue(char*** pstringarray,int* pM){_error_("Bool param of enum %i (%s) cannot return a string array",enum_type,EnumToStringx(enum_type));} 51 void GetParameterValue( double** pdoublearray,int* pM){_error_("Bool param of enum %i (%s) cannot return a double array",enum_type,EnumToStringx(enum_type));}52 void GetParameterValue( double** pdoublearray,int* pM, int* pN){_error_("Bool param of enum %i (%s) cannot return a double array",enum_type,EnumToStringx(enum_type));}53 void GetParameterValue( double*** parray, int* pM,int** pmdims, int** pndims){_error_("Bool param of enum %i (%s) cannot return a matrix array",enum_type,EnumToStringx(enum_type));}51 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error_("Bool param of enum %i (%s) cannot return a IssmDouble array",enum_type,EnumToStringx(enum_type));} 52 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error_("Bool param of enum %i (%s) cannot return a IssmDouble array",enum_type,EnumToStringx(enum_type));} 53 void GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("Bool param of enum %i (%s) cannot return a matrix array",enum_type,EnumToStringx(enum_type));} 54 54 void GetParameterValue(Vector** pvec){_error_("Bool param of enum %i (%s) cannot return a Vec",enum_type,EnumToStringx(enum_type));} 55 55 void GetParameterValue(Matrix** pmat){_error_("Bool param of enum %i (%s) cannot return a Mat",enum_type,EnumToStringx(enum_type));} … … 58 58 void SetValue(bool boolean){this->value=boolean;} 59 59 void SetValue(int integer){this->value=(bool)integer;} 60 void SetValue( double scalar){this->value=(bool)scalar;}60 void SetValue(IssmDouble scalar){this->value=(bool)scalar;} 61 61 void SetValue(char* string){_error_("Bool param of enum %i (%s) cannot hold a string",enum_type,EnumToStringx(enum_type));} 62 62 void SetValue(char** stringarray,int M){_error_("Bool param of enum %i (%s) cannot hold a string array",enum_type,EnumToStringx(enum_type));} 63 void SetValue( double* doublearray,int M){_error_("Bool param of enum %i (%s) cannot hold a double array",enum_type,EnumToStringx(enum_type));}64 void SetValue( double* pdoublearray,int M,int N){_error_("Bool param of enum %i (%s) cannot hold a double array",enum_type,EnumToStringx(enum_type));}63 void SetValue(IssmDouble* IssmDoublearray,int M){_error_("Bool param of enum %i (%s) cannot hold a IssmDouble array",enum_type,EnumToStringx(enum_type));} 64 void SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error_("Bool param of enum %i (%s) cannot hold a IssmDouble array",enum_type,EnumToStringx(enum_type));} 65 65 void SetValue(int* intarray,int M){_error_("Bool param of enum %i (%s) cannot hold a int array",enum_type,EnumToStringx(enum_type));} 66 66 void SetValue(int* pintarray,int M,int N){_error_("Bool param of enum %i (%s) cannot hold a int array",enum_type,EnumToStringx(enum_type));} … … 68 68 void SetValue(Matrix* mat){_error_("Bool param of enum %i (%s) cannot hold a Mat",enum_type,EnumToStringx(enum_type));} 69 69 void SetValue(FILE* fid){_error_("Bool param of enum %i (%s) cannot hold a FILE",enum_type,EnumToStringx(enum_type));} 70 void SetValue( double** array, int M, int* mdim_array, int* ndim_array){_error_("Bool param of enum %i (%s) cannot hold an array of matrices",enum_type,EnumToStringx(enum_type));}70 void SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Bool param of enum %i (%s) cannot hold an array of matrices",enum_type,EnumToStringx(enum_type));} 71 71 void UnitConversion(int direction_enum); 72 72 -
issm/trunk-jpl/src/c/objects/Params/DoubleMatArrayParam.cpp
r12451 r12474 26 26 } 27 27 /*}}}*/ 28 /*FUNCTION DoubleMatArrayParam::DoubleMatArrayParam(int enum_type, double** array, int M, int* mdim_array, int* ndim_array){{{*/29 DoubleMatArrayParam::DoubleMatArrayParam(int in_enum_type, double** in_array, int in_M, int* in_mdim_array, int* in_ndim_array){28 /*FUNCTION DoubleMatArrayParam::DoubleMatArrayParam(int enum_type,IssmDouble** array, int M, int* mdim_array, int* ndim_array){{{*/ 29 DoubleMatArrayParam::DoubleMatArrayParam(int in_enum_type,IssmDouble** in_array, int in_M, int* in_mdim_array, int* in_ndim_array){ 30 30 31 31 int i; 32 double* matrix=NULL;32 IssmDouble* matrix=NULL; 33 33 int m,n; 34 34 … … 36 36 M=in_M; 37 37 if(M){ 38 array=xNew< double*>(M);38 array=xNew<IssmDouble*>(M); 39 39 mdim_array=xNew<int>(M); 40 40 ndim_array=xNew<int>(M); … … 48 48 49 49 if(m*n){ 50 matrix=xNew< double>(m*n);51 memcpy(matrix,in_array[i],m*n*sizeof(double));50 matrix=xNew<IssmDouble>(m*n); 51 xMemCpy<IssmDouble>(matrix,in_array[i],m*n); 52 52 } 53 53 else{ … … 68 68 69 69 int i; 70 double* matrix=NULL;70 IssmDouble* matrix=NULL; 71 71 72 72 xDelete<int>(mdim_array); … … 75 75 for(i=0;i<M;i++){ 76 76 matrix=array[i]; 77 xDelete< double>(matrix);78 } 79 80 xDelete< double*>(array);77 xDelete<IssmDouble>(matrix); 78 } 79 80 xDelete<IssmDouble*>(array); 81 81 return; 82 82 } … … 99 99 int i,j,k; 100 100 int m,n; 101 double* matrix=NULL;101 IssmDouble* matrix=NULL; 102 102 103 103 printf("DoubleMatArrayParam:\n"); … … 143 143 144 144 /*DoubleMatArrayParam virtual functions definitions: */ 145 /*FUNCTION DoubleMatArrayParam::GetParameterValue( double*** parray, int* pM,int** pmdims, int** pndims){{{*/146 void DoubleMatArrayParam::GetParameterValue( double*** pout_array, int* pout_M,int** pout_mdim_array, int** pout_ndim_array){145 /*FUNCTION DoubleMatArrayParam::GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){{{*/ 146 void DoubleMatArrayParam::GetParameterValue(IssmDouble*** pout_array, int* pout_M,int** pout_mdim_array, int** pout_ndim_array){ 147 147 148 148 int i,m,n; 149 double* matrix=NULL;150 double* out_matrix=NULL;149 IssmDouble* matrix=NULL; 150 IssmDouble* out_matrix=NULL; 151 151 152 152 /*output: */ 153 double** out_array=NULL;153 IssmDouble** out_array=NULL; 154 154 int out_M; 155 155 int* out_mdim_array=NULL; … … 159 159 out_M=this->M; 160 160 if(out_M){ 161 out_array=xNew< double*>(M);161 out_array=xNew<IssmDouble*>(M); 162 162 out_mdim_array=xNew<int>(M); 163 163 out_ndim_array=xNew<int>(M); 164 164 165 memcpy(out_mdim_array,this->mdim_array,M*sizeof(int));166 memcpy(out_ndim_array,this->ndim_array,M*sizeof(int));165 xMemCpy<int>(out_mdim_array,this->mdim_array,M); 166 xMemCpy<int>(out_ndim_array,this->ndim_array,M); 167 167 168 168 for(i=0;i<this->M;i++){ … … 172 172 173 173 if(m*n){ 174 out_matrix=xNew< double>(m*n);175 memcpy(out_matrix,matrix,m*n*sizeof(double));174 out_matrix=xNew<IssmDouble>(m*n); 175 xMemCpy<IssmDouble>(out_matrix,matrix,m*n); 176 176 } 177 177 else{ … … 201 201 } 202 202 /*}}}*/ 203 /*FUNCTION DoubleMatArrayParam::SetValue( double** array, int M, int* mdim_array, int* ndim_array){{{*/204 void DoubleMatArrayParam::SetValue( double** in_array, int in_M, int* in_mdim_array, int* in_ndim_array){203 /*FUNCTION DoubleMatArrayParam::SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){{{*/ 204 void DoubleMatArrayParam::SetValue(IssmDouble** in_array, int in_M, int* in_mdim_array, int* in_ndim_array){ 205 205 206 206 int i,m,n; 207 double* in_matrix=NULL;208 double* matrix=NULL;207 IssmDouble* in_matrix=NULL; 208 IssmDouble* matrix=NULL; 209 209 210 210 /*avoid leak: */ … … 213 213 for(i=0;i<M;i++){ 214 214 matrix=array[i]; 215 xDelete< double>(matrix);216 } 217 xDelete< double*>(array);215 xDelete<IssmDouble>(matrix); 216 } 217 xDelete<IssmDouble*>(array); 218 218 219 219 /*copy data: */ 220 220 this->M=in_M; 221 this->array=xNew< double*>(M);221 this->array=xNew<IssmDouble*>(M); 222 222 this->mdim_array=xNew<int>(M); 223 223 this->ndim_array=xNew<int>(M); 224 224 225 memcpy(this->mdim_array,in_mdim_array,M*sizeof(double));226 memcpy(this->ndim_array,in_ndim_array,M*sizeof(double));225 xMemCpy<int>(this->mdim_array,in_mdim_array,M); 226 xMemCpy<int>(this->ndim_array,in_ndim_array,M); 227 227 228 228 for(i=0;i<M;i++){ … … 231 231 n=in_ndim_array[i]; 232 232 233 matrix=xNew< double>(m*n);234 memcpy(matrix,in_matrix,m*n*sizeof(double));233 matrix=xNew<IssmDouble>(m*n); 234 xMemCpy<IssmDouble>(matrix,in_matrix,m*n); 235 235 236 236 this->array[i]=matrix; … … 243 243 /*go through all matrices and convert: */ 244 244 for (int i=0;i<this->M;i++){ 245 double* matrix=this->array[i];245 IssmDouble* matrix=this->array[i]; 246 246 int m=this->mdim_array[i]; 247 247 int n=this->ndim_array[i]; -
issm/trunk-jpl/src/c/objects/Params/DoubleMatArrayParam.h
r12365 r12474 24 24 private: 25 25 int enum_type; 26 double** array; //array of matrices26 IssmDouble** array; //array of matrices 27 27 int M; //size of array 28 28 int* mdim_array; //m-dimensions of matrices in the array … … 32 32 /*DoubleMatArrayParam constructors, destructors: {{{*/ 33 33 DoubleMatArrayParam(); 34 DoubleMatArrayParam(int enum_type, double** array, int M, int* mdim_array, int* ndim_array);34 DoubleMatArrayParam(int enum_type,IssmDouble** array, int M, int* mdim_array, int* ndim_array); 35 35 ~DoubleMatArrayParam(); 36 36 /*}}}*/ … … 49 49 void GetParameterValue(int** pintarray,int* pM){_error_("DoubleMatArray param of enum %i (%s) cannot return an array of integers",enum_type,EnumToStringx(enum_type));} 50 50 void GetParameterValue(int** pintarray,int* pM,int* pN){_error_("DoubleMatArray param of enum %i (%s) cannot return an array of integers",enum_type,EnumToStringx(enum_type));} 51 void GetParameterValue( double* pdouble){_error_("DoubleMatArray param of enum %i (%s) cannot return a double",enum_type,EnumToStringx(enum_type));}51 void GetParameterValue(IssmDouble* pIssmDouble){_error_("DoubleMatArray param of enum %i (%s) cannot return a IssmDouble",enum_type,EnumToStringx(enum_type));} 52 52 void GetParameterValue(char** pstring){_error_("DoubleMatArray param of enum %i (%s) cannot return a string",enum_type,EnumToStringx(enum_type));} 53 53 void GetParameterValue(char*** pstringarray,int* pM){_error_("DoubleMatArray param of enum %i (%s) cannot return a string array",enum_type,EnumToStringx(enum_type));} 54 void GetParameterValue( double** pdoublearray,int* pM){_error_("DoubleMatArray param of enum %i (%s) cannot return a double array",enum_type,EnumToStringx(enum_type));}55 void GetParameterValue( double** pdoublearray,int* pM, int* pN){_error_("DoubleMatArray param of enum %i (%s) cannot return a double array",enum_type,EnumToStringx(enum_type));}56 void GetParameterValue( double*** parray, int* pM,int** pmdims, int** pndims);54 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error_("DoubleMatArray param of enum %i (%s) cannot return a IssmDouble array",enum_type,EnumToStringx(enum_type));} 55 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error_("DoubleMatArray param of enum %i (%s) cannot return a IssmDouble array",enum_type,EnumToStringx(enum_type));} 56 void GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims); 57 57 void GetParameterValue(Vector** pvec){_error_("DoubleMatArray param of enum %i (%s) cannot return a Vec",enum_type,EnumToStringx(enum_type));} 58 58 void GetParameterValue(Matrix** pmat){_error_("DoubleMatArray param of enum %i (%s) cannot return a Mat",enum_type,EnumToStringx(enum_type));} … … 61 61 void SetValue(bool boolean){_error_("DoubleMatArray param of enum %i (%s) cannot hold a boolean",enum_type,EnumToStringx(enum_type));} 62 62 void SetValue(int integer){_error_("DoubleMatArray param of enum %i (%s) cannot hold an integer",enum_type,EnumToStringx(enum_type));} 63 void SetValue( double scalar){_error_("DoubleMatArray param of enum %i (%s) cannot hold a scalar",enum_type,EnumToStringx(enum_type));}63 void SetValue(IssmDouble scalar){_error_("DoubleMatArray param of enum %i (%s) cannot hold a scalar",enum_type,EnumToStringx(enum_type));} 64 64 void SetValue(char* string){_error_("DoubleMatArray param of enum %i (%s) cannot hold a string",enum_type,EnumToStringx(enum_type));} 65 65 void SetValue(char** stringarray,int M){_error_("DoubleMatArray param of enum %i (%s) cannot hold a string array",enum_type,EnumToStringx(enum_type));} 66 void SetValue( double* doublearray,int M){_error_("DoubleMatArray param of enum %i (%s) cannot hold a double vec array",enum_type,EnumToStringx(enum_type));}67 void SetValue( double* doublearray,int M,int N){_error_("DoubleMatArray param of enum %i (%s) cannot hold a double mat array",enum_type,EnumToStringx(enum_type));}66 void SetValue(IssmDouble* IssmDoublearray,int M){_error_("DoubleMatArray param of enum %i (%s) cannot hold a IssmDouble vec array",enum_type,EnumToStringx(enum_type));} 67 void SetValue(IssmDouble* IssmDoublearray,int M,int N){_error_("DoubleMatArray param of enum %i (%s) cannot hold a IssmDouble mat array",enum_type,EnumToStringx(enum_type));} 68 68 void SetValue(int* intarray,int M){_error_("DoubleMatArray param of enum %i (%s) cannot hold a int vec array",enum_type,EnumToStringx(enum_type));} 69 69 void SetValue(int* intarray,int M,int N){_error_("DoubleMatArray param of enum %i (%s) cannot hold a int mat array",enum_type,EnumToStringx(enum_type));} … … 71 71 void SetValue(Matrix* mat){_error_("DoubleMatArray param of enum %i (%s) cannot hold a Mat",enum_type,EnumToStringx(enum_type));} 72 72 void SetValue(FILE* fid){_error_("Bool param of enum %i (%s) cannot hold a FILE",enum_type,EnumToStringx(enum_type));} 73 void SetValue( double** array, int M, int* mdim_array, int* ndim_array);73 void SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array); 74 74 void UnitConversion(int direction_enum); 75 75 -
issm/trunk-jpl/src/c/objects/Params/DoubleMatParam.cpp
r12452 r12474 27 27 /*}}}*/ 28 28 /*FUNCTION DoubleMatParam::DoubleMatParam(int enum_type,IssmDoubleMat value){{{*/ 29 DoubleMatParam::DoubleMatParam(int in_enum_type, double* in_value, int in_M,int in_N){29 DoubleMatParam::DoubleMatParam(int in_enum_type,IssmDouble* in_value, int in_M,int in_N){ 30 30 31 31 enum_type=in_enum_type; … … 33 33 N=in_N; 34 34 35 value=xNew< double>(M*N);36 memcpy(value,in_value,M*N*sizeof(double));35 value=xNew<IssmDouble>(M*N); 36 xMemCpy<IssmDouble>(value,in_value,M*N); 37 37 } 38 38 /*}}}*/ 39 39 /*FUNCTION DoubleMatParam::~DoubleMatParam(){{{*/ 40 40 DoubleMatParam::~DoubleMatParam(){ 41 xDelete< double>(value);41 xDelete<IssmDouble>(value); 42 42 return; 43 43 } … … 94 94 95 95 /*DoubleMatParam virtual functions definitions: */ 96 /*FUNCTION DoubleMatParam::GetParameterValue( double** pdoublearray,int* pM,int* pN){{{*/97 void DoubleMatParam::GetParameterValue( double** pdoublearray,int* pM,int* pN){98 double* output=NULL;96 /*FUNCTION DoubleMatParam::GetParameterValue(IssmDouble** pIssmDoublearray,int* pM,int* pN){{{*/ 97 void DoubleMatParam::GetParameterValue(IssmDouble** pIssmDoublearray,int* pM,int* pN){ 98 IssmDouble* output=NULL; 99 99 100 output=xNew< double>(M*N);101 memcpy(output,value,M*N*sizeof(double));100 output=xNew<IssmDouble>(M*N); 101 xMemCpy<IssmDouble>(output,value,M*N); 102 102 103 103 /*Assign output pointers:*/ 104 104 if(pM) *pM=M; 105 105 if(pN) *pN=N; 106 *p doublearray=output;106 *pIssmDoublearray=output; 107 107 } 108 108 /*}}}*/ … … 118 118 /*}}}*/ 119 119 /*FUNCTION DoubleMatParam::SetValue{{{*/ 120 void DoubleMatParam::SetValue( double* doublearray,int in_M,int in_N){120 void DoubleMatParam::SetValue(IssmDouble* IssmDoublearray,int in_M,int in_N){ 121 121 122 122 /*avoid leak: */ 123 xDelete< double>(this->value);123 xDelete<IssmDouble>(this->value); 124 124 125 this->value=xNew< double>(in_M*in_N);126 memcpy(this->value,doublearray,in_M*in_N*sizeof(double));125 this->value=xNew<IssmDouble>(in_M*in_N); 126 xMemCpy<IssmDouble>(this->value,IssmDoublearray,in_M*in_N); 127 127 128 128 this->M=in_M; … … 138 138 /*diverse: */ 139 139 /*FUNCTION DoubleMatParam::GetPointer{{{*/ 140 double* DoubleMatParam::GetPointer(void){140 IssmDouble* DoubleMatParam::GetPointer(void){ 141 141 return this->value; 142 142 } -
issm/trunk-jpl/src/c/objects/Params/DoubleMatParam.h
r12365 r12474 24 24 protected: 25 25 int enum_type; 26 double* value;26 IssmDouble* value; 27 27 int M; 28 28 int N; … … 48 48 void GetParameterValue(int** pintarray,int* pM){_error_("DoubleMat param of enum %i (%s) cannot return an array of integers",enum_type,EnumToStringx(enum_type));} 49 49 void GetParameterValue(int** pintarray,int* pM,int* pN); 50 void GetParameterValue( double* pdouble){_error_("DoubleMat param of enum %i (%s) cannot return a double",enum_type,EnumToStringx(enum_type));}50 void GetParameterValue(IssmDouble* pIssmDouble){_error_("DoubleMat param of enum %i (%s) cannot return a IssmDouble",enum_type,EnumToStringx(enum_type));} 51 51 void GetParameterValue(char** pstring){_error_("DoubleMat param of enum %i (%s) cannot return a string",enum_type,EnumToStringx(enum_type));} 52 52 void GetParameterValue(char*** pstringarray,int* pM){_error_("DoubleMat param of enum %i (%s) cannot return a string array",enum_type,EnumToStringx(enum_type));} 53 void GetParameterValue( double** pdoublearray,int* pM){_error_("DoubleMat param of enum %i (%s) cannot return a double array",enum_type,EnumToStringx(enum_type));}54 void GetParameterValue( double** pdoublearray,int* pM,int* pN);55 void GetParameterValue( double*** parray, int* pM,int** pmdims, int** pndims){_error_("DoubleMat param of enum %i (%s) cannot return a matrix array",enum_type,EnumToStringx(enum_type));}53 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error_("DoubleMat param of enum %i (%s) cannot return a IssmDouble array",enum_type,EnumToStringx(enum_type));} 54 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM,int* pN); 55 void GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("DoubleMat param of enum %i (%s) cannot return a matrix array",enum_type,EnumToStringx(enum_type));} 56 56 void GetParameterValue(Vector** pvec){_error_("DoubleMat param of enum %i (%s) cannot return a Vec",enum_type,EnumToStringx(enum_type));} 57 57 void GetParameterValue(Matrix** pmat){_error_("DoubleMat param of enum %i (%s) cannot return a Mat",enum_type,EnumToStringx(enum_type));} … … 60 60 void SetValue(bool boolean){_error_("DoubleMat param of enum %i (%s) cannot hold a boolean",enum_type,EnumToStringx(enum_type));} 61 61 void SetValue(int integer){_error_("DoubleMat param of enum %i (%s) cannot hold an integer",enum_type,EnumToStringx(enum_type));} 62 void SetValue( double scalar){_error_("DoubleMat param of enum %i (%s) cannot hold a scalar",enum_type,EnumToStringx(enum_type));}62 void SetValue(IssmDouble scalar){_error_("DoubleMat param of enum %i (%s) cannot hold a scalar",enum_type,EnumToStringx(enum_type));} 63 63 void SetValue(char* string){_error_("DoubleMat param of enum %i (%s) cannot hold a string",enum_type,EnumToStringx(enum_type));} 64 64 void SetValue(char** stringarray,int M){_error_("DoubleMat param of enum %i (%s) cannot hold a string array",enum_type,EnumToStringx(enum_type));} 65 void SetValue( double* doublearray,int M){_error_("DoubleMat param of enum %i (%s) cannot hold a double vec array",enum_type,EnumToStringx(enum_type));}66 void SetValue( double* doublearray,int M,int N);65 void SetValue(IssmDouble* IssmDoublearray,int M){_error_("DoubleMat param of enum %i (%s) cannot hold a IssmDouble vec array",enum_type,EnumToStringx(enum_type));} 66 void SetValue(IssmDouble* IssmDoublearray,int M,int N); 67 67 void SetValue(int* intarray,int M){_error_("DoubleMat param of enum %i (%s) cannot hold a int vec array",enum_type,EnumToStringx(enum_type));} 68 68 void SetValue(int* intarray,int M,int N){_error_("DoubleMat param of enum %i (%s) cannot hold a int mat array",enum_type,EnumToStringx(enum_type));}; … … 70 70 void SetValue(Matrix* mat){_error_("DoubleMat param of enum %i (%s) cannot hold a Mat",enum_type,EnumToStringx(enum_type));} 71 71 void SetValue(FILE* fid){_error_("DoubleMat param of enum %i (%s) cannot hold a FILE",enum_type,EnumToStringx(enum_type));} 72 void SetValue( double** array, int M, int* mdim_array, int* ndim_array){_error_("DoubleMat param of enum %i (%s) cannot hold an array of matrices",enum_type,EnumToStringx(enum_type));}72 void SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("DoubleMat param of enum %i (%s) cannot hold an array of matrices",enum_type,EnumToStringx(enum_type));} 73 73 void UnitConversion(int direction_enum); 74 double* GetPointer(void);74 IssmDouble* GetPointer(void); 75 75 76 76 void GetParameterName(char**pname); -
issm/trunk-jpl/src/c/objects/Params/DoubleParam.cpp
r12365 r12474 100 100 } 101 101 /*}}}*/ 102 /*FUNCTION DoubleParam::GetParameterValue( double** pdoublearray,int* pM){{{*/103 void DoubleParam::GetParameterValue( double** pdoublearray,int* pM){104 _error_("Double param of enum %i (%s) cannot return an array of double",enum_type,EnumToStringx(enum_type));102 /*FUNCTION DoubleParam::GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){{{*/ 103 void DoubleParam::GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){ 104 _error_("Double param of enum %i (%s) cannot return an array of IssmDouble",enum_type,EnumToStringx(enum_type)); 105 105 } 106 106 /*}}}*/ 107 /*FUNCTION DoubleParam::GetParameterValue( double** pdoublearray,int* pM,int* pN){{{*/108 void DoubleParam::GetParameterValue( double** pdoublearray,int* pM,int* pN){109 _error_("Double param of enum %i (%s) cannot return an array of double",enum_type,EnumToStringx(enum_type));107 /*FUNCTION DoubleParam::GetParameterValue(IssmDouble** pIssmDoublearray,int* pM,int* pN){{{*/ 108 void DoubleParam::GetParameterValue(IssmDouble** pIssmDoublearray,int* pM,int* pN){ 109 _error_("Double param of enum %i (%s) cannot return an array of IssmDouble",enum_type,EnumToStringx(enum_type)); 110 110 } 111 111 /*}}}*/ -
issm/trunk-jpl/src/c/objects/Params/DoubleParam.h
r12365 r12474 47 47 void GetParameterValue(int** pintarray,int* pM); 48 48 void GetParameterValue(int** pintarray,int* pM,int* pN); 49 void GetParameterValue( double* pdouble){*pdouble=value;}49 void GetParameterValue(IssmDouble* pIssmDouble){*pIssmDouble=value;} 50 50 void GetParameterValue(char** pstring){_error_("Double param of enum %i (%s) cannot return a string",enum_type,EnumToStringx(enum_type));} 51 51 void GetParameterValue(char*** pstringarray,int* pM){_error_("Double param of enum %i (%s) cannot return a string array",enum_type,EnumToStringx(enum_type));} 52 void GetParameterValue( double** pdoublearray,int* pM);53 void GetParameterValue( double** pdoublearray,int* pM, int* pN);54 void GetParameterValue( double*** parray, int* pM,int** pmdims, int** pndims){_error_("Double param of enum %i (%s) cannot return a matrix array",enum_type,EnumToStringx(enum_type));}52 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM); 53 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN); 54 void GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("Double param of enum %i (%s) cannot return a matrix array",enum_type,EnumToStringx(enum_type));} 55 55 void GetParameterValue(Vector** pvec){_error_("Double param of enum %i (%s) cannot return a Vec",enum_type,EnumToStringx(enum_type));} 56 56 void GetParameterValue(Matrix** pmat){_error_("Double param of enum %i (%s) cannot return a Mat",enum_type,EnumToStringx(enum_type));} 57 57 void GetParameterValue(FILE** pfid){_error_("Double param of enum %i (%s) cannot return a FILE",enum_type,EnumToStringx(enum_type));} 58 58 59 void SetValue(bool boolean){this->value=( double)boolean;}60 void SetValue(int integer){this->value=( double)integer;}61 void SetValue( double scalar){this->value=(double)scalar;}59 void SetValue(bool boolean){this->value=(IssmDouble)boolean;} 60 void SetValue(int integer){this->value=(IssmDouble)integer;} 61 void SetValue(IssmDouble scalar){this->value=(IssmDouble)scalar;} 62 62 void SetValue(char* string){_error_("Double param of enum %i (%s) cannot hold a string",enum_type,EnumToStringx(enum_type));} 63 63 void SetValue(char** stringarray,int M){_error_("Double param of enum %i (%s) cannot hold a string array",enum_type,EnumToStringx(enum_type));} 64 void SetValue( double* doublearray,int M){_error_("Double param of enum %i (%s) cannot hold a double array",enum_type,EnumToStringx(enum_type));}65 void SetValue( double* pdoublearray,int M,int N){_error_("Double param of enum %i (%s) cannot hold a double array",enum_type,EnumToStringx(enum_type));}64 void SetValue(IssmDouble* IssmDoublearray,int M){_error_("Double param of enum %i (%s) cannot hold a IssmDouble array",enum_type,EnumToStringx(enum_type));} 65 void SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error_("Double param of enum %i (%s) cannot hold a IssmDouble array",enum_type,EnumToStringx(enum_type));} 66 66 void SetValue(int* intarray,int M){_error_("Double param of enum %i (%s) cannot hold a int array",enum_type,EnumToStringx(enum_type));} 67 67 void SetValue(int* pintarray,int M,int N){_error_("Double param of enum %i (%s) cannot hold a int array",enum_type,EnumToStringx(enum_type));} … … 69 69 void SetValue(Matrix* mat){_error_("Double param of enum %i (%s) cannot hold a Mat",enum_type,EnumToStringx(enum_type));} 70 70 void SetValue(FILE* fid){_error_("Double param of enum %i (%s) cannot hold a FILE",enum_type,EnumToStringx(enum_type));} 71 void SetValue( double** array, int M, int* mdim_array, int* ndim_array){_error_("Double param of enum %i (%s) cannot hold an array of matrices",enum_type,EnumToStringx(enum_type));}71 void SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Double param of enum %i (%s) cannot hold an array of matrices",enum_type,EnumToStringx(enum_type));} 72 72 void UnitConversion(int direction_enum); 73 73 -
issm/trunk-jpl/src/c/objects/Params/DoubleTransientMatParam.cpp
r12365 r12474 21 21 22 22 /*FUNCTION DoubleTransientMatParam::DoubleTransientMatParam(int enum_type,IssmDoubleMat value){{{*/ 23 DoubleTransientMatParam::DoubleTransientMatParam(int in_enum_type, double* in_value, int in_M,int in_N):DoubleMatParam(in_enum_type,in_value,in_M,in_N){23 DoubleTransientMatParam::DoubleTransientMatParam(int in_enum_type,IssmDouble* in_value, int in_M,int in_N):DoubleMatParam(in_enum_type,in_value,in_M,in_N){ 24 24 } 25 25 /*}}}*/ -
issm/trunk-jpl/src/c/objects/Params/DoubleVecParam.cpp
r12452 r12474 27 27 /*}}}*/ 28 28 /*FUNCTION DoubleVecParam::DoubleVecParam(int enum_type,IssmDoubleVec values,int M){{{*/ 29 DoubleVecParam::DoubleVecParam(int in_enum_type, double* in_values, int in_M){29 DoubleVecParam::DoubleVecParam(int in_enum_type,IssmDouble* in_values, int in_M){ 30 30 31 31 enum_type=in_enum_type; 32 32 M=in_M; 33 33 34 values=xNew< double>(M);35 memcpy(values,in_values,M*sizeof(double));34 values=xNew<IssmDouble>(M); 35 xMemCpy<IssmDouble>(values,in_values,M); 36 36 } 37 37 /*}}}*/ 38 38 /*FUNCTION DoubleVecParam::~DoubleVecParam(){{{*/ 39 39 DoubleVecParam::~DoubleVecParam(){ 40 xDelete< double>(values);40 xDelete<IssmDouble>(values); 41 41 return; 42 42 } … … 91 91 92 92 /*DoubleVecParam virtual functions definitions: */ 93 /*FUNCTION DoubleVecParam::GetParameterValue( double** pdoublearray,int* pM){{{*/94 void DoubleVecParam::GetParameterValue( double** pdoublearray,int* pM){95 double* output=NULL;93 /*FUNCTION DoubleVecParam::GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){{{*/ 94 void DoubleVecParam::GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){ 95 IssmDouble* output=NULL; 96 96 int M; 97 97 98 98 M=this->M; 99 output=xNew< double>(M);100 memcpy(output,values,M*sizeof(double));99 output=xNew<IssmDouble>(M); 100 xMemCpy<IssmDouble>(output,values,M); 101 101 102 102 /*Assign output pointers:*/ 103 103 if(pM) *pM=M; 104 *p doublearray=output;104 *pIssmDoublearray=output; 105 105 } 106 106 /*}}}*/ 107 /*FUNCTION DoubleVecParam::GetParameterValue( double** pdoublearray,int* pM){{{*/108 void DoubleVecParam::GetParameterValue( double** pdoublearray,int* pM,int* pN){109 double* output=NULL;107 /*FUNCTION DoubleVecParam::GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){{{*/ 108 void DoubleVecParam::GetParameterValue(IssmDouble** pIssmDoublearray,int* pM,int* pN){ 109 IssmDouble* output=NULL; 110 110 int M; 111 111 int N; … … 113 113 N=1; 114 114 M=this->M; 115 output=xNew< double>(M);116 memcpy(output,values,M*sizeof(double));115 output=xNew<IssmDouble>(M); 116 xMemCpy<IssmDouble>(output,values,M); 117 117 118 118 /*Assign output pointers:*/ 119 119 if(pM) *pM=M; 120 120 if(pN) *pN=N; 121 *p doublearray=output;121 *pIssmDoublearray=output; 122 122 } 123 123 /*}}}*/ … … 133 133 /*}}}*/ 134 134 /*FUNCTION DoubleVecParam::SetValue{{{*/ 135 void DoubleVecParam::SetValue( double* doublearray,int in_M){135 void DoubleVecParam::SetValue(IssmDouble* IssmDoublearray,int in_M){ 136 136 137 137 /*avoid leak: */ 138 xDelete< double>(this->values);138 xDelete<IssmDouble>(this->values); 139 139 140 this->values=xNew< double>(in_M);141 memcpy(this->values,doublearray,in_M*sizeof(double));140 this->values=xNew<IssmDouble>(in_M); 141 xMemCpy<IssmDouble>(this->values,IssmDoublearray,in_M); 142 142 143 143 this->M=in_M; -
issm/trunk-jpl/src/c/objects/Params/DoubleVecParam.h
r12365 r12474 47 47 void GetParameterValue(int** pintarray,int* pM); 48 48 void GetParameterValue(int** pintarray,int* pM,int* pN){_error_("DoubleVec param of enum %i (%s) cannot return an array of integers",enum_type,EnumToStringx(enum_type));}; 49 void GetParameterValue( double* pdouble){_error_("DoubleVec param of enum %i (%s) cannot return a double",enum_type,EnumToStringx(enum_type));}49 void GetParameterValue(IssmDouble* pIssmDouble){_error_("DoubleVec param of enum %i (%s) cannot return a IssmDouble",enum_type,EnumToStringx(enum_type));} 50 50 void GetParameterValue(char** pstring){_error_("DoubleVec param of enum %i (%s) cannot return a string",enum_type,EnumToStringx(enum_type));} 51 51 void GetParameterValue(char*** pstringarray,int* pM){_error_("DoubleVec param of enum %i (%s) cannot return a string array",enum_type,EnumToStringx(enum_type));} 52 void GetParameterValue( double** pdoublearray,int* pM);53 void GetParameterValue( double** pdoublearray,int* pM, int* pN);54 void GetParameterValue( double*** parray, int* pM,int** pmdims, int** pndims){_error_("DoubleVec param of enum %i (%s) cannot return a matrix array",enum_type,EnumToStringx(enum_type));}52 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM); 53 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN); 54 void GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("DoubleVec param of enum %i (%s) cannot return a matrix array",enum_type,EnumToStringx(enum_type));} 55 55 void GetParameterValue(Vector** pvec){_error_("DoubleVec param of enum %i (%s) cannot return a Vec",enum_type,EnumToStringx(enum_type));} 56 56 void GetParameterValue(Matrix** pmat){_error_("DoubleVec param of enum %i (%s) cannot return a Mat",enum_type,EnumToStringx(enum_type));} … … 59 59 void SetValue(bool boolean){_error_("DoubleVec param of enum %i (%s) cannot hold a boolean",enum_type,EnumToStringx(enum_type));} 60 60 void SetValue(int integer){_error_("DoubleVec param of enum %i (%s) cannot hold an integer",enum_type,EnumToStringx(enum_type));} 61 void SetValue( double scalar){_error_("DoubleVec param of enum %i (%s) cannot hold a scalar",enum_type,EnumToStringx(enum_type));}61 void SetValue(IssmDouble scalar){_error_("DoubleVec param of enum %i (%s) cannot hold a scalar",enum_type,EnumToStringx(enum_type));} 62 62 void SetValue(char* string){_error_("DoubleVec param of enum %i (%s) cannot hold a string",enum_type,EnumToStringx(enum_type));} 63 63 void SetValue(char** stringarray,int M){_error_("DoubleVec param of enum %i (%s) cannot hold a string array",enum_type,EnumToStringx(enum_type));} 64 void SetValue( double* doublearray,int M);65 void SetValue( double* pdoublearray,int M,int N){_error_("DoubleVec param of enum %i (%s) cannot hold a double mat array",enum_type,EnumToStringx(enum_type));}64 void SetValue(IssmDouble* IssmDoublearray,int M); 65 void SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error_("DoubleVec param of enum %i (%s) cannot hold a IssmDouble mat array",enum_type,EnumToStringx(enum_type));} 66 66 void SetValue(int* intarray,int M){_error_("DoubleVec param of enum %i (%s) cannot hold a int mat array",enum_type,EnumToStringx(enum_type));}; 67 67 void SetValue(int* pintarray,int M,int N){_error_("DoubleVec param of enum %i (%s) cannot hold a int mat array",enum_type,EnumToStringx(enum_type));} … … 69 69 void SetValue(Matrix* mat){_error_("DoubleVec param of enum %i (%s) cannot hold a Mat",enum_type,EnumToStringx(enum_type));} 70 70 void SetValue(FILE* fid){_error_("DoubleVec param of enum %i (%s) cannot hold a FILE",enum_type,EnumToStringx(enum_type));} 71 void SetValue( double** array, int M, int* mdim_array, int* ndim_array){_error_("DoubleVec param of enum %i (%s) cannot hold an array of matrices",enum_type,EnumToStringx(enum_type));}71 void SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("DoubleVec param of enum %i (%s) cannot hold an array of matrices",enum_type,EnumToStringx(enum_type));} 72 72 void UnitConversion(int direction_enum); 73 73 -
issm/trunk-jpl/src/c/objects/Params/FileParam.h
r12365 r12474 43 43 int InstanceEnum(){return enum_type;} 44 44 void GetParameterValue(bool* pbool){ _error_("FileParam of enum %i (%s) cannot return a bool",enum_type,EnumToStringx(enum_type));} 45 void GetParameterValue(int* pinteger){_error_("FileParam of enum %i (%s) cannot return a double",enum_type,EnumToStringx(enum_type));}46 void GetParameterValue(int** pintarray,int* pM){_error_("FileParam of enum %i (%s) cannot return a double",enum_type,EnumToStringx(enum_type));}47 void GetParameterValue(int** pintarray,int* pM,int* pN){_error_("FileParam of enum %i (%s) cannot return a double",enum_type,EnumToStringx(enum_type));}48 void GetParameterValue( double* pdouble){_error_("FileParam of enum %i (%s) cannot return a double",enum_type,EnumToStringx(enum_type));}45 void GetParameterValue(int* pinteger){_error_("FileParam of enum %i (%s) cannot return a IssmDouble",enum_type,EnumToStringx(enum_type));} 46 void GetParameterValue(int** pintarray,int* pM){_error_("FileParam of enum %i (%s) cannot return a IssmDouble",enum_type,EnumToStringx(enum_type));} 47 void GetParameterValue(int** pintarray,int* pM,int* pN){_error_("FileParam of enum %i (%s) cannot return a IssmDouble",enum_type,EnumToStringx(enum_type));} 48 void GetParameterValue(IssmDouble* pIssmDouble){_error_("FileParam of enum %i (%s) cannot return a IssmDouble",enum_type,EnumToStringx(enum_type));} 49 49 void GetParameterValue(char** pstring){_error_("FileParam of enum %i (%s) cannot return a string",enum_type,EnumToStringx(enum_type));} 50 50 void GetParameterValue(char*** pstringarray,int* pM){_error_("FileParam of enum %i (%s) cannot return a string array",enum_type,EnumToStringx(enum_type));} 51 void GetParameterValue( double** pdoublearray,int* pM){_error_("FileParam of enum %i (%s) cannot return a double array",enum_type,EnumToStringx(enum_type));}52 void GetParameterValue( double** pdoublearray,int* pM, int* pN){_error_("FileParam of enum %i (%s) cannot return a double array",enum_type,EnumToStringx(enum_type));}53 void GetParameterValue( double*** parray, int* pM,int** pmdims, int** pndims){_error_("File param of enum %i (%s) cannot return a matrix array",enum_type,EnumToStringx(enum_type));}51 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error_("FileParam of enum %i (%s) cannot return a IssmDouble array",enum_type,EnumToStringx(enum_type));} 52 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error_("FileParam of enum %i (%s) cannot return a IssmDouble array",enum_type,EnumToStringx(enum_type));} 53 void GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("File param of enum %i (%s) cannot return a matrix array",enum_type,EnumToStringx(enum_type));} 54 54 void GetParameterValue(Vector** pvec){_error_("FileParam of enum %i (%s) cannot return a Vec",enum_type,EnumToStringx(enum_type));} 55 55 void GetParameterValue(Matrix** pmat){_error_("FileParam of enum %i (%s) cannot return a Mat",enum_type,EnumToStringx(enum_type));} … … 58 58 void SetValue(bool boolean){_error_("FileParam of enum %i (%s) cannot hold a string",enum_type,EnumToStringx(enum_type));} 59 59 void SetValue(int integer){_error_("FileParam of enum %i (%s) cannot hold a string",enum_type,EnumToStringx(enum_type));} 60 void SetValue( double scalar){_error_("FileParam of enum %i (%s) cannot hold a string",enum_type,EnumToStringx(enum_type));}60 void SetValue(IssmDouble scalar){_error_("FileParam of enum %i (%s) cannot hold a string",enum_type,EnumToStringx(enum_type));} 61 61 void SetValue(char* string){_error_("FileParam of enum %i (%s) cannot hold a string",enum_type,EnumToStringx(enum_type));} 62 62 void SetValue(char** stringarray,int M){_error_("FileParam of enum %i (%s) cannot hold a string array",enum_type,EnumToStringx(enum_type));} 63 void SetValue( double* doublearray,int M){_error_("FileParam of enum %i (%s) cannot hold a double array",enum_type,EnumToStringx(enum_type));}64 void SetValue( double* pdoublearray,int M,int N){_error_("FileParam of enum %i (%s) cannot hold a double array",enum_type,EnumToStringx(enum_type));}63 void SetValue(IssmDouble* IssmDoublearray,int M){_error_("FileParam of enum %i (%s) cannot hold a IssmDouble array",enum_type,EnumToStringx(enum_type));} 64 void SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error_("FileParam of enum %i (%s) cannot hold a IssmDouble array",enum_type,EnumToStringx(enum_type));} 65 65 void SetValue(int* intarray,int M){_error_("FileParam of enum %i (%s) cannot hold a int array",enum_type,EnumToStringx(enum_type));} 66 66 void SetValue(int* pintarray,int M,int N){_error_("FileParam of enum %i (%s) cannot hold a int array",enum_type,EnumToStringx(enum_type));} … … 68 68 void SetValue(Matrix* mat){_error_("FileParam of enum %i (%s) cannot hold a Mat",enum_type,EnumToStringx(enum_type));} 69 69 void SetValue(FILE* fid){_error_("File param of enum %i (%s) cannot hold a FILE",enum_type,EnumToStringx(enum_type));} 70 void SetValue( double** array, int M, int* mdim_array, int* ndim_array){_error_("File param of enum %i (%s) cannot hold an array of matrices",enum_type,EnumToStringx(enum_type));}70 void SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("File param of enum %i (%s) cannot hold an array of matrices",enum_type,EnumToStringx(enum_type));} 71 71 void UnitConversion(int direction_enum); 72 72 -
issm/trunk-jpl/src/c/objects/Params/IntMatParam.cpp
r12451 r12474 34 34 35 35 value=xNew<int>(M*N); 36 memcpy(value,in_value,M*N*sizeof(int));36 xMemCpy<int>(value,in_value,M*N); 37 37 } 38 38 /*}}}*/ … … 99 99 100 100 output=xNew<int>(M*N); 101 memcpy(output,value,M*N*sizeof(int));101 xMemCpy<int>(output,value,M*N); 102 102 103 103 /*Assign output pointers:*/ … … 119 119 120 120 this->value=xNew<int>(in_M*in_N); 121 memcpy(this->value,intarray,in_M*in_N*sizeof(int));121 xMemCpy<int>(this->value,intarray,in_M*in_N); 122 122 123 123 this->M=in_M; -
issm/trunk-jpl/src/c/objects/Params/IntMatParam.h
r12365 r12474 48 48 void GetParameterValue(int** pintarray,int* pM){_error_("IntMat param of enum %i (%s) cannot return an array of integers",enum_type,EnumToStringx(enum_type));} 49 49 void GetParameterValue(int** pintarray,int* pM,int* pN); 50 void GetParameterValue( double* pdouble){_error_("IntMat param of enum %i (%s) cannot return a double",enum_type,EnumToStringx(enum_type));}50 void GetParameterValue(IssmDouble* pIssmDouble){_error_("IntMat param of enum %i (%s) cannot return a IssmDouble",enum_type,EnumToStringx(enum_type));} 51 51 void GetParameterValue(char** pstring){_error_("IntMat param of enum %i (%s) cannot return a string",enum_type,EnumToStringx(enum_type));} 52 52 void GetParameterValue(char*** pstringarray,int* pM){_error_("IntMat param of enum %i (%s) cannot return a string array",enum_type,EnumToStringx(enum_type));} 53 void GetParameterValue( double** pdoublearray,int* pM){_error_("IntMat param of enum %i (%s) cannot return a double array",enum_type,EnumToStringx(enum_type));}54 void GetParameterValue( double** pdoublearray,int* pM,int* pN){_error_("IntMat param of enum %i (%s) cannot return a matrix array",enum_type,EnumToStringx(enum_type));};55 void GetParameterValue( double*** parray, int* pM,int** pmdims, int** pndims){_error_("IntMat param of enum %i (%s) cannot return a matrix array",enum_type,EnumToStringx(enum_type));}53 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error_("IntMat param of enum %i (%s) cannot return a IssmDouble array",enum_type,EnumToStringx(enum_type));} 54 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM,int* pN){_error_("IntMat param of enum %i (%s) cannot return a matrix array",enum_type,EnumToStringx(enum_type));}; 55 void GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("IntMat param of enum %i (%s) cannot return a matrix array",enum_type,EnumToStringx(enum_type));} 56 56 void GetParameterValue(Vector** pvec){_error_("IntMat param of enum %i (%s) cannot return a Vec",enum_type,EnumToStringx(enum_type));} 57 57 void GetParameterValue(Matrix** pmat){_error_("IntMat param of enum %i (%s) cannot return a Mat",enum_type,EnumToStringx(enum_type));} … … 60 60 void SetValue(bool boolean){_error_("IntMat param of enum %i (%s) cannot hold a boolean",enum_type,EnumToStringx(enum_type));} 61 61 void SetValue(int integer){_error_("IntMat param of enum %i (%s) cannot hold an integer",enum_type,EnumToStringx(enum_type));} 62 void SetValue( double scalar){_error_("IntMat param of enum %i (%s) cannot hold a scalar",enum_type,EnumToStringx(enum_type));}62 void SetValue(IssmDouble scalar){_error_("IntMat param of enum %i (%s) cannot hold a scalar",enum_type,EnumToStringx(enum_type));} 63 63 void SetValue(char* string){_error_("IntMat param of enum %i (%s) cannot hold a string",enum_type,EnumToStringx(enum_type));} 64 64 void SetValue(char** stringarray,int M){_error_("IntMat param of enum %i (%s) cannot hold a string array",enum_type,EnumToStringx(enum_type));} 65 void SetValue( double* doublearray,int M){_error_("IntMat param of enum %i (%s) cannot hold a double vec array",enum_type,EnumToStringx(enum_type));}66 void SetValue( double* doublearray,int M,int N){_error_("IntMat param of enum %i (%s) cannot hold a double vec array",enum_type,EnumToStringx(enum_type));};65 void SetValue(IssmDouble* IssmDoublearray,int M){_error_("IntMat param of enum %i (%s) cannot hold a IssmDouble vec array",enum_type,EnumToStringx(enum_type));} 66 void SetValue(IssmDouble* IssmDoublearray,int M,int N){_error_("IntMat param of enum %i (%s) cannot hold a IssmDouble vec array",enum_type,EnumToStringx(enum_type));}; 67 67 void SetValue(int* intarray,int M){_error_("IntMat param of enum %i (%s) cannot hold a int vec array",enum_type,EnumToStringx(enum_type));}; 68 68 void SetValue(int* intarray,int M,int N); … … 70 70 void SetValue(Matrix* mat){_error_("IntMat param of enum %i (%s) cannot hold a Mat",enum_type,EnumToStringx(enum_type));} 71 71 void SetValue(FILE* fid){_error_("IntMat param of enum %i (%s) cannot hold a FILE",enum_type,EnumToStringx(enum_type));} 72 void SetValue( double** array, int M, int* mdim_array, int* ndim_array){_error_("IntMat param of enum %i (%s) cannot hold an array of matrices",enum_type,EnumToStringx(enum_type));}72 void SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("IntMat param of enum %i (%s) cannot hold an array of matrices",enum_type,EnumToStringx(enum_type));} 73 73 void UnitConversion(int direction_enum); 74 74 -
issm/trunk-jpl/src/c/objects/Params/IntParam.h
r12365 r12474 47 47 void GetParameterValue(int** pintarray,int* pM){_error_("Int param of enum %i (%s) cannot return an array of integers",enum_type,EnumToStringx(enum_type));} 48 48 void GetParameterValue(int** pintarray,int* pM,int* pN){_error_("Int param of enum %i (%s) cannot return an array of integers",enum_type,EnumToStringx(enum_type));} 49 void GetParameterValue( double* pdouble){_error_("Int param of enum %i (%s) cannot return a double",enum_type,EnumToStringx(enum_type));}49 void GetParameterValue(IssmDouble* pIssmDouble){_error_("Int param of enum %i (%s) cannot return a IssmDouble",enum_type,EnumToStringx(enum_type));} 50 50 void GetParameterValue(char** pstring){_error_("Int param of enum %i (%s) cannot return a string",enum_type,EnumToStringx(enum_type));} 51 51 void GetParameterValue(char*** pstringarray,int* pM){_error_("Int param of enum %i (%s) cannot return a string array",enum_type,EnumToStringx(enum_type));} 52 void GetParameterValue( double** pdoublearray,int* pM){_error_("Int param of enum %i (%s) cannot return a double array",enum_type,EnumToStringx(enum_type));}53 void GetParameterValue( double** pdoublearray,int* pM, int* pN){_error_("Int param of enum %i (%s) cannot return a double array",enum_type,EnumToStringx(enum_type));}54 void GetParameterValue( double*** parray, int* pM,int** pmdims, int** pndims){_error_("Int param of enum %i (%s) cannot return a matrix array",enum_type,EnumToStringx(enum_type));}52 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error_("Int param of enum %i (%s) cannot return a IssmDouble array",enum_type,EnumToStringx(enum_type));} 53 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error_("Int param of enum %i (%s) cannot return a IssmDouble array",enum_type,EnumToStringx(enum_type));} 54 void GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("Int param of enum %i (%s) cannot return a matrix array",enum_type,EnumToStringx(enum_type));} 55 55 void GetParameterValue(Vector** pvec){_error_("Int param of enum %i (%s) cannot return a Vec",enum_type,EnumToStringx(enum_type));} 56 56 void GetParameterValue(Matrix** pmat){_error_("Int param of enum %i (%s) cannot return a Mat",enum_type,EnumToStringx(enum_type));} … … 61 61 void SetValue(int* intarray,int M){_error_("Int param of enum %i (%s) cannot hold an int array",enum_type,EnumToStringx(enum_type));} 62 62 void SetValue(int* intarray,int M,int N){_error_("Int param of enum %i (%s) cannot hold an int array",enum_type,EnumToStringx(enum_type));} 63 void SetValue( double scalar){this->value=(int)scalar;}63 void SetValue(IssmDouble scalar){this->value=(int)scalar;} 64 64 void SetValue(char* string){_error_("Int param of enum %i (%s) cannot hold a string",enum_type,EnumToStringx(enum_type));} 65 65 void SetValue(char** stringarray,int M){_error_("Int param of enum %i (%s) cannot hold a string array",enum_type,EnumToStringx(enum_type));} 66 void SetValue( double* doublearray,int M){_error_("Int param of enum %i (%s) cannot hold a double array",enum_type,EnumToStringx(enum_type));}67 void SetValue( double* pdoublearray,int M,int N){_error_("Int param of enum %i (%s) cannot hold a double array",enum_type,EnumToStringx(enum_type));}66 void SetValue(IssmDouble* IssmDoublearray,int M){_error_("Int param of enum %i (%s) cannot hold a IssmDouble array",enum_type,EnumToStringx(enum_type));} 67 void SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error_("Int param of enum %i (%s) cannot hold a IssmDouble array",enum_type,EnumToStringx(enum_type));} 68 68 void SetValue(Vector* vec){_error_("Int param of enum %i (%s) cannot hold a Vec",enum_type,EnumToStringx(enum_type));} 69 69 void SetValue(Matrix* mat){_error_("Int param of enum %i (%s) cannot hold a Mat",enum_type,EnumToStringx(enum_type));} 70 70 void SetValue(FILE* fid){_error_("Int param of enum %i (%s) cannot hold a FILE",enum_type,EnumToStringx(enum_type));} 71 void SetValue( double** array, int M, int* mdim_array, int* ndim_array){_error_("Int param of enum %i (%s) cannot hold an array of matrices",enum_type,EnumToStringx(enum_type));}71 void SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Int param of enum %i (%s) cannot hold an array of matrices",enum_type,EnumToStringx(enum_type));} 72 72 void UnitConversion(int direction_enum); 73 73 -
issm/trunk-jpl/src/c/objects/Params/IntVecParam.cpp
r12451 r12474 34 34 if(M){ 35 35 values=xNew<int>(M); 36 memcpy(values,in_values,M*sizeof(int));36 xMemCpy<int>(values,in_values,M); 37 37 } 38 38 else values=NULL; 39 39 } 40 40 /*}}}*/ 41 /*FUNCTION IntVecParam::IntVecParam(int enum_type, double* values,int M){{{*/42 IntVecParam::IntVecParam(int in_enum_type, double* in_values, int in_M){41 /*FUNCTION IntVecParam::IntVecParam(int enum_type,IssmDouble* values,int M){{{*/ 42 IntVecParam::IntVecParam(int in_enum_type,IssmDouble* in_values, int in_M){ 43 43 44 44 enum_type=in_enum_type; … … 113 113 if(M){ 114 114 output=xNew<int>(M); 115 memcpy(output,values,M*sizeof(int));115 xMemCpy<int>(output,values,M); 116 116 } 117 117 … … 134 134 if(in_M){ 135 135 this->values=xNew<int>(in_M); 136 memcpy(this->values,intarray,in_M*sizeof(int));136 xMemCpy<int>(this->values,intarray,in_M); 137 137 } 138 138 else this->values=NULL; -
issm/trunk-jpl/src/c/objects/Params/IntVecParam.h
r12365 r12474 31 31 IntVecParam(); 32 32 IntVecParam(int enum_type,int* values,int M); 33 IntVecParam(int enum_type, double* values,int M);33 IntVecParam(int enum_type,IssmDouble* values,int M); 34 34 ~IntVecParam(); 35 35 /*}}}*/ … … 48 48 void GetParameterValue(int** pintarray,int* pM); 49 49 void GetParameterValue(int** pintarray,int* pM,int* pN){_error_("IntVec param of enum %i (%s) cannot return a matrix",enum_type,EnumToStringx(enum_type));} 50 void GetParameterValue( double* pdouble){_error_("IntVec param of enum %i (%s) cannot return a double",enum_type,EnumToStringx(enum_type));}50 void GetParameterValue(IssmDouble* pIssmDouble){_error_("IntVec param of enum %i (%s) cannot return a IssmDouble",enum_type,EnumToStringx(enum_type));} 51 51 void GetParameterValue(char** pstring){_error_("IntVec param of enum %i (%s) cannot return a string",enum_type,EnumToStringx(enum_type));} 52 52 void GetParameterValue(char*** pstringarray,int* pM){_error_("IntVec param of enum %i (%s) cannot return a string array",enum_type,EnumToStringx(enum_type));} 53 void GetParameterValue( double** pdoublearray,int* pM){_error_("IntVec param of enum %i (%s) cannot return a double array (maybe in serial?)",enum_type,EnumToStringx(enum_type));}54 void GetParameterValue( double** pdoublearray,int* pM, int* pN){_error_("IntVec param of enum %i (%s) cannot return a double array",enum_type,EnumToStringx(enum_type));}55 void GetParameterValue( double*** parray, int* pM,int** pmdims, int** pndims){_error_("IntVec param of enum %i (%s) cannot return a matrix array",enum_type,EnumToStringx(enum_type));}53 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error_("IntVec param of enum %i (%s) cannot return a IssmDouble array (maybe in serial?)",enum_type,EnumToStringx(enum_type));} 54 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error_("IntVec param of enum %i (%s) cannot return a IssmDouble array",enum_type,EnumToStringx(enum_type));} 55 void GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("IntVec param of enum %i (%s) cannot return a matrix array",enum_type,EnumToStringx(enum_type));} 56 56 void GetParameterValue(Vector** pvec){_error_("IntVec param of enum %i (%s) cannot return a Vec",enum_type,EnumToStringx(enum_type));} 57 57 void GetParameterValue(Matrix** pmat){_error_("IntVec param of enum %i (%s) cannot return a Mat",enum_type,EnumToStringx(enum_type));} … … 60 60 void SetValue(bool boolean){_error_("IntVec param of enum %i (%s) cannot hold a boolean",enum_type,EnumToStringx(enum_type));} 61 61 void SetValue(int integer){_error_("IntVec param of enum %i (%s) cannot hold an integer",enum_type,EnumToStringx(enum_type));} 62 void SetValue( double scalar){_error_("IntVec param of enum %i (%s) cannot hold a scalar",enum_type,EnumToStringx(enum_type));}62 void SetValue(IssmDouble scalar){_error_("IntVec param of enum %i (%s) cannot hold a scalar",enum_type,EnumToStringx(enum_type));} 63 63 void SetValue(char* string){_error_("IntVec param of enum %i (%s) cannot hold a string",enum_type,EnumToStringx(enum_type));} 64 64 void SetValue(char** stringarray,int M){_error_("IntVec param of enum %i (%s) cannot hold a string array",enum_type,EnumToStringx(enum_type));} 65 void SetValue( double* doublearray,int M){_error_("IntVec param of enum %i (%s) cannot hold a double mat array",enum_type,EnumToStringx(enum_type));}66 void SetValue( double* pdoublearray,int M,int N){_error_("IntVec param of enum %i (%s) cannot hold a double mat array",enum_type,EnumToStringx(enum_type));}65 void SetValue(IssmDouble* IssmDoublearray,int M){_error_("IntVec param of enum %i (%s) cannot hold a IssmDouble mat array",enum_type,EnumToStringx(enum_type));} 66 void SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error_("IntVec param of enum %i (%s) cannot hold a IssmDouble mat array",enum_type,EnumToStringx(enum_type));} 67 67 void SetValue(int* intarray,int M); 68 68 void SetValue(int* pintarray,int M,int N){_error_("IntVec param of enum %i (%s) cannot hold a int mat array",enum_type,EnumToStringx(enum_type));} … … 70 70 void SetValue(Matrix* mat){_error_("IntVec param of enum %i (%s) cannot hold a Mat",enum_type,EnumToStringx(enum_type));} 71 71 void SetValue(FILE* fid){_error_("IntVec param of enum %i (%s) cannot hold a FILE",enum_type,EnumToStringx(enum_type));} 72 void SetValue( double** array, int M, int* mdim_array, int* ndim_array){_error_("IntVec param of enum %i (%s) cannot hold an array of matrices",enum_type,EnumToStringx(enum_type));}72 void SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("IntVec param of enum %i (%s) cannot hold an array of matrices",enum_type,EnumToStringx(enum_type));} 73 73 void UnitConversion(int direction_enum); 74 74 -
issm/trunk-jpl/src/c/objects/Params/MatrixParam.h
r12365 r12474 47 47 void GetParameterValue(int** pintarray,int* pM){_error_("Matrix param of enum %i (%s) cannot return an array of integers",enum_type,EnumToStringx(enum_type));} 48 48 void GetParameterValue(int** pintarray,int* pM,int* pN){_error_("Matrix param of enum %i (%s) cannot return an array of integers",enum_type,EnumToStringx(enum_type));} 49 void GetParameterValue( double* pdouble){_error_("Matrix param of enum %i (%s) cannot return a double",enum_type,EnumToStringx(enum_type));}49 void GetParameterValue(IssmDouble* pIssmDouble){_error_("Matrix param of enum %i (%s) cannot return a IssmDouble",enum_type,EnumToStringx(enum_type));} 50 50 void GetParameterValue(char** pstring){_error_("Matrix param of enum %i (%s) cannot return a string",enum_type,EnumToStringx(enum_type));} 51 51 void GetParameterValue(char*** pstringarray,int* pM){_error_("Matrix param of enum %i (%s) cannot return a string array",enum_type,EnumToStringx(enum_type));} 52 void GetParameterValue( double** pdoublearray,int* pM){_error_("Matrix param of enum %i (%s) cannot return a double array",enum_type,EnumToStringx(enum_type));}53 void GetParameterValue( double** pdoublearray,int* pM, int* pN){_error_("Matrix param of enum %i (%s) cannot return a double array",enum_type,EnumToStringx(enum_type));}54 void GetParameterValue( double*** parray, int* pM,int** pmdims, int** pndims){_error_("Matrix param of enum %i (%s) cannot return a matrix array",enum_type,EnumToStringx(enum_type));}52 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error_("Matrix param of enum %i (%s) cannot return a IssmDouble array",enum_type,EnumToStringx(enum_type));} 53 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error_("Matrix param of enum %i (%s) cannot return a IssmDouble array",enum_type,EnumToStringx(enum_type));} 54 void GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("Matrix param of enum %i (%s) cannot return a matrix array",enum_type,EnumToStringx(enum_type));} 55 55 void GetParameterValue(Vector** pvec){_error_("Matrix param of enum %i (%s) cannot return a vec",enum_type,EnumToStringx(enum_type));} 56 56 void GetParameterValue(Matrix** poutput); … … 59 59 void SetValue(bool boolean){_error_("Matrix param of enum %i (%s) cannot hold a boolean",enum_type,EnumToStringx(enum_type));} 60 60 void SetValue(int integer){_error_("Matrix param of enum %i (%s) cannot hold an integer",enum_type,EnumToStringx(enum_type));} 61 void SetValue( double scalar){_error_("Matrix param of enum %i (%s) cannot hold a scalar",enum_type,EnumToStringx(enum_type));}61 void SetValue(IssmDouble scalar){_error_("Matrix param of enum %i (%s) cannot hold a scalar",enum_type,EnumToStringx(enum_type));} 62 62 void SetValue(char* string){_error_("Matrix param of enum %i (%s) cannot hold a string",enum_type,EnumToStringx(enum_type));} 63 63 void SetValue(char** stringarray,int M){_error_("Matrix param of enum %i (%s) cannot hold a string array",enum_type,EnumToStringx(enum_type));} 64 void SetValue( double* doublearray,int M){_error_("Matrix param of enum %i (%s) cannot hold a double array",enum_type,EnumToStringx(enum_type));}65 void SetValue( double* pdoublearray,int M,int N){_error_("Matrix param of enum %i (%s) cannot hold a double array",enum_type,EnumToStringx(enum_type));}64 void SetValue(IssmDouble* IssmDoublearray,int M){_error_("Matrix param of enum %i (%s) cannot hold a IssmDouble array",enum_type,EnumToStringx(enum_type));} 65 void SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error_("Matrix param of enum %i (%s) cannot hold a IssmDouble array",enum_type,EnumToStringx(enum_type));} 66 66 void SetValue(int* intarray,int M){_error_("Matrix param of enum %i (%s) cannot hold a int array",enum_type,EnumToStringx(enum_type));} 67 67 void SetValue(int* pintarray,int M,int N){_error_("Matrix param of enum %i (%s) cannot hold a int array",enum_type,EnumToStringx(enum_type));} … … 69 69 void SetValue(Matrix* mat); 70 70 void SetValue(FILE* fid){_error_("Matrix param of enum %i (%s) cannot hold a FILE",enum_type,EnumToStringx(enum_type));} 71 void SetValue( double** array, int M, int* mdim_array, int* ndim_array){_error_("Matrix param of enum %i (%s) cannot hold an array of matrices",enum_type,EnumToStringx(enum_type));}71 void SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Matrix param of enum %i (%s) cannot hold an array of matrices",enum_type,EnumToStringx(enum_type));} 72 72 void UnitConversion(int direction_enum); 73 73 -
issm/trunk-jpl/src/c/objects/Params/Param.h
r12365 r12474 31 31 virtual void GetParameterValue(int** pintarray,int* pM)=0; 32 32 virtual void GetParameterValue(int** pintarray,int* pM,int* pN)=0; 33 virtual void GetParameterValue( double* pdouble)=0;33 virtual void GetParameterValue(IssmDouble* pIssmDouble)=0; 34 34 virtual void GetParameterValue(char** pstring)=0; 35 35 virtual void GetParameterValue(char*** pstringarray,int* pM)=0; 36 virtual void GetParameterValue( double** pdoublearray,int* pM)=0;37 virtual void GetParameterValue( double** pdoublearray,int* pM,int* pN)=0;38 virtual void GetParameterValue( double*** parray, int* pM,int** pmdims, int** pndims)=0;36 virtual void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM)=0; 37 virtual void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM,int* pN)=0; 38 virtual void GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims)=0; 39 39 virtual void GetParameterValue(Vector** pvec)=0; 40 40 virtual void GetParameterValue(Matrix** pmat)=0; … … 43 43 virtual void SetValue(bool boolean)=0; 44 44 virtual void SetValue(int integer)=0; 45 virtual void SetValue( double scalar)=0;45 virtual void SetValue(IssmDouble scalar)=0; 46 46 virtual void SetValue(char* string)=0; 47 47 virtual void SetValue(char** stringarray,int M)=0; 48 virtual void SetValue( double* doublearray,int M)=0;49 virtual void SetValue( double* pdoublearray,int M,int N)=0;48 virtual void SetValue(IssmDouble* IssmDoublearray,int M)=0; 49 virtual void SetValue(IssmDouble* pIssmDoublearray,int M,int N)=0; 50 50 virtual void SetValue(int* intarray,int M)=0; 51 51 virtual void SetValue(int* pintarray,int M,int N)=0; … … 53 53 virtual void SetValue(Matrix* mat)=0; 54 54 virtual void SetValue(FILE* fid)=0; 55 virtual void SetValue( double** array, int M, int* mdim_array, int* ndim_array)=0;55 virtual void SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array)=0; 56 56 virtual void UnitConversion(int direction_enum)=0; 57 57 virtual void GetParameterName(char**pname)=0; -
issm/trunk-jpl/src/c/objects/Params/StringArrayParam.cpp
r12451 r12474 41 41 size=strlen(in_values[i])+1; 42 42 string=xNew<char>(size); 43 memcpy(string,in_values[i],size*sizeof(char));43 xMemCpy<char>(string,in_values[i],size); 44 44 value[i]=string; 45 45 } … … 127 127 128 128 string2=xNew<char>(stringsize); 129 memcpy(string2,string,stringsize*sizeof(char));129 xMemCpy<char>(string2,string,stringsize); 130 130 131 131 outstrings[i]=string2; … … 167 167 168 168 string2=xNew<char>(stringsize); 169 memcpy(string2,string,stringsize*sizeof(char));169 xMemCpy<char>(string2,string,stringsize); 170 170 171 171 this->value[i]=string2; -
issm/trunk-jpl/src/c/objects/Params/StringArrayParam.h
r12365 r12474 49 49 void GetParameterValue(int** pintarray,int* pM){_error_("StringArray param of enum %i (%s) cannot return an array of integers",enum_type,EnumToStringx(enum_type));} 50 50 void GetParameterValue(int** pintarray,int* pM,int* pN){_error_("StringArray param of enum %i (%s) cannot return an array of integers",enum_type,EnumToStringx(enum_type));} 51 void GetParameterValue( double* pdouble){_error_("StringArray param of enum %i (%s) cannot return a double",enum_type,EnumToStringx(enum_type));}51 void GetParameterValue(IssmDouble* pIssmDouble){_error_("StringArray param of enum %i (%s) cannot return a IssmDouble",enum_type,EnumToStringx(enum_type));} 52 52 void GetParameterValue(char** pstring){_error_("StringArray param of enum %i (%s) cannot return a string",enum_type,EnumToStringx(enum_type));} 53 53 void GetParameterValue(char*** pstringarray,int* pM); 54 void GetParameterValue( double** pdoublearray,int* pM){_error_("StringArray param of enum %i (%s) cannot return a double array",enum_type,EnumToStringx(enum_type));}55 void GetParameterValue( double** pdoublearray,int* pM, int* pN){_error_("StringArray param of enum %i (%s) cannot return a double array",enum_type,EnumToStringx(enum_type));}56 void GetParameterValue( double*** parray, int* pM,int** pmdims, int** pndims){_error_("Vec param of enum %i (%s) cannot return a matrix array",enum_type,EnumToStringx(enum_type));}54 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error_("StringArray param of enum %i (%s) cannot return a IssmDouble array",enum_type,EnumToStringx(enum_type));} 55 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error_("StringArray param of enum %i (%s) cannot return a IssmDouble array",enum_type,EnumToStringx(enum_type));} 56 void GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("Vec param of enum %i (%s) cannot return a matrix array",enum_type,EnumToStringx(enum_type));} 57 57 void GetParameterValue(Vector** pvec){_error_("StringArray param of enum %i (%s) cannot return a Vec",enum_type,EnumToStringx(enum_type));} 58 58 void GetParameterValue(Matrix** pmat){_error_("StringArray param of enum %i (%s) cannot return a Mat",enum_type,EnumToStringx(enum_type));} … … 61 61 void SetValue(bool boolean){_error_("StringArray param of enum %i (%s) cannot hold a boolean",enum_type,EnumToStringx(enum_type));} 62 62 void SetValue(int integer){_error_("StringArray param of enum %i (%s) cannot hold an integer",enum_type,EnumToStringx(enum_type));} 63 void SetValue( double scalar){_error_("StringArray param of enum %i (%s) cannot hold a scalar",enum_type,EnumToStringx(enum_type));}63 void SetValue(IssmDouble scalar){_error_("StringArray param of enum %i (%s) cannot hold a scalar",enum_type,EnumToStringx(enum_type));} 64 64 void SetValue(char* string){_error_("StringArray param of enum %i (%s) cannot hold a string",enum_type,EnumToStringx(enum_type));} 65 65 void SetValue(char** stringarray,int M); 66 void SetValue( double* doublearray,int M){_error_("StringArray param of enum %i (%s) cannot hold a double array",enum_type,EnumToStringx(enum_type));}67 void SetValue( double* pdoublearray,int M,int N){_error_("StringArray param of enum %i (%s) cannot hold a double array",enum_type,EnumToStringx(enum_type));}66 void SetValue(IssmDouble* IssmDoublearray,int M){_error_("StringArray param of enum %i (%s) cannot hold a IssmDouble array",enum_type,EnumToStringx(enum_type));} 67 void SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error_("StringArray param of enum %i (%s) cannot hold a IssmDouble array",enum_type,EnumToStringx(enum_type));} 68 68 void SetValue(int* intarray,int M){_error_("StringArray param of enum %i (%s) cannot hold a int array",enum_type,EnumToStringx(enum_type));} 69 69 void SetValue(int* pintarray,int M,int N){_error_("StringArray param of enum %i (%s) cannot hold a int array",enum_type,EnumToStringx(enum_type));} … … 71 71 void SetValue(Matrix* mat){_error_("StringArray param of enum %i (%s) cannot hold a Mat",enum_type,EnumToStringx(enum_type));} 72 72 void SetValue(FILE* fid){_error_("StringArray param of enum %i (%s) cannot hold a FILE",enum_type,EnumToStringx(enum_type));} 73 void SetValue( double** array, int M, int* mdim_array, int* ndim_array){_error_("StringArray param of enum %i (%s) cannot hold an array of matrices",enum_type,EnumToStringx(enum_type));}73 void SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("StringArray param of enum %i (%s) cannot hold an array of matrices",enum_type,EnumToStringx(enum_type));} 74 74 void UnitConversion(int direction_enum); 75 75 -
issm/trunk-jpl/src/c/objects/Params/StringParam.cpp
r12451 r12474 31 31 enum_type=in_enum_type; 32 32 value=xNew<char>(strlen(in_value)+1); 33 memcpy(value,in_value,(strlen(in_value)+1)*sizeof(char));33 xMemCpy<char>(value,in_value,(strlen(in_value)+1)); 34 34 35 35 … … 89 89 90 90 outstring=xNew<char>(stringsize); 91 memcpy(outstring,this->value,stringsize*sizeof(char));91 xMemCpy<char>(outstring,this->value,stringsize); 92 92 93 93 *pstring=outstring; … … 111 111 stringsize=strlen(string)+1; 112 112 this->value=xNew<char>(stringsize); 113 memcpy(this->value,string,stringsize*sizeof(char));113 xMemCpy<char>(this->value,string,stringsize); 114 114 115 115 } -
issm/trunk-jpl/src/c/objects/Params/StringParam.h
r12365 r12474 47 47 void GetParameterValue(int** pintarray,int* pM){_error_("String param of enum %i (%s) cannot return an array of integers",enum_type,EnumToStringx(enum_type));} 48 48 void GetParameterValue(int** pintarray,int* pM,int* pN){_error_("String param of enum %i (%s) cannot return an array of integers",enum_type,EnumToStringx(enum_type));} 49 void GetParameterValue( double* pdouble){_error_("String param of enum %i (%s) cannot return a double",enum_type,EnumToStringx(enum_type));}49 void GetParameterValue(IssmDouble* pIssmDouble){_error_("String param of enum %i (%s) cannot return a IssmDouble",enum_type,EnumToStringx(enum_type));} 50 50 void GetParameterValue(char** pstring); 51 51 void GetParameterValue(char*** pstringarray,int* pM){_error_("String param of enum %i (%s) cannot return a string array",enum_type,EnumToStringx(enum_type));} 52 void GetParameterValue( double** pdoublearray,int* pM){_error_("String param of enum %i (%s) cannot return a double array",enum_type,EnumToStringx(enum_type));}53 void GetParameterValue( double** pdoublearray,int* pM, int* pN){_error_("String param of enum %i (%s) cannot return a double array",enum_type,EnumToStringx(enum_type));}54 void GetParameterValue( double*** parray, int* pM,int** pmdims, int** pndims){_error_("String param of enum %i (%s) cannot return a matrix array",enum_type,EnumToStringx(enum_type));}52 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error_("String param of enum %i (%s) cannot return a IssmDouble array",enum_type,EnumToStringx(enum_type));} 53 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error_("String param of enum %i (%s) cannot return a IssmDouble array",enum_type,EnumToStringx(enum_type));} 54 void GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("String param of enum %i (%s) cannot return a matrix array",enum_type,EnumToStringx(enum_type));} 55 55 void GetParameterValue(Vector** pvec){_error_("String param of enum %i (%s) cannot return a Vec",enum_type,EnumToStringx(enum_type));} 56 56 void GetParameterValue(Matrix** pmat){_error_("String param of enum %i (%s) cannot return a Mat",enum_type,EnumToStringx(enum_type));} … … 59 59 void SetValue(bool boolean){_error_("String param of enum %i (%s) cannot hold a boolean",enum_type,EnumToStringx(enum_type));} 60 60 void SetValue(int integer){_error_("String param of enum %i (%s) cannot hold an integer",enum_type,EnumToStringx(enum_type));} 61 void SetValue( double scalar){_error_("String param of enum %i (%s) cannot hold a scalar",enum_type,EnumToStringx(enum_type));}61 void SetValue(IssmDouble scalar){_error_("String param of enum %i (%s) cannot hold a scalar",enum_type,EnumToStringx(enum_type));} 62 62 void SetValue(char* string); 63 63 void SetValue(char** stringarray,int M){_error_("String param of enum %i (%s) cannot hold a string array",enum_type,EnumToStringx(enum_type));} 64 void SetValue( double* doublearray,int M){_error_("String param of enum %i (%s) cannot hold a double array",enum_type,EnumToStringx(enum_type));}65 void SetValue( double* pdoublearray,int M,int N){_error_("String param of enum %i (%s) cannot hold a double array",enum_type,EnumToStringx(enum_type));}64 void SetValue(IssmDouble* IssmDoublearray,int M){_error_("String param of enum %i (%s) cannot hold a IssmDouble array",enum_type,EnumToStringx(enum_type));} 65 void SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error_("String param of enum %i (%s) cannot hold a IssmDouble array",enum_type,EnumToStringx(enum_type));} 66 66 void SetValue(int* intarray,int M){_error_("String param of enum %i (%s) cannot hold a int array",enum_type,EnumToStringx(enum_type));} 67 67 void SetValue(int* pintarray,int M,int N){_error_("String param of enum %i (%s) cannot hold a int array",enum_type,EnumToStringx(enum_type));} … … 69 69 void SetValue(Matrix* mat){_error_("String param of enum %i (%s) cannot hold a Mat",enum_type,EnumToStringx(enum_type));} 70 70 void SetValue(FILE* fid){_error_("String param of enum %i (%s) cannot hold a FILE",enum_type,EnumToStringx(enum_type));} 71 void SetValue( double** array, int M, int* mdim_array, int* ndim_array){_error_("String param of enum %i (%s) cannot hold an array of matrices",enum_type,EnumToStringx(enum_type));}71 void SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("String param of enum %i (%s) cannot hold an array of matrices",enum_type,EnumToStringx(enum_type));} 72 72 void UnitConversion(int direction_enum); 73 73 -
issm/trunk-jpl/src/c/objects/Params/VectorParam.h
r12365 r12474 47 47 void GetParameterValue(int** pintarray,int* pM){_error_("Vector param of enum %i (%s) cannot return an array of integers",enum_type,EnumToStringx(enum_type));} 48 48 void GetParameterValue(int** pintarray,int* pM,int* pN){_error_("Vector param of enum %i (%s) cannot return an array of integers",enum_type,EnumToStringx(enum_type));} 49 void GetParameterValue( double* pdouble){_error_("Vector param of enum %i (%s) cannot return a double",enum_type,EnumToStringx(enum_type));}49 void GetParameterValue(IssmDouble* pIssmDouble){_error_("Vector param of enum %i (%s) cannot return a IssmDouble",enum_type,EnumToStringx(enum_type));} 50 50 void GetParameterValue(char** pstring){_error_("Vector param of enum %i (%s) cannot return a string",enum_type,EnumToStringx(enum_type));} 51 51 void GetParameterValue(char*** pstringarray,int* pM){_error_("Vector param of enum %i (%s) cannot return a string array",enum_type,EnumToStringx(enum_type));} 52 void GetParameterValue( double** pdoublearray,int* pM){_error_("Vector param of enum %i (%s) cannot return a double array",enum_type,EnumToStringx(enum_type));}53 void GetParameterValue( double** pdoublearray,int* pM, int* pN){_error_("Vector param of enum %i (%s) cannot return a double array",enum_type,EnumToStringx(enum_type));}54 void GetParameterValue( double*** parray, int* pM,int** pmdims, int** pndims){_error_("Vector param of enum %i (%s) cannot return a matrix array",enum_type,EnumToStringx(enum_type));}52 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error_("Vector param of enum %i (%s) cannot return a IssmDouble array",enum_type,EnumToStringx(enum_type));} 53 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error_("Vector param of enum %i (%s) cannot return a IssmDouble array",enum_type,EnumToStringx(enum_type));} 54 void GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("Vector param of enum %i (%s) cannot return a matrix array",enum_type,EnumToStringx(enum_type));} 55 55 void GetParameterValue(Matrix** pmat){_error_("Vector param of enum %i (%s) cannot return a Mat",enum_type,EnumToStringx(enum_type));} 56 56 void GetParameterValue(Vector** poutput); … … 59 59 void SetValue(bool boolean){_error_("Vector of enum %i (%s) cannot hold a boolean",enum_type,EnumToStringx(enum_type));} 60 60 void SetValue(int integer){_error_("Vector of enum %i (%s) cannot hold an integer",enum_type,EnumToStringx(enum_type));} 61 void SetValue( double scalar){_error_("Vector of enum %i (%s) cannot hold a scalar",enum_type,EnumToStringx(enum_type));}61 void SetValue(IssmDouble scalar){_error_("Vector of enum %i (%s) cannot hold a scalar",enum_type,EnumToStringx(enum_type));} 62 62 void SetValue(char* string){_error_("Vector of enum %i (%s) cannot hold a string",enum_type,EnumToStringx(enum_type));} 63 63 void SetValue(char** stringarray,int M){_error_("Vector of enum %i (%s) cannot hold a string array",enum_type,EnumToStringx(enum_type));} 64 void SetValue( double* doublearray,int M){_error_("Vector of enum %i (%s) cannot hold a double array",enum_type,EnumToStringx(enum_type));}65 void SetValue( double* pdoublearray,int M,int N){_error_("Vector of enum %i (%s) cannot hold a double array",enum_type,EnumToStringx(enum_type));}64 void SetValue(IssmDouble* IssmDoublearray,int M){_error_("Vector of enum %i (%s) cannot hold a IssmDouble array",enum_type,EnumToStringx(enum_type));} 65 void SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error_("Vector of enum %i (%s) cannot hold a IssmDouble array",enum_type,EnumToStringx(enum_type));} 66 66 void SetValue(int* intarray,int M){_error_("Vector of enum %i (%s) cannot hold a int array",enum_type,EnumToStringx(enum_type));} 67 67 void SetValue(int* pintarray,int M,int N){_error_("Vector of enum %i (%s) cannot hold a int array",enum_type,EnumToStringx(enum_type));} … … 69 69 void SetValue(Matrix* mat){_error_("Vector of enum %i (%s) cannot hold a Mat",enum_type,EnumToStringx(enum_type));} 70 70 void SetValue(FILE* fid){_error_("Vector of enum %i (%s) cannot hold a FILE",enum_type,EnumToStringx(enum_type));} 71 void SetValue( double** array, int M, int* mdim_array, int* ndim_array){_error_("Vector param of enum %i (%s) cannot hold an array of matrices",enum_type,EnumToStringx(enum_type));}71 void SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Vector param of enum %i (%s) cannot hold an array of matrices",enum_type,EnumToStringx(enum_type));} 72 72 void UnitConversion(int direction_enum); 73 73
Note:
See TracChangeset
for help on using the changeset viewer.