pub struct SimplexTableau<T> {
pub tableau: Vec<Vec<T>>,
pub basis: Vec<usize>,
pub num_vars: usize,
pub num_constraints: usize,
}Expand description
SIMD-friendly simplex tableau.
Fields§
§tableau: Vec<Vec<T>>Tableau matrix (includes slack variables and RHS)
basis: Vec<usize>Basic variable indices
num_vars: usizeNumber of original variables
num_constraints: usizeNumber of constraints
Implementations§
Source§impl<T> SimplexTableau<T>
impl<T> SimplexTableau<T>
Sourcepub fn new(constraints: Vec<Vec<T>>, objective: Vec<T>, rhs: Vec<T>) -> Self
pub fn new(constraints: Vec<Vec<T>>, objective: Vec<T>, rhs: Vec<T>) -> Self
Create a new simplex tableau.
Sourcepub fn pivot(&mut self) -> Result<bool, SimplexError>
pub fn pivot(&mut self) -> Result<bool, SimplexError>
Perform one iteration of the simplex algorithm.
Sourcepub fn get_solution(&self) -> Vec<T>
pub fn get_solution(&self) -> Vec<T>
Get current solution.
Sourcepub fn get_objective_value(&self) -> T
pub fn get_objective_value(&self) -> T
Get objective value.
Sourcepub fn is_feasible(&self) -> bool
pub fn is_feasible(&self) -> bool
Check if current solution is feasible.
Trait Implementations§
Source§impl<T: Clone> Clone for SimplexTableau<T>
impl<T: Clone> Clone for SimplexTableau<T>
Source§fn clone(&self) -> SimplexTableau<T>
fn clone(&self) -> SimplexTableau<T>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 SimplexTableau<T>
impl<T> RefUnwindSafe for SimplexTableau<T>where
T: RefUnwindSafe,
impl<T> Send for SimplexTableau<T>where
T: Send,
impl<T> Sync for SimplexTableau<T>where
T: Sync,
impl<T> Unpin for SimplexTableau<T>where
T: Unpin,
impl<T> UnsafeUnpin for SimplexTableau<T>
impl<T> UnwindSafe for SimplexTableau<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