Package com.artelys.kalis
Class KIntVarMatrix
- java.lang.Object
-
- com.artelys.kalis.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 constructorKIntVarMatrix(KProblem problem, int N, int M, int lowerBound, int upperBound, java.lang.String name)
default constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
delete()
protected void
finalize()
KIntVarArray
getAll(int n, KIntVarArray all)
put all the variables in the matrix into the "all" KIntVarArrayKIntVarArray
getCol(int n, KIntVarArray col)
put all the variables with column index m into the "col" KIntVarArrayprotected static long
getCPtr(KIntVarMatrix obj)
KIntVar
getElt(int n, int m)
return the KIntVar at position (n,m) in the matrixKIntVar
getPtr(int n, int m)
return a pointer to the KIntVar at position (n,m) in the matrixKIntVarArray
getRow(int m, KIntVarArray row)
put all the variables with row index m into the "row" KIntVarArrayvoid
print()
pretty printing of the matrix
-
-
-
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 problemN
- width of the matrixM
- length of the matrixlowerBound
- Lower bound for variables in the matrixupperBound
- Upper bound for variables in the matrixname
- name of the matrix
-
KIntVarMatrix
public KIntVarMatrix(KProblem problem, int N, int M, int lowerBound, int upperBound)
default constructor- Parameters:
problem
- the problemN
- width of the matrixM
- length of the matrixlowerBound
- Lower bound for variables in the matrixupperBound
- Upper bound for variables in the matrix
-
-
Method Detail
-
getCPtr
protected static long getCPtr(KIntVarMatrix obj)
-
finalize
protected void finalize()
- Overrides:
finalize
in classjava.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
-
-