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 ImmutableMatrixA()Get the constraint coefficients.ImmutableVectorb()Get the constraint values.static LinearConstraintsconcat(LinearConstraints... groups)Concatenate collections of linear constraints into one collection.intdimension()Get the number of variables.MatrixgetActiveConstraints(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.intsize()Get the number of constraints.StringtoString()
-
-
-
Method Detail
-
getConstraints
public List<RealScalarFunction> getConstraints()
Description copied from interface:ConstraintsGet the list of constraint functions.- Specified by:
getConstraintsin interfaceConstraints- Returns:
- the list of constraint functions
-
dimension
public int dimension()
Description copied from interface:ConstraintsGet the number of variables.- Specified by:
dimensionin interfaceConstraints- Returns:
- the number of variables
-
size
public int size()
Description copied from interface:ConstraintsGet the number of constraints.- Specified by:
sizein 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
-
-