choco.integer.constraints.extension
Class CouplesTable

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

public class CouplesTable
extends ConsistencyRelation
implements BinRelation


Field Summary
protected  int n2
          size of the initial domain of x
protected  int offset1
          first value of x
protected  int offset2
          first value of y
protected  java.util.BitSet table
          matrix of consistency/inconsistency
 
Fields inherited from class choco.integer.constraints.extension.ConsistencyRelation
feasible
 
Constructor Summary
CouplesTable()
           
CouplesTable(boolean feas, int offset1, int offset2, int n1, int n2)
           
 
Method Summary
 boolean checkCouple(int x, int y)
          return true if couple (x,y) is feasible according to the definition of the relation. e.g if the relation is defined with infeasible tuples, it returns true if (x,y) is one of them.
 ConsistencyRelation getOpposite()
          compute the opposite relation by "reusing" the table of consistency
 boolean isConsistent(int x, int y)
          Test whether the couple (x,y) is consistent
 void setCouple(int x, int y)
           
 void setCoupleWithoutOffset(int x, int y)
           
 
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

table

protected java.util.BitSet table
matrix of consistency/inconsistency


offset1

protected int offset1
first value of x


offset2

protected int offset2
first value of y


n2

protected int n2
size of the initial domain of x

Constructor Detail

CouplesTable

public CouplesTable()

CouplesTable

public CouplesTable(boolean feas,
                    int offset1,
                    int offset2,
                    int n1,
                    int n2)
Method Detail

getOpposite

public ConsistencyRelation getOpposite()
compute the opposite relation by "reusing" the table of consistency

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

setCouple

public void setCouple(int x,
                      int y)

setCoupleWithoutOffset

public void setCoupleWithoutOffset(int x,
                                   int y)

isConsistent

public boolean isConsistent(int x,
                            int y)
Description copied from interface: BinRelation
Test whether the couple (x,y) is consistent

Specified by:
isConsistent in interface BinRelation
Returns:
true if (x,y) is a consistent couple

checkCouple

public boolean checkCouple(int x,
                           int y)
Description copied from interface: BinRelation
return true if couple (x,y) is feasible according to the definition of the relation. e.g if the relation is defined with infeasible tuples, it returns true if (x,y) is one of them.

Specified by:
checkCouple in interface BinRelation
Returns: