Home | Doxygen Documentation | Tutorials | Developer Tools (restricted)

Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes
concepts::DiagonalMatrix< F > Class Template Reference

Diagonal matrix. More...

#include <diagonal.hh>

Inheritance diagram for concepts::DiagonalMatrix< F >:
Inheritance graph
[legend]
Collaboration diagram for concepts::DiagonalMatrix< F >:
Collaboration graph
[legend]

List of all members.

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

Public Member Functions

template<class H , class I >
void addInto (Matrix< H > &dest, const I fact)
 This matrix is added to the given matrix dest.
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)
 DiagonalMatrix (const Matrix< F > &matrix)
 Constructor.
 DiagonalMatrix (uint dim)
template<class G >
 DiagonalMatrix (const Space< G > &spc)
 Constructor. Creates a diagonal matrix with all entries set to 0.
template<class G >
 DiagonalMatrix (const Space< G > &spc, const Array< F > entries)
 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)
const_iterator end () const
 Constant iterator, standing behind last element.
iterator end ()
 Iterator, standing behind last element.
const uint nofCols () const
 Number of columns.
const uint nofRows () const
 Number of rows.
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) const
 Returns 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.
virtual F & operator() (const uint i, const uint j)
 Returns and allows access to entry with indices i and j.
DiagonalMatrix< F > & operator+= (const Matrix< F > &d)
 Addition operator.
DiagonalMatrix< F > & operator= (F c)
 Assignement operator.
virtual bool operator== (const Matrix< F > &otherMat) const
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 ~DiagonalMatrix ()

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 setTimings). These arrays can be grouped into a table for easier postprocessing with

    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
 Returns information in an output stream.

Protected Attributes

uint dimX_
 Dimension of image space and the source space.
uint dimY_

Private Member Functions

template<typename H , typename I >
void apply_ (const Function< H > &fncY, Function< I > &fncX)
template<typename H , typename I >
void applyT_ (const Vector< H > &fncY, Vector< I > &fncX)

Private Attributes

dummy_
 Dummy entry for the access to the off diagonal entries.
Array< F > entries_
 Diagonal entries of the matrix.

Detailed Description

template<typename F>
class concepts::DiagonalMatrix< F >

Diagonal matrix.

A diagonal matrix must be square. Any access to off diagonal entries does not lead to an error but is simply discarded.

Author:
Philipp Frauenfelder, 2002
See also:
DiagonalSolver

Definition at line 18 of file diagonal.hh.


Member Typedef Documentation

template<typename F>
typedef Cmplxtype<F>::type concepts::DiagonalMatrix< F >::c_type

Real type of data type.

Reimplemented from concepts::Matrix< F >.

Definition at line 23 of file diagonal.hh.

template<class F>
typedef _Matrix_iterator<F, const F&, const F*> concepts::Matrix< F >::const_iterator [inherited]
template<class F>
typedef _Matrix_iterator<F, F&, F*> concepts::Matrix< F >::iterator [inherited]
template<typename F>
typedef Realtype<F>::type concepts::DiagonalMatrix< F >::r_type

Real type of data type.

Reimplemented from concepts::Matrix< F >.

Definition at line 21 of file diagonal.hh.

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

template<class F>
typedef F concepts::Matrix< F >::value_type [inherited]

Definition at line 35 of file matrix.hh.


Constructor & Destructor Documentation

template<typename F>
template<class G >
concepts::DiagonalMatrix< F >::DiagonalMatrix ( const Space< G > &  spc)

Constructor. Creates a diagonal matrix with all entries set to 0.

template<typename F>
concepts::DiagonalMatrix< F >::DiagonalMatrix ( uint  dim)
template<typename F>
template<class G >
concepts::DiagonalMatrix< F >::DiagonalMatrix ( const Space< G > &  spc,
const Array< F >  entries 
)

Constructor.

Creates a diagonal matrix with entries on the diagonal.

template<typename F>
concepts::DiagonalMatrix< F >::DiagonalMatrix ( const Matrix< F > &  matrix)

Constructor.

Creates a diagonal matrix by taking the diagonal of matrix.

template<typename F>
virtual concepts::DiagonalMatrix< F >::~DiagonalMatrix ( ) [virtual]

Member Function Documentation

template<typename F >
template<class H , class I >
void concepts::DiagonalMatrix< F >::addInto ( Matrix< H > &  dest,
const I  fact 
)

This matrix is added to the given matrix dest.

Parameters:
destMatrix into which this matrix should be added.
factFactor by which this matrix should be multiplied.

Definition at line 109 of file diagonal.hh.

Here is the call graph for this function:

template<typename F >
template<typename H , typename I >
void concepts::DiagonalMatrix< F >::apply_ ( const Function< H > &  fncY,
Function< I > &  fncX 
) [private]

Definition at line 81 of file diagonal.hh.

Here is the call graph for this function:

template<typename F >
template<typename H , typename I >
void concepts::DiagonalMatrix< F >::applyT_ ( const Vector< H > &  fncY,
Vector< I > &  fncX 
) [private]

Definition at line 98 of file diagonal.hh.

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

Examples:
linearDG1d.cc.
template<class F>
template<class G >
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).

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

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

Definition at line 62 of file matrix.hh.

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

Definition at line 55 of file matrix.hh.

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

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

template<class F>
iterator concepts::Matrix< F >::end ( ) [inline, inherited]

Iterator, standing behind last element.

Definition at line 57 of file matrix.hh.

template<class F>
const_iterator concepts::Matrix< F >::end ( ) const [inline, inherited]
template<typename F>
virtual std::ostream& concepts::DiagonalMatrix< F >::info ( std::ostream &  os) const [protected, virtual]

Returns information in an output stream.

Reimplemented from concepts::Operator< F >.

template<class F>
const uint concepts::Matrix< F >::nofCols ( ) const [inline, inherited]

Number of columns.

Definition at line 49 of file matrix.hh.

template<class F>
const uint concepts::Matrix< F >::nofRows ( ) const [inline, inherited]

Number of rows.

Definition at line 47 of file matrix.hh.

template<typename F>
virtual void concepts::DiagonalMatrix< 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 >.

template<typename F>
virtual F& concepts::DiagonalMatrix< F >::operator() ( const uint  i,
const uint  j 
) [virtual]

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

Implements concepts::Matrix< F >.

template<typename F>
virtual void concepts::DiagonalMatrix< F >::operator() ( const Function< r_type > &  fncY,
Function< F > &  fncX 
) [virtual]

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

Implements concepts::Matrix< F >.

template<typename F>
virtual F concepts::DiagonalMatrix< F >::operator() ( const uint  i,
const uint  j 
) const [virtual]

Returns entry with indices i and j.

Implements concepts::Matrix< F >.

template<typename F>
DiagonalMatrix<F>& concepts::DiagonalMatrix< F >::operator+= ( const Matrix< F > &  d)

Addition operator.

template<typename F>
DiagonalMatrix<F>& concepts::DiagonalMatrix< F >::operator= ( c)

Assignement operator.

template<class F>
virtual bool concepts::Matrix< F >::operator== ( const Matrix< F > &  otherMat) const [inline, virtual, inherited]

Definition at line 103 of file matrix.hh.

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

  • evaluation of bilinear form in bilinear_form
  • application of T matrix in tmatrix_apply
  • assembling into global matrix in global_assembly
template<class F>
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.

template<typename F>
virtual void concepts::DiagonalMatrix< F >::transpMult ( const Vector< r_type > &  fncY,
Vector< F > &  fncX 
) [virtual]

Computes fncX = AT fncY where A is this matrix.

Implements concepts::Matrix< F >.

template<typename F>
virtual void concepts::DiagonalMatrix< F >::transpMult ( const Vector< c_type > &  fncY,
Vector< c_type > &  fncX 
) [virtual]

Implements concepts::Matrix< F >.


Member Data Documentation

template<class F>
uint concepts::Operator< F >::dimX_ [protected, inherited]

Dimension of image space and the source space.

Definition at line 96 of file compositions.hh.

template<class F>
uint concepts::Operator< F >::dimY_ [protected, inherited]

Definition at line 96 of file compositions.hh.

template<typename F>
F concepts::DiagonalMatrix< F >::dummy_ [private]

Dummy entry for the access to the off diagonal entries.

Definition at line 70 of file diagonal.hh.

template<typename F>
Array<F> concepts::DiagonalMatrix< F >::entries_ [private]

Diagonal entries of the matrix.

Definition at line 68 of file diagonal.hh.


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

Home | Doxygen Documentation | Tutorials | Developer Tools (restricted)