Struct good_lp::variable::VariableDefinition [−][src]
Defines the properties of a variable, such as its lower and upper bounds.
Implementations
impl VariableDefinition
[src]
pub fn new() -> Self
[src]
Creates an unbounded continuous linear variable
pub fn bounds<N: Into<f64> + Copy, B: RangeBounds<N>>(self, bounds: B) -> Self
[src]
Set the lower and/or higher bounds of the variable
Examples
assert_eq!( variable().bounds(1..2), variable().min(1).max(2) ); assert_eq!( variable().bounds(1..), variable().min(1) ); assert_eq!( variable().bounds(..=2), variable().max(2) );
pub fn min<N: Into<f64>>(self, min: N) -> Self
[src]
Set the lower bound of the variable
pub fn max<N: Into<f64>>(self, max: N) -> Self
[src]
Set the higher bound of the variable
pub fn clamp<N1: Into<f64>, N2: Into<f64>>(self, min: N1, max: N2) -> Self
[src]
Set both the lower and higher bounds of the variable
Trait Implementations
impl Clone for VariableDefinition
[src]
fn clone(&self) -> VariableDefinition
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for VariableDefinition
[src]
impl Default for VariableDefinition
[src]
Creates an unbounded continuous linear variable
impl PartialEq<VariableDefinition> for VariableDefinition
[src]
fn eq(&self, other: &VariableDefinition) -> bool
[src]
fn ne(&self, other: &VariableDefinition) -> bool
[src]
impl StructuralPartialEq for VariableDefinition
[src]
Auto Trait Implementations
impl RefUnwindSafe for VariableDefinition
[src]
impl Send for VariableDefinition
[src]
impl Sync for VariableDefinition
[src]
impl Unpin for VariableDefinition
[src]
impl UnwindSafe for VariableDefinition
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,