Class Constraint


  • public final class Constraint
    extends Object
    This class allows you to build objects, each of which represents a constraint for a linear programming problem expressed in matrix notation
    Version:
    1.0
    Author:
    Stefano Scarioli
    See Also:
    SSC Software www.sscLab.org
    • Constructor Detail

      • Constraint

        public Constraint​(double[] Aj,
                          ConsType rel,
                          double rhs)
                   throws LPException
        Parameters:
        Aj - The LHS part of the j-th constraint of the problem
        rel - The type of constraint/relation (EQ, LE, GE, UPPER, LOWER, INT, BIN, SEMICONT)
        rhs - The RHS part of the constraint or coefficient bj
        Throws:
        LPException - If the constraint is not congruent
      • Constraint

        public Constraint​(double[] Aj,
                          ConsType rel,
                          double rhs,
                          String name)
                   throws LPException
        Parameters:
        Aj - The LHS part of the j-th constraint of the problem
        rel - The type of constraint/relation (EQ, LE, GE, UPPER, LOWER, INT, BIN, SEMICONT)
        rhs - The RHS part of the constraint or coefficient bj
        name - The name of the constraint
        Throws:
        LPException - If the constraint is not congruent
    • Method Detail

      • getAj

        public double[] getAj()
        Returns:
        The LHS part of the j-th constraint of the problem
      • getRel

        public ConsType getRel()
        Returns:
        The type of constraint (relation) defined (EQ, LE, GE)
      • getRhs

        public double getRhs()
        Returns:
        The RHS part of the constraint or coefficient bj
      • getName

        public String getName()
      • setName

        public void setName​(String name)