Class RevisedStore
java.lang.Object
org.ojalgo.optimisation.linear.SimplexStore
org.ojalgo.optimisation.linear.RevisedStore
-
Nested Class Summary
Nested classes/interfaces inherited from class SimplexStore
SimplexStore.ColumnState -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final PhysicalStore<Double> Pivot row for dual simplex.private final R064StoreReduced costs for non-basic variables.private final R064StoreDual variables (Lagrange multipliers) for constraints.private final MatrixStore<Double> Current basis matrix B (columns of constraint matrix for basic variables).private final ColumnsSupplier<Double> Complete constraint matrix A (all variables).private final R064StoreRight-hand side vector b of Ax = b.private final BasisRepresentationInverse of the current basis matrix B^(-1).private final R064StoreObjective function coefficients c for all variables.private R064StorePhase-1 objective function (sum of artificial variables).private final R064StoreTemporary storage for reduced cost calculations.private final R064StoreCurrent basic solution x_B.private final R064StoreDirection vector for entering variable in primal simplex.private final R064StoreTemporary storage vector for various computations, especially rows of the inverse basis matrix.Fields inherited from class SimplexStore
edgeWeights, excluded, included, m, n, structure -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) void(package private) voidcalculateIteration(SimplexSolver.IterDescr iteration, double shift) (package private) void(package private) Mutate2DThe simplex' constraints body (including the parts corresponding to slack and artificial variables).(package private) Mutate1DThe simplex' constraints RHS.(package private) voidcopyBasicSolution(double[] solution) private voiddoBodyRow(int i, PhysicalStore<Double> destination) private voiddoExclTranspMult(MatrixStore<Double> lambda, PhysicalStore<Double> results) (package private) double(package private) doublegetCost(int j) (package private) doublegetCurrentElement(int i, SimplexSolver.EnterInfo enter) The current (tableau) constraint body element.(package private) doublegetCurrentElement(SimplexSolver.ExitInfo exit, int je) The current (tableau) constraint body element.(package private) doublegetCurrentRHS(int i) The current (tableau) constraint RHS.(package private) doublegetInfeasibility(int i) (package private) doublegetReducedCost(int je) private static BasisRepresentationnewBasisRepresentation(int nbConstraints) private static R064StorenewColumn(int nbRows) private static ColumnsSupplier<Double> newMatrix(int nbRows, int nbCols) private static R064StorenewRow(int nbCols) (package private) Mutate1DThe objective function.(package private) R064Storephase1()The phase-1 objective function.protected voidpivot(SimplexSolver.IterDescr iteration) (package private) void(package private) void(package private) voidresetBasis(int[] basis) Everything that is not in the basis is set to be in at lower bound.(package private) voidprotected voidshiftColumn(int col, double shift) (package private) Primitive1DsliceBodyRow(int i) (package private) Primitive1D(package private) voidupdateDualEdgeWeights(SimplexSolver.IterDescr iteration) Update edge weights for basic (included) variables.private void(package private) voidupdatePrimalEdgeWeights(SimplexSolver.IterDescr iteration) Update edge weights for non-basic (excluded) variables.Methods inherited from class SimplexStore
countRemainingArtificials, extractSolution, generateCutCandidates, getColumnState, getLowerBound, getLowerBounds, getLowerGap, getRange, getUpperBound, getUpperBounds, getUpperGap, isArtificial, isExcluded, isIncluded, isNegated, isPrintable, isRemainingArtificials, lower, newDualSimplexSolver, newPhasedSimplexSolver, newPrimalSimplexSolver, newStoreFactory, resetEdgeWeights, toString, unbounded, update, updateBasis, updateRange, upper
-
Field Details
-
a
Pivot row for dual simplex. Contains coefficients of non-basic variables in the tableau row for the exiting basic variable. Updated incrementally with each dual simplex iteration. -
d
Reduced costs for non-basic variables. Shows objective change per unit increase in a non-basic variable. Updated incrementally with each iteration and pivot. -
l
Dual variables (Lagrange multipliers) for constraints. Computed as π = B^(-T) * c_B. Updated as needed for reporting or solution extraction. -
myBasis
Current basis matrix B (columns of constraint matrix for basic variables). Not explicitly stored; computed from constraint matrix and current basis indices. Updated when the basis changes. -
myConstraintsBody
Complete constraint matrix A (all variables). Static during solve. Used for column access and basis updates. -
myConstraintsRHS
Right-hand side vector b of Ax = b. Updated when bounds are shifted. Used to compute the current basic solution. -
myInvBasis
Inverse of the current basis matrix B^(-1). Maintained and updated using factorization techniques. Updated when the basis changes or is reset. -
myObjective
Objective function coefficients c for all variables. Static during solve. Used to compute duals and objective value. -
myPhase1Objective
Phase-1 objective function (sum of artificial variables). Used only during phase-1. Created and set up at the start of phase-1, and set to null after phase-1. -
r
Temporary storage for reduced cost calculations. Used as intermediate storage during iterations and dual variable updates. -
x
Current basic solution x_B. Values of basic variables in the current iteration. Updated incrementally with each iteration and pivot. -
y
Direction vector for entering variable in primal simplex. Shows how basic variables change when entering variable increases. Updated incrementally with each iteration. -
z
Temporary storage vector for various computations, especially rows of the inverse basis matrix. Reused to avoid memory allocation. Updated as needed for intermediate calculations.
-
-
Constructor Details
-
RevisedStore
RevisedStore(int mm, int nn) -
RevisedStore
RevisedStore(LinearStructure linearStructure)
-
-
Method Details
-
newBasisRepresentation
-
newColumn
-
newMatrix
-
newRow
-
doBodyRow
-
doExclTranspMult
-
updateDualsAndReducedCosts
private void updateDualsAndReducedCosts() -
pivot
- Overrides:
pivotin classSimplexStore
-
shiftColumn
protected void shiftColumn(int col, double shift) - Overrides:
shiftColumnin classSimplexStore
-
calculateDualDirection
- Specified by:
calculateDualDirectionin classSimplexStore
-
calculateIteration
- Specified by:
calculateIterationin classSimplexStore
-
calculatePrimalDirection
- Specified by:
calculatePrimalDirectionin classSimplexStore
-
constraintsBody
Mutate2D constraintsBody()Description copied from class:SimplexStoreThe simplex' constraints body (including the parts corresponding to slack and artificial variables).- Specified by:
constraintsBodyin classSimplexStore
-
constraintsRHS
Mutate1D constraintsRHS()Description copied from class:SimplexStoreThe simplex' constraints RHS.- Specified by:
constraintsRHSin classSimplexStore
-
copyBasicSolution
void copyBasicSolution(double[] solution) - Specified by:
copyBasicSolutionin classSimplexStore
-
extractValue
double extractValue()- Specified by:
extractValuein classSimplexStore
-
getCost
double getCost(int j) - Specified by:
getCostin classSimplexStore
-
getCurrentElement
Description copied from class:SimplexStoreThe current (tableau) constraint body element.- Specified by:
getCurrentElementin classSimplexStore
-
getCurrentElement
Description copied from class:SimplexStoreThe current (tableau) constraint body element.- Specified by:
getCurrentElementin classSimplexStore
-
getCurrentRHS
double getCurrentRHS(int i) Description copied from class:SimplexStoreThe current (tableau) constraint RHS.- Specified by:
getCurrentRHSin classSimplexStore
-
getInfeasibility
double getInfeasibility(int i) - Specified by:
getInfeasibilityin classSimplexStore
-
getReducedCost
double getReducedCost(int je) - Specified by:
getReducedCostin classSimplexStore
-
objective
Mutate1D objective()Description copied from class:SimplexStoreThe objective function.- Specified by:
objectivein classSimplexStore
-
phase1
R064Store phase1()Description copied from class:SimplexStoreThe phase-1 objective function.- Specified by:
phase1in classSimplexStore
-
prepareToIterate
void prepareToIterate()- Specified by:
prepareToIteratein classSimplexStore
-
removePhase1
void removePhase1()- Specified by:
removePhase1in classSimplexStore
-
resetBasis
void resetBasis(int[] basis) Description copied from class:SimplexStoreEverything that is not in the basis is set to be in at lower bound.- Overrides:
resetBasisin classSimplexStore
-
setupClassicPhase1Objective
void setupClassicPhase1Objective()- Specified by:
setupClassicPhase1Objectivein classSimplexStore
-
sliceBodyRow
- Specified by:
sliceBodyRowin classSimplexStore
-
sliceDualVariables
Primitive1D sliceDualVariables()- Specified by:
sliceDualVariablesin classSimplexStore
-
updateDualEdgeWeights
Description copied from class:SimplexStoreUpdate edge weights for basic (included) variables.- Specified by:
updateDualEdgeWeightsin classSimplexStore
-
updatePrimalEdgeWeights
Description copied from class:SimplexStoreUpdate edge weights for non-basic (excluded) variables.- Specified by:
updatePrimalEdgeWeightsin classSimplexStore
-