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

Last change on this file since 20500 was 20500, checked in by Mathieu Morlighem, 9 years ago

merged trunk-jpl and trunk for revision 20497

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:*/
38void MatrixParam::Echo(void){/*{{{*/
39
40 _printf_("MatrixParam:\n");
41 _printf_(" enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")\n");
42
43}
44/*}}}*/
45void MatrixParam::DeepEcho(void){/*{{{*/
46
47 _printf_("MatrixParam:\n");
48 _printf_(" enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")\n");
49 this->value->Echo();
50}
51/*}}}*/
52int MatrixParam::Id(void){ return -1; }/*{{{*/
53/*}}}*/
54int MatrixParam::ObjectEnum(void){/*{{{*/
55
56 return MatrixParamEnum;
57
58}
59/*}}}*/
60Object* MatrixParam::copy() {/*{{{*/
61
62 return new MatrixParam(this->enum_type,this->value);
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.