Dedekind 0.0.0
A structuralist C++23 Module Library
Loading...
Searching...
No Matches
dedekind::category::AtMost< T, K > Struct Template Referenceexport

Words over an alphabet as a tensor, not as a sequence: the tensor power \(\Sigma^n\) of a filtered alphabet, its symmetric sections, and the free monoid on it truncated below a length, each counted as a product of factors that never overflow where the total does. Periodicity above is invariance under a translation of the counts; a symmetry here is invariance under a permutation of the positions of a word. More...

Collaboration diagram for dedekind::category::AtMost< T, K >:

Public Member Functions

constexpr AtMost with (const T &x) const
constexpr std::size_t size () const
constexpr T front () const
constexpr const T * begin () const
constexpr const T * end () const
constexpr bool operator== (const AtMost &) const =default

Public Attributes

std::array< T, K > items {}
std::size_t length {0}

Static Public Attributes

static constexpr std::size_t capacity = K

Detailed Description

template<std::semiregular T, std::size_t K>
struct dedekind::category::AtMost< T, K >

Words over an alphabet as a tensor, not as a sequence: the tensor power \(\Sigma^n\) of a filtered alphabet, its symmetric sections, and the free monoid on it truncated below a length, each counted as a product of factors that never overflow where the total does. Periodicity above is invariance under a translation of the counts; a symmetry here is invariance under a permutation of the positions of a word.

periodic__Tensor_Powers

At most K values, held in place: a list whose length the type bounds, so it needs no heap. A cycle type and a tensor's factors are such lists, their length fixed by the shape and not by the word, so a count along a chain of them streams in constant memory. It is the list materialised, for where a value is asked for (returned, compared, handed to Python: the ext pattern); a list that is only folded stays a sequence, chain >> f, and is never built (#1133). Storage a combinator needs is automatic, as here; the heap appears only as state the caller passes in.

Template Parameters
Tthe values.
Kthe bound.

Member Function Documentation

◆ with()

template<std::semiregular T, std::size_t K>
AtMost dedekind::category::AtMost< T, K >::with ( const T & x) const
inlineconstexpr
Parameters
xthe next value.
Returns
this list and x after it; a list at its bound refuses it.

The documentation for this struct was generated from the following file: