Struct concrete_core::crypto::ggsw::GgswLevelRow [−][src]
pub struct GgswLevelRow<Cont> { /* fields omitted */ }
Expand description
A row of a GGSW level matrix.
Implementations
pub fn from_container(
cont: Cont,
poly_size: PolynomialSize,
level: DecompositionLevel
) -> Self where
Cont: AsRefSlice,
pub fn from_container(
cont: Cont,
poly_size: PolynomialSize,
level: DecompositionLevel
) -> Self where
Cont: AsRefSlice,
Creates an Rgsw level row from an arbitrary container.
Example
use concrete_core::crypto::ggsw::GgswLevelRow; use concrete_core::crypto::GlweSize; use concrete_core::math::decomposition::DecompositionLevel; use concrete_core::math::polynomial::PolynomialSize; let level_row = GgswLevelRow::from_container( vec![0 as u8; 10 * 7], PolynomialSize(10), DecompositionLevel(1) ); assert_eq!(level_row.polynomial_size(), PolynomialSize(10)); assert_eq!(level_row.glwe_size(), GlweSize(7)); assert_eq!(level_row.decomposition_level(), DecompositionLevel(1));
Returns the size of the glwe ciphertext composing this level row.
Example
use concrete_core::crypto::ggsw::GgswLevelRow; use concrete_core::crypto::GlweSize; use concrete_core::math::polynomial::PolynomialSize; use concrete_core::math::decomposition::DecompositionLevel; let level_row = GgswLevelRow::from_container( vec![0 as u8; 10 * 7], PolynomialSize(10), DecompositionLevel(1) ); assert_eq!(level_row.glwe_size(), GlweSize(7));
Returns the index of the level corresponding to this row.
Example
use concrete_core::crypto::ggsw::GgswLevelRow; use concrete_core::crypto::GlweSize; use concrete_core::math::decomposition::DecompositionLevel; use concrete_core::math::polynomial::PolynomialSize; let level_row = GgswLevelRow::from_container( vec![0 as u8; 10 * 7], PolynomialSize(10), DecompositionLevel(1) ); assert_eq!(level_row.decomposition_level(), DecompositionLevel(1));
Returns the size of the polynomials used in the row.
Example
use concrete_core::crypto::ggsw::GgswLevelRow; use concrete_core::crypto::GlweSize; use concrete_core::math::decomposition::DecompositionLevel; use concrete_core::math::polynomial::PolynomialSize; let level_row = GgswLevelRow::from_container( vec![0 as u8; 10 * 7], PolynomialSize(10), DecompositionLevel(1) ); assert_eq!(level_row.polynomial_size(), PolynomialSize(10));
Consumes the row and returns its container wrapped into an GlweCiphertext
.
Example
use concrete_core::crypto::ggsw::GgswLevelRow; use concrete_core::crypto::GlweSize; use concrete_core::math::decomposition::DecompositionLevel; use concrete_core::math::polynomial::PolynomialSize; let level_row = GgswLevelRow::from_container( vec![0 as u8; 10 * 7], PolynomialSize(10), DecompositionLevel(1) ); let rlwe = level_row.into_rlwe(); assert_eq!(rlwe.polynomial_size(), PolynomialSize(10)) ; assert_eq!(rlwe.size(), GlweSize(7));
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 GgswLevelRow<Cont> where
Cont: RefUnwindSafe,
impl<Cont> Send for GgswLevelRow<Cont> where
Cont: Send,
impl<Cont> Sync for GgswLevelRow<Cont> where
Cont: Sync,
impl<Cont> Unpin for GgswLevelRow<Cont> where
Cont: Unpin,
impl<Cont> UnwindSafe for GgswLevelRow<Cont> where
Cont: UnwindSafe,