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 ConvexSolver
ConvexSolver.Builder, ConvexSolver.Configuration, ConvexSolver.ModelIntegrationNested classes/interfaces inherited from interface Optimisation
Optimisation.Constraint, Optimisation.ConstraintType, Optimisation.Integration<M,S>, 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 booleanprivate final R064Storeprivate final MatrixDecomposition.Solver<Double> private final MatrixDecomposition.Solver<Double> private booleanprivate static final Stringprivate static final StringFields inherited from class ConvexSolver
INTEGRATIONFields inherited from class GenericSolver
options -
Constructor Summary
ConstructorsConstructorDescriptionBasePrimitiveSolver(ConvexData<Double> convexData, Optimisation.Options optimisationOptions) -
Method Summary
Modifier and TypeMethodDescription(package private) static ConvexSolver.Builderbuilder(MatrixStore<Double>[] matrices) protected Optimisation.Resultprotected booleancomputeGeneral(Access2D.Collectable<Double, ? super TransformableRegion<Double>> matrix) protected intprotected intprotected intvoiddispose()Cleanup when a solver instance is no longer needed.protected doubleevaluateFunction(Access1D<?> solution) protected MatrixStore<Double> protected abstract Access2D.Collectable<Double, ? super TransformableRegion<Double>> protected abstract Access2D.Collectable<Double, ? super TransformableRegion<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 doublegetMatrixBI(int row) protected MatrixStore<Double> getMatrixBI(int[] selector) protected MatrixStore<Double> protected PhysicalStore<Double> protected intprotected 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 booleanprotected booleanprotected booleaninitialise(Optimisation.Result kickStarter) protected boolean(package private) booleanprotected booleanprotected boolean(package private) booleanisZeroQ()protected abstract boolean(package private) static BasePrimitiveSolvernewSolver(ConvexData<Double> data, Optimisation.Options options) (package private) static ConvexSolverof(MatrixStore<Double>[] matrices) protected abstract voidsolve(Optimisation.Result kickStarter) protected booleansolveFullKKT(PhysicalStore<Double> preallocated) protected Optimisation.ResultsolveLP()The LP result with aOptimisation.Statesuitable for this solver – most likelyOptimisation.State.FEASIBLE.(package private) static ConvexObjectiveFunction<Double> toObjectiveFunction(MatrixStore<?> mtrxQ, MatrixStore<?> mtrxC) toString()(package private) voidSpecifically for use byIterativeRefinementSolver2Methods inherited from class ConvexSolver
copy, newBuilder, newBuilder, newBuilder, newSolverMethods inherited from class GenericSolver
countIterations, countTime, error, getClassSimpleName, getDuration, getState, incrementIterationsCount, isIterationAllowed, isLogDebug, isLogOff, isLogProgress, log, log, log, log, logProgress, printf, resetIterationsCount, setState, setValidator, validate, validateMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Optimisation.Solver
solveMethods inherited from interface 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.SolverCleanup when a solver instance is no longer needed.- Specified by:
disposein interfaceOptimisation.Solver
-
getEntityMap
- Specified by:
getEntityMapin interfaceUpdatableSolver
-
solve
- Specified by:
solvein interfaceOptimisation.Solver
-
toString
-
buildResult
-
computeGeneral
protected boolean computeGeneral(Access2D.Collectable<Double, ? super TransformableRegion<Double>> matrix) -
countEqualityConstraints
protected int countEqualityConstraints() -
countInequalityConstraints
protected int countInequalityConstraints() -
countVariables
protected int countVariables() -
evaluateFunction
-
extractSolution
-
getIterationKKT
protected abstract Access2D.Collectable<Double, ? super TransformableRegion<Double>> getIterationKKT() -
getIterationRHS
protected abstract Access2D.Collectable<Double, ? super TransformableRegion<Double>> 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.Statesuitable 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() -
update
Specifically for use byIterativeRefinementSolver2
-