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 Details

    • KLinRel

      protected KLinRel(long cPtr, boolean cMemoryOwn)
    • KLinRel

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

      public KLinRel(KProblem problem, 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 Details

    • getCPtr

      protected static long getCPtr(KLinRel obj)
    • finalize

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

      public void delete()
      Overrides:
      delete in class KRelation
    • 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
    • clear

      public void clear()
      Overrides:
      clear in class KRelation