Skip to main content

SolverResult

Struct SolverResult 

Source
pub struct SolverResult {
Show 16 fields pub status: SolveStatus, pub objective: f64, pub solution: Vec<f64>, pub dual_solution: Vec<f64>, pub reduced_costs: Vec<f64>, pub slack: Vec<f64>, pub warm_start_basis: Option<WarmStartBasis>, pub bound_duals: Vec<f64>, pub iterations: usize, pub final_residuals: Option<(f64, f64, f64)>, pub duality_gap_rel: Option<f64>, pub timing_breakdown: Option<TimingBreakdown>, pub postsolve_dfeas: Option<f64>, pub stats: SolveStats, pub bound_gap_cert: Option<BoundGapCertificate>, pub opt_cert: Option<OptimalCertificate>,
}
Expand description

LP/QP共通求解結果型

LP求解(Simplex等)と QP求解(AS/IPM/Concurrent)の両方で使用できる統一結果型。 LP固有フィールド(reduced_costs, slack, warm_start_basis)は QP求解時は空/None。 QP固有フィールド(bound_duals, iterations)は LP求解時は空/0。

Fields§

§status: SolveStatus

求解ステータス

§objective: f64

最適目的関数値(最適解が存在する場合)

§solution: Vec<f64>

解ベクトル(最適解が存在する場合)

§dual_solution: Vec<f64>

双対変数ベクトル(各制約の影価格、最適解が存在する場合)

§reduced_costs: Vec<f64>

被縮小費用ベクトル(各決定変数に対して、最適解が存在する場合)

§slack: Vec<f64>

スラック変数ベクトル(各制約のスラック b_i - a_i^T x、最適解が存在する場合)

§warm_start_basis: Option<WarmStartBasis>

warm-start用の基底情報(Optimal時のみ Some)

§bound_duals: Vec<f64>

Bound dual values (shadow prices for variable bounds).

Maps to original variable indices via col_map. Empty if no bound constraints are active.

  • 除去変数 (presolveで固定された変数) の bound_dual = 0.0 (近似)
  • presolve tightening で追加された境界の dual は報告しない(元問題基準)
  • 配列順: [lb_dual(j0), ..., lb_dual(j_{n_lb-1}), ub_dual(j0), ..., ub_dual(j_{n_ub-1})]
§iterations: usize

反復回数(WSR実績回数)

§final_residuals: Option<(f64, f64, f64)>

最終反復の残差実値 (pfeas, dfeas, duality_gap)。Optimal/MaxIterations時のみ Some。

§duality_gap_rel: Option<f64>

相対双対ギャップ (|p_obj - d_obj| / max(|p|,|d|,1))。 IPPMM 内部の best-so-far に紐づく値。unscale_ipm_result の Suboptimal→Optimal 昇格ゲート用。 None = 未計測(LP simplex 等 gap を持たない経路)。

§timing_breakdown: Option<TimingBreakdown>

各 phase の所要時間 (LP simplex 経路のみ、None なら未計測)。 「どこに時間が掛かっているか」事実観測用 (CLAUDE.md「順調に収束に向けて探索」)。

§postsolve_dfeas: Option<f64>

Postsolve が最終的に採用した y_orig の dfeas violation (bound-aware sup ノルム). LP simplex + presolve 経路のみ Some。caller (solve_with) が値が PIVOT_TOL を 超えるとき presolve=off で再解する fallback gate に使う (greenbea-class 問題対策)。

§stats: SolveStats

Per-solve routing and warm-start statistics (race-free).

§bound_gap_cert: Option<BoundGapCertificate>

Branch-and-bound gap certificate.

Present iff the solver completed a B&B search with a fully authenticated gap (no proof_uncertain region, within_gap satisfied). None for direct LP/QP solves.

§opt_cert: Option<OptimalCertificate>

KKT optimality certificate — minted by prove_optimal on the B&B incumbent.

Set when finalize_proven verifies all KKT conditions on the returned point. None for demoted (LocallyOptimal/NonconvexLocal) or non-B&B results.

Implementations§

Source§

impl SolverResult

Source

pub fn infeasible() -> Self

Source

pub fn unbounded() -> Self

Source

pub fn numerical_error() -> Self

Source

pub fn not_supported(msg: impl Into<String>) -> Self

Trait Implementations§

Source§

impl Clone for SolverResult

Source§

fn clone(&self) -> SolverResult

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 SolverResult

Source§

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

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

impl Default for SolverResult

Source§

fn default() -> Self

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

impl Display for SolverResult

Source§

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

Formats the value using the given formatter. 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> Imply<T> for U
where T: ?Sized, U: ?Sized,

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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