Struct concrete_core::crypto::glwe::GlweMaskElement [−][src]
pub struct GlweMaskElement<Cont> { /* fields omitted */ }
Expand description
A mask of an GLWE ciphertext.
Implementations
Creates a mask element from a container.
Example
use concrete_core::crypto::glwe::GlweMaskElement; use concrete_core::math::polynomial::PolynomialSize; let mask = GlweMaskElement::from_container(vec![0 as u8; 10]); assert_eq!(mask.as_polynomial().polynomial_size(), PolynomialSize(10));
pub fn as_polynomial(&self) -> Polynomial<&[<Self as AsRefTensor>::Element]> where
Self: AsRefTensor,
pub fn as_polynomial(&self) -> Polynomial<&[<Self as AsRefTensor>::Element]> where
Self: AsRefTensor,
Returns a borrowed polynomial from the current mask element.
Example
use concrete_core::crypto::glwe::GlweMaskElement; use concrete_core::math::polynomial::PolynomialSize; let mask = GlweMaskElement::from_container(vec![0 as u8; 10]); assert_eq!(mask.as_polynomial().polynomial_size(), PolynomialSize(10));
pub fn as_mut_polynomial(
&mut self
) -> Polynomial<&mut [<Self as AsRefTensor>::Element]> where
Self: AsMutTensor,
pub fn as_mut_polynomial(
&mut self
) -> Polynomial<&mut [<Self as AsRefTensor>::Element]> where
Self: AsMutTensor,
Returns a mutably borrowed polynomial from the current mask element.
Example
use concrete_core::crypto::glwe::GlweMaskElement; use concrete_core::math::polynomial::PolynomialSize; use concrete_core::math::tensor::{AsMutTensor, AsRefTensor}; let mut mask = GlweMaskElement::from_container(vec![0 as u8; 10]); mask.as_mut_polynomial().as_mut_tensor().fill_with_element(9); assert!(mask.as_tensor().iter().all(|a| *a == 9));
Trait Implementations
type Element = Element
type Element = Element
The element type.
Returns a mutable reference to the enclosed tensor.
type Element = Element
type Element = Element
The element type.
Returns a mutable reference to the enclosed tensor.
type Element = Element
type Element = Element
The element type.
type Container = AlignedVec<Element>
type Container = AlignedVec<Element>
The container used by the tensor.
Returns a mutable reference to the enclosed tensor.
type Element = Element
type Element = Element
The element type.
type Container = &'a mut [Element]
type Container = &'a mut [Element]
The container used by the tensor.
Returns a mutable reference to the enclosed tensor.
type Element = Element
type Element = Element
The element type of the collection container.
type Container = AlignedVec<Element>
type Container = AlignedVec<Element>
The type of the collection container.
Consumes self
and returns an owned tensor.
type Element = Element
type Element = Element
The element type of the collection container.
type Container = &'a [Element]
type Container = &'a [Element]
The type of the collection container.
Consumes self
and returns an owned tensor.
type Element = Element
type Element = Element
The element type of the collection container.
type Container = &'a mut [Element]
type Container = &'a mut [Element]
The type of the collection container.
Consumes self
and returns an owned tensor.
Auto Trait Implementations
impl<Cont> RefUnwindSafe for GlweMaskElement<Cont> where
Cont: RefUnwindSafe,
impl<Cont> Send for GlweMaskElement<Cont> where
Cont: Send,
impl<Cont> Sync for GlweMaskElement<Cont> where
Cont: Sync,
impl<Cont> Unpin for GlweMaskElement<Cont> where
Cont: Unpin,
impl<Cont> UnwindSafe for GlweMaskElement<Cont> where
Cont: UnwindSafe,