pub struct IndexedVarBuilder<'a, K = IndexKey> { /* private fields */ }Implementations§
Source§impl<'a, K> IndexedVarBuilder<'a, K>
impl<'a, K> IndexedVarBuilder<'a, K>
pub fn lb(self, v: f64) -> Self
pub fn ub(self, v: f64) -> Self
pub fn bounds(self, lb: f64, ub: f64) -> Self
Sourcepub fn lb_by<F>(self, f: F) -> Self
pub fn lb_by<F>(self, f: F) -> Self
Per-key lower bound. Overrides Self::lb when both are set.
The closure receives a typed index value via FromIndexKey.
Annotate the argument to select the projection:
ⓘ
.lb_by(|(p, q): (String, String)| floor_for(&p, &q))
.lb_by(|i: usize| lower_bounds[i])Sourcepub fn ub_by<F>(self, f: F) -> Self
pub fn ub_by<F>(self, f: F) -> Self
Per-key upper bound. Overrides Self::ub when both are set.
The closure receives a typed index value via FromIndexKey; annotate
the argument to select the projection:
ⓘ
.ub_by(|(p, q): (String, String)| capacity_for(&p, &q))
.ub_by(|i: usize| upper_bounds[i])pub fn domain(self, d: Domain) -> Self
pub fn integer(self) -> Self
pub fn binary(self) -> Self
Sourcepub fn build(self) -> IndexedVar<'a, K>
pub fn build(self) -> IndexedVar<'a, K>
Register one scalar variable per key and return the IndexedVar handle.
§Panics
Panics if a scalar variable name collides with one already registered.
Trait Implementations§
Auto Trait Implementations§
impl<'a, K = IndexKey> !RefUnwindSafe for IndexedVarBuilder<'a, K>
impl<'a, K = IndexKey> !Send for IndexedVarBuilder<'a, K>
impl<'a, K = IndexKey> !Sync for IndexedVarBuilder<'a, K>
impl<'a, K = IndexKey> !UnwindSafe for IndexedVarBuilder<'a, K>
impl<'a, K> Freeze for IndexedVarBuilder<'a, K>
impl<'a, K> Unpin for IndexedVarBuilder<'a, K>
impl<'a, K> UnsafeUnpin for IndexedVarBuilder<'a, K>
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 more