Module org.maxicp

Class Sum

All Implemented Interfaces:
CPConstraint, ConcreteConstraint<ConcreteCPModel>

public class Sum extends AbstractCPConstraint
Sum Constraint
  • Constructor Details

    • Sum

      public Sum(CPIntVar[] x, CPIntVar 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(CPIntVar[] 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(CPIntVar[] 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