All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
LatticeDeterminizerPruned< Weight, IntType >::SubsetEqual Class Reference
Collaboration diagram for LatticeDeterminizerPruned< Weight, IntType >::SubsetEqual:

Public Member Functions

bool operator() (const vector< Element > *s1, const vector< Element > *s2) const
 
 SubsetEqual (float delta)
 
 SubsetEqual ()
 

Public Attributes

float delta_
 

Detailed Description

template<class Weight, class IntType>
class fst::LatticeDeterminizerPruned< Weight, IntType >::SubsetEqual

Definition at line 447 of file determinize-lattice-pruned.cc.

Constructor & Destructor Documentation

SubsetEqual ( float  delta)
inline

Member Function Documentation

bool operator() ( const vector< Element > *  s1,
const vector< Element > *  s2 
) const
inline

Definition at line 449 of file determinize-lattice-pruned.cc.

References fst::ApproxEqual(), and KALDI_ASSERT.

449  {
450  size_t sz = s1->size();
451  KALDI_ASSERT(sz>=0);
452  if (sz != s2->size()) return false;
453  typename vector<Element>::const_iterator iter1 = s1->begin(),
454  iter1_end = s1->end(), iter2=s2->begin();
455  for (; iter1 < iter1_end; ++iter1, ++iter2) {
456  if (iter1->state != iter2->state ||
457  iter1->string != iter2->string ||
458  ! ApproxEqual(iter1->weight, iter2->weight, delta_)) return false;
459  }
460  return true;
461  }
bool ApproxEqual(const LatticeWeightTpl< FloatType > &w1, const LatticeWeightTpl< FloatType > &w2, float delta=kDelta)
#define KALDI_ASSERT(cond)
Definition: kaldi-error.h:169

Member Data Documentation

float delta_

Definition at line 462 of file determinize-lattice-pruned.cc.


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