source: issm/trunk/src/c/classes/Params/MatrixParam.cpp

Last change on this file was 21341, checked in by Mathieu Morlighem, 8 years ago

merged trunk-jpl and trunk for revision 21337

File size: 1.6 KB
Line 
1/*!\file MatrixParam.c
2 * \brief: implementation of the MatrixParam object
3 */
4
5/*header files: */
6/*{{{*/
7#ifdef HAVE_CONFIG_H
8 #include <config.h>
9#else
10#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
11#endif
12
13#include "../classes.h"
14#include "../../shared/shared.h"
15/*}}}*/
16
17/*MatrixParam constructors and destructor*/
18MatrixParam::MatrixParam(){/*{{{*/
19 return;
20}
21/*}}}*/
22MatrixParam::MatrixParam(int in_enum_type,Matrix<IssmDouble>* in_value){/*{{{*/
23
24 enum_type=in_enum_type;
25 value=NULL;
26
27 if(in_value){
28 value=in_value->Duplicate();
29 }
30}
31/*}}}*/
32MatrixParam::~MatrixParam(){/*{{{*/
33 delete value;
34}
35/*}}}*/
36
37/*Object virtual functions definitions:*/
38Param* MatrixParam::copy() {/*{{{*/
39
40 return new MatrixParam(this->enum_type,this->value);
41
42}
43/*}}}*/
44void MatrixParam::DeepEcho(void){/*{{{*/
45
46 _printf_("MatrixParam:\n");
47 _printf_(" enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")\n");
48 this->value->Echo();
49}
50/*}}}*/
51void MatrixParam::Echo(void){/*{{{*/
52
53 _printf_("MatrixParam:\n");
54 _printf_(" enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")\n");
55
56}
57/*}}}*/
58int MatrixParam::Id(void){ return -1; }/*{{{*/
59/*}}}*/
60int MatrixParam::ObjectEnum(void){/*{{{*/
61
62 return MatrixParamEnum;
63
64}
65/*}}}*/
66
67/*MatrixParam virtual functions definitions: */
68void MatrixParam::GetParameterValue(Matrix<IssmDouble>** poutput){/*{{{*/
69 Matrix<IssmDouble>* output=NULL;
70
71 if(value){
72 output=value->Duplicate();
73 }
74 *poutput=output;
75}
76/*}}}*/
77void MatrixParam::SetValue(Matrix<IssmDouble>* matrix){/*{{{*/
78
79 /*avoid leak: */
80 delete value;
81
82 /*copy: */
83 value=matrix->Duplicate();
84}
85/*}}}*/
Note: See TracBrowser for help on using the repository browser.