Struct concrete_core::crypto::glwe::GlweMaskElement [−][src]
A mask of an GLWE ciphertext.
Implementations
impl<Container> GlweMaskElement<Container>
[src]
pub fn from_container(cont: Container) -> GlweMaskElement<Container>
[src]
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::Element]> where
Self: AsRefTensor,
[src]
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::Element]> where
Self: AsMutTensor,
[src]
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
impl<Element> AsMutTensor for GlweMaskElement<Vec<Element>>
[src]
type Element = Element
The element type.
type Container = Vec<Element>
The container used by the tensor.
fn as_mut_tensor(&mut self) -> &mut Tensor<Self::Container>
[src]
impl<Element> AsMutTensor for GlweMaskElement<[Element; 1]>
[src]
type Element = Element
The element type.
type Container = [Element; 1]
The container used by the tensor.
fn as_mut_tensor(&mut self) -> &mut Tensor<Self::Container>
[src]
impl<Element> AsMutTensor for GlweMaskElement<AlignedVec<Element>>
[src]
type Element = Element
The element type.
type Container = AlignedVec<Element>
The container used by the tensor.
fn as_mut_tensor(&mut self) -> &mut Tensor<Self::Container>
[src]
impl<'a, Element> AsMutTensor for GlweMaskElement<&'a mut [Element]>
[src]
type Element = Element
The element type.
type Container = &'a mut [Element]
The container used by the tensor.
fn as_mut_tensor(&mut self) -> &mut Tensor<Self::Container>
[src]
impl<Element> AsRefTensor for GlweMaskElement<Vec<Element>>
[src]
type Element = Element
The element type.
type Container = Vec<Element>
The container used by the tensor.
fn as_tensor(&self) -> &Tensor<Self::Container>
[src]
impl<Element> AsRefTensor for GlweMaskElement<AlignedVec<Element>>
[src]
type Element = Element
The element type.
type Container = AlignedVec<Element>
The container used by the tensor.
fn as_tensor(&self) -> &Tensor<Self::Container>
[src]
impl<Element> AsRefTensor for GlweMaskElement<[Element; 1]>
[src]
type Element = Element
The element type.
type Container = [Element; 1]
The container used by the tensor.
fn as_tensor(&self) -> &Tensor<Self::Container>
[src]
impl<'a, Element> AsRefTensor for GlweMaskElement<&'a [Element]>
[src]
type Element = Element
The element type.
type Container = &'a [Element]
The container used by the tensor.
fn as_tensor(&self) -> &Tensor<Self::Container>
[src]
impl<'a, Element> AsRefTensor for GlweMaskElement<&'a mut [Element]>
[src]
type Element = Element
The element type.
type Container = &'a mut [Element]
The container used by the tensor.
fn as_tensor(&self) -> &Tensor<Self::Container>
[src]
impl<Element> IntoTensor for GlweMaskElement<Vec<Element>>
[src]
type Element = Element
The element type of the collection container.
type Container = Vec<Element>
The type of the collection container.
fn into_tensor(self) -> Tensor<Self::Container>
[src]
impl<Element> IntoTensor for GlweMaskElement<AlignedVec<Element>>
[src]
type Element = Element
The element type of the collection container.
type Container = AlignedVec<Element>
The type of the collection container.
fn into_tensor(self) -> Tensor<Self::Container>
[src]
impl<Element> IntoTensor for GlweMaskElement<[Element; 1]>
[src]
type Element = Element
The element type of the collection container.
type Container = [Element; 1]
The type of the collection container.
fn into_tensor(self) -> Tensor<Self::Container>
[src]
impl<'a, Element> IntoTensor for GlweMaskElement<&'a [Element]>
[src]
type Element = Element
The element type of the collection container.
type Container = &'a [Element]
The type of the collection container.
fn into_tensor(self) -> Tensor<Self::Container>
[src]
impl<'a, Element> IntoTensor for GlweMaskElement<&'a mut [Element]>
[src]
type Element = Element
The element type of the collection container.
type Container = &'a mut [Element]
The type of the collection container.
fn into_tensor(self) -> Tensor<Self::Container>
[src]
Auto Trait Implementations
impl<Cont> RefUnwindSafe for GlweMaskElement<Cont> where
Cont: RefUnwindSafe,
Cont: RefUnwindSafe,
impl<Cont> Send for GlweMaskElement<Cont> where
Cont: Send,
Cont: Send,
impl<Cont> Sync for GlweMaskElement<Cont> where
Cont: Sync,
Cont: Sync,
impl<Cont> Unpin for GlweMaskElement<Cont> where
Cont: Unpin,
Cont: Unpin,
impl<Cont> UnwindSafe for GlweMaskElement<Cont> where
Cont: UnwindSafe,
Cont: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<Input, Output> CastInto<Output> for Input where
Output: CastFrom<Input>,
[src]
Output: CastFrom<Input>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,