ADS
Algorithms and Data Structures
Loading...
Searching...
No Matches
Algebra.h

The algebra of the aggregates, beyond the book. More...

Files

file  ADS/Algebra.h
 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).

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

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...

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

Detailed description

The algebra of the aggregates, beyond the book.

The definitions, the invariants and the costs of the area are in Theory of the foundations.

Variable documentation

◆ exact_v

template<class G>
bool ADS::exact_v
inlineconstexpr
Initial value:
=
! std::is_floating_point_v< typename G::Value >

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