concepts::TMatrix< F > Class Template Reference

A T matrix in sparse notation. More...

#include <edgeTest.hh>

Inheritance diagram for concepts::TMatrix< F >:
concepts::TMatrixBlock< F >

Classes

struct  Control
 The column header: column index and length of the column data. More...
 
struct  Data
 The matrix entries: row index and data. More...
 

Public Member Functions

void append (TColumn< F > *T)
 Appends the columns to the matrix. More...
 
void applyOne (const ElementMatrix< F > &A, ElementMatrix< F > &B) const
 
TColumn< F > * columns () const
 
const TMatrix::Controlcontrol (uint i) const
 Returns the ith entry of the control data array. More...
 
const TMatrix::Datadata (uint i) const
 Returns the ith entry of the data array. More...
 
virtual void extract (const concepts::Vector< F > &solution, concepts::Array< F > &coeff) const
 
virtual void extract (const concepts::Vector<::std::complex< F > > &solution, concepts::Array<::std::complex< F > > &coeff) const
 
void extractOne (const concepts::Vector< F > &solution, concepts::Array< F > &coeff) const
 
virtual uint index (const uint i) const
 Mapping of the column index to the global degree of freedom. More...
 
uint nEntries () const
 number of entries in the data vector More...
 
void operator() (const ElementMatrix< F > &A, ElementMatrix< F > &B) const
 Application operator. More...
 
void operator() (const ElementMatrix<::std::complex< F > > &A, ElementMatrix<::std::complex< F > > &B) const
 
void operator() (const Vector< F > &A, Vector< F > &B) const
 
::std::ostream & outputLocalMap (::std::ostream &os) const
 
 TMatrix (const TMatrix< F > &T, Set< uint > *idx=0)
 Copy-Constructor. More...
 
template<class G >
 TMatrix (const TMatrix< G > &T)
 to "upcast" TMatrix<Real> to TMatrix<Cmplx> More...
 
 TMatrix (TColumn< F > *T)
 Constructor. More...
 
virtual void usedIdx (Set< uint > &c) const
 
virtual void usedIdx (TColumn< bool > &c) const
 
virtual ~TMatrix ()
 

Protected Member Functions

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

Private Attributes

Array< Controlctrl_
 Control data array (column header: column index and length of the column data) More...
 
Array< Datadata_
 Data array (matrix entries: row index and data) More...
 
uint sz_
 Size of the stored data. More...
 

Detailed Description

template<class F>
class concepts::TMatrix< F >

A T matrix in sparse notation.

All non-zero matrix entries are stored in one big array together with their row index. Another array of the same size stores the column indices and the length of each column in the array (not the real length).

The columns of the matrix are TColumn.

See also
TColumn the columns of the matrix.

Definition at line 17 of file edgeTest.hh.

Constructor & Destructor Documentation

◆ TMatrix() [1/3]

template<class F >
concepts::TMatrix< F >::TMatrix ( TColumn< F > *  T)

Constructor.

The size of the matrix is initially set to 0.

Parameters
Ta linked list of columns (in full notation) to be initially stored.

◆ TMatrix() [2/3]

template<class F >
concepts::TMatrix< F >::TMatrix ( const TMatrix< F > &  T,
Set< uint > *  idx = 0 
)

Copy-Constructor.

Takes only the local indices in idx.

◆ ~TMatrix()

template<class F >
virtual concepts::TMatrix< F >::~TMatrix ( )
virtual

◆ TMatrix() [3/3]

template<class F >
template<class G >
concepts::TMatrix< F >::TMatrix ( const TMatrix< G > &  T)

to "upcast" TMatrix<Real> to TMatrix<Cmplx>

Definition at line 645 of file tmatrix.hh.

Member Function Documentation

◆ append()

template<class F >
void concepts::TMatrix< F >::append ( TColumn< F > *  T)

Appends the columns to the matrix.

n_ is updated to reflect the real size of the matrix. m_ is updated to show the number of columns which are stored. The columns are scanned and the needed space is allocated. Then the new data is stored.

Parameters
Ta linked list of columns (in full notation) to be stored.

◆ applyOne()

template<class F >
void concepts::TMatrix< F >::applyOne ( const ElementMatrix< F > &  A,
ElementMatrix< F > &  B 
) const

◆ columns()

template<class F >
TColumn<F>* concepts::TMatrix< F >::columns ( ) const

◆ control()

template<class F >
const TMatrix::Control* concepts::TMatrix< F >::control ( uint  i) const
inline

Returns the ith entry of the control data array.

Parameters
ia colum index, i.e. i < n()

Definition at line 601 of file tmatrix.hh.

◆ data()

template<class F >
const TMatrix::Data* concepts::TMatrix< F >::data ( uint  i) const
inline

Returns the ith entry of the data array.

Definition at line 604 of file tmatrix.hh.

◆ extract() [1/2]

template<class F >
virtual void concepts::TMatrix< F >::extract ( const concepts::Vector< F > &  solution,
concepts::Array< F > &  coeff 
) const
virtual

Reimplemented in concepts::TMatrixBlock< F >.

◆ extract() [2/2]

template<class F >
virtual void concepts::TMatrix< F >::extract ( const concepts::Vector<::std::complex< F > > &  solution,
concepts::Array<::std::complex< F > > &  coeff 
) const
virtual

Reimplemented in concepts::TMatrixBlock< F >.

◆ extractOne()

template<class F >
void concepts::TMatrix< F >::extractOne ( const concepts::Vector< F > &  solution,
concepts::Array< F > &  coeff 
) const

◆ index()

template<class F >
virtual uint concepts::TMatrix< F >::index ( const uint  i) const
inlinevirtual

Mapping of the column index to the global degree of freedom.

Remember: the columns represent the global degrees of freedom to which the shape functions of this element contribute.

More technical: the columns of a TMatrix contain the column index in Control::idx and the relevant data in TMatrix::Data but the number of columns stored in TMatrixBase::n_ does not reflect the global number of degrees of freedom. Therefore, there might be empty columns and TMatrixBase::n_ could be lower than the global number of degrees of freedom.

Definition at line 587 of file tmatrix.hh.

◆ info()

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

◆ nEntries()

template<class F >
uint concepts::TMatrix< F >::nEntries ( ) const
inline

number of entries in the data vector

Definition at line 610 of file tmatrix.hh.

◆ operator()() [1/3]

template<class F >
void concepts::TMatrix< F >::operator() ( const ElementMatrix< F > &  A,
ElementMatrix< F > &  B 
) const

Application operator.

Computes the application of the T matrix on A and returns B: $B = A \cdot T$. The typical usage is explained in the base class.

More detailed: B is resized to a $n_A \times m_T$ matrix, then $B_{ij} = \sum_k A_{ik} T_{kj}$ where $i=1,\dots,n_A$ and $j=1,\dots,m_T$ and $\sum_k$ means sum over all $k$ which are present in the T matrix.

Parameters
AElement matrix
BResult
See also
T for the typical usage of this application operator.

◆ operator()() [2/3]

template<class F >
void concepts::TMatrix< F >::operator() ( const ElementMatrix<::std::complex< F > > &  A,
ElementMatrix<::std::complex< F > > &  B 
) const

◆ operator()() [3/3]

template<class F >
void concepts::TMatrix< F >::operator() ( const Vector< F > &  A,
Vector< F > &  B 
) const

◆ outputLocalMap()

template<class F >
::std::ostream& concepts::TMatrix< F >::outputLocalMap ( ::std::ostream &  os) const

◆ usedIdx() [1/2]

template<class F >
virtual void concepts::TMatrix< F >::usedIdx ( Set< uint > &  c) const
virtual

Reimplemented in concepts::TMatrixBlock< F >.

◆ usedIdx() [2/2]

template<class F >
virtual void concepts::TMatrix< F >::usedIdx ( TColumn< bool > &  c) const
virtual

Reimplemented in concepts::TMatrixBlock< F >.

Member Data Documentation

◆ ctrl_

template<class F >
Array<Control> concepts::TMatrix< F >::ctrl_
private

Control data array (column header: column index and length of the column data)

Definition at line 634 of file tmatrix.hh.

◆ data_

template<class F >
Array<Data> concepts::TMatrix< F >::data_
private

Data array (matrix entries: row index and data)

Definition at line 637 of file tmatrix.hh.

◆ sz_

template<class F >
uint concepts::TMatrix< F >::sz_
private

Size of the stored data.

Definition at line 640 of file tmatrix.hh.


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