pub struct Dispatcher { /* private fields */ }Expand description
Analyzes operands and provisions the adaptive basis.
Implementations§
Source§impl Dispatcher
impl Dispatcher
pub fn new(basis: Basis) -> Self
Sourcepub fn plan_add(&self, a: &RnsRational, b: &RnsRational) -> DispatchPlan
pub fn plan_add(&self, a: &RnsRational, b: &RnsRational) -> DispatchPlan
Plan an addition: (p1·q2 + p2·q1) / (q1·q2).
Sourcepub fn plan_mul(&self, a: &RnsRational, b: &RnsRational) -> DispatchPlan
pub fn plan_mul(&self, a: &RnsRational, b: &RnsRational) -> DispatchPlan
Plan a multiplication: (p1·p2) / (q1·q2).
Sourcepub fn provision(&mut self, plan: &DispatchPlan)
pub fn provision(&mut self, plan: &DispatchPlan)
Grow the basis so the (planned) result reconstructs without aliasing.
Sourcepub fn execute_add(&self, a: &RnsRational, b: &RnsRational) -> RnsRational
pub fn execute_add(&self, a: &RnsRational, b: &RnsRational) -> RnsRational
Execute an addition (exact regardless of the plan).
Sourcepub fn execute_mul(&self, a: &RnsRational, b: &RnsRational) -> RnsRational
pub fn execute_mul(&self, a: &RnsRational, b: &RnsRational) -> RnsRational
Execute a multiplication (exact regardless of the plan).
Sourcepub fn invalid_channels(&self, denom: &BigInt) -> Vec<usize>
pub fn invalid_channels(&self, denom: &BigInt) -> Vec<usize>
Per-value channel validity mask: indices of channels whose prime divides
denom (and are therefore excluded from that value’s reconstruction).
Auto Trait Implementations§
impl Freeze for Dispatcher
impl RefUnwindSafe for Dispatcher
impl Send for Dispatcher
impl Sync for Dispatcher
impl Unpin for Dispatcher
impl UnsafeUnpin for Dispatcher
impl UnwindSafe for Dispatcher
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> 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