|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectCOM.hugin.HAPI.Table
public class Table
Hugin uses Tables for representing the conditional probability and utility potentials of individual Nodes, the probability and utility potentials on separators and Cliques of JunctionTrees, evidence potentials, etc.
A potential is a function from the state space of a set of variables into the set of real numbers. A Table is a representation of a potential.
Method Summary | |
---|---|
double |
computeProbabilityOfInterval(double x,
double y)
Computes the probability of the given interval for the mixture distribution represented by this Table. |
void |
delete()
Deletes this Table. |
long |
getCGSize()
Returns the CG size of this Table. |
void |
getConfiguration(int[] configuration,
long index)
Computes the state configuration corresponding to a given table index. |
double |
getCovariance(long i,
ContinuousChanceNode node1,
ContinuousChanceNode node2)
Returns the covariance of a couple of ContinuousChanceNodes given a configuration of the discrete chance Nodes of this Table. |
double[] |
getData()
Returns an array containing a copy of the discrete data of this Table. |
void |
getData(double[] data,
long start,
int count)
Returns a region of the discrete data of this Table. |
double |
getDataItem(long index)
Returns the data item at position index of the
discrete data of this Table. |
long |
getIndex(int[] configuration)
Computes the table index corresponding to a given state configuration. |
double |
getMean(long i,
ContinuousChanceNode node)
Returns the mean of a ContinuousChanceNode given a configuration of the discrete chance Nodes of this Table. |
NodeList |
getNodes()
Returns a NodeList containing the Nodes associated with this Table. |
long |
getSize()
Returns the size of this Table. |
java.lang.Object |
getUserData()
Returns the value stored within the user data slot of this Table. |
double |
getVariance(long i,
ContinuousChanceNode node)
Returns the variance of a ContinuousChanceNode given a configuration of the discrete chance Nodes of this Table. |
boolean |
isAlive()
Is this Table object alive? |
void |
reorderNodes(NodeList nodes)
Reorders the list of Nodes of this Table. |
void |
setAllDataItems(double value)
Sets all data items of the discrete data of this Table. |
void |
setData(double[] data)
Sets the discrete data of this Table. |
void |
setData(double[] data,
long start,
int count)
Sets a region of the discrete data of this Table. |
void |
setDataItem(long index,
double value)
Sets a specific data item of the discrete data of this Table. |
void |
setUserData(java.lang.Object data)
Sets the user data field of this Table. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public void getConfiguration(int[] configuration, long index) throws ExceptionHugin
configuration
array: The state index for the k'th
node in the node list (see the getNodes()
method) of
this Table (if the node is discrete) is stored in the k'th
entry of the array. The length of the array must be greater
than or equal to the number of discrete nodes of this Table
(extra entries are ignored).
ExceptionHugin
public long getIndex(int[] configuration) throws ExceptionHugin
configuration
array: A state index for the k'th
node in the node list (see the getNodes()
method) of
this Table (if the node is discrete) must be specified in the
k'th entry of the array. The length of the array must be
greater than or equal to the number of discrete nodes of this
Table (extra entries are ignored).
ExceptionHugin
public double[] getData() throws ExceptionHugin
ExceptionHugin
public void getData(double[] data, long start, int count) throws ExceptionHugin
start
position and the
number of elements (count
) to copy. The data is
copied to the data
array. Note that since this is
a copy of the real data stored in the table, updates will only
take place when the data is copied back using the setData
method.
The indexes start
, ..., start+count-1
must be valid indexes of this table. Also, count
must be less than or equal to the size of the data
array.
data
- array to hold the extracted datastart
- index of the first element to copycount
- number of elements to copy
ExceptionHugin
public double getDataItem(long index) throws ExceptionHugin
index
of the
discrete data of this Table. The index is interpreted as the
index of a one-dimensional row-major representation of the
actual multi-dimensional data.
index
- the index of the data item
ExceptionHugin
public NodeList getNodes() throws ExceptionHugin
ExceptionHugin
public long getSize() throws ExceptionHugin
ExceptionHugin
public long getCGSize() throws ExceptionHugin
ExceptionHugin
public void setData(double[] data) throws ExceptionHugin
data
array are copied to the table. The size of
the array must equal the size of the table.
data
- array holding the data to copy to the table
ExceptionHugin
public void setData(double[] data, long start, int count) throws ExceptionHugin
start
position and the number of
elements (count
) to copy. The data is copied from
the data
array to the table.
The indexes start
, ..., start+count-1
must be valid indexes of this table. Also, count
must be less than or equal to the size of the data
array.
data
- array holding the data to copy to this tablestart
- index of the first element to be setcount
- number of elements to copy
ExceptionHugin
public void setDataItem(long index, double value) throws ExceptionHugin
index
- index of the data item to setvalue
- the new value of the data item at the specified index.
ExceptionHugin
public void setAllDataItems(double value) throws ExceptionHugin
value
- the new value of the data items.
ExceptionHugin
public double getVariance(long i, ContinuousChanceNode node) throws ExceptionHugin
i
- the index of the discrete configuration.node
- the ContinuousChanceNode in question.
ExceptionHugin
public double getMean(long i, ContinuousChanceNode node) throws ExceptionHugin
i
- the index of the discrete configuration.node
- the ContinuousChanceNode in question.
ExceptionHugin
public double getCovariance(long i, ContinuousChanceNode node1, ContinuousChanceNode node2) throws ExceptionHugin
i
- the index of the discrete configuration.node1
- one of the ContinuousChanceNodes in question.node2
- the other ContinuousChanceNode.
ExceptionHugin
public double computeProbabilityOfInterval(double x, double y) throws ExceptionHugin
getDistribution
).
x
- the left endpoint of the interval.y
- the right endpoint of the interval.
ExceptionHugin
public void reorderNodes(NodeList nodes) throws ExceptionHugin
nodes
- the new order (which must be a permutation of the
current order) of the Nodes of this Table.
ExceptionHugin
public void delete() throws ExceptionHugin
ExceptionHugin
public boolean isAlive()
public java.lang.Object getUserData()
public void setUserData(java.lang.Object data)
data
- User-defined data associated with this Table.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |