Class LinearConstraints

    • Constructor Detail

      • LinearConstraints

        public LinearConstraints​(Matrix A,
                                 Vector b)
        Construct a collection of linear constraints.
        Parameters:
        A - the constraint coefficients
        b - the constraint values
    • Method Detail

      • dimension

        public int dimension()
        Description copied from interface: Constraints
        Get the number of variables.
        Specified by:
        dimension in interface Constraints
        Returns:
        the number of variables
      • size

        public int size()
        Description copied from interface: Constraints
        Get the number of constraints.
        Specified by:
        size in interface Constraints
        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 solution
        epsilon - 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 solution
        epsilon - 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