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