Class Sum

All Implemented Interfaces:
Constraint

public class Sum extends AbstractConstraint
Sum Constraint
  • Constructor Details

    • Sum

      public Sum(IntVar[] x, IntVar y)
      Creates a sum constraint.

      This constraint holds iff x[0]+x[1]+...+x[x.length-1] == y.

      Parameters:
      x - the non empty left hand side of the sum
      y - the right hand side of the sum
    • Sum

      public Sum(IntVar[] x, int y)
      Creates a sum constraint.

      This constraint holds iff x[0]+x[1]+...+x[x.length-1] == y.

      Parameters:
      x - the non empty left hand side of the sum
      y - the right hand side of the sum
    • Sum

      public Sum(IntVar[] x)
      Creates a sum constraint.

      This constraint holds iff x[0]+x[1]+...+x[x.length-1] == 0.

      Parameters:
      x - the non empty set of variables that should sum to zero
  • Method Details