LatticeDeterminizer< Weight, IntType >::SubsetEqual Class Reference
Collaboration diagram for LatticeDeterminizer< Weight, IntType >::SubsetEqual:

Public Member Functions

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

Public Attributes

float delta_
 

Detailed Description

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

Definition at line 593 of file determinize-lattice-inl.h.

Constructor & Destructor Documentation

◆ SubsetEqual() [1/2]

SubsetEqual ( float  delta)
inline

Definition at line 609 of file determinize-lattice-inl.h.

◆ SubsetEqual() [2/2]

SubsetEqual ( )
inline

Definition at line 610 of file determinize-lattice-inl.h.

Member Function Documentation

◆ operator()()

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

Definition at line 595 of file determinize-lattice-inl.h.

References fst::ApproxEqual().

595  {
596  size_t sz = s1->size();
597  assert(sz>=0);
598  if (sz != s2->size()) return false;
599  typename std::vector<Element>::const_iterator iter1 = s1->begin(),
600  iter1_end = s1->end(), iter2=s2->begin();
601  for (; iter1 < iter1_end; ++iter1, ++iter2) {
602  if (iter1->state != iter2->state ||
603  iter1->string != iter2->string ||
604  ! ApproxEqual(iter1->weight, iter2->weight, delta_)) return false;
605  }
606  return true;
607  }
bool ApproxEqual(const LatticeWeightTpl< FloatType > &w1, const LatticeWeightTpl< FloatType > &w2, float delta=kDelta)

Member Data Documentation

◆ delta_

float delta_

Definition at line 608 of file determinize-lattice-inl.h.


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