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

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

#include <matrix.h>

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

Public Member Functions

virtual void alloc (unsigned int ndofs)=0
 
virtual void free ()=0
 free the memory
 
virtual void finish ()
 finish the assembly of the vector
 
virtual Scalar get (unsigned int idx)=0
 
virtual void extract (Scalar *v) const =0
 
virtual void zero ()=0
 Zero the vector.
 
virtual void change_sign ()=0
 Multiply by minus one.
 
virtual void set (unsigned int idx, Scalar y)=0
 
virtual void add (unsigned int idx, Scalar y)=0
 
virtual void add_vector (Vector< Scalar > *vec)=0
 Add a vector.
 
virtual void add_vector (Scalar *vec)=0
 Add a vector.
 
virtual void add (unsigned int n, unsigned int *idx, Scalar *y)=0
 
unsigned int length () const
 Get vector length.
 
virtual bool dump (FILE *file, const char *var_name, EMatrixDumpFormat fmt=DF_MATLAB_SPARSE, char *number_format="%lf")=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
 size of vector
 

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::Vector< Scalar >

General (abstract) vector representation in Hermes.

Definition at line 482 of file matrix.h.

Member Function Documentation

template<typename Scalar>
virtual void Hermes::Algebra::Vector< Scalar >::add ( unsigned int  idx,
Scalar  y 
)
pure virtual

update element on the specified position

Parameters
[in]idx- indices where to update
[in]y- value
template<typename Scalar>
virtual void Hermes::Algebra::Vector< Scalar >::add ( unsigned int  n,
unsigned int *  idx,
Scalar *  y 
)
pure virtual

update subset of the elements

Parameters
[in]n- number of positions to update
[in]idx- indices where to update
[in]y- values
template<typename Scalar>
virtual void Hermes::Algebra::Vector< Scalar >::alloc ( unsigned int  ndofs)
pure virtual

allocate memory for storing ndofs elements

Parameters
[in]ndofs- number of elements of the vector
template<typename Scalar>
virtual bool Hermes::Algebra::Vector< Scalar >::dump ( FILE *  file,
const char *  var_name,
EMatrixDumpFormat  fmt = DF_MATLAB_SPARSE,
char *  number_format = "%lf" 
)
pure virtual

Write to file.

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 void Hermes::Algebra::Vector< Scalar >::extract ( Scalar *  v) const
pure virtual

Extract vector values into user-provided array.

Parameters
[out]v- array which will contain extracted values
template<typename Scalar>
virtual Scalar Hermes::Algebra::Vector< Scalar >::get ( unsigned int  idx)
pure virtual

Get the value from a position

Returns
the value form the specified index
Parameters
[in]idx- index which to obtain the value from
template<typename Scalar>
virtual void Hermes::Algebra::Vector< Scalar >::set ( unsigned int  idx,
Scalar  y 
)
pure virtual

set the entry on a specified position

Parameters
[in]idx- indices where to update
[in]y- value

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