pub struct ParametricSimplexSolver { /* private fields */ }Expand description
Parametric simplex solver.
Implementations§
Source§impl ParametricSimplexSolver
impl ParametricSimplexSolver
Sourcepub fn new(config: ParametricSimplexConfig, simplex: SimplexSolver) -> Self
pub fn new(config: ParametricSimplexConfig, simplex: SimplexSolver) -> Self
Create a new parametric simplex solver.
The simplex argument is the base LP whose objective (or RHS) will be
perturbed parametrically.
Sourcepub fn default_config() -> Self
pub fn default_config() -> Self
Create with default configuration and an empty 0-variable LP.
Sourcepub fn set_simplex(&mut self, simplex: SimplexSolver)
pub fn set_simplex(&mut self, simplex: SimplexSolver)
Replace the base simplex solver.
Sourcepub fn set_parametric_coeff(&mut self, id: usize, coeff: BigRational)
pub fn set_parametric_coeff(&mut self, id: usize, coeff: BigRational)
Set parametric coefficient for a variable/constraint.
Sourcepub fn solve(&mut self) -> ParametricSimplexResult
pub fn solve(&mut self) -> ParametricSimplexResult
Solve the parametric LP.
Sweeps λ from lambda_min to lambda_max, solving the LP at each
candidate breakpoint. A breakpoint occurs whenever the parametric
update changes an objective coefficient (Objective mode) or a RHS
value (Rhs mode) enough to alter the optimal basis.
The algorithm:
- Solve at λ =
lambda_min, recording the initial breakpoint. - Advance λ to the next candidate (computed from dual feasibility).
- Re-optimise and record if basis changed.
- Repeat until
lambda_maxis reached or the breakpoint limit hit.
Sourcepub fn breakpoints(&self) -> &[Breakpoint]
pub fn breakpoints(&self) -> &[Breakpoint]
Get breakpoints.
Sourcepub fn intervals(&self) -> &[ParametricInterval]
pub fn intervals(&self) -> &[ParametricInterval]
Get intervals.
Sourcepub fn evaluate(&self, lambda: &BigRational) -> Option<BigRational>
pub fn evaluate(&self, lambda: &BigRational) -> Option<BigRational>
Evaluate optimal value at parameter λ.
Sourcepub fn stats(&self) -> &ParametricSimplexStats
pub fn stats(&self) -> &ParametricSimplexStats
Get statistics.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ParametricSimplexSolver
impl RefUnwindSafe for ParametricSimplexSolver
impl Send for ParametricSimplexSolver
impl Sync for ParametricSimplexSolver
impl Unpin for ParametricSimplexSolver
impl UnsafeUnpin for ParametricSimplexSolver
impl UnwindSafe for ParametricSimplexSolver
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