pub struct Model { /* private fields */ }Implementations§
Source§impl Model
impl Model
pub fn with_config(self, config: SolverConfig) -> Self
Sourcepub fn set_max_iterations(&mut self, max_iterations: u32)
pub fn set_max_iterations(&mut self, max_iterations: u32)
Sets the maximum number of iterations for the solver.
Default is 10,000.
Sourcepub fn set_tolerance(&mut self, tolerance: f64)
pub fn set_tolerance(&mut self, tolerance: f64)
Sets the numerical tolerance (epsilon) for the solver.
Default is 1e-10. Values smaller than this are treated as zero.
pub fn add_variable(&mut self) -> VariableBuilder<'_>
pub fn add_constraint( &mut self, lhs: impl Into<LinearExpr<VariableKey>>, ) -> ConstraintBuilder<'_>
pub fn set_objective( &mut self, sense: ObjectiveSense, expression: impl Into<LinearExpr<VariableKey>>, )
Sourcepub fn format<'a, T>(&'a self, item: T) -> ModelDisplay<'a, T>
pub fn format<'a, T>(&'a self, item: T) -> ModelDisplay<'a, T>
Returns a helper object that implements Display, allowing you to print keys (Variables/Constraints) using their actual Names from the Model.
pub fn solve(&mut self) -> Result<SolverSolution<VariableKey>, SolverError>
pub fn variables(&self) -> &DenseSlotMap<VariableKey, Variable>
pub fn constraints(&self) -> &DenseSlotMap<ConstraintKey, Constraint>
pub fn objective(&self) -> Option<&Objective>
pub fn config(&self) -> &SolverConfig
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Model
impl RefUnwindSafe for Model
impl Send for Model
impl Sync for Model
impl Unpin for Model
impl UnsafeUnpin for Model
impl UnwindSafe for Model
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