public class LPProblemImpl1 extends Object implements LPProblem
LPProblem
.
For convenient construction, this implementation allows all forms of linear constraints:
Constructor and Description |
---|
LPProblemImpl1(Vector cost,
LinearGreaterThanConstraints greater,
LinearEqualityConstraints equal)
Construct a general linear programming problem with only greater-than-or-equal-to and
equality constraints.
|
LPProblemImpl1(Vector cost,
LinearGreaterThanConstraints greater,
LinearLessThanConstraints less,
LinearEqualityConstraints equal,
BoxConstraints bounds)
Construct a general linear programming problem.
|
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.
|
RealScalarFunction |
f()
Get the objective function.
|
LinearEqualityConstraints |
getEqualityConstraints()
Gets the equality constraints, hi(x) = 0
|
LinearLessThanConstraints |
getLessThanConstraints()
Gets the less-than-or-equal-to constraints, gi(x) ≤
0
|
boolean |
isFree(int i)
Check whether xi is a free variable after handling the box constraints.
|
int |
nEqualities()
Get the number of equality constraints.
|
int |
nGreaterThanInequalities()
Get the number of greater-than-or-equal-to constraints.
|
String |
toString() |
public LPProblemImpl1(Vector cost, LinearGreaterThanConstraints greater, LinearLessThanConstraints less, LinearEqualityConstraints equal, BoxConstraints bounds)
cost
- the objective functiongreater
- the greater-than-or-equal-to inequality constraintsless
- the less-than-or-equal-to inequality constraintsequal
- the equality constraintsbounds
- the bounds for variablespublic LPProblemImpl1(Vector cost, LinearGreaterThanConstraints greater, LinearEqualityConstraints equal)
cost
- the objective functiongreater
- the greater-than-or-equal-to inequality constraintsequal
- the equality constraintspublic int nGreaterThanInequalities()
public int nEqualities()
public int dimension()
OptimProblem
dimension
in interface OptimProblem
public RealScalarFunction f()
OptimProblem
f
in interface OptimProblem
public LinearLessThanConstraints getLessThanConstraints()
ConstrainedOptimProblem
getLessThanConstraints
in interface ConstrainedOptimProblem
public LinearEqualityConstraints getEqualityConstraints()
ConstrainedOptimProblem
getEqualityConstraints
in interface ConstrainedOptimProblem
public ImmutableVector c()
LPProblem
public ImmutableMatrix A()
LPProblem
public ImmutableVector b()
LPProblem
public ImmutableMatrix Aeq()
LPProblem
public ImmutableVector beq()
LPProblem
public boolean isFree(int i)
LPProblem
Copyright © 2010-2020 NM FinTech Ltd.. All Rights Reserved.