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


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) |
Definition in file band_matrix.h.
| #define BD_MINVAL 1e-16 |
Definition at line 21 of file band_matrix.h.
Referenced by TBCI::BdMatrix< T >::autoinsert(), and TBCI::BdMatrix< T >::operator==().
| #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 | ( | x | ) |
Definition at line 32 of file band_matrix.h.
Referenced by TBCI::BdMatrix< T >::adddiag(), TBCI::BdMatrix< T >::constructor(), TBCI::BdMatrix< T >::free_diags(), and TBCI::BdMatrix< T >::removediag().
| #define BDMATVEC_LNWISE_OPT |
Definition at line 1466 of file band_matrix.h.
| #define COST_BDMATVEC | ( | d, | |||
| o, | |||||
| m | ) | COST_BDMATVEC_LNO(d,o,m) |
Definition at line 1684 of file band_matrix.h.
| #define COST_BDMATVEC_DIAG | ( | d, | |||
| o, | |||||
| m | ) |
Value:
(d*(2*COST_UNIT_LOAD+COST_MULT+COST_UNIT_STORE+COST_LOOP)\ +o*(6*COST_NU_LOAD+COST_LOOP+3*COST_UNIT_LOAD+2*COST_NU_STORE\ +(2*d-m)*(3*COST_UNIT_LOAD+COST_LOOP+COST_MULT+COST_ADD+COST_UNIT_STORE)))
Definition at line 1474 of file band_matrix.h.
| #define COST_BDMATVEC_DOT | ( | d, | |||
| o, | |||||
| m | ) | COST_BDMATVEC(d,o,m) |
Definition at line 1861 of file band_matrix.h.
| #define COST_BDMATVEC_LN | ( | d, | |||
| o, | |||||
| m | ) |
Value:
(d*(COST_MULT+2*COST_UNIT_LOAD+COST_UNIT_STORE+COST_LOOP\ +o*(COST_LOOP+2*COST_BRANCH+COST_UNIT_LOAD))+(2*d-m)*o*(3*COST_NU_LOAD+COST_ADD+COST_MULT))
Definition at line 1470 of file band_matrix.h.
| #define COST_BDMATVEC_LNO | ( | d, | |||
| o, | |||||
| m | ) |
Value:
(d*(COST_MULT+2*COST_UNIT_LOAD+COST_UNIT_STORE+COST_LOOP\ +o*(COST_LOOP+COST_UNIT_LOAD))+(2*d-m)*o*(3*COST_NU_LOAD+COST_ADD+COST_MULT+COST_BRANCH/2))
Definition at line 1472 of file band_matrix.h.
| #define COST_BDMATVEC_TRANS | ( | d, | |||
| o, | |||||
| m | ) | COST_BDMATVEC(d,o,m) |
Definition at line 1689 of file band_matrix.h.
| #define INTDIVEQ | ( | T | ) |
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 |
Definition at line 2087 of file band_matrix.h.
Referenced by TBCI::BdMatrix< T >::operator*(), and TBCI::BdMatrix< T >::transMult().
| #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.
1.5.6