Classes | Public Types | Public Member Functions | Static Public Attributes

fst::PdtShortestPathData< Arc > Class Template Reference

#include <fst/extensions/pdt/shortest-path.h>

Collaboration diagram for fst::PdtShortestPathData< Arc >:
Collaboration graph
[legend]

List of all members.

Classes

struct  ParenHash
 Hash for paren map.
struct  ParenSpec
struct  SearchData
struct  SearchState
struct  SearchStateHash
 Hash for search state.

Public Types

typedef Arc::StateId StateId
typedef Arc::Weight Weight
typedef Arc::Label Label

Public Member Functions

 PdtShortestPathData (bool gc)
 ~PdtShortestPathData ()
void Clear ()
Weight Distance (SearchState s) const
Weight Distance (const ParenSpec &paren) const
SearchState Parent (SearchState s) const
SearchState Parent (const ParenSpec &paren) const
Label ParenId (SearchState s) const
uint8 Flags (SearchState s) const
void SetDistance (SearchState s, Weight w)
void SetDistance (const ParenSpec &paren, Weight w)
void SetParent (SearchState s, SearchState p)
void SetParent (const ParenSpec &paren, SearchState p)
void SetParenId (SearchState s, Label p)
void SetFlags (SearchState s, uint8 f, uint8 mask)
void GC (StateId s)

Static Public Attributes

static const uint8 kFinal = 0x02

Detailed Description

template<class Arc>
class fst::PdtShortestPathData< Arc >

Class to store PDT shortest path results. Stores shortest path tree info 'Distance()', Parent(), and ArcParent() information keyed on two types: (1) By SearchState: This is a usual node in a shortest path tree but: (a) is w.r.t a PDT search state - a pair of a PDT state and a 'start' state, which is either the PDT start state or the destination state of an open parenthesis. (b) the Distance() is from this 'start' state to the search state. (c) Parent().state is kNoLabel for the 'start' state.

(2) By ParenSpec: This connects shortest path trees depending on the the parenthesis taken. Given the parenthesis spec: (a) the Distance() is from the Parent() 'start' state to the parenthesis destination state. (b) the ArcParent() is the parenthesis arc.

Definition at line 65 of file shortest-path.h.


Member Typedef Documentation

template<class Arc >
typedef Arc::Label fst::PdtShortestPathData< Arc >::Label

Definition at line 71 of file shortest-path.h.

template<class Arc >
typedef Arc::StateId fst::PdtShortestPathData< Arc >::StateId

Definition at line 69 of file shortest-path.h.

template<class Arc >
typedef Arc::Weight fst::PdtShortestPathData< Arc >::Weight

Definition at line 70 of file shortest-path.h.


Constructor & Destructor Documentation

template<class Arc >
fst::PdtShortestPathData< Arc >::PdtShortestPathData ( bool  gc  )  [inline]

Definition at line 123 of file shortest-path.h.

template<class Arc >
fst::PdtShortestPathData< Arc >::~PdtShortestPathData (  )  [inline]

Definition at line 130 of file shortest-path.h.


Member Function Documentation

template<class Arc >
void fst::PdtShortestPathData< Arc >::Clear (  )  [inline]

Definition at line 137 of file shortest-path.h.

template<class Arc >
Weight fst::PdtShortestPathData< Arc >::Distance ( SearchState  s  )  const [inline]

Definition at line 146 of file shortest-path.h.

template<class Arc >
Weight fst::PdtShortestPathData< Arc >::Distance ( const ParenSpec paren  )  const [inline]

Definition at line 151 of file shortest-path.h.

template<class Arc >
uint8 fst::PdtShortestPathData< Arc >::Flags ( SearchState  s  )  const [inline]

Definition at line 171 of file shortest-path.h.

template<class Arc >
void fst::PdtShortestPathData< Arc >::GC ( StateId  start  ) 

Deletes inaccessible search data from a given 'start' (open paren dest) state. Assumes 'final' (close paren source or PDT final) states have been flagged 'kFinal'.

Definition at line 278 of file shortest-path.h.

template<class Arc >
Label fst::PdtShortestPathData< Arc >::ParenId ( SearchState  s  )  const [inline]

Definition at line 166 of file shortest-path.h.

template<class Arc >
SearchState fst::PdtShortestPathData< Arc >::Parent ( SearchState  s  )  const [inline]

Definition at line 156 of file shortest-path.h.

template<class Arc >
SearchState fst::PdtShortestPathData< Arc >::Parent ( const ParenSpec paren  )  const [inline]

Definition at line 161 of file shortest-path.h.

template<class Arc >
void fst::PdtShortestPathData< Arc >::SetDistance ( SearchState  s,
Weight  w 
) [inline]

Definition at line 176 of file shortest-path.h.

template<class Arc >
void fst::PdtShortestPathData< Arc >::SetDistance ( const ParenSpec paren,
Weight  w 
) [inline]

Definition at line 181 of file shortest-path.h.

template<class Arc >
void fst::PdtShortestPathData< Arc >::SetFlags ( SearchState  s,
uint8  f,
uint8  mask 
) [inline]

Definition at line 202 of file shortest-path.h.

template<class Arc >
void fst::PdtShortestPathData< Arc >::SetParenId ( SearchState  s,
Label  p 
) [inline]

Definition at line 196 of file shortest-path.h.

template<class Arc >
void fst::PdtShortestPathData< Arc >::SetParent ( SearchState  s,
SearchState  p 
) [inline]

Definition at line 186 of file shortest-path.h.

template<class Arc >
void fst::PdtShortestPathData< Arc >::SetParent ( const ParenSpec paren,
SearchState  p 
) [inline]

Definition at line 191 of file shortest-path.h.


Member Data Documentation

template<class Arc >
const uint8 fst::PdtShortestPathData< Arc >::kFinal = 0x02 [static]

Definition at line 67 of file shortest-path.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines