TBCI Numerical high perf. C++ Library 2.8.0
basics.h File Reference

Provides some macros which are used throughout the library files. More...

#include "tbci/tbci_version.h"
#include "tbci/config_manual.h"
#include <iostream>
#include <fstream>
#include <iomanip>
#include <string>
#include <cstring>
#include <cstdarg>
#include <cstdlib>
#include <cmath>
#include "tbci/except.h"
#include "perf_opt.h"
#include "tbci_traits.h"
#include "tbci_param.h"
#include "plain_def.h"
#include "malloc_cache.h"
#include "cost.h"
Include dependency graph for basics.h:

Go to the source code of this file.

Classes

class  TBCI::vec_fill_fn< T >

Namespaces

namespace  TBCI
 The TBCI Numerical Library is put into TBCI namespace, if the compiler supports it (egcs-1.1.x and later for example).
namespace  CPLX__
namespace  std

Macros

#define HAVE_UNIX   1
#define USE_NS
#define SIGNATURE   class
#define RESTRICT
#define LIKELY(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)
#define REGISTER   register
#define TBCI_DLLEXPORT
#define TBCI_DLLLOCAL
#define FGD
#define FGDT
#define FGDU
#define FGDTD
#define FGDDT
#define FGDCT
#define FGDR
#define ISTRINGSTREAM   istrstream
 strstream vs. s(tring)stream
#define OSTRINGSTREAM   ostrstream
#define STRINGSTREAM   strstream
#define LONG_DOUBLE   double
#define 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 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   } /* namespace */
#define NAMESPACE_STD_END   } /* namespace std */
#define NAMESPACE_CSTD_END   } /* namespace std */
#define NAMESPACE_CPLX_END   } /* namespace std */
#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; /* Don't use! */
#define USING_STD   using namespace std;
#define TBCI__   TBCI::
#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__   /* not needed if ::std:: is used */
#define GLBL2__   /* not needed if ::TBCI:: is used */
#define ABORT_RET(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)
#define ALIGN2(v, x)
#define ALIGN(x)
#define TALIGN(x)
#define CONSTA
#define TBCI_CONST(x)
#define REGPARMA(n)
#define REGPARM(n, x)
#define UNUSED
#define WEAKA
#define WEAK(x)
#define TWEAK(x)
#define HOT
#define COLD
#define HOTDECL(x)
#define COLDDECL(x)
#define __PRETTY_FUNCTION__   "<unknown>"
#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 EXPCHK(cond, exc, txt, ind, rtval)
#define EXPCHKNR(cond, exc, txt, ind)
#define MIN(a, b)
#define MAX(a, b)
#define INFO(x)
#define RET(x)
#define CONSTR(x)
#define _VOID
#define INLINE   inline
#define OMP_FOR
#define OMP_FOR_REDUCE_F2
#define OMP_FOR_REDUCE_F1F2
#define PREFETCH_R(addr, loc)
 In case gcc does not yet support __builtin_prefetch(), we have handcoded assembly with gcc for a few architectures.
#define PREFETCH_W(addr, loc)
#define PREFETCH_R_MANY(addr, loc)
#define PREFETCH_W_MANY(addr, loc)
#define THREAD__
#define MAIN_PID   (getpid())
#define num_threads   (0)
#define thrno   (0)
#define ismainthread   (1)
#define VEC_INLINE   inline
#define COPY2(res, v1, f1, f2)
#define TBCICOPY(n, o, t, s)
#define VEC_INLINE   /*inline*/
#define FILL1(res, f1, f2)
#define TBCIFILL(n, v, t, s)
#define TBCICLEAR(n, t, s)
#define _TBCICOMP(n, o, t, s)
#define VEC_INLINE   /*inline*/
#define COMP2(r, v1, f1, f2)
#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 , TBCI::vag_max = 4294967295U
}
 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 *const res, const T *const v1)
template<typename T>
void TBCI::_par_copy (const unsigned long sz, T *v1, const T *v2)
template<typename T>
void TBCI::_tbci_fill (const unsigned long sz, T *const res, register typename tbci_traits< T >::loop_const_refval_typef2)
template<typename T>
void TBCI::_par_fill (const unsigned long, T *const, typename tbci_traits< T >::loop_const_refval_type)
template<typename T>
void TBCI::_tbci_fill_fn (const unsigned long sz, T *vec, vec_fill_fn< T > fn, void *par)
template<typename T>
void TBCI::do_vv_comp (const unsigned long sz, const T *const v1, const T *const v2, volatile long &_f2)
 f2 = number of differences vec, vec
template<typename T>
int TBCI::_par_comp (const unsigned long sz, const T *v1, const T *v2)
template<typename T>
unsigned long TBCI::_bin_search (const T *vec, T el, unsigned long start, unsigned long end)
 Search for an element el in a sorted vector between start and end-1, returns (unsigned long)-1 if element is not found.
template<typename T>
unsigned long TBCI::bin_search (const T *vec, T el, unsigned long start, unsigned long end)
 Search for an element el in a sorted vector between start and end-1, returns (unsigned long)-1 if element is not found.
int std::conj (const int arg)
 conj for elementary types
unsigned std::conj (const unsigned arg)
long std::conj (const long arg)
short std::conj (const short arg)
char std::conj (const char arg)
float std::conj (const float arg)
double std::conj (const double arg)
int std::real (const int d)
unsigned std::real (const unsigned d)
float std::real (const float d)
double std::real (const double d)
int std::imag (const int d)
unsigned std::imag (const unsigned d)
float std::imag (const float d)
double std::imag (const double d)
template<typename T>
int TBCI::sign (const T &x)
 Signum.
double TBCI::fabssqr (const double a)
double TBCI::fabssqr (const float a)
double TBCI::fabssqr (const int a)
double TBCI::fabssqr (const unsigned a)
template<typename T>
T TBCI::sqr (const T &a)
template<typename T>
T TBCI::dot (const T &a1, const T &a2)
double std::fabs (const int a)
double std::sqrt (const int a)
double std::fabs (const unsigned int a)
unsigned std::abs (const unsigned a)

Detailed Description

Provides some macros which are used throughout the library files.

basics.h should be included from any file. It contains basics definitions and macros used thoughout the library code.

Note
This file should not be changed! Settings should be changed by passing defines to the compiler. See README file for docu about those defines: NO_NS ERRCHECK NO_EXCEPT ABORT_ON_ERR

The knowledge about compilers has been moved to config_manual.h, hooray! Next step will be to generate it with autoconf ...

The basics.h file is still a collection of awful stuff, but it's getting better.

Author
Kurt Garloff kurt@.nosp@m.garl.nosp@m.off.d.nosp@m.e
Date
9/1997 – 3/2006 License: GNU LGPL v2 or later
Version
Id
basics.h,v 1.54.2.180 2022/11/03 23:52:52 garloff Exp

Definition in file basics.h.

Macro Definition Documentation

◆ __PRETTY_FUNCTION__

#define __PRETTY_FUNCTION__   "<unknown>"

Definition at line 515 of file basics.h.

◆ __TBCI__

#define __TBCI__   ::TBCI::

Definition at line 333 of file basics.h.

◆ _REF_

◆ _TBCICOMP

#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; \
})
#define REGISTER
Definition basics.h:108

Definition at line 952 of file basics.h.

◆ _VOID

#define _VOID

Definition at line 682 of file basics.h.

◆ ABORT_RET

#define ABORT_RET ( x)
Value:
return x
const Vector< T > const Vector< T > & x
Definition LM_fit.h:97

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

Definition at line 412 of file basics.h.

◆ ABORT_RET_NR

#define ABORT_RET_NR   do {} while (0)

Definition at line 413 of file basics.h.

◆ ABS

#define ABS ( T)
Value:
TBCI_CONST(inline T abs (const T a)) \
{ return a<(T)0?-a:a; }
#define TBCI_CONST(x)
Definition basics.h:458
#define T
Definition bdmatlib.cc:20
#define abs(x)
Definition f2c.h:178
const unsigned TMatrix< T > const Matrix< T > * a

Definition at line 1241 of file basics.h.

◆ ALIGN

◆ ALIGN2

◆ ALIGN3

◆ BCHK

#define BCHK ( cond,
exc,
txt,
ind,
rtval )
Value:
/*if (UNLIKELY((cond) && __TBCI__ do_errcheck())) { */ \
if (UNLIKELY(__TBCI__ do_errcheck() && (cond))) { \
throw exc ((TBCIERRM(cond,exc,txt,ind)).c_str(), ind); \
else \
STD__ cerr << TBCIERRS(cond,exc,txt,ind) << STD__ endl; \
if (__TBCI__ do_abort()) \
abort(); \
return rtval; \
}
#define STD__
Definition basics.h:338
#define TBCIERRM(cond, exc, txt, ind)
Definition basics.h:521
#define __TBCI__
Definition basics.h:333
#define UNLIKELY(expr)
Definition basics.h:101
#define TBCIERRS(cond, exc, txt, ind)
Definition basics.h:525
unsigned int do_errcheck()
Definition tbci_param.h:141
unsigned int do_except()
Definition tbci_param.h:149
unsigned int do_abort()
Definition tbci_param.h:148

Definition at line 575 of file basics.h.

Referenced by BdMatrix< T >::adddiag(), tbci_memalloc_cache< T >::alloc(), BVector< T >::append(), BVector< T >::append(), BdMatrix< T >::autoinsert(), TVector< T >::BdMatrix< T >, TBCI::bin_search(), bvfillm(), CTensor< T >::calc_indx(), CTensor< T >::calc_offs(), cediv(), cediv(), cediv(), cediv(), cediv(), cediv(), cediv(), cediv(), cediv(), cediv(), cemul(), cemul(), cemul(), cemul(), cemul(), cemul(), cemul(), cemul(), cemul(), cemul(), BVector< T >::cheapdownsize(), TMatrix< T >::cheapdownsizerow(), Tensor< T >::cntrmul(), Tensor< T >::contract(), CSCMatrix< T >::cscm_vec_mul_exact(), ctrmul(), tbci_memalloc_cache< T >::dealloc(), BdMatrix< T >::div_row(), Matrix< T >::div_row(), BdMatrix< T >::div_rows(), Matrix< T >::div_rows(), do_fbdmat_vec_mul(), dot(), BdMatrix< T >::dotMult(), ediv(), ediv(), ediv(), ediv(), ediv(), ediv(), ediv(), ediv(), ediv(), ediv(), emul(), emul(), emul(), emul(), emul(), emul(), emul(), emul(), emul(), emul(), BdMatrix< T >::expand(), TMatrix< T >::fill(), tbci_memalloc_cache< T >::find_by_sz(), gaussj(), BdMatrix< T >::get_col(), F_BandMatrix< T >::get_col(), TMatrix< T >::get_col(), BdMatrix< T >::get_row(), CRMatrix< T >::get_row(), F_TMatrix< T >::get_row(), CTensor< T >::getcref(), HOTDECL(), Index::idx_fill_in1(), Index::idx_fill_in2(), Index::idx_remove1(), Index::idx_remove2(), Index::idx_set1(), FS_Vector< dims, T >::incr(), TSVector< T >::incr(), TVector< T >::incr(), Vector< T >::incr(), tbci_memalloc_cache< T >::init(), LU_bkw_subst(), LU_bkw_subst(), lu_decomp(), lu_decomp(), LU_det(), LU_fwd_subst(), LU_fwd_subst(), LU_invert(), lu_solve(), Vector< T >::max(), metrmul(), Vector< T >::min(), CSCMatrix< T >::mult(), CSCMatrix< T >::mult1(), BdMatrix< T >::mult_row(), Matrix< T >::mult_row(), BdMatrix< T >::mult_rows(), Matrix< T >::mult_rows(), CSCMatrix< T >::multf(), Index::next_idx(), CRMatrix< T >::operator()(), CTensor< T >::operator()(), CTensor< T >::operator()(), F_BandMatrix< T >::operator()(), F_BandMatrix< T >::operator()(), F_Matrix< T >::operator()(), F_TMatrix< T >::operator()(), FS_Vector< dims, T >::operator()(), FS_Vector< dims, T >::operator()(), Matrix< T >::operator()(), BdMatrix< T >::operator*(), BdMatrix< T >::operator*(), CRMatrix< T >::operator*(), CRMatrix< T >::operator*(), CSCMatrix< T >::operator*(), CSCMatrix< T >::operator*(), CSCMatrix< T >::operator*(), F_Matrix< T >::operator*(), F_Matrix< T >::operator*(), F_TSMatrix< T >::operator*(), F_TSMatrix< T >::operator*(), Matrix< T >::operator*(), Matrix< T >::operator*(), Matrix< T >::operator*(), Matrix< T >::operator*(), TSMatrix< T >::operator*(), TSMatrix< T >::operator*(), TSMatrix< T >::operator*(), TSMatrix< T >::operator*(), Vector< T >::operator*(), CSCMatrix< T >::operator+(), Matrix< T >::operator+(), Matrix< T >::operator+(), Matrix< T >::operator+(), operator+(), Tensor< T >::operator+(), TMatrix< T >::operator+(), TSMatrix< T >::operator+(), TSMatrix< T >::operator+(), TSMatrix< T >::operator+(), TSVector< T >::operator+(), TSVector< T >::operator+(), TSVector< T >::operator+(), TVector< T >::operator+(), TVector< T >::operator+(), Vector< T >::operator+(), Vector< T >::operator+(), Vector< T >::operator+(), Tensor< T >::operator+=(), TMatrix< T >::operator+=(), TMatrix< T >::operator+=(), TVector< T >::operator+=(), TVector< T >::operator+=(), CSCMatrix< T >::operator-(), Matrix< T >::operator-(), Matrix< T >::operator-(), Matrix< T >::operator-(), operator-(), Tensor< T >::operator-(), TMatrix< T >::operator-(), TSMatrix< T >::operator-(), TSMatrix< T >::operator-(), TSMatrix< T >::operator-(), TSVector< T >::operator-(), TSVector< T >::operator-(), TSVector< T >::operator-(), TVector< T >::operator-(), TVector< T >::operator-(), Vector< T >::operator-(), Vector< T >::operator-(), Vector< T >::operator-(), Tensor< T >::operator-=(), TMatrix< T >::operator-=(), TMatrix< T >::operator-=(), TVector< T >::operator-=(), TVector< T >::operator-=(), F_Matrix< T >::operator/(), F_TMatrix< T >::operator/(), FS_Vector< dims, T >::operator/(), Matrix< T >::operator/(), operator/(), operator/(), TMatrix< T >::operator/(), Vector< T >::operator/(), Vector< T >::operator/(), BdMatrix< T >::operator/=(), F_TMatrix< T >::operator/=(), FS_Vector< dims, T >::operator/=(), TMatrix< T >::operator/=(), TVector< T >::operator/=(), BVector< T >::operator<=(), BdMatrix< T >::operator=(), BVector< T >::operator=(), CRMatrix< T >::operator=(), F_BandMatrix< T >::operator=(), F_TMatrix< T >::operator=(), F_TMatrix< T >::operator=(), F_TMatrix< T >::operator=(), TMatrix< T >::operator=(), TMatrix< T >::operator=(), TMatrix< T >::operator=(), TVector< T >::operator=(), TVector< T >::operator=(), BVector< T >::operator>=(), FS_Vector< dims, T >::operator[](), FS_Vector< dims, T >::operator[](), Index::prev_idx(), BVector< T >::remove(), BVector< T >::resize(), CRMatrix< T >::setunit(), CSCMatrix< T >::setunit(), F_TMatrix< T >::setunit(), TMatrix< T >::setunit(), BdMatrix< T >::setval(), CRMatrix< T >::setval(), CRMatrix< T >::setval(), slice(), TVector< T >::slice(), Vector< T >::slice(), ILU0_BdMatrixPreconditioner< T >::solve(), thread_dereg_callback(), F_TMatrix< T >::trace(), TMatrix< T >::trace(), BdMatrix< T >::transMult(), CRMatrix< T >::transMult(), CSCMatrix< T >::transMult(), F_BandMatrix< T >::transMult(), Matrix< T >::transMult(), CTensor< T >::transpose(), DiagPreconditioner< T, MatrixType >::update(), DILU_BdMatrixPreconditioner< T >::update(), and ILU0_BdMatrixPreconditioner< T >::update().

◆ BCHKNR

◆ COLD

#define COLD

Definition at line 496 of file basics.h.

◆ COLDDECL

#define COLDDECL ( x)
Value:

Definition at line 498 of file basics.h.

◆ COMP2

#define COMP2 ( r,
v1,
f1,
f2 )
Value:
if (r != v1) { ++f2; i = sz; goto _fin; /* break; */ }

Definition at line 975 of file basics.h.

Referenced by TBCI::do_vv_comp().

◆ CONSTA

#define CONSTA

Definition at line 457 of file basics.h.

◆ CONSTR

#define CONSTR ( x)
Value:

Definition at line 675 of file basics.h.

◆ COPY2

#define COPY2 ( res,
v1,
f1,
f2 )
Value:
res = v1
const unsigned TMatrix< T > * res

Definition at line 890 of file basics.h.

Referenced by TBCI::_tbci_copy().

◆ CPLX__

#define CPLX__   std::

Definition at line 341 of file basics.h.

◆ CSTD__

◆ EXPCHK

◆ EXPCHKNR

#define EXPCHKNR ( cond,
exc,
txt,
ind )
Value:
do {} while(0)

Definition at line 631 of file basics.h.

Referenced by CSCMatrix< T >::setval().

◆ FABS

#define FABS ( T)
Value:
TBCI_CONST(inline double fabs (const T a)) \
{ return a<(T)0?(double)-a:(double)a; }
double fabs(const TBCI__ cplx< T > &c)
Definition cplx.h:746

Definition at line 1202 of file basics.h.

◆ FABSSQR

#define FABSSQR ( T)
Value:
TBCI_CONST(inline double fabssqr (const T a)) \
{ return CPLX__ real(a * CPLX__ conj(a)); }
double fabssqr(const cplx< T > &c)
Definition cplx.h:390
NAMESPACE_END NAMESPACE_CPLX TBCI__ cplx< T > conj(const TBCI__ cplx< T > &c)
Definition cplx.h:663
#define real

Definition at line 1155 of file basics.h.

Referenced by TBCI::fabssqr(), TBCI::fabssqr(), and TBCI::fabssqr().

◆ FD__

#define FD__   FD::

Definition at line 337 of file basics.h.

◆ FGD

#define FGD

Definition at line 144 of file basics.h.

◆ FGDCT

#define FGDCT

Definition at line 149 of file basics.h.

◆ FGDDT

#define FGDDT

Definition at line 148 of file basics.h.

◆ FGDR

#define FGDR

Definition at line 150 of file basics.h.

◆ FGDT

#define FGDT

Definition at line 145 of file basics.h.

◆ FGDTD

#define FGDTD

Definition at line 147 of file basics.h.

◆ FGDU

#define FGDU

Definition at line 146 of file basics.h.

◆ FILL1

#define FILL1 ( res,
f1,
f2 )
Value:
res = f2

Definition at line 907 of file basics.h.

Referenced by TBCI::_tbci_fill().

◆ FRIEND_TBCI2__

◆ FRIEND_TBCI__

◆ GLBL2__

#define GLBL2__   /* not needed if ::TBCI:: is used */

Definition at line 343 of file basics.h.

Referenced by TSMatrix< T >::fabssqr(), and TSVector< T >::fabssqr().

◆ GLBL__

◆ GRID__

#define GRID__   Grid::

Definition at line 336 of file basics.h.

◆ HAVE_UNIX

#define HAVE_UNIX   1

Definition at line 55 of file basics.h.

◆ HOT

◆ HOTDECL

#define HOTDECL ( x )
Value:

Definition at line 497 of file basics.h.

◆ INFO

#define INFO ( x)

Definition at line 664 of file basics.h.

◆ INLINE

◆ INST

#define INST ( x)

Definition at line 238 of file basics.h.

Referenced by INST(), and INST().

◆ INST2

#define INST2 ( x,
y )

Definition at line 239 of file basics.h.

◆ INST3

#define INST3 ( x,
y,
z )

Definition at line 240 of file basics.h.

Referenced by FS_Vector< dims, T >::minus().

◆ INST4

#define INST4 ( x,
y,
z,
a )

Definition at line 241 of file basics.h.

◆ INST5

#define INST5 ( x,
y,
z,
a,
b )

Definition at line 242 of file basics.h.

◆ INST6

#define INST6 ( x,
y,
z,
a,
b,
c )

Definition at line 243 of file basics.h.

◆ INSTCTL

#define INSTCTL ( x)

Definition at line 245 of file basics.h.

◆ ismainthread

#define ismainthread   (1)

◆ ISTRINGSTREAM

#define ISTRINGSTREAM   istrstream

strstream vs. s(tring)stream

Definition at line 204 of file basics.h.

◆ LIKELY

#define LIKELY ( expr)
Value:
(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 TSVector< T >::add_t_tsv(), BdMatrix< T >::adddiag(), BdMatrix< T >::autoinsert(), BiCGSTAB(), BVector< T >::BVector(), BVector< T >::BVector(), BVector< T >::BVector(), BVector< T >::BVector(), TMatrix< T >::cheapdownsizerow(), BdMatrix< T >::check_internal(), TSMatrix< T >::clone(), TSVector< T >::clone(), BdMatrix< T >::constructor(), BVector< T >::destroy(), TSVector< T >::destroy(), TSMatrix< T >::detach(), TSVector< T >::detach(), do_bdmat_vec_dotmult(), do_bdmat_vec_mult(), do_bdmat_vec_mult_lnw(), do_bdmat_vec_transmult_lnw(), dot(), BdMatrix< T >::expand(), F_TMatrix< T >::F_TMatrix(), F_TMatrix< T >::F_TMatrix(), F_TMatrix< T >::F_TMatrix(), Vector< T >::fabssqr(), tbci_memalloc_cache< T >::find_and_rmv(), tbci_memalloc_cache< T >::free_and_enter(), BdMatrix< T >::get(), BdMatrix< T >::get_col(), BdMatrix< T >::get_row(), HOTDECL(), HOTDECL(), HOTDECL(), HOTDECL(), HOTDECL(), HOTDECL(), lu_decomp(), Vector< T >::max(), Vector< T >::max(), Vector< T >::min(), Vector< T >::min(), BdMatrix< T >::operator()(), BdMatrix< T >::operator()(), BdMatrix< T >::operator*(), Matrix< T >::operator*(), Matrix< T >::operator*(), Vector< T >::operator*(), TSMatrix< T >::operator+(), TSVector< T >::operator+(), TSVector< T >::operator+(), TSVector< T >::operator+(), TVector< T >::operator+(), Vector< T >::operator+(), TVector< T >::operator+=(), TSMatrix< T >::operator-(), TSVector< T >::operator-(), TSVector< T >::operator-(), TSVector< T >::operator-(), TVector< T >::operator-(), Vector< T >::operator-(), TVector< T >::operator-=(), TVector< T >::operator=(), TVector< T >::operator=(), BdMatrix< T >::operator==(), BVector< T >::operator==(), Matrix< T >::operator==(), Matrix< T >::operator==(), TMatrix< T >::operator==(), TMatrix< T >::operator==(), TSMatrix< T >::operator==(), TSMatrix< T >::operator==(), TSVector< T >::operator==(), TSVector< T >::operator==(), TVector< T >::operator==(), Vector< T >::operator==(), par_fill(), TSMatrix< T >::real_destroy(), BVector< T >::resize(), BVector< T >::resize(), BVector< T >::resize(), F_TMatrix< T >::resize(), TMatrix< T >::resize(), TMatrix< T >::resize(), TMatrix< T >::resize(), TMatrix< T >::row_expand(), TMatrix< T >::row_expand(), TMatrix< T >::set_ptrs(), TMatrix< T >::setunit(), BdMatrix< T >::setval(), TBCI::sign(), ILU0_Symm_BdMatrixPreconditioner< T >::solve(), TSVector< T >::sub_t_tsv(), Vector< T >::sum(), cplx< T >::theta(), TMatrix< T >::TMatrix(), TMatrix< T >::TMatrix(), TMatrix< T >::TMatrix(), BdMatrix< T >::transMult(), Matrix< T >::transMult(), DILU_BdMatrixPreconditioner< T >::update(), and Vector< T >::Vector().

◆ LONG_DOUBLE

#define LONG_DOUBLE   double

Definition at line 219 of file basics.h.

◆ LONG_LONG

#define LONG_LONG   long

Definition at line 224 of file basics.h.

Referenced by binom(), binomial(), and fac().

◆ MAIN_PID

#define MAIN_PID   (getpid())

Definition at line 781 of file basics.h.

◆ MATH__

◆ MAX

◆ MIN

◆ MIN_ALIGN

◆ MIN_ALIGN2

◆ NAMESPACE_CPLX

#define NAMESPACE_CPLX   namespace std {

Definition at line 322 of file basics.h.

◆ NAMESPACE_CPLX_END

#define NAMESPACE_CPLX_END   } /* namespace std */

Definition at line 326 of file basics.h.

◆ NAMESPACE_CSTD

#define NAMESPACE_CSTD   namespace std {

Definition at line 319 of file basics.h.

◆ NAMESPACE_CSTD_END

#define NAMESPACE_CSTD_END   } /* namespace std */

Definition at line 325 of file basics.h.

Referenced by std::abs().

◆ NAMESPACE_END

◆ NAMESPACE_FD

#define NAMESPACE_FD   namespace Finite_Difference {

Definition at line 321 of file basics.h.

◆ NAMESPACE_GRID

#define NAMESPACE_GRID   namespace Grid {

Definition at line 320 of file basics.h.

◆ NAMESPACE_STD

#define NAMESPACE_STD   namespace std {

Definition at line 318 of file basics.h.

◆ NAMESPACE_STD_END

#define NAMESPACE_STD_END   } /* namespace std */

Definition at line 324 of file basics.h.

◆ NAMESPACE_TBCI

#define NAMESPACE_TBCI   namespace TBCI {

Definition at line 317 of file basics.h.

Referenced by std::abs(), and TVector< T >::BdMatrix< T >.

◆ NOINST

◆ NULL

◆ num_threads

◆ OMP_FOR

#define OMP_FOR

Definition at line 708 of file basics.h.

◆ OMP_FOR_REDUCE_F1F2

#define OMP_FOR_REDUCE_F1F2

Definition at line 710 of file basics.h.

◆ OMP_FOR_REDUCE_F2

#define OMP_FOR_REDUCE_F2

Definition at line 709 of file basics.h.

◆ OSTRINGSTREAM

#define OSTRINGSTREAM   ostrstream

Definition at line 205 of file basics.h.

◆ PREFETCH_R

#define PREFETCH_R ( addr,
loc )
Value:
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:

  • For AXP (21164A,EV56) it seems to harm performance a bit
  • For PentiumIII (Coppermine) it helps a lot
  • For AMD K7 (Athlon st.2) it seems to help a tiny bit

Definition at line 748 of file basics.h.

Referenced by busy_read(), do_bdmat_vec_dotmult(), do_bdmat_vec_mult_lnw_opt(), do_bdmat_vec_transmult_lnw_opt(), dot(), Vector< T >::fabssqr(), HOTDECL(), HOTDECL(), if(), lu_decomp(), Matrix< T >::operator*(), Matrix< T >::operator*(), Vector< T >::operator*(), and Vector< T >::sum().

◆ PREFETCH_R_MANY

#define PREFETCH_R_MANY ( addr,
loc )
Value:
do {} while(0)

Definition at line 764 of file basics.h.

Referenced by BdMatrix< T >::operator*(), and BdMatrix< T >::transMult().

◆ PREFETCH_W

#define PREFETCH_W ( addr,
loc )
Value:
do {} while (0)

Definition at line 749 of file basics.h.

Referenced by HOTDECL(), HOTDECL(), HOTDECL(), if(), Matrix< T >::operator*(), Matrix< T >::operator*(), and par_fill().

◆ PREFETCH_W_MANY

#define PREFETCH_W_MANY ( addr,
loc )
Value:
do {} while(0)

Definition at line 765 of file basics.h.

Referenced by BdMatrix< T >::operator*(), and BdMatrix< T >::transMult().

◆ REGISTER

#define REGISTER   register

Definition at line 108 of file basics.h.

Referenced by TBCI::_tbci_fill_fn(), BdMatrix< T >::autoinsert(), BdMatrix< T >::BdMatrix(), BdMatrix< T >::BdMatrix(), BVector< T >::bubble_sort(), buf_minus(), CTensor< T >::calc_offs(), CTensor< T >::calclayout(), CTensor< T >::calcsize(), cediv(), cediv(), cediv(), cediv(), cediv(), cemul(), cemul(), cemul(), cemul(), cemul(), F_TSMatrix< T >::clone(), TSVector< T >::clone(), conj(), conj(), BdMatrix< T >::constructor(), BVector< T >::contains(), FS_Vector< dims, T >::contains(), CSCMatrix< T >::cscm_vec_mul_exact(), F_TSMatrix< T >::detach(), TSMatrix< T >::detach(), cplx< T >::div(), do_bdmat_vec_dotmult(), do_bdmat_vec_mult_diagw_exact(), do_bdmat_vec_mult_lnw(), do_bdmat_vec_mult_lnw_opt(), do_bdmat_vec_transmult_diagw_exact(), do_bdmat_vec_transmult_lnw(), do_bdmat_vec_transmult_lnw_opt(), do_fill_mat(), dot(), ediv(), ediv(), ediv(), ediv(), ediv(), emul(), emul(), emul(), emul(), emul(), F_TSMatrix< T >::eval(), TSVector< T >::eval(), exact_sum(), expi(), F_Matrix< T >::fabs(), F_TSMatrix< T >::fabs(), gaussj(), BdMatrix< T >::get(), CSCMatrix< T >::get(), BdMatrix< T >::get_col(), TMatrix< T >::get_col(), BdMatrix< T >::get_row(), F_TMatrix< T >::get_row(), if(), imag(), imag(), kahan_sum(), LU_bkw_subst(), LU_bkw_subst(), lu_decomp(), lu_decomp(), LU_det(), LU_det(), LU_fwd_subst(), LU_fwd_subst(), FS_Vector< dims, T >::max(), Vector< T >::max(), Vector< T >::max(), FS_Vector< dims, T >::min(), Vector< T >::min(), Vector< T >::min(), CSCMatrix< T >::mult(), CSCMatrix< T >::multf(), BdMatrix< T >::operator()(), BdMatrix< T >::operator()(), BdMatrix< T >::operator*(), CSCMatrix< T >::operator*(), F_Matrix< T >::operator*(), F_Matrix< T >::operator*(), F_Matrix< T >::operator*(), F_TSMatrix< T >::operator*(), F_TSMatrix< T >::operator*(), Matrix< T >::operator*(), TSMatrix< T >::operator*(), TSMatrix< T >::operator*(), TSMatrix< T >::operator*(), TSMatrix< T >::operator*(), cplx< T >::operator*=(), BdMatrix< T >::operator-(), F_TMatrix< T >::operator-(), cplx< T >::operator/(), BdMatrix< T >::operator/=(), cplx< T >::operator/=(), F_Matrix< T >::operator==(), F_TMatrix< T >::operator==(), F_TSMatrix< T >::operator==(), F_TSMatrix< T >::operator==(), Matrix< T >::operator==(), TMatrix< T >::operator==(), TSMatrix< T >::operator==(), TSMatrix< T >::operator==(), TSVector< T >::operator==(), TSVector< T >::operator==(), Vector< T >::operator==(), real(), real(), BdMatrix< T >::reconfig(), BdMatrix< T >::resize(), BVector< T >::revert(), TMatrix< T >::row_expand(), TMatrix< T >::row_expand(), TMatrix< T >::set_col(), TMatrix< T >::set_col_partial(), TMatrix< T >::set_ptrs(), F_TMatrix< T >::set_row(), F_TMatrix< T >::setunit(), TMatrix< T >::setunit(), BdMatrix< T >::setval(), ILU0_BdMatrixPreconditioner< T >::solve(), ILU0_Symm_BdMatrixPreconditioner< T >::solve(), sqr(), FS_Vector< dims, T >::sum(), TBCI::SWAP(), BdMatrix< T >::trace(), F_TMatrix< T >::trace(), TMatrix< T >::trace(), CSCMatrix< T >::transMult(), BdMatrix< T >::transpose(), and DILU_BdMatrixPreconditioner< T >::update().

◆ REGPARM

#define REGPARM ( n,
x )
Value:

Definition at line 465 of file basics.h.

◆ REGPARMA

#define REGPARMA ( n)

Definition at line 464 of file basics.h.

◆ RESTRICT

#define RESTRICT

Definition at line 89 of file basics.h.

Referenced by TMatrix< T >::set_ptrs().

◆ RET

#define RET ( x)

Definition at line 674 of file basics.h.

◆ SIGNATURE

#define SIGNATURE   class

Definition at line 80 of file basics.h.

◆ SQRT

#define SQRT ( T)
Value:
TBCI_CONST(inline double sqrt (const T a)) \
{ return MATH__ sqrt ((double)a); }
#define MATH__
Definition basics.h:339
NAMESPACE_END NAMESPACE_CSTD TBCI__ cplx< T > sqrt(const TBCI__ cplx< T > &z)
Definition cplx.h:751

Definition at line 1206 of file basics.h.

Referenced by std::sqrt().

◆ STD__

#define STD__   std::

Definition at line 338 of file basics.h.

Referenced by BdMatrix< T >::adddiag(), BiCGSTAB(), buf_minus(), CGS(), F_TMatrix< T >::conj(), BdMatrix< T >::constructor(), Symm_BdMatrix< T >::create(), Symm_BdMatrix< T >::create(), dot(), eig(), eig(), eig(), eig(), eig(), eig(), expm3(), Vector< T >::fabssqr(), CSCMatrix< T >::fill(), BdMatrix< T >::free_diags(), gaussj(), F_TMatrix< T >::herm(), hyper2geom1(), hyper2geom1(), inv(), inv(), inv(), lu_decomp(), lu_solve(), lu_solve(), lu_solve(), lu_solve(), lu_solve(), lu_solve(), lu_solve(), lu_solve_expert(), CSCMatrix< T >::MatVecMult(), NumErr::NumErr(), NumErr::NumErr(), NumErr::NumErr(), NumErr::NumErr(), Symm_BdMatrix< T >::operator*(), Vector< T >::operator*(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), BdMatrix< T >::operator<<FGD, BVector< T >::operator<<FGD, cplx< T >::operator<<FGD, CRMatrix< T >::operator<<FGD, CTensor< T >::operator<<FGD, F_BandMatrix< T >::operator<<FGD, F_Matrix< T >::operator<<FGD, FS_Vector< dims, T >::operator<<FGD, Symm_BdMatrix< T >::operator<<FGD, TSVector< T >::operator<<FGD, TVector< T >::operator<<FGD, CSCMatrix< T >::operator<<FGDT, Matrix< T >::operator<<FGDT, BdMatrix< T >::operator=(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), BdMatrix< T >::operator>>FGD, BVector< T >::operator>>FGD, cplx< T >::operator>>FGD, CTensor< T >::operator>>FGD, F_Matrix< T >::operator>>FGD, FS_Vector< dims, T >::operator>>FGD, Matrix< T >::operator>>FGDT, QMR(), BdMatrix< T >::removediag(), Symm_BdMatrix< T >::setval(), sv_decomp(), F_TMatrix< T >::trans(), and ILU0_Symm_BdMatrixPreconditioner< T >::update().

◆ STRINGSTREAM

#define STRINGSTREAM   strstream

Definition at line 206 of file basics.h.

◆ TALIGN

#define TALIGN ( x)

Definition at line 450 of file basics.h.

◆ TBCI__

◆ TBCI_CONST

#define TBCI_CONST ( x)
Value:

Definition at line 458 of file basics.h.

◆ TBCI_DLLEXPORT

#define TBCI_DLLEXPORT

Definition at line 124 of file basics.h.

◆ TBCI_DLLLOCAL

#define TBCI_DLLLOCAL

Definition at line 125 of file basics.h.

◆ TBCICLEAR

#define TBCICLEAR ( n,
t,
s )
Value:
_par_fill < t > (s,n,t(0))

Definition at line 913 of file basics.h.

Referenced by TMatrix< T >::clear(), BVector< T >::init_0(), and TMatrix< T >::setunit().

◆ TBCICOMP

#define TBCICOMP ( n,
o,
t,
s )
Value:
_par_comp< t > (s, n, o)

The above discussion similarily holds for comparing things. memcmp() however is much less dangerous. You risk to have two logically identical objects, which still don't have the same bytes to be compared to be unequal. OTOH, our manual memcmp seems to be faster ...

Definition at line 981 of file basics.h.

Referenced by BdMatrix< T >::operator==(), BVector< T >::operator==(), F_Matrix< T >::operator==(), F_Matrix< T >::operator==(), F_TMatrix< T >::operator==(), F_TMatrix< T >::operator==(), F_TSMatrix< T >::operator==(), F_TSMatrix< T >::operator==(), Matrix< T >::operator==(), Matrix< T >::operator==(), TMatrix< T >::operator==(), TMatrix< T >::operator==(), TSMatrix< T >::operator==(), TSMatrix< T >::operator==(), TSVector< T >::operator==(), TSVector< T >::operator==(), and Vector< T >::operator==().

◆ TBCICOPY

#define TBCICOPY ( n,
o,
t,
s )
Value:
_par_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 895 of file basics.h.

Referenced by BVector< T >::append(), bvfillm(), F_TSMatrix< T >::clone(), TSMatrix< T >::clone(), TSVector< T >::clone(), BVector< T >::concat(), BdMatrix< T >::do_copy(), F_TMatrix< T >::F_TMatrix(), F_TMatrix< T >::F_TMatrix(), TMatrix< T >::fill(), F_TMatrix< T >::get_col(), TMatrix< T >::get_row(), Matrix< T >::operator()(), BVector< T >::operator=(), F_TMatrix< T >::operator=(), TMatrix< T >::operator=(), BdMatrix< T >::reconfig(), BVector< T >::remove(), BdMatrix< T >::resize(), BVector< T >::resize(), F_TMatrix< T >::resize(), TMatrix< T >::resize(), TMatrix< T >::resize(), F_TMatrix< T >::set_col(), TMatrix< T >::set_row(), TMatrix< T >::set_row_partial(), Vector< T >::slice(), TMatrix< T >::TMatrix(), TMatrix< T >::TMatrix(), and Vector< T >::Vector().

◆ TBCIERRH1

#define TBCIERRH1   __PRETTY_FUNCTION__

Definition at line 520 of file basics.h.

◆ TBCIERRM

#define TBCIERRM ( cond,
exc,
txt,
ind )
Value:
STD__ string(#exc) + " in " + TBCIERRH1 + ":\n " + #txt + " at "\
+ __FILE__ + ":" + TBCI__ ltoa(__LINE__) + ":\n (" + #cond \
+ ") == TRUE! (" + #ind + " = " + TBCI__ ltoa(ind) + ")"
#define TBCIERRH1
Definition basics.h:520
#define TBCI__
Definition basics.h:332
static char * ltoa(const long l)
Definition except.h:102

Definition at line 521 of file basics.h.

◆ TBCIERRS

#define TBCIERRS ( cond,
exc,
txt,
ind )
Value:
#exc << " in " << TBCIERRH1 << ":\n " << #txt << " at " \
<< __FILE__ << ":" << __LINE__ << ":\n (" << #cond \
<< ") == TRUE! (" << #ind << " = " << ind << ")"

Definition at line 525 of file basics.h.

◆ TBCIFILL

◆ THREAD__

#define THREAD__

Definition at line 774 of file basics.h.

◆ thrno

◆ TWEAK

#define TWEAK ( x)
Value:

Definition at line 486 of file basics.h.

◆ UNLIKELY

#define UNLIKELY ( expr)
Value:
(expr)

Definition at line 101 of file basics.h.

Referenced by cplx< T >::abs(), BdMatrix< T >::adddiag(), tbci_memalloc_cache< T >::alloc(), BdMatrix< T >::BdMatrix(), BdMatrix< T >::BdMatrix(), BdMatrix< T >::BdMatrix(), BdMatrix< T >::BdMatrix(), BiCG(), BiCGSTAB(), BVector< T >::BVector(), BVector< T >::BVector(), BVector< T >::BVector(), BVector< T >::cheapdownsize(), TMatrix< T >::cheapdownsizerow(), TMatrix< T >::clear(), TSVector< T >::clone(), BdMatrix< T >::constructor(), BVector< T >::contains(), tbci_memalloc_cache< T >::dealloc(), TSVector< T >::detach(), BdMatrix< T >::expand(), cplx< T >::fabs(), tbci_memalloc_cache< T >::free_and_enter(), BVector< T >::init_0(), CSCMatrix< T >::insert(), lina_thread(), lu_decomp(), lu_decomp(), lu_solve(), Vector< T >::max(), Vector< T >::max(), Vector< T >::min(), Vector< T >::min(), TSVector< T >::operator+(), TSVector< T >::operator-(), operator<<(), BVector< T >::operator<=(), BdMatrix< T >::operator==(), Matrix< T >::operator==(), TMatrix< T >::operator==(), TSMatrix< T >::operator==(), TSMatrix< T >::operator==(), TSVector< T >::operator==(), TSVector< T >::operator==(), Vector< T >::operator==(), BVector< T >::operator>=(), TMatrix< T >::real_destroy(), BVector< T >::remove(), BVector< T >::resize(), BVector< T >::resize(), BVector< T >::resize(), CSCMatrix< T >::resize(), TMatrix< T >::resize(), TMatrix< T >::resize(), TMatrix< T >::resize(), TMatrix< T >::row_expand(), TMatrix< T >::row_expand(), TMatrix< T >::set_ptrs(), TVector< T >::slice(), Vector< T >::slice(), cplx< T >::theta(), DILU_BdMatrixPreconditioner< T >::update(), ILU0_Symm_BdMatrixPreconditioner< T >::update(), Vector< T >::Vector(), and BVector< T >::~BVector().

◆ UNUSED

#define UNUSED

Definition at line 471 of file basics.h.

◆ USE_NS

#define USE_NS

Definition at line 70 of file basics.h.

◆ USING_END

#define USING_END   using namespace std; /* Don't use! */

Definition at line 330 of file basics.h.

◆ USING_FD

#define USING_FD   using namespace Finite_Difference;

Definition at line 329 of file basics.h.

◆ USING_GRID

#define USING_GRID   using namespace Grid;

Definition at line 328 of file basics.h.

◆ USING_STD

#define USING_STD   using namespace std;

Definition at line 331 of file basics.h.

◆ USING_TBCI

#define USING_TBCI   using namespace TBCI;

Definition at line 327 of file basics.h.

◆ VEC_INLINE [1/4]

#define VEC_INLINE

Definition at line 889 of file basics.h.

◆ VEC_INLINE [2/4]

#define VEC_INLINE   /*inline*/

Definition at line 889 of file basics.h.

◆ VEC_INLINE [3/4]

#define VEC_INLINE   /*inline*/

Definition at line 889 of file basics.h.

◆ VEC_INLINE [4/4]

#define VEC_INLINE   inline

Definition at line 889 of file basics.h.

◆ WEAK

#define WEAK ( x )
Value:

Definition at line 485 of file basics.h.

◆ WEAKA

#define WEAKA

Definition at line 484 of file basics.h.