|
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>
|
Functor representing the field embedding φ: SUBFIELD → SUPERFIELD, with reverse lookup. More...
#include <fields.hpp>
Public Member Functions | |
| Embedding () | |
| Constructs the embedding (cached on first instantiation per template arguments). | |
| constexpr SUPERFIELD | operator() (const SUBFIELD &sub) const |
| Apply φ: SUBFIELD → SUPERFIELD. | |
| constexpr SUBFIELD | extract (const SUPERFIELD &super) const |
| Reverse φ: find the unique s ∈ SUBFIELD with φ(s) == super. | |
Functor representing the field embedding φ: SUBFIELD → SUPERFIELD, with reverse lookup.
| SUBFIELD | Subfield (finite-field type) |
| SUPERFIELD | Superfield (finite-field type, must satisfy SubfieldOf<SUPERFIELD, SUBFIELD>) |
The embedding is determined by mapping a generator: with factor = (|SUPERFIELD| − 1) / (|SUBFIELD| − 1), it sends g_sub^k ↦ g_super^{k · factor}. Identities φ(0) = 0, φ(1) = 1 are fixed. The full table is computed once per template instantiation and cached.
Forward map (operator()) is an O(1) array lookup; extract reverses it via linear search through the cached map. When SUPERFIELD is an CECCO::Iso, extract walks the MAIN representation first, then each of OTHERS, until it finds one that contains SUBFIELD.
Definition at line 1301 of file fields.hpp.
| CECCO::Embedding< SUBFIELD, SUPERFIELD >::Embedding | ( | ) |
Constructs the embedding (cached on first instantiation per template arguments).
Definition at line 1337 of file fields.hpp.
|
constexpr |
Reverse φ: find the unique s ∈ SUBFIELD with φ(s) == super.
| std::invalid_argument | if super is not in the image of φ |
O(|SUBFIELD|) for regular fields; for Iso superfields, O(k · |SUBFIELD|) where k is the number of inspected components.
Definition at line 1346 of file fields.hpp.
|
inlineconstexpr |
Apply φ: SUBFIELD → SUPERFIELD.
Definition at line 1307 of file fields.hpp.