/*!\file IntMatParam.c * \brief: implementation of the IntMatParam object */ /*header files: */ /*{{{*/ #ifdef HAVE_CONFIG_H #include #else #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!" #endif #include "../classes.h" #include "shared/shared.h" /*}}}*/ /*IntMatParam constructors and destructor*/ IntMatParam::IntMatParam(){/*{{{*/ return; } /*}}}*/ IntMatParam::IntMatParam(int in_enum_type,int* in_value, int in_M,int in_N){/*{{{*/ enum_type=in_enum_type; M=in_M; N=in_N; value=xNew(M*N); xMemCpy(value,in_value,M*N); } /*}}}*/ IntMatParam::~IntMatParam(){/*{{{*/ xDelete(value); return; } /*}}}*/ /*Object virtual functions definitions:*/ void IntMatParam::Echo(void){/*{{{*/ _printf_("IntMatParam:\n"); _printf_(" enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")\n"); _printf_(" matrix size: " << this->M << "x" << this->N << "\n"); } /*}}}*/ void IntMatParam::DeepEcho(void){/*{{{*/ int i,j; _printf_("IntMatParam:\n"); _printf_(" enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")\n"); _printf_(" matrix size: " << this->M << "x" << this->N << "\n"); for(i=0;iM;i++){ for(j=0;jN;j++){ _printf_("(" << i << "," << j << ") " << *(this->value+N*i+j) << "\n"); } } } /*}}}*/ int IntMatParam::Id(void){ return -1; }/*{{{*/ /*}}}*/ int IntMatParam::ObjectEnum(void){/*{{{*/ return IntMatParamEnum; } /*}}}*/ Param* IntMatParam::copy() {/*{{{*/ return new IntMatParam(this->enum_type,this->value,this->M,this->N); } /*}}}*/ void IntMatParam::Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ /*{{{*/ MARSHALLING_ENUM(IntMatParamEnum); MARSHALLING(enum_type); MARSHALLING(M); MARSHALLING(N); MARSHALLING_DYNAMIC(value,int,M*N); } /*}}}*/ /*IntMatParam virtual functions definitions: */ void IntMatParam::GetParameterValue(int** pintarray,int* pM,int* pN){/*{{{*/ int* output=NULL; output=xNew(M*N); xMemCpy(output,value,M*N); /*Assign output pointers:*/ if(pM) *pM=M; if(pN) *pN=N; *pintarray=output; } /*}}}*/ void IntMatParam::SetValue(int* intarray,int in_M,int in_N){/*{{{*/ /*avoid leak: */ xDelete(this->value); this->value=xNew(in_M*in_N); xMemCpy(this->value,intarray,in_M*in_N); this->M=in_M; this->N=in_N; } /*}}}*/