pub trait PackedFieldExtension<BaseField: Field, ExtField: ExtensionField<BaseField, ExtensionPacking = Self>>:
Algebra<ExtField>
+ Algebra<BaseField::Packing>
+ BasedVectorSpace<BaseField::Packing> {
// Required methods
fn from_ext_slice(ext_slice: &[ExtField]) -> Self;
fn packed_ext_powers(base: ExtField) -> Powers<Self> ⓘ;
// Provided methods
fn extract(&self, lane: usize) -> ExtField { ... }
fn to_ext_iter(
iter: impl IntoIterator<Item = Self>,
) -> impl Iterator<Item = ExtField> { ... }
fn packed_ext_powers_capped(
base: ExtField,
unpacked_len: usize,
) -> impl Iterator<Item = Self> { ... }
}Expand description
Fix a field F a packing width W and an extension field EF of F.
By choosing a basis B, EF can be transformed into an array [F; D].
A type should implement PackedFieldExtension if it can be transformed into [F::Packing; D] ~ [[F; W]; D]
This is interpreted by taking a transpose to get [[F; D]; W] which can then be reinterpreted
as [EF; W] by making use of the chosen basis B again.
Required Methods§
Sourcefn from_ext_slice(ext_slice: &[ExtField]) -> Self
fn from_ext_slice(ext_slice: &[ExtField]) -> Self
Given a slice of extension field EF elements of length W,
convert into the array [[F; D]; W] transpose to
[[F; W]; D] and then pack to get [PF; D].
Sourcefn packed_ext_powers(base: ExtField) -> Powers<Self> ⓘ
fn packed_ext_powers(base: ExtField) -> Powers<Self> ⓘ
Similar to packed_powers, construct an iterator which returns
powers of base packed into PackedFieldExtension elements.
Provided Methods§
Sourcefn extract(&self, lane: usize) -> ExtField
fn extract(&self, lane: usize) -> ExtField
Extract the extension field element at the given SIMD lane.
Sourcefn to_ext_iter(
iter: impl IntoIterator<Item = Self>,
) -> impl Iterator<Item = ExtField>
fn to_ext_iter( iter: impl IntoIterator<Item = Self>, ) -> impl Iterator<Item = ExtField>
Convert an iterator of packed extension field elements to an iterator of extension field elements.
This performs the inverse transformation to from_ext_slice.
Sourcefn packed_ext_powers_capped(
base: ExtField,
unpacked_len: usize,
) -> impl Iterator<Item = Self>
fn packed_ext_powers_capped( base: ExtField, unpacked_len: usize, ) -> impl Iterator<Item = Self>
Similar to packed_ext_powers but only returns unpacked_len powers of base.
Note that the length of the returned iterator will be unpacked_len / WIDTH and
not len as the iterator is over packed extension field elements. If unpacked_len
is not divisible by WIDTH, unpacked_len will be rounded up to the next multiple of WIDTH.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".