Ice Sheet System Model  4.18
Code documentation
Public Member Functions | Private Attributes
DoubleVecParam Class Reference

#include <DoubleVecParam.h>

Inheritance diagram for DoubleVecParam:
Param Object

Public Member Functions

 DoubleVecParam ()
 
 DoubleVecParam (int enum_type, IssmDouble *values, int M)
 
 ~DoubleVecParam ()
 
Paramcopy ()
 
void DeepEcho ()
 
void Echo ()
 
int Id ()
 
void Marshall (char **pmarshalled_data, int *pmarshalled_data_size, int marshall_direction)
 
int ObjectEnum ()
 
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)
 
int InstanceEnum ()
 
void SetEnum (int enum_in)
 
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 *pIssmDoublearray, int M, int N)
 
void SetValue (int *intarray, int M)
 
void SetValue (int *pintarray, 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 GetParameterValueByPointer (IssmDouble **pIssmDoublearray, int *pM)
 
- 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 ()
 

Private Attributes

int enum_type
 
IssmDoublevalues
 
int M
 

Detailed Description

Definition at line 20 of file DoubleVecParam.h.

Constructor & Destructor Documentation

◆ DoubleVecParam() [1/2]

DoubleVecParam::DoubleVecParam ( )

Definition at line 18 of file DoubleVecParam.cpp.

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

◆ DoubleVecParam() [2/2]

DoubleVecParam::DoubleVecParam ( int  enum_type,
IssmDouble values,
int  M 
)

Definition at line 22 of file DoubleVecParam.cpp.

22  {/*{{{*/
23 
24  enum_type=in_enum_type;
25  M=in_M;
26 
27  if(M){
28  values=xNew<IssmDouble>(M);
29  xMemCpy<IssmDouble>(values,in_values,M);
30  }
31  else values=NULL;
32 }

◆ ~DoubleVecParam()

DoubleVecParam::~DoubleVecParam ( )

Definition at line 34 of file DoubleVecParam.cpp.

34  {/*{{{*/
35  xDelete<IssmDouble>(values);
36  return;
37 }

Member Function Documentation

◆ copy()

Param * DoubleVecParam::copy ( void  )
virtual

Implements Param.

Definition at line 41 of file DoubleVecParam.cpp.

41  {/*{{{*/
42 
43  return new DoubleVecParam(this->enum_type,this->values,this->M);
44 
45 }

◆ DeepEcho()

void DoubleVecParam::DeepEcho ( void  )
virtual

Implements Param.

Definition at line 47 of file DoubleVecParam.cpp.

47  {/*{{{*/
48  _printf_(setw(22)<<" DoubleVecParam "<<setw(35)<<left<<EnumToStringx(this->enum_type)<<" "<<"[");
49  for(int i=0;i<this->M;i++) _printf_(" "<< this->values[i]);
50  _printf_("\n");
51 }

◆ Echo()

void DoubleVecParam::Echo ( void  )
virtual

Implements Param.

Definition at line 53 of file DoubleVecParam.cpp.

53  {/*{{{*/
54 
55  _printf_(setw(22)<<" DoubleVecParam "<<setw(35)<<left<<EnumToStringx(this->enum_type)<<" size: "<<this->M<<"\n");
56 
57 }

◆ Id()

int DoubleVecParam::Id ( void  )
virtual

Implements Object.

Definition at line 59 of file DoubleVecParam.cpp.

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

◆ Marshall()

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

Implements Param.

Definition at line 61 of file DoubleVecParam.cpp.

61  { /*{{{*/
62 
64 
66  MARSHALLING(M);
68 
69 }

◆ ObjectEnum()

int DoubleVecParam::ObjectEnum ( void  )
virtual

Implements Param.

Definition at line 71 of file DoubleVecParam.cpp.

71  {/*{{{*/
72 
73  return DoubleVecParamEnum;
74 
75 }

◆ GetParameterValue() [1/15]

void DoubleVecParam::GetParameterValue ( bool *  pbool)
inlinevirtual

Implements Param.

Definition at line 42 of file DoubleVecParam.h.

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

◆ GetParameterValue() [2/15]

void DoubleVecParam::GetParameterValue ( int *  pinteger)
inlinevirtual

Implements Param.

Definition at line 43 of file DoubleVecParam.h.

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

◆ GetParameterValue() [3/15]

void DoubleVecParam::GetParameterValue ( int **  pintarray,
int *  pM 
)
virtual

Implements Param.

Definition at line 100 of file DoubleVecParam.cpp.

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

◆ GetParameterValue() [4/15]

void DoubleVecParam::GetParameterValue ( int **  pintarray,
int *  pM,
int *  pN 
)
inlinevirtual

Implements Param.

Definition at line 45 of file DoubleVecParam.h.

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

◆ GetParameterValue() [5/15]

void DoubleVecParam::GetParameterValue ( IssmDouble pIssmDouble)
inlinevirtual

Implements Param.

Definition at line 46 of file DoubleVecParam.h.

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

◆ GetParameterValue() [6/15]

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

Implements Param.

Definition at line 47 of file DoubleVecParam.h.

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

◆ GetParameterValue() [7/15]

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

Implements Param.

Definition at line 48 of file DoubleVecParam.h.

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

◆ GetParameterValue() [8/15]

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

Implements Param.

Definition at line 49 of file DoubleVecParam.h.

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

◆ GetParameterValue() [9/15]

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

Implements Param.

Definition at line 79 of file DoubleVecParam.cpp.

79  {/*{{{*/
80 
81  IssmDouble* output=xNew<IssmDouble>(M);
82  xMemCpy<IssmDouble>(output,values,M);
83 
84  /*Assign output pointers:*/
85  if(pM) *pM=M;
86  *poutput=output;
87 }

◆ GetParameterValue() [10/15]

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

Implements Param.

Definition at line 89 of file DoubleVecParam.cpp.

89  {/*{{{*/
90 
91  IssmDouble* output=xNew<IssmDouble>(this->M);
92  xMemCpy<IssmDouble>(output,values,M);
93 
94  /*Assign output pointers:*/
95  if(pM) *pM=this->M;
96  if(pN) *pN=1;
97  *poutput=output;
98 }

◆ GetParameterValue() [11/15]

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

Implements Param.

Definition at line 52 of file DoubleVecParam.h.

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

◆ GetParameterValue() [12/15]

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

Implements Param.

Definition at line 53 of file DoubleVecParam.h.

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

◆ GetParameterValue() [13/15]

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

Implements Param.

Definition at line 54 of file DoubleVecParam.h.

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

◆ GetParameterValue() [14/15]

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

Implements Param.

Definition at line 55 of file DoubleVecParam.h.

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

◆ GetParameterValue() [15/15]

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

Implements Param.

Definition at line 56 of file DoubleVecParam.h.

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

◆ InstanceEnum()

int DoubleVecParam::InstanceEnum ( )
inlinevirtual

Implements Param.

Definition at line 57 of file DoubleVecParam.h.

57 {return enum_type;}

◆ SetEnum()

void DoubleVecParam::SetEnum ( int  enum_in)
inlinevirtual

Implements Param.

Definition at line 59 of file DoubleVecParam.h.

59 {this->enum_type = enum_in;};

◆ SetValue() [1/13]

void DoubleVecParam::SetValue ( bool  boolean)
inlinevirtual

Implements Param.

Definition at line 60 of file DoubleVecParam.h.

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

◆ SetValue() [2/13]

void DoubleVecParam::SetValue ( int  integer)
inlinevirtual

Implements Param.

Definition at line 61 of file DoubleVecParam.h.

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

◆ SetValue() [3/13]

void DoubleVecParam::SetValue ( IssmDouble  scalar)
inlinevirtual

Implements Param.

Definition at line 62 of file DoubleVecParam.h.

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

◆ SetValue() [4/13]

void DoubleVecParam::SetValue ( char *  string)
inlinevirtual

Implements Param.

Definition at line 63 of file DoubleVecParam.h.

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

◆ SetValue() [5/13]

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

Implements Param.

Definition at line 64 of file DoubleVecParam.h.

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

◆ SetValue() [6/13]

void DoubleVecParam::SetValue ( IssmDouble IssmDoublearray,
int  M 
)
virtual

Implements Param.

Definition at line 104 of file DoubleVecParam.cpp.

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

◆ SetValue() [7/13]

void DoubleVecParam::SetValue ( IssmDouble pIssmDoublearray,
int  M,
int  N 
)
inlinevirtual

Implements Param.

Definition at line 66 of file DoubleVecParam.h.

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

◆ SetValue() [8/13]

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

Implements Param.

Definition at line 67 of file DoubleVecParam.h.

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

◆ SetValue() [9/13]

void DoubleVecParam::SetValue ( int *  pintarray,
int  M,
int  N 
)
inlinevirtual

Implements Param.

Definition at line 68 of file DoubleVecParam.h.

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

◆ SetValue() [10/13]

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

Implements Param.

Definition at line 69 of file DoubleVecParam.h.

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

◆ SetValue() [11/13]

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

Implements Param.

Definition at line 70 of file DoubleVecParam.h.

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

◆ SetValue() [12/13]

void DoubleVecParam::SetValue ( FILE *  fid)
inlinevirtual

Implements Param.

Definition at line 71 of file DoubleVecParam.h.

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

◆ SetValue() [13/13]

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

Implements Param.

Definition at line 72 of file DoubleVecParam.h.

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

◆ GetParameterValueByPointer()

void DoubleVecParam::GetParameterValueByPointer ( IssmDouble **  pIssmDoublearray,
int *  pM 
)

Definition at line 117 of file DoubleVecParam.cpp.

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

Field Documentation

◆ enum_type

int DoubleVecParam::enum_type
private

Definition at line 23 of file DoubleVecParam.h.

◆ values

IssmDouble* DoubleVecParam::values
private

Definition at line 24 of file DoubleVecParam.h.

◆ M

int DoubleVecParam::M
private

Definition at line 25 of file DoubleVecParam.h.


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