Class LinearConstraints
- java.lang.Object
-
- dev.nm.solver.multivariate.constrained.constraint.linear.LinearConstraints
-
- All Implemented Interfaces:
Constraints
- Direct Known Subclasses:
LinearEqualityConstraints
,LinearGreaterThanConstraints
,LinearLessThanConstraints
public abstract class LinearConstraints extends Object implements Constraints
This is a collection of linear constraints for a real-valued optimization problem.
-
-
Constructor Summary
Constructors Constructor Description LinearConstraints(Matrix A, Vector b)
Construct a collection of linear constraints.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ImmutableMatrix
A()
Get the constraint coefficients.ImmutableVector
b()
Get the constraint values.static LinearConstraints
concat(LinearConstraints... groups)
Concatenate collections of linear constraints into one collection.int
dimension()
Get the number of variables.Matrix
getActiveConstraints(Vector x, double epsilon)
Get the active constraint.ArrayList<Integer>
getActiveRows(Vector x, double epsilon)
Get the active constraint indices.List<RealScalarFunction>
getConstraints()
Get the list of constraint functions.int
size()
Get the number of constraints.String
toString()
-
-
-
Method Detail
-
getConstraints
public List<RealScalarFunction> getConstraints()
Description copied from interface:Constraints
Get the list of constraint functions.- Specified by:
getConstraints
in interfaceConstraints
- Returns:
- the list of constraint functions
-
dimension
public int dimension()
Description copied from interface:Constraints
Get the number of variables.- Specified by:
dimension
in interfaceConstraints
- Returns:
- the number of variables
-
size
public int size()
Description copied from interface:Constraints
Get the number of constraints.- Specified by:
size
in interfaceConstraints
- Returns:
- the number of constraints
-
A
public ImmutableMatrix A()
Get the constraint coefficients.- Returns:
- the constraint coefficients
-
b
public ImmutableVector b()
Get the constraint values.- Returns:
- the constraint values
-
getActiveRows
public ArrayList<Integer> getActiveRows(Vector x, double epsilon)
Get the active constraint indices. The active constraints are those with a_i(x) = 0.- Parameters:
x
- a point or a potential solutionepsilon
- a precision parameter: when a number |x| ≤ ε, it is considered 0- Returns:
- the active (row) indices
-
getActiveConstraints
public Matrix getActiveConstraints(Vector x, double epsilon)
Get the active constraint. The active constraints are those with a_i(x) = 0.- Parameters:
x
- a point or a potential solutionepsilon
- a precision parameter: when a number |x| ≤ ε, it is considered 0- Returns:
- the active constraints
-
concat
public static LinearConstraints concat(LinearConstraints... groups)
Concatenate collections of linear constraints into one collection.- Parameters:
groups
- collections of linear constraints- Returns:
- a collection of linear constraints
-
-