public class LP
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
LP.OptimizationType |
Constructor and Description |
---|
LP()
Creates a new empty LP
|
Modifier and Type | Method and Description |
---|---|
Constraint |
addConstraint() |
Constraint |
addConstraint(java.lang.String operator,
double rightOperand)
Adds a contrainst to this problem.
|
void |
addVariable(Variable v) |
static LP |
createExample()
Creates an example LP.
|
java.util.List<Constraint> |
getConstraints()
Retrieves the list of contrainsts applying to this LP.
|
LinearExpression |
getObjective()
Retrieves the objective of this LP
|
LP.OptimizationType |
getOptimizationType()
Retrieves the type of optimization for this LP, min or max.
|
Variable |
getVariableByName(long variableNumber)
Looks up a variable by its name.
|
Variable |
getVariableByName(java.lang.String variableName) |
java.util.Collection<Variable> |
getVariables()
Retrieves the set of variables implied in this LP.
|
static LP |
parseCplex(java.lang.String cplexText) |
void |
setOptimizationType(LP.OptimizationType optimizationType)
Sets the type of optimization
|
Result |
solve()
This this LP using the default solver.
|
Result |
solve(LPSolver solver)
Solves this problem using the given solver.
|
java.lang.String |
toCanonicalForm() |
java.lang.String |
toCplex()
Computes a CPLEX PL text representing this LP.
|
java.lang.String |
toLpSolve()
Computes a CPLEX PL text representing this LP.
|
java.lang.String |
toString() |
static int |
var2i(Variable v) |
public LinearExpression getObjective()
public void setOptimizationType(LP.OptimizationType optimizationType)
public java.util.Collection<Variable> getVariables()
public Variable getVariableByName(long variableNumber)
variableNumber
- the name of a variable implied in this LPpublic Variable getVariableByName(java.lang.String variableName)
public LP.OptimizationType getOptimizationType()
public java.util.List<Constraint> getConstraints()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toCplex()
public java.lang.String toLpSolve()
public Constraint addConstraint()
public Result solve()
public Constraint addConstraint(java.lang.String operator, double rightOperand)
public java.lang.String toCanonicalForm()
public static LP createExample()
public static int var2i(Variable v)
public static LP parseCplex(java.lang.String cplexText)
public void addVariable(Variable v)