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