#include "tbci_version.h"
#include "config_manual.h"
#include <iostream>
#include <fstream>
#include <iomanip>
#include <string>
#include <cstring>
#include <cstdarg>
#include <cstdlib>
#include <cmath>
#include <unistd.h>
#include "except.h"
#include "perf_opt.h"
#include "tbci_traits.h"
#include "smp.h"
#include "plain_def.h"
#include "malloc_cache.h"
#include "cost.h"


Go to the source code of this file.
Namespaces | |
| namespace | TBCI |
| namespace | CPLX__ |
| namespace | std |
Defines | |
| #define | HAVE_UNIX 1 |
| #define | USE_NS |
| #define | SIGNATURE signature |
| #define | RESTRICT __restrict__ |
| #define | LIKELY(expr) (expr) |
| branch prediction note that we sometimes on purpose mark the unlikely possibility likely and vice versa to optimize the fast path. | |
| #define | UNLIKELY(expr) (expr) |
| #define | TBCI_DLLEXPORT |
| #define | TBCI_DLLLOCAL |
| #define | PRAGMA_I |
| #define | FGD <> |
| #define | FGDT <T> |
| #define | FGDU <U> |
| #define | FGDTD <T,dims> |
| #define | FGDDT <dims,T> |
| #define | FGDCT <cplx<T> > |
| #define | FGDR <rank> |
| #define | ISTRINGSTREAM istrstream |
| strstream vs. s(tring)stream | |
| #define | OSTRINGSTREAM ostrstream |
| #define | STRINGSTREAM strstream |
| #define | LONG_DOUBLE long double |
| #define | LONG_LONG long long |
| #define | INST(x) |
| #define | INST2(x, y) |
| #define | INST3(x, y, z) |
| #define | INST4(x, y, z, a) |
| #define | INST5(x, y, z, a, b) |
| #define | INST6(x, y, z, a, b, c) |
| #define | NOINST |
| #define | INSTCTL(x) |
| #define | NULL (0) |
| #define | BOUNDCHECK |
| #define | NAMESPACE_TBCI namespace TBCI { |
| #define | NAMESPACE_STD namespace std { |
| #define | NAMESPACE_CSTD namespace std { |
| #define | NAMESPACE_GRID namespace Grid { |
| #define | NAMESPACE_FD namespace Finite_Difference { |
| #define | NAMESPACE_CPLX namespace std { |
| #define | NAMESPACE_END } |
| #define | NAMESPACE_STD_END } |
| #define | NAMESPACE_CSTD_END } |
| #define | NAMESPACE_CPLX_END } |
| #define | USING_TBCI using namespace TBCI; |
| #define | USING_GRID using namespace Grid; |
| #define | USING_FD using namespace Finite_Difference; |
| #define | USING_END using namespace std; |
| #define | USING_STD using namespace std; |
| #define | TBCI__ TBCI:: |
| #define | FRIEND_TBCI__ |
| #define | FRIEND_TBCI2__ |
| #define | GRID__ Grid:: |
| #define | FD__ FD:: |
| #define | STD__ std:: |
| #define | MATH__ std:: |
| #define | CSTD__ std:: |
| #define | CPLX__ std:: |
| #define | GLBL__ |
| #define | GLBL2__ |
| #define | ABORT_RET(x) return x |
| Note (KG, 2001-06-06): Eventually MATH__ and CSTD__ are the same on all systems and thus all MATH__ could be replaced by CSTD__ . | |
| #define | ABORT_RET_NR do {} while (0) |
| #define | MIN_ALIGN 8 |
| #define | MIN_ALIGN2 16 |
| #define | ALIGN3(v, i, x) v(i) __attribute__ ((aligned(x))) |
| #define | ALIGN2(v, x) v __attribute__ ((aligned(x))) |
| #define | ALIGN(x) __attribute__ ((aligned(x))) |
| #define | TALIGN(x) |
| #define | CONSTA __attribute__ ((const)) |
| #define | TBCI_CONST(x) x __attribute__ ((const)); x |
| #define | REGPARMA(n) __attribute__ ((regparm(n))) |
| #define | REGPARM(n, x) x __attribute__ ((regparm(n))); x |
| #define | UNUSED __attribute__((unused)) |
| #define | WEAKA __attribute__ ((weak)) |
| #define | WEAK(x) x __attribute__ ((weak)); x |
| #define | TWEAK(x) x __attribute__ ((weak)); x |
| #define | HOT |
| #define | COLD |
| #define | HOTDECL(x) x |
| #define | COLDDECL(x) x |
| #define | TBCIERRH1 __PRETTY_FUNCTION__ |
| #define | TBCIERRM(cond, exc, txt, ind) |
| #define | TBCIERRS(cond, exc, txt, ind) |
| #define | BCHK(cond, exc, txt, ind, rtval) |
| #define | BCHKNR(cond, exc, txt, ind) |
| #define | MIN(a, b) ((a) <? (b)) |
| #define | MAX(a, b) ((a) >? (b)) |
| #define | INFO(x) |
| #define | RET(x) |
| #define | CONSTR(x) x |
| #define | _VOID |
| #define | INLINE inline |
| #define | PREFETCH_R(addr, loc) do {} while (0) |
| In case gcc does not yet support __builtin_prefetch(), we have handcoded assembly with gcc for a few architectures. | |
| #define | PREFETCH_W(addr, loc) do {} while (0) |
| #define | THREAD__ |
| #define | VEC_INLINE inline |
| #define | COPY2(res, v1, f1, f2) res = v1 |
| #define | TBCICOPY(n, o, t, s) _tbci_copy < t > (s,n,o) |
| #define | VEC_INLINE |
| #define | FILL1(res, f1, f2) res = f2 |
| #define | TBCICLEAR(n, t, s) _tbci_fill < t > (s,n,t(0)) |
| #define | TBCIFILL(n, v, t, s) _tbci_fill < t > (s,n,v) |
| #define | TBCICOMP(n, o, t, s) |
| #define | _REF_ |
| #define | FABSSQR(T) |
| #define | FABS(T) |
| #define | SQRT(T) |
| #define | ABS(T) |
| #define | VEC_INLINE |
Typedefs | |
| typedef enum _vararg | TBCI::vararg |
Enumerations | |
| enum | TBCI::_vararg { TBCI::vag0 = 0, TBCI::vag1, TBCI::vag2, TBCI::vag3, TBCI::vag4, TBCI::vag5, TBCI::vag6, TBCI::vag7, TBCI::vag8, TBCI::vag9, TBCI::vag10, TBCI::vag11, TBCI::vag12, TBCI::vag13, TBCI::vag14, TBCI::vag15, TBCI::vag16 } |
| This is a helper type to identify and count varargs. More... | |
Functions | |
| template<typename T> | |
| void | TBCI::SWAP (T &a, T &b) |
| SWAP function Note: We could implement a swap function without temporaries: a -= b b += a a -= b a = -a That's four arithmetic operations to save one temporary and it can be only done for integers. | |
| template<typename T> | |
| void | TBCI::_tbci_copy (const unsigned long sz, T *__restrict__ const res, const T *__restrict__ const v1) |
| template<typename T> | |
| void | TBCI::_tbci_fill (const unsigned long sz, T *__restrict__ const res, register typename tbci_traits< T >::loop_const_refval_type f2) |
| int | std::conj (const int arg) __attribute__((const )) |
| conj for elementary types | |
| unsigned | std::conj (const unsigned arg) __attribute__((const )) |
| long | std::conj (const long arg) __attribute__((const )) |
| short | std::conj (const short arg) __attribute__((const )) |
| char | std::conj (const char arg) __attribute__((const )) |
| float | std::conj (const float arg) __attribute__((const )) |
| double | std::conj (const double arg) __attribute__((const )) |
| int | std::real (const int d) __attribute__((const )) |
| unsigned | std::real (const unsigned d) __attribute__((const )) |
| float | std::real (const float d) __attribute__((const )) |
| double | std::real (const double d) __attribute__((const )) |
| int | std::imag (const int d) __attribute__((const )) |
| unsigned | std::imag (const unsigned d) __attribute__((const )) |
| float | std::imag (const float d) __attribute__((const )) |
| double | std::imag (const double d) __attribute__((const )) |
| long double | std::conj (const long double arg) __attribute__((const )) |
| long double | std::real (const long double d) __attribute__((const )) |
| long double | std::imag (const long double d) __attribute__((const )) |
| long long | std::conj (const long long arg) __attribute__((const )) |
| long long | std::real (const long long d) __attribute__((const )) |
| long long | std::imag (const long long d) __attribute__((const )) |
| template<typename T> | |
| int | TBCI::sign (const T &x) __attribute__((const )) |
| Signum. | |
| double | TBCI::fabssqr (const double a) __attribute__((const )) |
| double | TBCI::fabssqr (const float a) __attribute__((const )) |
| double | TBCI::fabssqr (const int a) __attribute__((const )) |
| double | TBCI::fabssqr (const unsigned a) __attribute__((const )) |
| double | TBCI::fabssqr (const long double a) __attribute__((const )) |
| double | TBCI::fabssqr (const long long a) __attribute__((const )) |
| template<typename T> | |
| T | TBCI::sqr (const T &a) __attribute__((const )) |
| template<typename T> | |
| T | TBCI::dot (const T &a1, const T &a2) __attribute__((const )) |
| double | std::fabs (const long double a) __attribute__((const )) |
| double | std::sqrt (const long double a) __attribute__((const )) |
| double | std::fabs (const int a) __attribute__((const )) |
| double | std::sqrt (const int a) __attribute__((const )) |
| double | std::fabs (const long long a) __attribute__((const )) |
| double | std::sqrt (const long long a) __attribute__((const )) |
| double | std::fabs (const unsigned int a) __attribute__((const )) |
| unsigned | std::abs (const unsigned a) __attribute__((const )) |
basics.h should be included from any file. It contains basics definitions and macros used thoughout the library code.
The basics.h file is still a collection of awful stuff, but it's getting better.
Definition in file basics.h.
| #define ABORT_RET | ( | x | ) | return x |
Note (KG, 2001-06-06): Eventually MATH__ and CSTD__ are the same on all systems and thus all MATH__ could be replaced by CSTD__ .
The difference to STD__ is that STD__ refers to the C++ stuff in the namespace std::, while the CSTD__ (and MATH__) refers to C stuff which is wrapped into std:: by including cXXX headers
| #define ABS | ( | T | ) |
| #define ALIGN | ( | x | ) | __attribute__ ((aligned(x))) |
attributes definitions for alignment, weak, const, regparm, ...
Definition at line 442 of file basics.h.
Referenced by TBCI::chisq(), TBCI::Chisq(), TBCI::chisquare(), TBCI::Chisquare_2D(), TBCI::cplx< T >::div(), TBCI::do_bdmat_vec_dotmult(), TBCI::do_bdmat_vec_mult(), TBCI::do_bdmat_vec_transmult(), TBCI::expi(), TBCI::F_TSMatrix< T >::fabs(), TBCI::grid_min(), TBCI::Grid_Min_2D(), TBCI::lev_mar(), TBCI::LM_fit_2D(), TBCI::Vector< T >::max(), TBCI::FS_Vector< dims, T >::max(), TBCI::Vector< T >::min(), TBCI::FS_Vector< dims, T >::min(), TBCI::Matrix< T >::operator*(), TBCI::TSMatrix< T >::operator*(), TBCI::F_Matrix< T >::operator*(), TBCI::F_TSMatrix< T >::operator*(), TBCI::BdMatrix< T >::operator*(), TBCI::cplx< T >::operator*=(), TBCI::Vector< T >::operator/(), TBCI::cplx< T >::operator/(), TBCI::cplx< T >::operator/=(), TBCI::BdMatrix< T >::operator/=(), TBCI::operator>>(), TBCI::partial_del(), TBCI::Partial_Del(), TBCI::Vector< T >::sum(), TBCI::FS_Vector< dims, T >::sum(), TBCI::SWAP(), and TBCI::BdMatrix< T >::trace().
| #define ALIGN2 | ( | v, | |||
| x | ) | v __attribute__ ((aligned(x))) |
Definition at line 441 of file basics.h.
Referenced by do_mat_vec_mult(), TBCI::LU_bkw_subst(), TBCI::lu_decomp(), TBCI::LU_det(), TBCI::LU_fwd_subst(), TBCI::ILU0_BdMatrixPreconditioner< T >::solve(), and TBCI::ILU0_Symm_BdMatrixPreconditioner< T >::solve().
| #define ALIGN3 | ( | v, | |||
| i, | |||||
| x | ) | v(i) __attribute__ ((aligned(x))) |
Definition at line 439 of file basics.h.
Referenced by do_mat_mat_mult(), do_mat_vec_transmult(), TBCI::dot(), TBCI::TSMatrix< T >::operator*(), TBCI::F_Matrix< T >::operator*(), TBCI::F_TSMatrix< T >::operator*(), TBCI::TMatrix< T >::trace(), and TBCI::F_TMatrix< T >::trace().
| #define BCHK | ( | cond, | |||
| exc, | |||||
| txt, | |||||
| ind, | |||||
| rtval | ) |
Value:
Definition at line 572 of file basics.h.
Referenced by TBCI::BdMatrix< T >::adddiag(), TBCI::tbci_memalloc_cache< T >::alloc(), TBCI::BVector< T >::append(), TBCI::BdMatrix< T >::autoinsert(), TBCI::bvfillm(), TBCI::CTensor< T >::calc_indx(), TBCI::CTensor< T >::calc_offs(), TBCI::cediv(), TBCI::cemul(), TBCI::BVector< T >::cheapdownsize(), TBCI::TMatrix< T >::cheapdownsizerow(), TBCI::BdMatrix< T >::check(), TBCI::Tensor< T >::cntrmul(), TBCI::Tensor< T >::contract(), TBCI::ctrmul(), TBCI::tbci_memalloc_cache< T >::dealloc(), TBCI::Matrix< T >::div_row(), TBCI::BdMatrix< T >::div_row(), TBCI::Matrix< T >::div_rows(), TBCI::BdMatrix< T >::div_rows(), TBCI::do_fbdmat_vec_mul(), TBCI::dot(), TBCI::BdMatrix< T >::dotMult(), TBCI::ediv(), TBCI::emul(), TBCI::BdMatrix< T >::expand(), TBCI::TMatrix< T >::fill(), TBCI::tbci_memalloc_cache< T >::find_by_sz(), TBCI::gaussj(), TBCI::TMatrix< T >::get_col(), TBCI::F_BandMatrix< T >::get_col(), TBCI::BdMatrix< T >::get_col(), TBCI::F_TMatrix< T >::get_row(), TBCI::CRMatrix< T >::get_row(), TBCI::BdMatrix< T >::get_row(), TBCI::CTensor< T >::getcref(), TBCI::BVector< T >::getcref(), TBCI::Index::idx_fill_in1(), TBCI::Index::idx_fill_in2(), TBCI::Index::idx_remove1(), TBCI::Index::idx_remove2(), TBCI::Index::idx_set1(), TBCI::Vector< T >::incr(), TBCI::TSVector< T >::incr(), TBCI::TVector< T >::incr(), TBCI::FS_Vector< dims, T >::incr(), TBCI::tbci_memalloc_cache< floatptr >::init(), TBCI::LU_bkw_subst(), TBCI::lu_decomp(), TBCI::LU_det(), TBCI::LU_fwd_subst(), TBCI::LU_invert(), TBCI::lu_solve(), TBCI::Vector< T >::max(), TBCI::metrmul(), TBCI::Vector< T >::min(), TBCI::CSCMatrix< T >::mult(), TBCI::CSCMatrix< T >::mult1(), TBCI::Matrix< T >::mult_row(), TBCI::BdMatrix< T >::mult_row(), TBCI::Matrix< T >::mult_rows(), TBCI::BdMatrix< T >::mult_rows(), TBCI::CSCMatrix< T >::multf(), TBCI::Index::next_idx(), TBCI::CTensor< T >::operator()(), TBCI::Matrix< T >::operator()(), TBCI::TMatrix< T >::operator()(), TBCI::FS_Vector< dims, T >::operator()(), TBCI::F_Matrix< T >::operator()(), TBCI::F_TMatrix< T >::operator()(), TBCI::F_BandMatrix< T >::operator()(), TBCI::CSCMatrix< T >::operator()(), TBCI::CRMatrix< T >::operator()(), TBCI::BVector< T >::operator()(), TBCI::BdMatrix< T >::operator()(), TBCI::Vector< T >::operator*(), TBCI::Matrix< T >::operator*(), TBCI::TSMatrix< T >::operator*(), TBCI::F_Matrix< T >::operator*(), TBCI::F_TSMatrix< T >::operator*(), TBCI::CSCMatrix< T >::operator*(), TBCI::CRMatrix< T >::operator*(), TBCI::BdMatrix< T >::operator*(), TBCI::Vector< T >::operator+(), TBCI::TSVector< T >::operator+(), TBCI::TVector< T >::operator+(), TBCI::Tensor< T >::operator+(), TBCI::Matrix< T >::operator+(), TBCI::TSMatrix< T >::operator+(), TBCI::TMatrix< T >::operator+(), TBCI::operator+(), TBCI::CSCMatrix< T >::operator+(), TBCI::TVector< T >::operator+=(), TBCI::Tensor< T >::operator+=(), TBCI::TMatrix< T >::operator+=(), TBCI::Vector< T >::operator-(), TBCI::TSVector< T >::operator-(), TBCI::TVector< T >::operator-(), TBCI::Tensor< T >::operator-(), TBCI::Matrix< T >::operator-(), TBCI::TSMatrix< T >::operator-(), TBCI::TMatrix< T >::operator-(), TBCI::operator-(), TBCI::CSCMatrix< T >::operator-(), TBCI::TVector< T >::operator-=(), TBCI::Tensor< T >::operator-=(), TBCI::TMatrix< T >::operator-=(), TBCI::Vector< T >::operator/(), TBCI::operator/(), TBCI::Matrix< T >::operator/(), TBCI::TMatrix< T >::operator/(), TBCI::FS_Vector< dims, T >::operator/(), TBCI::F_Matrix< T >::operator/(), TBCI::F_TMatrix< T >::operator/(), TBCI::TVector< T >::operator/=(), TBCI::TMatrix< T >::operator/=(), TBCI::FS_Vector< dims, T >::operator/=(), TBCI::F_TMatrix< T >::operator/=(), TBCI::BdMatrix< T >::operator/=(), TBCI::operator<<(), TBCI::BVector< T >::operator<=(), TBCI::TVector< T >::operator=(), TBCI::TMatrix< T >::operator=(), TBCI::F_TMatrix< T >::operator=(), TBCI::F_BandMatrix< T >::operator=(), TBCI::CRMatrix< T >::operator=(), TBCI::BVector< T >::operator=(), TBCI::BdMatrix< T >::operator=(), TBCI::BVector< T >::operator>=(), TBCI::TMatrix< T >::operator[](), TBCI::FS_Vector< dims, T >::operator[](), TBCI::Index::prev_idx(), TBCI::BVector< T >::remove(), TBCI::BVector< T >::resize(), TBCI::TMatrix< T >::setunit(), TBCI::F_TMatrix< T >::setunit(), TBCI::CSCMatrix< T >::setunit(), TBCI::CRMatrix< T >::setunit(), TBCI::CRMatrix< T >::setval(), TBCI::BdMatrix< T >::setval(), TBCI::Vector< T >::slice(), TBCI::TVector< T >::slice(), TBCI::slice(), TBCI::slice_offset(), TBCI::ILU0_BdMatrixPreconditioner< T >::solve(), TBCI::DILU_BdMatrixPreconditioner< T >::solve(), TBCI::thread_dereg_callback(), TBCI::TMatrix< T >::trace(), TBCI::F_TMatrix< T >::trace(), TBCI::Matrix< T >::transMult(), TBCI::F_BandMatrix< T >::transMult(), TBCI::CSCMatrix< T >::transMult(), TBCI::CRMatrix< T >::transMult(), TBCI::BdMatrix< T >::transMult(), TBCI::CTensor< T >::transpose(), TBCI::ILU0_BdMatrixPreconditioner< T >::update(), TBCI::DILU_BdMatrixPreconditioner< T >::update(), and TBCI::DiagPreconditioner< T, MatrixType >::update().
| #define BCHKNR | ( | cond, | |||
| exc, | |||||
| txt, | |||||
| ind | ) |
Value:
Definition at line 576 of file basics.h.
Referenced by TBCI::_thread_start_off(), TBCI::BdMatrix< T >::adddiag(), TBCI::TMatrix< T >::alias(), TBCI::F_BandMatrix< T >::allocate(), TBCI::CSCMatrix< T >::allocate(), TBCI::CRMatrix< T >::allocate(), TBCI::BdMatrix< T >::BdMatrix(), TBCI::BdMatrix< T >::constructor(), TBCI::F_BandMatrix< T >::copy(), TBCI::CSCMatrix< T >::copy(), TBCI::CRMatrix< T >::copy(), TBCI::F_BandMatrix< T >::F_BandMatrix(), TBCI::FS_Vector< dims, T >::FS_Vector(), TBCI::CSCMatrix< T >::insert(), TBCI::CSCMatrix< T >::MatVecMult(), TBCI::CRMatrix< T >::MatVecMult(), TBCI::metrmul(), TBCI::CTensor< T >::operator()(), TBCI::TMatrix< T >::set_col(), TBCI::F_TMatrix< T >::set_col(), TBCI::F_BandMatrix< T >::set_col(), TBCI::TMatrix< T >::set_col_partial(), TBCI::TMatrix< T >::set_row(), TBCI::F_TMatrix< T >::set_row(), TBCI::CRMatrix< T >::set_row(), TBCI::TMatrix< T >::set_row_partial(), TBCI::F_BandMatrix< T >::setval(), TBCI::CSCMatrix< T >::setval(), TBCI::thread_wait(), TBCI::thread_wait_result(), TBCI::TMatrix< T >::TMatrix(), and TBCI::BdMatrix< T >::~BdMatrix().
| #define CPLX__ std:: |
Definition at line 348 of file basics.h.
Referenced by std::acos(), TBCI::ApplyPlaneRotation(), std::asin(), std::atan(), std::atanh(), TBCI::besselh1(), TBCI::besselh2(), TBCI::besseli(), TBCI::besselj(), TBCI::besselk(), TBCI::bessely(), TBCI::cediv(), TBCI::cemul(), TBCI::conj(), TBCI::do_bdmat_vec_dotmult(), TBCI::dot(), TBCI::eig(), TBCI::FS_Vector< dims, T >::fabssqr(), TBCI::gamma(), TBCI::hyper2geom1(), TBCI::HypergeometricM(), TBCI::HypergeometricU(), TBCI::imag(), TBCI::inv(), TBCI::lu_solve(), TBCI::real(), and TBCI::sign().
| #define CSTD__ std:: |
Definition at line 347 of file basics.h.
Referenced by TBCI::TSVector< T >::abs(), TBCI::cplx< T >::abs(), TBCI::BdMatrix< T >::autoinsert(), TBCI::Basis_Trafo(), TBCI::BdMatrix< T >::check(), TBCI::CSCMatrix< T >::clear(), TBCI::F_BandMatrix< T >::copy(), TBCI::tbci_memalloc_cache< T >::dealloc(), TBCI::detect_num_cpu(), TBCI::free_threads(), TBCI::FS_Vector< dims, T >::FS_Vector(), TBCI::tbci_memalloc_cache< floatptr >::init(), TBCI::FS_Vector< dims, T >::init_0(), TBCI::init_threads(), TBCI::FS_Vector< dims, T >::operator BVector< T >(), TBCI::operator<<(), TBCI::FS_Vector< dims, T >::operator=(), TBCI::F_BandMatrix< T >::operator=(), TBCI::FS_Vector< dims, T >::operator==(), TBCI::operator>>(), TBCI::pthread_mutex_bug_abort(), TBCI::BdMatrix< T >::setval(), TBCI::slice(), TBCI::tbci_memalloc_cache< floatptr >::smp_deinit(), and TBCI::NumErr::~NumErr().
| #define FABS | ( | T | ) |
| #define FABSSQR | ( | T | ) |
| #define GLBL2__ |
Definition at line 350 of file basics.h.
Referenced by TBCI::TSVector< T >::fabssqr(), and TBCI::TSMatrix< T >::fabssqr().
| #define GLBL__ |
Definition at line 349 of file basics.h.
Referenced by TBCI::TSVector< T >::abs(), TBCI::cplx< T >::abs(), TBCI::cplx< T >::acos(), TBCI::cplx< T >::acosh(), TBCI::cplx< T >::asin(), TBCI::cplx< T >::asinh(), TBCI::cplx< T >::exp(), TBCI::TSVector< T >::fabs(), std::fabs(), TBCI::Matrix< T >::fabs(), TBCI::TSMatrix< T >::fabs(), TBCI::TMatrix< T >::fabs(), TBCI::cplx< T >::fabs(), TBCI::cplx< T >::ln(), std::log10(), TBCI::cplx< T >::power(), and TBCI::cplx< T >::sqrt().
| #define ISTRINGSTREAM istrstream |
| #define LIKELY | ( | expr | ) | (expr) |
branch prediction note that we sometimes on purpose mark the unlikely possibility likely and vice versa to optimize the fast path.
Definition at line 100 of file basics.h.
Referenced by TBCI::TSVector< T >::add_t_tsv(), TBCI::BdMatrix< T >::adddiag(), TBCI::BdMatrix< T >::autoinsert(), TBCI::BiCGSTAB(), TBCI::BVector< T >::BVector(), TBCI::BVector< unsigned >::BVector(), TBCI::TMatrix< T >::cheapdownsizerow(), TBCI::BdMatrix< T >::check(), TBCI::TSVector< T >::clone(), TBCI::TSMatrix< T >::clone(), TBCI::BdMatrix< T >::constructor(), TBCI::TSVector< T >::destroy(), TBCI::BVector< T >::destroy(), TBCI::TSVector< T >::detach(), TBCI::TSMatrix< T >::detach(), TBCI::do_bdmat_vec_dotmult(), TBCI::do_bdmat_vec_mult(), TBCI::do_bdmat_vec_transmult(), do_mat_mat_mult(), do_mat_vec_mult(), do_mat_vec_transmult(), TBCI::dot(), TBCI::BdMatrix< T >::expand(), TBCI::F_TMatrix< T >::F_TMatrix(), TBCI::Vector< T >::fabssqr(), TBCI::tbci_memalloc_cache< T >::find_and_rmv(), TBCI::tbci_memalloc_cache< T >::free_and_enter(), TBCI::BdMatrix< T >::get_col(), TBCI::BdMatrix< T >::get_row(), TBCI::Vector< T >::max(), TBCI::Vector< T >::min(), TBCI::BdMatrix< T >::operator()(), TBCI::Vector< T >::operator*(), TBCI::Matrix< T >::operator*(), TBCI::BdMatrix< T >::operator*(), TBCI::Vector< T >::operator+(), TBCI::TSVector< T >::operator+(), TBCI::TVector< T >::operator+(), TBCI::TSMatrix< T >::operator+(), TBCI::TVector< T >::operator+=(), TBCI::Vector< T >::operator-(), TBCI::TSVector< T >::operator-(), TBCI::TVector< T >::operator-(), TBCI::TSMatrix< T >::operator-(), TBCI::TVector< T >::operator-=(), TBCI::TVector< T >::operator=(), TBCI::Vector< T >::operator==(), TBCI::TSVector< T >::operator==(), TBCI::TVector< unsigned >::operator==(), TBCI::Matrix< T >::operator==(), TBCI::TSMatrix< T >::operator==(), TBCI::TMatrix< T >::operator==(), TBCI::BVector< T >::operator==(), TBCI::BdMatrix< T >::operator==(), TBCI::par_comp(), TBCI::TSMatrix< T >::real_destroy(), TBCI::TMatrix< T >::resize(), TBCI::F_TMatrix< T >::resize(), TBCI::BVector< T >::resize(), TBCI::TMatrix< T >::row_expand(), TBCI::TMatrix< T >::set_ptrs(), TBCI::TMatrix< T >::setunit(), TBCI::BdMatrix< T >::setval(), TBCI::sign(), TBCI::ILU0_Symm_BdMatrixPreconditioner< T >::solve(), TBCI::TSVector< T >::sub_t_tsv(), TBCI::cplx< T >::theta(), TBCI::TMatrix< T >::TMatrix(), TBCI::Matrix< T >::transMult(), TBCI::BdMatrix< T >::transMult(), TBCI::DILU_BdMatrixPreconditioner< T >::update(), and TBCI::Vector< T >::Vector().
| #define LONG_DOUBLE long double |
Definition at line 210 of file basics.h.
Referenced by TBCI::Vector< T >::fabssqr(), TBCI::Matrix< T >::fabssqr(), TBCI::TSMatrix< T >::fabssqr(), and TBCI::thread_wait_result().
| #define LONG_LONG long long |
| #define MATH__ std:: |
Definition at line 346 of file basics.h.
Referenced by TBCI::Vector< unsigned >::abs(), TBCI::FS_Vector< dims, T >::abs(), TBCI::cplx< T >::abs(), std::abs(), TBCI::cplx< T >::acos(), TBCI::cplx< T >::acosh(), TBCI::cplx< T >::asin(), asinh(), TBCI::cplx< T >::asinh(), std::atanh(), TBCI::BdMatrix< T >::autoinsert(), TBCI::basis_trafo(), TBCI::Basis_Trafo(), bernoulli(), TBCI::besselh1(), TBCI::besselh2(), TBCI::besseli(), TBCI::besselj(), TBCI::besselk(), TBCI::bessely(), TBCI::BiCG(), TBCI::BiCGSTAB(), TBCI::CGS(), chi_s(), erfc3(), TBCI::cplx< T >::exp(), std::exp(), TBCI::expi(), TBCI::expm3(), TBCI::Vector< unsigned >::fabs(), TBCI::TSVector< T >::fabs(), TBCI::Matrix< T >::fabs(), TBCI::TSMatrix< T >::fabs(), TBCI::TMatrix< T >::fabs(), TBCI::FS_Vector< dims, T >::fabs(), TBCI::F_Matrix< T >::fabs(), TBCI::F_TSMatrix< T >::fabs(), TBCI::cplx< T >::fabs(), std::fabs(), TBCI::hcplx::fabs(), fact(), TBCI::CSCMatrix< T >::fill(), TBCI::fix_condition(), TBCI::gaussj(), TBCI::GeneratePlaneRotation(), TBCI::GMRES(), TBCI::Grid_Min_2D(), ldgamma(), TBCI::lev_mar(), TBCI::LM_fit_2D(), TBCI::cplx< T >::ln(), std::log10(), TBCI::lu_decomp(), TBCI::lu_solve(), TBCI::norm_1(), std::operator<(), std::operator<=(), TBCI::BdMatrix< T >::operator==(), std::operator>(), std::operator>=(), TBCI::partial_del(), TBCI::Partial_Del(), poisson(), TBCI::polar(), TBCI::cplx< T >::power(), TBCI::QMR(), TBCI::cplx< T >::sqrt(), std::sqrt(), TBCI::sv_decomp(), and TBCI::sv_decomp_pythag().
| #define MAX | ( | a, | |||
| b | ) | ((a) >? (b)) |
Definition at line 626 of file basics.h.
Referenced by TBCI::do_bdmat_vec_dotmult(), TBCI::do_bdmat_vec_mult(), TBCI::do_bdmat_vec_transmult(), TBCI::expm(), TBCI::expm2(), TBCI::expm3(), TBCI::F_BandMatrix< T >::F_BandMatrix(), TBCI::fix_condition(), TBCI::lu_decomp(), TBCI::LU_fwd_subst(), TBCI::norm_1(), TBCI::BdMatrix< T >::operator*(), TBCI::operator+(), TBCI::operator-(), TBCI::partial_del(), TBCI::Partial_Del(), TBCI::sv_decomp(), and TBCI::F_BandMatrix< T >::transposed_copy().
| #define MIN | ( | a, | |||
| b | ) | ((a) <? (b)) |
Safe MIN/MAX macros
Definition at line 614 of file basics.h.
Referenced by TBCI::do_bdmat_vec_dotmult(), TBCI::do_bdmat_vec_mult(), TBCI::do_bdmat_vec_transmult(), TBCI::do_fbdmat_vec_mul(), TBCI::F_BandMatrix< T >::F_BandMatrix(), TBCI::FS_Vector< dims, T >::FS_Vector(), TBCI::LU_bkw_subst(), TBCI::lu_decomp(), TBCI::BdMatrix< T >::operator*(), TBCI::BdMatrix< T >::reconfig(), TBCI::BdMatrix< T >::removediag(), TBCI::TMatrix< T >::resize(), TBCI::F_TMatrix< T >::resize(), TBCI::CSCMatrix< T >::resize(), TBCI::BdMatrix< T >::resize(), TBCI::TMatrix< T >::setunit(), TBCI::F_TMatrix< T >::setunit(), TBCI::slice(), TBCI::sv_decomp(), TBCI::F_BandMatrix< T >::transMult(), and TBCI::F_BandMatrix< T >::transposed_copy().
| #define MIN_ALIGN 8 |
Definition at line 428 of file basics.h.
Referenced by TBCI::chisq(), TBCI::Chisq(), TBCI::chisquare(), TBCI::Chisquare_2D(), TBCI::cplx< T >::div(), TBCI::do_bdmat_vec_dotmult(), TBCI::do_bdmat_vec_mult(), TBCI::do_bdmat_vec_transmult(), TBCI::expi(), TBCI::grid_min(), TBCI::Grid_Min_2D(), TBCI::lev_mar(), TBCI::LM_fit_2D(), TBCI::Vector< T >::max(), TBCI::FS_Vector< dims, T >::max(), TBCI::Vector< T >::min(), TBCI::FS_Vector< dims, T >::min(), TBCI::F_TSMatrix< T >::operator*(), TBCI::BdMatrix< T >::operator*(), TBCI::cplx< T >::operator*=(), TBCI::Vector< T >::operator/(), TBCI::cplx< T >::operator/(), TBCI::cplx< T >::operator/=(), TBCI::BdMatrix< T >::operator/=(), TBCI::operator>>(), TBCI::partial_del(), TBCI::Partial_Del(), TBCI::Vector< T >::sum(), TBCI::FS_Vector< dims, T >::sum(), TBCI::SWAP(), and TBCI::BdMatrix< T >::trace().
| #define MIN_ALIGN2 16 |
Definition at line 431 of file basics.h.
Referenced by TBCI::do_bdmat_vec_dotmult(), TBCI::do_bdmat_vec_mult(), do_mat_mat_mult(), do_mat_vec_mult(), do_mat_vec_transmult(), TBCI::dot(), TBCI::LU_bkw_subst(), TBCI::lu_decomp(), TBCI::LU_det(), TBCI::LU_fwd_subst(), TBCI::Matrix< T >::operator*(), TBCI::TSMatrix< T >::operator*(), TBCI::F_Matrix< T >::operator*(), TBCI::F_TSMatrix< T >::operator*(), TBCI::ILU0_BdMatrixPreconditioner< T >::solve(), TBCI::ILU0_Symm_BdMatrixPreconditioner< T >::solve(), TBCI::TMatrix< T >::trace(), and TBCI::F_TMatrix< T >::trace().
| #define NULL (0) |
Definition at line 243 of file basics.h.
Referenced by TBCI::List< T >::alias(), TBCI::F_BandMatrix< T >::allocate(), TBCI::CSCMatrix< T >::allocate(), TBCI::CRMatrix< T >::allocate(), TBCI::List< T >::app(), TBCI::List< T >::checklast(), TBCI::F_BandMatrix< T >::copy(), TBCI::CSCMatrix< T >::copy(), TBCI::CRMatrix< T >::copy(), TBCI::List< T >::delcurr(), TBCI::List< T >::deltree(), TBCI::F_BandMatrix< T >::destroy(), TBCI::CSCMatrix< T >::destroy(), TBCI::CRMatrix< T >::destroy(), TBCI::List< T >::detachcurr(), TBCI::empty_thread(), TBCI::List< T >::erase(), TBCI::free_threads(), TBCI::List< T >::getbynr(), TBCI::List< T >::getnr(), TBCI::init_threads(), TBCI::List< T >::inscurr(), TBCI::CSCMatrix< T >::insert(), TBCI::lina_thread(), TBCI::List< T >::List(), TBCI::List< T >::operator=(), TBCI::CRMatrix< T >::operator=(), TBCI::nsList< T, S >::qsort(), stopwatch_e::seconds(), TBCI::CRMatrix< T >::set_row(), TBCI::CRMatrix< T >::setval(), TBCI::nsList< T, S >::sortin_r(), and TBCI::thread_wait_useful().
| #define PREFETCH_R | ( | addr, | |||
| loc | ) | do {} while (0) |
In case gcc does not yet support __builtin_prefetch(), we have handcoded assembly with gcc for a few architectures.
Some preliminary results:
Definition at line 706 of file basics.h.
Referenced by TBCI::do_bdmat_vec_dotmult(), TBCI::do_bdmat_vec_mult(), TBCI::do_bdmat_vec_transmult(), do_mat_mat_mult(), do_mat_tsv_mult(), do_mat_vec_mult(), do_mat_vec_transmult(), TBCI::dot(), TBCI::Vector< T >::fabssqr(), TBCI::Vector< T >::operator*(), TBCI::BdMatrix< T >::operator*(), TBCI::par_comp(), and TBCI::BdMatrix< T >::transMult().
| #define PREFETCH_W | ( | addr, | |||
| loc | ) | do {} while (0) |
Definition at line 707 of file basics.h.
Referenced by TBCI::do_bdmat_vec_dotmult(), TBCI::do_bdmat_vec_mult(), TBCI::do_bdmat_vec_transmult(), do_mat_vec_mult(), do_mat_vec_transmult(), TBCI::Matrix< T >::operator*(), TBCI::BdMatrix< T >::operator*(), and TBCI::BdMatrix< T >::transMult().
| #define RESTRICT __restrict__ |
Definition at line 87 of file basics.h.
Referenced by do_mat_mat_mult(), and TBCI::TMatrix< T >::set_ptrs().
| #define SQRT | ( | T | ) |
| #define STD__ std:: |
Definition at line 345 of file basics.h.
Referenced by TBCI::BdMatrix< T >::adddiag(), TBCI::BiCGSTAB(), TBCI::CGS(), TBCI::F_TMatrix< T >::conj(), TBCI::BdMatrix< T >::constructor(), TBCI::Symm_BdMatrix< T >::create(), TBCI::List< T >::deltree(), TBCI::dot(), TBCI::eig(), TBCI::expm3(), TBCI::Vector< T >::fabssqr(), TBCI::CSCMatrix< T >::fill(), TBCI::BdMatrix< T >::free_diags(), TBCI::gaussj(), TBCI::grid_min(), TBCI::Grid_Min_2D(), TBCI::F_TMatrix< T >::herm(), TBCI::hyper2geom1(), TBCI::inv(), TBCI::lev_mar(), TBCI::LM_fit_2D(), TBCI::lu_decomp(), TBCI::lu_solve(), TBCI::lu_solve_expert(), TBCI::CSCMatrix< T >::MatVecMult(), TBCI::Symm_BdMatrix< T >::operator()(), TBCI::Vector< T >::operator*(), TBCI::Symm_BdMatrix< T >::operator*(), TBCI::operator<<(), TBCI::BdMatrix< T >::operator=(), TBCI::operator>>(), TBCI::partial_del(), TBCI::Partial_Del(), TBCI::QMR(), TBCI::BdMatrix< T >::removediag(), TBCI::Symm_BdMatrix< T >::setval(), TBCI::nsList< T, S >::sortin_r(), TBCI::sv_decomp(), TBCI::F_TMatrix< T >::trans(), and TBCI::ILU0_Symm_BdMatrixPreconditioner< T >::update().
| #define TBCI__ TBCI:: |
Definition at line 340 of file basics.h.
Referenced by std::abs(), TBCI::BiCGSTAB(), TBCI::CGS(), TBCI::cplx< T >::exp(), std::exp(), TBCI::expm(), std::fabs(), TBCI::TSVector< T >::fabssqr(), TBCI::TSMatrix< T >::fabssqr(), TBCI::hyper2geom1(), TBCI::polar(), TBCI::cplx< T >::power(), TBCI::cplx< T >::sqrt(), and std::sqrt().
| #define TBCICLEAR | ( | n, | |||
| t, | |||||
| s | ) | _tbci_fill < t > (s,n,t(0)) |
Definition at line 849 of file basics.h.
Referenced by TBCI::TMatrix< T >::clear(), TBCI::BVector< unsigned >::init_0(), and TBCI::TMatrix< T >::setunit().
| #define TBCICOMP | ( | n, | |||
| o, | |||||
| t, | |||||
| s | ) |
Value:
({ \
register int _r; register unsigned long _i; \
for (_r=0, _i=0; _i<(s) && !_r; _i++) { \
_r = (int)((n)[_i] != (o)[_i]); \
if (_r) break; \
} \
_r; \
})
Definition at line 870 of file basics.h.
Referenced by TBCI::Vector< T >::operator==(), TBCI::TSVector< T >::operator==(), TBCI::Matrix< T >::operator==(), TBCI::TSMatrix< T >::operator==(), TBCI::TMatrix< T >::operator==(), TBCI::F_Matrix< T >::operator==(), TBCI::F_TSMatrix< T >::operator==(), TBCI::F_TMatrix< T >::operator==(), TBCI::BVector< T >::operator==(), and TBCI::BdMatrix< T >::operator==().
| #define TBCICOPY | ( | n, | |||
| o, | |||||
| t, | |||||
| s | ) | _tbci_copy < t > (s,n,o) |
Note (KG, 01/06/15): Discussing with Jan I just got the idea that copying of data with memcpy () is a dangerous thing to do. It only works, if the memory of the type T is contiguous (this is believed to be true) and does not have any pointers with dynamically allocated memory. Again, we have a speed vs. general implementation issue. memcpy () is believed to be faster, normally ... Actually, even the assignment can go wrong, if we have a slightly non-std meaning of assignment like the non-resizing of Vectors and Matrices.
Definition at line 838 of file basics.h.
Referenced by TBCI::BVector< T >::append(), TBCI::BVector< T >::BVector(), TBCI::bvfillm(), TBCI::TSVector< T >::clone(), TBCI::TSMatrix< T >::clone(), TBCI::F_TSMatrix< T >::clone(), TBCI::BVector< T >::concat(), TBCI::BdMatrix< T >::do_copy(), TBCI::F_TMatrix< T >::F_TMatrix(), TBCI::TMatrix< T >::fill(), TBCI::F_TMatrix< T >::get_col(), TBCI::TMatrix< T >::get_row(), TBCI::Matrix< T >::operator()(), TBCI::TMatrix< T >::operator=(), TBCI::F_TMatrix< T >::operator=(), TBCI::BVector< T >::operator=(), TBCI::BdMatrix< T >::reconfig(), TBCI::BVector< T >::remove(), TBCI::TMatrix< T >::resize(), TBCI::F_TMatrix< T >::resize(), TBCI::BVector< T >::resize(), TBCI::BdMatrix< T >::resize(), TBCI::F_TMatrix< T >::set_col(), TBCI::TMatrix< T >::set_row(), TBCI::TMatrix< T >::set_row_partial(), TBCI::Vector< T >::slice(), TBCI::TMatrix< T >::TMatrix(), and TBCI::Vector< T >::Vector().
| #define TBCIERRM | ( | cond, | |||
| exc, | |||||
| txt, | |||||
| ind | ) |
| #define TBCIERRS | ( | cond, | |||
| exc, | |||||
| txt, | |||||
| ind | ) |
| #define TBCIFILL | ( | n, | |||
| v, | |||||
| t, | |||||
| s | ) | _tbci_fill < t > (s,n,v) |
Definition at line 850 of file basics.h.
Referenced by TBCI::BdMatrix< T >::adddiag(), TBCI::BVector< T >::BVector(), TBCI::F_TMatrix< T >::clear(), TBCI::BdMatrix< T >::clear(), TBCI::F_TMatrix< T >::F_TMatrix(), TBCI::TMatrix< T >::fill(), TBCI::F_TMatrix< T >::fill(), TBCI::BVector< T >::fill(), TBCI::BdMatrix< T >::fill(), TBCI::BdMatrix< T >::removediag(), TBCI::TMatrix< T >::resize(), TBCI::F_TMatrix< T >::resize(), TBCI::BdMatrix< T >::resize(), TBCI::F_TMatrix< T >::setunit(), TBCI::BdMatrix< T >::setunit(), and TBCI::TMatrix< T >::TMatrix().
| #define UNLIKELY | ( | expr | ) | (expr) |
Definition at line 101 of file basics.h.
Referenced by TBCI::cplx< T >::abs(), TBCI::BdMatrix< T >::adddiag(), TBCI::tbci_memalloc_cache< T >::alloc(), TBCI::BdMatrix< T >::BdMatrix(), TBCI::BiCG(), TBCI::BiCGSTAB(), TBCI::BVector< T >::BVector(), TBCI::BVector< unsigned >::BVector(), TBCI::BVector< T >::cheapdownsize(), TBCI::TMatrix< T >::cheapdownsizerow(), TBCI::TMatrix< T >::clear(), TBCI::TSVector< T >::clone(), TBCI::BdMatrix< T >::constructor(), TBCI::BVector< T >::contains(), TBCI::tbci_memalloc_cache< T >::dealloc(), TBCI::TSVector< T >::detach(), do_mat_tsv_mult(), do_mat_vec_mult(), TBCI::BdMatrix< T >::expand(), TBCI::cplx< T >::fabs(), TBCI::tbci_memalloc_cache< T >::free_and_enter(), TBCI::GeneratePlaneRotation(), TBCI::GMRES(), TBCI::BVector< unsigned >::init_0(), TBCI::CSCMatrix< T >::insert(), TBCI::lina_thread(), TBCI::lu_decomp(), TBCI::lu_solve(), TBCI::Vector< T >::max(), TBCI::Vector< T >::min(), TBCI::TSVector< T >::operator+(), TBCI::TSVector< T >::operator-(), TBCI::operator<<(), TBCI::BVector< T >::operator<=(), TBCI::Vector< T >::operator==(), TBCI::TSVector< T >::operator==(), TBCI::Matrix< T >::operator==(), TBCI::TSMatrix< T >::operator==(), TBCI::TMatrix< T >::operator==(), TBCI::BdMatrix< T >::operator==(), TBCI::BVector< T >::operator>=(), TBCI::TMatrix< T >::real_destroy(), TBCI::BVector< T >::remove(), TBCI::TMatrix< T >::resize(), TBCI::CSCMatrix< T >::resize(), TBCI::BVector< T >::resize(), TBCI::TMatrix< T >::row_expand(), TBCI::TMatrix< T >::set_ptrs(), TBCI::Vector< T >::slice(), TBCI::TVector< T >::slice(), TBCI::cplx< T >::theta(), TBCI::thread_wait(), TBCI::threads_avail(), TBCI::ILU0_Symm_BdMatrixPreconditioner< T >::update(), TBCI::DILU_BdMatrixPreconditioner< T >::update(), TBCI::Vector< T >::Vector(), and TBCI::BVector< T >::~BVector().
1.5.6