Vector

Struct Vector 

Source
pub struct Vector<F: Field, K: ArraySize>(pub Array<Polynomial<F>, K>);
Expand description

A Vector is a vector of polynomials from R_q of length K. Vectors can be added, subtracted, negated, and multiplied by field elements.

Tuple Fields§

§0: Array<Polynomial<F>, K>

Implementations§

Source§

impl<F: Field, K: ArraySize> Vector<F, K>

Source

pub const fn new(x: Array<Polynomial<F>, K>) -> Self

Trait Implementations§

Source§

impl<F: Field, K: ArraySize> Add<&Vector<F, K>> for &Vector<F, K>

Source§

type Output = Vector<F, K>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &Vector<F, K>) -> Vector<F, K>

Performs the + operation. Read more
Source§

impl<K: ArraySize> AlgebraExt for Vector<BaseField, K>

Source§

fn mod_plus_minus<M: Unsigned>(&self) -> Self

Source§

fn infinity_norm(&self) -> u32

Source§

fn power2round(&self) -> (Self, Self)

Source§

fn high_bits<TwoGamma2: Unsigned>(&self) -> Self

Source§

fn low_bits<TwoGamma2: Unsigned>(&self) -> Self

Source§

impl<K, A, B> BitPack<A, B> for Vector<BaseField, K>

Source§

impl<F: Clone + Field, K: Clone + ArraySize> Clone for Vector<F, K>

Source§

fn clone(&self) -> Vector<F, K>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<F: Debug + Field, K: Debug + ArraySize> Debug for Vector<F, K>

Source§

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

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

impl<F: Default + Field, K: Default + ArraySize> Default for Vector<F, K>

Source§

fn default() -> Vector<F, K>

Returns the “default value” for a type. Read more
Source§

impl<F, D, K> Encode<D> for Vector<F, K>
where F: Field, K: ArraySize, D: VectorEncodingSize<K>,

Source§

impl<F: Field, K: ArraySize> Mul<&Vector<F, K>> for Elem<F>

Source§

type Output = Vector<F, K>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Vector<F, K>) -> Vector<F, K>

Performs the * operation. Read more
Source§

impl<F: Field, K: ArraySize> Neg for &Vector<F, K>

Source§

type Output = Vector<F, K>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Vector<F, K>

Performs the unary - operation. Read more
Source§

impl<K: ArraySize> Ntt for Vector<BaseField, K>

Source§

type Output = NttVector<BaseField, K>

Source§

fn ntt(&self) -> Self::Output

Source§

impl<F: PartialEq + Field, K: PartialEq + ArraySize> PartialEq for Vector<F, K>

Source§

fn eq(&self, other: &Vector<F, K>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<F: Field, K: ArraySize> Sub<&Vector<F, K>> for &Vector<F, K>

Source§

type Output = Vector<F, K>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &Vector<F, K>) -> Vector<F, K>

Performs the - operation. Read more
Source§

impl<F: Field, K: ArraySize> StructuralPartialEq for Vector<F, K>

Auto Trait Implementations§

§

impl<F, K> Freeze for Vector<F, K>
where <K as ArraySize>::ArrayType<Polynomial<F>>: Freeze,

§

impl<F, K> RefUnwindSafe for Vector<F, K>

§

impl<F, K> Send for Vector<F, K>
where <F as Field>::Int: Send,

§

impl<F, K> Sync for Vector<F, K>
where <F as Field>::Int: Sync,

§

impl<F, K> Unpin for Vector<F, K>
where <K as ArraySize>::ArrayType<Polynomial<F>>: Unpin,

§

impl<F, K> UnwindSafe for Vector<F, K>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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.