ToPS
|
This is a context tree node. More...
#include <ContextTree.hpp>
Public Member Functions | |
ContextTreeNode (int alphabet_size) | |
ContextTreeNode () | |
Default constructor. | |
void | addCount (int s) |
Add a count to the symbol s. | |
void | addCount (int s, double w) |
Add a count w to the symbol s. | |
void | setCount (int s, double v) |
Add v to the counter to the symbol s. | |
std::vector< double > & | getCounter () |
get the counter | |
int | alphabet_size () |
Set the alphabet size. | |
void | setParent (int parent) |
Set the parent id. | |
int | getParent () |
Get the parent id;. | |
void | setId (int id) |
Set the id of the node. | |
void | setChild (ContextTreeNodePtr child, int symbol) |
set the child for a given symbol | |
int | symbol () |
get the symbol of the node | |
void | setSymbol (int symbol) |
get the symbol of the node | |
void | setDistribution (DiscreteIIDModelPtr distribution) |
set the distribution of this context | |
ContextTreeNodePtr | getChild (int symbol) |
get the child of a symbol | |
DiscreteIIDModelPtr | getDistribution () |
get the distribution of this context | |
void | deleteChildren () |
deletes the children of this contex | |
ContextTreeNodeVector | getChildren () |
Returns the children. | |
bool | isLeaf () |
returns true if this context node is a leaf |
This is a context tree node.
Definition at line 41 of file ContextTree.hpp.
tops::ContextTreeNode::ContextTreeNode | ( | int | alphabet_size | ) |
alphabet | is the alphabet to be used |
Definition at line 70 of file ContextTree.cpp.