Dense matrix. More...
#include <denseMatrix.hh>


Public Types | |
| typedef Cmplxtype< F >::type | c_type |
| Real type of data type. | |
| typedef _Matrix_iterator< F, const F &, const F * > | const_iterator |
| typedef _Matrix_iterator< F, F &, F * > | iterator |
| typedef Realtype< F >::type | r_type |
| Real type of data type. | |
| typedef F | type |
| Type of data, e.g. matrix entries. | |
| typedef F | value_type |
| typedef F | value_type |
Public Member Functions | |
| void | add (const ElementMatrix< F > &A, uint offm=0, uint offn=0) |
| Addition of another element matrix with possible offset. | |
| template<class T > | |
| void | addInto (Matrix< T > &dest, const T fact, const uint rowoffset=0, const uint coloffset=0) const |
| allows to add a Real Matrix to a complex one. | |
| void | addInto (Matrix< F > &dest, const F fact, const uint rowoffset=0, const uint coloffset=0) const |
| This matrix is added into to the given matrix. | |
| template<class T > | |
| void | addIntoT (Matrix< T > &dest, const T fact, const uint rowoffset=0, const uint coloffset=0) const |
| allows to add a Real Matrix to a complex one. | |
| iterator | begin (uint r=0) |
| Iterator over the elements, standing at position (r,0). | |
| const_iterator | begin (uint r=0) const |
| Constant iterator over the elements, standing at position (r,0) | |
| uint | col () const |
| Returns current column. | |
| void | compress (const Real threshold=EPS) |
| Compresses the matrix by dropping small entries. | |
| DenseMatrix (int m, int n, bool transpose=false) | |
| Constructor for an empty matrix. | |
| DenseMatrix (const Matrix< F > &m, bool t=false) | |
| Copy constructor. | |
| DenseMatrix (const Vector< F > &v, bool t=false) | |
| Transformation constructor from a vector of length n. | |
| template<class G > | |
| DenseMatrix (const Space< G > &spcX, const Space< G > &spcY, BilinearForm< F, G > &bf) | |
| Constructor. | |
| template<class G > | |
| DenseMatrix (const Space< G > &spc, BilinearForm< F, G > &bf) | |
| Constructor. | |
| DenseMatrix (const LiCo< F > &L) | |
| Constructor. | |
| DenseMatrix (const Compose< F > &L) | |
| Constructor. | |
| template<class G > | |
| DenseMatrix (const Space< G > &spcX, const Space< G > &spcY) | |
| Constructor for an empty matrix. | |
| DenseMatrix (const DenseMatrix< F > &m) | |
| Copy constructor. | |
| virtual const uint | dimX () const |
| Returns the size of the image space of the operator (number of rows of the corresponding matrix) | |
| virtual const uint | dimY () const |
| Returns the size of the source space of the operator (number of columns of the corresponding matrix) | |
| iterator | end () |
| Iterator, standing behind last element. | |
| const_iterator | end () const |
| Constant iterator, standing behind last element. | |
| const Array< F > & | getData () const |
| Returns the data array. | |
| int | getIndex () const |
| bool | isTranspose () const |
| Returns true if the matrix is transposed. | |
| uint | m () const |
| Returns the number of rows. | |
| uint | n () const |
| Returns the number of columns. | |
| const uint | nofCols () const |
| Number of columns. | |
| const uint | nofRows () const |
| Number of rows. | |
| operator const F * () const | |
| Returns a pointer to the data array. | |
| operator F * () | |
| Returns a pointer to the data array. | |
| virtual void | operator() (const Function< c_type > &fncY, Function< c_type > &fncX) |
Application operator for complex function fncY. | |
| virtual F & | operator() (const uint i, const uint j) |
Returns and allows access to entry with indices i and j. | |
| virtual void | operator() (const Function< r_type > &fncY, Function< F > &fncX) |
Computes fncX = A(fncY) where A is this matrix. | |
| template<class H , class I > | |
| void | operator() (const Vector< H > &fncY, Vector< I > &fncX) |
| virtual F | operator() (const uint i, const uint j) const |
Returns entry with indices i and j. | |
| ElementMatrix< F > & | operator*= (const F n) |
| Scaling operator. | |
| virtual bool | operator== (const Matrix< F > &otherMat) const |
| void | resize (uint m, uint n) |
| Sets a new size. | |
| uint | row () const |
| Returns current row. | |
| void | setIndex (int i) |
| void | setTranspose (bool t) |
| uint | size () const |
| Returns the number of entries in the matrix. | |
| bool | storeMatlab (const std::string filename, std::string name="", bool append=false) const |
| Stores the matrix in a Matlab matrix. | |
| virtual void | transpMult (const Vector< c_type > &fncY, Vector< c_type > &fncX) |
| virtual void | transpMult (const Vector< r_type > &fncY, Vector< F > &fncX) |
Computes fncX = AT fncY where A is this matrix. | |
| bool | transpose () |
| Transposes the matrix. | |
| void | zeros () |
| Fills the matrix with zeros. | |
Static Public Member Functions | |
| template<class G > | |
| static void | assembly (Matrix< F > &dest, const Space< G > &spc, BilinearForm< F, G > &bf, const Real threshold=0.0) |
Assembly operator for dest using the bilinear form bf. | |
| template<class G > | |
| static void | assembly (Matrix< F > &dest, BilinearForm< F, G > &bf, const ElementPairList< G > &pairs) |
Assembly operator for dest using the bilinear form bf. | |
| template<class G > | |
| static void | assembly (Matrix< F > &dest, const Space< G > &spcX, const Space< G > &spcY, BilinearForm< F, G > &bf, const Real threshold=0.0) |
Assembly operator for dest using the bilinear form bf. | |
Timing Interface | |
These functions are used to get timings from class internal computations. The values are stored in a user defined concepts::InOutParameters structure in different arrays (see concepts::ResultsTable table; table.addMap(concepts::ResultsTable::DOUBLE, "jacobian", output); table.addMap(concepts::ResultsTable::DOUBLE, "whole_sumfact", output); std::ofstream ofs("table.gnuplot"); ofs << std::setprecision(20); table.print<concepts::ResultsTable::GNUPLOT>(ofs); | |
| static void | setTimings (InOutParameters *timings) |
| Sets the class to store the timing values in. | |
| static bool | timings () |
| Returns true if the class is able to do timings. | |
Protected Member Functions | |
| virtual std::ostream & | info (std::ostream &os) const |
Protected Attributes | |
| Array< F > | data_ |
| Data. | |
| uint | dimX_ |
| Dimension of image space and the source space. | |
| uint | dimY_ |
| uint | m_ |
| Number of rows. | |
| uint | n_ |
| Number of columns. | |
| bool | t_ |
| Transpose. | |
Dense matrix.
The matrix has the size
where m is the dimension of the image space (spaceX) and n is the dimension of the source space (spaceY).
The matrix is setup and assembled in the constructor. It calls the bilinear form on every element of the space and uses the T matrices of the elements to assemble the element matrices into the global matrix.
There are quite a few solver which can be used to solve the system.
Definition at line 39 of file denseMatrix.hh.
| typedef Cmplxtype<F>::type concepts::DenseMatrix< F >::c_type |
Real type of data type.
Reimplemented from concepts::Matrix< F >.
Definition at line 44 of file denseMatrix.hh.
typedef _Matrix_iterator<F, const F&, const F*> concepts::Matrix< F >::const_iterator [inherited] |
typedef _Matrix_iterator<F, F&, F*> concepts::Matrix< F >::iterator [inherited] |
| typedef Realtype<F>::type concepts::DenseMatrix< F >::r_type |
Real type of data type.
Reimplemented from concepts::Matrix< F >.
Definition at line 42 of file denseMatrix.hh.
typedef F concepts::Operator< F >::type [inherited] |
Type of data, e.g. matrix entries.
Reimplemented in concepts::AfterIteration< F >, and concepts::SubMatrixN< F >.
Definition at line 43 of file compositions.hh.
typedef F concepts::Matrix< F >::value_type [inherited] |
typedef F concepts::ElementMatrix< F >::value_type [inherited] |
Reimplemented from concepts::ElementMatrixBase< F >.
Definition at line 195 of file element.hh.
| concepts::DenseMatrix< F >::DenseMatrix | ( | const Space< G > & | spcX, |
| const Space< G > & | spcY, | ||
| BilinearForm< F, G > & | bf | ||
| ) |
Constructor.
Computes the global matrix by assembling the element matrices.
This constructor features a double loop over the elements of the image and the source space. On each combination, the bilinear form is called.
Using this constructor, if spcX != spcY or if you have local matrices which express the interaction of the two elements. You can force this constructor to execute the double loop in such a way that only for diagonal combinations of the elements in both space the integration and assembling is executed. Use single and set it to true.
In non-symmetric FEM (eg. DGFEM), one has to solve AT u = f. This constructor computes A and not AT.
| spcX | Image space |
| spcY | Source space |
| bf | Bilinear form |
| concepts::DenseMatrix< F >::DenseMatrix | ( | const Space< G > & | spc, |
| BilinearForm< F, G > & | bf | ||
| ) |
Constructor.
Computes the global matrix by assembling the element matrices.
This constructor features a single loop over the elements of the space. On each element, the bilinear form is called.
Use the constructor, if spcX == spcY and there is no special element interaction. This is the case for standard FEM.
| spc | Image and source space |
| bf | Bilinear form |
| concepts::DenseMatrix< F >::DenseMatrix | ( | const Space< G > & | spcX, |
| const Space< G > & | spcY | ||
| ) |
Constructor for an empty matrix.
| spcX | Image space |
| spcY | Source space |
| concepts::DenseMatrix< F >::DenseMatrix | ( | int | m, |
| int | n, | ||
| bool | transpose = false |
||
| ) | [inline] |
Constructor for an empty matrix.
| m | Number of rows |
| n | Number of columns |
| transpose | The matrix will be stored in transposed format |
Definition at line 100 of file denseMatrix.hh.
| concepts::DenseMatrix< F >::DenseMatrix | ( | const LiCo< F > & | L | ) |
Constructor.
Evaluates a linear combination and stores the result in the matrix.
| concepts::DenseMatrix< F >::DenseMatrix | ( | const Compose< F > & | L | ) |
Constructor.
Evaluates a composition and stores the result in the matrix.
| concepts::DenseMatrix< F >::DenseMatrix | ( | const DenseMatrix< F > & | m | ) |
Copy constructor.
| concepts::DenseMatrix< F >::DenseMatrix | ( | const Matrix< F > & | m, |
| bool | t = false |
||
| ) |
Copy constructor.
If t is set to true, the matrix is transposed during the copy process
| concepts::DenseMatrix< F >::DenseMatrix | ( | const Vector< F > & | v, |
| bool | t = false |
||
| ) |
Transformation constructor from a vector of length n.
If t is set to true, the matrix is a 1xn, otherwise nx1.
| void concepts::ElementMatrix< F >::add | ( | const ElementMatrix< F > & | A, |
| uint | offm = 0, |
||
| uint | offn = 0 |
||
| ) | [inherited] |
Addition of another element matrix with possible offset.
| void concepts::DenseMatrix< F >::addInto | ( | Matrix< T > & | dest, |
| const T | fact, | ||
| const uint | rowoffset = 0, |
||
| const uint | coloffset = 0 |
||
| ) | const [inline] |
allows to add a Real Matrix to a complex one.
Definition at line 157 of file denseMatrix.hh.
| void concepts::DenseMatrix< F >::addInto | ( | Matrix< F > & | dest, |
| const F | fact, | ||
| const uint | rowoffset = 0, |
||
| const uint | coloffset = 0 |
||
| ) | const |
This matrix is added into to the given matrix.
| dest | Matrix into which this matrix should be added. |
| fact | Factor by which this matrix should be multiplied. |
| void concepts::DenseMatrix< F >::addIntoT | ( | Matrix< T > & | dest, |
| const T | fact, | ||
| const uint | rowoffset = 0, |
||
| const uint | coloffset = 0 |
||
| ) | const [inline] |
allows to add a Real Matrix to a complex one.
Definition at line 173 of file denseMatrix.hh.
| static void concepts::Matrix< F >::assembly | ( | Matrix< F > & | dest, |
| const Space< G > & | spc, | ||
| BilinearForm< F, G > & | bf, | ||
| const Real | threshold = 0.0 |
||
| ) | [static, inherited] |
Assembly operator for dest using the bilinear form bf.
This assembly operator does not compute element matrices for two different elements. The elements are taken from the space spc.
| static void concepts::Matrix< F >::assembly | ( | Matrix< F > & | dest, |
| const Space< G > & | spcX, | ||
| const Space< G > & | spcY, | ||
| BilinearForm< F, G > & | bf, | ||
| const Real | threshold = 0.0 |
||
| ) | [static, inherited] |
Assembly operator for dest using the bilinear form bf.
This assembly operator computes also the element matrices for two different elements (coming from spcX and spcY).
| static void concepts::Matrix< F >::assembly | ( | Matrix< F > & | dest, |
| BilinearForm< F, G > & | bf, | ||
| const ElementPairList< G > & | pairs | ||
| ) | [static, inherited] |
Assembly operator for dest using the bilinear form bf.
This assembly operator uses the element pairs taken from pairs. For every two elements found in a ElementPair in pairs, the bilinear form is evaluated and the result assembled into dest.
| iterator concepts::Matrix< F >::begin | ( | uint | r = 0 | ) | [inline, inherited] |
Iterator over the elements, standing at position (r,0).
Might be implemented differently for derived classes.
Reimplemented in concepts::SparseMatrix< F >, concepts::SubMatrixN< F >, concepts::SparseMatrix< concepts::Real >, concepts::SparseMatrix< FX >, concepts::SparseMatrix< T >, concepts::SparseMatrix< Cmplx >, and concepts::SparseMatrix< Real >.
| const_iterator concepts::Matrix< F >::begin | ( | uint | r = 0 | ) | const [inline, inherited] |
Constant iterator over the elements, standing at position (r,0)
Might be implemented differently for derived classes.
Reimplemented in concepts::SparseMatrix< F >, concepts::SubMatrixN< F >, concepts::SparseMatrix< concepts::Real >, concepts::SparseMatrix< FX >, concepts::SparseMatrix< T >, concepts::SparseMatrix< Cmplx >, and concepts::SparseMatrix< Real >.
| uint concepts::ElementMatrix< F >::col | ( | ) | const [inline, inherited] |
Returns current column.
Definition at line 262 of file element.hh.
| void concepts::ElementMatrix< F >::compress | ( | const Real | threshold = EPS | ) | [inherited] |
Compresses the matrix by dropping small entries.
All matrix entries which are smaller than a certain threshold times the largest entry of the matrix are deleted from the matrix.
| virtual const uint concepts::Operator< F >::dimX | ( | ) | const [inline, virtual, inherited] |
Returns the size of the image space of the operator (number of rows of the corresponding matrix)
Definition at line 87 of file compositions.hh.
| virtual const uint concepts::Operator< F >::dimY | ( | ) | const [inline, virtual, inherited] |
Returns the size of the source space of the operator (number of columns of the corresponding matrix)
Definition at line 92 of file compositions.hh.
| const_iterator concepts::Matrix< F >::end | ( | ) | const [inline, inherited] |
Constant iterator, standing behind last element.
Reimplemented in concepts::SparseMatrix< F >, concepts::SubMatrixN< F >, concepts::SparseMatrix< concepts::Real >, concepts::SparseMatrix< FX >, concepts::SparseMatrix< T >, concepts::SparseMatrix< Cmplx >, and concepts::SparseMatrix< Real >.
| iterator concepts::Matrix< F >::end | ( | ) | [inline, inherited] |
| const Array<F>& concepts::ElementMatrixBase< F >::getData | ( | ) | const [inline, inherited] |
Returns the data array.
Definition at line 161 of file element.hh.
| int concepts::ElementMatrix< F >::getIndex | ( | ) | const [inline, inherited] |
Definition at line 242 of file element.hh.
| virtual std::ostream& concepts::DenseMatrix< F >::info | ( | std::ostream & | os | ) | const [protected, virtual] |
Reimplemented from concepts::ElementMatrix< F >.
| bool concepts::ElementMatrixBase< F >::isTranspose | ( | ) | const [inline, inherited] |
Returns true if the matrix is transposed.
Definition at line 164 of file element.hh.
| uint concepts::ElementMatrixBase< F >::m | ( | ) | const [inline, inherited] |
Returns the number of rows.
Definition at line 140 of file element.hh.
| uint concepts::ElementMatrixBase< F >::n | ( | ) | const [inline, inherited] |
Returns the number of columns.
Definition at line 142 of file element.hh.
| const uint concepts::Matrix< F >::nofCols | ( | ) | const [inline, inherited] |
| const uint concepts::Matrix< F >::nofRows | ( | ) | const [inline, inherited] |
| concepts::ElementMatrixBase< F >::operator const F * | ( | ) | const [inline, inherited] |
Returns a pointer to the data array.
Definition at line 158 of file element.hh.
| concepts::ElementMatrix< F >::operator F * | ( | ) | [inline, inherited] |
Returns a pointer to the data array.
Definition at line 251 of file element.hh.
| virtual void concepts::DenseMatrix< F >::operator() | ( | const Function< r_type > & | fncY, |
| Function< F > & | fncX | ||
| ) | [virtual] |
Computes fncX = A(fncY) where A is this matrix.
Implements concepts::Matrix< F >.
| virtual void concepts::DenseMatrix< F >::operator() | ( | const Function< c_type > & | fncY, |
| Function< c_type > & | fncX | ||
| ) | [virtual] |
Application operator for complex function fncY.
Computes fncX = A(fncY) where A is this operator. fncX becomes complex.
In derived classes its enough to implement the operator() for complex Operator's. If a real counterpart is not implemented, the function fncY is splitted into real and imaginary part and the application operator for real functions is called for each. Then the result is combined.
If in a derived class the operator() for complex Operator's is not implemented, a exception is thrown from here.
Implements concepts::Matrix< F >.
| virtual F concepts::DenseMatrix< F >::operator() | ( | const uint | i, |
| const uint | j | ||
| ) | const [inline, virtual] |
Returns entry with indices i and j.
Implements concepts::Matrix< F >.
Definition at line 140 of file denseMatrix.hh.
| void concepts::DenseMatrix< F >::operator() | ( | const Vector< H > & | fncY, |
| Vector< I > & | fncX | ||
| ) |
| virtual F& concepts::DenseMatrix< F >::operator() | ( | const uint | i, |
| const uint | j | ||
| ) | [inline, virtual] |
Returns and allows access to entry with indices i and j.
Implements concepts::Matrix< F >.
Definition at line 144 of file denseMatrix.hh.
| ElementMatrix<F>& concepts::ElementMatrix< F >::operator*= | ( | const F | n | ) | [inline, inherited] |
Scaling operator.
Definition at line 254 of file element.hh.
| virtual bool concepts::Matrix< F >::operator== | ( | const Matrix< F > & | otherMat | ) | const [inline, virtual, inherited] |
| void concepts::ElementMatrix< F >::resize | ( | uint | m, |
| uint | n | ||
| ) | [inherited] |
Sets a new size.
| uint concepts::ElementMatrix< F >::row | ( | ) | const [inline, inherited] |
Returns current row.
Definition at line 260 of file element.hh.
| void concepts::ElementMatrix< F >::setIndex | ( | int | i | ) | [inline, inherited] |
Definition at line 245 of file element.hh.
| static void concepts::Matrix< F >::setTimings | ( | InOutParameters * | timings | ) | [static, inherited] |
Sets the class to store the timing values in.
Additionally, the timeCntr_ is reset to 0. This counter is used to fill in the values into the arrays listed below in subsequent calls. The following timings are taken and stored in timings:
bilinear_form tmatrix_apply global_assembly | void concepts::ElementMatrix< F >::setTranspose | ( | bool | t | ) | [inline, inherited] |
Definition at line 239 of file element.hh.
| uint concepts::ElementMatrixBase< F >::size | ( | ) | const [inline, inherited] |
Returns the number of entries in the matrix.
Definition at line 155 of file element.hh.
| bool concepts::ElementMatrixBase< F >::storeMatlab | ( | const std::string | filename, |
| std::string | name = "", |
||
| bool | append = false |
||
| ) | const [inherited] |
Stores the matrix in a Matlab matrix.
| filename | name of the matlab file, with ending '.m' |
| name | name of the variable, e.g. "A" |
| append | if false, create new file, otherwise append to it |
| static bool concepts::Matrix< F >::timings | ( | ) | [static, inherited] |
Returns true if the class is able to do timings.
The ability to do timings depends on a compiler switch in matrix.cc file.
| virtual void concepts::DenseMatrix< F >::transpMult | ( | const Vector< r_type > & | fncY, |
| Vector< F > & | fncX | ||
| ) | [virtual] |
Computes fncX = AT fncY where A is this matrix.
Implements concepts::Matrix< F >.
| virtual void concepts::DenseMatrix< F >::transpMult | ( | const Vector< c_type > & | fncY, |
| Vector< c_type > & | fncX | ||
| ) | [virtual] |
Implements concepts::Matrix< F >.
| bool concepts::ElementMatrix< F >::transpose | ( | ) | [inline, inherited] |
Transposes the matrix.
Definition at line 237 of file element.hh.
| void concepts::ElementMatrix< F >::zeros | ( | ) | [inline, inherited] |
Fills the matrix with zeros.
Definition at line 248 of file element.hh.
Array<F> concepts::ElementMatrixBase< F >::data_ [protected, inherited] |
Data.
Definition at line 176 of file element.hh.
uint concepts::Operator< F >::dimX_ [protected, inherited] |
Dimension of image space and the source space.
Definition at line 96 of file compositions.hh.
uint concepts::Operator< F >::dimY_ [protected, inherited] |
Definition at line 96 of file compositions.hh.
uint concepts::ElementMatrixBase< F >::m_ [protected, inherited] |
Number of rows.
Definition at line 178 of file element.hh.
uint concepts::ElementMatrixBase< F >::n_ [protected, inherited] |
Number of columns.
Definition at line 180 of file element.hh.
bool concepts::ElementMatrixBase< F >::t_ [protected, inherited] |
Definition at line 182 of file element.hh.