Provides utilities to extract basing and non-basic variables from the model and to swap variables in and out of the basis.
- Source:
Methods
(inner) getVariables(model, variables) → {Object}
- Source:
Parses out the basic and non-basic variables from the simplex tableau.
Parameters:
Name | Type | Description |
---|---|---|
model |
Array | A two-dimensional array of numbers representing the current simplex tableau |
variables |
Array | An array of strings representing the variables of the tableau. |
Returns:
An object with and array (strings) of the basic variables and an array (strings) of the non-basic variables.
- Type
- Object
(inner) swapVariables(pivot, variables, basicVariables, nonBasicVariables) → {Object}
- Source:
Swaps the basic variable indicated by the pivot row out of the basis with the non-basic variable indicted by the pivot column into the basis.
Parameters:
Name | Type | Description |
---|---|---|
pivot |
Object | Key value pairs holding the current pivot row and column indices. |
variables |
Array | An array of strings representing all of the variables in the tableau. |
basicVariables |
Array | An array of strings representing all of the basic variables in the tableau. |
nonBasicVariables |
Array | An array of strings representing all of the non-basic variables in the tableau. |
Returns:
Key-value pairs of the basic and non-basic variables (arrays of strings) after swapping.
- Type
- Object