Class KIntVarMatrix

java.lang.Object
com.artelys.kalis.KIntVarMatrix

public class KIntVarMatrix extends Object
This class implements an matrix of KIntVar

Example :

KProblem p(...);
// mat is a matrix of KIntVar of size (2, 3) with domain [0..10]
KIntVarMatrix  mat(p, 2, 3, 0, 10, "mat");


Since:
2016.1
See Also:
KIntArray

  • Field Details

    • swigCMemOwn

      protected transient boolean swigCMemOwn
  • Constructor Details

    • KIntVarMatrix

      protected KIntVarMatrix(long cPtr, boolean cMemoryOwn)
    • KIntVarMatrix

      public KIntVarMatrix(KProblem problem, int N, int M, int lowerBound, int upperBound, String name)
      default constructor
      Parameters:
      problem - the problem
      N - width of the matrix
      M - length of the matrix
      lowerBound - Lower bound for variables in the matrix
      upperBound - Upper bound for variables in the matrix
      name - name of the matrix
    • KIntVarMatrix

      public KIntVarMatrix(KProblem problem, int N, int M, int lowerBound, int upperBound)
      default constructor
      Parameters:
      problem - the problem
      N - width of the matrix
      M - length of the matrix
      lowerBound - Lower bound for variables in the matrix
      upperBound - Upper bound for variables in the matrix
  • Method Details

    • getCPtr

      protected static long getCPtr(KIntVarMatrix obj)
    • finalize

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

      public void delete()
    • getPtr

      public KIntVar getPtr(int n, int m)
      return a pointer to the KIntVar at position (n,m) in the matrix
    • getElt

      public KIntVar getElt(int n, int m)
      return the KIntVar at position (n,m) in the matrix
    • getRow

      public KIntVarArray getRow(int m, KIntVarArray row)
      put all the variables with row index m into the "row" KIntVarArray
    • getCol

      public KIntVarArray getCol(int n, KIntVarArray col)
      put all the variables with column index m into the "col" KIntVarArray
    • getAll

      public KIntVarArray getAll(int n, KIntVarArray all)
      put all the variables in the matrix into the "all" KIntVarArray
    • print

      public void print()
      pretty printing of the matrix