pub struct AlmostExactSharedBaseConversion<A = Global>{ /* private fields */ }Expand description
Computes almost exact base conversion with a shared factor. The exact map would be
Z/aqZ -> Z/aq'Z, x -> lift(x) mod aq'but as usual, we allow an error of +/- aq, unless the shortest
lift of the input is bounded by aq/4, in which case the result
is always correct.
The functionality is exactly as for super::lift::AlmostExactBaseConversion,
except that it might be faster by reusing the shared factor a.
Implementations§
Sourcepub fn new_with(
shared_moduli: Vec<Zn>,
additional_in_moduli: Vec<Zn>,
additional_out_moduli: Vec<Zn>,
allocator: A,
) -> Self
pub fn new_with( shared_moduli: Vec<Zn>, additional_in_moduli: Vec<Zn>, additional_out_moduli: Vec<Zn>, allocator: A, ) -> Self
Creates a new AlmostExactSharedBaseConversion, where
ais the product ofshared_moduliqis the product ofadditional_in_modulia'is the product ofadditional_out_moduli
The input resp. output moduli are ordered as in shared_moduli, followed
by additional_in_moduli resp. additional_out_moduli. In other words, the
additional moduli are appended at the end to the shared moduli.
Trait Implementations§
type Ring = RingValue<ZnBase>
type RingType = ZnBase
fn input_rings<'a>(&'a self) -> &'a [Self::Ring]
fn output_rings<'a>(&'a self) -> &'a [Self::Ring]
Source§fn apply<V1, V2>(
&self,
input: Submatrix<'_, V1, El<Self::Ring>>,
output: SubmatrixMut<'_, V2, El<Self::Ring>>,
)
fn apply<V1, V2>( &self, input: Submatrix<'_, V1, El<Self::Ring>>, output: SubmatrixMut<'_, V2, El<Self::Ring>>, )
Applies the RNS operation to each column of the given matrix, and writes the results to the columns
of
output. The entries of the i-th row are considered to be elements of self.input_rings().at(i)
resp. self.output_rings().at(i).Auto Trait Implementations§
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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