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