HermesCommon  2.0
Hermes::Algebra::Matrix< Scalar > Class Template Referenceabstract

General (abstract) matrix representation in Hermes. More...

#include <matrix.h>

+ Inheritance diagram for Hermes::Algebra::Matrix< Scalar >:

Public Member Functions

unsigned int get_size ()
 
 Matrix (unsigned int size)
 
virtual void alloc ()=0
 allocate the memory for stiffness matrix and right-hand side
 
virtual void free ()=0
 free the memory associated with stiffness matrix and right-hand side
 
virtual Scalar get (unsigned int m, unsigned int n)=0
 
virtual void zero ()=0
 Zero the matrix.
 
virtual void add_to_diagonal (Scalar v)=0
 Add a number to each diagonal entry.
 
virtual void add (unsigned int m, unsigned int n, Scalar v)=0
 
virtual void add (unsigned int m, unsigned int n, Scalar **mat, int *rows, int *cols)=0
 
virtual bool dump (FILE *file, const char *var_name, EMatrixDumpFormat fmt=DF_MATLAB_SPARSE, char *number_format="%lf")=0
 
virtual unsigned int get_matrix_size () const =0
 
- Public Member Functions inherited from Hermes::Mixins::Loggable
void set_verbose_output (bool to_set)
 Sets the attribute verbose_output to the paramater option passed.
 
bool get_verbose_output () const
 Returns the current value of verbose_output;.
 
void set_verbose_callback (callbackFn callback)
 
callbackFn get_verbose_callback () const
 Returns the current value of verbose_callback;.
 

Protected Attributes

unsigned int size
 matrix size
 

Additional Inherited Members

- Protected Member Functions inherited from Hermes::Mixins::Loggable
 Loggable (bool verbose_output=false, callbackFn verbose_callback=NULL)
 
void info (const char *msg,...) const
 
void info_if (bool cond, const char *msg,...) const
 
void warn (const char *msg,...) const
 
void warn_if (bool cond, const char *msg,...) const
 
void error (const char *msg,...) const
 
void error_if (bool cond, const char *msg,...) const
 
void hermes_fwrite (const void *ptr, size_t size, size_t nitems, FILE *stream) const
 
void hermes_fread (void *ptr, size_t size, size_t nitems, FILE *stream) const
 

Detailed Description

template<typename Scalar>
class Hermes::Algebra::Matrix< Scalar >

General (abstract) matrix representation in Hermes.

Definition at line 281 of file matrix.h.

Constructor & Destructor Documentation

template<typename Scalar>
Hermes::Algebra::Matrix< Scalar >::Matrix ( unsigned int  size)
inline

constructor of matrix

Parameters
[in]sizesize of matrix

Definition at line 290 of file matrix.h.

Member Function Documentation

template<typename Scalar>
virtual void Hermes::Algebra::Matrix< Scalar >::add ( unsigned int  m,
unsigned int  n,
Scalar  v 
)
pure virtual

update the stiffness matrix

Parameters
[in]m- the row where to update
[in]n- the column where to update
[in]v- value
template<typename Scalar>
virtual void Hermes::Algebra::Matrix< Scalar >::add ( unsigned int  m,
unsigned int  n,
Scalar **  mat,
int *  rows,
int *  cols 
)
pure virtual

update the stiffness matrix

Parameters
[in]m- number of rows of given block
[in]n- number of columns of given block
[in]mat- block of values
[in]rows- array with row indexes
[in]cols- array with column indexes
template<typename Scalar>
virtual bool Hermes::Algebra::Matrix< Scalar >::dump ( FILE *  file,
const char *  var_name,
EMatrixDumpFormat  fmt = DF_MATLAB_SPARSE,
char *  number_format = "%lf" 
)
pure virtual

dumping matrix and right-hand side

Parameters
[in]filefile handle
[in]var_namename of variable (will be written to output file)
[in]fmtoutput file format
Returns
true on succes
template<typename Scalar>
virtual Scalar Hermes::Algebra::Matrix< Scalar >::get ( unsigned int  m,
unsigned int  n 
)
pure virtual

Get the value from a position

Returns
the value from the specified position
Parameters
[in]m- the number of row
[in]n- the number of column
template<typename Scalar>
virtual unsigned int Hermes::Algebra::Matrix< Scalar >::get_matrix_size ( ) const
pure virtual

Get size of matrix

Returns
size of matrix
template<typename Scalar>
unsigned int Hermes::Algebra::Matrix< Scalar >::get_size ( )
inline

get size of matrix

Returns
size of matrix

Definition at line 286 of file matrix.h.


The documentation for this class was generated from the following file: