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

#include <block_matrix.h>

Inheritance diagram for MathTL::BlockMatrix< C >:
MathTL::MatrixBlock< C >

List of all members.

Public Types

typedef Vector< C >::size_type size_type

Public Member Functions

 BlockMatrix (const size_type n=0)
 default constructor, yields a zero (nxn)-block (each 1x1) matrix, empty per default
 BlockMatrix (const size_type block_rows, const size_type block_columns)
 constructor for (mxn) block (each 1x1) matrices, empty per default
 BlockMatrix (const BlockMatrix< C > &)
 copy constructor
 ~BlockMatrix ()
 destructor (all subblocks will be deleted)
MatrixBlock< C > * clone () const
 clone the block matrix (requirement from MatrixBlock)
MatrixBlock< C > * clone_transposed () const
 transpose the block matrix (requirement from MatrixBlock)
const size_type row_dimension () const
 (overall) row dimension
const size_type column_dimension () const
 (overall) column dimension
const size_type block_rows () const
 number of "block rows", i.e., blocks in column direction (vertical)
const size_type block_columns () const
 number of "block columns", i.e., blocks in row direction (horizontal)
const size_type block_row_dimension (const size_type block_row) const
 row dimension of a given block row
const size_type block_column_dimension (const size_type block_column) const
 column dimension of a given block column
const MatrixBlock< C > * get_block (const size_type block_row, const size_type block_column) const
 get a single matrix block
void set_block (const size_type row, const size_type column, MatrixBlock< C > *block)
void resize_block_row (const size_type block_row, const size_type rows)
 resize a row block (i.e., its number of rows)
void resize_block_column (const size_type block_row, const size_type columns)
 resize a block column (i.e., its number of columns)
bool empty () const
 return true if matrix is empty (cf. STL containers)
void apply (const Vector< C > &x, Vector< C > &Mx) const
void apply_transposed (const Vector< C > &x, Vector< C > &Mtx) const
void print (std::ostream &os, const unsigned int tabwidth=10, const unsigned int precision=3) const

Protected Member Functions

void calculate_size ()
 (re)calculate overall row and column dimensions

Protected Attributes

Array1D< MatrixBlock< C > * > blocks
 pointers to the blocks
Array1D< size_typeblock_rows_rows
 row dimensions of the block rows
Array1D< size_typeblock_columns_columns
 column dimensions of the block columns
size_type rowdim_
 (overall) row dimension
size_type coldim_
 (overall) column dimension

Detailed Description

template<class C>
class MathTL::BlockMatrix< C >

A class for block matrices with almost arbitrary subblocks.


Member Typedef Documentation

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

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

Reimplemented from MathTL::MatrixBlock< C >.


Member Function Documentation

template<class C>
void MathTL::BlockMatrix< C >::apply ( const Vector< C > &  x,
Vector< C > &  Mx 
) const [virtual]

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

Implements MathTL::MatrixBlock< C >.

template<class C>
void MathTL::BlockMatrix< C >::apply_transposed ( const Vector< C > &  x,
Vector< C > &  Mtx 
) const [virtual]

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

Implements MathTL::MatrixBlock< C >.

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

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

Implements MathTL::MatrixBlock< C >.

template<class C>
void MathTL::BlockMatrix< C >::set_block ( const size_type  row,
const size_type  column,
MatrixBlock< C > *  block 
) [inline]

Set a single matrix block. Note that the old block will be deleted, and ~BlockMatrix() will delete this block! Be sure to resize the corresponding row/column block properly before or after this call. (this is necessary to have zero row/column blocks without having to allocate them)


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