Class KLinComb


public class KLinComb extends KConstraint
This class creates a Sum(ai.Xi) { <= , != , == } C constraint

Example :

KIntVarArray X(...);
problem.post(2 * X[1] + 3 * X[2] + 5 * X[3] + ... + 7 * X[n] == 3);
//  or
problem.post(2 * X[1] + 3 * X[2] + 5 * X[3] + ... + 7 * X[n] <= 3);
//  or
problem.post(2 * X[1] + 3 * X[2] + 5 * X[3] + ... + 7 * X[n] >= 3);
//  or
problem.post(2 * X[1] + 3 * X[2] + 5 * X[3] + ... + 7 * X[n] != 3);


Since:
2016.1
See Also:
KConstraint

  • Constructor Details

    • KLinComb

      protected KLinComb(long cPtr, boolean cMemoryOwn)
    • KLinComb

      public KLinComb(String name, KIntArray coeffs, KIntVarArray vars, int cste, int linCombOperator)
      Primary Constructor
      Parameters:
      name - name of the constraint
      coeffs - array of coefficients for the variables in the linear combination
      vars - array of variables involved in the linear combination
      cste - constant in the linear combination
      linCombOperator - operator of the linear constraint {<>,<=,>=,==}
    • KLinComb

      public KLinComb(KLinComb toCopy)
      Copy Constructor
  • Method Details

    • getCPtr

      protected static long getCPtr(KLinComb obj)
    • finalize

      protected void finalize()
      Overrides:
      finalize in class KConstraint
    • delete

      public void delete()
      Overrides:
      delete in class KConstraint
    • getConstraintIPtr

      public com.artelys.kalis.SWIGTYPE_p_void getConstraintIPtr()