Module

Struct Module 

Source
pub struct Module<B: Backend> { /* private fields */ }

Implementations§

Source§

impl<B: Backend> Module<B>

Source

pub fn new_marker(n: u64) -> Self

Source

pub unsafe fn from_nonnull(ptr: NonNull<B::Handle>, n: u64) -> Self

Source

pub unsafe fn from_raw_parts(ptr: *mut B::Handle, n: u64) -> Self

Construct from a raw pointer managed elsewhere. SAFETY: ptr must be non-null and remain valid for the lifetime of this Module.

Source

pub unsafe fn ptr(&self) -> *mut <B as Backend>::Handle

Source

pub fn n(&self) -> usize

Source

pub fn as_mut_ptr(&self) -> *mut B::Handle

Source

pub fn log_n(&self) -> usize

Trait Implementations§

Source§

impl<BE: Backend> Convolution<BE> for Module<BE>

Source§

fn convolution_tmp_bytes(&self, res_size: usize) -> usize

Source§

fn convolution<R, A, B>( &self, res: &mut R, res_scale: i64, a: &A, b: &B, scratch: &mut Scratch<BE>, )
where R: VecZnxDftToMut<BE>, A: VecZnxToRef, B: VecZnxDftToRef<BE>,

Evaluates a bivariate convolution over Z[X, Y] / (X^N + 1) where Y = 2^-K and scales the result by 2^{res_scale * K} Read more
Source§

impl<BE: Backend> CyclotomicOrder for Module<BE>
where Self: ModuleN,

Source§

impl<B: Backend> Drop for Module<B>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl<BE: Backend> GaloisElement for Module<BE>
where Self: CyclotomicOrder,

Source§

fn galois_element(&self, generator: i64) -> i64

Source§

fn galois_element_inv(&self, gal_el: i64) -> i64

Source§

impl<BE: Backend> ModuleLogN for Module<BE>
where Self: ModuleN,

Source§

fn log_n(&self) -> usize

Source§

impl<B> ModuleN for Module<B>
where B: Backend,

Source§

fn n(&self) -> usize

Source§

impl<B> ModuleNew<B> for Module<B>
where B: Backend + ModuleNewImpl<B>,

Source§

fn new(n: u64) -> Self

Source§

impl<B> SvpApplyDft<B> for Module<B>
where B: Backend + SvpApplyDftImpl<B>,

Source§

fn svp_apply_dft<R, A, C>( &self, res: &mut R, res_col: usize, a: &A, a_col: usize, b: &C, b_col: usize, )
where R: VecZnxDftToMut<B>, A: SvpPPolToRef<B>, C: VecZnxToRef,

Source§

impl<B> SvpApplyDftToDft<B> for Module<B>

Source§

fn svp_apply_dft_to_dft<R, A, C>( &self, res: &mut R, res_col: usize, a: &A, a_col: usize, b: &C, b_col: usize, )
where R: VecZnxDftToMut<B>, A: SvpPPolToRef<B>, C: VecZnxDftToRef<B>,

Source§

impl<B> SvpApplyDftToDftAdd<B> for Module<B>

Source§

fn svp_apply_dft_to_dft_add<R, A, C>( &self, res: &mut R, res_col: usize, a: &A, a_col: usize, b: &C, b_col: usize, )
where R: VecZnxDftToMut<B>, A: SvpPPolToRef<B>, C: VecZnxDftToRef<B>,

Source§

impl<B> SvpApplyDftToDftInplace<B> for Module<B>

Source§

fn svp_apply_dft_to_dft_inplace<R, A>( &self, res: &mut R, res_col: usize, a: &A, a_col: usize, )
where R: VecZnxDftToMut<B>, A: SvpPPolToRef<B>,

Source§

impl<B> SvpPPolAlloc<B> for Module<B>
where B: Backend + SvpPPolAllocImpl<B>,

Source§

impl<B> SvpPPolBytesOf for Module<B>

Source§

impl<B> SvpPPolFromBytes<B> for Module<B>

Source§

fn svp_ppol_from_bytes(&self, cols: usize, bytes: Vec<u8>) -> SvpPPolOwned<B>

Source§

impl<B> SvpPrepare<B> for Module<B>
where B: Backend + SvpPrepareImpl<B>,

Source§

fn svp_prepare<R, A>(&self, res: &mut R, res_col: usize, a: &A, a_col: usize)
where R: SvpPPolToMut<B>, A: ScalarZnxToRef,

Source§

impl<B> VecZnxAdd for Module<B>
where B: Backend + VecZnxAddImpl<B>,

Source§

fn vec_znx_add<R, A, C>( &self, res: &mut R, res_col: usize, a: &A, a_col: usize, b: &C, b_col: usize, )

Adds the selected column of a to the selected column of b and writes the result on the selected column of res.
Source§

impl<B> VecZnxAddInplace for Module<B>

Source§

fn vec_znx_add_inplace<R, A>( &self, res: &mut R, res_col: usize, a: &A, a_col: usize, )
where R: VecZnxToMut, A: VecZnxToRef,

Adds the selected column of a to the selected column of res and writes the result on the selected column of res.
Source§

impl<B> VecZnxAddNormal for Module<B>

Source§

fn vec_znx_add_normal<R>( &self, base2k: usize, res: &mut R, res_col: usize, k: usize, source: &mut Source, sigma: f64, bound: f64, )
where R: VecZnxToMut,

Adds a discrete normal vector scaled by 2^{-k} with the provided standard deviation and bounded to [-bound, bound].
Source§

impl<B> VecZnxAddScalar for Module<B>

Source§

fn vec_znx_add_scalar<R, A, D>( &self, res: &mut R, res_col: usize, a: &A, a_col: usize, b: &D, b_col: usize, b_limb: usize, )

Adds the selected column of a on the selected column and limb of b and writes the result on the selected column of res.
Source§

impl<B> VecZnxAddScalarInplace for Module<B>

Source§

fn vec_znx_add_scalar_inplace<R, A>( &self, res: &mut R, res_col: usize, res_limb: usize, a: &A, a_col: usize, )

Adds the selected column of a on the selected column and limb of res.
Source§

impl<B> VecZnxAutomorphism for Module<B>

Source§

fn vec_znx_automorphism<R, A>( &self, k: i64, res: &mut R, res_col: usize, a: &A, a_col: usize, )
where R: VecZnxToMut, A: VecZnxToRef,

Applies the automorphism X^i -> X^ik on the selected column of a and stores the result in res_col column of res.
Source§

impl<B> VecZnxAutomorphismInplace<B> for Module<B>

Source§

fn vec_znx_automorphism_inplace<R>( &self, k: i64, res: &mut R, res_col: usize, scratch: &mut Scratch<B>, )
where R: VecZnxToMut,

Applies the automorphism X^i -> X^ik on the selected column of a.
Source§

impl<B> VecZnxAutomorphismInplaceTmpBytes for Module<B>

Source§

impl<B> VecZnxBigAdd<B> for Module<B>
where B: Backend + VecZnxBigAddImpl<B>,

Source§

fn vec_znx_big_add<R, A, C>( &self, res: &mut R, res_col: usize, a: &A, a_col: usize, b: &C, b_col: usize, )
where R: VecZnxBigToMut<B>, A: VecZnxBigToRef<B>, C: VecZnxBigToRef<B>,

Adds a to b and stores the result on c.
Source§

impl<B> VecZnxBigAddInplace<B> for Module<B>

Source§

fn vec_znx_big_add_inplace<R, A>( &self, res: &mut R, res_col: usize, a: &A, a_col: usize, )
where R: VecZnxBigToMut<B>, A: VecZnxBigToRef<B>,

Adds a to b and stores the result on b.
Source§

impl<B> VecZnxBigAddNormal<B> for Module<B>

Source§

fn vec_znx_big_add_normal<R: VecZnxBigToMut<B>>( &self, base2k: usize, res: &mut R, res_col: usize, k: usize, source: &mut Source, sigma: f64, bound: f64, )

Source§

impl<B> VecZnxBigAddSmall<B> for Module<B>

Source§

fn vec_znx_big_add_small<R, A, C>( &self, res: &mut R, res_col: usize, a: &A, a_col: usize, b: &C, b_col: usize, )
where R: VecZnxBigToMut<B>, A: VecZnxBigToRef<B>, C: VecZnxToRef,

Adds a to b and stores the result on c.
Source§

impl<B> VecZnxBigAddSmallInplace<B> for Module<B>

Source§

fn vec_znx_big_add_small_inplace<R, A>( &self, res: &mut R, res_col: usize, a: &A, a_col: usize, )
where R: VecZnxBigToMut<B>, A: VecZnxToRef,

Adds a to b and stores the result on b.
Source§

impl<B> VecZnxBigAlloc<B> for Module<B>

Source§

fn vec_znx_big_alloc(&self, cols: usize, size: usize) -> VecZnxBigOwned<B>

Source§

impl<B> VecZnxBigAutomorphism<B> for Module<B>

Source§

fn vec_znx_big_automorphism<R, A>( &self, k: i64, res: &mut R, res_col: usize, a: &A, a_col: usize, )
where R: VecZnxBigToMut<B>, A: VecZnxBigToRef<B>,

Applies the automorphism X^i -> X^ik on a and stores the result on b.
Source§

impl<B> VecZnxBigAutomorphismInplace<B> for Module<B>

Source§

fn vec_znx_big_automorphism_inplace<A>( &self, k: i64, a: &mut A, a_col: usize, scratch: &mut Scratch<B>, )
where A: VecZnxBigToMut<B>,

Applies the automorphism X^i -> X^ik on a and stores the result on a.
Source§

impl<B> VecZnxBigAutomorphismInplaceTmpBytes for Module<B>

Source§

impl<B> VecZnxBigBytesOf for Module<B>

Source§

fn bytes_of_vec_znx_big(&self, cols: usize, size: usize) -> usize

Source§

impl<B> VecZnxBigFromBytes<B> for Module<B>

Source§

fn vec_znx_big_from_bytes( &self, cols: usize, size: usize, bytes: Vec<u8>, ) -> VecZnxBigOwned<B>

Source§

impl<B> VecZnxBigFromSmall<B> for Module<B>

Source§

fn vec_znx_big_from_small<R, A>( &self, res: &mut R, res_col: usize, a: &A, a_col: usize, )
where R: VecZnxBigToMut<B>, A: VecZnxToRef,

Source§

impl<B> VecZnxBigNegate<B> for Module<B>

Source§

fn vec_znx_big_negate<R, A>( &self, res: &mut R, res_col: usize, a: &A, a_col: usize, )
where R: VecZnxBigToMut<B>, A: VecZnxBigToRef<B>,

Source§

impl<B> VecZnxBigNegateInplace<B> for Module<B>

Source§

fn vec_znx_big_negate_inplace<A>(&self, a: &mut A, a_col: usize)
where A: VecZnxBigToMut<B>,

Source§

impl<B> VecZnxBigNormalize<B> for Module<B>

Source§

fn vec_znx_big_normalize<R, A>( &self, res_basek: usize, res: &mut R, res_col: usize, a_basek: usize, a: &A, a_col: usize, scratch: &mut Scratch<B>, )
where R: VecZnxToMut, A: VecZnxBigToRef<B>,

Source§

impl<B> VecZnxBigNormalizeTmpBytes for Module<B>

Source§

impl<B> VecZnxBigSub<B> for Module<B>
where B: Backend + VecZnxBigSubImpl<B>,

Source§

fn vec_znx_big_sub<R, A, C>( &self, res: &mut R, res_col: usize, a: &A, a_col: usize, b: &C, b_col: usize, )
where R: VecZnxBigToMut<B>, A: VecZnxBigToRef<B>, C: VecZnxBigToRef<B>,

Subtracts a to b and stores the result on c.
Source§

impl<B> VecZnxBigSubInplace<B> for Module<B>

Source§

fn vec_znx_big_sub_inplace<R, A>( &self, res: &mut R, res_col: usize, a: &A, a_col: usize, )
where R: VecZnxBigToMut<B>, A: VecZnxBigToRef<B>,

Subtracts a from b and stores the result on b.
Source§

impl<B> VecZnxBigSubNegateInplace<B> for Module<B>

Source§

fn vec_znx_big_sub_negate_inplace<R, A>( &self, res: &mut R, res_col: usize, a: &A, a_col: usize, )
where R: VecZnxBigToMut<B>, A: VecZnxBigToRef<B>,

Subtracts b from a and stores the result on b.
Source§

impl<B> VecZnxBigSubSmallA<B> for Module<B>

Source§

fn vec_znx_big_sub_small_a<R, A, C>( &self, res: &mut R, res_col: usize, a: &A, a_col: usize, b: &C, b_col: usize, )
where R: VecZnxBigToMut<B>, A: VecZnxToRef, C: VecZnxBigToRef<B>,

Subtracts b from a and stores the result on c.
Source§

impl<B> VecZnxBigSubSmallB<B> for Module<B>

Source§

fn vec_znx_big_sub_small_b<R, A, C>( &self, res: &mut R, res_col: usize, a: &A, a_col: usize, b: &C, b_col: usize, )
where R: VecZnxBigToMut<B>, A: VecZnxBigToRef<B>, C: VecZnxToRef,

Subtracts b from a and stores the result on c.
Source§

impl<B> VecZnxBigSubSmallInplace<B> for Module<B>

Source§

fn vec_znx_big_sub_small_inplace<R, A>( &self, res: &mut R, res_col: usize, a: &A, a_col: usize, )
where R: VecZnxBigToMut<B>, A: VecZnxToRef,

Subtracts a from res and stores the result on res.
Source§

impl<B> VecZnxBigSubSmallNegateInplace<B> for Module<B>

Source§

fn vec_znx_big_sub_small_negate_inplace<R, A>( &self, res: &mut R, res_col: usize, a: &A, a_col: usize, )
where R: VecZnxBigToMut<B>, A: VecZnxToRef,

Subtracts res from a and stores the result on res.
Source§

impl<B> VecZnxCopy for Module<B>
where B: Backend + VecZnxCopyImpl<B>,

Source§

fn vec_znx_copy<R, A>(&self, res: &mut R, res_col: usize, a: &A, a_col: usize)
where R: VecZnxToMut, A: VecZnxToRef,

Source§

impl<B> VecZnxDftAdd<B> for Module<B>
where B: Backend + VecZnxDftAddImpl<B>,

Source§

fn vec_znx_dft_add<R, A, D>( &self, res: &mut R, res_col: usize, a: &A, a_col: usize, b: &D, b_col: usize, )
where R: VecZnxDftToMut<B>, A: VecZnxDftToRef<B>, D: VecZnxDftToRef<B>,

Source§

impl<B> VecZnxDftAddInplace<B> for Module<B>

Source§

fn vec_znx_dft_add_inplace<R, A>( &self, res: &mut R, res_col: usize, a: &A, a_col: usize, )
where R: VecZnxDftToMut<B>, A: VecZnxDftToRef<B>,

Source§

impl<B> VecZnxDftAddScaledInplace<B> for Module<B>

Source§

fn vec_znx_dft_add_scaled_inplace<R, A>( &self, res: &mut R, res_col: usize, a: &A, a_col: usize, a_scale: i64, )
where R: VecZnxDftToMut<B>, A: VecZnxDftToRef<B>,

Source§

impl<B> VecZnxDftAlloc<B> for Module<B>

Source§

fn vec_znx_dft_alloc(&self, cols: usize, size: usize) -> VecZnxDftOwned<B>

Source§

impl<B> VecZnxDftApply<B> for Module<B>

Source§

fn vec_znx_dft_apply<R, A>( &self, step: usize, offset: usize, res: &mut R, res_col: usize, a: &A, a_col: usize, )
where R: VecZnxDftToMut<B>, A: VecZnxToRef,

Source§

impl<B> VecZnxDftBytesOf for Module<B>

Source§

fn bytes_of_vec_znx_dft(&self, cols: usize, size: usize) -> usize

Source§

impl<B> VecZnxDftCopy<B> for Module<B>
where B: Backend + VecZnxDftCopyImpl<B>,

Source§

fn vec_znx_dft_copy<R, A>( &self, step: usize, offset: usize, res: &mut R, res_col: usize, a: &A, a_col: usize, )
where R: VecZnxDftToMut<B>, A: VecZnxDftToRef<B>,

Source§

impl<B> VecZnxDftFromBytes<B> for Module<B>

Source§

fn vec_znx_dft_from_bytes( &self, cols: usize, size: usize, bytes: Vec<u8>, ) -> VecZnxDftOwned<B>

Source§

impl<B> VecZnxDftSub<B> for Module<B>
where B: Backend + VecZnxDftSubImpl<B>,

Source§

fn vec_znx_dft_sub<R, A, D>( &self, res: &mut R, res_col: usize, a: &A, a_col: usize, b: &D, b_col: usize, )
where R: VecZnxDftToMut<B>, A: VecZnxDftToRef<B>, D: VecZnxDftToRef<B>,

Source§

impl<B> VecZnxDftSubInplace<B> for Module<B>

Source§

fn vec_znx_dft_sub_inplace<R, A>( &self, res: &mut R, res_col: usize, a: &A, a_col: usize, )
where R: VecZnxDftToMut<B>, A: VecZnxDftToRef<B>,

Source§

impl<B> VecZnxDftSubNegateInplace<B> for Module<B>

Source§

fn vec_znx_dft_sub_negate_inplace<R, A>( &self, res: &mut R, res_col: usize, a: &A, a_col: usize, )
where R: VecZnxDftToMut<B>, A: VecZnxDftToRef<B>,

Source§

impl<B> VecZnxDftZero<B> for Module<B>
where B: Backend + VecZnxDftZeroImpl<B>,

Source§

fn vec_znx_dft_zero<R>(&self, res: &mut R)
where R: VecZnxDftToMut<B>,

Source§

impl<B> VecZnxFillNormal for Module<B>

Source§

fn vec_znx_fill_normal<R>( &self, base2k: usize, res: &mut R, res_col: usize, k: usize, source: &mut Source, sigma: f64, bound: f64, )
where R: VecZnxToMut,

Source§

impl<B> VecZnxFillUniform for Module<B>

Source§

fn vec_znx_fill_uniform<R>( &self, base2k: usize, res: &mut R, res_col: usize, source: &mut Source, )
where R: VecZnxToMut,

Fills the first size size with uniform values in [-2^{base2k-1}, 2^{base2k-1}]
Source§

impl<B> VecZnxIdftApply<B> for Module<B>

Source§

fn vec_znx_idft_apply<R, A>( &self, res: &mut R, res_col: usize, a: &A, a_col: usize, scratch: &mut Scratch<B>, )
where R: VecZnxBigToMut<B>, A: VecZnxDftToRef<B>,

Source§

impl<B> VecZnxIdftApplyConsume<B> for Module<B>

Source§

fn vec_znx_idft_apply_consume<D: Data>( &self, a: VecZnxDft<D, B>, ) -> VecZnxBig<D, B>
where VecZnxDft<D, B>: VecZnxDftToMut<B>,

Source§

impl<B> VecZnxIdftApplyTmpA<B> for Module<B>

Source§

fn vec_znx_idft_apply_tmpa<R, A>( &self, res: &mut R, res_col: usize, a: &mut A, a_col: usize, )
where R: VecZnxBigToMut<B>, A: VecZnxDftToMut<B>,

Source§

impl<B> VecZnxIdftApplyTmpBytes for Module<B>

Source§

impl<B> VecZnxLsh<B> for Module<B>
where B: Backend + VecZnxLshImpl<B>,

Source§

fn vec_znx_lsh<R, A>( &self, base2k: usize, k: usize, res: &mut R, res_col: usize, a: &A, a_col: usize, scratch: &mut Scratch<B>, )
where R: VecZnxToMut, A: VecZnxToRef,

Left shift by k bits all columns of a.
Source§

impl<B> VecZnxLshInplace<B> for Module<B>

Source§

fn vec_znx_lsh_inplace<A>( &self, base2k: usize, k: usize, a: &mut A, a_col: usize, scratch: &mut Scratch<B>, )
where A: VecZnxToMut,

Left shift by k bits all columns of a.
Source§

impl<B> VecZnxLshTmpBytes for Module<B>

Source§

impl<B> VecZnxMergeRings<B> for Module<B>

Source§

fn vec_znx_merge_rings<R, A>( &self, res: &mut R, res_col: usize, a: &[A], a_col: usize, scratch: &mut Scratch<B>, )
where R: VecZnxToMut, A: VecZnxToRef,

Merges the subrings of the selected column of a into the selected column of res. Read more
Source§

impl<B> VecZnxMergeRingsTmpBytes for Module<B>

Source§

impl<B> VecZnxMulXpMinusOne for Module<B>

Source§

fn vec_znx_mul_xp_minus_one<R, A>( &self, p: i64, res: &mut R, res_col: usize, a: &A, a_col: usize, )
where R: VecZnxToMut, A: VecZnxToRef,

Source§

impl<B> VecZnxMulXpMinusOneInplace<B> for Module<B>

Source§

fn vec_znx_mul_xp_minus_one_inplace<R>( &self, p: i64, res: &mut R, res_col: usize, scratch: &mut Scratch<B>, )
where R: VecZnxToMut,

Source§

impl<B> VecZnxMulXpMinusOneInplaceTmpBytes for Module<B>

Source§

impl<B> VecZnxNegate for Module<B>
where B: Backend + VecZnxNegateImpl<B>,

Source§

fn vec_znx_negate<R, A>(&self, res: &mut R, res_col: usize, a: &A, a_col: usize)
where R: VecZnxToMut, A: VecZnxToRef,

Source§

impl<B> VecZnxNegateInplace for Module<B>

Source§

fn vec_znx_negate_inplace<A>(&self, a: &mut A, a_col: usize)
where A: VecZnxToMut,

Negates the selected column of a.
Source§

impl<B> VecZnxNormalize<B> for Module<B>

Source§

fn vec_znx_normalize<R, A>( &self, res_basek: usize, res: &mut R, res_col: usize, a_basek: usize, a: &A, a_col: usize, scratch: &mut Scratch<B>, )
where R: VecZnxToMut, A: VecZnxToRef,

Normalizes the selected column of a and stores the result into the selected column of res.
Source§

impl<B> VecZnxNormalizeInplace<B> for Module<B>

Source§

fn vec_znx_normalize_inplace<A>( &self, base2k: usize, a: &mut A, a_col: usize, scratch: &mut Scratch<B>, )
where A: VecZnxToMut,

Normalizes the selected column of a.
Source§

impl<B> VecZnxNormalizeTmpBytes for Module<B>

Source§

fn vec_znx_normalize_tmp_bytes(&self) -> usize

Returns the minimum number of bytes necessary for normalization.
Source§

impl<B> VecZnxRotate for Module<B>
where B: Backend + VecZnxRotateImpl<B>,

Source§

fn vec_znx_rotate<R, A>( &self, k: i64, res: &mut R, res_col: usize, a: &A, a_col: usize, )
where R: VecZnxToMut, A: VecZnxToRef,

Multiplies the selected column of a by X^k and stores the result in res_col of res.
Source§

impl<B> VecZnxRotateInplace<B> for Module<B>

Source§

fn vec_znx_rotate_inplace<A>( &self, k: i64, a: &mut A, a_col: usize, scratch: &mut Scratch<B>, )
where A: VecZnxToMut,

Multiplies the selected column of a by X^k.
Source§

impl<B> VecZnxRotateInplaceTmpBytes for Module<B>

Source§

impl<B> VecZnxRsh<B> for Module<B>
where B: Backend + VecZnxRshImpl<B>,

Source§

fn vec_znx_rsh<R, A>( &self, base2k: usize, k: usize, res: &mut R, res_col: usize, a: &A, a_col: usize, scratch: &mut Scratch<B>, )
where R: VecZnxToMut, A: VecZnxToRef,

Right shift by k bits all columns of a.
Source§

impl<B> VecZnxRshInplace<B> for Module<B>

Source§

fn vec_znx_rsh_inplace<A>( &self, base2k: usize, k: usize, a: &mut A, a_col: usize, scratch: &mut Scratch<B>, )
where A: VecZnxToMut,

Right shift by k bits all columns of a.
Source§

impl<B> VecZnxRshTmpBytes for Module<B>

Source§

impl<B> VecZnxSplitRing<B> for Module<B>

Source§

fn vec_znx_split_ring<R, A>( &self, res: &mut [R], res_col: usize, a: &A, a_col: usize, scratch: &mut Scratch<B>, )
where R: VecZnxToMut, A: VecZnxToRef,

Splits the selected columns of b into subrings and copies them them into the selected column of res. Read more
Source§

impl<B> VecZnxSplitRingTmpBytes for Module<B>

Source§

impl<B> VecZnxSub for Module<B>
where B: Backend + VecZnxSubImpl<B>,

Source§

fn vec_znx_sub<R, A, C>( &self, res: &mut R, res_col: usize, a: &A, a_col: usize, b: &C, b_col: usize, )

Subtracts the selected column of b from the selected column of a and writes the result on the selected column of res.
Source§

impl<B> VecZnxSubInplace for Module<B>

Source§

fn vec_znx_sub_inplace<R, A>( &self, res: &mut R, res_col: usize, a: &A, a_col: usize, )
where R: VecZnxToMut, A: VecZnxToRef,

Subtracts the selected column of a from the selected column of res inplace. Read more
Source§

impl<B> VecZnxSubNegateInplace for Module<B>

Source§

fn vec_znx_sub_negate_inplace<R, A>( &self, res: &mut R, res_col: usize, a: &A, a_col: usize, )
where R: VecZnxToMut, A: VecZnxToRef,

Subtracts the selected column of res from the selected column of a and inplace mutates res Read more
Source§

impl<B> VecZnxSubScalar for Module<B>

Source§

fn vec_znx_sub_scalar<R, A, D>( &self, res: &mut R, res_col: usize, a: &A, a_col: usize, b: &D, b_col: usize, b_limb: usize, )

Subtracts the selected column of a on the selected column and limb of b and writes the result on the selected column of res.
Source§

impl<B> VecZnxSubScalarInplace for Module<B>

Source§

fn vec_znx_sub_scalar_inplace<R, A>( &self, res: &mut R, res_col: usize, res_limb: usize, a: &A, a_col: usize, )

Subtracts the selected column of a on the selected column and limb of res.
Source§

impl<B> VecZnxSwitchRing for Module<B>

Source§

fn vec_znx_switch_ring<R, A>( &self, res: &mut R, res_col: usize, a: &A, a_col: usize, )
where R: VecZnxToMut, A: VecZnxToRef,

Source§

impl<B> VmpApplyDft<B> for Module<B>
where B: Backend + VmpApplyDftImpl<B>,

Source§

fn vmp_apply_dft<R, A, C>( &self, res: &mut R, a: &A, b: &C, scratch: &mut Scratch<B>, )
where R: VecZnxDftToMut<B>, A: VecZnxToRef, C: VmpPMatToRef<B>,

Source§

impl<B> VmpApplyDftTmpBytes for Module<B>

Source§

fn vmp_apply_dft_tmp_bytes( &self, res_size: usize, a_size: usize, b_rows: usize, b_cols_in: usize, b_cols_out: usize, b_size: usize, ) -> usize

Source§

impl<B> VmpApplyDftToDft<B> for Module<B>

Source§

fn vmp_apply_dft_to_dft<R, A, C>( &self, res: &mut R, a: &A, b: &C, scratch: &mut Scratch<B>, )
where R: VecZnxDftToMut<B>, A: VecZnxDftToRef<B>, C: VmpPMatToRef<B>,

Applies the vector matrix product crate::layouts::VecZnxDft x crate::layouts::VmpPMat. Read more
Source§

impl<B> VmpApplyDftToDftAdd<B> for Module<B>

Source§

fn vmp_apply_dft_to_dft_add<R, A, C>( &self, res: &mut R, a: &A, b: &C, scale: usize, scratch: &mut Scratch<B>, )
where R: VecZnxDftToMut<B>, A: VecZnxDftToRef<B>, C: VmpPMatToRef<B>,

Source§

impl<B> VmpApplyDftToDftAddTmpBytes for Module<B>

Source§

fn vmp_apply_dft_to_dft_add_tmp_bytes( &self, res_size: usize, a_size: usize, b_rows: usize, b_cols_in: usize, b_cols_out: usize, b_size: usize, ) -> usize

Source§

impl<B> VmpApplyDftToDftTmpBytes for Module<B>

Source§

fn vmp_apply_dft_to_dft_tmp_bytes( &self, res_size: usize, a_size: usize, b_rows: usize, b_cols_in: usize, b_cols_out: usize, b_size: usize, ) -> usize

Source§

impl<B> VmpPMatAlloc<B> for Module<B>
where B: Backend + VmpPMatAllocImpl<B>,

Source§

fn vmp_pmat_alloc( &self, rows: usize, cols_in: usize, cols_out: usize, size: usize, ) -> VmpPMatOwned<B>

Source§

impl<B> VmpPMatBytesOf for Module<B>

Source§

fn bytes_of_vmp_pmat( &self, rows: usize, cols_in: usize, cols_out: usize, size: usize, ) -> usize

Source§

impl<B> VmpPMatFromBytes<B> for Module<B>

Source§

fn vmp_pmat_from_bytes( &self, rows: usize, cols_in: usize, cols_out: usize, size: usize, bytes: Vec<u8>, ) -> VmpPMatOwned<B>

Source§

impl<B> VmpPrepare<B> for Module<B>
where B: Backend + VmpPrepareImpl<B>,

Source§

fn vmp_prepare<R, A>(&self, res: &mut R, a: &A, scratch: &mut Scratch<B>)
where R: VmpPMatToMut<B>, A: MatZnxToRef,

Source§

impl<B> VmpPrepareTmpBytes for Module<B>

Source§

fn vmp_prepare_tmp_bytes( &self, rows: usize, cols_in: usize, cols_out: usize, size: usize, ) -> usize

Source§

impl<B> ZnAddNormal for Module<B>
where B: Backend + ZnAddNormalImpl<B>,

Source§

fn zn_add_normal<R>( &self, n: usize, base2k: usize, res: &mut R, res_col: usize, k: usize, source: &mut Source, sigma: f64, bound: f64, )
where R: ZnToMut,

Adds a discrete normal vector scaled by 2^{-k} with the provided standard deviation and bounded to [-bound, bound].
Source§

impl<B> ZnFillNormal for Module<B>
where B: Backend + ZnFillNormalImpl<B>,

Source§

fn zn_fill_normal<R>( &self, n: usize, base2k: usize, res: &mut R, res_col: usize, k: usize, source: &mut Source, sigma: f64, bound: f64, )
where R: ZnToMut,

Source§

impl<B> ZnFillUniform for Module<B>
where B: Backend + ZnFillUniformImpl<B>,

Source§

fn zn_fill_uniform<R>( &self, n: usize, base2k: usize, res: &mut R, res_col: usize, source: &mut Source, )
where R: ZnToMut,

Fills the first size size with uniform values in [-2^{base2k-1}, 2^{base2k-1}]
Source§

impl<B> ZnNormalizeInplace<B> for Module<B>

Source§

fn zn_normalize_inplace<A>( &self, n: usize, base2k: usize, a: &mut A, a_col: usize, scratch: &mut Scratch<B>, )
where A: ZnToMut,

Normalizes the selected column of a.
Source§

impl<B> ZnNormalizeTmpBytes for Module<B>

Source§

impl<B: Backend> Send for Module<B>

Source§

impl<B: Backend> Sync for Module<B>

Auto Trait Implementations§

§

impl<B> Freeze for Module<B>

§

impl<B> RefUnwindSafe for Module<B>

§

impl<B> Unpin for Module<B>
where B: Unpin,

§

impl<B> UnwindSafe for Module<B>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Az for T

Source§

fn az<Dst>(self) -> Dst
where T: Cast<Dst>,

Casts the value.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<Src, Dst> CastFrom<Src> for Dst
where Src: Cast<Dst>,

Source§

fn cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> CheckedAs for T

Source§

fn checked_as<Dst>(self) -> Option<Dst>
where T: CheckedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> CheckedCastFrom<Src> for Dst
where Src: CheckedCast<Dst>,

Source§

fn checked_cast_from(src: Src) -> Option<Dst>

Casts the value.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> OverflowingAs for T

Source§

fn overflowing_as<Dst>(self) -> (Dst, bool)
where T: OverflowingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> OverflowingCastFrom<Src> for Dst
where Src: OverflowingCast<Dst>,

Source§

fn overflowing_cast_from(src: Src) -> (Dst, bool)

Casts the value.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> SaturatingAs for T

Source§

fn saturating_as<Dst>(self) -> Dst
where T: SaturatingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> SaturatingCastFrom<Src> for Dst
where Src: SaturatingCast<Dst>,

Source§

fn saturating_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> UnwrappedAs for T

Source§

fn unwrapped_as<Dst>(self) -> Dst
where T: UnwrappedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> UnwrappedCastFrom<Src> for Dst
where Src: UnwrappedCast<Dst>,

Source§

fn unwrapped_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WrappingAs for T

Source§

fn wrapping_as<Dst>(self) -> Dst
where T: WrappingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> WrappingCastFrom<Src> for Dst
where Src: WrappingCast<Dst>,

Source§

fn wrapping_cast_from(src: Src) -> Dst

Casts the value.