pub struct Basis {
pub col_status: Vec<i32>,
pub row_status: Vec<i32>,
}Expand description
Simplex basis storing solver-native i32 status codes for zero-copy round-trip
basis management.
Basis stores the raw solver i32 status codes directly, enabling zero-copy
round-trip warm-starting via copy_from_slice (memcpy). This avoids per-element
translation overhead when the caller only needs to save and restore the basis
without inspecting individual statuses.
HiGHS uses HighsInt (4 bytes) for status codes; CLP uses unsigned char
(1 byte, widened to i32 in this representation). The caller is responsible
for matching the buffer dimensions to the LP model before use.
See Solver Abstraction SS9.
Fields§
§col_status: Vec<i32>Solver-native i32 status codes for each column (length must equal num_cols).
row_status: Vec<i32>Solver-native i32 status codes for each row, including structural and dynamic rows.
Implementations§
Source§impl Basis
impl Basis
Sourcepub fn new(num_cols: usize, num_rows: usize) -> Self
pub fn new(num_cols: usize, num_rows: usize) -> Self
Creates a new Basis with pre-allocated, zero-filled status code buffers.
Both col_status and row_status are allocated to the requested lengths
and filled with 0_i32. The caller reuses this buffer across solves by
passing it to crate::SolverInterface::get_basis on each iteration.