scpsolver.constraints
Class QuadraticSmallerThanEqualsContraint

java.lang.Object
  extended by scpsolver.constraints.QuadraticSmallerThanEqualsContraint
All Implemented Interfaces:
Constraint, QuadraticConstraint

public class QuadraticSmallerThanEqualsContraint
extends java.lang.Object
implements QuadraticConstraint

Author:
planatsc

Constructor Summary
QuadraticSmallerThanEqualsContraint(double[][] pq, double[] c, double t, java.lang.String name)
           
QuadraticSmallerThanEqualsContraint(Matrix q, SparseVector c, double t, java.lang.String name)
           
 
Method Summary
 void addToQuadraticProgramSolver(QuadraticProgramSolver solver)
           
 double[] getC()
           
 SparseVector getCSparse()
           
 java.lang.String getName()
          Returns the name of a specific constraint.
 Matrix getQ()
           
 double getRHS()
          Returns the right hand side.
 double getT()
           
 boolean isSatisfiedBy(double[] x)
          Evaluates the constraint at input value x and checks if the constraint holds.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QuadraticSmallerThanEqualsContraint

public QuadraticSmallerThanEqualsContraint(Matrix q,
                                           SparseVector c,
                                           double t,
                                           java.lang.String name)

QuadraticSmallerThanEqualsContraint

public QuadraticSmallerThanEqualsContraint(double[][] pq,
                                           double[] c,
                                           double t,
                                           java.lang.String name)
Method Detail

getName

public java.lang.String getName()
Description copied from interface: Constraint
Returns the name of a specific 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.

Specified by:
getName in interface Constraint
Returns:

isSatisfiedBy

public boolean isSatisfiedBy(double[] x)
Description copied from interface: Constraint
Evaluates the constraint at input value 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.

Specified by:
isSatisfiedBy in interface Constraint
Parameters:
x - the position, where the constraint is to be evaluated
Returns:
true if input value x satisfies this constraint, false otherwise

addToQuadraticProgramSolver

public void addToQuadraticProgramSolver(QuadraticProgramSolver solver)
Specified by:
addToQuadraticProgramSolver in interface QuadraticConstraint

getC

public double[] getC()
Specified by:
getC in interface QuadraticConstraint

getQ

public Matrix getQ()
Specified by:
getQ in interface QuadraticConstraint

getT

public double getT()
Specified by:
getT in interface QuadraticConstraint

getCSparse

public SparseVector getCSparse()
Specified by:
getCSparse in interface QuadraticConstraint

getRHS

public double getRHS()
Description copied from interface: Constraint
Returns the right hand side.

Specified by:
getRHS in interface Constraint
Returns:
right hand side