pub struct LpProblem {
pub c: Vec<f64>,
pub a: CscMatrix,
pub b: Vec<f64>,
pub num_vars: usize,
pub num_constraints: usize,
pub constraint_types: Vec<ConstraintType>,
pub bounds: Vec<(f64, f64)>,
pub name: Option<String>,
}Expand description
線形計画問題: min c^T x s.t. Ax {op} b, x in [lb, ub]
目的関数・制約行列・右辺ベクトル・変数上下限をまとめて保持する。
制約種別(<=, >=, =)と変数ごとの上下限を個別に指定できる。
Fields§
§c: Vec<f64>目的関数係数ベクトル(長さ: num_vars)
a: CscMatrix制約行列(CSC形式、サイズ: num_constraints x num_vars)
b: Vec<f64>制約右辺ベクトル(長さ: num_constraints)
num_vars: usize決定変数の数
num_constraints: usize制約式の数
constraint_types: Vec<ConstraintType>各制約の種別(長さ: num_constraints)
bounds: Vec<(f64, f64)>各変数の上下限 (lower, upper)(長さ: num_vars)
name: Option<String>問題名(オプション)
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LpProblem
impl RefUnwindSafe for LpProblem
impl Send for LpProblem
impl Sync for LpProblem
impl Unpin for LpProblem
impl UnsafeUnpin for LpProblem
impl UnwindSafe for LpProblem
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> 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>
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