ModErn Text Analysis
META Enumerates Textual Applications
|
Shared resources and utilities. More...
Classes | |
struct | aligned_allocator |
class | array_view |
A non-owning reference to an array (or part of one). More... | |
class | bad_optional_access |
Exception thrown when trying to obtain the value of a non-engaged optional. More... | |
class | basic_range |
Implements a range that spans a loop's extension and termination conditions, most useful for iterating over a range of numbers with a range-based for loop. More... | |
class | basic_string_view |
A non-owning reference to a string. More... | |
class | chunk_iterator |
A simple implementation of the ChunkIterator concept that reads Records from a binary file using io::packed::read. More... | |
class | comparable |
A CRTP base class that allows for inheritance of all comparator operators given that the derived class defines an operator<(). More... | |
class | dense_matrix |
Simple wrapper class for representing a dense matrix laid out in row-major order (that is, its internal representation is a linear array of the rows). More... | |
class | destructive_chunk_iterator |
A simple implementation of the ChunkIterator concept that reads Records from a binary file using io::packed::read and deletes the underlying file when it reaches EOF. More... | |
class | disk_vector |
disk_vector represents a large constant-size vector that does not necessarily fit in memory. More... | |
class | disk_vector_exception |
Basic exception for disk_vector. More... | |
class | factory |
Generic factory that can be subclassed to create factories for specific types. More... | |
class | factory_exception |
Simple exception for factories. More... | |
class | fixed_heap |
Keeps a constant number of high-priority elements. More... | |
struct | identifier |
Base template that denotes an identifier. More... | |
class | invertible_map |
This data structure indexes by keys as well as values, allowing constant amortized lookup time by key or value. More... | |
class | invertible_map_exception |
Basic exception for invertible_map interactions. More... | |
struct | is_numeric |
Type trait for numeric. More... | |
class | multilevel_clonable |
Template class to facilitate polymorphic cloning. More... | |
struct | nullopt_t |
A dummy type for representing a disengaged option<T>. More... | |
struct | numeric |
Empty helper class to denote that something is numeric. More... | |
struct | numerical_identifier |
A CRTP template base that adds numeric functionality to the identifier type. More... | |
class | optional |
A class for representing optional values. More... | |
struct | optional_dummy_t |
A dummy type for optional storage. More... | |
union | optional_storage |
A storage class for the optional<T> class. More... | |
class | persistent_stack |
class | persistent_stack_exception |
class | pimpl |
Class to assist in simple pointer-to-implementation classes. More... | |
class | sparse_vector |
Represents a sparse vector, indexed by type Index and storing values of type Value. More... | |
class | transform_iterator |
Wrapper around an Iterator that, when dereferenced, returns f(*it) where it is the wrapped Iterator and f is a UnaryFunction. More... | |
struct | trivial_init_t |
A tag for trivial initialization of optional storage. More... | |
Typedefs | |
template<class T , std::size_t Alignment = 64> | |
using | aligned_vector = std::vector< T, aligned_allocator< T, Alignment >> |
template<class Base , class Derived > | |
using | clonable = multilevel_clonable< Base, Base, Derived > |
Template alias to facilitate polymorphic cloning. More... | |
using | string_view = basic_string_view< char > |
using | u16string_view = basic_string_view< char16_t > |
using | u32string_view = basic_string_view< char32_t > |
using | wstring_view = basic_string_view< wchar_t > |
template<class A , class B > | |
using | disable_if_same_or_derived_t = typename std::enable_if<!std::is_base_of< A, typename std::remove_reference< B >::type >::value >::type |
Functions | |
template<class InputIt , class ForwardIt , class BinOp > | |
void | for_each_token (InputIt first, InputIt last, ForwardIt s_first, ForwardIt s_last, BinOp binary_op) |
Applys the binary operator to each token in the range [first, last) that is delimited a token in [s_first, s_last). More... | |
template<class InputIt , class Delims , class BinOp > | |
void | for_each_token (InputIt first, InputIt last, const Delims &delims, BinOp binary_op) |
Applys the binary operator to each token in the range [first, last) that is delimited a token in delims. More... | |
template<class T , class U , std::size_t Alignment> | |
bool | operator== (const aligned_allocator< T, Alignment > &, const aligned_allocator< U, Alignment > &) |
template<class T , class U , std::size_t Alignment> | |
bool | operator!= (const aligned_allocator< T, Alignment > &, const aligned_allocator< U, Alignment > &) |
template<class T , class BinaryFunction > | |
fixed_heap< T, BinaryFunction > | make_fixed_heap (uint64_t max_elems, BinaryFunction &&bf) |
Constructs a fixed_heap from a maximum size and binary comparison function. | |
template<class HashAlgorithm , class Tag , class T > | |
void | hash_append (HashAlgorithm &h, const identifier< Tag, T > &id) |
template<class Iterator , class UnaryFunction > | |
transform_iterator< Iterator, UnaryFunction > | make_transform_iterator (Iterator it, UnaryFunction &&fun) |
Helper function to construct a transform_iterator from an Iterator and a UnaryFunction to transform the values of that Iterator. | |
template<class ForwardIterator , class RecordHandler , class Compare , class ShouldMerge , class ProgressTrait = printing::default_progress_trait> | |
uint64_t | multiway_merge (ForwardIterator begin, ForwardIterator end, Compare &&record_comp, ShouldMerge &&should_merge, RecordHandler &&output, ProgressTrait=ProgressTrait{}) |
A generic algorithm for performing an N-way merge on a collection of sorted "chunks". More... | |
template<class ForwardIterator , class RecordHandler , class ProgressTrait = printing::default_progress_trait> | |
uint64_t | multiway_merge (ForwardIterator begin, ForwardIterator end, RecordHandler &&output, ProgressTrait=ProgressTrait{}) |
A simplified wrapper for multiway_merge that uses the default comparison (operator<) and merge criteria (operator==). | |
template<class Record > | |
bool | operator!= (const chunk_iterator< Record > &a, const chunk_iterator< Record > &b) |
template<class T > | |
bool | operator< (const optional< T > &lhs, const optional< T > &rhs) |
template<class T > | |
basic_range< T > | range (const T &begin, const T &end) |
Constructs a range based on a beginning and ending value. More... | |
template<class T > | |
basic_range< T > | range (const T &begin, const T &end, const T &step) |
Constructs a range based on a beginning value, and ending value, and a step size. More... | |
template<class Index , class Value > | |
sparse_vector< Index, Value > | operator+ (const sparse_vector< Index, Value > &lhs, const sparse_vector< Index, Value > &rhs) |
template<class Index , class Value > | |
sparse_vector< Index, Value > | operator+ (sparse_vector< Index, Value > &&lhs, const sparse_vector< Index, Value > &rhs) |
template<class Index , class Value > | |
sparse_vector< Index, Value > | operator+ (const sparse_vector< Index, Value > &lhs, sparse_vector< Index, Value > &&rhs) |
template<class Index , class Value > | |
sparse_vector< Index, Value > | operator+ (sparse_vector< Index, Value > &&lhs, sparse_vector< Index, Value > &&rhs) |
template<class Index , class Value > | |
sparse_vector< Index, Value > | operator- (const sparse_vector< Index, Value > &lhs, const sparse_vector< Index, Value > &rhs) |
template<class Index , class Value > | |
sparse_vector< Index, Value > | operator- (sparse_vector< Index, Value > &&lhs, const sparse_vector< Index, Value > &rhs) |
template<class Index , class Value > | |
sparse_vector< Index, Value > | operator- (sparse_vector< Index, Value > &&lhs, sparse_vector< Index, Value > &&rhs) |
template<class SparseVector1 , class SparseVector2 > | |
double | dot_product (SparseVector1 &&first, SparseVector2 &&second) |
template<class Char , class Traits > | |
constexpr bool | operator== (basic_string_view< Char, Traits > lhs, basic_string_view< Char, Traits > rhs) noexcept |
template<class Char , class Traits > | |
constexpr bool | operator== (basic_string_view< Char, Traits > lhs, identity< basic_string_view< Char, Traits >> rhs) noexcept |
template<class Char , class Traits > | |
constexpr bool | operator== (identity< basic_string_view< Char, Traits >> lhs, basic_string_view< Char, Traits > rhs) noexcept |
template<class Char , class Traits > | |
constexpr bool | operator!= (basic_string_view< Char, Traits > lhs, basic_string_view< Char, Traits > rhs) noexcept |
template<class Char , class Traits > | |
constexpr bool | operator!= (basic_string_view< Char, Traits > lhs, identity< basic_string_view< Char, Traits >> rhs) noexcept |
template<class Char , class Traits > | |
constexpr bool | operator!= (identity< basic_string_view< Char, Traits >> lhs, basic_string_view< Char, Traits > rhs) noexcept |
template<class Char , class Traits > | |
constexpr bool | operator< (basic_string_view< Char, Traits > lhs, basic_string_view< Char, Traits > rhs) noexcept |
template<class Char , class Traits > | |
constexpr bool | operator< (basic_string_view< Char, Traits > lhs, identity< basic_string_view< Char, Traits >> rhs) noexcept |
template<class Char , class Traits > | |
constexpr bool | operator< (identity< basic_string_view< Char, Traits >> lhs, basic_string_view< Char, Traits > rhs) noexcept |
template<class Char , class Traits > | |
constexpr bool | operator> (basic_string_view< Char, Traits > lhs, basic_string_view< Char, Traits > rhs) noexcept |
template<class Char , class Traits > | |
constexpr bool | operator> (basic_string_view< Char, Traits > lhs, identity< basic_string_view< Char, Traits >> rhs) noexcept |
template<class Char , class Traits > | |
constexpr bool | operator> (identity< basic_string_view< Char, Traits >> lhs, basic_string_view< Char, Traits > rhs) noexcept |
template<class Char , class Traits > | |
constexpr bool | operator<= (basic_string_view< Char, Traits > lhs, basic_string_view< Char, Traits > rhs) noexcept |
template<class Char , class Traits > | |
constexpr bool | operator<= (basic_string_view< Char, Traits > lhs, identity< basic_string_view< Char, Traits >> rhs) noexcept |
template<class Char , class Traits > | |
constexpr bool | operator<= (identity< basic_string_view< Char, Traits >> lhs, basic_string_view< Char, Traits > rhs) noexcept |
template<class Char , class Traits > | |
constexpr bool | operator>= (basic_string_view< Char, Traits > lhs, basic_string_view< Char, Traits > rhs) noexcept |
template<class Char , class Traits > | |
constexpr bool | operator>= (basic_string_view< Char, Traits > lhs, identity< basic_string_view< Char, Traits >> rhs) noexcept |
template<class Char , class Traits > | |
constexpr bool | operator>= (identity< basic_string_view< Char, Traits >> lhs, basic_string_view< Char, Traits > rhs) noexcept |
template<class Char , class Traits > | |
std::basic_ostream< Char, Traits > & | operator<< (std::basic_ostream< Char, Traits > &os, basic_string_view< Char, Traits > str) |
string_view | make_string_view (std::string::const_iterator begin, std::string::const_iterator end) |
Variables | |
constexpr struct meta::util::trivial_init_t | trivial_init |
constexpr nullopt_t | nullopt {nullopt_t::init{}} |
A global nullopt_t constant. | |
Shared resources and utilities.
using meta::util::clonable = typedef multilevel_clonable<Base, Base, Derived> |
Template alias to facilitate polymorphic cloning.
Use in place of an ordinary base class, with first parameter being the base class and the second parameter being the current class (CRTP style).
void meta::util::for_each_token | ( | InputIt | first, |
InputIt | last, | ||
ForwardIt | s_first, | ||
ForwardIt | s_last, | ||
BinOp | binary_op | ||
) |
Applys the binary operator to each token in the range [first, last) that is delimited a token in [s_first, s_last).
void meta::util::for_each_token | ( | InputIt | first, |
InputIt | last, | ||
const Delims & | delims, | ||
BinOp | binary_op | ||
) |
Applys the binary operator to each token in the range [first, last) that is delimited a token in delims.
uint64_t meta::util::multiway_merge | ( | ForwardIterator | begin, |
ForwardIterator | end, | ||
Compare && | record_comp, | ||
ShouldMerge && | should_merge, | ||
RecordHandler && | output, | ||
ProgressTrait | = ProgressTrait{} |
||
) |
A generic algorithm for performing an N-way merge on a collection of sorted "chunks".
The following concepts are involved:
ChunkIterator: A ChunkIterator is an iterator over Records within a chunk. Typically, these will be streamed-in from disk, and thus ChunkIterator can be thought of as an InputIterator with a few additional functions.
ChunkIterators must dereference to a Record.
Comparison operators for (in)equality must be provided. A ChunkIterator that cannot read any more Records must compare equal to the default-constructed ChunkIterator.
ChunkIterator's operator++ shall buffer in (at least) the next Record, which can be obtained via the dereference operator.
ChunkIterators also keep track of the state of the underlying InputStream from which Records are read. ChunkIterators shall provide two observer functions for the state of that stream: total_bytes(), which indicates the total number of bytes that occur in the stream, and bytes_read(), which indicates the total number of bytes that have been consumed from the stream thus far. When bytes_read() == total_bytes(), the stream has been exhausted and the iterator shall compare equal to the default-constructed ChunkIterator.
basic_range<T> meta::util::range | ( | const T & | begin, |
const T & | end | ||
) |
Constructs a range based on a beginning and ending value.
begin | The desired start for the range |
end | The desired end for the range |
basic_range<T> meta::util::range | ( | const T & | begin, |
const T & | end, | ||
const T & | step | ||
) |
Constructs a range based on a beginning value, and ending value, and a step size.
begin | The desired start for the range |
end | The desired end for the range |
step | The desired step size for the range |