#[non_exhaustive]pub enum SolverError {
DimensionMismatch {
field: &'static str,
expected: usize,
got: usize,
},
IndexOutOfBounds {
context: &'static str,
index: usize,
bound: usize,
},
SingularBasis {
step: usize,
},
EmptyInput {
context: &'static str,
},
DeadlineExceeded,
NonFiniteCoefficient {
field: &'static str,
index: usize,
},
InvalidBounds {
index: usize,
lb: f64,
ub: f64,
},
}Expand description
ソルバー全体の統一エラー型
入力検証・数値計算など、ソルバー操作中に発生しうるエラーを統一的に表現する。
注意: Infeasible/Unbounded/MaxIterations は数学的結果であり、
エラーではないため SolveStatus で表現する。
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
DimensionMismatch
次元不一致(配列長・行列サイズの不整合)
例: c.len() != a.ncols, トリプレット配列の長さ不一致
Fields
IndexOutOfBounds
インデックスが有効範囲外
例: 行列の列インデックス、基底列インデックス
Fields
SingularBasis
基底行列が特異(LU分解で数値的に特異なピボットを検出)
EmptyInput
空の入力が渡された
DeadlineExceeded
Deadline を超過した(タイムアウト)
NonFiniteCoefficient
非有限係数(NaN または ±∞)が入力された
例: c[i] が NaN、b[j] が Inf、行列要素が NaN
InvalidBounds
変数境界が無効(NaN または lb > ub)
Trait Implementations§
Source§impl Debug for SolverError
impl Debug for SolverError
Source§impl Display for SolverError
impl Display for SolverError
Source§impl Error for SolverError
impl Error for SolverError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for SolverError
impl RefUnwindSafe for SolverError
impl Send for SolverError
impl Sync for SolverError
impl Unpin for SolverError
impl UnsafeUnpin for SolverError
impl UnwindSafe for SolverError
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
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>
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 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>
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