#include <denseMatrix.hh>
Public Types | |
typedef Realtype< F >::type | r_type |
Real type of data type. | |
typedef Cmplxtype< F >::type | c_type |
Complex type of data type. | |
typedef std::conditional< std::is_same< typenameRealtype< F >::type, F >::value, typenameRealtype< F >::type, typenameCmplxtype< F >::type >::type | d_type |
Data type, depending if F is real or complex. | |
typedef F | value_type |
typedef _Matrix_iterator< F, F &, F * > | iterator |
typedef _Matrix_iterator< F, const F &, const F * > | const_iterator |
typedef F | type |
Type of data, e.g. matrix entries. | |
typedef F | value_type |
Public Member Functions | |
template<class G > | |
DenseMatrix (const Space< G > &spcX, const Space< G > &spcY, const BilinearForm< F, G > &bf, const bool single=true) | |
template<class G > | |
DenseMatrix (const Space< G > &spc, const BilinearForm< F, G > &bf) | |
template<class G > | |
DenseMatrix (const Space< G > &spc, const BilinearForm< F, G > &bf, const Sequence< ElementWithCell< G > * > &seq) | |
template<class G > | |
DenseMatrix (const Space< G > &spcX, const Space< G > &spcY) | |
DenseMatrix (int m=0, int n=0, bool transpose=false) | |
DenseMatrix (const LiCo< F > &L) | |
DenseMatrix (const Compose< F > &L) | |
DenseMatrix (const DenseMatrix< F > &m) | |
Copy constructor. | |
DenseMatrix (const Matrix< F > &m, bool t=false) | |
DenseMatrix (const Vector< F > &v, bool t=false) | |
virtual void | operator() (const Function< r_type > &fncY, Function< F > &fncX) |
Computes fncX = A(fncY ) where A is this matrix. | |
virtual void | operator() (const Function< c_type > &fncY, Function< c_type > &fncX) |
template<class H , class I > | |
void | operator() (const Vector< H > &fncY, Vector< I > &fncX) |
virtual void | transpMult (const Vector< r_type > &fncY, Vector< F > &fncX) |
Computes fncX = AT fncY where A is this matrix. | |
virtual void | transpMult (const Vector< c_type > &fncY, Vector< c_type > &fncX) |
virtual F | operator() (const uint i, const uint j) const |
Returns entry with indices i and j . | |
virtual F & | operator() (const uint i, const uint j) |
Returns and allows access to entry with indices i and j . | |
virtual DenseMatrix< F > & | operator= (const F &v) |
virtual void | resize (uint m, uint n) |
virtual void | setTranspose (bool t) |
void | addInto (Matrix< F > &dest, const F fact, const uint rowoffset=0, const uint coloffset=0) const |
template<class T > | |
void | addInto (Matrix< T > &dest, const T fact, const uint rowoffset=0, const uint coloffset=0) const |
template<class T > | |
void | addIntoT (Matrix< T > &dest, const T fact, const uint rowoffset=0, const uint coloffset=0) const |
const uint | nofRows () const |
Number of rows. | |
const uint | nofCols () const |
Number of columns. | |
iterator | begin (uint r=0) |
const_iterator | begin (uint r=0) const |
iterator | end () |
Iterator, standing behind last element. | |
const_iterator | end () const |
Constant iterator, standing behind last element. | |
virtual void | set (const uint i, const uint j, const F value, const bool use_threshold=false, const Real threshold_value=1e-8) |
virtual void | add (const uint i, const uint j, const F value, const bool use_threshold=false, const Real threshold_value=1e-8) |
virtual void | operator() () |
virtual bool | operator== (const Matrix< F > &otherMat) const |
virtual const uint | dimX () const |
virtual const uint | dimY () const |
virtual void | show_messages () |
void | add (const ElementMatrix< F > &A, uint offm=0, uint offn=0) |
Addition of another element matrix with possible offset. | |
template<uint dim> | |
void | writeColumn (uint col, const Point< F, dim > &val) |
Writes a vector to a column in case of m() >= dim. | |
void | writeColumn (uint col, const Array< F > &val) |
Writes an array to a column. | |
void | writeColumn (uint col, const F val) |
Writes a value to a column in case of m() >= 1. | |
bool | transpose () |
int | getIndex () const |
void | setIndex (int i) |
void | zeros () |
Fills the matrix with zeros. | |
operator F* () | |
Returns a pointer to the data array. | |
ElementMatrix< F > & | operator*= (const F n) |
Scaling operator. | |
uint | row () const |
Returns current row. | |
uint | col () const |
Returns current column. | |
void | compress (const Real threshold=EPS) |
uint | m () const |
Returns the number of rows. | |
uint | n () const |
Returns the number of columns. | |
uint | size () const |
Returns the number of entries in the matrix. | |
operator const F * () const | |
Returns a pointer to the data array. | |
const Array< F > & | getData () const |
Returns the data array | |
bool | isTranspose () const |
bool | storeMatlab (const std::string filename, std::string name="", bool append=false) const |
Static Public Member Functions | |
template<class G > | |
static void | assembly (Matrix< F > &dest, const Space< G > &spc, const BilinearForm< F, G > &bf, const Real threshold=0.0) |
template<class G > | |
static void | assembly (Matrix< F > &dest, Scan< Element< G > > *sc, const BilinearForm< F, G > &bf, const Real threshold=0.0) |
template<class G > | |
static void | assembly (Matrix< F > &dest, const Sequence< ElementWithCell< G > * > seq, const BilinearForm< F, G > &bf, const Real threshold=0.0) |
template<class G > | |
static void | assembly (Matrix< F > &dest, const Space< G > &spc, const Sequence< bool > &seq, const BilinearForm< F, G > &bf, const Real threshold=0.0) |
template<class G > | |
static void | assembly (Matrix< F > &dest, const Space< G > &spcX, const Space< G > &spcY, const BilinearForm< F, G > &bf, const Real threshold=0.0, const bool single=false) |
template<class G > | |
static void | assembly (Matrix< F > &dest, const Sequence< ElementWithCell< G > * > seqX, const Space< G > &spcY, const BilinearForm< F, G > &bf, const Real threshold=0.0) |
template<class G > | |
static void | assembly (Matrix< F > &dest, const BilinearForm< F, G > &bf, const ElementPairList< G > &pairs) |
template<class G > | |
static void | assembly (Matrix< F > &dest, const Space< G > &spcX, const Space< G > &spcY, const Sequence< bool > &seq, const BilinearForm< F, G > &bf, const Real threshold=0.0, const bool single=false) |
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 | |
static void | setTimings (InOutParameters *timings) |
static bool | timings () |
Protected Member Functions | |
virtual std::ostream & | info (std::ostream &os) const |
Returns information in an output stream. | |
Protected Attributes | |
uint | dimX_ |
Dimension of image space and the source space. | |
uint | dimY_ |
Array< F > | data_ |
Data. | |
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 44 of file denseMatrix.hh.
typedef Cmplxtype<F>::type concepts::DenseMatrix< F >::c_type |
Complex type of data type.
Definition at line 49 of file denseMatrix.hh.
|
inherited |
typedef std::conditional<std::is_same<typenameRealtype<F>::type,F>::value,typenameRealtype<F>::type,typenameCmplxtype<F>::type>::type concepts::DenseMatrix< F >::d_type |
Data type, depending if F is real or complex.
Definition at line 52 of file denseMatrix.hh.
|
inherited |
typedef Realtype<F>::type concepts::DenseMatrix< F >::r_type |
Real type of data type.
Definition at line 47 of file denseMatrix.hh.
|
inherited |
Type of data, e.g. matrix entries.
Definition at line 45 of file compositions.hh.
|
inherited |
|
inherited |
Definition at line 208 of file element.hh.
concepts::DenseMatrix< F >::DenseMatrix | ( | const Space< G > & | spcX, |
const Space< G > & | spcY, | ||
const BilinearForm< F, G > & | bf, | ||
const bool | single = true |
||
) |
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, |
const 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 > & | spc, |
const BilinearForm< F, G > & | bf, | ||
const Sequence< ElementWithCell< G > * > & | seq | ||
) |
Constructor. Computes the partial matrix by assembling the element matrices on a given subdomain
This constructor features a single loop over the elements of the sequence. On each element, the bilinear form is called.
spc | Image and source space |
bf | Bilinear form |
seq | Sequence of elements to take into account |
concepts::DenseMatrix< F >::DenseMatrix | ( | const Space< G > & | spcX, |
const Space< G > & | spcY | ||
) |
Constructor for an empty matrix.
spcX | Image space |
spcY | Source space |
|
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 121 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 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.
|
virtualinherited |
Addition operator Add the value to the entry (i,j) if not zero (for use_threshold
= false), or if the absolute avlue is bigger than the threshold_value
(for use_threshold
= true)
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. |
|
inline |
allows to add a Real Matrix to a complex one.
Definition at line 196 of file denseMatrix.hh.
|
inline |
allows to add a Real Matrix to a complex one.
Definition at line 212 of file denseMatrix.hh.
|
staticinherited |
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
.
|
staticinherited |
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 element sequence seq
.
|
staticinherited |
Assembly operator for dest
using the bilinear form bf
. This assembly operator computes also the element matrices for two different elements. The elements are taken from the element sequence seqX
for the test space, and the trial space spcY
is fully taken into account.
|
staticinherited |
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
.
|
staticinherited |
Assembly operator for dest
using the bilinear form bf
on space spc
. This assembly operator does not compute element matrices for two different elements. The elements are computing on the cells that are flagged by seq
.
|
staticinherited |
Assembly operator for dest
using the bilinear form bf
. This assembly operator computes also the element matrices for two different elements (coming from test space spcX
and trial space spcY
).
|
staticinherited |
Assembly operator for dest
using the bilinear form bf
. This assembly operator computes also the element matrices for two different elements (coming from test space spcX
and trial space spcY
). The elements are computing on the cells that are flagged by seq
.
|
staticinherited |
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 scanner sc
.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
Returns current column.
Definition at line 309 of file element.hh.
|
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.
|
inlinevirtualinherited |
Returns the size of the image space of the operator (number of rows of the corresponding matrix)
Definition at line 93 of file compositions.hh.
|
inlinevirtualinherited |
Returns the size of the source space of the operator (number of columns of the corresponding matrix)
Definition at line 98 of file compositions.hh.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
Returns the data array
Definition at line 172 of file element.hh.
|
inlineinherited |
Definition at line 289 of file element.hh.
|
protectedvirtual |
Returns information in an output stream.
Reimplemented from concepts::Operator< F >.
|
inlineinherited |
Returns true if the matrix is internally stored as transposed (column-major).
Definition at line 177 of file element.hh.
|
inlineinherited |
Returns the number of rows.
Definition at line 151 of file element.hh.
|
inlineinherited |
Returns the number of columns.
Definition at line 153 of file element.hh.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
Returns a pointer to the data array.
Definition at line 169 of file element.hh.
|
inlineinherited |
Returns a pointer to the data array.
Definition at line 298 of file element.hh.
|
virtualinherited |
Application operator without argument
Reimplemented in concepts::BelosSolver< T >, concepts::VecOperator< F >, concepts::VecOperator< Cmplx >, concepts::VecOperator< F::d_type >, concepts::VecOperator< Real >, and concepts::VecOperator< T >.
|
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 |
Computes fncX
= A(fncY
) where A is this matrix.
Implements concepts::Matrix< F >.
|
inlinevirtual |
Returns and allows access to entry with indices i
and j
.
Implements concepts::Matrix< F >.
Definition at line 165 of file denseMatrix.hh.
|
inlinevirtual |
Returns entry with indices i
and j
.
Implements concepts::Matrix< F >.
Definition at line 161 of file denseMatrix.hh.
void concepts::DenseMatrix< F >::operator() | ( | const Vector< H > & | fncY, |
Vector< I > & | fncX | ||
) |
Definition at line 231 of file denseMatrix.hh.
|
inlineinherited |
Scaling operator.
Definition at line 301 of file element.hh.
|
inlinevirtual |
Reimplemented from concepts::ElementMatrix< F >.
Definition at line 169 of file denseMatrix.hh.
|
inlinevirtualinherited |
Resize to m
rows and n
columns. Be aware that data might be lost.
Reimplemented from concepts::ElementMatrix< F >.
Definition at line 178 of file denseMatrix.hh.
|
inlineinherited |
Returns current row.
Definition at line 307 of file element.hh.
|
virtualinherited |
Affectation operator Affet the value to the entry (i,j) if not zero (for use_threshold
= false), or if the absolute value is bigger than the threshold_value
(for use_threshold
= true)
|
inlineinherited |
Definition at line 292 of file element.hh.
|
staticinherited |
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
|
inlinevirtual |
Definition at line 182 of file denseMatrix.hh.
|
inlinevirtualinherited |
Reimplemented in concepts::MumpsOverlap< F >.
Definition at line 100 of file compositions.hh.
|
inlineinherited |
Returns the number of entries in the matrix.
Definition at line 166 of file element.hh.
|
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 |
|
staticinherited |
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 |
Implements concepts::Matrix< F >.
|
virtual |
Computes fncX
= AT fncY
where A is this matrix.
Implements concepts::Matrix< F >.
|
inlineinherited |
Transposes the matrix.
Only the dimensions are interchanged, the data is not touched, but the internal storage changes from row-major two column-major order or vice-versa.
Definition at line 277 of file element.hh.
|
inherited |
Writes a vector to a column in case of m() >= dim.
Definition at line 326 of file element.hh.
|
inlineinherited |
Fills the matrix with zeros.
Definition at line 295 of file element.hh.
|
protectedinherited |
Data.
Definition at line 189 of file element.hh.
|
protectedinherited |
Dimension of image space and the source space.
Definition at line 104 of file compositions.hh.
|
protectedinherited |
Definition at line 104 of file compositions.hh.
|
protectedinherited |
Number of rows.
Definition at line 191 of file element.hh.
|
protectedinherited |
Number of columns.
Definition at line 193 of file element.hh.
|
protectedinherited |
Definition at line 195 of file element.hh.