Class KLinRel


  • public class KLinRel
    extends KRelation
    This class represents a linear relation (equality or inequality) between variables.

    Variables involved in the KLinRel object can be a mix of KNumVar and KAuxVar.
    • Constructor Detail

      • KLinRel

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

        public KLinRel​(KProblem problem)
        Constructor with a problem.
      • KLinRel

        public KLinRel​(KProblem problem,
                       java.lang.String name)
        Constructor with a problem and aname.
        Parameters:
        problem - problem to which the KLinRel object is related
        name - the name of the variable (used for printing)
      • KLinRel

        public KLinRel​(KLinRel arg0)
        Copy constructor.
    • Method Detail

      • getCPtr

        protected static long getCPtr​(KLinRel obj)
      • add

        public void add​(KNumVar var,
                        double coeff)
        Add a term (variable "times" coefficient) to the relation.

        Parameters:
        var - the variable involved
        coeff - its coefficient
      • add

        public void add​(KNumVar var)
        Add a term (variable "times" coefficient) to the relation.

        Parameters:
        var - the variable involved
      • add

        public void add​(KAuxVar var,
                        double coeff)
        Add a term (variable "times" coefficient) to the relation.

        Parameters:
        var - the variable involved
        coeff - its coefficient
      • add

        public void add​(KAuxVar var)
        Add a term (variable "times" coefficient) to the relation.

        Parameters:
        var - the variable involved
      • add

        public void add​(KLinRel relation)
        Add all the terms of the given relation (no reduction).

        Parameters:
        relation - the relation to add
      • assign

        public void assign​(KLinRel relation)
      • invert

        public void invert​(KLinRel relation)
      • mult

        public void mult​(KLinRel relation,
                         double real)
      • print

        public void print()
        Pretty-print the equation.
        Overrides:
        print in class KRelation
      • print

        public void print​(com.artelys.kalis.SWIGTYPE_p_void ctx,
                          com.artelys.kalis.SWIGTYPE_p_f_p_void_p_q_const__char__int pfp)
        Overrides:
        print in class KRelation
      • printStat

        public void printStat()
        Print statistics about the equation.
      • isSatisfied

        public boolean isSatisfied​(KHybridSolution sol)
        Is the linear relation satisfied for this instantiation ?

        Overrides:
        isSatisfied in class KRelation
        Parameters:
        sol - hybrid solution to check