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

#include <triangular_matrix.h>

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

List of all members.

Public Types

typedef LowerTriangularMatrix
< C >::size_type 
size_type

Public Member Functions

 UpperTriangularMatrix (const size_type n=0)
 UpperTriangularMatrix (const UpperTriangularMatrix< C > &M)
 UpperTriangularMatrix (const size_type rows, const size_type columns)
 UpperTriangularMatrix (const size_type rows, const size_type columns, const char *str, const bool byrow=true)
const size_type row_dimension () const
const size_type column_dimension () const
void resize (const size_type rows, const size_type columns)
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 UpperTriangularMatrix< C2 > &M) const
template<class C2 >
bool operator!= (const UpperTriangularMatrix< C2 > &M) const
UpperTriangularMatrix< C > & operator= (const UpperTriangularMatrix< C > &M)
void inverse (UpperTriangularMatrix< C > &MInv) const
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=10, const unsigned int precision=3) const

Detailed Description

template<class C>
class MathTL::UpperTriangularMatrix< C >

This class models finite, densely populated, upper triangular matrices M = (m_{i,j})_{0<=i<m, 0<=j<n} with entries from an arbitrary (scalar) class C, designed for numerical computations. The class also works for nonquadratic matrices, where the triangular shape is appropriately clipped or filled up with zeros.


Member Typedef Documentation

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

Reimplemented from MathTL::LowerTriangularMatrix< C >.


Constructor & Destructor Documentation

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

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

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

copy constructor

template<class C>
MathTL::UpperTriangularMatrix< C >::UpperTriangularMatrix ( const size_type  rows,
const size_type  columns 
)

construct m*n rectangular matrix

template<class C>
MathTL::UpperTriangularMatrix< C >::UpperTriangularMatrix ( const size_type  rows,
const size_type  columns,
const char *  str,
const bool  byrow = true 
)

Construct matrix from a string holding its entries, separated by a blank.

Parameters:
row_dimensionrow dimension
column_dimensioncolumn 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::UpperTriangularMatrix< 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::UpperTriangularMatrix< 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

Reimplemented from MathTL::LowerTriangularMatrix< C >.

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

column dimension

Reimplemented from MathTL::LowerTriangularMatrix< C >.

template<class C >
const C MathTL::UpperTriangularMatrix< 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>
void MathTL::UpperTriangularMatrix< C >::inverse ( UpperTriangularMatrix< C > &  MInv) const

compute the inverse of *this (if possible), M will be properly scaled

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

non-equality test

template<class C >
const C MathTL::UpperTriangularMatrix< 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::UpperTriangularMatrix< C >::operator() ( const size_type  row,
const size_type  column 
) [inline]

read-write access to a matrix entry

Reimplemented from MathTL::LowerTriangularMatrix< C >.

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

assignment from another upper triangular matrix

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

equality test with another matrix

template<class C >
void MathTL::UpperTriangularMatrix< C >::print ( std::ostream &  os,
const unsigned int  tabwidth = 10,
const unsigned int  precision = 3 
) const

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

Reimplemented from MathTL::LowerTriangularMatrix< C >.

template<class C >
void MathTL::UpperTriangularMatrix< C >::resize ( const size_type  rows,
const size_type  columns 
) [inline]

resize matrix and initialize with zero

Reimplemented from MathTL::LowerTriangularMatrix< C >.

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

row dimension

Reimplemented from MathTL::LowerTriangularMatrix< C >.

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

write access to a matrix entry

Reimplemented from MathTL::LowerTriangularMatrix< C >.


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