[][src]Struct ddo::common::Variable

pub struct Variable(pub usize);

This type denotes a variable from the optimization problem at hand. In this case, each variable is assumed to be identified with an integer ranging from 0 until problem.nb_vars()

Implementations

impl Variable[src]

pub fn id(self) -> usize[src]

This function retruns the id (numeric value) of the variable.

Examples:

assert_eq!(0, Variable(0).id());
assert_eq!(1, Variable(1).id());
assert_eq!(2, Variable(2).id());
assert_eq!(3, Variable(3).id());

Trait Implementations

impl Clone for Variable[src]

impl Copy for Variable[src]

impl Debug for Variable[src]

impl Eq for Variable[src]

impl Hash for Variable[src]

impl Ord for Variable[src]

impl PartialEq<Variable> for Variable[src]

impl PartialOrd<Variable> for Variable[src]

impl StructuralEq for Variable[src]

impl StructuralPartialEq for Variable[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.