|
ADS
Algorithms and Data Structures
|
The algebra of the aggregates, beyond the book: the concepts by which a structure that keeps a combination of values (a prefix sum, the aggregate of a window, the augmentation of a tree) chooses its update rule at compile time (see The algebra of the aggregates). More...
#include <concepts>#include <cstddef>#include <limits>#include <type_traits>Go to the source code of this file.
Classes | |
| struct | ADS::SumOf< T > |
| the abelian group of the sums of T, of identity T() More... | |
| struct | ADS::MinOf< T > |
| the selective commutative monoid of the least value of T, of identity \( +\infty \) if T has it, its largest value otherwise More... | |
| struct | ADS::MaxOf< T > |
| the selective commutative monoid of the largest value of T, of identity \( -\infty \) if T has it, its least value otherwise More... | |
Namespaces | |
| namespace | ADS |
Concepts | |
| concept | ADS::Monoid |
| a monoid on G::Value: the identity G::identity() and the associative operation G::combine( a , b ) | |
| concept | ADS::CommutativeMonoid |
| a monoid whose operation commutes, by the opt-in G::commutative | |
| concept | ADS::Group |
| a monoid with the inverse G::inverse( a ), i.e., combine( inverse( a
) , a ) and combine( a , inverse( a ) ) are the identity | |
| concept | ADS::AbelianGroup |
| a group whose operation commutes | |
| concept | ADS::Selective |
| a monoid whose combine( a , b ) is always \( a \) or \( b \), by the opt-in G::selective | |
| concept | ADS::Action |
| a monoid of the maps A::Map acting on the values of the monoid G: the identity map A::id(), the composition A::compose( f , g ) (first \( g \), then \( f \)), and A::apply( f , a , n ), the map applied to the aggregate \( a \) of \( n \) values | |
Variables | |
| template<class G> | |
| constexpr bool | ADS::exact_v |
| whether the values of G are exact, false for the floating point types, whose groups drift by rounding when a value leaves by its inverse | |
The algebra of the aggregates, beyond the book: the concepts by which a structure that keeps a combination of values (a prefix sum, the aggregate of a window, the augmentation of a tree) chooses its update rule at compile time (see The algebra of the aggregates).
An algebra G is a type with static members, as the augmentations of JoinTree [see JoinTree.h], of which these are refinements by opt-in members:
SumOf< T > (the abelian group of the sums), MinOf< T > and MaxOf< T > (the selective commutative monoids of the least and of the largest value, of identity the largest and the least value of T) are the algebras that the structures of ADS use most. A type with the members from() of an augmentation of JoinTree and these is both.