ModErn Text Analysis
META Enumerates Textual Applications
Public Member Functions | Protected Attributes | List of all members
meta::sequence::trellis Class Reference

Basic trellis for holding score data for the forward/backward algorithm. More...

#include <trellis.h>

Inheritance diagram for meta::sequence::trellis:
meta::sequence::forward_trellis meta::sequence::viterbi_trellis

Public Member Functions

 trellis (uint64_t size, uint64_t labels)
 Constructs a new trellis with the given number of time steps and labels. More...
 
uint64_t size () const
 
void probability (uint64_t idx, const label_id &tag, double prob)
 Sets the value in the trellis for the given time step and label. More...
 
double probability (uint64_t idx, const label_id &tag) const
 Obtains the value in the trellis for the given time step and label. More...
 

Protected Attributes

util::dense_matrix< double > trellis_
 storage for the scores
 

Detailed Description

Basic trellis for holding score data for the forward/backward algorithm.

Constructor & Destructor Documentation

meta::sequence::trellis::trellis ( uint64_t  size,
uint64_t  labels 
)

Constructs a new trellis with the given number of time steps and labels.

Parameters
sizeThe number of time steps
labelsThe number of labels associated with each time step

Member Function Documentation

uint64_t meta::sequence::trellis::size ( ) const
Returns
The number of time steps in the trellis.
void meta::sequence::trellis::probability ( uint64_t  idx,
const label_id &  tag,
double  prob 
)

Sets the value in the trellis for the given time step and label.

Parameters
idxThe time step
tagThe label
probThe value to be set
double meta::sequence::trellis::probability ( uint64_t  idx,
const label_id &  tag 
) const

Obtains the value in the trellis for the given time step and label.

Parameters
idxThe time step
tagThe label
Returns
the value in the trellis at that location

The documentation for this class was generated from the following files: