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

Last change on this file since 16560 was 16560, checked in by Mathieu Morlighem, 11 years ago

merged trunk-jpl and trunk for revision 16554

File size: 2.0 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*/
18/*FUNCTION MatrixParam::MatrixParam(){{{*/
19MatrixParam::MatrixParam(){
20 return;
21}
22/*}}}*/
23/*FUNCTION MatrixParam::MatrixParam(int enum_type,Matrix<IssmDouble>* value){{{*/
24MatrixParam::MatrixParam(int in_enum_type,Matrix<IssmDouble>* in_value){
25
26 enum_type=in_enum_type;
27 value=NULL;
28
29 if(in_value){
30 value=in_value->Duplicate();
31 }
32}
33/*}}}*/
34/*FUNCTION MatrixParam::~MatrixParam(){{{*/
35MatrixParam::~MatrixParam(){
36 delete value;
37}
38/*}}}*/
39
40/*Object virtual functions definitions:*/
41/*FUNCTION MatrixParam::Echo {{{*/
42void MatrixParam::Echo(void){
43
44 _printf_("MatrixParam:\n");
45 _printf_(" enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")\n");
46
47}
48/*}}}*/
49/*FUNCTION MatrixParam::DeepEcho{{{*/
50void MatrixParam::DeepEcho(void){
51
52 _printf_("MatrixParam:\n");
53 _printf_(" enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")\n");
54 this->value->Echo();
55}
56/*}}}*/
57/*FUNCTION MatrixParam::Id{{{*/
58int MatrixParam::Id(void){ return -1; }
59/*}}}*/
60/*FUNCTION MatrixParam::ObjectEnum{{{*/
61int MatrixParam::ObjectEnum(void){
62
63 return MatrixParamEnum;
64
65}
66/*}}}*/
67/*FUNCTION MatrixParam::copy{{{*/
68Object* MatrixParam::copy() {
69
70 return new MatrixParam(this->enum_type,this->value);
71
72}
73/*}}}*/
74
75/*MatrixParam virtual functions definitions: */
76/*FUNCTION MatrixParam::GetParameterValue{{{*/
77void MatrixParam::GetParameterValue(Matrix<IssmDouble>** poutput){
78 Matrix<IssmDouble>* output=NULL;
79
80 if(value){
81 output=value->Duplicate();
82 }
83 *poutput=output;
84}
85/*}}}*/
86/*FUNCTION MatrixParam::SetValue{{{*/
87void MatrixParam::SetValue(Matrix<IssmDouble>* matrix){
88
89 /*avoid leak: */
90 delete value;
91
92 /*copy: */
93 value=matrix->Duplicate();
94}
95/*}}}*/
Note: See TracBrowser for help on using the repository browser.