CHROMA
chromabase.h
Go to the documentation of this file.
1 //
2 // Absolute basic stuff to use chroma
3 //
4 /*! \file
5  * \brief Primary include file for CHROMA library code
6  *
7  * This is the absolute basic stuff to use Chroma in say
8  * library codes.
9  */
10 
11 #ifndef CHROMABASE_INCLUDE
12 #define CHROMABASE_INCLUDE
13 
14 #include "qdp.h"
15 // #include "chroma_config.h" // turn off by default using config file
16 
17 #include <map>
18 #include <exception>
19 #include <typeinfo>
20 #include <cassert>
21 
22 using namespace QDP;
23 
24 namespace Chroma {
25 
26 // Trait classes
27 template<class T>
28 struct PropTypeTraits {};
29 
30 template<>
31 struct PropTypeTraits<LatticeDiracFermion>
32 {
33  typedef LatticeDiracPropagator Type_t;
34 };
35 
36 
37 template<>
38 struct PropTypeTraits<LatticeStaggeredFermion>
39 {
40  typedef LatticeStaggeredPropagator Type_t;
41 };
42 
43 
44 // Extremely basic types
45 enum PlusMinus {PLUS = 1, MINUS = -1};
46 
47 
48 // Useful constants
49 #if BASE_PRECISION == 32
50 const Real fuzz = 1.0e-5;
51 #elif BASE_PRECISION == 64
52 const Real fuzz = 1.0e-10;
53 #endif
54 
55 const Real twopi = 6.283185307179586476925286;
56 
57 
58 // Hooks for various things
59 #if defined(QDP_DEBUG_MEMORY)
60 #define START_CODE() QDP::Allocator::theQDPAllocator::Instance().pushFunc(__func__, __LINE__)
61 #define END_CODE() QDP::Allocator::theQDPAllocator::Instance().popFunc()
62 
63 #else
64 #define START_CODE() QDP_PUSH_PROFILE(QDP::getProfileLevel())
65 #define END_CODE() QDP_POP_PROFILE()
66 
67 #endif
68 }
69 
70 #endif
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
@ MINUS
Definition: chromabase.h:45
@ PLUS
Definition: chromabase.h:45
const Real twopi
Definition: chromabase.h:55