pub struct Dispatcher { /* private fields */ }Expand description
Routes operations to the minimal set of RNS channels.
Implementations§
Source§impl Dispatcher
impl Dispatcher
pub fn new(channels: Channels) -> Self
Sourcepub fn plan_add(&self, a: &RnsRational, b: &RnsRational) -> DispatchPlan
pub fn plan_add(&self, a: &RnsRational, b: &RnsRational) -> DispatchPlan
Plan an addition: the natural base is the LCM of the operands’ bases.
Sourcepub fn plan_mul(&self, a: &RnsRational, b: &RnsRational) -> DispatchPlan
pub fn plan_mul(&self, a: &RnsRational, b: &RnsRational) -> DispatchPlan
Plan a multiplication.
Sourcepub fn execute_add(&self, a: &RnsRational, b: &RnsRational) -> RnsRational
pub fn execute_add(&self, a: &RnsRational, b: &RnsRational) -> RnsRational
Execute an addition (the result is exact regardless of the plan; the plan is the hardware-scheduling hint).
Sourcepub fn execute_mul(&self, a: &RnsRational, b: &RnsRational) -> RnsRational
pub fn execute_mul(&self, a: &RnsRational, b: &RnsRational) -> RnsRational
Execute a multiplication.
Sourcepub fn channel_efficiency(&self, plan: &DispatchPlan) -> f64
pub fn channel_efficiency(&self, plan: &DispatchPlan) -> f64
Fraction of channels that are active for this plan (in [0, 1]).
Sourcepub fn channel_idle_fraction(&self, plan: &DispatchPlan) -> f64
pub fn channel_idle_fraction(&self, plan: &DispatchPlan) -> f64
Fraction of channels left idle for this plan.
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