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::Isomorphism< A, B > Class Template Reference

Functor representing the field isomorphism φ: A → B between two same-size finite fields. More...

#include <fields.hpp>

Public Member Functions

 Isomorphism ()
 Construct (or retrieve from cache) the isomorphism map A → B.
constexpr Isomorphism (const std::vector< size_t > &iso)
 Construct from a precomputed mapping table (iso[i] = φ(A(i))).
constexpr B operator() (const A &a) const
 Apply φ to a.
constexpr Isomorphism< B, A > inverse () const
 Inverse isomorphism φ⁻¹: B → A.

Detailed Description

template<FiniteFieldType A, FiniteFieldType B>
requires Isomorphic<A, B>
class CECCO::Isomorphism< A, B >

Functor representing the field isomorphism φ: A → B between two same-size finite fields.

Template Parameters
ASource finite field
BTarget finite field (Isomorphic<A, B>)

The isomorphism is built deterministically: a Conway polynomial of the prime field gives generators α ∈ A and β ∈ B as common roots, and φ is extended linearly via a change-of-basis matrix over the prime subfield. The resulting table is stored in a single details::IsomorphismPair shared between Isomorphism<A, B> and Isomorphism<B, A>. It is a field homomorphism: φ(a + b) = φ(a) + φ(b), φ(a · b) = φ(a) · φ(b), φ(0) = 0, φ(1) = 1.

Usage_Example

using F2 = Fp<2>;
using F4 = Ext<F2, {1, 1, 1}>;
using F16_a = Ext<F4, {2, 1, 1}>;
using F16_b = Ext<F4, {1, 2, 1}>;
F16_a a(4);
F16_b b = phi(a);
F16_a c = phi.inverse()(b);
assert(a == c);
Extension field 𝔽_{q^m} ≅ B[x]/(f(x)), constructed from a base field and an irreducible monic modulus...
Definition fields.hpp:2221
Prime field 𝔽_p ≅ ℤ/pℤ
Definition fields.hpp:1647
Isomorphism()
Construct (or retrieve from cache) the isomorphism map A → B.
Definition fields.hpp:1597

Definition at line 1562 of file fields.hpp.

Constructor & Destructor Documentation

◆ Isomorphism() [1/2]

template<FiniteFieldType A, FiniteFieldType B>
CECCO::Isomorphism< A, B >::Isomorphism ( )

Construct (or retrieve from cache) the isomorphism map A → B.

Definition at line 1597 of file fields.hpp.

◆ Isomorphism() [2/2]

template<FiniteFieldType A, FiniteFieldType B>
CECCO::Isomorphism< A, B >::Isomorphism ( const std::vector< size_t > & iso)
inlineconstexpr

Construct from a precomputed mapping table (iso[i] = φ(A(i))).

Warning
No validation — incorrect input gives undefined behaviour. Internal use.

Definition at line 1574 of file fields.hpp.

Member Function Documentation

◆ inverse()

template<FiniteFieldType A, FiniteFieldType B>
Isomorphism< B, A > CECCO::Isomorphism< A, B >::inverse ( ) const
constexpr

Inverse isomorphism φ⁻¹: B → A.

Definition at line 1621 of file fields.hpp.

◆ operator()()

template<FiniteFieldType A, FiniteFieldType B>
B CECCO::Isomorphism< A, B >::operator() ( const A & a) const
inlineconstexpr

Apply φ to a.

Definition at line 1577 of file fields.hpp.


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