IsBlockMatrix< MatrixType > Struct Template Reference

List of all members.

Classes

struct  no_type
struct  yes_type

Static Public Attributes

static const bool value

Static Private Member Functions

template<typename T >
static yes_type check_for_block_matrix (const BlockMatrixBase< T > *)
template<typename T >
static yes_type check_for_block_matrix (const BlockSparsityPatternBase< T > *)
template<typename T >
static yes_type check_for_block_matrix (const BlockSparseMatrixEZ< T > *)
static no_type check_for_block_matrix (...)


Detailed Description

template<typename MatrixType>
struct IsBlockMatrix< MatrixType >

A class that can be used to determine whether a given type is a block matrix type or not. For example,
   IsBlockMatrix<SparseMatrix<double> >::value
has the value false, whereas
   IsBlockMatrix<BlockSparseMatrix<double> >::value
is true. This is sometimes useful in template contexts where we may want to do things differently depending on whether a template type denotes a regular or a block matrix type.

Author:
Wolfgang Bangerth, 2009

Member Function Documentation

template<typename MatrixType >
template<typename T >
static yes_type IsBlockMatrix< MatrixType >::check_for_block_matrix ( const BlockMatrixBase< T > *   )  [inline, static, private]

Overload returning true if the class is derived from BlockMatrixBase, which is what block matrices do (with the exception of BlockSparseMatrixEZ).

template<typename MatrixType >
template<typename T >
static yes_type IsBlockMatrix< MatrixType >::check_for_block_matrix ( const BlockSparsityPatternBase< T > *   )  [inline, static, private]

Overload returning true if the class is derived from BlockSparsityPatternBase, which is what block sparsity patterns do.

template<typename MatrixType >
template<typename T >
static yes_type IsBlockMatrix< MatrixType >::check_for_block_matrix ( const BlockSparseMatrixEZ< T > *   )  [inline, static, private]

Overload for BlockSparseMatrixEZ, which is the only block matrix not derived from BlockMatrixBase at the time of writing this class.

template<typename MatrixType >
static no_type IsBlockMatrix< MatrixType >::check_for_block_matrix (   ...  )  [static, private]

Catch all for all other potential matrix types that are not block matrices.


Member Data Documentation

template<typename MatrixType >
const bool IsBlockMatrix< MatrixType >::value [inline, static]

Initial value:

 (sizeof(check_for_block_matrix
                                      ((MatrixType*)0))
                               ==
                               sizeof(yes_type))
A statically computable value that indicates whether the template argument to this class is a block matrix (in fact whether the type is derived from BlockMatrix<T>).


The documentation for this struct was generated from the following file:

deal.II documentation generated on Sat Aug 15 16:52:03 2009 by doxygen 1.5.9