FqSliceMut

Struct FqSliceMut 

Source
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: usize

Implementations§

Source§

impl<'a, F: Field> FqSliceMut<'a, F>

Source

pub(super) fn new(fq: F, limbs: &'a mut [u64], start: usize, end: usize) -> Self

Source

pub fn fq(&self) -> F

Source

pub(super) fn start(&self) -> usize

Source

pub(super) fn end(&self) -> usize

Source

pub(super) fn end_mut(&mut self) -> &mut usize

Source

pub(super) fn limbs(&self) -> &[u64]

Source

pub(super) fn limbs_mut(&mut self) -> &mut [u64]

Source§

impl<F: Field> FqSliceMut<'_, F>

Source

pub(super) fn scale_helper(&mut self, c: F::ElementContainer)

Source

pub(super) fn add_helper( &mut self, other: FqSlice<'_, F>, c: F::ElementContainer, )

Source

pub(super) fn add_offset_helper( &mut self, other: FqSlice<'_, F>, c: F::ElementContainer, offset: usize, )

Source

pub(super) fn set_entry_helper( &mut self, index: usize, value: F::ElementContainer, )

Source

pub(super) fn add_basis_element_helper( &mut self, index: usize, value: F::ElementContainer, )

Source

pub(super) fn add_masked_helper( &mut self, other: FqSlice<'_, F>, c: F::ElementContainer, mask: &[usize], )

Source

pub(super) fn add_unmasked_helper( &mut self, other: FqSlice<'_, F>, c: F::ElementContainer, mask: &[usize], )

Source

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>

Source

pub fn prime(&self) -> ValidPrime

Source

pub fn add_basis_element(&mut self, index: usize, value: FieldElement<F>)

Source

pub fn set_entry(&mut self, index: usize, value: FieldElement<F>)

Source

fn reduce_limbs(&mut self)

Source

pub fn scale(&mut self, c: FieldElement<F>)

Source

pub fn set_to_zero(&mut self)

Source

pub fn add(&mut self, other: FqSlice<'_, F>, c: FieldElement<F>)

Source

pub fn add_offset( &mut self, other: FqSlice<'_, F>, c: FieldElement<F>, offset: usize, )

Source

pub fn add_tensor( &mut self, offset: usize, coeff: FieldElement<F>, left: FqSlice<'_, F>, right: FqSlice<'_, F>, )

Adds v otimes w to self.

Source

pub fn assign(&mut self, other: FqSlice<'_, F>)

TODO: improve efficiency

Source

pub fn shl_assign(&mut self, shift: usize)

Shifts the entries of self to the left by shift entries.

Source

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.

Source

fn add_shift_left(&mut self, other: FqSlice<'_, F>, c: FieldElement<F>)

Source

fn add_shift_right(&mut self, other: FqSlice<'_, F>, c: FieldElement<F>)

Source

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.

Source

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.

Source

pub fn slice_mut(&mut self, start: usize, end: usize) -> FqSliceMut<'_, F>

Source

pub fn as_slice(&self) -> FqSlice<'_, F>

Source

pub fn copy(&mut self) -> FqSliceMut<'_, F>

Generates a version of itself with a shorter lifetime

Trait Implementations§

Source§

impl<'a, F: Debug + Field> Debug for FqSliceMut<'a, F>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a, F: Field> From<&'a mut FqVector<F>> for FqSliceMut<'a, F>

Source§

fn from(v: &'a mut FqVector<F>) -> Self

Converts to this type from the input type.

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V