pub struct FqSliceMut<'a, F: Field> {
fq: F,
limbs: &'a mut [u64],
start: usize,
end: usize,
}Expand description
A mutable slice of an FqVector.
This mutably borrows the vector. Since it is a mutable borrow, it cannot implement Copy.
However, it has a FqSliceMut::copy function that imitates the reborrowing, that mutably
borrows FqSliceMut and returns a FqSliceMut with a shorter lifetime.
Fields§
§fq: F§limbs: &'a mut [u64]§start: usize§end: usizeImplementations§
Source§impl<'a, F: Field> FqSliceMut<'a, F>
impl<'a, F: Field> FqSliceMut<'a, F>
pub(super) fn new(fq: F, limbs: &'a mut [u64], start: usize, end: usize) -> Self
pub fn fq(&self) -> F
pub(super) fn start(&self) -> usize
pub(super) fn end(&self) -> usize
pub(super) fn end_mut(&mut self) -> &mut usize
pub(super) fn limbs(&self) -> &[u64]
pub(super) fn limbs_mut(&mut self) -> &mut [u64]
Source§impl<F: Field> FqSliceMut<'_, F>
impl<F: Field> FqSliceMut<'_, F>
pub(super) fn scale_helper(&mut self, c: F::ElementContainer)
pub(super) fn add_helper( &mut self, other: FqSlice<'_, F>, c: F::ElementContainer, )
pub(super) fn add_offset_helper( &mut self, other: FqSlice<'_, F>, c: F::ElementContainer, offset: usize, )
pub(super) fn set_entry_helper( &mut self, index: usize, value: F::ElementContainer, )
pub(super) fn add_basis_element_helper( &mut self, index: usize, value: F::ElementContainer, )
pub(super) fn add_masked_helper( &mut self, other: FqSlice<'_, F>, c: F::ElementContainer, mask: &[usize], )
pub(super) fn add_unmasked_helper( &mut self, other: FqSlice<'_, F>, c: F::ElementContainer, mask: &[usize], )
pub(super) fn add_tensor_helper( &mut self, offset: usize, coeff: F::ElementContainer, left: FqSlice<'_, F>, right: FqSlice<'_, F>, )
Source§impl<'a, F: Field> FqSliceMut<'a, F>
impl<'a, F: Field> FqSliceMut<'a, F>
pub fn prime(&self) -> ValidPrime
pub fn add_basis_element(&mut self, index: usize, value: FieldElement<F>)
pub fn set_entry(&mut self, index: usize, value: FieldElement<F>)
fn reduce_limbs(&mut self)
pub fn scale(&mut self, c: FieldElement<F>)
pub fn set_to_zero(&mut self)
pub fn add(&mut self, other: FqSlice<'_, F>, c: FieldElement<F>)
pub fn add_offset( &mut self, other: FqSlice<'_, F>, c: FieldElement<F>, offset: usize, )
Sourcepub fn add_tensor(
&mut self,
offset: usize,
coeff: FieldElement<F>,
left: FqSlice<'_, F>,
right: FqSlice<'_, F>,
)
pub fn add_tensor( &mut self, offset: usize, coeff: FieldElement<F>, left: FqSlice<'_, F>, right: FqSlice<'_, F>, )
Adds v otimes w to self.
Sourcepub fn shl_assign(&mut self, shift: usize)
pub fn shl_assign(&mut self, shift: usize)
Shifts the entries of self to the left by shift entries.
Sourcepub fn add_shift_none(&mut self, other: FqSlice<'_, F>, c: FieldElement<F>)
pub fn add_shift_none(&mut self, other: FqSlice<'_, F>, c: FieldElement<F>)
Adds c * other to self. other must have the same length, offset, and prime as self.
fn add_shift_left(&mut self, other: FqSlice<'_, F>, c: FieldElement<F>)
fn add_shift_right(&mut self, other: FqSlice<'_, F>, c: FieldElement<F>)
Sourcepub fn add_masked(
&mut self,
other: FqSlice<'_, F>,
c: FieldElement<F>,
mask: &[usize],
)
pub fn add_masked( &mut self, other: FqSlice<'_, F>, c: FieldElement<F>, mask: &[usize], )
Given a mask v, add the v[i]th entry of other to the ith entry of self.
Sourcepub fn add_unmasked(
&mut self,
other: FqSlice<'_, F>,
c: FieldElement<F>,
mask: &[usize],
)
pub fn add_unmasked( &mut self, other: FqSlice<'_, F>, c: FieldElement<F>, mask: &[usize], )
Given a mask v, add the ith entry of other to the v[i]th entry of self.
pub fn slice_mut(&mut self, start: usize, end: usize) -> FqSliceMut<'_, F>
pub fn as_slice(&self) -> FqSlice<'_, F>
Sourcepub fn copy(&mut self) -> FqSliceMut<'_, F>
pub fn copy(&mut self) -> FqSliceMut<'_, F>
Generates a version of itself with a shorter lifetime
Trait Implementations§
Auto Trait Implementations§
impl<'a, F> Freeze for FqSliceMut<'a, F>where
F: Freeze,
impl<'a, F> RefUnwindSafe for FqSliceMut<'a, F>where
F: RefUnwindSafe,
impl<'a, F> Send for FqSliceMut<'a, F>where
F: Send,
impl<'a, F> Sync for FqSliceMut<'a, F>where
F: Sync,
impl<'a, F> Unpin for FqSliceMut<'a, F>where
F: Unpin,
impl<'a, F> !UnwindSafe for FqSliceMut<'a, F>
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> 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