Struct coin_cbc::Model[][src]

pub struct Model { /* fields omitted */ }

A MILP model.

Implementations

impl Model[src]

pub fn num_rows(&self) -> u32[src]

Gets the current number of rows of the model.

pub fn num_cols(&self) -> u32[src]

Gets the current number of columns of the model.

pub fn remove_initial_solution(&mut self)[src]

Removes the initial solution.

pub fn set_col_initial_solution(&mut self, col: Col, value: f64)[src]

Sets the column value to the initial solution.

If the solution is not present, it will be initialized with 0 for all coefficients.

pub fn get_col_initial_solution(&self, col: Col) -> Option<f64>[src]

Gets the column value to the initial solution.

pub fn set_initial_solution(&mut self, solution: &Solution)[src]

Sets the initial solution from a Solution.

pub fn set_parameter(&mut self, key: &str, value: &str)[src]

Sets a parameter.

For documentation, launch the cbc binary and type ?.

pub fn set_parameters(
    &mut self,
    iter: impl IntoIterator<Item = (impl AsRef<str>, impl AsRef<str>)>
)
[src]

Sets parameters for an iterator.

pub fn rows(&self) -> impl Iterator<Item = Row>[src]

Gets an iterator on the row identifiers.

pub fn cols(&self) -> impl Iterator<Item = Col>[src]

Gets an iterator on the column identifiers.

pub fn add_col(&mut self) -> Col[src]

Adds a column to the model. Returns the corresponding column identifier.

At creation, the bounds of the column are setted to [0, +∞].

pub fn add_integer(&mut self) -> Col[src]

Adds an integer variable to the model.

Equivalent to adding a column and setting it to integer.

pub fn add_binary(&mut self) -> Col[src]

Adds a binary variable to the model.

Equivalent to adding a column and setting it to binary.

pub fn add_row(&mut self) -> Row[src]

Adds a row to the model. Returns the corresponding row identifier.

At creation, the bounds of the row are setted to [-∞, +∞].

pub fn set_weight(&mut self, row: Row, col: Col, weight: f64)[src]

Sets the weight corresponding to the given row and column in the constraint matrix.

pub fn set_integer(&mut self, col: Col)[src]

Changes the given column to integer variable.

pub fn set_continuous(&mut self, col: Col)[src]

Changes the given column to continuous variable.

pub fn set_binary(&mut self, col: Col)[src]

Changes the given column to binary variable.

Equivalent to setting the column as integer and restricting it to [0, 1].

pub fn set_col_upper(&mut self, col: Col, value: f64)[src]

Sets the upper bound of the given column.

pub fn set_col_lower(&mut self, col: Col, value: f64)[src]

Sets the lower bound of the given column.

pub fn set_obj_coeff(&mut self, col: Col, value: f64)[src]

Sets the objective coefficient of the given variable.

pub fn set_row_upper(&mut self, row: Row, value: f64)[src]

Sets the upper bound of the given row.

pub fn set_row_lower(&mut self, row: Row, value: f64)[src]

Sets the lower bound of the given row.

pub fn set_row_equal(&mut self, row: Row, value: f64)[src]

Force the given row to be equal to the given value.

Equivalent to setting the upper bound and the lower bound.

pub fn add_sos1<I: IntoIterator<Item = (Col, f64)>>(
    &mut self,
    columns_and_weights: I
)
[src]

Add a special ordered set constraint, preventing all but one variable in a set from being non-zero at the same time. weights can be used as hints to the optimizer to improve the resolution speed. In case you don’t have any weights for your variables, you can use 1, 2, 3, … For more information about SOS weights, see: http://lpsolve.sourceforge.net/5.5/SOS.htm

pub fn add_sos2<I: IntoIterator<Item = (Col, f64)>>(
    &mut self,
    columns_and_weights: I
)
[src]

Add a special ordered set constraint, preventing all but two adjacent variables in a set from being non-zero at the same time. Weights determine the adjacency of the variables. For more information about SOS weights, see: http://lpsolve.sourceforge.net/5.5/SOS.htm

pub fn set_obj_sense(&mut self, sense: Sense)[src]

Sets the objective sense.

pub fn to_raw(&self) -> Model[src]

Construct a raw::Model corresponding to the current state.

pub fn solve(&self) -> Solution[src]

Solves the model. Returns the solution.

Trait Implementations

impl Clone for Model[src]

impl Default for Model[src]

Auto Trait Implementations

impl RefUnwindSafe for Model

impl Send for Model

impl Sync for Model

impl Unpin for Model

impl UnwindSafe for Model

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.