choco.integer.constraints.extension
Class TuplesTable

java.lang.Object
  extended by choco.integer.constraints.extension.ConsistencyRelation
      extended by choco.integer.constraints.extension.TuplesTable
All Implemented Interfaces:
LargeRelation, java.lang.Cloneable

public class TuplesTable
extends ConsistencyRelation
implements LargeRelation


Field Summary
protected  int[] blocks
          in order to speed up the computation of the index of a tuple in the table, blocks[i] stores the product of the size of variables j with j < i.
protected  int n
          the number of dimensions of the considered tuples
protected  int[] offsets
          offset (lower bound) of each variable
protected  int[] sizes
          domain size of each variable
protected  java.util.BitSet table
          The consistency matrix
 
Fields inherited from class choco.integer.constraints.extension.ConsistencyRelation
feasible
 
Constructor Summary
TuplesTable(boolean feas, int[] offsetTable, int[] sizesTable)
           
TuplesTable(int n)
           
 
Method Summary
 boolean checkTuple(int[] tuple)
          return true if tuple is feasible according to the definition of the relation. e.g if the relation is defined with infeasible tuples, it returns true if tuple is one of them.
 ConsistencyRelation getOpposite()
          return the opposite relation of itself
 boolean isConsistent(int[] tuple)
          Test whether a tuple is consistent
 void setCouple(int[] tuple)
           
 
Methods inherited from class choco.integer.constraints.extension.ConsistencyRelation
isDefinedByFeasability, switchToOppositeRelation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

n

protected int n
the number of dimensions of the considered tuples


table

protected java.util.BitSet table
The consistency matrix


offsets

protected int[] offsets
offset (lower bound) of each variable


sizes

protected int[] sizes
domain size of each variable


blocks

protected int[] blocks
in order to speed up the computation of the index of a tuple in the table, blocks[i] stores the product of the size of variables j with j < i.

Constructor Detail

TuplesTable

public TuplesTable(int n)

TuplesTable

public TuplesTable(boolean feas,
                   int[] offsetTable,
                   int[] sizesTable)
Method Detail

checkTuple

public boolean checkTuple(int[] tuple)
Description copied from interface: LargeRelation
return true if tuple is feasible according to the definition of the relation. e.g if the relation is defined with infeasible tuples, it returns true if tuple is one of them.

Specified by:
checkTuple in interface LargeRelation
Returns:

isConsistent

public boolean isConsistent(int[] tuple)
Description copied from interface: LargeRelation
Test whether a tuple is consistent

Specified by:
isConsistent in interface LargeRelation
Returns:
true if tuple is consistent.

setCouple

public void setCouple(int[] tuple)

getOpposite

public ConsistencyRelation getOpposite()
Description copied from class: ConsistencyRelation
return the opposite relation of itself

Specified by:
getOpposite in class ConsistencyRelation
Returns:
the opposite relation