|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsbrt.ext.cplex.CplexSolver<R,C>
R
- the row variable type.C
- the column variable type.public final class CplexSolver<R,C>
This class is a wrapper for the CPLEX package from ILOG.
Constructor Summary | |
---|---|
CplexSolver()
Constructs a new CPLEX program solver. |
Method Summary | ||
---|---|---|
void |
clear()
Clears all information contained in this program solver. |
|
double |
getObjectiveValue()
Returns the most recently computed objective value. |
|
UnmodifiableMap<C,java.lang.Double> |
getSolutionVector()
Returns the most recently computed solution vector. |
|
ProgramSolverStatus |
getStatus()
Returns the status of the most recently attempted optimization. |
|
boolean |
isColumnVar(java.lang.Object obj)
Indicates if the provided object is a column variable in the matrix of this program solver. |
|
boolean |
isRowVar(java.lang.Object obj)
Indicates if the provided object is a row variable in the matrix of this program solver. |
|
boolean |
optimize()
Computes the optimal value of the current objective function in the direction of the current optimization sense. |
|
|
setColumnConstraint(T column,
Interval c)
Sets the constraint on the provided column variable. |
|
void |
setColumnConstraints(java.util.Map<? extends C,Interval> constraints)
Sets the constraints for the provided column variables. |
|
void |
setConstraint(LinearComb<? extends C> linComb,
Interval c)
Sets a constraint on the provided mathematical expression of column variables. |
|
void |
setConstraint(MathExpr<? extends C> expression,
Interval c)
Sets a constraint on the provided mathematical expression of column variables. |
|
void |
setConstraint(QuadraticExpr<? extends C> expr,
Interval c)
Sets a constraint on the provided mathematical expression of column variables. |
|
void |
setConstraints(java.util.Map<? extends MathExpr<? extends C>,Interval> exprConstraints)
Sets constraints on the provided mathematical expressions of column variables. |
|
|
setMatrixElement(S row,
T column,
double value)
Sets the element of the program matrix at the provided row and column variables to the one provided. |
|
void |
setObjectiveFunction(LinearComb<? extends C> objective)
Sets the objective function to the provided mathematical expression of column variables. |
|
void |
setObjectiveFunction(LinearComb<? extends C> objective,
OptSense sense)
Sets the objective function and optimization sense to the provided values. |
|
void |
setObjectiveFunction(MathExpr<? extends C> objective)
Sets the objective function to the provided mathematical expression of column variables. |
|
void |
setObjectiveFunction(MathExpr<? extends C> objective,
OptSense sense)
Sets the objective function and optimization sense to the provided values. |
|
void |
setObjectiveFunction(QuadraticExpr<? extends C> objective)
Not yet implemented. |
|
void |
setObjectiveFunction(QuadraticExpr<? extends C> objective,
OptSense sense)
Sets the objective function and optimization sense to the provided values. |
|
void |
setOptimizationSense(OptSense sense)
Sets the optimization sense. |
|
void |
setParamFile(java.lang.String prmFileName)
Reads the program solver parameter file with the provided name. |
|
|
setRowConstraint(T row,
Interval c)
Sets the constraint for the provided row variable. |
|
void |
setRowConstraints(java.util.Map<? extends R,Interval> rowConstraints)
Sets the constraints for the provided row variables. |
|
java.lang.String |
toString()
Returns the name of this program solver. |
|
void |
writeProblem(java.lang.String fileName)
Writes the CPLEX model to a file with the provided name. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public CplexSolver()
Method Detail |
---|
public void clear()
clear
in interface ProgramSolver<R,C>
public <S extends R,T extends C> void setMatrixElement(S row, T column, double value)
setMatrixElement
in interface ProgramSolver<R,C>
S
- a type extending the primary row variable type.T
- a type extending the primary column variable type.row
- the row variable.column
- the column variable.value
- the double precision element value.public void setConstraint(MathExpr<? extends C> expression, Interval c)
setConstraint
in interface ProgramSolver<R,C>
expression
- a mathematical expression of column variables for
which the constraint is set.c
- the constraint.public void setConstraints(java.util.Map<? extends MathExpr<? extends C>,Interval> exprConstraints)
setConstraints
in interface ProgramSolver<R,C>
exprConstraints
- mathematical expressions of column variables
mapped to their corresponding constraint.public void setConstraint(LinearComb<? extends C> linComb, Interval c)
setConstraint
in interface LinearProgramSolver<R,C>
linComb
- a mathematical expression of column variables for
which the constraint is set.c
- the constraint.public void setConstraint(QuadraticExpr<? extends C> expr, Interval c)
setConstraint
in interface QuadraticProgramSolver<R,C>
expr
- a mathematical expression of column variables for
which the constraint is set.c
- the constraint.public <T extends C> void setColumnConstraint(T column, Interval c)
setColumnConstraint
in interface ProgramSolver<R,C>
T
- a type extending the primary column variable type.column
- the column variable for which the constraint is set.c
- the constraint.public void setColumnConstraints(java.util.Map<? extends C,Interval> constraints)
setColumnConstraints
in interface ProgramSolver<R,C>
constraints
- column variables mapped to their corresponding
constraint.public <T extends R> void setRowConstraint(T row, Interval c)
setRowConstraint
in interface ProgramSolver<R,C>
T
- a type extending the primary row variable type.row
- the row variable for which the constraint is set.c
- the constraint.public void setRowConstraints(java.util.Map<? extends R,Interval> rowConstraints)
setRowConstraints
in interface ProgramSolver<R,C>
rowConstraints
- row variables mapped to their corresponding
constraint.public void setObjectiveFunction(MathExpr<? extends C> objective, OptSense sense)
setObjectiveFunction
in interface ProgramSolver<R,C>
objective
- a mathematical expression of column variables from
this program solver.sense
- the optimization sense.setObjectiveFunction(MathExpr)
,
setOptimizationSense(OptSense)
public void setObjectiveFunction(LinearComb<? extends C> objective, OptSense sense)
setObjectiveFunction
in interface LinearProgramSolver<R,C>
objective
- a mathematical expression of column variables from
this program solver.sense
- the optimization sense.setObjectiveFunction(MathExpr)
,
setOptimizationSense(OptSense)
public void setObjectiveFunction(QuadraticExpr<? extends C> objective, OptSense sense)
setObjectiveFunction
in interface QuadraticProgramSolver<R,C>
objective
- a mathematical expression of column variables from
this program solver.sense
- the optimization sense.setObjectiveFunction(MathExpr)
,
setOptimizationSense(OptSense)
public void setObjectiveFunction(MathExpr<? extends C> objective)
setObjectiveFunction
in interface ProgramSolver<R,C>
objective
- a mathematical expression of column variables from
this program solver.public void setObjectiveFunction(LinearComb<? extends C> objective)
setObjectiveFunction
in interface LinearProgramSolver<R,C>
objective
- a mathematical expression of column variables from
this program solver.public void setObjectiveFunction(QuadraticExpr<? extends C> objective)
setObjectiveFunction
in interface QuadraticProgramSolver<R,C>
objective
- a mathematical expression of column variables from
this program solver.
java.lang.UnsupportedOperationException
public void setOptimizationSense(OptSense sense)
setOptimizationSense
in interface ProgramSolver<R,C>
sense
- the optimization sense.public boolean optimize()
optimize
in interface ProgramSolver<R,C>
true
if an optimal solution was found;
false
otherwise.getObjectiveValue()
,
getSolutionVector()
public ProgramSolverStatus getStatus()
getStatus
in interface ProgramSolver<R,C>
optimize()
public double getObjectiveValue()
getObjectiveValue
in interface ProgramSolver<R,C>
optimize()
public UnmodifiableMap<C,java.lang.Double> getSolutionVector()
getSolutionVector
in interface ProgramSolver<R,C>
optimize()
public void writeProblem(java.lang.String fileName)
fileName
- the name of the file to be written.public java.lang.String toString()
toString
in class java.lang.Object
public void setParamFile(java.lang.String prmFileName)
setParamFile
in interface ProgramSolver<R,C>
prmFileName
- the name of the PRM file containing parameter values.public boolean isColumnVar(java.lang.Object obj)
isColumnVar
in interface ProgramSolver<R,C>
obj
- the potential column variable.
true
if the provided object is a column variable in the
matrix of this program solver; false
otherwise.public boolean isRowVar(java.lang.Object obj)
isRowVar
in interface ProgramSolver<R,C>
obj
- the potential row variable.
true
if the provided object is a row variable in the
matrix of this program solver; false
otherwise.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |