|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectTableIndex
public class TableIndex
A class for mapping from variable instantiations to a linear index.
Nested Class Summary | |
---|---|
class |
TableIndex.Iterator
A class for stepping through the instantiations of an index. |
Constructor Summary | |
---|---|
TableIndex(Collection variables)
creates an index over the variables supplied. |
|
TableIndex(Object[] variables)
creates an index over the variables. |
|
TableIndex(TableIndex toCopy)
|
Method Summary | |
---|---|
int |
blockSize(FiniteVariable var)
Returns the change in index of incrementing the value of the dimension corresponding to var by 1 while holding all others constant. |
int |
blockSize(int i)
Returns the change in index of incrementing the value of the ith dimension by 1 while holding all others constant. |
int |
cardinality(int index)
|
Object |
clone()
|
boolean |
equals(Object obj)
|
int[] |
fill(Map mapInstantiations,
int[] mind)
|
TableIndex |
forget(Set variables)
Returns a new index formed by removing any dimensions whose associated with the variables contained in variables. |
int[] |
getDimensionIndices(Object[] variables)
Returns the dimensions that correspond to the given variables. |
int[] |
getDimensionIndices(TableIndex ind)
returns the dimensions that correspond to the variables in ind. |
FiniteVariable |
getJoint()
Returns the child variable. |
int |
getNumVariables()
|
FiniteVariable[] |
getParents()
Returns an array containing the variable associated with each dimension. |
HashSet |
getParentsSet()
|
int |
hashCode()
|
int |
index(int[] mind)
Converts the multidimensional index to the corresponding linear index. |
int |
index(Map mapInstantiations)
|
int |
index(Object[] instantiations)
|
int[] |
intoMapping(TableIndex ind2)
Returns an array where result[i] is the entry in this index that is compatible with the ith entry in ind2. |
TableIndex.Iterator |
iterator()
returns an iterator over the indices in the array. |
int[] |
mindex(int index,
int[] mind)
Converts the linear index to the corresponding multidimensional index. |
TableIndex |
multiply(TableIndex ind2)
Returns the Index which corresponds to basically the cartesian product of the two arrays. |
TableIndex |
project(Set variables)
Returns a new index formed from limiting the current index to the variables contained in variables. |
int[] |
shrinkMapping(TableIndex ind2,
Map inst)
Returns an array where result[i] is the entry in ind2 that is compatible with the ith entry of this index and is compatible with inst. |
int |
size()
returns the total number of elements that the index represents. |
FiniteVariable |
variable(int dim)
returns the variable index of the specified dimesion. |
int |
variableIndex(FiniteVariable fv)
Returns the position of the variable in the array. |
List |
variables()
|
Methods inherited from class Object |
---|
getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TableIndex(TableIndex toCopy)
public TableIndex(Collection variables)
public TableIndex(Object[] variables)
Method Detail |
---|
public Object clone()
clone
in class Object
public int cardinality(int index)
public List variables()
public int variableIndex(FiniteVariable fv)
public int blockSize(int i)
public int blockSize(FiniteVariable var)
public int getNumVariables()
public int size()
public int index(int[] mind)
public int[] fill(Map mapInstantiations, int[] mind)
public int index(Map mapInstantiations)
public int index(Object[] instantiations)
public int[] mindex(int index, int[] mind)
public TableIndex.Iterator iterator()
public FiniteVariable variable(int dim)
public FiniteVariable getJoint()
public int[] getDimensionIndices(Object[] variables)
public int[] getDimensionIndices(TableIndex ind)
public boolean equals(Object obj)
equals
in class Object
public int hashCode()
hashCode
in class Object
public FiniteVariable[] getParents()
public HashSet getParentsSet()
public TableIndex multiply(TableIndex ind2)
public TableIndex project(Set variables)
public TableIndex forget(Set variables)
public int[] intoMapping(TableIndex ind2)
public int[] shrinkMapping(TableIndex ind2, Map inst)
ind2
- The TableIndex to shrink frominst
- The mapping from variable to value for some subset
of the variables in ind2 that aren't in this.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |