pub struct RobustLP {
pub c: Array1<f64>,
pub a_matrix: Array2<f64>,
pub b_rhs: Array1<f64>,
pub lb: Option<Array1<f64>>,
pub ub: Option<Array1<f64>>,
pub c_uncertainty: Option<Array1<f64>>,
pub a_uncertainty: Option<Array2<f64>>,
pub b_uncertainty: Option<Array1<f64>>,
}Expand description
A linear program with uncertain data.
Nominal problem:
min cᵀ x
s.t. A x ≤ b
lb ≤ x ≤ ub (optional bounds)Fields§
§c: Array1<f64>Nominal objective coefficient vector c (n-vector).
a_matrix: Array2<f64>Nominal constraint matrix A (m × n).
b_rhs: Array1<f64>Nominal right-hand side b (m-vector).
lb: Option<Array1<f64>>Optional lower bounds on x (length n; use f64::NEG_INFINITY for unbounded).
ub: Option<Array1<f64>>Optional upper bounds on x (length n; use f64::INFINITY for unbounded).
c_uncertainty: Option<Array1<f64>>Uncertainty in objective coefficients c: perturbation radius per coordinate.
a_uncertainty: Option<Array2<f64>>Uncertainty in constraint matrix A: perturbation radius per entry (m × n).
b_uncertainty: Option<Array1<f64>>Uncertainty in right-hand side b: perturbation radius per constraint.
Implementations§
Source§impl RobustLP
impl RobustLP
Sourcepub fn new(
c: Array1<f64>,
a_matrix: Array2<f64>,
b_rhs: Array1<f64>,
) -> OptimizeResult<Self>
pub fn new( c: Array1<f64>, a_matrix: Array2<f64>, b_rhs: Array1<f64>, ) -> OptimizeResult<Self>
Create a new robust LP with no uncertainty (reduces to nominal LP).
§Arguments
c– objective vector (n)a_matrix– constraint matrix (m × n)b_rhs– right-hand side (m)
Sourcepub fn with_c_uncertainty(self, delta_c: Array1<f64>) -> OptimizeResult<Self>
pub fn with_c_uncertainty(self, delta_c: Array1<f64>) -> OptimizeResult<Self>
Set box uncertainty on the objective: c̃ ∈ [c - δ_c, c + δ_c].
Sourcepub fn with_a_uncertainty(self, delta_a: Array2<f64>) -> OptimizeResult<Self>
pub fn with_a_uncertainty(self, delta_a: Array2<f64>) -> OptimizeResult<Self>
Set box uncertainty on constraints: Ã_ij ∈ [A_ij - δ_A_ij, A_ij + δ_A_ij].
Sourcepub fn with_b_uncertainty(self, delta_b: Array1<f64>) -> OptimizeResult<Self>
pub fn with_b_uncertainty(self, delta_b: Array1<f64>) -> OptimizeResult<Self>
Set box uncertainty on the RHS: b̃_i ∈ [b_i - δ_b_i, b_i + δ_b_i].
Sourcepub fn with_bounds(
self,
lb: Array1<f64>,
ub: Array1<f64>,
) -> OptimizeResult<Self>
pub fn with_bounds( self, lb: Array1<f64>, ub: Array1<f64>, ) -> OptimizeResult<Self>
Set variable bounds.
Sourcepub fn n_constraints(&self) -> usize
pub fn n_constraints(&self) -> usize
Number of constraints.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RobustLP
impl RefUnwindSafe for RobustLP
impl Send for RobustLP
impl Sync for RobustLP
impl Unpin for RobustLP
impl UnsafeUnpin for RobustLP
impl UnwindSafe for RobustLP
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.