choco.kernel.solver.variables.integer
Interface IntDomain

All Superinterfaces:
Domain, IPretty
All Known Implementing Classes:
AbstractIntDomain, BipartiteIntDomain, BitSetIntDomain, BooleanDomain, IntervalBTreeDomain, IntervalIntDomain, LinkedIntDomain

public interface IntDomain
extends Domain

An interface for all domains of search variables


Field Summary
static Logger LOGGER
           
 
Method Summary
 void clearDeltaDomain()
          cleans the data structure implementing the delta domain
 boolean contains(int x)
          Testing whether an search value is contained within the domain.
 IDeltaDomain copyDelta()
           
 int fastNextValue(int x)
          Accessing the smallest value stored in the domain and strictly greater than x, assuming x is greater or equal to the lower bound.
 int fastPrevValue(int x)
          Accessing the largest value stored in the domain and strictly smaller than x, assuming x is less or equal to the upper bound.
 void freezeDeltaDomain()
          The delta domain container is "frozen" (it can no longer accept new value removals) so that this set of values can be iterated as such
 DisposableIntIterator getDeltaIterator()
          Returns an getIterator over the set of values that have been removed from the domain since the last propagation
 int getInf()
          Access the minimal value stored in the domain.
 DisposableIntIterator getIterator()
          Retrieve an getIterator for traversing the sequence of values contained in the domain
 int getNextValue(int x)
          Accessing the smallest value stored in the domain and strictly greater than x.
 int getPrevValue(int x)
          Accessing the largest value stored in the domain and strictly smaller than x.
 int getRandomValue()
          Draws a value at random from the domain.
 boolean getReleasedDeltaDomain()
          checks whether the delta domain has indeed been released (ie: chechks that no domain updates are pending)
 int getSize()
          Access the total number of values stored in the domain.
 int getSup()
          Access the maximal value stored in the domain/
 boolean hasNextValue(int x)
          Testing whether there are values in the domain that are strictly greater than x.
 boolean hasPrevValue(int x)
          Testing whether there are values in the domain that are strictly smaller than x.
 boolean isBoolean()
          Is it a 0/1 domain ?
 boolean isEnumerated()
           
 boolean releaseDeltaDomain()
          after an iteration over the delta domain, the delta domain is reopened again.
 boolean remove(int x)
          Removing a single value from the domain.
 void restrict(int x)
          Restricting the domain to a singleton
 int updateInf(int x)
          Augment the minimal value stored in the domain.
 int updateSup(int x)
          Diminish the maximal value stored in the domain.
 
Methods inherited from interface choco.IPretty
pretty
 

Field Detail

LOGGER

static final Logger LOGGER
Method Detail

getIterator

DisposableIntIterator getIterator()
Retrieve an getIterator for traversing the sequence of values contained in the domain


getInf

int getInf()
Access the minimal value stored in the domain.


getSup

int getSup()
Access the maximal value stored in the domain/


updateInf

int updateInf(int x)
Augment the minimal value stored in the domain. returns the new lower bound (x or more, in case x was not in the domain)


updateSup

int updateSup(int x)
Diminish the maximal value stored in the domain. returns the new upper bound (x or more, in case x was not in the domain).


contains

boolean contains(int x)
Testing whether an search value is contained within the domain.


remove

boolean remove(int x)
Removing a single value from the domain.


restrict

void restrict(int x)
Restricting the domain to a singleton


getSize

int getSize()
Access the total number of values stored in the domain.


getNextValue

int getNextValue(int x)
Accessing the smallest value stored in the domain and strictly greater than x. Does not require x to be in the domain.

To iterate over the values in a IntDomain, use the following loop:

 int ub = dom.getSup();
 for (int val = dom.getInf(); val <= ub; val = dom.getNextValue(val)) {
     // operate on value 'val' here
 }


fastNextValue

int fastNextValue(int x)
Accessing the smallest value stored in the domain and strictly greater than x, assuming x is greater or equal to the lower bound.

To iterate over the values in a IntDomain, use the following loop:

 int ub = dom.getSup();
 for (int val = dom.getInf(); val <= ub; val = dom.fastNextValue(val)) {
     // operate on value 'val' here
 }


getPrevValue

int getPrevValue(int x)
Accessing the largest value stored in the domain and strictly smaller than x. Does not require x to be in the domain.

To iterate over the values in a IntDomain, use the following loop:

 int lb = dom.getInf();
 for (int val = dom.getSup(); val >= lb; val = dom.getPrevValue(val)) {
     // operate on value 'val' here
 }


fastPrevValue

int fastPrevValue(int x)
Accessing the largest value stored in the domain and strictly smaller than x, assuming x is less or equal to the upper bound.

To iterate over the values in a IntDomain, use the following loop:

 int lb = dom.getInf();
 for (int val = dom.getSup(); val >= lb; val = dom.fastPrevValue(val)) {
     // operate on value 'val' here
 }


hasNextValue

boolean hasNextValue(int x)
Testing whether there are values in the domain that are strictly greater than x. Does not require x to be in the domain.


hasPrevValue

boolean hasPrevValue(int x)
Testing whether there are values in the domain that are strictly smaller than x. Does not require x to be in the domain.


getRandomValue

int getRandomValue()
Draws a value at random from the domain.


getDeltaIterator

DisposableIntIterator getDeltaIterator()
Returns an getIterator over the set of values that have been removed from the domain since the last propagation


freezeDeltaDomain

void freezeDeltaDomain()
The delta domain container is "frozen" (it can no longer accept new value removals) so that this set of values can be iterated as such


releaseDeltaDomain

boolean releaseDeltaDomain()
after an iteration over the delta domain, the delta domain is reopened again.

Returns:
true iff the delta domain is reopened empty (no updates have been made to the domain while it was frozen, false iff the delta domain is reopened with pending value removals (updates were made to the domain, while the delta domain was frozen).

getReleasedDeltaDomain

boolean getReleasedDeltaDomain()
checks whether the delta domain has indeed been released (ie: chechks that no domain updates are pending)


clearDeltaDomain

void clearDeltaDomain()
cleans the data structure implementing the delta domain


isEnumerated

boolean isEnumerated()

isBoolean

boolean isBoolean()
Is it a 0/1 domain ?


copyDelta

IDeltaDomain copyDelta()


Copyright © 2012. All Rights Reserved.