pub trait FieldOps:
Clone
+ Neg<Output = Self>
+ Add<Output = Self>
+ Sub<Output = Self>
+ Mul<Output = Self>
+ Sum
+ Product
+ for<'a> Add<&'a Self, Output = Self>
+ for<'a> Sub<&'a Self, Output = Self>
+ for<'a> Mul<&'a Self, Output = Self>
+ for<'a> Sum<&'a Self>
+ for<'a> Product<&'a Self>
+ AddAssign
+ SubAssign
+ MulAssign
+ for<'a> AddAssign<&'a Self>
+ for<'a> SubAssign<&'a Self>
+ for<'a> MulAssign<&'a Self>
+ Square
+ InvertOrZero {
type Scalar: Field;
// Required methods
fn zero() -> Self;
fn one() -> Self;
fn square_transpose<FSub: Field>(elems: &mut [Self])
where Self::Scalar: ExtensionField<FSub>;
}Expand description
Operations for types that represent vectors of field elements.
This trait abstracts over:
Fieldtypes (single field elements, which are trivially vectors of length 1)PackedFieldtypes (SIMD-accelerated vectors of field elements)- Symbolic field types (for constraint system representations)
Mathematically, instances of this trait represent vectors of field elements where arithmetic operations like addition, subtraction, multiplication, squaring, and inversion are defined element-wise. For a packed field with width N, multiplying two values performs N independent field multiplications in parallel.
§Required Methods
Required Associated Types§
Required Methods§
Sourcefn square_transpose<FSub: Field>(elems: &mut [Self])where
Self::Scalar: ExtensionField<FSub>,
fn square_transpose<FSub: Field>(elems: &mut [Self])where
Self::Scalar: ExtensionField<FSub>,
Transpose the subfield elements in a slice of field elements.
§Arguments
elems- a slice of $n$ elements, where $n$ is the degee of the extension ofSelf::ScalaroverFSub. They are overwritten with the result elements.
§Preconditions
elems.len()must equal<Self::Scalar as ExtensionField<FSub>>::DEGREE
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.