Ice Sheet System Model  4.18
Code documentation
DoubleMatArrayParam.h
Go to the documentation of this file.
1 
5 #ifndef _DOUBLEMATARRAYPARAM_H_
6 #define _DOUBLEMATARRAYPARAM_H_
7 
8 /*Headers:*/
9 /*{{{*/
10 #ifdef HAVE_CONFIG_H
11  #include <config.h>
12 #else
13 #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
14 #endif
15 
16 #include "./Param.h"
17 #include "../../shared/shared.h"
18 /*}}}*/
19 
20 class DoubleMatArrayParam: public Param{
21 
22  private:
23  int enum_type;
24  IssmDouble **array; //array of matrices
25  int M; //size of array
26  int *mdim_array; //m-dimensions of matrices in the array
27  int *ndim_array; //n-dimensions -f matrices in the array
28 
29  public:
30  /*DoubleMatArrayParam constructors, destructors: {{{*/
34  /*}}}*/
35  /*Object virtual functions definitions:{{{ */
36  Param* copy();
37  void DeepEcho();
38  void Echo();
39  int Id();
40  void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
41  int ObjectEnum();
42  /*}}}*/
43  /*Param vritual function definitions: {{{*/
44  void GetParameterValue(bool* pbool){_error_("Param "<< EnumToStringx(enum_type) << "cannot return a bool");}
45  void GetParameterValue(int* pinteger){_error_("Param "<< EnumToStringx(enum_type) << "cannot return an integer");}
46  void GetParameterValue(int** pintarray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << "cannot return an array of integers");}
47  void GetParameterValue(int** pintarray,int* pM,int* pN){_error_("Param "<< EnumToStringx(enum_type) << "cannot return an array of integers");}
48  void GetParameterValue(IssmDouble* pIssmDouble){_error_("Param "<< EnumToStringx(enum_type) << "cannot return a IssmDouble");}
49  void GetParameterValue(IssmDouble* pdouble,IssmDouble time){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}
50  void GetParameterValue(char** pstring){_error_("Param "<< EnumToStringx(enum_type) << "cannot return a string");}
51  void GetParameterValue(char*** pstringarray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << "cannot return a string array");}
52  void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){_error_("Param "<< EnumToStringx(enum_type) << "cannot return a IssmDouble array");}
53  void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error_("Param "<< EnumToStringx(enum_type) << "cannot return a IssmDouble array");}
54  void GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims);
55  void GetParameterValue(Vector<IssmDouble>** pvec){_error_("Param "<< EnumToStringx(enum_type) << "cannot return a Vec");}
56  void GetParameterValue(Matrix<IssmDouble>** pmat){_error_("Param "<< EnumToStringx(enum_type) << "cannot return a Mat");}
57  void GetParameterValue(FILE** pfid){_error_("Param "<< EnumToStringx(enum_type) << "cannot return a FILE");}
58  void GetParameterValue(DataSet** pdataset){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a DataSet");}
59  int InstanceEnum(){return enum_type;}
60 
61  void SetEnum(int enum_in){this->enum_type = enum_in;};
62  void SetValue(bool boolean){_error_("Param "<< EnumToStringx(enum_type) << "cannot hold a boolean");}
63  void SetValue(int integer){_error_("Param "<< EnumToStringx(enum_type) << "cannot hold an integer");}
64  void SetValue(IssmDouble scalar){_error_("Param "<< EnumToStringx(enum_type) << "cannot hold a scalar");}
65  void SetValue(char* string){_error_("Param "<< EnumToStringx(enum_type) << "cannot hold a string");}
66  void SetValue(char** stringarray,int M){_error_("Param "<< EnumToStringx(enum_type) << "cannot hold a string array");}
67  void SetValue(IssmDouble* IssmDoublearray,int M){_error_("Param "<< EnumToStringx(enum_type) << "cannot hold a IssmDouble vec array");}
68  void SetValue(IssmDouble* IssmDoublearray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << "cannot hold a IssmDouble mat array");}
69  void SetValue(int* intarray,int M){_error_("Param "<< EnumToStringx(enum_type) << "cannot hold a int vec array");}
70  void SetValue(int* intarray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << "cannot hold a int mat array");}
71  void SetValue(Vector<IssmDouble>* vec){_error_("Param "<< EnumToStringx(enum_type) << "cannot hold a Vec");}
72  void SetValue(Matrix<IssmDouble>* mat){_error_("Param "<< EnumToStringx(enum_type) << "cannot hold a Mat");}
73  void SetValue(FILE* fid){_error_("Bool param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a FILE");}
74  void SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array);
75  /*}}}*/
76 };
77 #endif /* _DOUBLEMATARRAYPARAM_H */
DoubleMatArrayParam::DeepEcho
void DeepEcho()
Definition: DoubleMatArrayParam.cpp:84
Matrix< IssmDouble >
DoubleMatArrayParam::GetParameterValue
void GetParameterValue(int *pinteger)
Definition: DoubleMatArrayParam.h:45
IssmDouble
double IssmDouble
Definition: types.h:37
Param
Definition: Param.h:21
DoubleMatArrayParam::InstanceEnum
int InstanceEnum()
Definition: DoubleMatArrayParam.h:59
DoubleMatArrayParam::SetValue
void SetValue(int *intarray, int M, int N)
Definition: DoubleMatArrayParam.h:70
DoubleMatArrayParam::array
IssmDouble ** array
Definition: DoubleMatArrayParam.h:24
DoubleMatArrayParam::GetParameterValue
void GetParameterValue(IssmDouble *pIssmDouble)
Definition: DoubleMatArrayParam.h:48
DoubleMatArrayParam::ObjectEnum
int ObjectEnum()
Definition: DoubleMatArrayParam.cpp:140
DoubleMatArrayParam::SetValue
void SetValue(char **stringarray, int M)
Definition: DoubleMatArrayParam.h:66
DoubleMatArrayParam::GetParameterValue
void GetParameterValue(char ***pstringarray, int *pM)
Definition: DoubleMatArrayParam.h:51
DoubleMatArrayParam::~DoubleMatArrayParam
~DoubleMatArrayParam()
Definition: DoubleMatArrayParam.cpp:59
DoubleMatArrayParam::Id
int Id()
Definition: DoubleMatArrayParam.cpp:116
DoubleMatArrayParam::SetValue
void SetValue(bool boolean)
Definition: DoubleMatArrayParam.h:62
DoubleMatArrayParam::SetValue
void SetValue(IssmDouble *IssmDoublearray, int M)
Definition: DoubleMatArrayParam.h:67
DoubleMatArrayParam::SetEnum
void SetEnum(int enum_in)
Definition: DoubleMatArrayParam.h:61
DoubleMatArrayParam::GetParameterValue
void GetParameterValue(IssmDouble *pdouble, IssmDouble time)
Definition: DoubleMatArrayParam.h:49
DoubleMatArrayParam::GetParameterValue
void GetParameterValue(IssmDouble **pIssmDoublearray, int *pM)
Definition: DoubleMatArrayParam.h:52
EnumToStringx
const char * EnumToStringx(int enum_in)
Definition: EnumToStringx.cpp:15
DoubleMatArrayParam::GetParameterValue
void GetParameterValue(DataSet **pdataset)
Definition: DoubleMatArrayParam.h:58
DoubleMatArrayParam::SetValue
void SetValue(Vector< IssmDouble > *vec)
Definition: DoubleMatArrayParam.h:71
Param.h
abstract class for Param object
DoubleMatArrayParam::mdim_array
int * mdim_array
Definition: DoubleMatArrayParam.h:26
DoubleMatArrayParam::GetParameterValue
void GetParameterValue(int **pintarray, int *pM, int *pN)
Definition: DoubleMatArrayParam.h:47
DoubleMatArrayParam::SetValue
void SetValue(Matrix< IssmDouble > *mat)
Definition: DoubleMatArrayParam.h:72
DoubleMatArrayParam::enum_type
int enum_type
Definition: DoubleMatArrayParam.h:23
DoubleMatArrayParam::DoubleMatArrayParam
DoubleMatArrayParam()
Definition: DoubleMatArrayParam.cpp:18
_error_
#define _error_(StreamArgs)
Definition: exceptions.h:49
DoubleMatArrayParam::GetParameterValue
void GetParameterValue(int **pintarray, int *pM)
Definition: DoubleMatArrayParam.h:46
DoubleMatArrayParam::GetParameterValue
void GetParameterValue(FILE **pfid)
Definition: DoubleMatArrayParam.h:57
DoubleMatArrayParam::GetParameterValue
void GetParameterValue(Vector< IssmDouble > **pvec)
Definition: DoubleMatArrayParam.h:55
DoubleMatArrayParam::SetValue
void SetValue(IssmDouble *IssmDoublearray, int M, int N)
Definition: DoubleMatArrayParam.h:68
DoubleMatArrayParam::M
int M
Definition: DoubleMatArrayParam.h:25
DoubleMatArrayParam::GetParameterValue
void GetParameterValue(IssmDouble **pIssmDoublearray, int *pM, int *pN)
Definition: DoubleMatArrayParam.h:53
DoubleMatArrayParam::copy
Param * copy()
Definition: DoubleMatArrayParam.cpp:78
DoubleMatArrayParam::Echo
void Echo()
Definition: DoubleMatArrayParam.cpp:107
DoubleMatArrayParam::GetParameterValue
void GetParameterValue(Matrix< IssmDouble > **pmat)
Definition: DoubleMatArrayParam.h:56
DataSet
Declaration of DataSet class.
Definition: DataSet.h:14
DoubleMatArrayParam::SetValue
void SetValue(int *intarray, int M)
Definition: DoubleMatArrayParam.h:69
DoubleMatArrayParam::SetValue
void SetValue(IssmDouble scalar)
Definition: DoubleMatArrayParam.h:64
Vector< IssmDouble >
DoubleMatArrayParam
Definition: DoubleMatArrayParam.h:20
DoubleMatArrayParam::SetValue
void SetValue(char *string)
Definition: DoubleMatArrayParam.h:65
DoubleMatArrayParam::GetParameterValue
void GetParameterValue(bool *pbool)
Definition: DoubleMatArrayParam.h:44
DoubleMatArrayParam::SetValue
void SetValue(int integer)
Definition: DoubleMatArrayParam.h:63
DoubleMatArrayParam::ndim_array
int * ndim_array
Definition: DoubleMatArrayParam.h:27
DoubleMatArrayParam::Marshall
void Marshall(char **pmarshalled_data, int *pmarshalled_data_size, int marshall_direction)
Definition: DoubleMatArrayParam.cpp:118
DoubleMatArrayParam::SetValue
void SetValue(FILE *fid)
Definition: DoubleMatArrayParam.h:73
DoubleMatArrayParam::GetParameterValue
void GetParameterValue(char **pstring)
Definition: DoubleMatArrayParam.h:50