Class ILPProblemImpl1

    • Constructor Detail

      • ILPProblemImpl1

        public ILPProblemImpl1​(Vector cost,
                               LinearGreaterThanConstraints greater,
                               LinearLessThanConstraints less,
                               LinearEqualityConstraints equal,
                               BoxConstraints bounds,
                               int[] integers,
                               double epsilon)
        Construct an ILP problem, in which the variables can be real or integral.
        Parameters:
        cost - the linear objective function
        greater - the greater-than-or-equal-to constraints
        less - the less-than-or-equal-to constraints
        equal - the equality constraints
        bounds - the box constraints
        integers - the indices of the integral variables
        epsilon - a precision parameter: when a number |x| ≤ ε, it is considered 0
    • Method Detail

      • epsilon

        public double epsilon()
        Description copied from interface: IPProblem
        Get the threshold to check whether a variable is an integer.
        Specified by:
        epsilon in interface IPProblem
        Returns:
        the precision parameter: when a number |x| ≤ ε, it is considered 0
      • getIntegerIndices

        public int[] getIntegerIndices()
        Description copied from interface: IPProblem
        Get the indices of the integral variables.
        Specified by:
        getIntegerIndices in interface IPProblem
        Returns:
        the integral variable indices
      • getNonIntegralIndices

        public int[] getNonIntegralIndices​(double[] x)
        Description copied from interface: IPProblem
        Check which elements in x do not satisfy the integral constraints. The indices count from 1.
        Specified by:
        getNonIntegralIndices in interface IPProblem
        Parameters:
        x - an argument to the objective function
        Returns:
        the set of indices of values in x that do not satisfy the integral constraints. An int[] of length 0 indicates that all integral variables in x are integers.
      • dimension

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

        public ImmutableVector c()
        Description copied from interface: LPProblem
        Get the objective function.
        Specified by:
        c in interface LPProblem
        Returns:
        the objective function
      • A

        public ImmutableMatrix A()
        Description copied from interface: LPProblem
        Get the coefficients, A, of the greater-than-or-equal-to constraints A * x ≥ b.
        Specified by:
        A in interface LPProblem
        Returns:
        the coefficients of the greater-than-or-equal-to constraints
      • b

        public ImmutableVector b()
        Description copied from interface: LPProblem
        Get the values, b, of the greater-than-or-equal-to constraints A * x ≥ b.
        Specified by:
        b in interface LPProblem
        Returns:
        the values of the greater-than-or-equal-to constraints
      • Aeq

        public ImmutableMatrix Aeq()
        Description copied from interface: LPProblem
        Get the coefficients, Aeq, of the equality constraints Aeq * x ≥ beq.
        Specified by:
        Aeq in interface LPProblem
        Returns:
        the coefficients of the equality constraints
      • beq

        public ImmutableVector beq()
        Description copied from interface: LPProblem
        Get the values, beq, of the equality constraints Aeq * x ≥ beq.
        Specified by:
        beq in interface LPProblem
        Returns:
        the values of the equality constraints
      • isFree

        public boolean isFree​(int i)
        Description copied from interface: LPProblem
        Check whether xi is a free variable after handling the box constraints.
        Specified by:
        isFree in interface LPProblem
        Parameters:
        i - the index of a variable, counting from 1
        Returns:
        true if xi is free