Skip to content

Class univector_base

class univector_base<T, Class, is_expression> base

template <typename T, typename Class, bool is_expression>
struct univector_base

Base class for all univector specializations, providing common operations such as slicing, references and ring-buffer helpers. Ring-buffer helpers operate on caller-owned cursors and are intended for single-threaded use only; concurrent access requires external synchronization.

Template parameters
T Element type of the vector.
Class Concrete derived univector type (CRTP).
is_expression Whether the derived type can act as an output expression.

Fully qualified name: kfr::univector_base<T, Class, is_expression>

Class univector_base

class univector_base<T, Class, true> base

template <typename T, typename Class>
struct univector_base<T, Class, true> { … }

Specialization for univectors that can be assigned from expressions.

function operator=(Input &&)

template <expression_argument Input>
KFR_MEM_INTRINSIC Class& operator=(Input&& input)

Assigns an expression to the vector. The expression must have at most one dimension; its elements are written to the vector starting at index 0.

Template parameters
Input Type of the input expression.
Parameters
input Expression to assign.
Returns
Reference to *this.

Fully qualified name: kfr::univector_base<T, Class, true>::operator=(Input &&)

function slice(size_t, size_t)

univector<T, 0> slice(size_t start = 0, size_t size = max_size_t)

Returns subrange of the vector. If start is greater or equal to this->size, returns empty univector If requested size is greater than this->size, returns only available elements

Fully qualified name: kfr::univector_base<T, Class, true>::slice(size_t, size_t)

function slice(size_t, size_t)

univector<const T, 0> slice(size_t start = 0, size_t size = max_size_t) const

Returns subrange of the vector. If start is greater or equal to this->size, returns empty univector If requested size is greater than this->size, returns only available elements

Fully qualified name: kfr::univector_base<T, Class, true>::slice(size_t, size_t)

function truncate(size_t)

univector<T, 0> truncate(size_t size = max_size_t)

Returns subrange of the vector starting from 0. If requested size is greater than this->size, returns only available elements

Fully qualified name: kfr::univector_base<T, Class, true>::truncate(size_t)

function truncate(size_t)

univector<const T, 0> truncate(size_t size = max_size_t) const

Returns subrange of the vector starting from 0. If requested size is greater than this->size, returns only available elements

Fully qualified name: kfr::univector_base<T, Class, true>::truncate(size_t)

function ref()

array_ref<T> ref()

Returns a mutable reference to the underlying data.

Fully qualified name: kfr::univector_base<T, Class, true>::ref()

function ref()

array_ref<const T> ref() const

Returns a const reference to the underlying data.

Fully qualified name: kfr::univector_base<T, Class, true>::ref()

function cref()

array_ref<const T> cref() const

Returns a const reference to the underlying data.

Fully qualified name: kfr::univector_base<T, Class, true>::cref()

function ringbuf_write(size_t &, const T *, size_t)

void ringbuf_write(size_t& cursor, const T* src, size_t srcsize)

Writes srcsize elements from src into the ring buffer starting at cursor. The buffer is treated as circular: data that does not fit before the end wraps around to the beginning. If srcsize exceeds the buffer capacity, only the most recent size() elements are kept and the rest is skipped. cursor is advanced by the number of elements actually written and wrapped into [0, size()).

Parameters
cursor Read/write cursor into the buffer (updated in place).
src Pointer to the source data.
srcsize Number of elements to write.

Fully qualified name: kfr::univector_base<T, Class, true>::ringbuf_write(size_t &, const T *, size_t)

function ringbuf_write(size_t &, const vec<T, N> &)

template <size_t N>
void ringbuf_write(size_t& cursor, const vec<T, N>& x)

Writes the N elements of the SIMD vector x into the ring buffer at cursor.

Parameters
cursor Read/write cursor into the buffer (updated in place).
src Pointer to the source data.
srcsize Number of elements to write.
Parameters
x SIMD vector to write.

Fully qualified name: kfr::univector_base<T, Class, true>::ringbuf_write(size_t &, const vec<T, N> &)

function ringbuf_write(size_t &, const T &)

void ringbuf_write(size_t& cursor, const T& value)

Writes a single value into the ring buffer at cursor and advances the cursor.

Parameters
cursor Read/write cursor into the buffer (updated in place).
value Value to write.

Fully qualified name: kfr::univector_base<T, Class, true>::ringbuf_write(size_t &, const T &)

function ringbuf_step(size_t &, size_t)

void ringbuf_step(size_t& cursor, size_t step) const

Advances cursor by step, wrapping it into the [0, size()) range.

Parameters
cursor Cursor to advance (updated in place).
step Number of positions to advance.

Fully qualified name: kfr::univector_base<T, Class, true>::ringbuf_step(size_t &, size_t)

function ringbuf_read(size_t &, T &)

void ringbuf_read(size_t& cursor, T& value)

Reads a single element from the ring buffer at cursor into value and advances the cursor.

Parameters
cursor Read cursor into the buffer (updated in place).
value Output value.

Fully qualified name: kfr::univector_base<T, Class, true>::ringbuf_read(size_t &, T &)

function ringbuf_read(size_t &, vec<T, N> &)

template <size_t N>
void ringbuf_read(size_t& cursor, vec<T, N>& x)

Reads N elements from the ring buffer at cursor into the SIMD vector x.

Parameters
cursor Read cursor into the buffer (updated in place).
x Output SIMD vector.

Fully qualified name: kfr::univector_base<T, Class, true>::ringbuf_read(size_t &, vec<T, N> &)

function ringbuf_read(size_t &, T *, size_t)

void ringbuf_read(size_t& cursor, T* dest, size_t destsize) const

Reads destsize elements from the ring buffer at cursor into dest. The buffer is treated as circular: reads that cross the end wrap around to the beginning. If destsize exceeds the buffer capacity, only the most recent size() elements are produced and the leading portion of dest is skipped. cursor is advanced by the number of elements actually read and wrapped into [0, size()).

Parameters
cursor Read cursor into the buffer (updated in place).
dest Destination buffer.
destsize Number of elements to read.

Fully qualified name: kfr::univector_base<T, Class, true>::ringbuf_read(size_t &, T *, size_t)

function assign_expr(Input &&)

template <typename Input>
KFR_MEM_INTRINSIC void assign_expr(Input&& input)

Evaluates input and writes the result into the derived vector.

Template parameters
Input Type of the input expression.
Parameters
input Expression to evaluate.

Fully qualified name: kfr::univector_base<T, Class, true>::assign_expr(Input &&)

Fully qualified name: kfr::univector_base<T, Class, true>

Class univector_base

class univector_base<T, Class, false> base

template <typename T, typename Class>
struct univector_base<T, Class, false> { … }

Specialization for univectors that cannot be assigned from expressions. Provides only reference access to the underlying data.

function ref()

array_ref<T> ref()

Returns a mutable reference to the underlying data.

Fully qualified name: kfr::univector_base<T, Class, false>::ref()

function ref()

array_ref<const T> ref() const

Returns a const reference to the underlying data.

Fully qualified name: kfr::univector_base<T, Class, false>::ref()

function cref()

array_ref<const T> cref() const

Returns a const reference to the underlying data.

Fully qualified name: kfr::univector_base<T, Class, false>::cref()

function operator=(Input &&)

template <expression_argument Input>
KFR_MEM_INTRINSIC Class& operator=(Input&& input)

Assignment from an expression is disabled for non-expression vectors. Always triggers a static assertion failure.

Fully qualified name: kfr::univector_base<T, Class, false>::operator=(Input &&)

Fully qualified name: kfr::univector_base<T, Class, false>

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