Class KNumLinComb


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

    Example :
    
    KNumVarArray 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 Detail

      • KNumLinComb

        protected KNumLinComb​(long cPtr,
                              boolean cMemoryOwn)
      • KNumLinComb

        public KNumLinComb​(java.lang.String name,
                           KDoubleArray coeffs,
                           KNumVarArray vars,
                           double 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 {<>,<=,>=,==}
      • KNumLinComb

        public KNumLinComb​(KNumLinComb toCopy)
        Copy Constructor
    • Method Detail

      • getCPtr

        protected static long getCPtr​(KNumLinComb obj)
      • getConstraintIPtr

        public com.artelys.kalis.SWIGTYPE_p_void getConstraintIPtr()