Class documentation of Concepts

Loading...
Searching...
No Matches

#include <submatrix.hh>

Inheritance diagram for concepts::SubMatrixN< F >:
concepts::Matrix< F::type > concepts::CRSConvertable< F::type > concepts::Operator< F > concepts::OutputOperator

Public Types

typedef F::type type
 
typedef Realtype< type >::type r_type
 Real type of data type.
 
typedef Cmplxtype< type >::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 _SubMatrix_iterator< F, type &, type * > iterator
 
typedef _SubMatrix_iterator< F, const type &, const type * > const_iterator
 
typedefvalue_type
 

Public Member Functions

 SubMatrixN (F &m, const Set< IndexRange > &indicesX, const Set< IndexRange > &indicesY)
 Constructor.
 
 SubMatrixN ()
 Standard constructor.
 
virtual void operator() (const Function< r_type > &fncY, Function< type > &fncX)
 
virtual void operator() (const Function< c_type > &fncY, Function< c_type > &fncX)
 
virtual void transpMult (const Vector< r_type > &fncY, Vector< type > &fncX)
 
virtual void transpMult (const Vector< c_type > &fncY, Vector< c_type > &fncX)
 
template<class H , class I >
void multiply (const H &fact, I &dest) const
 
virtual type operator() (const uint i, const uint j) const
 Index operator.
 
virtual type & operator() (const uint i, const uint j)
 Returns and allows access to entry with indices i and j.
 
iterator begin (uint r=0)
 Iterator over the elements, standing at position (0,0)
 
const_iterator begin (uint r=0) const
 Constant iterator over the elements, standing at position (0,0)
 
const_iterator end () const
 Constant iterator, standing behind last element.
 
uint used () const
 
virtual void convertCRS (type *a, int *asub, int *xa) const
 Converts sub matrix to CRS format.
 
virtual void convertCCS (type *a, int *asub, int *xa) const
 Converts sub matrix to CCS format.
 
virtual void convertIJK (type *, int *, int *) const
 Converts sub matrix to IJK format.
 
template<class H , class I >
void addInto (Matrix< H > &dest, const I fact, const uint rowoffset=0, const uint coloffset=0) const
 
const Set< IndexRange > & indicesX () const
 Returns index range for the rows.
 
const Set< IndexRange > & indicesY () const
 Returns index range for the columns.
 
F & matrix ()
 Matrix, which the sub matrix is based on.
 
const F & matrix () const
 
const uint nofRows () const
 Number of rows.
 
const uint nofCols () const
 Number of columns.
 
iterator end ()
 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() (const Function< r_type > &fncY, Function< F > &fncX)=0
 Computes fncX = A(fncY) where A is this matrix.
 
virtual void operator() ()
 
virtual bool operator== (const Matrix< F > &otherMat) const
 
virtual void transpMult (const Vector< r_type > &fncY, Vector< F > &fncX)=0
 Computes fncX = AT fncY where A is this matrix.
 
virtual const uint dimX () const
 
virtual const uint dimY () const
 
virtual void show_messages ()
 
virtual void convertCRS (F *a, int *asub, int *xa) const=0
 
virtual void convertCCS (F *a, int *asub, int *xa) const=0
 
virtual void convertIJK (F *a, int *irn, int *jcn) const=0
 

Static Public Member Functions

static void assembly (Matrix< F > &dest, const Space< G > &spc, const BilinearForm< F, G > &bf, const Real threshold=0.0)
 
static void assembly (Matrix< F > &dest, Scan< Element< G > > *sc, const BilinearForm< F, G > &bf, const Real threshold=0.0)
 
static void assembly (Matrix< F > &dest, const Sequence< ElementWithCell< G > * > seq, const BilinearForm< F, G > &bf, const Real threshold=0.0)
 
static void assembly (Matrix< F > &dest, const Space< G > &spc, const Sequence< bool > &seq, const BilinearForm< F, G > &bf, const Real threshold=0.0)
 
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)
 
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)
 
static void assembly (Matrix< F > &dest, const BilinearForm< F, G > &bf, const ElementPairList< G > &pairs)
 
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 setTimings). These arrays can be grouped into a table for easier postprocessing with

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);
Set< F > makeSet(uint n, const F &first,...)
Definition set.hh:320
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

const Set< IndexRangeindicesX_
 Index sets of sub matrix.
 
const Set< IndexRangeindicesY_
 
uint dimX_
 Dimension of image space and the source space.
 
uint dimY_
 

Detailed Description

template<class F>
class concepts::SubMatrixN< F >

Abstract class for an operator, which is a sub matrix of another matrix.

Author
Kersten Schmidt, 2005
Parameters
Ftype of matrix

Definition at line 40 of file submatrix.hh.

Member Typedef Documentation

◆ c_type

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

Complex type of data type.

Definition at line 47 of file submatrix.hh.

◆ const_iterator

template<class F >
typedef _SubMatrix_iterator<F, const type&, const type*> concepts::SubMatrixN< F >::const_iterator

Definition at line 53 of file submatrix.hh.

◆ d_type

template<class F >
typedef std::conditional<std::is_same<typenameRealtype<F>::type,F>::value,typenameRealtype<F>::type,typenameCmplxtype<F>::type>::type concepts::SubMatrixN< F >::d_type

Data type, depending if F is real or complex.

Definition at line 50 of file submatrix.hh.

◆ iterator

template<class F >
typedef _SubMatrix_iterator<F, type&, type*> concepts::SubMatrixN< F >::iterator

Definition at line 52 of file submatrix.hh.

◆ r_type

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

Real type of data type.

Definition at line 45 of file submatrix.hh.

◆ type

template<class F >
typedef F::type concepts::SubMatrixN< F >::type

Definition at line 43 of file submatrix.hh.

◆ value_type

typedef F concepts::Matrix< F >::value_type
inherited

Definition at line 41 of file matrix.hh.

Constructor & Destructor Documentation

◆ ~SubMatrixN()

template<class F >
virtual concepts::SubMatrixN< F >::~SubMatrixN ( )
inlinevirtual

Definition at line 62 of file submatrix.hh.

Member Function Documentation

◆ add()

virtual void concepts::Matrix< F >::add ( const uint  i,
const uint  j,
const F  value,
const bool  use_threshold = false,
const Real  threshold_value = 1e-8 
)
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)

◆ addInto()

template<class F >
template<class H , class I >
void concepts::SubMatrixN< F >::addInto ( Matrix< H > &  dest,
const I  fact,
const uint  rowoffset = 0,
const uint  coloffset = 0 
) const

This matrix is added as block into to the given matrix.

Parameters
destMatrix into which this matrix should be added.
factFactor by which this matrix should be multiplied.
rowoffsetRow in dest, where block begins.
coloffsetColumn in dest, where block begins.

Definition at line 134 of file submatrix.hh.

◆ assembly() [1/8]

static void concepts::Matrix< F >::assembly ( Matrix< F > &  dest,
const BilinearForm< F, G > &  bf,
const ElementPairList< G > &  pairs 
)
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.

◆ assembly() [2/8]

static void concepts::Matrix< F >::assembly ( Matrix< F > &  dest,
const Sequence< ElementWithCell< G > * >  seq,
const BilinearForm< F, G > &  bf,
const Real  threshold = 0.0 
)
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.

◆ assembly() [3/8]

static void concepts::Matrix< F >::assembly ( Matrix< F > &  dest,
const Sequence< ElementWithCell< G > * >  seqX,
const Space< G > &  spcY,
const BilinearForm< F, G > &  bf,
const Real  threshold = 0.0 
)
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.

◆ assembly() [4/8]

static void concepts::Matrix< F >::assembly ( Matrix< F > &  dest,
const Space< G > &  spc,
const BilinearForm< F, G > &  bf,
const Real  threshold = 0.0 
)
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.

◆ assembly() [5/8]

static void concepts::Matrix< F >::assembly ( Matrix< F > &  dest,
const Space< G > &  spc,
const Sequence< bool > &  seq,
const BilinearForm< F, G > &  bf,
const Real  threshold = 0.0 
)
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.

◆ assembly() [6/8]

static void concepts::Matrix< F >::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 
)
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).

◆ assembly() [7/8]

static void concepts::Matrix< F >::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 
)
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.

◆ assembly() [8/8]

static void concepts::Matrix< F >::assembly ( Matrix< F > &  dest,
Scan< Element< G > > *  sc,
const BilinearForm< F, G > &  bf,
const Real  threshold = 0.0 
)
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.

◆ convertCCS()

virtual void concepts::CRSConvertable< F >::convertCCS ( F *  a,
int *  asub,
int *  xa 
) const
pure virtualinherited

Converts to Compressed Column Storage (CCS) format and writes values to field a, the row number asub and the index of the first value of each column xa. The fields have to be allocated with enough memory.

◆ convertCRS()

virtual void concepts::CRSConvertable< F >::convertCRS ( F *  a,
int *  asub,
int *  xa 
) const
pure virtualinherited

Converts to Compressed Row Storage (CRS) format and writes values to field a, the column number asub and the index of the first value of each row xa. The fields have to be allocated with enough memory.

◆ convertIJK()

virtual void concepts::CRSConvertable< F >::convertIJK ( F *  a,
int *  irn,
int *  jcn 
) const
pure virtualinherited

Convert to coordinate (COO) format and writes values to field a, the row indices to irn and the column indices to jcn. The fields have to be allocated with enough memory.

◆ dimX()

template<class F >
virtual const uint concepts::Operator< F >::dimX ( ) const
inlinevirtualinherited

Returns the size of the image space of the operator (number of rows of the corresponding matrix)

Examples
hpFEM2d-simple.cc, hpFEM2d.cc, and matfileTutorial.cc.

Definition at line 93 of file compositions.hh.

◆ dimY()

template<class F >
virtual const uint concepts::Operator< F >::dimY ( ) const
inlinevirtualinherited

Returns the size of the source space of the operator (number of columns of the corresponding matrix)

Examples
matfileTutorial.cc.

Definition at line 98 of file compositions.hh.

◆ end()

iterator concepts::Matrix< F >::end ( )
inlineinherited

Iterator, standing behind last element.

Definition at line 66 of file matrix.hh.

◆ indicesX()

template<class F >
const Set< IndexRange > & concepts::SubMatrixN< F >::indicesX ( ) const
inline

Returns index range for the rows.

Definition at line 116 of file submatrix.hh.

◆ indicesY()

template<class F >
const Set< IndexRange > & concepts::SubMatrixN< F >::indicesY ( ) const
inline

Returns index range for the columns.

Definition at line 118 of file submatrix.hh.

◆ info()

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

Returns information in an output stream.

Reimplemented from concepts::Operator< F >.

◆ matrix() [1/2]

template<class F >
F & concepts::SubMatrixN< F >::matrix ( )
inline

Matrix, which the sub matrix is based on.

Definition at line 121 of file submatrix.hh.

◆ matrix() [2/2]

template<class F >
const F & concepts::SubMatrixN< F >::matrix ( ) const
inline

Definition at line 122 of file submatrix.hh.

◆ multiply()

template<class F >
template<class H , class I >
void concepts::SubMatrixN< F >::multiply ( const H &  fact,
I dest 
) const
inline

Definition at line 75 of file submatrix.hh.

◆ nofCols()

const uint concepts::Matrix< F >::nofCols ( ) const
inlineinherited

Number of columns.

Definition at line 58 of file matrix.hh.

◆ nofRows()

const uint concepts::Matrix< F >::nofRows ( ) const
inlineinherited

Number of rows.

Definition at line 56 of file matrix.hh.

◆ operator()() [1/5]

◆ operator()() [2/5]

template<class F >
virtual void concepts::SubMatrixN< 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::type >.

◆ operator()() [3/5]

virtual void concepts::Matrix< F >::operator() ( const Function< r_type > &  fncY,
Function< F > &  fncX 
)
pure virtualinherited

Computes fncX = A(fncY) where A is this matrix.

Reimplemented from concepts::Operator< F >.

◆ operator()() [4/5]

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

Returns and allows access to entry with indices i and j.

Implements concepts::Matrix< F::type >.

◆ operator()() [5/5]

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

Index operator.

Implements concepts::Matrix< F::type >.

◆ operator==()

virtual bool concepts::Matrix< F >::operator== ( const Matrix< F > &  otherMat) const
inlinevirtualinherited

Definition at line 179 of file matrix.hh.

◆ set()

virtual void concepts::Matrix< F >::set ( const uint  i,
const uint  j,
const F  value,
const bool  use_threshold = false,
const Real  threshold_value = 1e-8 
)
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)

◆ setTimings()

static void concepts::Matrix< F >::setTimings ( InOutParameters timings)
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:

  • evaluation of bilinear form in bilinear_form
  • application of T matrix in tmatrix_apply
  • assembling into global matrix in global_assembly

◆ show_messages()

template<class F >
virtual void concepts::Operator< F >::show_messages ( )
inlinevirtualinherited

Reimplemented in concepts::MumpsOverlap< F >.

Definition at line 100 of file compositions.hh.

◆ timings()

static bool concepts::Matrix< F >::timings ( )
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.

◆ transpMult()

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

◆ used()

template<class F >
uint concepts::SubMatrixN< F >::used ( ) const
virtual

Number of elements in the sub matrix.

The sub matrix will be travers with an iterator and the number of elements are count. That's interesting for a sparse sub matrix.

Implements concepts::CRSConvertable< F::type >.

Member Data Documentation

◆ dimX_

template<class F >
uint concepts::Operator< F >::dimX_
protectedinherited

Dimension of image space and the source space.

Definition at line 104 of file compositions.hh.

◆ dimY_

template<class F >
uint concepts::Operator< F >::dimY_
protectedinherited

Definition at line 104 of file compositions.hh.

◆ indicesX_

template<class F >
const Set<IndexRange> concepts::SubMatrixN< F >::indicesX_
protected

Index sets of sub matrix.

Definition at line 126 of file submatrix.hh.

◆ indicesY_

template<class F >
const Set<IndexRange> concepts::SubMatrixN< F >::indicesY_
protected

Definition at line 126 of file submatrix.hh.


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