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. More...
Public Member Functions | |
size_t | getCGSize () const |
Return the CG size of this Table. | |
void | getConfiguration (std::vector< size_t > &configuration, size_t index) const |
Compute the state configuration corresponding to a given table index. | |
double | getCovariance (size_t index, const ContinuousChanceNode *node1, const ContinuousChanceNode *node2) const |
Return the covariance of the specified nodes. | |
void | getData (NumberList &data, size_t start, size_t count) const |
Return a region of the discrete data of this Table. | |
NumberList | getData () const |
Return a vector containing a copy of the discrete data of this Table. | |
size_t | getIndex (const std::vector< size_t > &configuration) const |
Compute the table index corresponding to a given state configuration. | |
double | getMean (size_t index, const ContinuousChanceNode *node) const |
Return the mean of the specified node. | |
NodeList | getNodes () const |
Return the nodes of this Table. | |
size_t | getSize () const |
Return the size of this table. | |
double | getVariance (size_t index, const ContinuousChanceNode *node) const |
Return the variance of the specified node. | |
void | reorderNodes (const NodeList &order) |
Reorder the node list of this table to follow the order of the members in the NodeList. | |
void | setData (const NumberList &data, size_t start, size_t count) |
Set a region of the discrete data of this Table. | |
void | setData (const NumberList &data) |
Set the discrete data of this Table. | |
~Table () throw () | |
Release the memory resources used by the application-owned Table object. |
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.
size_t HAPI::Table::getCGSize | ( | ) | const |
Return the CG size of this Table.
This is the number of CG data elements stored in the table.
void HAPI::Table::getConfiguration | ( | std::vector< size_t > & | configuration, | |
size_t | index | |||
) | const |
Compute the state configuration corresponding to a given table index.
The computed state configuration is stored in the configuration
vector: 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 vector. The size of the vector must be greater than or equal to the number of discrete nodes of this table (extra entries are ignored).
double HAPI::Table::getCovariance | ( | size_t | index, | |
const ContinuousChanceNode * | node1, | |||
const ContinuousChanceNode * | node2 | |||
) | const |
Return the covariance of the specified nodes.
The covariance of the continuous nodes node1
and node2
given the discrete state configuration index
is returned.
void HAPI::Table::getData | ( | NumberList & | data, | |
size_t | start, | |||
size_t | count | |||
) | const |
Return a region of the discrete data of this Table.
The region is specified by a start
position and the number of elements (count
) to copy. The data is copied to the data
vector. 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
vector.
data | vector to hold the extracted data | |
start | index of the first element to copy | |
count | number of elements to copy |
NumberList HAPI::Table::getData | ( | ) | const |
Return a vector containing a copy of the discrete data of this Table.
The vector is a row-major representation of the actual multi-dimensional data. Note that this is a copy of the real data stored in the table. To update the table, the modified data must be copied back using the setData method.
size_t HAPI::Table::getIndex | ( | const std::vector< size_t > & | configuration | ) | const |
Compute the table index corresponding to a given state configuration.
The state configuration is specified in the configuration
vector: 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 vector. The size of the vector must be greater than or equal to the number of discrete nodes of this table (extra entries are ignored).
double HAPI::Table::getMean | ( | size_t | index, | |
const ContinuousChanceNode * | node | |||
) | const |
Return the mean of the specified node.
The mean of the continuous node node
given the discrete state configuration index
is returned.
NodeList HAPI::Table::getNodes | ( | ) | const |
Return the nodes of this Table.
double HAPI::Table::getVariance | ( | size_t | index, | |
const ContinuousChanceNode * | node | |||
) | const |
Return the variance of the specified node.
The variance of the continuous node node
given the discrete state configuration index
is returned.
void HAPI::Table::reorderNodes | ( | const NodeList & | order | ) |
Reorder the node list of this table to follow the order of the members in the NodeList.
order
must be a permutation of the node list of this table.
void HAPI::Table::setData | ( | const NumberList & | data, | |
size_t | start, | |||
size_t | count | |||
) |
Set a region of the discrete data of this Table.
The region is specified by a start
position and the number of elements (count
) to copy. The data is copied from the data
vector 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
vector.
data | vector holding the data to copy to this table | |
start | index of the first element to be set | |
count | number of elements to copy |
void HAPI::Table::setData | ( | const NumberList & | data | ) |
Set the discrete data of this Table.
The contents of the data
vector are copied to the table. The size of the vector must equal the size of the table.
data | vector holding the data to copy to the table |