Package org.ojalgo.optimisation.convex
Class BasePrimitiveSolver
java.lang.Object
org.ojalgo.optimisation.GenericSolver
org.ojalgo.optimisation.convex.ConvexSolver
org.ojalgo.optimisation.convex.BasePrimitiveSolver
- All Implemented Interfaces:
Optimisation
,Optimisation.Solver
,UpdatableSolver
- Direct Known Subclasses:
ConstrainedSolver
,UnconstrainedSolver
-
Nested Class Summary
Nested classes/interfaces inherited from class org.ojalgo.optimisation.convex.ConvexSolver
ConvexSolver.Builder, ConvexSolver.Configuration, ConvexSolver.ModelIntegration
Nested classes/interfaces inherited from interface org.ojalgo.optimisation.Optimisation
Optimisation.Constraint, Optimisation.ConstraintType, Optimisation.Integration<M extends Optimisation.Model,
S extends Optimisation.Solver>, Optimisation.Model, Optimisation.Objective, Optimisation.Options, Optimisation.ProblemStructure, Optimisation.Result, Optimisation.Sense, Optimisation.Solver, Optimisation.State -
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final PhysicalStore.Factory
<Double, R064Store> private final ConvexData
<Double> private boolean
private final R064Store
private final MatrixDecomposition.Solver
<Double> private final MatrixDecomposition.Solver
<Double> private boolean
private static final String
private static final String
Fields inherited from class org.ojalgo.optimisation.convex.ConvexSolver
INTEGRATION
Fields inherited from class org.ojalgo.optimisation.GenericSolver
options
-
Constructor Summary
ConstructorsConstructorDescriptionBasePrimitiveSolver
(ConvexData<Double> convexData, Optimisation.Options optimisationOptions) -
Method Summary
Modifier and TypeMethodDescription(package private) static ConvexSolver.Builder
builder
(MatrixStore<Double>[] matrices) protected Optimisation.Result
protected boolean
computeGeneral
(Access2D.Collectable<Double, ? super PhysicalStore<Double>> matrix) protected int
protected int
protected int
void
dispose()
Cleanup when a solver instance is no longer needed.protected double
evaluateFunction
(Access1D<?> solution) protected MatrixStore
<Double> protected abstract Access2D.Collectable
<Double, ? super PhysicalStore<Double>> protected abstract Access2D.Collectable
<Double, ? super PhysicalStore<Double>> protected MatrixStore
<Double> protected SparseArray
<Double> getMatrixAE
(int row) protected RowsSupplier
<Double> getMatrixAE
(int[] rows) protected MatrixStore
<Double> protected SparseArray
<Double> getMatrixAI
(int row) protected RowsSupplier
<Double> getMatrixAI
(int[] rows) protected MatrixStore
<Double> protected MatrixStore
<Double> protected double
getMatrixBI
(int row) protected MatrixStore
<Double> getMatrixBI
(int[] selector) protected MatrixStore
<Double> protected PhysicalStore
<Double> protected int
protected MatrixStore
<Double> getSolutionGeneral
(Access2D.Collectable<Double, ? super PhysicalStore<Double>> rhs) protected MatrixStore
<Double> getSolutionGeneral
(Access2D.Collectable<Double, ? super PhysicalStore<Double>> rhs, PhysicalStore<Double> preallocated) protected MatrixStore
<Double> getSolutionQ
(Access2D.Collectable<Double, ? super PhysicalStore<Double>> rhs) protected MatrixStore
<Double> getSolutionQ
(Access2D.Collectable<Double, ? super PhysicalStore<Double>> rhs, PhysicalStore<Double> preallocated) protected PhysicalStore
<Double> Solution / Variables: [X]protected boolean
protected boolean
protected boolean
initialise
(Optimisation.Result kickStarter) protected boolean
(package private) boolean
protected boolean
protected boolean
(package private) boolean
isZeroQ()
protected abstract boolean
(package private) static BasePrimitiveSolver
newSolver
(ConvexData<Double> data, Optimisation.Options options) (package private) static ConvexSolver
of
(MatrixStore<Double>[] matrices) protected abstract void
solve
(Optimisation.Result kickStarter) protected boolean
solveFullKKT
(PhysicalStore<Double> preallocated) protected Optimisation.Result
solveLP()
The LP result with aOptimisation.State
suitable for this solver – most likelyOptimisation.State.FEASIBLE
.(package private) static ConvexObjectiveFunction
<Double> toObjectiveFunction
(MatrixStore<?> mtrxQ, MatrixStore<?> mtrxC) toString()
Methods inherited from class org.ojalgo.optimisation.convex.ConvexSolver
copy, newBuilder, newBuilder, newBuilder, newSolver
Methods inherited from class org.ojalgo.optimisation.GenericSolver
countIterations, countTime, error, getClassSimpleName, getDuration, getState, incrementIterationsCount, isIterationAllowed, isLogDebug, isLogOff, isLogProgress, log, log, log, log, logProgress, resetIterationsCount, setState, setValidator, validate, validate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.ojalgo.optimisation.Optimisation.Solver
solve
Methods inherited from interface org.ojalgo.optimisation.UpdatableSolver
fixVariable, generateCutCandidates, integers, isMapped, updateRange
-
Field Details
-
Q_NOT_POSITIVE_SEMIDEFINITE
- See Also:
-
Q_NOT_SYMMETRIC
- See Also:
-
MATRIX_FACTORY
-
myMatrices
-
myPatchedQ
private boolean myPatchedQ -
mySolutionX
-
mySolverGeneral
-
mySolverQ
-
myZeroQ
private boolean myZeroQ
-
-
Constructor Details
-
BasePrimitiveSolver
BasePrimitiveSolver(ConvexData<Double> convexData, Optimisation.Options optimisationOptions)
-
-
Method Details
-
builder
-
newSolver
-
of
-
toObjectiveFunction
static ConvexObjectiveFunction<Double> toObjectiveFunction(MatrixStore<?> mtrxQ, MatrixStore<?> mtrxC) -
dispose
public void dispose()Description copied from interface:Optimisation.Solver
Cleanup when a solver instance is no longer needed.- Specified by:
dispose
in interfaceOptimisation.Solver
-
getEntityMap
- Specified by:
getEntityMap
in interfaceUpdatableSolver
-
solve
- Specified by:
solve
in interfaceOptimisation.Solver
-
toString
-
buildResult
-
computeGeneral
-
countEqualityConstraints
protected int countEqualityConstraints() -
countInequalityConstraints
protected int countInequalityConstraints() -
countVariables
protected int countVariables() -
evaluateFunction
-
extractSolution
-
getIterationKKT
-
getIterationRHS
-
getMatrixAE
-
getMatrixAE
-
getMatrixAE
-
getMatrixAI
-
getMatrixAI
-
getMatrixAI
-
getMatrixBE
-
getMatrixBI
-
getMatrixBI
protected double getMatrixBI(int row) -
getMatrixBI
-
getMatrixC
-
getMatrixQ
-
getRankGeneral
protected int getRankGeneral() -
getSolutionGeneral
protected MatrixStore<Double> getSolutionGeneral(Access2D.Collectable<Double, ? super PhysicalStore<Double>> rhs) -
getSolutionGeneral
protected MatrixStore<Double> getSolutionGeneral(Access2D.Collectable<Double, ? super PhysicalStore<Double>> rhs, PhysicalStore<Double> preallocated) -
getSolutionQ
protected MatrixStore<Double> getSolutionQ(Access2D.Collectable<Double, ? super PhysicalStore<Double>> rhs) -
getSolutionQ
protected MatrixStore<Double> getSolutionQ(Access2D.Collectable<Double, ? super PhysicalStore<Double>> rhs, PhysicalStore<Double> preallocated) -
getSolutionX
Solution / Variables: [X] -
hasEqualityConstraints
protected boolean hasEqualityConstraints() -
hasInequalityConstraints
protected boolean hasInequalityConstraints() -
initialise
- Returns:
- true/false if the main algorithm may start or not
-
isIteratingPossible
protected boolean isIteratingPossible() -
isSolvableGeneral
protected boolean isSolvableGeneral() -
isSolvableQ
protected boolean isSolvableQ() -
needsAnotherIteration
protected abstract boolean needsAnotherIteration() -
performIteration
protected abstract void performIteration() -
solveFullKKT
-
solveLP
The LP result with aOptimisation.State
suitable for this solver – most likelyOptimisation.State.FEASIBLE
. IF the LP was solved to optimality but the Q matrix (or the entire objective function) was disregarded then the returned state will just beOptimisation.State.FEASIBLE
. -
isPatchedQ
boolean isPatchedQ() -
isZeroQ
boolean isZeroQ()
-