|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.bddbddb.Relation
net.sf.bddbddb.BDDRelation
public class BDDRelation
An implementation of Relation that uses BDDs.
| Field Summary | |
|---|---|
static java.lang.String |
BDD_INPUT_SUFFIX
|
static java.lang.String |
BDD_OUTPUT_SUFFIX
|
protected java.util.List |
domains
List of BDDDomains that are used in this relation. |
protected net.sf.javabdd.BDD |
relation
Value of relation. |
static boolean |
SMART_LOAD
|
protected BDDSolver |
solver
Link to solver. |
protected byte |
special_type
|
static java.lang.String |
TUPLES_INPUT_SUFFIX
|
static java.lang.String |
TUPLES_OUTPUT_SUFFIX
|
| Fields inherited from class net.sf.bddbddb.Relation |
|---|
attributes, id, name, negated |
| Method Summary | |
|---|---|
static java.lang.String |
activeDomains(net.sf.javabdd.BDD r)
Return a string representation of the active domains of the given relation. |
boolean |
add(java.math.BigInteger[] tuple)
Adds the given tuple to this relation. |
boolean |
add(int a)
Add a single to this relation. |
boolean |
add(int a,
int b)
Add a double to this relation. |
boolean |
add(int a,
int b,
int c)
Add a triple to this relation. |
boolean |
contains(int k,
java.math.BigInteger j)
Returns true iff this relation contains a tuple where the kth field is value j. |
Relation |
copy()
Make a copy of this relation. |
double |
dsize()
Return the number of tuples in this relation, in double format. |
void |
free()
Free the memory associated with this relation. |
Attribute |
getAttribute(net.sf.javabdd.BDDDomain d)
Get the attribute that is assigned to the given BDDDomain. |
net.sf.javabdd.BDD |
getBDD()
Return the value of this relation in BDD form. |
net.sf.javabdd.BDDDomain |
getBDDDomain(Attribute a)
Get the BDDDomain that matches the given attribute, or null if the attribute hasn't been assigned one yet. |
net.sf.javabdd.BDDDomain |
getBDDDomain(int i)
Get the BDDDomain with the given index. |
java.util.List |
getBDDDomains()
Returns the list of BDD domains this relation is using. |
net.sf.javabdd.BDDVarSet |
getDomainSet()
|
BDDSolver |
getSolver()
Get the solver object. |
void |
initialize()
Initialize this relation. |
void |
initialize2()
Do more initialization. |
TupleIterator |
iterator()
Return an iterator over the tuples of this relation. |
TupleIterator |
iterator(java.math.BigInteger[] j)
Return an iterator over the tuples where the fields match the values in the given array. |
TupleIterator |
iterator(int k)
Return an iterator over the values in the kth field of the relation. |
TupleIterator |
iterator(int k,
java.math.BigInteger j)
Return an iterator over the tuples where the kth field has value j. |
void |
load()
Load this relation from disk in its native format. |
void |
load(java.lang.String filename)
Load this relation from the given file. |
void |
loadTuples()
Load the tuple form of this relation from disk. |
void |
loadTuples(java.lang.String filename)
Load this relation in tuple form from the given file. |
void |
save()
Save the current value of this relation to disk in its native format. |
static void |
save(BDDSolver solver,
java.lang.String filename,
net.sf.javabdd.BDD relation)
Save a BDD with a valid header. |
void |
save(java.lang.String filename)
Save the value of this relation to the given file. |
void |
saveTuples()
Save the current value of this relation to disk in tuple form. |
void |
saveTuples(java.lang.String filename)
Save the value of this relation in tuple form to the given file. |
void |
saveTuples(java.lang.String fileName,
net.sf.javabdd.BDD relation)
Save the given relation in tuple form to the given file. |
void |
setBDD(net.sf.javabdd.BDD b)
Set the value of this relation from the given BDD. |
void |
setDomainAssignment(java.util.List newdom)
Set the BDD domain assignment of this relation to the given one. |
java.lang.String |
verboseToString()
Returns a verbose representation of the relation |
boolean |
verify()
Verify that the domains for this BDD are correct. |
boolean |
verify(net.sf.javabdd.BDD r)
Verify that the domains for the given BDD match this relation. |
| Methods inherited from class net.sf.bddbddb.Relation |
|---|
elementsToString, fromXMLElement, getAttribNameMap, getAttribute, getAttribute, getAttributes, getConstraints, getNegated, hashCode, makeNegated, numberOfAttributes, setConstraints, size, toString, toXMLElement |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static java.lang.String BDD_INPUT_SUFFIX
public static java.lang.String BDD_OUTPUT_SUFFIX
public static java.lang.String TUPLES_INPUT_SUFFIX
public static java.lang.String TUPLES_OUTPUT_SUFFIX
protected BDDSolver solver
protected net.sf.javabdd.BDD relation
protected java.util.List domains
protected byte special_type
public static boolean SMART_LOAD
| Method Detail |
|---|
public void initialize()
Relation
initialize in class Relationpublic net.sf.javabdd.BDDVarSet getDomainSet()
public void initialize2()
public boolean verify()
public boolean verify(net.sf.javabdd.BDD r)
r - the given BDD
public void load()
throws java.io.IOException
Relation
load in class Relationjava.io.IOException
public void load(java.lang.String filename)
throws java.io.IOException
filename - the file to load
java.io.IOException
public void loadTuples()
throws java.io.IOException
Relation
loadTuples in class Relationjava.io.IOException
public void loadTuples(java.lang.String filename)
throws java.io.IOException
Relation
loadTuples in class Relationfilename - the file to load
java.io.IOException
public void save()
throws java.io.IOException
Relation
save in class Relationjava.io.IOException
public static void save(BDDSolver solver,
java.lang.String filename,
net.sf.javabdd.BDD relation)
throws java.io.IOException
solver - solver objectfilename - filename to save intorelation - BDD to save
java.io.IOException
public void save(java.lang.String filename)
throws java.io.IOException
filename - name of file to save
java.io.IOException
public void saveTuples()
throws java.io.IOException
Relation
saveTuples in class Relationjava.io.IOException
public void saveTuples(java.lang.String filename)
throws java.io.IOException
saveTuples in class Relationfilename - name of file to save
java.io.IOException
public void saveTuples(java.lang.String fileName,
net.sf.javabdd.BDD relation)
throws java.io.IOException
fileName - name of file to saverelation - value to save
java.io.IOExceptionpublic static java.lang.String activeDomains(net.sf.javabdd.BDD r)
r - relation to check
public double dsize()
Relation
dsize in class Relationpublic TupleIterator iterator()
Relation
iterator in class Relationpublic TupleIterator iterator(int k)
Relation
iterator in class Relationk - zero-based field number
public TupleIterator iterator(int k,
java.math.BigInteger j)
Relation
iterator in class Relationk - zero-based field numberj - value
public TupleIterator iterator(java.math.BigInteger[] j)
Relation
iterator in class Relationj - values
public boolean contains(int k,
java.math.BigInteger j)
Relation
contains in class Relationk - zero-based field numberj - value
public boolean add(int a)
a - first attribute
public boolean add(int a,
int b)
a - first attributeb - second attribute
public boolean add(int a,
int b,
int c)
a - first attributeb - second attributec - third attribute
public boolean add(java.math.BigInteger[] tuple)
Relation
add in class Relationtuple - new tuple
public net.sf.javabdd.BDD getBDD()
public void setBDD(net.sf.javabdd.BDD b)
b - BDD value to set frompublic net.sf.javabdd.BDDDomain getBDDDomain(int i)
i - index
public net.sf.javabdd.BDDDomain getBDDDomain(Attribute a)
a - attribute
public Attribute getAttribute(net.sf.javabdd.BDDDomain d)
d - BDD domain
public java.util.List getBDDDomains()
public Relation copy()
Relation
copy in class Relationpublic void free()
Relation
free in class Relationpublic BDDSolver getSolver()
public void setDomainAssignment(java.util.List newdom)
newdom - new BDD domain assignmentpublic java.lang.String verboseToString()
Relation
verboseToString in class Relation
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||