Ice Sheet System Model  4.18
Code documentation
Public Member Functions | Protected Attributes
DoubleMatParam Class Reference

#include <DoubleMatParam.h>

Inheritance diagram for DoubleMatParam:
Param Object DoubleTransientMatParam

Public Member Functions

 DoubleMatParam ()
 
 DoubleMatParam (int enum_type, IssmDouble *value, int M, int N)
 
 ~DoubleMatParam ()
 
void Echo ()
 
void DeepEcho ()
 
int Id ()
 
int ObjectEnum ()
 
Paramcopy ()
 
void Marshall (char **pmarshalled_data, int *pmarshalled_data_size, int marshall_direction)
 
int InstanceEnum ()
 
void GetParameterValue (bool *pbool)
 
void GetParameterValue (int *pinteger)
 
void GetParameterValue (int **pintarray, int *pM)
 
void GetParameterValue (int **pintarray, int *pM, int *pN)
 
void GetParameterValue (IssmDouble *pIssmDouble)
 
void GetParameterValue (IssmDouble *pdouble, IssmDouble time)
 
void GetParameterValue (char **pstring)
 
void GetParameterValue (char ***pstringarray, int *pM)
 
void GetParameterValue (IssmDouble **pIssmDoublearray, int *pM)
 
void GetParameterValue (IssmDouble **pIssmDoublearray, int *pM, int *pN)
 
void GetParameterValue (IssmDouble ***parray, int *pM, int **pmdims, int **pndims)
 
void GetParameterValue (Vector< IssmDouble > **pvec)
 
void GetParameterValue (Matrix< IssmDouble > **pmat)
 
void GetParameterValue (FILE **pfid)
 
void GetParameterValue (DataSet **pdataset)
 
void SetValue (bool boolean)
 
void SetValue (int integer)
 
void SetValue (IssmDouble scalar)
 
void SetValue (char *string)
 
void SetValue (char **stringarray, int M)
 
void SetValue (IssmDouble *IssmDoublearray, int M)
 
void SetValue (IssmDouble *IssmDoublearray, int M, int N)
 
void SetValue (int *intarray, int M)
 
void SetValue (int *intarray, int M, int N)
 
void SetValue (Vector< IssmDouble > *vec)
 
void SetValue (Matrix< IssmDouble > *mat)
 
void SetValue (FILE *fid)
 
void SetValue (IssmDouble **array, int M, int *mdim_array, int *ndim_array)
 
void SetEnum (int enum_in)
 
void GetParameterValueByPointer (IssmDouble **pIssmDoublearray, int *pM, int *pN)
 
- Public Member Functions inherited from Param
virtual ~Param ()
 
virtual void GetParameterValue (IssmDouble *pdouble, int row, IssmDouble time)
 
virtual void SetValue (DataSet *dataset)
 
- Public Member Functions inherited from Object
virtual ~Object ()
 

Protected Attributes

int enum_type
 
IssmDoublevalue
 
int M
 
int N
 

Detailed Description

Definition at line 20 of file DoubleMatParam.h.

Constructor & Destructor Documentation

◆ DoubleMatParam() [1/2]

DoubleMatParam::DoubleMatParam ( )

Definition at line 18 of file DoubleMatParam.cpp.

18  {/*{{{*/
19  return;
20 }

◆ DoubleMatParam() [2/2]

DoubleMatParam::DoubleMatParam ( int  enum_type,
IssmDouble value,
int  M,
int  N 
)

Definition at line 22 of file DoubleMatParam.cpp.

22  {/*{{{*/
23 
24  enum_type=in_enum_type;
25  M=in_M;
26  N=in_N;
27 
28  value=xNew<IssmDouble>(M*N);
29  xMemCpy<IssmDouble>(value,in_value,M*N);
30 }

◆ ~DoubleMatParam()

DoubleMatParam::~DoubleMatParam ( )

Definition at line 32 of file DoubleMatParam.cpp.

32  {/*{{{*/
33  xDelete<IssmDouble>(value);
34  return;
35 }

Member Function Documentation

◆ Echo()

void DoubleMatParam::Echo ( void  )
virtual

Implements Param.

Definition at line 39 of file DoubleMatParam.cpp.

39  {/*{{{*/
40 
41  _printf_("DoubleMatParam:\n");
42  _printf_(" enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")\n");
43  _printf_(" matrix size: " << this->M << "x" << this->N << "\n");
44 
45 }

◆ DeepEcho()

void DoubleMatParam::DeepEcho ( void  )
virtual

Implements Param.

Definition at line 47 of file DoubleMatParam.cpp.

47  {/*{{{*/
48 
49  int i,j;
50 
51  _printf_("DoubleMatParam:\n");
52  _printf_(" enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")\n");
53  _printf_(" matrix size: " << this->M << "x" << this->N << "\n");
54  for(i=0;i<this->M;i++){
55  for(j=0;j<this->N;j++){
56  _printf_(i << " " << j << " " << *(this->value+N*i+j) << "\n");
57  }
58  }
59 }

◆ Id()

int DoubleMatParam::Id ( void  )
virtual

Implements Object.

Definition at line 61 of file DoubleMatParam.cpp.

61 { return -1; }/*{{{*/

◆ ObjectEnum()

int DoubleMatParam::ObjectEnum ( void  )
virtual

Implements Param.

Definition at line 63 of file DoubleMatParam.cpp.

63  {/*{{{*/
64 
65  return DoubleMatParamEnum;
66 
67 }

◆ copy()

Param * DoubleMatParam::copy ( void  )
virtual

Implements Param.

Definition at line 69 of file DoubleMatParam.cpp.

69  {/*{{{*/
70 
71  return new DoubleMatParam(this->enum_type,this->value,this->M,this->N);
72 
73 }

◆ Marshall()

void DoubleMatParam::Marshall ( char **  pmarshalled_data,
int *  pmarshalled_data_size,
int  marshall_direction 
)
virtual

Implements Param.

Definition at line 75 of file DoubleMatParam.cpp.

75  { /*{{{*/
76 
78 
80  MARSHALLING(M);
81  MARSHALLING(N);
83 }

◆ InstanceEnum()

int DoubleMatParam::InstanceEnum ( )
inlinevirtual

Implements Param.

Definition at line 43 of file DoubleMatParam.h.

43 {return enum_type;}

◆ GetParameterValue() [1/15]

void DoubleMatParam::GetParameterValue ( bool *  pbool)
inlinevirtual

Implements Param.

Definition at line 44 of file DoubleMatParam.h.

44 {_error_("Param "<< EnumToStringx(enum_type) << " cannot return a bool");}

◆ GetParameterValue() [2/15]

void DoubleMatParam::GetParameterValue ( int *  pinteger)
inlinevirtual

Implements Param.

Definition at line 45 of file DoubleMatParam.h.

45 {_error_("Param "<< EnumToStringx(enum_type) << " cannot return an integer");}

◆ GetParameterValue() [3/15]

void DoubleMatParam::GetParameterValue ( int **  pintarray,
int *  pM 
)
inlinevirtual

Implements Param.

Definition at line 46 of file DoubleMatParam.h.

46 {_error_("Param "<< EnumToStringx(enum_type) << " cannot return an array of integers");}

◆ GetParameterValue() [4/15]

void DoubleMatParam::GetParameterValue ( int **  pintarray,
int *  pM,
int *  pN 
)
virtual

Implements Param.

Definition at line 99 of file DoubleMatParam.cpp.

99  {/*{{{*/
100  _error_("DoubleMat of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an array of int");
101 }

◆ GetParameterValue() [5/15]

void DoubleMatParam::GetParameterValue ( IssmDouble pIssmDouble)
inlinevirtual

Implements Param.

Definition at line 48 of file DoubleMatParam.h.

48 {_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble");}

◆ GetParameterValue() [6/15]

void DoubleMatParam::GetParameterValue ( IssmDouble pdouble,
IssmDouble  time 
)
inlinevirtual

Implements Param.

Definition at line 49 of file DoubleMatParam.h.

49 {_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble for a given time");}

◆ GetParameterValue() [7/15]

void DoubleMatParam::GetParameterValue ( char **  pstring)
inlinevirtual

Implements Param.

Definition at line 50 of file DoubleMatParam.h.

50 {_error_("Param "<< EnumToStringx(enum_type) << " cannot return a string");}

◆ GetParameterValue() [8/15]

void DoubleMatParam::GetParameterValue ( char ***  pstringarray,
int *  pM 
)
inlinevirtual

Implements Param.

Definition at line 51 of file DoubleMatParam.h.

51 {_error_("Param "<< EnumToStringx(enum_type) << " cannot return a string array");}

◆ GetParameterValue() [9/15]

void DoubleMatParam::GetParameterValue ( IssmDouble **  pIssmDoublearray,
int *  pM 
)
inlinevirtual

Implements Param.

Definition at line 52 of file DoubleMatParam.h.

52 {_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}

◆ GetParameterValue() [10/15]

void DoubleMatParam::GetParameterValue ( IssmDouble **  pIssmDoublearray,
int *  pM,
int *  pN 
)
virtual

Implements Param.

Definition at line 87 of file DoubleMatParam.cpp.

87  {/*{{{*/
88  IssmDouble* output=NULL;
89 
90  output=xNew<IssmDouble>(M*N);
91  xMemCpy<IssmDouble>(output,value,M*N);
92 
93  /*Assign output pointers:*/
94  if(pM) *pM=M;
95  if(pN) *pN=N;
96  *pIssmDoublearray=output;
97 }

◆ GetParameterValue() [11/15]

void DoubleMatParam::GetParameterValue ( IssmDouble ***  parray,
int *  pM,
int **  pmdims,
int **  pndims 
)
inlinevirtual

Implements Param.

Definition at line 54 of file DoubleMatParam.h.

54 {_error_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}

◆ GetParameterValue() [12/15]

void DoubleMatParam::GetParameterValue ( Vector< IssmDouble > **  pvec)
inlinevirtual

Implements Param.

Definition at line 55 of file DoubleMatParam.h.

55 {_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}

◆ GetParameterValue() [13/15]

void DoubleMatParam::GetParameterValue ( Matrix< IssmDouble > **  pmat)
inlinevirtual

Implements Param.

Definition at line 56 of file DoubleMatParam.h.

56 {_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}

◆ GetParameterValue() [14/15]

void DoubleMatParam::GetParameterValue ( FILE **  pfid)
inlinevirtual

Implements Param.

Definition at line 57 of file DoubleMatParam.h.

57 {_error_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}

◆ GetParameterValue() [15/15]

void DoubleMatParam::GetParameterValue ( DataSet **  pdataset)
inlinevirtual

Implements Param.

Definition at line 58 of file DoubleMatParam.h.

58 {_error_("Param "<< EnumToStringx(enum_type) << " cannot return a DataSet");}

◆ SetValue() [1/13]

void DoubleMatParam::SetValue ( bool  boolean)
inlinevirtual

Implements Param.

Definition at line 60 of file DoubleMatParam.h.

60 {_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a boolean");}

◆ SetValue() [2/13]

void DoubleMatParam::SetValue ( int  integer)
inlinevirtual

Implements Param.

Definition at line 61 of file DoubleMatParam.h.

61 {_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an integer");}

◆ SetValue() [3/13]

void DoubleMatParam::SetValue ( IssmDouble  scalar)
inlinevirtual

Implements Param.

Definition at line 62 of file DoubleMatParam.h.

62 {_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a scalar");}

◆ SetValue() [4/13]

void DoubleMatParam::SetValue ( char *  string)
inlinevirtual

Implements Param.

Definition at line 63 of file DoubleMatParam.h.

63 {_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a string");}

◆ SetValue() [5/13]

void DoubleMatParam::SetValue ( char **  stringarray,
int  M 
)
inlinevirtual

Implements Param.

Definition at line 64 of file DoubleMatParam.h.

64 {_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a string array");}

◆ SetValue() [6/13]

void DoubleMatParam::SetValue ( IssmDouble IssmDoublearray,
int  M 
)
inlinevirtual

Implements Param.

Definition at line 65 of file DoubleMatParam.h.

65 {_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble vec array");}

◆ SetValue() [7/13]

void DoubleMatParam::SetValue ( IssmDouble IssmDoublearray,
int  M,
int  N 
)
virtual

Implements Param.

Definition at line 103 of file DoubleMatParam.cpp.

103  {/*{{{*/
104 
105  /*avoid leak: */
106  xDelete<IssmDouble>(this->value);
107 
108  this->value=xNew<IssmDouble>(in_M*in_N);
109  xMemCpy<IssmDouble>(this->value,IssmDoublearray,in_M*in_N);
110 
111  this->M=in_M;
112  this->N=in_N;
113 }

◆ SetValue() [8/13]

void DoubleMatParam::SetValue ( int *  intarray,
int  M 
)
inlinevirtual

Implements Param.

Definition at line 67 of file DoubleMatParam.h.

67 {_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int vec array");}

◆ SetValue() [9/13]

void DoubleMatParam::SetValue ( int *  intarray,
int  M,
int  N 
)
inlinevirtual

Implements Param.

Definition at line 68 of file DoubleMatParam.h.

68 {_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int mat array");};

◆ SetValue() [10/13]

void DoubleMatParam::SetValue ( Vector< IssmDouble > *  vec)
inlinevirtual

Implements Param.

Definition at line 69 of file DoubleMatParam.h.

69 {_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}

◆ SetValue() [11/13]

void DoubleMatParam::SetValue ( Matrix< IssmDouble > *  mat)
inlinevirtual

Implements Param.

Definition at line 70 of file DoubleMatParam.h.

70 {_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}

◆ SetValue() [12/13]

void DoubleMatParam::SetValue ( FILE *  fid)
inlinevirtual

Implements Param.

Definition at line 71 of file DoubleMatParam.h.

71 {_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}

◆ SetValue() [13/13]

void DoubleMatParam::SetValue ( IssmDouble **  array,
int  M,
int *  mdim_array,
int *  ndim_array 
)
inlinevirtual

Implements Param.

Definition at line 72 of file DoubleMatParam.h.

72 {_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}

◆ SetEnum()

void DoubleMatParam::SetEnum ( int  enum_in)
inlinevirtual

Implements Param.

Definition at line 73 of file DoubleMatParam.h.

73 {this->enum_type = enum_in;};

◆ GetParameterValueByPointer()

void DoubleMatParam::GetParameterValueByPointer ( IssmDouble **  pIssmDoublearray,
int *  pM,
int *  pN 
)

Definition at line 117 of file DoubleMatParam.cpp.

117  {/*{{{*/
118 
119  /*Assign output pointers:*/
120  if(pM) *pM=M;
121  if(pN) *pN=N;
122  *pIssmDoublearray=value;
123 }

Field Documentation

◆ enum_type

int DoubleMatParam::enum_type
protected

Definition at line 23 of file DoubleMatParam.h.

◆ value

IssmDouble* DoubleMatParam::value
protected

Definition at line 24 of file DoubleMatParam.h.

◆ M

int DoubleMatParam::M
protected

Definition at line 25 of file DoubleMatParam.h.

◆ N

int DoubleMatParam::N
protected

Definition at line 26 of file DoubleMatParam.h.


The documentation for this class was generated from the following files:
DoubleMatParam::enum_type
int enum_type
Definition: DoubleMatParam.h:23
DoubleMatParam::M
int M
Definition: DoubleMatParam.h:25
IssmDouble
double IssmDouble
Definition: types.h:37
_printf_
#define _printf_(StreamArgs)
Definition: Print.h:22
MARSHALLING_ENUM
#define MARSHALLING_ENUM(EN)
Definition: Marshalling.h:14
MARSHALLING_DYNAMIC
#define MARSHALLING_DYNAMIC(FIELD, TYPE, SIZE)
Definition: Marshalling.h:61
DoubleMatParam::value
IssmDouble * value
Definition: DoubleMatParam.h:24
DoubleMatParam::N
int N
Definition: DoubleMatParam.h:26
EnumToStringx
const char * EnumToStringx(int enum_in)
Definition: EnumToStringx.cpp:15
MARSHALLING
#define MARSHALLING(FIELD)
Definition: Marshalling.h:29
_error_
#define _error_(StreamArgs)
Definition: exceptions.h:49
DoubleMatParamEnum
@ DoubleMatParamEnum
Definition: EnumDefinitions.h:1046
DoubleMatParam::DoubleMatParam
DoubleMatParam()
Definition: DoubleMatParam.cpp:18