pub struct SolverOptions {Show 22 fields
pub primal_tol: f64,
pub max_etas: usize,
pub clamp_tol: f64,
pub simplex_method: SimplexMethod,
pub dual_tol: f64,
pub dual_pricing: DualPricing,
pub warm_start: Option<WarmStartBasis>,
pub warm_start_qp: Option<QpWarmStart>,
pub warm_start_lp: Option<LpWarmStart>,
pub recover_warm_start_basis: bool,
pub use_lp_crash_basis: bool,
pub presolve: bool,
pub presolve_max_pass: usize,
pub presolve_phase2: bool,
pub timeout_secs: Option<f64>,
pub use_ruiz_scaling: bool,
pub tolerance: Option<Tolerance>,
pub ipm: IpmOptions,
pub multistart: Option<MultiStartConfig>,
pub global_optimization: Option<GlobalOptimizationConfig>,
pub threads: usize,
pub known_optimal_obj: Option<f64>,
/* private fields */
}Expand description
Solver configuration.
Controls tolerances, iteration limits, refactorisation frequency, and
algorithm selection. Default uses values from tolerances.rs.
§Validation
Call SolverOptions::validate (or use builder methods) before solving
to catch invalid values (NaN, zero, negative tolerances, etc.) early.
§Solver-specific parameters
Use the SolverOptions::ipm sub-struct for IPM-specific settings.
Fields§
§primal_tol: f64Simplex primal feasibility / optimality threshold. Default: PIVOT_TOL.
max_etas: usizeMax eta-file count (refactorisation threshold). 0 = auto (from problem size).
clamp_tol: f64Micro-value clamp threshold. Default: DEFAULT_CLAMP_TOL.
simplex_method: SimplexMethodSimplex algorithm selection. Default: Auto.
dual_tol: f64Dual feasibility threshold. Default: PIVOT_TOL.
dual_pricing: DualPricingDual simplex leaving strategy. Default: MostInfeasible.
warm_start: Option<WarmStartBasis>LP warm-start basis. None = cold start.
warm_start_qp: Option<QpWarmStart>QP IP-PMM interior-point warm start for B&B node transfer.
warm_start_lp: Option<LpWarmStart>Extended LP warm start; takes priority over warm_start.
recover_warm_start_basis: boolReconstruct warm_start_basis after postsolve. Default: false.
When presolve reduces the problem the reduced-LP basis indices are
invalid for the original LP. true triggers basis reconstruction at
postsolve exit (LTSF crash + solution refinement). Opt-in only.
When presolve is skipped or the problem was not reduced, the simplex basis is cloned directly regardless of this flag.
use_lp_crash_basis: boolApply simplex crash basis on cold LP starts. Ignored when
warm_start / warm_start_lp is set.
presolve: boolEnable presolve. Default: true.
presolve_max_pass: usizeMaximum fixpoint passes in QP presolve. Default: 10.
presolve_phase2: boolEnable QP presolve phase 2. Default: true.
timeout_secs: Option<f64>Timeout in seconds. None = unlimited.
use_ruiz_scaling: boolApply Ruiz equilibration scaling before IPM. Default: true.
tolerance: Option<Tolerance>Convergence accuracy level. None = use ipm.eps directly.
When Some(_), each solver derives eps from this; ipm.eps is ignored.
ipm: IpmOptionsIPM-specific options.
multistart: Option<MultiStartConfig>Multi-start local search config. None (default) = disabled.
global_optimization: Option<GlobalOptimizationConfig>Spatial B&B global optimisation config. None (default) = disabled.
Only consumed by explicit solve_qp_global calls.
threads: usizeThread budget for all solver paths (LP / QP / multistart).
Default = 1 (serial; no contention with external bench workers).
- QP (
threads >= 2): enables faer parallel sparse LDL on the KKT system. - LP simplex (
threads >= 2): no effect. - Multistart (
threads >= 2):min(n_starts, threads)parallel degree; inner solves forced tothreads = 1.
known_optimal_obj: Option<f64>Reference optimal objective for early-exit.
When Some(ref_obj), returns Optimal as soon as
|obj − ref_obj| / (1 + |ref_obj|) < OBJ_MATCH_REL_TOL.
Used by bench harnesses. None = no early-exit.
Implementations§
Source§impl SolverOptions
impl SolverOptions
Sourcepub fn ipm_eps(&self) -> f64
pub fn ipm_eps(&self) -> f64
Effective IPM eps: derived from tolerance if set, otherwise ipm.eps.
Sourcepub fn validate(&self) -> Result<(), OptionsError>
pub fn validate(&self) -> Result<(), OptionsError>
Validate all option fields.
Returns the first Err encountered, in field declaration order.
Called by public solver entry points (solve_qp_with, solve_qp_global,
multistart::solve_qp_multistart, solve_milp, solve_miqp, simplex::solve_with)
before starting work; invalid options cause the entry to return
crate::problem::SolveStatus::NumericalError rather than propagating
bad values into the solver core.
Invalid conditions:
primal_tol/dual_tol: non-finite or <= 0clamp_tol: non-finite or < 0 (0 is allowed)threads: 0timeout_secs:Some(v)where v is non-finite or < 0tolerance:Custom(v)where v is non-finite or <= 0- Any field in
IpmOptions
Sourcepub fn with_timeout(self, secs: f64) -> Result<Self, OptionsError>
pub fn with_timeout(self, secs: f64) -> Result<Self, OptionsError>
Builder: set timeout_secs, validated immediately.
Sourcepub fn with_threads(self, n: usize) -> Result<Self, OptionsError>
pub fn with_threads(self, n: usize) -> Result<Self, OptionsError>
Builder: set threads, validated immediately.
Sourcepub fn with_tolerance(self, tol: Tolerance) -> Result<Self, OptionsError>
pub fn with_tolerance(self, tol: Tolerance) -> Result<Self, OptionsError>
Builder: set tolerance, validated immediately.
Tolerance::Custom(v) requires v to be finite and > 0; other variants
are always accepted.
Trait Implementations§
Source§impl Clone for SolverOptions
impl Clone for SolverOptions
Source§fn clone(&self) -> SolverOptions
fn clone(&self) -> SolverOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SolverOptions
impl Debug for SolverOptions
Auto Trait Implementations§
impl Freeze for SolverOptions
impl RefUnwindSafe for SolverOptions
impl Send for SolverOptions
impl Sync for SolverOptions
impl Unpin for SolverOptions
impl UnsafeUnpin for SolverOptions
impl UnwindSafe for SolverOptions
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T, U> Imply<T> for U
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