pub struct MilpProblemBuilder { /* private fields */ }Expand description
Fluent builder for MilpProblem.
Implementations§
Source§impl MilpProblemBuilder
impl MilpProblemBuilder
Sourcepub fn inequalities(self, a: Array2<f64>, b: Array1<f64>) -> Self
pub fn inequalities(self, a: Array2<f64>, b: Array1<f64>) -> Self
Add inequality constraints A x ≤ b.
Sourcepub fn equalities(self, a: Array2<f64>, b: Array1<f64>) -> Self
pub fn equalities(self, a: Array2<f64>, b: Array1<f64>) -> Self
Add equality constraints Aeq x = beq.
Sourcepub fn integer_constraints(self, c: Vec<IntegerConstraint>) -> Self
pub fn integer_constraints(self, c: Vec<IntegerConstraint>) -> Self
Set per-variable integrality.
Sourcepub fn all_binary(self) -> Self
pub fn all_binary(self) -> Self
Mark all variables as binary (sets ub=1, lb=0).
Sourcepub fn all_integer(self) -> Self
pub fn all_integer(self) -> Self
Mark all variables as integer.
Sourcepub fn build(self) -> OptimizeResult<MilpProblem>
pub fn build(self) -> OptimizeResult<MilpProblem>
Validate and finalise the problem.
Auto Trait Implementations§
impl Freeze for MilpProblemBuilder
impl RefUnwindSafe for MilpProblemBuilder
impl Send for MilpProblemBuilder
impl Sync for MilpProblemBuilder
impl Unpin for MilpProblemBuilder
impl UnsafeUnpin for MilpProblemBuilder
impl UnwindSafe for MilpProblemBuilder
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> 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 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>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
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
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.