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 451 of file determinize-lattice-pruned.cc.

Constructor & Destructor Documentation

◆ SubsetEqual() [1/2]

SubsetEqual ( float  delta)
inline

◆ SubsetEqual() [2/2]

Member Function Documentation

◆ operator()()

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

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

References fst::ApproxEqual(), and KALDI_ASSERT.

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

Member Data Documentation

◆ delta_

float delta_

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


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