public class IPProblemImpl1 extends Object implements IPProblem
| Constructor and Description |
|---|
IPProblemImpl1(RealScalarFunction f,
EqualityConstraints equal,
LessThanConstraints less,
int[] integers)
Construct a constrained optimization problem with integral constraints.
|
IPProblemImpl1(RealScalarFunction f,
EqualityConstraints equal,
LessThanConstraints less,
int[] integers,
double epsilon)
Construct a constrained optimization problem with integral constraints.
|
| Modifier and Type | Method and Description |
|---|---|
int |
dimension()
Get the number of variables.
|
double |
epsilon()
Get the threshold to check whether a variable is an integer.
|
RealScalarFunction |
f()
Get the objective function.
|
EqualityConstraints |
getEqualityConstraints()
Gets the equality constraints, hi(x) = 0
|
int |
getFirstNonIntegralIndices(double[] x)
Get the index of the first integral variable whose value is not an integer, violating the integral constraints.
|
int[] |
getIntegerIndices()
Get the indices of the integral variables.
|
LessThanConstraints |
getLessThanConstraints()
Gets the less-than-or-equal-to constraints, gi(x) ≤
0
|
int[] |
getNonIntegralIndices(double[] x)
Check which elements in x do not satisfy the integral constraints.
|
public IPProblemImpl1(RealScalarFunction f, EqualityConstraints equal, LessThanConstraints less, int[] integers, double epsilon)
f - the objective function to be minimizedequal - the set of equality constraints; Use null if the set is empty.less - the set of less-than-or-equal-to inequality constraints; Use null if the set is empty.integers - the set of indices of the integral variables, counting from 1epsilon - a precision parameter: when a number |x| ≤ ε, it is considered 0public IPProblemImpl1(RealScalarFunction f, EqualityConstraints equal, LessThanConstraints less, int[] integers)
f - the objective function to be minimizedequal - the set of equality constraints; Use null if the set is empty.less - the set of less-than-or-equal-to inequality constraints; Use null if the set is empty.integers - the set of indices of the integral variables, counting from 1public int[] getIntegerIndices()
IPProblemgetIntegerIndices in interface IPProblempublic int[] getNonIntegralIndices(double[] x)
IPProblemgetNonIntegralIndices in interface IPProblemx - an argument to the objective functionint[] of length 0 indicates that all integral variables in x are integers.public int getFirstNonIntegralIndices(double[] x)
x - an argument to the objective functionpublic double epsilon()
IPProblempublic LessThanConstraints getLessThanConstraints()
ConstrainedOptimProblemgetLessThanConstraints in interface ConstrainedOptimProblempublic EqualityConstraints getEqualityConstraints()
ConstrainedOptimProblemgetEqualityConstraints in interface ConstrainedOptimProblempublic int dimension()
OptimProblemdimension in interface OptimProblempublic RealScalarFunction f()
OptimProblemf in interface OptimProblemCopyright © 2010-2020 NM FinTech Ltd.. All Rights Reserved.