Module ojalgo
Package org.ojalgo.optimisation
Class GenericSolver.Builder<B extends GenericSolver.Builder<B,S>,S extends GenericSolver>
- java.lang.Object
-
- org.ojalgo.optimisation.GenericSolver.Builder<B,S>
-
- All Implemented Interfaces:
Optimisation,Optimisation.ProblemStructure
- Direct Known Subclasses:
ConvexSolver.Builder,LinearSolver.Builder
- Enclosing class:
- GenericSolver
public abstract static class GenericSolver.Builder<B extends GenericSolver.Builder<B,S>,S extends GenericSolver> extends java.lang.Object implements Optimisation.ProblemStructure
-
-
Nested Class Summary
-
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
Fields Modifier and Type Field Description private static PhysicalStore.Factory<java.lang.Double,R064Store>FACTORYprivate java.util.Map<java.lang.String,MultiaryFunction.TwiceDifferentiable<java.lang.Double>>myAdditionalConstraintsAssumed constrained to be <= 0.0private RowsSupplier<java.lang.Double>myAEprivate RowsSupplier<java.lang.Double>myAIprivate MatrixStore<java.lang.Double>myBEprivate MatrixStore<java.lang.Double>myBIprivate R064StoremyLowerBoundsprivate intmyNumberOfVariablesprivate MultiaryFunction.TwiceDifferentiable<java.lang.Double>myObjectiveprivate R064StoremyUpperBounds-
Fields inherited from interface org.ojalgo.optimisation.Optimisation.ProblemStructure
DEBUG
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedBuilder()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description private static MatrixStore<java.lang.Double>add(RowsSupplier<java.lang.Double> baseA, MatrixStore<java.lang.Double> baseB, Access2D<?> addA, Access1D<?> addB)(package private) voidaddConstraint(java.lang.String key, MultiaryFunction.TwiceDifferentiable<java.lang.Double> value)(package private) voidaddEqualities(MatrixStore<?> mtrxAE, MatrixStore<?> mtrxBE)(package private) voidaddInequalities(MatrixStore<?> mtrxAI, MatrixStore<?> mtrxBI)protected voidappend(java.lang.StringBuilder builder)protected static voidappend(java.lang.StringBuilder builder, java.lang.String label, MatrixStore<java.lang.Double> matrix)Sbuild()Sbuild(Optimisation.Options options)intcountAdditionalConstraints()Not included inOptimisation.ProblemStructure.countConstraints()(because they are not simple linear equality or inequality constraints),intcountEqualityConstraints()intcountInequalityConstraints()intcountVariables()protected abstract SdoBuild(Optimisation.Options options)protected intdoCountVariables()protected Bequalities(Access2D<?> mtrxAE, Access1D<?> mtrxBE)protected Bequality(double rhs, double... factors)protected MatrixStore<java.lang.Double>getAE()Equality constraints body: [AE][X] == [BE]protected SparseArray<java.lang.Double>getAE(int row)protected RowsSupplier<java.lang.Double>getAE(int... rows)protected MatrixStore<java.lang.Double>getAI()Inequality constraints body: [AI][X] <= [BI]protected SparseArray<java.lang.Double>getAI(int row)protected RowsSupplier<java.lang.Double>getAI(int... rows)protected MatrixStore<java.lang.Double>getBE()Equality constraints RHS: [AE][X] == [BE]protected doublegetBE(int row)protected MatrixStore<java.lang.Double>getBI()Inequality constraints RHS: [AI][X] <= [BI]protected doublegetBI(int row)protected MatrixStore<java.lang.Double>getC()protected PhysicalStore.Factory<java.lang.Double,R064Store>getFactory()protected R064StoregetLowerBounds(double defaultValue)protected MultiaryFunction.TwiceDifferentiable<java.lang.Double>getObjective()protected <T extends MultiaryFunction.TwiceDifferentiable<java.lang.Double>>
TgetObjective(java.lang.Class<T> type)protected Access2D.RowView<java.lang.Double>getRowsAE()protected Access2D.RowView<java.lang.Double>getRowsAI()protected R064StoregetUpperBounds(double defaultValue)protected Binequalities(Access2D<?> mtrxAI, Access1D<?> mtrxBI)protected Binequality(double rhs, double... factors)(package private) voidnewEqualities(int nbEqualities, int nbVariables)(package private) voidnewInequalities(int nbInequalities, int nbVariables)voidreset()(package private) voidsetBounds(Access1D<java.lang.Double> lower, Access1D<java.lang.Double> upper)(package private) voidsetEqualities(Access2D<?> mtrxAE, Access1D<?> mtrxBE)(package private) voidsetInequalities(Access2D<?> mtrxAI, Access1D<?> mtrxBI)protected voidsetNumberOfVariables(int numberOfVariables)protected voidsetObjective(MultiaryFunction.TwiceDifferentiable<java.lang.Double> objective)Optimisation.Resultsolve()java.lang.StringtoString()(package private) voidvalidate()-
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.ProblemStructure
countConstraints
-
-
-
-
Field Detail
-
FACTORY
private static final PhysicalStore.Factory<java.lang.Double,R064Store> FACTORY
-
myAdditionalConstraints
private java.util.Map<java.lang.String,MultiaryFunction.TwiceDifferentiable<java.lang.Double>> myAdditionalConstraints
Assumed constrained to be <= 0.0
-
myAE
private RowsSupplier<java.lang.Double> myAE
-
myAI
private RowsSupplier<java.lang.Double> myAI
-
myBE
private MatrixStore<java.lang.Double> myBE
-
myBI
private MatrixStore<java.lang.Double> myBI
-
myLowerBounds
private R064Store myLowerBounds
-
myNumberOfVariables
private transient int myNumberOfVariables
-
myObjective
private MultiaryFunction.TwiceDifferentiable<java.lang.Double> myObjective
-
myUpperBounds
private R064Store myUpperBounds
-
-
Method Detail
-
add
private static MatrixStore<java.lang.Double> add(RowsSupplier<java.lang.Double> baseA, MatrixStore<java.lang.Double> baseB, Access2D<?> addA, Access1D<?> addB)
-
append
protected static final void append(java.lang.StringBuilder builder, java.lang.String label, MatrixStore<java.lang.Double> matrix)
-
build
public final S build()
-
build
public final S build(Optimisation.Options options)
-
countAdditionalConstraints
public int countAdditionalConstraints()
Description copied from interface:Optimisation.ProblemStructureNot included inOptimisation.ProblemStructure.countConstraints()(because they are not simple linear equality or inequality constraints),- Specified by:
countAdditionalConstraintsin interfaceOptimisation.ProblemStructure
-
countEqualityConstraints
public int countEqualityConstraints()
- Specified by:
countEqualityConstraintsin interfaceOptimisation.ProblemStructure
-
countInequalityConstraints
public int countInequalityConstraints()
- Specified by:
countInequalityConstraintsin interfaceOptimisation.ProblemStructure
-
countVariables
public int countVariables()
- Specified by:
countVariablesin interfaceOptimisation.ProblemStructure
-
reset
public void reset()
-
solve
public final Optimisation.Result solve()
-
toString
public final java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
append
protected void append(java.lang.StringBuilder builder)
-
doBuild
protected abstract S doBuild(Optimisation.Options options)
-
doCountVariables
protected int doCountVariables()
-
equality
protected B equality(double rhs, double... factors)
-
getAE
protected MatrixStore<java.lang.Double> getAE()
Equality constraints body: [AE][X] == [BE]
-
getAE
protected SparseArray<java.lang.Double> getAE(int row)
-
getAE
protected RowsSupplier<java.lang.Double> getAE(int... rows)
-
getAI
protected MatrixStore<java.lang.Double> getAI()
Inequality constraints body: [AI][X] <= [BI]
-
getAI
protected SparseArray<java.lang.Double> getAI(int row)
-
getAI
protected RowsSupplier<java.lang.Double> getAI(int... rows)
-
getBE
protected MatrixStore<java.lang.Double> getBE()
Equality constraints RHS: [AE][X] == [BE]
-
getBE
protected double getBE(int row)
-
getBI
protected MatrixStore<java.lang.Double> getBI()
Inequality constraints RHS: [AI][X] <= [BI]
-
getBI
protected double getBI(int row)
-
getC
protected MatrixStore<java.lang.Double> getC()
-
getFactory
protected PhysicalStore.Factory<java.lang.Double,R064Store> getFactory()
-
getLowerBounds
protected R064Store getLowerBounds(double defaultValue)
-
getObjective
protected MultiaryFunction.TwiceDifferentiable<java.lang.Double> getObjective()
-
getObjective
protected <T extends MultiaryFunction.TwiceDifferentiable<java.lang.Double>> T getObjective(java.lang.Class<T> type)
-
getRowsAE
protected Access2D.RowView<java.lang.Double> getRowsAE()
-
getRowsAI
protected Access2D.RowView<java.lang.Double> getRowsAI()
-
getUpperBounds
protected R064Store getUpperBounds(double defaultValue)
-
inequality
protected B inequality(double rhs, double... factors)
-
setNumberOfVariables
protected void setNumberOfVariables(int numberOfVariables)
-
setObjective
protected void setObjective(MultiaryFunction.TwiceDifferentiable<java.lang.Double> objective)
-
addConstraint
void addConstraint(java.lang.String key, MultiaryFunction.TwiceDifferentiable<java.lang.Double> value)
-
addEqualities
void addEqualities(MatrixStore<?> mtrxAE, MatrixStore<?> mtrxBE)
-
addInequalities
void addInequalities(MatrixStore<?> mtrxAI, MatrixStore<?> mtrxBI)
-
newEqualities
void newEqualities(int nbEqualities, int nbVariables)
-
newInequalities
void newInequalities(int nbInequalities, int nbVariables)
-
validate
void validate()
-
-