Skip to main content

SolverOptions

Struct SolverOptions 

Source
pub struct SolverOptions {
Show 24 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 enable_bound_flipping: bool, 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_skip_large_coeff: bool, 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: f64

Simplex primal feasibility / optimality threshold. Default: PIVOT_TOL.

§max_etas: usize

Max eta-file count (refactorisation threshold). 0 = auto (from problem size).

§clamp_tol: f64

Micro-value clamp threshold. Default: DEFAULT_CLAMP_TOL.

§simplex_method: SimplexMethod

Simplex algorithm selection. Default: Auto.

§dual_tol: f64

Dual feasibility threshold. Default: PIVOT_TOL.

§dual_pricing: DualPricing

Dual simplex leaving strategy. Default: MostInfeasible.

§enable_bound_flipping: bool

Enable Bound-Flipping Ratio Test (Maros 2003 §7.6) in dual_advanced. Runtime override: BOUND_FLIP_DISABLE=1.

§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: bool

Reconstruct 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: bool

Apply simplex crash basis on cold LP starts. Ignored when warm_start / warm_start_lp is set. Runtime override: LP_CRASH_DUAL_ADV_DISABLE=1 (Big-M path only).

§presolve: bool

Enable presolve. Default: true.

§presolve_max_pass: usize

Maximum fixpoint passes in QP presolve. Default: 10.

§presolve_skip_large_coeff: bool

Skip large-coefficient row rescaling in QP presolve. Default: false. Rescaling is also skipped when use_ruiz_scaling is true (existing behaviour).

§presolve_phase2: bool

Enable QP presolve phase 2. Default: true.

§timeout_secs: Option<f64>

Timeout in seconds. None = unlimited.

§use_ruiz_scaling: bool

Apply 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: IpmOptions

IPM-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: usize

Thread 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 to threads = 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

Source

pub fn ipm_eps(&self) -> f64

Effective IPM eps: derived from tolerance if set, otherwise ipm.eps.

Source

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, 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 <= 0
  • clamp_tol: non-finite or < 0 (0 is allowed)
  • threads: 0
  • timeout_secs: Some(v) where v is non-finite or < 0
  • tolerance: Custom(v) where v is non-finite or <= 0
  • Any field in IpmOptions
Source

pub fn with_timeout(self, secs: f64) -> Result<Self, OptionsError>

Builder: set timeout_secs, validated immediately.

Source

pub fn with_threads(self, n: usize) -> Result<Self, OptionsError>

Builder: set threads, validated immediately.

Source

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

Source§

fn clone(&self) -> SolverOptions

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SolverOptions

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for SolverOptions

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ByRef<T> for T

Source§

fn by_ref(&self) -> &T

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DistributionExt for T
where T: ?Sized,

Source§

fn rand<T>(&self, rng: &mut (impl Rng + ?Sized)) -> T
where Self: Distribution<T>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T, U> Imply<T> for U
where T: ?Sized, U: ?Sized,