C(++)ECCO
C++ Error Control COding: a header-only library for ECC simulations and experiments, modeling complete coding systems across arbitrary finite fields and complex inter-field relationships - Christian Senger <senger@inue.uni-stuttgart.de>
Loading...
Searching...
No Matches
CECCO::details::BlockProcessor< T, InputType, OutputType > Class Template Reference

CRTP base providing scalar, vector, and matrix block operations. More...

#include <blocks.hpp>

Inheritance diagram for CECCO::details::BlockProcessor< T, InputType, OutputType >:
Inheritance graph

Public Member Functions

Vector< OutputType > operator() (const Vector< InputType > &in)
 Apply the block element-wise to each vector entry.
Vector< OutputType > operator() (Vector< InputType > &&in)
 Apply the block element-wise (rvalue input).
Matrix< OutputType > operator() (const Matrix< InputType > &in)
 Apply the block element-wise to each matrix entry.
Matrix< OutputType > operator() (Matrix< InputType > &&in)
 Apply the block element-wise (rvalue input).
template<FiniteFieldType U>
OutputType operator() (const U &)
 Catch-all for inputs whose element type differs from InputType.
template<FiniteFieldType U>
Vector< OutputType > operator() (const Vector< U > &)
template<FiniteFieldType U>
Matrix< OutputType > operator() (const Matrix< U > &)

Protected Member Functions

const T & derived () const noexcept
T & derived () noexcept

Detailed Description

template<typename T, typename InputType, typename OutputType>
class CECCO::details::BlockProcessor< T, InputType, OutputType >

CRTP base providing scalar, vector, and matrix block operations.

Template Parameters
TDerived block type
InputTypeScalar input type
OutputTypeScalar output type

Derived classes implement the scalar call operator; this base supplies vector and matrix overloads, reusing rvalue storage when input and output types match.

Calls with another finite-field type are accepted syntactically and throw at runtime, allowing otherwise discarded non-template branches to remain well-formed.

Note
Blocks are movable but non-copyable. Channel copies would duplicate distribution caches and stochastic countdown state, producing statistically coupled block instances.

Definition at line 77 of file blocks.hpp.

Member Function Documentation

◆ derived() [1/2]

template<typename T, typename InputType, typename OutputType>
const T & CECCO::details::BlockProcessor< T, InputType, OutputType >::derived ( ) const
inlineprotectednoexcept

Definition at line 79 of file blocks.hpp.

◆ derived() [2/2]

template<typename T, typename InputType, typename OutputType>
T & CECCO::details::BlockProcessor< T, InputType, OutputType >::derived ( )
inlineprotectednoexcept

Definition at line 81 of file blocks.hpp.

◆ operator()() [1/7]

template<typename T, typename InputType, typename OutputType>
Matrix< OutputType > CECCO::details::BlockProcessor< T, InputType, OutputType >::operator() ( const Matrix< InputType > & in)
inline

Apply the block element-wise to each matrix entry.

Parameters
inInput matrix
Returns
Matrix of processed outputs

Definition at line 117 of file blocks.hpp.

◆ operator()() [2/7]

template<typename T, typename InputType, typename OutputType>
template<FiniteFieldType U>
Matrix< OutputType > CECCO::details::BlockProcessor< T, InputType, OutputType >::operator() ( const Matrix< U > & )
inline

Definition at line 170 of file blocks.hpp.

◆ operator()() [3/7]

template<typename T, typename InputType, typename OutputType>
template<FiniteFieldType U>
OutputType CECCO::details::BlockProcessor< T, InputType, OutputType >::operator() ( const U & )
inline

Catch-all for inputs whose element type differs from InputType.

Template Parameters
UAny CECCO::FiniteFieldType other than InputType

Always throws std::logic_error at runtime. See the class doc for the if constexpr use case that motivates these overloads.

Definition at line 156 of file blocks.hpp.

◆ operator()() [4/7]

template<typename T, typename InputType, typename OutputType>
Vector< OutputType > CECCO::details::BlockProcessor< T, InputType, OutputType >::operator() ( const Vector< InputType > & in)
inline

Apply the block element-wise to each vector entry.

Parameters
inInput vector
Returns
Vector of processed outputs

Definition at line 89 of file blocks.hpp.

◆ operator()() [5/7]

template<typename T, typename InputType, typename OutputType>
template<FiniteFieldType U>
Vector< OutputType > CECCO::details::BlockProcessor< T, InputType, OutputType >::operator() ( const Vector< U > & )
inline

Definition at line 163 of file blocks.hpp.

◆ operator()() [6/7]

template<typename T, typename InputType, typename OutputType>
Matrix< OutputType > CECCO::details::BlockProcessor< T, InputType, OutputType >::operator() ( Matrix< InputType > && in)
inline

Apply the block element-wise (rvalue input).

Parameters
inInput matrix (moved)
Returns
Matrix of processed outputs (reuses input storage when InputType == OutputType)

Definition at line 130 of file blocks.hpp.

◆ operator()() [7/7]

template<typename T, typename InputType, typename OutputType>
Vector< OutputType > CECCO::details::BlockProcessor< T, InputType, OutputType >::operator() ( Vector< InputType > && in)
inline

Apply the block element-wise (rvalue input).

Parameters
inInput vector (moved)
Returns
Vector of processed outputs (reuses input storage when InputType == OutputType)

Definition at line 100 of file blocks.hpp.


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