- java.lang.Object
-
- org.ojalgo.optimisation.linear.SimplexStore
-
- org.ojalgo.optimisation.linear.RevisedStore
-
final class RevisedStore extends SimplexStore
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.ojalgo.optimisation.linear.SimplexStore
SimplexStore.ColumnState
-
-
Field Summary
Fields Modifier and Type Field Description private PhysicalStore<java.lang.Double>aPivot row for dual simplex.private R064StoredReduced costs for non-basic variables.private R064StorelDual variables (Lagrange multipliers) for constraints.private MatrixStore<java.lang.Double>myBasisCurrent basis matrix B (columns of constraint matrix for basic variables).private ColumnsSupplier<java.lang.Double>myConstraintsBodyComplete constraint matrix A (all variables).private R064StoremyConstraintsRHSRight-hand side vector b of Ax = b.private BasisRepresentationmyInvBasisInverse of the current basis matrix B^(-1).private R064StoremyObjectiveObjective function coefficients c for all variables.private R064StoremyPhase1ObjectivePhase-1 objective function (sum of artificial variables).private R064StorerTemporary storage for reduced cost calculations.private R064StorexCurrent basic solution x_B.private R064StoreyDirection vector for entering variable in primal simplex.private R064StorezTemporary storage vector for various computations, especially rows of the inverse basis matrix.-
Fields inherited from class org.ojalgo.optimisation.linear.SimplexStore
edgeWeights, excluded, included, m, n, structure
-
-
Constructor Summary
Constructors Constructor Description RevisedStore(int mm, int nn)RevisedStore(LinearStructure linearStructure)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voidcalculateDualDirection(SimplexSolver.ExitInfo exit)(package private) voidcalculateIteration(SimplexSolver.IterDescr iteration, double shift)(package private) voidcalculatePrimalDirection(SimplexSolver.EnterInfo enter)(package private) Mutate2DconstraintsBody()The simplex' constraints body (including the parts corresponding to slack and artificial variables).(package private) Mutate1DconstraintsRHS()The simplex' constraints RHS.(package private) voidcopyBasicSolution(double[] solution)private voiddoBodyRow(int i, PhysicalStore<java.lang.Double> destination)private voiddoExclTranspMult(MatrixStore<java.lang.Double> lambda, PhysicalStore<java.lang.Double> results)(package private) doubleextractValue()(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<java.lang.Double>newMatrix(int nbRows, int nbCols)private static R064StorenewRow(int nbCols)(package private) Mutate1Dobjective()The objective function.(package private) R064Storephase1()The phase-1 objective function.protected voidpivot(SimplexSolver.IterDescr iteration)(package private) voidprepareToIterate()(package private) voidremovePhase1()(package private) voidresetBasis(int[] basis)Everything that is not in the basis is set to be in at lower bound.(package private) voidsetupClassicPhase1Objective()protected voidshiftColumn(int col, double shift)(package private) Primitive1DsliceBodyRow(int i)(package private) Primitive1DsliceDualVariables()(package private) voidupdateDualEdgeWeights(SimplexSolver.IterDescr iteration)Update edge weights for basic (included) variables.private voidupdateDualsAndReducedCosts()(package private) voidupdatePrimalEdgeWeights(SimplexSolver.IterDescr iteration)Update edge weights for non-basic (excluded) variables.-
Methods inherited from class org.ojalgo.optimisation.linear.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 Detail
-
a
private final PhysicalStore<java.lang.Double> 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
private final R064Store 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
private final R064Store l
Dual variables (Lagrange multipliers) for constraints. Computed as π = B^(-T) * c_B. Updated as needed for reporting or solution extraction.
-
myBasis
private final MatrixStore<java.lang.Double> 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
private final ColumnsSupplier<java.lang.Double> myConstraintsBody
Complete constraint matrix A (all variables). Static during solve. Used for column access and basis updates.
-
myConstraintsRHS
private final R064Store myConstraintsRHS
Right-hand side vector b of Ax = b. Updated when bounds are shifted. Used to compute the current basic solution.
-
myInvBasis
private final BasisRepresentation myInvBasis
Inverse of the current basis matrix B^(-1). Maintained and updated using factorization techniques. Updated when the basis changes or is reset.
-
myObjective
private final R064Store myObjective
Objective function coefficients c for all variables. Static during solve. Used to compute duals and objective value.
-
myPhase1Objective
private R064Store 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
private final R064Store r
Temporary storage for reduced cost calculations. Used as intermediate storage during iterations and dual variable updates.
-
x
private final R064Store x
Current basic solution x_B. Values of basic variables in the current iteration. Updated incrementally with each iteration and pivot.
-
y
private final R064Store y
Direction vector for entering variable in primal simplex. Shows how basic variables change when entering variable increases. Updated incrementally with each iteration.
-
z
private final R064Store 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 Detail
-
RevisedStore
RevisedStore(int mm, int nn)
-
RevisedStore
RevisedStore(LinearStructure linearStructure)
-
-
Method Detail
-
newBasisRepresentation
private static BasisRepresentation newBasisRepresentation(int nbConstraints)
-
newColumn
private static R064Store newColumn(int nbRows)
-
newMatrix
private static ColumnsSupplier<java.lang.Double> newMatrix(int nbRows, int nbCols)
-
newRow
private static R064Store newRow(int nbCols)
-
doBodyRow
private void doBodyRow(int i, PhysicalStore<java.lang.Double> destination)
-
doExclTranspMult
private void doExclTranspMult(MatrixStore<java.lang.Double> lambda, PhysicalStore<java.lang.Double> results)
-
updateDualsAndReducedCosts
private void updateDualsAndReducedCosts()
-
pivot
protected void pivot(SimplexSolver.IterDescr iteration)
- Overrides:
pivotin classSimplexStore
-
shiftColumn
protected void shiftColumn(int col, double shift)- Overrides:
shiftColumnin classSimplexStore
-
calculateDualDirection
void calculateDualDirection(SimplexSolver.ExitInfo exit)
- Specified by:
calculateDualDirectionin classSimplexStore
-
calculateIteration
void calculateIteration(SimplexSolver.IterDescr iteration, double shift)
- Specified by:
calculateIterationin classSimplexStore
-
calculatePrimalDirection
void calculatePrimalDirection(SimplexSolver.EnterInfo enter)
- 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
double getCurrentElement(SimplexSolver.ExitInfo exit, int je)
Description copied from class:SimplexStoreThe current (tableau) constraint body element.- Specified by:
getCurrentElementin classSimplexStore
-
getCurrentElement
double getCurrentElement(int i, SimplexSolver.EnterInfo enter)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
Primitive1D sliceBodyRow(int i)
- Specified by:
sliceBodyRowin classSimplexStore
-
sliceDualVariables
Primitive1D sliceDualVariables()
- Specified by:
sliceDualVariablesin classSimplexStore
-
updateDualEdgeWeights
void updateDualEdgeWeights(SimplexSolver.IterDescr iteration)
Description copied from class:SimplexStoreUpdate edge weights for basic (included) variables.- Specified by:
updateDualEdgeWeightsin classSimplexStore
-
updatePrimalEdgeWeights
void updatePrimalEdgeWeights(SimplexSolver.IterDescr iteration)
Description copied from class:SimplexStoreUpdate edge weights for non-basic (excluded) variables.- Specified by:
updatePrimalEdgeWeightsin classSimplexStore
-
-