DeterminizerStar< F >::SubsetEqual Class Reference
Collaboration diagram for DeterminizerStar< F >::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 F>
class fst::DeterminizerStar< F >::SubsetEqual

Definition at line 304 of file determinize-star-inl.h.

Constructor & Destructor Documentation

◆ SubsetEqual() [1/2]

SubsetEqual ( float  delta)
inline

Definition at line 322 of file determinize-star-inl.h.

◆ SubsetEqual() [2/2]

SubsetEqual ( )
inline

Definition at line 323 of file determinize-star-inl.h.

Member Function Documentation

◆ operator()()

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

Definition at line 306 of file determinize-star-inl.h.

References fst::ApproxEqual().

307  {
308  size_t sz = s1->size();
309  assert(sz >= 0);
310  if (sz != s2->size()) return false;
311  typename std::vector<Element>::const_iterator iter1 = s1->begin(),
312  iter1_end = s1->end(), iter2 = s2->begin();
313  for (; iter1 < iter1_end; ++iter1, ++iter2) {
314  if (iter1->state != iter2->state ||
315  iter1->string != iter2->string ||
316  ! ApproxEqual(iter1->weight, iter2->weight, delta_))
317  return false;
318  }
319  return true;
320  }
bool ApproxEqual(const LatticeWeightTpl< FloatType > &w1, const LatticeWeightTpl< FloatType > &w2, float delta=kDelta)

Member Data Documentation

◆ delta_

float delta_

Definition at line 321 of file determinize-star-inl.h.


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