Datatypes for the Simplex Algorithm implementation #
Specification for matrix types over ℚ which can be used in the Gauss Elimination and the Simplex Algorithm. It was introduced to unify dense matrices and sparse matrices.
Returns
mat[i, j]
.Sets
mat[i, j]
.Returns the list of elements of
mat
in the form(i, j, mat[i, j])
.Creates a matrix from a list of elements in the form
(i, j, mat[i, j])
.Swaps two rows.
Subtracts
i
-th row multiplied bycoef
fromj
-th row.Divides the
i
-th row bycoef
.
Instances
Equations
- One or more equations did not get rendered due to their size.
Structure for matrices over ℚ.
So far it is just a 2d-array carrying dimensions (that are supposed to match with the actual
dimensions of data
), but the plan is to add some Prop
-data and make the structure strict and
safe.
Note: we avoid using the Matrix
from Mathlib.Data.Matrix
because it is far more efficient to
store matrix as its entries than as function between Fin
-s.
The content of the matrix.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Structure for sparse matrices over ℚ, implemented as an array of hashmaps, containing only nonzero values.
- data : Array (Lean.HashMap Nat Rat)
The content of the matrix.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Tableau
is a structure the Simplex Algorithm operates on. The i
-th row of mat
expresses the
variable basic[i]
as a linear combination of variables from free
.
Array containing the basic variables' indexes
Array containing the free variables' indexes
- mat : matType self.basic.size self.free.size
Matrix of coefficients the basic variables expressed through the free ones.