[−][src]Struct slp::LP
Represents an LP instance
Methods
impl LP
[src]
pub fn new_from_stdin() -> Self
[src]
Input is taken from stdin.
Example input format for
max 2x1 + 3x2
subject to 2x1 + x2 <= 18
6x1 + 5x2 <= 60
2x1 + 5x2 <= 40
x1 >= 0
x2 >= 0
is
3 2 # 3 is number of constraints and 2 is number of variables
2 3 # coefficients of objective function to be maximized: 2x1 + 3x2
2 1 18 # Constraint 1: 2x1 + x2 <= 18
6 5 60 # Constraint 2: 6x1 + 5x2 <= 60
2 5 40 # Constraint 3: 2x1 + 5x2 <= 40
# x1 >= 0 and x2 >= 0 are always assumed
#
is used for comments.
pub fn new_from_file(input_file: &str) -> Self
[src]
Input is taken from a file.
See new_from_stdin function for input format.
pub fn new_from_buf_reader<F>(reader: &mut F) -> LP where
F: BufRead,
[src]
F: BufRead,
Input is taken from a reader that implements
std::io::BufRead
.
See new_from_stdin function for input format.
pub fn solve(&mut self) -> Solution
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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.
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,