MathTL
 All Classes Functions Variables Typedefs Enumerations
Public Types | Public Member Functions
MathTL::FixedMatrix< C, ROW_DIM, COL_DIM > Class Template Reference

#include <fixed_matrix.h>

List of all members.

Public Types

typedef FixedVector< C,
ROW_DIM *COL_DIM >::size_type 
size_type

Public Member Functions

 FixedMatrix (const C value=0)
 FixedMatrix (const int value)
 FixedMatrix (const FixedMatrix< C, ROW_DIM, COL_DIM > &M)
 FixedMatrix (const char *str, const bool byrow=true)
 FixedMatrix (const char *str, const C denominator, const bool byrow)
 ~FixedMatrix ()
const size_type row_dimension () const
const size_type column_dimension () const
const size_type size () const
const size_type memory_consumption () const
bool empty () const
const C get_entry (const size_type row, const size_type column) const
const C operator() (const size_type row, const size_type column) const
void set_entry (const size_type row, const size_type column, const C value)
C & operator() (const size_type row, const size_type column)
template<class C2 >
bool operator== (const FixedMatrix< C2, ROW_DIM, COL_DIM > &M) const
template<class C2 >
bool operator!= (const FixedMatrix< C2, ROW_DIM, COL_DIM > &M) const
FixedMatrix< C, ROW_DIM,
COL_DIM > & 
operator= (const FixedMatrix< C, ROW_DIM, COL_DIM > &M)
void scale (const C s)
void operator*= (const C s)
void add (const FixedMatrix< C, ROW_DIM, COL_DIM > &M, const C s=1)
void operator+= (const FixedMatrix< C, ROW_DIM, COL_DIM > &M)
void operator-= (const FixedMatrix< C, ROW_DIM, COL_DIM > &M)
template<class VECTOR >
void apply (const VECTOR &x, VECTOR &Mx) const
void apply (const FixedVector< C, COL_DIM > &x, FixedVector< C, ROW_DIM > &Mx) const
 special version for FixedVector<C, DIM> (requirement from MatrixBlock)
template<class VECTOR >
void apply_transposed (const VECTOR &x, VECTOR &Mtx) const
void apply_transposed (const FixedVector< C, ROW_DIM > &x, FixedVector< C, COL_DIM > &Mtx) const
 special version for FixedVector<C, DIM> (requirement from MatrixBlock)
void print (std::ostream &os, const unsigned int tabwidth=10, const unsigned int precision=3) const

Detailed Description

template<class C, unsigned int ROW_DIM, unsigned int COL_DIM = ROW_DIM>
class MathTL::FixedMatrix< C, ROW_DIM, COL_DIM >

This class models finite, densely populated matrices M = (m_{i,j})_{0<=i<m, 0<=j<n} with entries from an arbitrary (scalar) class C, where the matrix size is a priori known.


Member Typedef Documentation

template<class C, unsigned int ROW_DIM, unsigned int COL_DIM = ROW_DIM>
typedef FixedVector<C,ROW_DIM*COL_DIM>::size_type MathTL::FixedMatrix< C, ROW_DIM, COL_DIM >::size_type

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


Constructor & Destructor Documentation

template<class C, unsigned int ROW_DIM, unsigned int COL_DIM>
MathTL::FixedMatrix< C, ROW_DIM, COL_DIM >::FixedMatrix ( const C  value = 0) [inline]

construct a fixed matrix with all entries equal to the given number also used as default constructor, yields zero matrix

template<class C, unsigned int ROW_DIM, unsigned int COL_DIM>
MathTL::FixedMatrix< C, ROW_DIM, COL_DIM >::FixedMatrix ( const int  value) [inline]

just to satisfy the compiler at constructs like FixedMatrix(0)

template<class C, unsigned int ROW_DIM, unsigned int COL_DIM>
MathTL::FixedMatrix< C, ROW_DIM, COL_DIM >::FixedMatrix ( const FixedMatrix< C, ROW_DIM, COL_DIM > &  M) [inline]

copy constructor

template<class C, unsigned int ROW_DIM, unsigned int COL_DIM>
MathTL::FixedMatrix< C, ROW_DIM, COL_DIM >::FixedMatrix ( const char *  str,
const bool  byrow = true 
) [explicit]

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

Parameters:
strinput string
byrowindicates whether coefficients are stored row by row in the stream
template<class C, unsigned int ROW_DIM, unsigned int COL_DIM>
MathTL::FixedMatrix< C, ROW_DIM, COL_DIM >::FixedMatrix ( const char *  str,
const C  denominator,
const bool  byrow 
) [explicit]

Construct matrix of fractions from a string holding its numerators (separated by a blank), with a common denominator.

Parameters:
strinput string of nominators
denominatorThe common denominator
byrowindicates whether coefficients are stored row by row in the stream
template<class C , unsigned int ROW_DIM, unsigned int COL_DIM>
MathTL::FixedMatrix< C, ROW_DIM, COL_DIM >::~FixedMatrix ( ) [inline]

release allocated memory


Member Function Documentation

template<class C, unsigned int ROW_DIM, unsigned int COL_DIM>
void MathTL::FixedMatrix< C, ROW_DIM, COL_DIM >::add ( const FixedMatrix< C, ROW_DIM, COL_DIM > &  M,
const C  s = 1 
)

in place addition *this += s*M

template<class C , unsigned int ROW_DIM, unsigned int COL_DIM>
template<class VECTOR >
void MathTL::FixedMatrix< C, ROW_DIM, COL_DIM >::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 , unsigned int ROW_DIM, unsigned int COL_DIM>
template<class VECTOR >
void MathTL::FixedMatrix< C, ROW_DIM, COL_DIM >::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 , unsigned int ROW_DIM, unsigned int COL_DIM>
const FixedMatrix< C, ROW_DIM, COL_DIM >::size_type MathTL::FixedMatrix< C, ROW_DIM, COL_DIM >::column_dimension ( ) const [inline]

column dimension

template<class C , unsigned int ROW_DIM, unsigned int COL_DIM>
bool MathTL::FixedMatrix< C, ROW_DIM, COL_DIM >::empty ( ) const [inline]

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

template<class C , unsigned int ROW_DIM, unsigned int COL_DIM>
const C MathTL::FixedMatrix< C, ROW_DIM, COL_DIM >::get_entry ( const size_type  row,
const size_type  column 
) const [inline]

read-only access to a matrix entry

template<class C , unsigned int ROW_DIM, unsigned int COL_DIM>
const FixedMatrix< C, ROW_DIM, COL_DIM >::size_type MathTL::FixedMatrix< C, ROW_DIM, COL_DIM >::memory_consumption ( ) const [inline]

(estimate for the) memory consumption in bytes

template<class C , unsigned int ROW_DIM, unsigned int COL_DIM>
template<class C2 >
bool MathTL::FixedMatrix< C, ROW_DIM, COL_DIM >::operator!= ( const FixedMatrix< C2, ROW_DIM, COL_DIM > &  M) const [inline]

non-equality test

template<class C , unsigned int ROW_DIM, unsigned int COL_DIM>
const C MathTL::FixedMatrix< C, ROW_DIM, COL_DIM >::operator() ( const size_type  row,
const size_type  column 
) const [inline]

read-only access to a matrix entry

template<class C , unsigned int ROW_DIM, unsigned int COL_DIM>
C & MathTL::FixedMatrix< C, ROW_DIM, COL_DIM >::operator() ( const size_type  row,
const size_type  column 
) [inline]

read-write access to a matrix entry

template<class C, unsigned int ROW_DIM, unsigned int COL_DIM = ROW_DIM>
void MathTL::FixedMatrix< C, ROW_DIM, COL_DIM >::operator*= ( const C  s)

in place scaling *this *= s

template<class C, unsigned int ROW_DIM, unsigned int COL_DIM = ROW_DIM>
void MathTL::FixedMatrix< C, ROW_DIM, COL_DIM >::operator+= ( const FixedMatrix< C, ROW_DIM, COL_DIM > &  M)

in place addition *this += M

template<class C, unsigned int ROW_DIM, unsigned int COL_DIM = ROW_DIM>
void MathTL::FixedMatrix< C, ROW_DIM, COL_DIM >::operator-= ( const FixedMatrix< C, ROW_DIM, COL_DIM > &  M)

in place subtraction *this -= M

template<class C, unsigned int ROW_DIM, unsigned int COL_DIM>
FixedMatrix< C, ROW_DIM, COL_DIM > & MathTL::FixedMatrix< C, ROW_DIM, COL_DIM >::operator= ( const FixedMatrix< C, ROW_DIM, COL_DIM > &  M)

assignment from another fixed matrix

template<class C , unsigned int ROW_DIM, unsigned int COL_DIM>
template<class C2 >
bool MathTL::FixedMatrix< C, ROW_DIM, COL_DIM >::operator== ( const FixedMatrix< C2, ROW_DIM, COL_DIM > &  M) const

equality test with another fixed matrix

template<class C , unsigned int ROW_DIM, unsigned int COL_DIM>
void MathTL::FixedMatrix< C, ROW_DIM, COL_DIM >::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)

template<class C , unsigned int ROW_DIM, unsigned int COL_DIM>
const FixedMatrix< C, ROW_DIM, COL_DIM >::size_type MathTL::FixedMatrix< C, ROW_DIM, COL_DIM >::row_dimension ( ) const [inline]

row dimension

template<class C, unsigned int ROW_DIM, unsigned int COL_DIM>
void MathTL::FixedMatrix< C, ROW_DIM, COL_DIM >::scale ( const C  s) [inline]

in place scaling *this *= s

template<class C, unsigned int ROW_DIM, unsigned int COL_DIM>
void MathTL::FixedMatrix< C, ROW_DIM, COL_DIM >::set_entry ( const size_type  row,
const size_type  column,
const C  value 
) [inline]

write access to a matrix entry

template<class C , unsigned int ROW_DIM, unsigned int COL_DIM>
const FixedMatrix< C, ROW_DIM, COL_DIM >::size_type MathTL::FixedMatrix< C, ROW_DIM, COL_DIM >::size ( ) const [inline]

size as an STL-compatible container for matrix entries


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