chromabase.h

Go to the documentation of this file.
00001 // $Id: chromabase.h,v 3.0 2006/04/03 04:58:43 edwards Exp $
00002 //
00003 // Absolute basic stuff to use chroma
00004 //
00005 /*! \file
00006  * \brief Primary include file for CHROMA library code
00007  *
00008  * This is the absolute basic stuff to use Chroma in say
00009  * library codes.
00010  */
00011 
00012 #ifndef CHROMABASE_INCLUDE
00013 #define CHROMABASE_INCLUDE
00014 
00015 #include "qdp.h"
00016 // #include "chroma_config.h"   // turn off by default using config file
00017 
00018 using namespace QDP;
00019 
00020 namespace Chroma {
00021 
00022 // Trait classes 
00023 template<class T>
00024 struct PropTypeTraits {};
00025 
00026 template<>
00027 struct PropTypeTraits<LatticeDiracFermion>
00028 {
00029   typedef LatticeDiracPropagator   Type_t;
00030 };
00031 
00032 
00033 template<>
00034 struct PropTypeTraits<LatticeStaggeredFermion>
00035 {
00036   typedef LatticeStaggeredPropagator   Type_t;
00037 };
00038 
00039 
00040 // Extremely basic types
00041 enum PlusMinus {PLUS = 1, MINUS = -1};
00042 
00043 
00044 // Useful constants
00045 #if BASE_PRECISION == 32
00046 const Real fuzz = 1.0e-5;
00047 #elif BASE_PRECISION == 64
00048 const Real fuzz = 1.0e-10;
00049 #endif
00050 
00051 const Real twopi = 6.283185307179586476925286;
00052 
00053 
00054 // Hooks for various things
00055 #if defined(QDP_DEBUG_MEMORY)
00056 #define START_CODE() QDP::Allocator::theQDPAllocator::Instance().pushFunc(__func__, __LINE__)
00057 #define END_CODE()   QDP::Allocator::theQDPAllocator::Instance().popFunc()
00058 
00059 #else
00060 #define START_CODE() QDP_PUSH_PROFILE(QDP::getProfileLevel())
00061 #define END_CODE()   QDP_POP_PROFILE()
00062 
00063 #endif
00064 };
00065 
00066 #endif

Generated on Sun Nov 22 04:28:57 2009 for CHROMA by  doxygen 1.4.7