Class KIntVarMatrix


  • public class KIntVarMatrix
    extends java.lang.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 Summary

      Fields 
      Modifier and Type Field Description
      protected boolean swigCMemOwn  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected KIntVarMatrix​(long cPtr, boolean cMemoryOwn)  
        KIntVarMatrix​(KProblem problem, int N, int M, int lowerBound, int upperBound)
      default constructor
        KIntVarMatrix​(KProblem problem, int N, int M, int lowerBound, int upperBound, java.lang.String name)
      default constructor
    • Field Detail

      • swigCMemOwn

        protected transient boolean swigCMemOwn
    • Constructor Detail

      • KIntVarMatrix

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

        public KIntVarMatrix​(KProblem problem,
                             int N,
                             int M,
                             int lowerBound,
                             int upperBound,
                             java.lang.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 Detail

      • finalize

        protected void finalize()
        Overrides:
        finalize in class java.lang.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