|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectscpsolver.constraints.LinearEqualsConstraint
public class LinearEqualsConstraint
Constructor Summary | |
---|---|
LinearEqualsConstraint(double[] pc,
double t,
java.lang.String name)
|
|
LinearEqualsConstraint(SparseVector c,
double t,
java.lang.String name)
|
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)
|
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 LinearEqualsConstraint(SparseVector c, double t, java.lang.String name)
public LinearEqualsConstraint(double[] pc, double t, java.lang.String name)
Method Detail |
---|
public void setC(double[] pc)
public 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 LinearConstraint
public double getT()
LinearConstraint
getT
in interface LinearConstraint
public void setT(double t)
t
- the t to setpublic java.lang.String getName()
Constraint
When 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 Constraint
public boolean isSatisfiedBy(double[] x)
Constraint
x
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 Constraint
x
- 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 LinearConstraint
solver
- an instance of a linear program solverpublic java.lang.StringBuffer convertToCPLEX()
Convertable
convertToCPLEX
in interface Convertable
public java.lang.StringBuffer convertToGMPL()
Convertable
convertToGMPL
in interface Convertable
public SparseVector getCSparse()
LinearConstraint
getCSparse
in interface LinearConstraint
getC
public double getRHS()
Constraint
getRHS
in interface Constraint
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |