java.lang.Object
java.util.AbstractCollection
java.util.AbstractList
java.util.Vector
mlsub.typing.lowlevel.DomainVector
- All Implemented Interfaces:
- java.lang.Cloneable, java.util.Collection, java.lang.Iterable, java.util.List, java.util.RandomAccess, java.io.Serializable
- final class DomainVector
- extends java.util.Vector
A DomainVector maintains an upper approximation of the set of solutions of
a constraint. What is handled dynamically : constraints between rigid and
soft variables. Constraints between soft variables are handled in gfp().
RMK: only garbage indexes can have null domains
- Version:
- $OrigRevision: 1.9 $, $OrigDate: 1999/10/03 17:37:05 $
|
Field Summary |
(package private) int |
offset
|
(package private) int |
width
|
|
Method Summary |
int |
chooseDomain()
Choose a non-null, non-singleton, domain and return its index. |
int |
chooseDomain(BitVector set)
ditto but choose a domain whose index i is in set |
void |
clear(int x)
|
java.lang.Object |
clone()
Creates a new Vector with the same contents as this one. |
java.lang.String |
dump()
|
void |
exclude(int value)
|
void |
exclude(int x,
BitVector domain)
|
void |
extend()
|
Domain |
getDomain(int x)
|
void |
gfp(BitMatrix R,
BitMatrix Rt,
BitMatrix C,
BitMatrix Ct,
int[] strategy)
Reduce this domain vector to the greatest fixed-point of a constraint. |
private boolean |
gfpSweep(BitMatrix R,
BitMatrix C,
int[] strategy,
int dS,
int direction)
Fix-point computations |
(package private) void |
initGfpCardinals()
|
private boolean |
isGarbage(int x)
|
private boolean |
isValidSoft(int x)
|
void |
merge(int src,
int dest)
|
void |
move(int src,
int dest)
|
void |
reduce(int x,
boolean unit,
BitVector domain)
|
| Methods inherited from class java.util.Vector |
add, add, addAll, addAll, addElement, capacity, clear, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize |
offset
int offset
width
int width
DomainVector
public DomainVector(int offset,
int width)
DomainVector
public DomainVector(int offset,
int width,
int n)
getDomain
public Domain getDomain(int x)
isValidSoft
private boolean isValidSoft(int x)
isGarbage
private boolean isGarbage(int x)
clear
public void clear(int x)
reduce
public void reduce(int x,
boolean unit,
BitVector domain)
throws LowlevelUnsatisfiable
exclude
public void exclude(int x,
BitVector domain)
throws LowlevelUnsatisfiable
merge
public void merge(int src,
int dest)
throws LowlevelUnsatisfiable
exclude
public void exclude(int value)
throws LowlevelUnsatisfiable
move
public void move(int src,
int dest)
extend
public void extend()
clone
public java.lang.Object clone()
- Description copied from class:
java.util.Vector
- Creates a new Vector with the same contents as this one. The clone is
shallow; elements are not cloned.
gfpSweep
private boolean gfpSweep(BitMatrix R,
BitMatrix C,
int[] strategy,
int dS,
int direction)
throws LowlevelUnsatisfiable
- Fix-point computations
gfp
public void gfp(BitMatrix R,
BitMatrix Rt,
BitMatrix C,
BitMatrix Ct,
int[] strategy)
throws LowlevelUnsatisfiable
- Reduce this domain vector to the greatest fixed-point of a constraint.
initGfpCardinals
void initGfpCardinals()
chooseDomain
public int chooseDomain()
- Choose a non-null, non-singleton, domain and return its index. Return -1
if all the domains are instantiated.
chooseDomain
public int chooseDomain(BitVector set)
- ditto but choose a domain whose index i is in set
dump
public java.lang.String dump()