pub struct MachineBuilder<D: Discretization> { /* private fields */ }Expand description
Implementations§
Source§impl<D: Discretization> MachineBuilder<D>
impl<D: Discretization> MachineBuilder<D>
Sourcepub fn new(disc: D) -> Self
pub fn new(disc: D) -> Self
Create a builder with default precision parameters.
Defaults:
min_precision: 20 bitsmax_precision: 10,000 bitsslack_unit: 512profiling: enabled, buffer capacity 1000
Sourcepub fn min_precision(self, v: u32) -> Self
pub fn min_precision(self, v: u32) -> Self
Set the minimum working precision in bits.
Sourcepub fn max_precision(self, v: u32) -> Self
pub fn max_precision(self, v: u32) -> Self
Set the maximum working precision in bits.
Sourcepub fn slack_unit(self, v: i64) -> Self
pub fn slack_unit(self, v: i64) -> Self
Set the slack unit used when computing slack bits.
Sourcepub fn base_tuning_precision(self, v: u32) -> Self
pub fn base_tuning_precision(self, v: u32) -> Self
Set the base tuning precision added to discretization targets.
Sourcepub fn ampl_tuning_bits(self, v: u32) -> Self
pub fn ampl_tuning_bits(self, v: u32) -> Self
Set the amplification tuning bits added during propagation.
Sourcepub fn enable_profiling(self, enabled: bool) -> Self
pub fn enable_profiling(self, enabled: bool) -> Self
Enable or disable per-instruction profiling (enabled by default).
Sourcepub fn profile_capacity(self, cap: usize) -> Self
pub fn profile_capacity(self, cap: usize) -> Self
Set profiling buffer capacity (default 1000 records).
Sourcepub fn build(self, exprs: Vec<Expr>, vars: Vec<String>) -> Machine<D>
pub fn build(self, exprs: Vec<Expr>, vars: Vec<String>) -> Machine<D>
Compile expressions into a machine.
exprs is a list of real-number expressions, using Expr.
vars is a list of the free variables of these expressions.
An empty vars list can be provided if the expressions
have no free variables.
Returns a Machine, an opaque type that can be passed to
Machine::apply to evaluate the compiled real expressions
on a specific point.
Auto Trait Implementations§
impl<D> Freeze for MachineBuilder<D>where
D: Freeze,
impl<D> RefUnwindSafe for MachineBuilder<D>where
D: RefUnwindSafe,
impl<D> Send for MachineBuilder<D>where
D: Send,
impl<D> Sync for MachineBuilder<D>where
D: Sync,
impl<D> Unpin for MachineBuilder<D>where
D: Unpin,
impl<D> UnsafeUnpin for MachineBuilder<D>where
D: UnsafeUnpin,
impl<D> UnwindSafe for MachineBuilder<D>where
D: UnwindSafe,
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
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
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>
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>
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