Class LPProblemImpl1
- java.lang.Object
-
- dev.nm.solver.multivariate.constrained.convex.sdp.socp.qp.lp.problem.LPProblemImpl1
-
- All Implemented Interfaces:
LPProblem,ConstrainedOptimProblem,OptimProblem
- Direct Known Subclasses:
LPCanonicalProblem1,LPCanonicalProblem2,LPStandardProblem
public class LPProblemImpl1 extends Object implements LPProblem
This is an implementation of a linear programming problem,LPProblem. For convenient construction, this implementation allows all forms of linear constraints:- greater-than-or-equal-to constraints: Agr * x ≥ bgr
- less-than-or-equal-to constraints: Ale * x ≤ ble
- equality constraints: Aeq * x = beq
- box constraints (bounds): l ≤ x ≤ u
-
-
Constructor Summary
Constructors Constructor 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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ImmutableMatrixA()Get the coefficients, A, of the greater-than-or-equal-to constraints A * x ≥ b.ImmutableMatrixAeq()Get the coefficients, Aeq, of the equality constraints Aeq * x ≥ beq.ImmutableVectorb()Get the values, b, of the greater-than-or-equal-to constraints A * x ≥ b.ImmutableVectorbeq()Get the values, beq, of the equality constraints Aeq * x ≥ beq.ImmutableVectorc()Get the objective function.intdimension()Get the number of variables.RealScalarFunctionf()Get the objective function.LinearEqualityConstraintsgetEqualityConstraints()Gets the equality constraints, hi(x) = 0LinearLessThanConstraintsgetLessThanConstraints()Gets the less-than-or-equal-to constraints, gi(x) ≤ 0booleanisFree(int i)Check whether xi is a free variable after handling the box constraints.intnEqualities()Get the number of equality constraints.intnGreaterThanInequalities()Get the number of greater-than-or-equal-to constraints.StringtoString()
-
-
-
Constructor Detail
-
LPProblemImpl1
public LPProblemImpl1(Vector cost, LinearGreaterThanConstraints greater, LinearLessThanConstraints less, LinearEqualityConstraints equal, BoxConstraints bounds)
Construct a general linear programming problem.- Parameters:
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 variables
-
LPProblemImpl1
public LPProblemImpl1(Vector cost, LinearGreaterThanConstraints greater, LinearEqualityConstraints equal)
Construct a general linear programming problem with only greater-than-or-equal-to and equality constraints.- Parameters:
cost- the objective functiongreater- the greater-than-or-equal-to inequality constraintsequal- the equality constraints
-
-
Method Detail
-
nGreaterThanInequalities
public int nGreaterThanInequalities()
Get the number of greater-than-or-equal-to constraints.- Returns:
- the number of greater-than-or-equal-to inequalities
-
nEqualities
public int nEqualities()
Get the number of equality constraints.- Returns:
- the number of equality constraints
-
dimension
public int dimension()
Description copied from interface:OptimProblemGet the number of variables.- Specified by:
dimensionin interfaceOptimProblem- Returns:
- the number of variables.
-
f
public RealScalarFunction f()
Description copied from interface:OptimProblemGet the objective function.- Specified by:
fin interfaceOptimProblem- Returns:
- the objective function
-
getLessThanConstraints
public LinearLessThanConstraints getLessThanConstraints()
Description copied from interface:ConstrainedOptimProblemGets the less-than-or-equal-to constraints, gi(x) ≤ 0- Specified by:
getLessThanConstraintsin interfaceConstrainedOptimProblem- Returns:
- the less-than-or-equal-to constraints
-
getEqualityConstraints
public LinearEqualityConstraints getEqualityConstraints()
Description copied from interface:ConstrainedOptimProblemGets the equality constraints, hi(x) = 0- Specified by:
getEqualityConstraintsin interfaceConstrainedOptimProblem- Returns:
- the equality constraints
-
c
public ImmutableVector c()
Description copied from interface:LPProblemGet the objective function.
-
A
public ImmutableMatrix A()
Description copied from interface:LPProblemGet the coefficients, A, of the greater-than-or-equal-to constraints A * x ≥ b.
-
b
public ImmutableVector b()
Description copied from interface:LPProblemGet the values, b, of the greater-than-or-equal-to constraints A * x ≥ b.
-
Aeq
public ImmutableMatrix Aeq()
Description copied from interface:LPProblemGet the coefficients, Aeq, of the equality constraints Aeq * x ≥ beq.
-
beq
public ImmutableVector beq()
Description copied from interface:LPProblemGet the values, beq, of the equality constraints Aeq * x ≥ beq.
-
isFree
public boolean isFree(int i)
Description copied from interface:LPProblemCheck whether xi is a free variable after handling the box constraints.
-
-