Skip to content

Class generator

class generator<T, VecWidth, Class, Twork> base

template <typename T, size_t VecWidth, typename Class, typename Twork = T>
struct generator : public expression_traits_defaults { … }

CRTP base for stateful streaming generators that produce fixed-width vectors of values on demand.

Generators are expressions of infinite length and are not random-access.

Template parameters
T Value type produced by the generator.
VecWidth Native vector width used by the generator.
Class Derived generator type (CRTP).
Twork Working type used to store the internal state; defaults to T but may differ (e.g. interleaved cos/sin pairs for gen_sin ).

typedef value_type

using value_type             = T

Fully qualified name: kfr::generator<T, VecWidth, Class, Twork>::value_type

variable dims

constexpr static size_t dims = 1

Fully qualified name: kfr::generator<T, VecWidth, Class, Twork>::dims

function get_shape(const Class &)

constexpr static shape<1> get_shape(const Class&) { … }

Fully qualified name: kfr::generator<T, VecWidth, Class, Twork>::get_shape(const Class &)

function get_shape()

constexpr static shape<1> get_shape() { … }

Fully qualified name: kfr::generator<T, VecWidth, Class, Twork>::get_shape()

variable random_access

constexpr static inline bool random_access = false

Fully qualified name: kfr::generator<T, VecWidth, Class, Twork>::random_access

variable width

constexpr static size_t width = VecWidth

Fully qualified name: kfr::generator<T, VecWidth, Class, Twork>::width

function resync(T)

void resync(T start) const

Reinitializes the generator state so that the next produced value corresponds to the given start.

Parameters
start Starting value to synchronize the generator to.

Fully qualified name: kfr::generator<T, VecWidth, Class, Twork>::resync(T)

function generate()

template <size_t N>
KFR_MEM_INTRINSIC vec<T, N> generate() const

Produces a vector of N values from the generator and advances its internal state.

Template parameters
N Number of values to produce.
Returns
Vector of N generated values.

Fully qualified name: kfr::generator<T, VecWidth, Class, Twork>::generate()

variable value

mutable vec<Twork, width> value

Fully qualified name: kfr::generator<T, VecWidth, Class, Twork>::value

function get_elements(const generator<T, VecWidth, Class, Twork> &, const shape<1> &, const axis_params<0, N> &)

template <size_t N>
friend KFR_INTRINSIC vec<T, N> get_elements(const generator& self, const shape<1>& index,
                                            const axis_params<0, N>&)

Internal ADL-provided implementation for generator expressions. Returns a vector of N generated values at the given index.

Fully qualified name: kfr::generator<T, VecWidth, Class, Twork>::get_elements(const generator<T, VecWidth, Class, Twork> &, const shape<1> &, const axis_params<0, N> &)

Fully qualified name: kfr::generator<T, VecWidth, Class, Twork>

This file was generated by cxxdox, a C++ documentation generator based on MkDocs Material and libclang.