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.
| 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>
Declared at base/univector.hpp:102
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.
| Input | Type of the input expression. |
| input | Expression to assign. |
Reference to *this. |
Fully qualified name: kfr::univector_base<T, Class, true>::operator=(Input &&)
Declared at base/univector.hpp:115
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)
Declared at base/univector.hpp:126
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)
Declared at base/univector.hpp:136
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)
Declared at base/univector.hpp:145
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)
Declared at base/univector.hpp:154
function ref() ¶
array_ref<T> ref() Returns a mutable reference to the underlying data.
Fully qualified name: kfr::univector_base<T, Class, true>::ref()
Declared at base/univector.hpp:162
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()
Declared at base/univector.hpp:169
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()
Declared at base/univector.hpp:176
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()).
| 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)
Declared at base/univector.hpp:191
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.
| cursor | Read/write cursor into the buffer (updated in place). |
| src | Pointer to the source data. |
| srcsize | Number of elements to write. |
| x | SIMD vector to write. |
Fully qualified name: kfr::univector_base<T, Class, true>::ringbuf_write(size_t &, const vec<T, N> &)
Declared at base/univector.hpp:223
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.
| 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 &)
Declared at base/univector.hpp:230
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.
| 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)
Declared at base/univector.hpp:241
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.
| 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 &)
Declared at base/univector.hpp:252
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.
| 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> &)
Declared at base/univector.hpp:264
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()).
| 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)
Declared at base/univector.hpp:276
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.
| Input | Type of the input expression. |
| input | Expression to evaluate. |
Fully qualified name: kfr::univector_base<T, Class, true>::assign_expr(Input &&)
Declared at base/univector.hpp:310
Fully qualified name: kfr::univector_base<T, Class, true>
Declared at base/univector.hpp:106
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()
Declared at base/univector.hpp:333
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()
Declared at base/univector.hpp:340
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()
Declared at base/univector.hpp:347
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 &&)
Declared at base/univector.hpp:357
Fully qualified name: kfr::univector_base<T, Class, false>
Declared at base/univector.hpp:330