|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object scpsolver.problems.MathematicalProgram scpsolver.qpsolver.QuadraticProgram
public class QuadraticProgram
Field Summary |
---|
Fields inherited from class scpsolver.problems.MathematicalProgram |
---|
c, constraints, isboolean, isinteger, lowerbound, minproblem, upperbound |
Constructor Summary | |
---|---|
QuadraticProgram(double[][] q)
|
|
QuadraticProgram(double[][] q,
double[] pc)
|
|
QuadraticProgram(Matrix q,
SparseVector c)
|
Method Summary | |
---|---|
boolean |
addConstraint(Constraint c)
|
double |
evaluate(double[] x)
Returns the value of the function at position x . |
java.util.ArrayList<Constraint> |
getConstraints()
Returns a list of all constrains a valid solution must keep. |
int |
getDimension()
Returns the dimension of the mathematical problem, i.e. the number of free variables of the problem. |
java.lang.String |
getName()
Gets a string containing the type of problem that is formulated with a given instance. |
Matrix |
getQ()
|
java.util.ArrayList<Constraint> |
getViolatedContraints(double[] x)
|
boolean |
isFeasable(double[] x)
Determines whether all constrains are fulfilled at input value x . |
boolean |
isMinProblem()
Checks, whether the target function of this problem is to be minimized or maximized. |
static void |
main(java.lang.String[] args)
|
void |
setMinProblem(boolean bool)
Determines if the target function of this problem is to be minimized or maximized. |
void |
setQ(double[][] q)
|
void |
setQ(Matrix q)
|
Methods inherited from class scpsolver.problems.MathematicalProgram |
---|
getC, getIsboolean, getIsinteger, getLowerbound, getUpperbound, hasBounds, isMIP, makeDoubleArray, setC, setContinous, setInteger, setIsinteger, setLowerbound, setUpperbound |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public QuadraticProgram(Matrix q, SparseVector c)
public QuadraticProgram(double[][] q, double[] pc)
public QuadraticProgram(double[][] q)
Method Detail |
---|
public Matrix getQ()
public void setQ(Matrix q)
public double evaluate(double[] x)
Problem
x
. The length of the array
must be the same as the value returned by getDimension
.
evaluate
in interface Problem
x
- input variable vector for the target function
x
public void setQ(double[][] q)
public boolean addConstraint(Constraint c)
public boolean isFeasable(double[] x)
ConstrainedProblem
x
.
isFeasable
will iterate over all constrains of an optimization problem
and check if all of them hold. isFeasable
will then return
true
, otherwise it will return false
.
The length of the array must be the same as the value returned by getDimension
.
isFeasable
in interface ConstrainedProblem
x
- input variable vector
true
if all constrains hold, false
otherwisepublic java.util.ArrayList<Constraint> getViolatedContraints(double[] x)
public int getDimension()
MathematicalProgram
getDimension
in interface Problem
getDimension
in class MathematicalProgram
public java.util.ArrayList<Constraint> getConstraints()
ConstrainedProblem
getConstraints
in interface ConstrainedProblem
public java.lang.String getName()
Problem
LinearProgram
class returns "Linear Program".
Please note, that this method will not return the actual name of a given instance. If you have two instances of linear programs, a method call will yield the same result. Therefore, two different linear programs cannot be distinguish via this method and must be kept apart somehow differently.
getName
in interface Problem
public boolean isMinProblem()
MathematicalProgram
isMinProblem
in interface Problem
isMinProblem
in class MathematicalProgram
true
, if the target function is to be minimized, otherwise
false
public void setMinProblem(boolean bool)
MathematicalProgram
setMinProblem
in interface Problem
setMinProblem
in class MathematicalProgram
bool
- true
, if the target function is to be minimized, otherwise
false
public static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |