#[repr(transparent)]pub struct FieldArray<F: Field, const N: usize>(pub [F; N]);
Tuple Fields§
§0: [F; N]
Trait Implementations§
Source§impl<F: Field, const N: usize> AddAssign<F> for FieldArray<F, N>
impl<F: Field, const N: usize> AddAssign<F> for FieldArray<F, N>
Source§fn add_assign(&mut self, rhs: F)
fn add_assign(&mut self, rhs: F)
Performs the
+=
operation. Read moreSource§impl<F: Field, const N: usize> AddAssign for FieldArray<F, N>
impl<F: Field, const N: usize> AddAssign for FieldArray<F, N>
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+=
operation. Read moreSource§impl<F: Clone + Field, const N: usize> Clone for FieldArray<F, N>
impl<F: Clone + Field, const N: usize> Clone for FieldArray<F, N>
Source§fn clone(&self) -> FieldArray<F, N>
fn clone(&self) -> FieldArray<F, N>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<F: Field, const N: usize> FieldAlgebra for FieldArray<F, N>
impl<F: Field, const N: usize> FieldAlgebra for FieldArray<F, N>
type F = F
Source§fn from_f(f: Self::F) -> Self
fn from_f(f: Self::F) -> Self
Interpret a field element as a commutative algebra element. Read more
Source§fn from_canonical_u8(n: u8) -> Self
fn from_canonical_u8(n: u8) -> Self
Convert from a canonical
u8
. Read moreSource§fn from_canonical_u16(n: u16) -> Self
fn from_canonical_u16(n: u16) -> Self
Convert from a canonical
u16
. Read moreSource§fn from_canonical_u32(n: u32) -> Self
fn from_canonical_u32(n: u32) -> Self
Convert from a canonical
u32
. Read moreSource§fn from_canonical_u64(n: u64) -> Self
fn from_canonical_u64(n: u64) -> Self
Convert from a canonical
u64
. Read moreSource§fn from_canonical_usize(n: usize) -> Self
fn from_canonical_usize(n: usize) -> Self
Convert from a canonical
usize
. Read morefn from_wrapped_u32(n: u32) -> Self
fn from_wrapped_u64(n: u64) -> Self
Source§fn exp_const_u64<const POWER: u64>(&self) -> Self
fn exp_const_u64<const POWER: u64>(&self) -> Self
Exponentiation by a constant power. Read more
Source§fn exp_power_of_2(&self, power_log: usize) -> Self
fn exp_power_of_2(&self, power_log: usize) -> Self
Compute self^{2^power_log} by repeated squaring.
Source§fn mul_2exp_u64(&self, exp: u64) -> Self
fn mul_2exp_u64(&self, exp: u64) -> Self
self * 2^exp
Source§fn powers(&self) -> Powers<Self> ⓘ
fn powers(&self) -> Powers<Self> ⓘ
Construct an iterator which returns powers of
self: self^0, self^1, self^2, ...
.Source§fn shifted_powers(&self, start: Self) -> Powers<Self> ⓘ
fn shifted_powers(&self, start: Self) -> Powers<Self> ⓘ
Construct an iterator which returns powers of
self
shifted by start: start, start*self^1, start*self^2, ...
.Source§fn powers_packed<P: PackedField<Scalar = Self>>(&self) -> Powers<P> ⓘ
fn powers_packed<P: PackedField<Scalar = Self>>(&self) -> Powers<P> ⓘ
Source§fn shifted_powers_packed<P: PackedField<Scalar = Self>>(
&self,
start: Self,
) -> Powers<P> ⓘ
fn shifted_powers_packed<P: PackedField<Scalar = Self>>( &self, start: Self, ) -> Powers<P> ⓘ
Construct an iterator which returns powers of
self
shifted by start
and packed into PackedField
elements. Read moreSource§fn dot_product<const N: usize>(u: &[Self; N], v: &[Self; N]) -> Self
fn dot_product<const N: usize>(u: &[Self; N], v: &[Self; N]) -> Self
Compute the dot product of two vectors.
Source§fn zero_vec(len: usize) -> Vec<Self>
fn zero_vec(len: usize) -> Vec<Self>
Allocates a vector of zero elements of length
len
. Many operating systems zero pages
before assigning them to a userspace process. In that case, our process should not need to
write zeros, which would be redundant. However, the compiler may not always recognize this. Read moreSource§impl<F: Field, const N: usize> MulAssign<F> for FieldArray<F, N>
impl<F: Field, const N: usize> MulAssign<F> for FieldArray<F, N>
Source§fn mul_assign(&mut self, rhs: F)
fn mul_assign(&mut self, rhs: F)
Performs the
*=
operation. Read moreSource§impl<F: Field, const N: usize> MulAssign for FieldArray<F, N>
impl<F: Field, const N: usize> MulAssign for FieldArray<F, N>
Source§fn mul_assign(&mut self, rhs: Self)
fn mul_assign(&mut self, rhs: Self)
Performs the
*=
operation. Read moreSource§impl<F: Field, const N: usize> PackedValue for FieldArray<F, N>
impl<F: Field, const N: usize> PackedValue for FieldArray<F, N>
const WIDTH: usize = N
type Value = F
fn from_slice(slice: &[Self::Value]) -> &Self
fn from_slice_mut(slice: &mut [Self::Value]) -> &mut Self
fn as_slice(&self) -> &[Self::Value]
fn as_slice_mut(&mut self) -> &mut [Self::Value]
fn pack_slice(buf: &[Self::Value]) -> &[Self]
fn pack_slice_with_suffix(buf: &[Self::Value]) -> (&[Self], &[Self::Value])
fn pack_slice_mut(buf: &mut [Self::Value]) -> &mut [Self]
fn pack_maybe_uninit_slice_mut( buf: &mut [MaybeUninit<Self::Value>], ) -> &mut [MaybeUninit<Self>]
fn pack_slice_with_suffix_mut( buf: &mut [Self::Value], ) -> (&mut [Self], &mut [Self::Value])
fn pack_maybe_uninit_slice_with_suffix_mut( buf: &mut [MaybeUninit<Self::Value>], ) -> (&mut [MaybeUninit<Self>], &mut [MaybeUninit<Self::Value>])
fn unpack_slice(buf: &[Self]) -> &[Self::Value]
Source§impl<F: Field, const N: usize> SubAssign<F> for FieldArray<F, N>
impl<F: Field, const N: usize> SubAssign<F> for FieldArray<F, N>
Source§fn sub_assign(&mut self, rhs: F)
fn sub_assign(&mut self, rhs: F)
Performs the
-=
operation. Read moreSource§impl<F: Field, const N: usize> SubAssign for FieldArray<F, N>
impl<F: Field, const N: usize> SubAssign for FieldArray<F, N>
Source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the
-=
operation. Read moreimpl<F: Copy + Field, const N: usize> Copy for FieldArray<F, N>
impl<F: Eq + Field, const N: usize> Eq for FieldArray<F, N>
impl<F: Field, const N: usize> StructuralPartialEq for FieldArray<F, N>
Auto Trait Implementations§
impl<F, const N: usize> Freeze for FieldArray<F, N>where
F: Freeze,
impl<F, const N: usize> RefUnwindSafe for FieldArray<F, N>where
F: RefUnwindSafe,
impl<F, const N: usize> Send for FieldArray<F, N>
impl<F, const N: usize> Sync for FieldArray<F, N>
impl<F, const N: usize> Unpin for FieldArray<F, N>where
F: Unpin,
impl<F, const N: usize> UnwindSafe for FieldArray<F, N>where
F: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<FA> FieldExtensionAlgebra<FA> for FAwhere
FA: FieldAlgebra,
impl<FA> FieldExtensionAlgebra<FA> for FAwhere
FA: FieldAlgebra,
const D: usize = 1usize
fn from_base(b: FA) -> FA
Source§fn from_base_slice(bs: &[FA]) -> FA
fn from_base_slice(bs: &[FA]) -> FA
Suppose this field extension is represented by the quotient
ring B[X]/(f(X)) where B is
Base
and f is an irreducible
polynomial of degree D
. This function takes a slice bs
of
length at exactly D, and constructs the field element
\sum_i bs[i] * X^i. Read morefn from_base_iter<I>(iter: I) -> FAwhere
I: Iterator<Item = FA>,
Source§fn from_base_fn<F>(f: F) -> FA
fn from_base_fn<F>(f: F) -> FA
Similar to
core:array::from_fn
, with the same caveats as
from_base_slice
.Source§fn as_base_slice(&self) -> &[FA]
fn as_base_slice(&self) -> &[FA]
Suppose this field extension is represented by the quotient
ring B[X]/(f(X)) where B is
Base
and f is an irreducible
polynomial of degree D
. This function takes a field element
\sum_i bs[i] * X^i and returns the coefficients as a slice
bs
of length at most D containing, from lowest degree to
highest. Read moreSource§fn monomial(exponent: usize) -> Self
fn monomial(exponent: usize) -> Self
Suppose this field extension is represented by the quotient
ring B[X]/(f(X)) where B is
Base
and f is an irreducible
polynomial of degree D
. This function returns the field
element X^exponent
if exponent < D
and panics otherwise.
(The fact that f is not known at the point that this function
is defined prevents implementing exponentiation of higher
powers since the reduction cannot be performed.) Read moreSource§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more