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

#include <MatrixParam.h>

Inheritance diagram for MatrixParam:
Param Object

Public Member Functions

 MatrixParam ()
 
 MatrixParam (int enum_type, Matrix< IssmDouble > *value)
 
 ~MatrixParam ()
 
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 > **poutput)
 
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)
 
- 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
 
Matrix< IssmDouble > * value
 

Detailed Description

Definition at line 20 of file MatrixParam.h.

Constructor & Destructor Documentation

◆ MatrixParam() [1/2]

MatrixParam::MatrixParam ( )

Definition at line 18 of file MatrixParam.cpp.

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

◆ MatrixParam() [2/2]

MatrixParam::MatrixParam ( int  enum_type,
Matrix< IssmDouble > *  value 
)

Definition at line 22 of file MatrixParam.cpp.

22  {/*{{{*/
23 
24  enum_type=in_enum_type;
25  value=NULL;
26 
27  if(in_value){
28  value=in_value->Duplicate();
29  }
30 }

◆ ~MatrixParam()

MatrixParam::~MatrixParam ( )

Definition at line 32 of file MatrixParam.cpp.

32  {/*{{{*/
33  delete value;
34 }

Member Function Documentation

◆ copy()

Param * MatrixParam::copy ( void  )
virtual

Implements Param.

Definition at line 38 of file MatrixParam.cpp.

38  {/*{{{*/
39 
40  return new MatrixParam(this->enum_type,this->value);
41 
42 }

◆ DeepEcho()

void MatrixParam::DeepEcho ( void  )
virtual

Implements Param.

Definition at line 44 of file MatrixParam.cpp.

44  {/*{{{*/
45 
46  _printf_("MatrixParam:\n");
47  _printf_(" enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")\n");
48  this->value->Echo();
49 }

◆ Echo()

void MatrixParam::Echo ( void  )
virtual

Implements Param.

Definition at line 51 of file MatrixParam.cpp.

51  {/*{{{*/
52 
53  _printf_("MatrixParam:\n");
54  _printf_(" enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")\n");
55 
56 }

◆ Id()

int MatrixParam::Id ( void  )
virtual

Implements Object.

Definition at line 58 of file MatrixParam.cpp.

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

◆ Marshall()

void MatrixParam::Marshall ( char **  pmarshalled_data,
int *  pmarshalled_data_size,
int  marshall_direction 
)
inlinevirtual

Implements Param.

Definition at line 38 of file MatrixParam.h.

38 { _error_("not implemented yet!"); };

◆ ObjectEnum()

int MatrixParam::ObjectEnum ( void  )
virtual

Implements Param.

Definition at line 60 of file MatrixParam.cpp.

60  {/*{{{*/
61 
62  return MatrixParamEnum;
63 
64 }

◆ GetParameterValue() [1/15]

void MatrixParam::GetParameterValue ( bool *  pbool)
inlinevirtual

Implements Param.

Definition at line 42 of file MatrixParam.h.

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

◆ GetParameterValue() [2/15]

void MatrixParam::GetParameterValue ( int *  pinteger)
inlinevirtual

Implements Param.

Definition at line 43 of file MatrixParam.h.

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

◆ GetParameterValue() [3/15]

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

Implements Param.

Definition at line 44 of file MatrixParam.h.

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

◆ GetParameterValue() [4/15]

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

Implements Param.

Definition at line 45 of file MatrixParam.h.

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

◆ GetParameterValue() [5/15]

void MatrixParam::GetParameterValue ( IssmDouble pIssmDouble)
inlinevirtual

Implements Param.

Definition at line 46 of file MatrixParam.h.

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

◆ GetParameterValue() [6/15]

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

Implements Param.

Definition at line 47 of file MatrixParam.h.

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

◆ GetParameterValue() [7/15]

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

Implements Param.

Definition at line 48 of file MatrixParam.h.

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

◆ GetParameterValue() [8/15]

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

Implements Param.

Definition at line 49 of file MatrixParam.h.

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

◆ GetParameterValue() [9/15]

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

Implements Param.

Definition at line 50 of file MatrixParam.h.

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

◆ GetParameterValue() [10/15]

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

Implements Param.

Definition at line 51 of file MatrixParam.h.

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

◆ GetParameterValue() [11/15]

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

Implements Param.

Definition at line 52 of file MatrixParam.h.

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

◆ GetParameterValue() [12/15]

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

Implements Param.

Definition at line 53 of file MatrixParam.h.

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

◆ GetParameterValue() [13/15]

void MatrixParam::GetParameterValue ( Matrix< IssmDouble > **  poutput)
virtual

Implements Param.

Definition at line 68 of file MatrixParam.cpp.

68  {/*{{{*/
69  Matrix<IssmDouble>* output=NULL;
70 
71  if(value){
72  output=value->Duplicate();
73  }
74  *poutput=output;
75 }

◆ GetParameterValue() [14/15]

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

Implements Param.

Definition at line 55 of file MatrixParam.h.

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

◆ GetParameterValue() [15/15]

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

Implements Param.

Definition at line 56 of file MatrixParam.h.

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

◆ InstanceEnum()

int MatrixParam::InstanceEnum ( )
inlinevirtual

Implements Param.

Definition at line 57 of file MatrixParam.h.

57 {return enum_type;}

◆ SetEnum()

void MatrixParam::SetEnum ( int  enum_in)
inlinevirtual

Implements Param.

Definition at line 59 of file MatrixParam.h.

59 {this->enum_type = enum_in;};

◆ SetValue() [1/13]

void MatrixParam::SetValue ( bool  boolean)
inlinevirtual

Implements Param.

Definition at line 60 of file MatrixParam.h.

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

◆ SetValue() [2/13]

void MatrixParam::SetValue ( int  integer)
inlinevirtual

Implements Param.

Definition at line 61 of file MatrixParam.h.

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

◆ SetValue() [3/13]

void MatrixParam::SetValue ( IssmDouble  scalar)
inlinevirtual

Implements Param.

Definition at line 62 of file MatrixParam.h.

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

◆ SetValue() [4/13]

void MatrixParam::SetValue ( char *  string)
inlinevirtual

Implements Param.

Definition at line 63 of file MatrixParam.h.

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

◆ SetValue() [5/13]

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

Implements Param.

Definition at line 64 of file MatrixParam.h.

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

◆ SetValue() [6/13]

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

Implements Param.

Definition at line 65 of file MatrixParam.h.

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

◆ SetValue() [7/13]

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

Implements Param.

Definition at line 66 of file MatrixParam.h.

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

◆ SetValue() [8/13]

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

Implements Param.

Definition at line 67 of file MatrixParam.h.

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

◆ SetValue() [9/13]

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

Implements Param.

Definition at line 68 of file MatrixParam.h.

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

◆ SetValue() [10/13]

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

Implements Param.

Definition at line 69 of file MatrixParam.h.

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

◆ SetValue() [11/13]

void MatrixParam::SetValue ( Matrix< IssmDouble > *  mat)
virtual

Implements Param.

Definition at line 77 of file MatrixParam.cpp.

77  {/*{{{*/
78 
79  /*avoid leak: */
80  delete value;
81 
82  /*copy: */
83  value=matrix->Duplicate();
84 }

◆ SetValue() [12/13]

void MatrixParam::SetValue ( FILE *  fid)
inlinevirtual

Implements Param.

Definition at line 71 of file MatrixParam.h.

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

◆ SetValue() [13/13]

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

Implements Param.

Definition at line 72 of file MatrixParam.h.

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

Field Documentation

◆ enum_type

int MatrixParam::enum_type
private

Definition at line 24 of file MatrixParam.h.

◆ value

Matrix<IssmDouble>* MatrixParam::value
private

Definition at line 25 of file MatrixParam.h.


The documentation for this class was generated from the following files:
Matrix< IssmDouble >
_printf_
#define _printf_(StreamArgs)
Definition: Print.h:22
MatrixParamEnum
@ MatrixParamEnum
Definition: EnumDefinitions.h:1172
MatrixParam::enum_type
int enum_type
Definition: MatrixParam.h:24
MatrixParam::value
Matrix< IssmDouble > * value
Definition: MatrixParam.h:25
EnumToStringx
const char * EnumToStringx(int enum_in)
Definition: EnumToStringx.cpp:15
Matrix::Duplicate
Matrix< doubletype > * Duplicate(void)
Definition: Matrix.h:252
_error_
#define _error_(StreamArgs)
Definition: exceptions.h:49
MatrixParam::MatrixParam
MatrixParam()
Definition: MatrixParam.cpp:18
Matrix::Echo
void Echo(void)
Definition: Matrix.h:159