band_matrix.h File Reference

Variable size configurable Band Matrix class TBCI::BdMatrix. More...

#include "basics.h"
#include "vector.h"
#include "matrix.h"

Include dependency graph for band_matrix.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  TBCI

Classes

class  TBCI::BdMatrixErr
 exception class More...
class  TBCI::BdMatrix< T >
 The class BdMatrix is an implementation to store and do operations on sparse Matrices with a band structure. More...

Defines

#define BD_MINVAL   1e-16
#define BDMAT_ONE_BLOCK
 BDMAT_NEW_ALLOC directs BdMatrix to allocate off-diags separately.
#define BDMATDBG(x)
#define SFORALL_S(op)
#define SFORALL_T(op)
#define INTDIVEQ(T)
#define STDDEF_ST(op)
#define STDDEF_SS(op)
#define BDMATVEC_LNWISE_OPT
#define COST_BDMATVEC_LN(d, o, m)
#define COST_BDMATVEC_LNO(d, o, m)
#define COST_BDMATVEC_DIAG(d, o, m)
#define COST_BDMATVEC(d, o, m)   COST_BDMATVEC_LNO(d,o,m)
#define COST_BDMATVEC_TRANS(d, o, m)   COST_BDMATVEC(d,o,m)
#define COST_BDMATVEC_DOT(d, o, m)   COST_BDMATVEC(d,o,m)
#define SMP_BDMATSLICE   2048

Functions

template<typename T>
BdMatrix< T > TBCI::transpose (BdMatrix< T > &mat)
template<typename T>
BdMatrix< T > TBCI::operator* (const T &v, const BdMatrix< T > &m)
template<typename T>
void TBCI::do_bdmat_vec_mult (const unsigned start, const unsigned end, TVector< T > *res, const BdMatrix< T > *mat, const Vector< T > *vec)
template<typename T>
void TBCI::do_bdmat_vec_transmult (const unsigned start, const unsigned end, TVector< T > *res, const BdMatrix< T > *mat, const Vector< T > *vec)
template<typename T>
void TBCI::do_bdmat_vec_dotmult (const unsigned start, const unsigned end, TVector< T > *res, const BdMatrix< T > *mat, const Vector< T > *vec)
template<typename T>
void TBCI::job_bdmat_vec_mult (struct thr_ctrl *tc)
template<typename T>
void TBCI::job_bdmat_vec_transmult (struct thr_ctrl *tc)
template<typename T>
std::ostream & TBCI::operator<< (std::ostream &ostr, const BdMatrix< T > &mat)
template<typename T>
std::istream & TBCI::operator>> (std::istream &istr, BdMatrix< T > &mat)


Detailed Description

Variable size configurable Band Matrix class TBCI::BdMatrix.

Definition in file band_matrix.h.


Define Documentation

#define BD_MINVAL   1e-16

#define BDMAT_ONE_BLOCK

BDMAT_NEW_ALLOC directs BdMatrix to allocate off-diags separately.

Definition at line 26 of file band_matrix.h.

#define BDMATDBG (  ) 

#define BDMATVEC_LNWISE_OPT

Definition at line 1466 of file band_matrix.h.

#define COST_BDMATVEC ( d,
o,
 )     COST_BDMATVEC_LNO(d,o,m)

Definition at line 1684 of file band_matrix.h.

#define COST_BDMATVEC_DIAG ( d,
o,
 ) 

#define COST_BDMATVEC_DOT ( d,
o,
 )     COST_BDMATVEC(d,o,m)

Definition at line 1861 of file band_matrix.h.

#define COST_BDMATVEC_LN ( d,
o,
 ) 

#define COST_BDMATVEC_LNO ( d,
o,
 ) 

#define COST_BDMATVEC_TRANS ( d,
o,
 )     COST_BDMATVEC(d,o,m)

Definition at line 1689 of file band_matrix.h.

#define INTDIVEQ (  ) 

Value:

template <>                                                                     \
inline BdMatrix < T >& BdMatrix< T >::operator /= (const T & div)               \
{                                                                               \
        BCHK((div==( T )0), BdMatrixErr, "Divide BdMatrix by zero", 0, *this);  \
        for (register unsigned i = 0; i < dim; ++i)                             \
                diag[i] /= div;                                                 \
        for (unsigned j = 0; j < diagconf.size(); ++j) {                        \
                const register unsigned di = diagconf(j);                       \
                for (unsigned k = 0; k < (dim-di); ++k) {                       \
                        adiag(di)[k] /= div;                                    \
                        bdiag(di)[k] /= div;                                    \
                }                                                               \
        }                                                                       \
        return *this;                                                           \
}

Definition at line 1325 of file band_matrix.h.

#define SFORALL_S ( op   ) 

Value:

template <typename T>                                                                   \
BdMatrix<T>& BdMatrix<T>::operator op (const BdMatrix<T>& mat)                          \
{                                                                                       \
        BCHK(mat.dim != dim, BdMatrixErr, Adding wrong size BdMatrix, mat.dim, *this);  \
        unsigned i, j;                                                                  \
        for (i = 0; i < dim; ++i)                                                       \
                diag[i] op mat.diag[i];                                                 \
        for (j = 0; j < diagconf.size(); ++j) {                                         \
                const register unsigned di = diagconf(j);                               \
                if (LIKELY(mat.adiag(di)))                                              \
                        for (i = 0; i < (dim-di); ++i) {                                \
                                adiag(di)[i] op mat.adiag(di)[i];                       \
                                bdiag(di)[i] op mat.bdiag(di)[i];                       \
                        }                                                               \
        }                                                                               \
        if (diagconf == mat.diagconf)                                                   \
                return *this;                                                           \
        for (j = 0; j < mat.diagconf.size(); ++j) {                                     \
                const register unsigned di = mat.diagconf(j);                           \
                if (!diagconf.contains(di))  {                                          \
                        adddiag(di);                                                    \
                        for (i = 0; i < (dim-di); ++i) {                                \
                                adiag(di)[i] op mat.adiag(di)[i];                       \
                                bdiag(di)[i] op mat.bdiag(di)[i];                       \
                        }                                                               \
                }                                                                       \
        }                                                                               \
        return *this;                                                                   \
}

Definition at line 1252 of file band_matrix.h.

#define SFORALL_T ( op   ) 

Value:

template <typename T>                                                   \
BdMatrix<T>& BdMatrix<T>::operator op (const T& mult)                   \
{                                                                       \
        for (register unsigned int i = 0; i < dim; ++i)                 \
                diag[i] op mult;                                        \
        for (unsigned j = 0; j < diagconf.size(); ++j) {                \
                const register unsigned di = diagconf(j);               \
                for (unsigned k = 0; k < (dim-di); ++k) {               \
                        adiag(di)[k] op mult;                           \
                        bdiag(di)[k] op mult;                           \
                }                                                       \
        }                                                               \
        return *this;                                                   \
}

Definition at line 1287 of file band_matrix.h.

#define SMP_BDMATSLICE   2048

#define STDDEF_SS ( op   ) 

Value:

template <typename T>                                           \
BdMatrix<T> BdMatrix<T>::operator op (const BdMatrix<T>& m2) const      \
{                                                               \
        return (BdMatrix<T> (*this)) op##= m2;                  \
}

Definition at line 1379 of file band_matrix.h.

#define STDDEF_ST ( op   ) 

Value:

template <typename T>                                           \
inline BdMatrix<T> BdMatrix<T>::operator op (const T& val) const \
{                                                               \
        return (BdMatrix<T> (*this)) op##= val;                 \
}

Definition at line 1367 of file band_matrix.h.


Generated on Wed Nov 20 09:27:28 2013 for TBCI Numerical high perf. C++ Library by  doxygen 1.5.6