|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectCOM.hugin.HAPI.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 | |
void |
delete()
Deletes this Table. |
int |
getCGSize()
Returns the CG size of this Table. |
void |
getConfiguration(int[] configuration,
int index)
Computes the state configuration corresponding to a given table index. |
double |
getCovariance(int 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,
int start,
int count)
Returns a region of the discrete data of this Table. |
double |
getDataItem(int index)
Returns the data item at position index of the
discrete data of this Table. |
int |
getIndex(int[] configuration)
Computes the table index corresponding to a given state configuration. |
double |
getMean(int 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. |
int |
getSize()
Returns the size of this Table. |
double |
getVariance(int 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 |
setData(double[] data)
Sets the discrete data of this Table. |
void |
setData(double[] data,
int start,
int count)
Sets a region of the discrete data of this Table. |
void |
setDataItem(int index,
double value)
Sets a specific data item of the discrete data 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, int 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 int 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, int 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(int 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 int getSize() throws ExceptionHugin
ExceptionHugin
public int 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, int 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(int 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 double getVariance(int i, ContinuousChanceNode node) throws ExceptionHugin
i
- the index of the discrete configuration.node
- the ContinuousChanceNode in question.
ExceptionHugin
public double getMean(int i, ContinuousChanceNode node) throws ExceptionHugin
i
- the index of the discrete configuration.node
- the ContinuousChanceNode in question.
ExceptionHugin
public double getCovariance(int 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 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()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |