|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectscpsolver.constraints.LinearSmallerThanEqualsConstraint
public class LinearSmallerThanEqualsConstraint
| Constructor Summary | |
|---|---|
LinearSmallerThanEqualsConstraint(double[] pc,
double t,
java.lang.String name)
Generic constructor for LinearSmallerThanEqualsConstraint |
|
LinearSmallerThanEqualsConstraint(SparseVector c,
double t,
java.lang.String name)
Generic constructor for LinearSmallerThanEqualsConstraint |
|
| Method Summary | |
|---|---|
void |
addToLinearProgramSolver(LinearProgramSolver solver)
Adds one line representing this constraint to the constraint matrix of a given solver. |
java.lang.StringBuffer |
convertToCPLEX()
Creates a CPLEX description of the given instance. |
java.lang.StringBuffer |
convertToGMPL()
Creates a GMPL description of the given instance. |
double[] |
getC()
Returns the weight vector of this constraint. |
SparseVector |
getCSparse()
Returns a sparse representation of the weight vector. |
java.lang.String |
getName()
Returns the name of a specific constraint. |
double |
getRHS()
Returns the right hand side. |
double |
getT()
Returns the target value of this constraint. |
boolean |
isSatisfiedBy(double[] x)
Evaluates the constraint at input value x and checks if the constraint
holds. |
void |
setC(double[] pc)
Set c-Vector |
void |
setT(double t)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LinearSmallerThanEqualsConstraint(SparseVector c,
double t,
java.lang.String name)
c - c-Vectort - right hand sidename - name of the constraint
public LinearSmallerThanEqualsConstraint(double[] pc,
double t,
java.lang.String name)
pc - c-Vectort - right hand sidename - name of the constraint| Method Detail |
|---|
public void setC(double[] pc)
pc - c-vectorpublic double[] getC()
LinearConstraint
For easier constraint manipulation, SCPSolver saves not one big
constraint matrix as the formal description of a linear problem
suggests, but creates a line for line representation of this
matrix. Therefore, a formal description of this vector is the
i-th line of A, if this constraint
is the i-th constraint.
getC in interface LinearConstraintpublic double getT()
LinearConstraint
getT in interface LinearConstraintpublic void setT(double t)
t - the right hand side to setpublic java.lang.String getName()
ConstraintWhen creating a new constraint for a problem, a name can be given to this constraint to identify it later and see, which specific constrains hold and maybe which contradict each other.
Please note: unlike Problem, where the name describes the type of problem
instead of the actual instance, here the name the describes the actual instance and not
the generic type.
getName in interface Constraintpublic boolean isSatisfiedBy(double[] x)
Constraintx and checks if the constraint
holds. Returns true if input x satisfies the constraint,
false otherwise. The input dimension (i.e. the array.length), must be the same
as the target function.
isSatisfiedBy in interface Constraintx - the position, where the constraint is to be evaluated
true if input value x satisfies this constraint,
false otherwisepublic void addToLinearProgramSolver(LinearProgramSolver solver)
LinearConstraint
addToLinearProgramSolver in interface LinearConstraintsolver - an instance of a linear program solverpublic java.lang.StringBuffer convertToCPLEX()
Convertable
convertToCPLEX in interface Convertablepublic java.lang.StringBuffer convertToGMPL()
Convertable
convertToGMPL in interface Convertablepublic SparseVector getCSparse()
LinearConstraint
getCSparse in interface LinearConstraintgetCpublic double getRHS()
Constraint
getRHS in interface Constraint
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||