1 #ifndef _GLUCAT_GLOBAL_H 2 #define _GLUCAT_GLOBAL_H 48 #define _GLUCAT_CTAssert(expr, msg) \ 49 namespace { struct msg { glucat::CTAssertion<(expr)> ERROR_##msg; }; } 53 template <
typename LHS_T,
typename RHS_T >
57 enum { are_same =
false };
59 template <
typename T >
63 enum { are_same =
true };
68 template<
bool truth_value >
72 enum { value = truth_value };
88 #if (ULONG_MAX == (4294967295UL)) 89 #define _GLUCAT_BITS_PER_ULONG 32 90 #elif (ULONG_MAX == (18446744073709551615UL)) 91 #define _GLUCAT_BITS_PER_ULONG 64 92 #elif defined(__WORDSIZE) 93 #define _GLUCAT_BITS_PER_ULONG __WORDSIZE 97 _GLUCAT_CTAssert(std::numeric_limits<unsigned char>::radix == 2, CannotDetermineBitsPerChar)
100 const index_t BITS_PER_CHAR =
std::numeric_limits<
unsigned char>::digits;
109 const index_t DEFAULT_LO = -index_t(BITS_PER_SET_VALUE / 2);
149 precision_t Function_Precision = DEFAULT_Function_Precision
155 enum { mult_matrix_threshold = Mult_Matrix_Threshold };
158 enum { div_max_steps = Div_Max_Steps };
161 enum { sqrt_max_steps = Sqrt_Max_Steps };
164 enum { log_max_outer_steps = Log_Max_Outer_Steps };
166 enum { log_max_inner_steps = Log_Max_Inner_Steps };
169 enum { basis_max_count = Basis_Max_Count };
172 enum { fast_size_threshold = Fast_Size_Threshold };
174 enum { inv_fast_dim_threshold = Inv_Fast_Dim_Threshold };
177 enum { products_size_threshold = Products_Size_Threshold };
184 template<
typename LHS_T,
typename RHS_T >
188 {
return lhs > 0? lhs % rhs : (-lhs) % rhs == 0 ? 0 : rhs - (-lhs) % rhs; }
191 #endif // _GLUCAT_GLOBAL_H
const double MS_PER_S
Timing constant: deprecated here - moved to test/timing.h.
precision_t
Precision policy.
const unsigned int DEFAULT_Products_Size_Threshold
_GLUCAT_CTAssert(std::numeric_limits< unsigned char >::radix==2, CannotDetermineBitsPerChar) const index_t BITS_PER_CHAR
If radix of unsigned char is not 2, we can't easily determine number of bits from sizeof...
const index_t BITS_PER_SET_VALUE
Number of bits in set_value_t.
const unsigned int DEFAULT_Mult_Matrix_Threshold
const unsigned int DEFAULT_Log_Max_Outer_Steps
const unsigned int DEFAULT_Sqrt_Max_Steps
const unsigned int DEFAULT_Fast_Size_Threshold
const unsigned int DEFAULT_Inv_Fast_Dim_Threshold
const unsigned int DEFAULT_Div_Max_Steps
const precision_t DEFAULT_Function_Precision
const unsigned int DEFAULT_Log_Max_Inner_Steps
const unsigned int DEFAULT_Basis_Max_Count
int index_t
Size of index_t should be enough to represent LO, HI.
unsigned long set_value_t
Size of set_value_t should be enough to contain index_set<LO,HI>
LHS_T pos_mod(LHS_T lhs, RHS_T rhs)
Modulo function which works reliably for lhs < 0.
const index_t DEFAULT_HI
Default highest index in an index set.
const double DEFAULT_TRUNCATION
Default for truncation.