|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsbrt.ext.glpk.GlpkSolver<R,C>
R
- the row variable type.C
- the column variable type.public class GlpkSolver<R,C>
This class is a wrapper for the GLPK package from GNU.
Constructor Summary | |
---|---|
GlpkSolver()
Constructs a new GLPK program solver. |
Method Summary | ||
---|---|---|
void |
clear()
Clears all information contained in this program solver. |
|
double |
getObjectiveValue()
Returns the most recently computed objective value. |
|
java.util.Map<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 current optimization sense. |
|
|
setColumnConstraint(Y column,
Interval c)
Sets the constraint on the provided column variable. |
|
void |
setColumnConstraints(java.util.Map<? extends C,Interval> columnConstraints)
Sets the constraints for the provided column variables. |
|
void |
setConstraint(LinearComb<? extends C> expression,
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 |
setConstraints(java.util.Map<? extends MathExpr<? extends C>,Interval> expressionConstraints)
Sets constraints on the provided mathematical expressions of column variables. |
|
|
setMatrixElement(X row,
Y 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> expression)
Sets the objective function to the provided mathematical expression of column variables. |
|
void |
setObjectiveFunction(LinearComb<? extends C> expression,
OptSense sense)
Sets the objective function and optimization sense to the provided values. |
|
void |
setObjectiveFunction(MathExpr<? extends C> expression)
Sets the objective function to the provided mathematical expression of column variables. |
|
void |
setObjectiveFunction(MathExpr<? extends C> expression,
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 fileName)
Throws UnsupportedOperationException . |
|
|
setRowConstraint(X 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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GlpkSolver()
Method Detail |
---|
public void clear()
clear
in interface ProgramSolver<R,C>
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.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 <X extends R,Y extends C> void setMatrixElement(X row, Y column, double value)
setMatrixElement
in interface ProgramSolver<R,C>
X
- a type extending the primary row variable type.Y
- a type extending the primary column variable type.row
- the row variable.column
- the column variable.value
- the double precision element value.public <Y extends C> void setColumnConstraint(Y column, Interval c)
setColumnConstraint
in interface ProgramSolver<R,C>
Y
- 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> columnConstraints)
setColumnConstraints
in interface ProgramSolver<R,C>
columnConstraints
- column variables mapped to their corresponding
constraint.public <X extends R> void setRowConstraint(X row, Interval c)
setRowConstraint
in interface ProgramSolver<R,C>
X
- 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 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 setConstraint(LinearComb<? extends C> expression, Interval c)
setConstraint
in interface LinearProgramSolver<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> expressionConstraints)
setConstraints
in interface ProgramSolver<R,C>
expressionConstraints
- mathematical expressions of column variables
mapped to their corresponding constraint.public void setObjectiveFunction(MathExpr<? extends C> expression, OptSense sense)
setObjectiveFunction
in interface ProgramSolver<R,C>
expression
- a mathematical expression of column variables from
this program solver.sense
- the optimization sense.setObjectiveFunction(MathExpr)
,
setOptimizationSense(OptSense)
public void setObjectiveFunction(MathExpr<? extends C> expression)
setObjectiveFunction
in interface ProgramSolver<R,C>
expression
- a mathematical expression of column variables from
this program solver.public void setObjectiveFunction(LinearComb<? extends C> expression, OptSense sense)
setObjectiveFunction
in interface LinearProgramSolver<R,C>
expression
- a mathematical expression of column variables from
this program solver.sense
- the optimization sense.setObjectiveFunction(MathExpr)
,
setOptimizationSense(OptSense)
public void setObjectiveFunction(LinearComb<? extends C> expression)
setObjectiveFunction
in interface LinearProgramSolver<R,C>
expression
- a mathematical expression of column variables from
this program solver.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 double getObjectiveValue()
getObjectiveValue
in interface ProgramSolver<R,C>
optimize()
public java.util.Map<C,java.lang.Double> getSolutionVector()
getSolutionVector
in interface ProgramSolver<R,C>
optimize()
public ProgramSolverStatus getStatus()
getStatus
in interface ProgramSolver<R,C>
optimize()
public void setParamFile(java.lang.String fileName)
UnsupportedOperationException
.
setParamFile
in interface ProgramSolver<R,C>
fileName
- the name of the file containing parameter values.
java.lang.UnsupportedOperationException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |