#include <LinEqVector.h>
Inheritance diagram for LinEqVector::

Public Methods | |
| LinEqVector () | |
| LinEqVector (int nblocks) | |
| LinEqVector (const LinEqVector &u) | |
| LinEqVector (Vector(NUMT) &vec) | |
| ~LinEqVector () | |
| int | size () const |
| int | getNoEntries () const |
| bool | redim (int nblocks=1) |
| bool | redim (const LinEqVector_prm &vecprm) |
| bool | redim (const LinEqVector &u) |
| int | getWork (const VectorWork work_tp=NORM_WORK) const |
| real | getStorage () const |
| bool | ok () const |
| bool | single () const |
| Vector(NUMT)& | vec (int i=1) |
| const Vector(NUMT)& | vec (int i=1) const |
| void | attach (const Vector(NUMT) &vec, int i=1) |
| LinEqVector& | operator= (const LinEqVector &v) |
| LinEqVector& | operator= (NUMT a) |
| void | assemble (const Vec(NUMT) &ev, const VecSimple(int) &idx_trans, int elm_no, int i=1) |
| bool | blockCompatible (const LinEqVector &y) const |
| void | add (const LinEqVector &y, const LinEqVector &z) |
| void | add (const LinEqVector &y, char s, const LinEqVector &z) |
| void | add (const LinEqVector &y, NUMT b, const LinEqVector &z) |
| void | add (NUMT a, const LinEqVector &y, NUMT b, const LinEqVector &z) |
| void | mult (NUMT value) |
| NUMT | inner (const LinEqVector &y) const |
| real | norm (Norm_type lp=l2) |
| real | normDiff (const LinEqVector &y, Norm_type lp=l2) |
| void | randomize (real low=-1.0, real high=1.0) |
| const Vec(NUMT)& | getVec (int i=1) const |
| Vec(NUMT)& | getVec (int i=1) |
| const ArrayGen(NUMT)& | getArrayGen (int i=1) const |
| ArrayGen(NUMT)& | getArrayGen (int i=1) |
| const ArrayGenSel(NUMT)& | getArrayGenSel (int i=1) const |
| ArrayGenSel(NUMT)& | getArrayGenSel (int i=1) |
| void | debugPrint (Os os, const char *header) const |
Friends | |
| Os& | operator<< (Os &os, const LinEqVector &v) |
NAME: LinEqVector - vector in a system of linear equations
DESCRIPTION:
The class implements a block vector and constitutes the basic vector class to be used by (iterative) equation solvers in the "LinEqSolver" hierarchy. Most operations are simplified if there is only one block present.
The class allocates a vector of "Handle(Vector(NUMT)" instances, where each vector represents a block.
The class has features for keeping track of the storage requirements of "LinEqVectors", see the documentation page of class "LinEqMatrix" for more details.
|
|
There are four constructors. One is empty and allocates no internal data structure. Further initialization is then required: either a call to the "redim" function with an int (the number of blocks) as argument and then calls to "attach", or a call to "redim(LinEqVector_prm)". In the latter case, the "redim" function allocates memory for all the matrices according to the sizes given in the parameter object of class "LinEqVector_prm". Another alternative is to call "redim(LinEqVector)", where the allocation is based on an already existing "LinEqVector" structure. Note that the "redim" function that takes an int as argument allocates an internal vector of handles. These handles are empty and must be rebound to objects of type "Vector(NUMT)" by calling the "attach" function. The other "redim" functions allocate both the vector of handles and "Vector(NUMT)" objects that are rebound to the handles. In addition to the default constructor, there are other constructors accepting the number of blocks, a preallocated "LinEqVector" object or a "Vector(NUMT)" object. In the first of these cases, attachment or some redimensioning of each block is required. The third option implies that the "LinEqVector" object consists of a single block. Deallocation of everything that is allocated in "LinEqVector" objects will automatically take place when the "LinEqVector" object goes out of scope since then all handles will be deleted and the handles will delete the "Vector(NUMT)" objects if there are no other handle referring to these objects. Further initialization of the class is not necessary, except that the matrices must be filled by proper "NUMT" values. |
|
|
|
|
|
See documentation of one of the overloaded constructor. |
|
|
See documentation of one of the overloaded constructor. |
|
|
|
|
|
See documentation of one of the overloaded functions. |
|
|
See documentation of one of the overloaded functions. |
|
|
See documentation of one of the overloaded functions. |
|
|
computes a sum of (block) vectors. Some of the vectors can be multiplied by a scalar. There are several overloaded instances. |
|
|
adds a small vector to a large, global vector. The elements are assembled according to an index transformation vector. The routine is useful when programming finite element methods. |
|
|
attach a "Vector(NUMT)" handle as a block. |
|
|
compares the block size of the "LinEqVector" y and the current object. |
|
|
prints the contents of a "LinEqVector" object block for block. Alternatively, printing can be done by calls like "vec(i).print(os)". |
|
|
See documentation of one of the overloaded functions. |
|
|
as "getVec", but the subclass instance of "Vector(NUMT)" must be of "ArrayGen(NUMT)" type. |
|
|
See documentation of one of the overloaded functions. |
|
|
as "getVec", but the subclass instance of "Vector(NUMT)" must be of "ArrayGenSel(NUMT)" type. |
|
|
returns the total number of entries (added up over all blocks). |
|
|
returns the total storage cost (added up over all blocks). |
|
|
See documentation of one of the overloaded functions. |
|
|
performs a cast from the general vector representation ("Vector(NUMT)" pointer) to a specific subclass reference. Do not use this routine to index a vector, declare your own reference and use this routine to initialize that reference. |
|
|
returns the total cost if the last issued vector operation (added up over all blocks). |
|
|
computes the inner product of two vectors with identical block structure. If both vectors contain complex values, the complex conjugate is used. |
|
|
|
|
|
computes the norm of the (block) vector. There are several norms available (see "enum" "Norm_type"): "l1" is the discrete `$`L`_`1`$` norm, "L1" is the corresponding continuous norm, "l2" is the discrete `$`L`_`2`$` norm (Euclidean norm), while "L2" is the corresponding continuous norm. Finally, "Linf" is the `$`L`_{\`infty`}$` norm. |
|
|
similar to "norm", but computes the norm of the vector difference between the current object and the argument vector. |
|
|
returns "true" if the object is in an ok state. the value "false" is returned only if there are empty handles. |
|
|
See documentation of one of the overloaded functions. |
|
|
redimensions and initializes this "LinEqVector" object based on another existing "LinEqVector". |
|
|
fills the vector with random values in the closed interval from "low" to "high". Two sequences of same length will be identical if they are based on the same "seed" value. |
|
|
See documentation of one of the overloaded functions. |
|
|
See documentation of one of the overloaded functions. |
|
|
redimension the block vector. If given a "LinEqVector_prm" or "LinEqVector" object, each block is also redimensioned according to indicated block sizes and formats. |
|
|
returns "true" if there is only a single block. |
|
|
returns the number of blocks. |
|
|
See documentation of one of the overloaded functions. |
|
|
subscripting, returns a "Vector(NUMT)" reference to a block. |
|
|
see "debugPrint". |