Struct concrete_core::crypto::ggsw::GgswLevelRow[][src]

pub struct GgswLevelRow<Cont> { /* fields omitted */ }
Expand description

A row of a GGSW level matrix.

Implementations

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

The element type.

The container used by the tensor.

Returns a mutable reference to the enclosed tensor.

The element type.

The container used by the tensor.

Returns a mutable reference to the enclosed tensor.

The element type.

The container used by the tensor.

Returns a mutable reference to the enclosed tensor.

The element type.

The container used by the tensor.

Returns a mutable reference to the enclosed tensor.

The element type.

The container used by the tensor.

Returns a reference to the enclosed tensor.

The element type.

The container used by the tensor.

Returns a reference to the enclosed tensor.

The element type.

The container used by the tensor.

Returns a reference to the enclosed tensor.

The element type.

The container used by the tensor.

Returns a reference to the enclosed tensor.

The element type.

The container used by the tensor.

Returns a reference to the enclosed tensor.

The element type of the collection container.

The type of the collection container.

Consumes self and returns an owned tensor.

The element type of the collection container.

The type of the collection container.

Consumes self and returns an owned tensor.

The element type of the collection container.

The type of the collection container.

Consumes self and returns an owned tensor.

The element type of the collection container.

The type of the collection container.

Consumes self and returns an owned tensor.

The element type of the collection container.

The type of the collection container.

Consumes self and returns an owned tensor.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.