pub unsafe trait PackedField:
Algebra<Self::Scalar>
+ PackedValue<Value = Self::Scalar>
+ Div<Self::Scalar, Output = Self>
+ DivAssign<Self::Scalar>
+ Sum<Self::Scalar>
+ Product<Self::Scalar> {
type Scalar: Field;
// Provided methods
fn packed_powers(base: Self::Scalar) -> Powers<Self> ⓘ { ... }
fn packed_shifted_powers(
base: Self::Scalar,
start: Self::Scalar,
) -> Powers<Self> ⓘ { ... }
fn packed_linear_combination<const N: usize>(
coeffs: &[Self::Scalar],
vecs: &[Self],
) -> Self { ... }
}Expand description
An array of field elements which can be packed into a vector for SIMD operations.
§Safety
- See
PackedValueabove.
Required Associated Types§
Provided Methods§
Sourcefn packed_powers(base: Self::Scalar) -> Powers<Self> ⓘ
fn packed_powers(base: Self::Scalar) -> Powers<Self> ⓘ
Construct an iterator which returns powers of base packed into packed field elements.
E.g. if Self::WIDTH = 4, returns: [base^0, base^1, base^2, base^3], [base^4, base^5, base^6, base^7], ....
Sourcefn packed_shifted_powers(
base: Self::Scalar,
start: Self::Scalar,
) -> Powers<Self> ⓘ
fn packed_shifted_powers( base: Self::Scalar, start: Self::Scalar, ) -> Powers<Self> ⓘ
Construct an iterator which returns powers of base multiplied by start and packed into packed field elements.
E.g. if Self::WIDTH = 4, returns: [start, start*base, start*base^2, start*base^3], [start*base^4, start*base^5, start*base^6, start*base^7], ....
Sourcefn packed_linear_combination<const N: usize>(
coeffs: &[Self::Scalar],
vecs: &[Self],
) -> Self
fn packed_linear_combination<const N: usize>( coeffs: &[Self::Scalar], vecs: &[Self], ) -> Self
Compute a linear combination of a slice of base field elements and a slice of packed field elements. The slices must have equal length and it must be a compile time constant.
§Panics
May panic if the length of either slice is not equal to N.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.