choco.kernel.solver.constraints.integer.extension
Class CouplesBitSetTable

java.lang.Object
  extended by choco.kernel.solver.constraints.integer.extension.ConsistencyRelation
      extended by choco.kernel.solver.constraints.integer.extension.CouplesBitSetTable
All Implemented Interfaces:
BinRelation, ExtensionalBinRelation, Cloneable

public class CouplesBitSetTable
extends ConsistencyRelation
implements BinRelation, ExtensionalBinRelation


Field Summary
protected  int[] ns
           
protected  int[] offsets
          first value of x
protected  OpenBitSet[][] table
          table[0][i] gives the supports of value i of variable 0 table[1][i] gives the supports of value i of variable 1
 
Fields inherited from class choco.kernel.solver.constraints.integer.extension.ConsistencyRelation
feasible, LOGGER
 
Constructor Summary
CouplesBitSetTable()
           
CouplesBitSetTable(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.
 boolean checkValue(int var, int val, IBitSetIntDomain v)
          check is there exist a support for value val of variable var within the domain of v
 ConsistencyRelation getOpposite()
          compute the opposite relation by "reusing" the table of consistency
 OpenBitSet getSupport(int var, int val)
           
 boolean isConsistent(int x, int y)
          Test whether the couple (x,y) is consistent
 void setCouple(int x, int y)
          Set the couple (x,y) as consistent
 void setCoupleWithoutOffset(int x, int y)
           
 
Methods inherited from class choco.kernel.solver.constraints.integer.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 OpenBitSet[][] table
table[0][i] gives the supports of value i of variable 0 table[1][i] gives the supports of value i of variable 1


offsets

protected int[] offsets
first value of x


ns

protected int[] ns
Constructor Detail

CouplesBitSetTable

public CouplesBitSetTable()

CouplesBitSetTable

public CouplesBitSetTable(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)
Description copied from interface: ExtensionalBinRelation
Set the couple (x,y) as consistent

Specified by:
setCouple in interface ExtensionalBinRelation

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:

getSupport

public OpenBitSet getSupport(int var,
                             int val)

checkValue

public boolean checkValue(int var,
                          int val,
                          IBitSetIntDomain v)
check is there exist a support for value val of variable var within the domain of v

Parameters:
var -
val -
v -
Returns:


Copyright © 2012. All Rights Reserved.