basics.h File Reference

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

#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"

Include dependency graph for basics.h:

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

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>
TBCI::sqr (const T &a) __attribute__((const ))
template<typename 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 ))


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@garloff.de>
Date:
9/1997 -- 3/2006 License: GNU LGPL v2 or later
Version:
Id
basics.h,v 1.54.2.154 2010/08/16 13:23:11 garloff Exp

Definition in file basics.h.


Define Documentation

#define _REF_

Definition at line 920 of file basics.h.

#define _VOID

Definition at line 659 of file basics.h.

#define ABORT_RET (  )     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

Definition at line 419 of file basics.h.

#define ABORT_RET_NR   do {} while (0)

Definition at line 420 of file basics.h.

#define ABS (  ) 

Value:

TBCI_CONST(inline T abs (const T a))            \
{ return a<(T)0?-a:a; }

Definition at line 1106 of file basics.h.

#define ALIGN (  )     __attribute__ ((aligned(x)))

#define ALIGN2 ( v,
 )     v __attribute__ ((aligned(x)))

#define ALIGN3 ( v,
i,
 )     v(i) __attribute__ ((aligned(x)))

#define BCHK ( cond,
exc,
txt,
ind,
rtval   ) 

Value:

if (UNLIKELY(cond)) {                                   \
        throw exc ((TBCIERRM(cond,exc,txt,ind)).c_str(), ind);  \
  }

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   ) 

#define BOUNDCHECK

Definition at line 251 of file basics.h.

#define COLD

Definition at line 503 of file basics.h.

#define COLDDECL (  )     x

Definition at line 505 of file basics.h.

#define CONSTA   __attribute__ ((const))

Definition at line 461 of file basics.h.

#define CONSTR (  )     x

Definition at line 652 of file basics.h.

#define COPY2 ( res,
v1,
f1,
f2   )     res = v1

Definition at line 836 of file basics.h.

#define CPLX__   std::

#define CSTD__   std::

#define FABS (  ) 

Value:

TBCI_CONST(inline double fabs (const T a))      \
{ return a<(T)0?(double)-a:(double)a; }

Definition at line 1067 of file basics.h.

#define FABSSQR (  ) 

Value:

TBCI_CONST(inline double fabssqr (const T a))   \
{ return CPLX__ real(a * CPLX__ conj(a)); }

Definition at line 1020 of file basics.h.

#define FD__   FD::

Definition at line 344 of file basics.h.

#define FGD   <>

Definition at line 129 of file basics.h.

#define FGDCT   <cplx<T> >

Definition at line 134 of file basics.h.

#define FGDDT   <dims,T>

Definition at line 133 of file basics.h.

#define FGDR   <rank>

Definition at line 135 of file basics.h.

#define FGDT   <T>

Definition at line 130 of file basics.h.

#define FGDTD   <T,dims>

Definition at line 132 of file basics.h.

#define FGDU   <U>

Definition at line 131 of file basics.h.

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

Definition at line 847 of file basics.h.

#define FRIEND_TBCI2__

Definition at line 342 of file basics.h.

#define FRIEND_TBCI__

Definition at line 341 of file basics.h.

#define GLBL2__

Definition at line 350 of file basics.h.

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

#define GLBL__

#define GRID__   Grid::

Definition at line 343 of file basics.h.

#define HAVE_UNIX   1

Definition at line 55 of file basics.h.

#define HOT

Definition at line 502 of file basics.h.

#define HOTDECL (  )     x

Definition at line 504 of file basics.h.

#define INFO (  ) 

Definition at line 641 of file basics.h.

#define INLINE   inline

Definition at line 665 of file basics.h.

#define INST (  ) 

Definition at line 231 of file basics.h.

#define INST2 ( x,
y   ) 

Definition at line 232 of file basics.h.

#define INST3 ( x,
y,
 ) 

Definition at line 233 of file basics.h.

#define INST4 ( x,
y,
z,
 ) 

Definition at line 234 of file basics.h.

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

Definition at line 235 of file basics.h.

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

Definition at line 236 of file basics.h.

#define INSTCTL (  ) 

Definition at line 238 of file basics.h.

#define ISTRINGSTREAM   istrstream

strstream vs. s(tring)stream

Definition at line 197 of file basics.h.

#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

#define LONG_LONG   long long

Definition at line 215 of file basics.h.

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

#define MATH__   std::

#define MAX ( a,
 )     ((a) >? (b))

#define MIN ( a,
 )     ((a) <? (b))

#define MIN_ALIGN   8

#define MIN_ALIGN2   16

#define NAMESPACE_CPLX   namespace std {

Definition at line 330 of file basics.h.

#define NAMESPACE_CPLX_END   }

Definition at line 334 of file basics.h.

#define NAMESPACE_CSTD   namespace std {

Definition at line 327 of file basics.h.

#define NAMESPACE_CSTD_END   }

Definition at line 333 of file basics.h.

#define NAMESPACE_END   }

Definition at line 331 of file basics.h.

#define NAMESPACE_FD   namespace Finite_Difference {

Definition at line 329 of file basics.h.

#define NAMESPACE_GRID   namespace Grid {

Definition at line 328 of file basics.h.

#define NAMESPACE_STD   namespace std {

Definition at line 326 of file basics.h.

#define NAMESPACE_STD_END   }

Definition at line 332 of file basics.h.

#define NAMESPACE_TBCI   namespace TBCI {

Definition at line 325 of file basics.h.

#define NOINST

Definition at line 237 of file basics.h.

#define NULL   (0)

#define OSTRINGSTREAM   ostrstream

Definition at line 198 of file basics.h.

#define PRAGMA_I

Definition at line 124 of file basics.h.

#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:

  • 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 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)

#define REGPARM ( n,
 )     x __attribute__ ((regparm(n))); x

Definition at line 469 of file basics.h.

#define REGPARMA (  )     __attribute__ ((regparm(n)))

Definition at line 468 of file basics.h.

#define RESTRICT   __restrict__

Definition at line 87 of file basics.h.

Referenced by do_mat_mat_mult(), and TBCI::TMatrix< T >::set_ptrs().

#define RET (  ) 

Definition at line 651 of file basics.h.

#define SIGNATURE   signature

Definition at line 78 of file basics.h.

#define SQRT (  ) 

Value:

TBCI_CONST(inline double sqrt (const T a))      \
{ return MATH__ sqrt ((double)a); }

Definition at line 1071 of file basics.h.

#define STD__   std::

#define STRINGSTREAM   strstream

Definition at line 199 of file basics.h.

#define TALIGN (  ) 

Definition at line 457 of file basics.h.

#define TBCI__   TBCI::

#define TBCI_CONST (  )     x __attribute__ ((const)); x

Definition at line 462 of file basics.h.

#define TBCI_DLLEXPORT

Definition at line 117 of file basics.h.

#define TBCI_DLLLOCAL

Definition at line 118 of file basics.h.

#define TBCICLEAR ( n,
t,
 )     _tbci_fill < t > (s,n,t(0))

#define TBCICOMP ( n,
o,
t,
 ) 

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;                                                     \
})
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 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,
 )     _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 TBCIERRH1   __PRETTY_FUNCTION__

Definition at line 529 of file basics.h.

#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) + ")"

Definition at line 530 of file basics.h.

#define TBCIERRS ( cond,
exc,
txt,
ind   ) 

Value:

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

Definition at line 534 of file basics.h.

#define TBCIFILL ( n,
v,
t,
 )     _tbci_fill < t > (s,n,v)

#define THREAD__

Definition at line 720 of file basics.h.

#define TWEAK (  )     x __attribute__ ((weak)); x

Definition at line 488 of file basics.h.

#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().

#define UNUSED   __attribute__((unused))

Definition at line 476 of file basics.h.

#define USE_NS

Definition at line 70 of file basics.h.

#define USING_END   using namespace std;

Definition at line 338 of file basics.h.

#define USING_FD   using namespace Finite_Difference;

Definition at line 337 of file basics.h.

#define USING_GRID   using namespace Grid;

Definition at line 336 of file basics.h.

#define USING_STD   using namespace std;

Definition at line 339 of file basics.h.

#define USING_TBCI   using namespace TBCI;

Definition at line 335 of file basics.h.

#define VEC_INLINE

Definition at line 1133 of file basics.h.

#define VEC_INLINE

Definition at line 1133 of file basics.h.

#define VEC_INLINE   inline

Definition at line 1133 of file basics.h.

#define WEAK (  )     x __attribute__ ((weak)); x

Definition at line 484 of file basics.h.

#define WEAKA   __attribute__ ((weak))

Definition at line 483 of file basics.h.


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