48 #include "config_HAVE_ASSERTS.hpp" 50 #include <boost/concept/usage.hpp> 51 #include <boost/iterator/iterator_facade.hpp> 52 #include <boost/lexical_cast.hpp> 61 #define STR_CST_string_separator std::string(1, 31) 64 #define STR_CST_string_separator_char static_cast<char>(31) 67 #define INFINITE_INT (std::numeric_limits<int>::max()) 70 #define INFINITE_UINT (std::numeric_limits<unsigned int>::max()) 73 #define INFINITE_SIZE_T (std::numeric_limits<size_t>::max()) 76 #define INFINITE_DOUBLE (std::numeric_limits<double>::max()) 79 #define INFINITE_LONG_DOUBLE (std::numeric_limits<long double>::max()) 82 #define INFINITE_ULONGLONG_INT (std::numeric_limits<unsigned long long int>::max()) 85 #define MINUS_INFINITE_LONG_DOUBLE (std::numeric_limits<long double>::min()) 89 #define DEBUG_PARAMETER(parameter) 91 #define DEBUG_PARAMETER(parameter) parameter 94 #define ASSERT_PARAMETER(parameter) parameter 96 #define ASSERT_PARAMETER(parameter) 102 #define GET_CLASS_NAME(meth) #meth 107 #define GET_FUNCTION_DEBUG_LEVEL(parameters) parameters->GetFunctionDebugLevel(GET_CLASS(*this), __func__) 113 std::string bin_value;
114 for(
unsigned int ind = 0; ind < precision; ind++)
116 bin_value = bin_value + (((
integer_cst_t(1) << (precision - ind - 1)) &
value) ?
'1' :
'0');
121 template <
typename _InputIt>
122 std::string
container_to_string(_InputIt first, _InputIt last,
const std::string& separator,
bool trim_empty =
true)
127 auto estr = boost::lexical_cast<std::string>(*first);
128 if(!trim_empty || estr.size())
141 template <
typename _Container>
142 std::string
container_to_string(
const _Container& _c,
const std::string& separator,
bool trim_empty =
true)
147 template <
typename _OutputIt>
149 bool trim_empty =
true)
151 auto curr = str.data();
152 std::string::size_type last = 0;
155 auto next = str.find(separator, last);
156 auto _len = next != std::string::npos ? (next - last) : (str.size() - last);
157 if(!trim_empty || _len)
159 *first++ = boost::lexical_cast<
typename _OutputIt::container_type::value_type>(curr, _len);
163 }
while(last < str.size());
166 template <
typename _Container>
206 bool operator()(std::string::const_iterator& next, std::string::const_iterator& end,
207 std::basic_string<
char, std::char_traits<char>, std::allocator<char>>& tok)
213 std::string current(next, end);
214 if(current.find(delimiter) != std::string::npos)
216 tok = current.substr(0, current.find(delimiter));
252 long double ld = example;
263 void ShuffleVector(
typename std::vector<T>& shuffle,
const unsigned int seed)
266 size_t size = shuffle.size();
269 size_t k =
static_cast<size_t>(rand()) % size;
273 T temp = shuffle[size];
274 shuffle[size] = shuffle[
k];
292 explicit TimeStamp(
const std::string& timestamp);
297 static std::string GetCurrentTimeStamp();
Functor to tokenize string used with boost::tokenizer.
Concept checking class This class is used to check that an object can be converted into long double...
const std::string delimiter
The delimiter.
string_separator()
Empty constructor.
Definition of hash function for EdgeDescriptor.
string_separator(const std::string &_delimiter)
Constructor.
Auxiliary methods for manipulating string.
bool operator()(std::string::const_iterator &next, std::string::const_iterator &end, std::basic_string< char, std::char_traits< char >, std::allocator< char >> &tok)
Tokenize operator.
std::string convert_to_binary(G _value, unsigned long long precision)
static const uint32_t k[]
constexpr void string_to_container(_OutputIt first, const std::string &str, const std::string &separator, bool trim_empty=true)
void reset()
Reset function (required to implement boost tokenizerFunction model.
BOOST_CONCEPT_USAGE(check_long_double)
bool operator<=(const DiscrepancyOpInfo &a, const DiscrepancyOpInfo &b)
std::ostream & operator<<(std::ostream &OS, const Range &R)
The type used for timestamp.
std::string container_to_string(_InputIt first, _InputIt last, const std::string &separator, bool trim_empty=true)
unsigned counter[N_THREADS]
void ShuffleVector(typename std::vector< T > &shuffle, const unsigned int seed)
Randomly shuffle a vector.