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

#include <symmetric_matrix.h>

Inheritance diagram for MathTL::SymmetricMatrix< C >:
MathTL::LowerTriangularMatrix< C >

List of all members.

Public Types

typedef LowerTriangularMatrix
< C >::size_type 
size_type

Public Member Functions

 SymmetricMatrix (const size_type n=0)
 SymmetricMatrix (const SymmetricMatrix< C > &M)
 SymmetricMatrix (const size_type n, const char *str, const bool byrow=true)
void resize (const size_type n)
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 SymmetricMatrix< C2 > &M) const
template<class C2 >
bool operator!= (const SymmetricMatrix< C2 > &M) const
SymmetricMatrix< C > & operator= (const SymmetricMatrix< 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

Detailed Description

template<class C>
class MathTL::SymmetricMatrix< C >

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

Internally, we only store the lower triangular part.


Member Typedef Documentation

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

Reimplemented from MathTL::LowerTriangularMatrix< C >.


Constructor & Destructor Documentation

template<class C >
MathTL::SymmetricMatrix< C >::SymmetricMatrix ( const size_type  n = 0) [inline, explicit]

default constructor, yields zero square matrix which is empty per default

template<class C>
MathTL::SymmetricMatrix< C >::SymmetricMatrix ( const SymmetricMatrix< C > &  M) [inline]

copy constructor

template<class C>
MathTL::SymmetricMatrix< C >::SymmetricMatrix ( const size_type  n,
const char *  str,
const bool  byrow = true 
)

Construct n*n matrix from a string holding its entries, separated by a blank. Please note that we internally only store the lower triangular part of the matrix, so the string only has to contain those entries.

Parameters:
nrow and column dimension
strinput string
byrowindicates whether coefficients are stored row by row in the stream

Member Function Documentation

template<class C >
template<class VECTOR >
void MathTL::SymmetricMatrix< 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

Reimplemented from MathTL::LowerTriangularMatrix< C >.

template<class C >
template<class VECTOR >
void MathTL::SymmetricMatrix< 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 (this is identical to apply(), since we have a symmetric matrix)

Reimplemented from MathTL::LowerTriangularMatrix< C >.

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

read-only access to a matrix entry

Reimplemented from MathTL::LowerTriangularMatrix< C >.

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

non-equality test

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

read-only access to a matrix entry

Reimplemented from MathTL::LowerTriangularMatrix< C >.

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

read-write access to a matrix entry (you should not use this, since it destroys the matrix structure!)

Reimplemented from MathTL::LowerTriangularMatrix< C >.

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

assignment from another symmetric matrix

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

equality test with another matrix

template<class C >
void MathTL::SymmetricMatrix< 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)

Reimplemented from MathTL::LowerTriangularMatrix< C >.

template<class C >
void MathTL::SymmetricMatrix< C >::resize ( const size_type  n) [inline]

resize matrix and initialize with zero

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

write access to a matrix entry (you should not use this, since it destroys the matrix structure!)

Reimplemented from MathTL::LowerTriangularMatrix< C >.


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