pub struct SolverResult {Show 18 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 pfeas: Option<f64>,
pub dfeas: Option<f64>,
pub gap: Option<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>,
}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。
pfeas: Option<f64>主実行可能性残差 (||Ax - b||_inf)。final_residuals と同値。デバッグ可視性向上用。
dfeas: Option<f64>双対実行可能性残差。final_residuals と同値。デバッグ可視性向上用。
gap: Option<f64>双対ギャップ (mu)。final_residuals と同値。デバッグ可視性向上用。
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: SolveStatsPer-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.
Implementations§
Source§impl SolverResult
impl SolverResult
pub fn infeasible() -> Self
pub fn unbounded() -> Self
pub fn max_iterations(x: Vec<f64>, obj: f64, iters: usize) -> Self
pub fn numerical_error() -> Self
pub fn not_supported(msg: impl Into<String>) -> Self
Trait Implementations§
Source§impl Clone for SolverResult
impl Clone for SolverResult
Source§fn clone(&self) -> SolverResult
fn clone(&self) -> SolverResult
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 SolverResult
impl Debug for SolverResult
Source§impl Default for SolverResult
impl Default for SolverResult
Auto Trait Implementations§
impl Freeze for SolverResult
impl RefUnwindSafe for SolverResult
impl Send for SolverResult
impl Sync for SolverResult
impl Unpin for SolverResult
impl UnsafeUnpin for SolverResult
impl UnwindSafe for SolverResult
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,
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