public class ILPProblemImpl1 extends Object implements ILPProblem
Constructor and Description |
---|
ILPProblemImpl1(Vector cost,
LinearGreaterThanConstraints greater,
LinearLessThanConstraints less,
LinearEqualityConstraints equal,
BoxConstraints bounds,
int[] integers,
double epsilon)
Construct an ILP problem, in which the variables can be real or integral.
|
Modifier and Type | Method and Description |
---|---|
ImmutableMatrix |
A()
Get the coefficients, A, of the greater-than-or-equal-to constraints A * x ≥ b.
|
ImmutableMatrix |
Aeq()
Get the coefficients, Aeq, of the equality constraints Aeq * x ≥ beq.
|
ImmutableVector |
b()
Get the values, b, of the greater-than-or-equal-to constraints A * x ≥ b.
|
ImmutableVector |
beq()
Get the values, beq, of the equality constraints Aeq * x ≥ beq.
|
ImmutableVector |
c()
Get the objective function.
|
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.
|
LinearEqualityConstraints |
getEqualityConstraints()
Gets the equality constraints, hi(x) = 0
|
int[] |
getIntegerIndices()
Get the indices of the integral variables.
|
LinearLessThanConstraints |
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.
|
boolean |
isFree(int i)
Check whether xi is a free variable after handling the box constraints.
|
public ILPProblemImpl1(Vector cost, LinearGreaterThanConstraints greater, LinearLessThanConstraints less, LinearEqualityConstraints equal, BoxConstraints bounds, int[] integers, double epsilon)
cost
- the linear objective functiongreater
- the greater-than-or-equal-to constraintsless
- the less-than-or-equal-to constraintsequal
- the equality constraintsbounds
- the box constraintsintegers
- the indices of the integral variablesepsilon
- a precision parameter: when a number |x| ≤ ε, it is considered 0public double epsilon()
IPProblem
public int[] getIntegerIndices()
IPProblem
getIntegerIndices
in interface IPProblem
public int[] getNonIntegralIndices(double[] x)
IPProblem
getNonIntegralIndices
in interface IPProblem
x
- an argument to the objective functionint[]
of length 0 indicates that all integral variables in x are integers.public LinearLessThanConstraints getLessThanConstraints()
ConstrainedOptimProblem
getLessThanConstraints
in interface ConstrainedOptimProblem
public LinearEqualityConstraints getEqualityConstraints()
ConstrainedOptimProblem
getEqualityConstraints
in interface ConstrainedOptimProblem
public int dimension()
OptimProblem
dimension
in interface OptimProblem
public RealScalarFunction f()
OptimProblem
f
in interface OptimProblem
public ImmutableVector c()
LPProblem
public ImmutableMatrix A()
LPProblem
public ImmutableVector b()
LPProblem
public ImmutableMatrix Aeq()
LPProblem
public ImmutableVector beq()
LPProblem
Copyright © 2010-2020 NM FinTech Ltd.. All Rights Reserved.