concepts::DenseMatrix< F > Class Template Reference

Dense matrix. More...

#include <compositions.hh>

Public Types

typedef Cmplxtype< F >::type c_type
 Complex type of data type. More...
 
typedef std::conditional< std::is_same< typename Realtype< F >::type, F >::value, typename Realtype< F >::type, typename Cmplxtype< F >::type >::type d_type
 Data type, depending if F is real or complex. More...
 
typedef Realtype< F >::type r_type
 Real type of data type. More...
 

Public Member Functions

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. More...
 
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. More...
 
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. More...
 
 DenseMatrix (const Compose< F > &L)
 Constructor. More...
 
 DenseMatrix (const DenseMatrix< F > &m)
 Copy constructor. More...
 
 DenseMatrix (const LiCo< F > &L)
 Constructor. More...
 
 DenseMatrix (const Matrix< F > &m, bool t=false)
 Copy constructor. More...
 
template<class G >
 DenseMatrix (const Space< G > &spc, const BilinearForm< F, G > &bf)
 Constructor. More...
 
template<class G >
 DenseMatrix (const Space< G > &spc, const BilinearForm< F, G > &bf, const Sequence< ElementWithCell< G > * > &seq)
 Constructor. More...
 
template<class G >
 DenseMatrix (const Space< G > &spcX, const Space< G > &spcY)
 Constructor for an empty matrix. More...
 
template<class G >
 DenseMatrix (const Space< G > &spcX, const Space< G > &spcY, const BilinearForm< F, G > &bf, const bool single=true)
 Constructor. More...
 
 DenseMatrix (const Vector< F > &v, bool t=false)
 Transformation constructor from a vector of length n. More...
 
 DenseMatrix (int m=0, int n=0, bool transpose=false)
 Constructor for an empty matrix. More...
 
virtual void operator() (const Function< c_type > &fncY, Function< c_type > &fncX)
 
virtual void operator() (const Function< r_type > &fncY, Function< F > &fncX)
 
virtual F & operator() (const uint i, const uint j)
 
virtual F operator() (const uint i, const uint j) const
 
template<class H , class I >
void operator() (const Vector< H > &fncY, Vector< I > &fncX)
 
virtual DenseMatrix< F > & operator= (const F &v)
 
virtual void resize (uint m, uint n)
 Resize to m rows and n columns. More...
 
virtual void setTranspose (bool t)
 
virtual void transpMult (const Vector< c_type > &fncY, Vector< c_type > &fncX)
 
virtual void transpMult (const Vector< r_type > &fncY, Vector< F > &fncX)
 

Protected Member Functions

virtual std::ostream & info (std::ostream &os) const
 

Detailed Description

template<class F>
class concepts::DenseMatrix< F >

Dense matrix.

The matrix has the size $m \times n$ 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.

See also
TMatrixBase
CG
GMRes
Examples
hpFEM2d.cc, and matfileTutorial.cc.

Definition at line 28 of file compositions.hh.

Member Typedef Documentation

◆ c_type

template<class F >
typedef Cmplxtype<F>::type concepts::DenseMatrix< F >::c_type

Complex type of data type.

Definition at line 49 of file denseMatrix.hh.

◆ d_type

template<class F >
typedef std::conditional<std::is_same<typename Realtype<F>::type, F>::value , typename Realtype<F>::type, typename Cmplxtype<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.

◆ r_type

template<class F >
typedef Realtype<F>::type concepts::DenseMatrix< F >::r_type

Real type of data type.

Definition at line 47 of file denseMatrix.hh.

Constructor & Destructor Documentation

◆ DenseMatrix() [1/10]

template<class F >
template<class G >
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.

Parameters
spcXImage space
spcYSource space
bfBilinear form

◆ DenseMatrix() [2/10]

template<class F >
template<class G >
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.

Parameters
spcImage and source space
bfBilinear form

◆ DenseMatrix() [3/10]

template<class F >
template<class G >
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.

Parameters
spcImage and source space
bfBilinear form
seqSequence of elements to take into account

◆ DenseMatrix() [4/10]

template<class F >
template<class G >
concepts::DenseMatrix< F >::DenseMatrix ( const Space< G > &  spcX,
const Space< G > &  spcY 
)

Constructor for an empty matrix.

Parameters
spcXImage space
spcYSource space

◆ DenseMatrix() [5/10]

template<class F >
concepts::DenseMatrix< F >::DenseMatrix ( int  m = 0,
int  n = 0,
bool  transpose = false 
)
inline

Constructor for an empty matrix.

Parameters
mNumber of rows
nNumber of columns
transposeThe matrix will be stored in transposed format

Definition at line 121 of file denseMatrix.hh.

◆ DenseMatrix() [6/10]

template<class F >
concepts::DenseMatrix< F >::DenseMatrix ( const LiCo< F > &  L)

Constructor.

Evaluates a linear combination and stores the result in the matrix.

◆ DenseMatrix() [7/10]

template<class F >
concepts::DenseMatrix< F >::DenseMatrix ( const Compose< F > &  L)

Constructor.

Evaluates a composition and stores the result in the matrix.

◆ DenseMatrix() [8/10]

template<class F >
concepts::DenseMatrix< F >::DenseMatrix ( const DenseMatrix< F > &  m)

Copy constructor.

◆ DenseMatrix() [9/10]

template<class F >
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

◆ DenseMatrix() [10/10]

template<class F >
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.

Member Function Documentation

◆ addInto() [1/2]

template<class F >
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.

Parameters
destMatrix into which this matrix should be added.
factFactor by which this matrix should be multiplied.
Examples
hpFEM2d.cc.

◆ addInto() [2/2]

template<class F >
template<class T >
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 196 of file denseMatrix.hh.

◆ addIntoT()

template<class F >
template<class T >
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 212 of file denseMatrix.hh.

◆ info()

template<class F >
virtual std::ostream& concepts::DenseMatrix< F >::info ( std::ostream &  os) const
protectedvirtual

◆ operator()() [1/5]

template<class F >
virtual void concepts::DenseMatrix< F >::operator() ( const Function< c_type > &  fncY,
Function< c_type > &  fncX 
)
virtual

◆ operator()() [2/5]

template<class F >
virtual void concepts::DenseMatrix< F >::operator() ( const Function< r_type > &  fncY,
Function< F > &  fncX 
)
virtual

◆ operator()() [3/5]

template<class F >
virtual F& concepts::DenseMatrix< F >::operator() ( const uint  i,
const uint  j 
)
inlinevirtual

Definition at line 165 of file denseMatrix.hh.

◆ operator()() [4/5]

template<class F >
virtual F concepts::DenseMatrix< F >::operator() ( const uint  i,
const uint  j 
) const
inlinevirtual

Definition at line 161 of file denseMatrix.hh.

◆ operator()() [5/5]

template<class F >
template<class H , class I >
void concepts::DenseMatrix< F >::operator() ( const Vector< H > &  fncY,
Vector< I > &  fncX 
)

Definition at line 231 of file denseMatrix.hh.

◆ operator=()

template<class F >
virtual DenseMatrix<F>& concepts::DenseMatrix< F >::operator= ( const F &  v)
inlinevirtual

Definition at line 169 of file denseMatrix.hh.

◆ resize()

template<class F >
virtual void concepts::DenseMatrix< F >::resize ( uint  m,
uint  n 
)
inlinevirtual

Resize to m rows and n columns.

Be aware that data might be lost.

Definition at line 178 of file denseMatrix.hh.

◆ setTranspose()

template<class F >
virtual void concepts::DenseMatrix< F >::setTranspose ( bool  t)
inlinevirtual

Definition at line 182 of file denseMatrix.hh.

◆ transpMult() [1/2]

template<class F >
virtual void concepts::DenseMatrix< F >::transpMult ( const Vector< c_type > &  fncY,
Vector< c_type > &  fncX 
)
virtual

◆ transpMult() [2/2]

template<class F >
virtual void concepts::DenseMatrix< F >::transpMult ( const Vector< r_type > &  fncY,
Vector< F > &  fncX 
)
virtual

The documentation for this class was generated from the following files:
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich