FrameData Class Reference

Struct for holding (active) cells at a frame in the DP chart. More...

#include <lab4_vit.H>

List of all members.

Public Member Functions

 FrameData (unsigned stateCnt)
 Ctor; initializes object to be empty.
void clear ()
 Clears object.
unsigned size () const
 Returns number of active cells.
bool empty () const
 Returns whether no active cells.
unsigned get_state_count () const
 Returns number of states in corresponding graph.
const FrameCellget_cell_by_state (unsigned stateIdx) const
 Returns cell corresponding to state with index stateIdx.
bool has_cell (unsigned stateIdx) const
 Returns whether cell exists for state stateIdx.
FrameCellinsert_cell (unsigned stateIdx)
 Returns cell for state stateIdx, creating it if absent.
const FrameCellget_cell_by_index (unsigned cellIdx) const
 Returns cell with index cellIdx, where cells are numbered in an arbitrary order.
unsigned get_state_by_index (unsigned idx) const
 Returns state index for idx-th active state, where states are numbered in no particular order.
void reset_iteration ()
 Prepares object for iterating through states in upward order.
int get_next_state ()
 Returns lowest-numbered state not yet iterated through, or -1 if no more active states.
void swap (FrameData &frmData)
 Swap operation.


Detailed Description

Struct for holding (active) cells at a frame in the DP chart.

Stores a list of cells of type FrameCell.

To find a cell and create it if it doesn't exist, use insert_cell(). To look up cells by state index, use get_cell_by_state() and has_cell().

To loop through all cells in increasing state order, use reset_iteration() and get_next_state().

To loop through all cells (in no particular order), use get_cell_by_index() (and size() to determine how many cells there are).


Constructor & Destructor Documentation

FrameData::FrameData ( unsigned  stateCnt  )  [inline]

Ctor; initializes object to be empty.

The argument stateCnt should be the number of states in the graph.


Member Function Documentation

void FrameData::clear (  )  [inline]

Clears object.

unsigned FrameData::size (  )  const [inline]

Returns number of active cells.

bool FrameData::empty (  )  const [inline]

Returns whether no active cells.

unsigned FrameData::get_state_count (  )  const [inline]

Returns number of states in corresponding graph.

const FrameCell& FrameData::get_cell_by_state ( unsigned  stateIdx  )  const [inline]

Returns cell corresponding to state with index stateIdx.

The cell must already exist. You can check whether a cell exists using has_cell().

bool FrameData::has_cell ( unsigned  stateIdx  )  const [inline]

Returns whether cell exists for state stateIdx.

FrameCell& FrameData::insert_cell ( unsigned  stateIdx  )  [inline]

Returns cell for state stateIdx, creating it if absent.

If called in the middle of looping through states (see reset_iteration(), get_next_state()), will be added into list of states not yet looped through.

const FrameCell& FrameData::get_cell_by_index ( unsigned  cellIdx  )  const [inline]

Returns cell with index cellIdx, where cells are numbered in an arbitrary order.

Cells are numbered upwards from 0. There is no easy way to recover the state index corresponding to a cell retrieved by this method. However, this method may be useful for computing pruning thresholds.

unsigned FrameData::get_state_by_index ( unsigned  idx  )  const [inline]

Returns state index for idx-th active state, where states are numbered in no particular order.

If any non-read-only methods are called, the numbering of states may change.

void FrameData::reset_iteration (  )  [inline]

Prepares object for iterating through states in upward order.

See get_next_state() to do actual iteration. Specifically, puts all active states in list of states not yet iterated through.

void FrameData::swap ( FrameData frmData  )  [inline]

Swap operation.


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

Generated on Thu Nov 5 09:26:30 2009 for asr_lib by  doxygen 1.5.5