pub struct LinProgResult<T: Float> {
pub x: Vec<T>,
pub fun: T,
pub slack: Vec<T>,
pub iterations: usize,
pub converged: bool,
}Expand description
Result of a linear programming solve.
§Examples
// minimize -x - 2y s.t. x + y <= 4, x >= 0, y >= 0
let result = linprog(&[-1.0_f64, -2.0], &[vec![1.0, 1.0]], &[4.0]).unwrap();
assert!(result.converged);Fields§
§x: Vec<T>Optimal decision variables.
fun: TOptimal objective value.
slack: Vec<T>Slack variables (b_ub - A_ub x).
iterations: usizeNumber of simplex iterations.
converged: boolWhether the solver found an optimal solution.
Trait Implementations§
Source§impl<T: Clone + Float> Clone for LinProgResult<T>
impl<T: Clone + Float> Clone for LinProgResult<T>
Source§fn clone(&self) -> LinProgResult<T>
fn clone(&self) -> LinProgResult<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<T> Freeze for LinProgResult<T>where
T: Freeze,
impl<T> RefUnwindSafe for LinProgResult<T>where
T: RefUnwindSafe,
impl<T> Send for LinProgResult<T>
impl<T> Sync for LinProgResult<T>
impl<T> Unpin for LinProgResult<T>where
T: Unpin,
impl<T> UnsafeUnpin for LinProgResult<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for LinProgResult<T>where
T: UnwindSafe,
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