KIntVarMatrix

class KIntVarMatrix

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");

See

KIntArray

Since

2016.1

Public Functions

KIntVarMatrix(KProblem &problem, int N, int M, int lowerBound, int upperBound, const char *name = 0)

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

KIntVar *getPtr(int n, int m)

return a pointer to the KIntVar at position (n,m) in the matrix

KIntVar &getElt(int n, int m)

return the KIntVar at position (n,m) in the matrix

KIntVarArray &getRow(int m, KIntVarArray &row)

put all the variables with row index m into the “row” KIntVarArray

KIntVarArray &getCol(int n, KIntVarArray &col)

put all the variables with column index m into the “col” KIntVarArray

KIntVarArray &getAll(int n, KIntVarArray &all)

put all the variables in the matrix into the “all” KIntVarArray

void print(void) const

pretty printing of the matrix