public class Tuples extends Object
Constructor and Description |
---|
Tuples()
Create a list of tuples which represents all allowed tuples, i.e.
|
Tuples(boolean feasible)
Create a list of tuples which represents all allowed tuples if feasible=true
or a set of forbidden tuples if feasible=false
|
Tuples(int[][] values,
boolean feasible)
Create a list of tuples which represents all allowed tuples if feasible=true
or a set of forbidden tuples if feasible=false.
|
Modifier and Type | Method and Description |
---|---|
void |
add(int... tuple)
Add a new tuple to the set of tuples
|
void |
add(int[]... tuples)
Add a tuple set
|
boolean |
allowUniversalValue() |
ESat |
check(IntVar... vars)
Checks entailment of a table constraint over vars with this Tuples object
|
int[] |
get(int idx)
Return the idx^th tuple
|
int |
getStarValue() |
boolean |
isFeasible()
Return true if these are allowed tuples, false otherwise
|
int |
max(int idx)
Return the maximum value for the idx^th column among all tuples
|
int |
min(int idx)
Return the minimum value for the idx^th column among all tuples
|
int |
nbTuples()
Return the number of tuples stored
|
void |
setUniversalValue(int star)
One can allow the presence of universal values,
meaning that some variables can take any values from their domain.
|
void |
sort() |
int[][] |
toMatrix() |
String |
toString() |
protected final List<int[]> tuples
public Tuples(int[][] values, boolean feasible)
setUniversalValue(int)
,
meaning that some variables can take any values from their domain.values
- list of tuplesfeasible
- indicates whether the tuples are allowed or forbiddenpublic Tuples(boolean feasible)
feasible
- indicates whether the tuples are allowed or forbiddenpublic Tuples()
public void setUniversalValue(int star)
star
- the universal value that can appear in any tuple.public boolean allowUniversalValue()
public int getStarValue()
public ESat check(IntVar... vars)
vars
- set of integer variables to testpublic void add(int... tuple)
tuple
- a tuple.SolverException
- if the size of the tuple added does not correspond to a the previous ones (if any).public void add(int[]... tuples)
tuples
- tuple setpublic boolean isFeasible()
public int min(int idx)
idx
- idx of the columnpublic int max(int idx)
idx
- index of the columnpublic int nbTuples()
public int[] get(int idx)
public int[][] toMatrix()
public void sort()
Copyright © 2018. All rights reserved.