pub struct PolyVector { /* private fields */ }
Implementations§
Source§impl PolyVector
impl PolyVector
pub fn new(elements: Vec<PolyRing>) -> Self
pub fn zero() -> Self
pub fn get_elements(&self) -> &Vec<PolyRing>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn iter(&self) -> impl Iterator<Item = &PolyRing>
pub fn iter_mut(&mut self) -> impl Iterator<Item = &mut PolyRing>
pub fn random(n: usize, m: usize) -> Self
Sourcepub fn random_ternary(n: usize, m: usize) -> Self
pub fn random_ternary(n: usize, m: usize) -> Self
Generate random small polynomial with secure RNG implementation
pub fn inner_product_poly_vector(&self, other: &PolyVector) -> PolyRing
pub fn compute_norm_squared(&self) -> Zq
Sourcepub fn concatenate_coefficients(&self, s: usize) -> ZqVector
pub fn concatenate_coefficients(&self, s: usize) -> ZqVector
Function to concatenate coefficients from multiple Polyrings into a Vec
pub fn decompose(&self, b: Zq, parts: usize) -> Vec<PolyVector>
Trait Implementations§
Source§impl Add<&PolyVector> for &PolyVector
impl Add<&PolyVector> for &PolyVector
Source§type Output = PolyVector
type Output = PolyVector
The resulting type after applying the
+
operator.Source§fn add(self, other: &PolyVector) -> PolyVector
fn add(self, other: &PolyVector) -> PolyVector
Performs the
+
operation. Read moreSource§impl Clone for PolyVector
impl Clone for PolyVector
Source§fn clone(&self) -> PolyVector
fn clone(&self) -> PolyVector
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 Debug for PolyVector
impl Debug for PolyVector
Source§impl Default for PolyVector
impl Default for PolyVector
Source§fn default() -> PolyVector
fn default() -> PolyVector
Returns the “default value” for a type. Read more
Source§impl<const N: usize, const D: usize> From<PolyVector> for RqVector<N, D>
impl<const N: usize, const D: usize> From<PolyVector> for RqVector<N, D>
Source§fn from(polys: PolyVector) -> Self
fn from(polys: PolyVector) -> Self
Converts to this type from the input type.
Source§impl FromIterator<PolyRing> for PolyVector
impl FromIterator<PolyRing> for PolyVector
Source§impl Mul<&PolyRing> for &PolyVector
impl Mul<&PolyRing> for &PolyVector
Source§type Output = PolyVector
type Output = PolyVector
The resulting type after applying the
*
operator.Source§impl Mul<&Vec<PolyVector>> for &PolyVector
impl Mul<&Vec<PolyVector>> for &PolyVector
Source§type Output = PolyVector
type Output = PolyVector
The resulting type after applying the
*
operator.Source§fn mul(self, other: &Vec<PolyVector>) -> PolyVector
fn mul(self, other: &Vec<PolyVector>) -> PolyVector
Performs the
*
operation. Read moreSource§impl Mul<&Zq> for &PolyVector
impl Mul<&Zq> for &PolyVector
Source§type Output = PolyVector
type Output = PolyVector
The resulting type after applying the
*
operator.Source§impl Ord for PolyVector
impl Ord for PolyVector
Source§fn cmp(&self, other: &PolyVector) -> Ordering
fn cmp(&self, other: &PolyVector) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for PolyVector
impl PartialEq for PolyVector
Source§impl PartialOrd for PolyVector
impl PartialOrd for PolyVector
impl Eq for PolyVector
impl StructuralPartialEq for PolyVector
Auto Trait Implementations§
impl Freeze for PolyVector
impl RefUnwindSafe for PolyVector
impl Send for PolyVector
impl Sync for PolyVector
impl Unpin for PolyVector
impl UnwindSafe for PolyVector
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