Stride Reference Manual
- generated for commit 9643b11
|
Utilities for the project. More...
Namespaces | |
detail | |
ii_detail | |
Classes | |
struct | BoxPlotData |
BoxPlotData calculates total, minimum, maximum, median, lower and upper quartile of the values in the vector. More... | |
class | ConfigInfo |
Config information. More... | |
class | CSV |
A collection of CSVRow elements. More... | |
class | CSVRow |
Row in CSV file. More... | |
class | Exception |
Basic exception class: needed to prevent clang-tidy warning "thrown exception type is not nothrow copy constructible". More... | |
class | FileSys |
Utilities for interaction with filesystem. More... | |
struct | is_iterator |
When it 's not an iterator. More... | |
struct | is_iterator< T, ii_detail::void_t< typename std::iterator_traits< T >::iterator_category > > |
When it is an iterator. More... | |
class | LogUtils |
Utilities for logging (spdlog). More... | |
class | Rn |
Manages random number generation in parallel (OpenMP) calculations. More... | |
struct | RnInfo |
Information on random number management state. More... | |
class | RnMan |
class | RunConfigManager |
Produce run config ptree. More... | |
class | SegmentedVector |
Container that stores objects "almost contiguously" (in a chain of blocks) and guarantees that pointers/iterators are not invalidated when the container grows. More... | |
class | SliceIndexer |
Datastructure to index a container (supporting RandomAccessIterators) with slices. More... | |
class | Stopwatch |
Provides a stopwatch interface to time: it accumulates time between start/stop pairs. More... | |
class | Subject |
Template for Subject/Observer (or Publish/Subscribe). More... | |
class | SVIterator |
Implementation of iterator for SegmentedVector. More... | |
class | TimeStamp |
Provides wall-clock time stamp using the time call. More... | |
struct | TimeToString |
Utilities to tag clocks and to reformat number of ticks to a string. More... | |
Functions | |
std::string | AssertMessage (const char *condition, const std::string &message, const std::shared_ptr< spdlog::logger > &logger, const char *file, int line) |
std::ofstream & | operator<< (std::ofstream &ofs, const CSV &csv) |
template<> | |
std::string | CSVRow::GetValue< std::string > (size_t index) const |
specialization for string More... | |
template<> | |
std::string | CSVRow::GetValue< std::string > (const std::string &label) const |
specialization for string More... | |
std::ostream & | operator<< (std::ostream &os, const CSVRow &row) |
template<typename T , std::enable_if_t< std::is_arithmetic< T >::value, int > = 0> | |
T | safe_cast (const std::string &val) |
Converts a string to an arithmetic type, in a safe manner. More... | |
template<class Sequence > | |
Sequence | ToSequence (const boost::property_tree::ptree &ptree) |
template<class T , std::size_t N> | |
std::array< T, N > | ToArray (const boost::property_tree::ptree &ptree) |
template<class Ptree > | |
Ptree | Merge (const Ptree &pt1, const Ptree &pt2) |
std::ostream & | operator<< (std::ostream &os, const RnInfo &info) |
template<typename T , size_t N = 512, bool Safe = true> | |
bool | operator== (const SegmentedVector< T, N, Safe > &lhs, const SegmentedVector< T, N, Safe > &rhs) |
Helper function for equality test (equal size and all elements equal). More... | |
template<typename T , size_t N = 512, bool Safe = true> | |
bool | operator!= (const SegmentedVector< T, N, Safe > &lhs, const SegmentedVector< T, N, Safe > &rhs) |
Helper function for inequality test (unequal size or not all elements equal). More... | |
template<typename T > | |
SliceIndexer< T > | make_slice_indexer (T &t) |
template<typename T > | |
std::ostream & | operator<< (std::ostream &oss, Stopwatch< T > const &stopwatch) |
Insert accumulated time into output stream without altering stopwatch state. More... | |
bool | CheckAllDigits (const std::string &s) |
All characters in string are digits (or string is empty) More... | |
template<typename T > | |
T | FromString (const std::string &s) |
Builds a value of type T representation from a string. More... | |
std::vector< std::string > | Split (const std::string &s, const std::string &delimiters) |
Split a string (in order of occurence) by splitting it on the given delimiters. More... | |
std::vector< std::string > | Tokenize (const std::string &str, const std::string &delimiters) |
Tokenize a string (in order of occurence) with the given delimiters. More... | |
template<typename T > | |
std::string | ToString (const T &value) |
Builds a string representation of a value of type T. More... | |
template<> | |
std::string | ToString< std::string > (const std::string &value) |
template<typename It > | |
std::vector< std::string > | ToString (typename std::enable_if<!std::is_same< typename It::value_type, std::string >::value, It >::type first, It last) |
Stringify values (that are not strings) in a range and put them in a vector. More... | |
template<typename It > | |
std::vector< std::string > | ToString (typename std::enable_if< std::is_same< typename It::value_type, std::string >::value, It >::type first, It last) |
Stringify values (that are strings - so no-op) in a range and put them in a vector. More... | |
template<typename T > | |
std::string | ToString (const T &value, int width, char fill= ' ') |
Builds a string representation with minimum width of a value of type T. More... | |
std::string | ToLower (const std::string &source) |
Builds a string with lower case characters only. More... | |
std::string | ToUpper (const std::string &source) |
Builds a string with upper case characters only. More... | |
std::string | TrimRight (const std::string &source, const std::string &t=" ") |
Trim characters at right end of string. More... | |
std::string | TrimLeft (const std::string &source, const std::string &t=" ") |
Trim characters at left end of string. More... | |
std::string | Trim (const std::string &source, const std::string &t=" ") |
Trim characters at both ends of string. More... | |
template<typename T > | |
std::string | intToDottedString (const T &value) |
template<typename T , std::size_t N, bool Safe, typename P = const T*, typename R = const T&, bool is_const_iterator = true> | |
SVIterator< T, N, Safe, P, R, is_const_iterator > | operator+ (std::ptrdiff_t i, SVIterator< T, N, Safe, P, R, is_const_iterator > p) |
template<typename T , std::size_t N, bool Safe, typename P = const T*, typename R = const T&, bool is_const_iterator = true> | |
SVIterator< T, N, Safe, P, R, is_const_iterator > | operator- (std::ptrdiff_t i, SVIterator< T, N, Safe, P, R, is_const_iterator > p) |
std::ostream & | operator<< (std::ostream &os, TimeStamp t) |
TimeStamp helper inserts string representation in output stream. More... | |
Utilities for the project.
|
inline |
|
inline |
Definition at line 134 of file CSV.h.
References stride::util::CSV::WriteLabels(), and stride::util::CSV::WriteRows().
std::string stride::util::CSVRow::GetValue< std::string > | ( | size_t | index | ) | const |
specialization for string
Declaration of specialization.
Definition at line 54 of file CSVRow.cpp.
References stride::util::CSV::GetColumnCount(), stride::util::CSVRow::m_parent, stride::util::CSVRow::m_values, and ToString().
std::string stride::util::CSVRow::GetValue< std::string > | ( | const std::string & | label | ) | const |
specialization for string
Declaration of specialization.
Definition at line 64 of file CSVRow.cpp.
References stride::util::CSV::GetIndexForLabel(), stride::util::CSVRow::GetValue(), and stride::util::CSVRow::m_parent.
std::ostream& stride::util::operator<< | ( | std::ostream & | os, |
const CSVRow & | row | ||
) |
Definition at line 72 of file CSVRow.cpp.
References stride::util::CSVRow::m_values.
|
inline |
Converts a string to an arithmetic type, in a safe manner.
Converts a string to a type.
bad_lexical_cast | if val can't be converted to a double or int |
bad_numeric_cast | if val can't be converted to T |
T | the type to safe cast to |
val | the value to cast |
bad_lexical_cast | if val can't be converted to T |
T | the type to safe cast to |
val | the value to cast |
Definition at line 74 of file CSVRow.h.
Referenced by stride::util::CSVRow::GetValue().
Sequence stride::util::ToSequence | ( | const boost::property_tree::ptree & | ptree | ) |
Definition at line 49 of file PtreeUtils.h.
std::array<T, N> stride::util::ToArray | ( | const boost::property_tree::ptree & | ptree | ) |
Definition at line 61 of file PtreeUtils.h.
Ptree stride::util::Merge | ( | const Ptree & | pt1, |
const Ptree & | pt2 | ||
) |
Definition at line 78 of file PtreeUtils.h.
|
inline |
Definition at line 42 of file RnInfo.h.
References stride::util::RnInfo::m_seed_seq_init, stride::util::RnInfo::m_state, and stride::util::RnInfo::m_stream_count.
|
inline |
Helper function for equality test (equal size and all elements equal).
Definition at line 365 of file SegmentedVector.h.
References stride::util::SegmentedVector< T, N, Safe >::cbegin(), and stride::util::SegmentedVector< T, N, Safe >::cend().
Referenced by operator!=().
|
inline |
Helper function for inequality test (unequal size or not all elements equal).
Definition at line 374 of file SegmentedVector.h.
References operator==().
SliceIndexer<T> stride::util::make_slice_indexer | ( | T & | t | ) |
Definition at line 97 of file SliceIndexer.h.
std::ostream& stride::util::operator<< | ( | std::ostream & | oss, |
Stopwatch< T > const & | stopwatch | ||
) |
Insert accumulated time into output stream without altering stopwatch state.
Definition at line 125 of file Stopwatch.h.
|
inline |
All characters in string are digits (or string is empty)
Definition at line 36 of file StringUtils.h.
Referenced by stride::util::Rn< E >::Initialize().
|
inline |
Builds a value of type T representation from a string.
Definition at line 49 of file StringUtils.h.
Referenced by stride::util::RunConfigManager::AddGeoPopConfig(), and stride::util::RunConfigManager::Create().
|
inline |
Split a string (in order of occurence) by splitting it on the given delimiters.
Definition at line 58 of file StringUtils.h.
Referenced by stride::util::Rn< E >::Initialize(), stride::DefaultPopBuilder::MakePersons(), and stride::util::CSV::ReadFromStream().
|
inline |
Tokenize a string (in order of occurence) with the given delimiters.
Multiple consecutive delimiters do NOT define "empty" tokens; they are skipped.
Definition at line 67 of file StringUtils.h.
Referenced by main().
|
inline |
Builds a string representation of a value of type T.
Definition at line 90 of file StringUtils.h.
Referenced by stride::util::CSV::AddRow(), stride::util::CSV::CSV(), stride::util::CSVRow::CSVRow(), CSVRow::GetValue< std::string >(), and ToString().
|
inline |
Definition at line 98 of file StringUtils.h.
|
inline |
Stringify values (that are not strings) in a range and put them in a vector.
Definition at line 105 of file StringUtils.h.
References ToString().
|
inline |
Stringify values (that are strings - so no-op) in a range and put them in a vector.
Definition at line 117 of file StringUtils.h.
|
inline |
Builds a string representation with minimum width of a value of type T.
Definition at line 127 of file StringUtils.h.
|
inline |
Builds a string with lower case characters only.
Definition at line 135 of file StringUtils.h.
Referenced by stride::util::FileSys::Initialize(), and stride::DiseaseSeeder::Vaccinate().
|
inline |
Builds a string with upper case characters only.
Definition at line 144 of file StringUtils.h.
|
inline |
Trim characters at right end of string.
Definition at line 153 of file StringUtils.h.
Referenced by Trim().
|
inline |
Trim characters at left end of string.
Definition at line 160 of file StringUtils.h.
Referenced by Trim().
|
inline |
Trim characters at both ends of string.
Definition at line 167 of file StringUtils.h.
References TrimLeft(), and TrimRight().
Referenced by stride::util::CSVRow::CSVRow(), and stride::util::CSV::ReadFromStream().
|
inline |
Definition at line 173 of file StringUtils.h.
Referenced by geopop::operator<<().
SVIterator<T, N, Safe, P, R, is_const_iterator> stride::util::operator+ | ( | std::ptrdiff_t | i, |
SVIterator< T, N, Safe, P, R, is_const_iterator > | p | ||
) |
Definition at line 253 of file SVIterator.h.
SVIterator<T, N, Safe, P, R, is_const_iterator> stride::util::operator- | ( | std::ptrdiff_t | i, |
SVIterator< T, N, Safe, P, R, is_const_iterator > | p | ||
) |
Definition at line 261 of file SVIterator.h.
|
inline |
TimeStamp helper inserts string representation in output stream.
Definition at line 53 of file TimeStamp.h.
References stride::util::TimeStamp::ToString().