MathTL
 All Classes Functions Variables Typedefs Enumerations
Public Types | Public Member Functions | Protected Attributes
MathTL::TridiagonalMatrix< C > Class Template Reference

#include <tridiagonal_matrix.h>

List of all members.

Public Types

typedef Vector< C >::size_type size_type

Public Member Functions

 TridiagonalMatrix (const size_type n=1)
 TridiagonalMatrix (const TridiagonalMatrix< C > &M)
const size_type row_dimension () const
const size_type column_dimension () const
const size_type size () const
void resize (const size_type rows)
const size_type memory_consumption () const
bool empty () const
const C operator() (const size_type row, const size_type column) const
const C get_entry (const size_type row, const size_type column) const
C & operator() (const size_type row, const size_type column)
void set_entry (const size_type row, const size_type column, const C value)
template<class C2 >
bool operator== (const TridiagonalMatrix< C2 > &M) const
template<class C2 >
bool operator!= (const TridiagonalMatrix< C2 > &M) const
TridiagonalMatrix< C > & operator= (const TridiagonalMatrix< C > &M)
template<class VECTOR >
void apply (const VECTOR &x, VECTOR &Mx) const
template<class VECTOR >
void apply_transposed (const VECTOR &x, VECTOR &Mtx) const
void print (std::ostream &os, const unsigned int tabwidth=5, const unsigned int precision=2) const

Protected Attributes

Vector< C > a_
Vector< C > b_
Vector< C > c_
size_type rowdim_

Detailed Description

template<class C>
class MathTL::TridiagonalMatrix< C >

This class models tridiagonal matrices M = (m_{i,j})_{0<=i,j<n} with entries from an arbitrary (scalar) class C, designed for numerical computations.

Internally, the entries are stored as three vectors.


Member Typedef Documentation

template<class C>
typedef Vector<C>::size_type MathTL::TridiagonalMatrix< C >::size_type

type of indexes and size type (cf. STL containers)


Constructor & Destructor Documentation

template<class C >
MathTL::TridiagonalMatrix< C >::TridiagonalMatrix ( const size_type  n = 1) [explicit]

default constructor, yields zero tridiagonal matrix which is 1x1 by default

template<class C>
MathTL::TridiagonalMatrix< C >::TridiagonalMatrix ( const TridiagonalMatrix< C > &  M)

copy constructor


Member Function Documentation

template<class C >
template<class VECTOR >
void MathTL::TridiagonalMatrix< C >::apply ( const VECTOR &  x,
VECTOR &  Mx 
) const

matrix-vector multiplication Mx = (*this) * x; we assume that the vector Mx has the correct size and is not identical to x

template<class C >
template<class VECTOR >
void MathTL::TridiagonalMatrix< C >::apply_transposed ( const VECTOR &  x,
VECTOR &  Mtx 
) const

transposed matrix-vector multiplication Mtx = (*this)^T * x; we assume that the vector Mtx has the correct size and is not identical to x

template<class C >
const TridiagonalMatrix< C >::size_type MathTL::TridiagonalMatrix< C >::column_dimension ( ) const [inline]

column dimension

template<class C >
bool MathTL::TridiagonalMatrix< C >::empty ( ) const [inline]

return true if matrix is empty (cf. STL containers)

template<class C >
const C MathTL::TridiagonalMatrix< C >::get_entry ( const size_type  row,
const size_type  column 
) const [inline]

read-only access to a matrix entry

template<class C >
const TridiagonalMatrix< C >::size_type MathTL::TridiagonalMatrix< C >::memory_consumption ( ) const [inline]

(estimate for the) memory consumption in bytes

template<class C >
template<class C2 >
bool MathTL::TridiagonalMatrix< C >::operator!= ( const TridiagonalMatrix< C2 > &  M) const [inline]

non-equality test

template<class C >
const C MathTL::TridiagonalMatrix< C >::operator() ( const size_type  row,
const size_type  column 
) const [inline]

read-only access to a matrix entry

template<class C >
C & MathTL::TridiagonalMatrix< C >::operator() ( const size_type  row,
const size_type  column 
) [inline]

read-write access to a matrix entry

template<class C>
TridiagonalMatrix< C > & MathTL::TridiagonalMatrix< C >::operator= ( const TridiagonalMatrix< C > &  M)

assignment from another tridiagonal matrix

template<class C >
template<class C2 >
bool MathTL::TridiagonalMatrix< C >::operator== ( const TridiagonalMatrix< C2 > &  M) const

equality test with another matrix

template<class C >
void MathTL::TridiagonalMatrix< C >::print ( std::ostream &  os,
const unsigned int  tabwidth = 5,
const unsigned int  precision = 2 
) const

stream output with user-defined tabwidth and precision (cf. deal.II)

template<class C >
void MathTL::TridiagonalMatrix< C >::resize ( const size_type  rows)

resize matrix and initialize with zero

template<class C >
const TridiagonalMatrix< C >::size_type MathTL::TridiagonalMatrix< C >::row_dimension ( ) const [inline]

row dimension

template<class C>
void MathTL::TridiagonalMatrix< C >::set_entry ( const size_type  row,
const size_type  column,
const C  value 
) [inline]

write access to a matrix entry

template<class C >
const TridiagonalMatrix< C >::size_type MathTL::TridiagonalMatrix< C >::size ( ) const [inline]

size as an STL-compatible container for matrix entries


Member Data Documentation

template<class C>
Vector<C> MathTL::TridiagonalMatrix< C >::a_ [protected]

a: lower diagonal b: main diagonal c. upper diagonal

template<class C>
size_type MathTL::TridiagonalMatrix< C >::rowdim_ [protected]

row dimension == column dimension


The documentation for this class was generated from the following files:
 All Classes Functions Variables Typedefs Enumerations