barry: Your go-to motif accountant  0.0-1
Full enumeration of sample space and fast count of sufficient statistics for binary arrays
barry-configuration.hpp
Go to the documentation of this file.
1 #ifndef BARRY_CONFIGURATION_HPP
2 #define BARRY_CONFIGURATION_HPP
3 
22 #ifdef BARRY_USE_UNORDERED_MAP
23  template<typename Ta,typename Tb>
24  using Map = std::unordered_map<Ta,Tb>;
25 #else
26  template<typename Ta,typename Tb>
27  using Map = std::map<Ta,Tb>;
28 #endif
29 
30 #ifdef BARRY_USE_SAFE_EXP
31  #define BARRY_SAFE_EXP
32 #else
33  #define BARRY_SAFE_EXP -100.0
34 #endif
35 
36 #ifdef BARRY_USE_ISFINITE
37  #define BARRY_ISFINITE(a) if (!std::isfinite( (a) )) \
38  throw std::overflow_error("The likelihood function has overflowed.");
39 #else
40  #define BARRY_ISFINITE(a)
41 #endif
42 
43 #ifdef BARRAY_USE_CHECK_SUPPORT
44  #define BARRY_CHECK_SUPPORT(x, maxs) if ((x).size() > (maxs)) \
45  throw std::length_error("The support has exceeded its maximum size.");
46 #else
47  #define BARRY_CHECK_SUPPORT(x, maxs)
48 #endif
49 
50 #ifndef printf_barry
51  #define printf_barry printf
52 #endif
53 
54 #ifndef BARRY_MAX_NUM_ELEMENTS
55  #define BARRY_MAX_NUM_ELEMENTS static_cast< size_t >(std::numeric_limits< size_t >::max() /2u)
56 #endif
57 
58 #if defined(__OPENMP) || defined(_OPENMP)
59  #define BARRY_WITH_OMP
60  #include <omp.h>
61 #endif
62 
63 
64 #ifdef BARRY_USE_LATEX
65  #define BARRY_WITH_LATEX
66 #else
67  #undef BARRY_WITH_LATEX
68 #endif
69 
70 // BARRY_DEBUG_LEVEL: See barry-debug.hpp
71 
72 // BARRY_PROGRESS_BAR_WIDTH: See progress.hpp
73 
75 
76 #endif
std::map< Ta, Tb > Map