All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
DeterminizerStar< F >::SubsetEqual Class Reference
Collaboration diagram for DeterminizerStar< F >::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 F>
class fst::DeterminizerStar< F >::SubsetEqual

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

Constructor & Destructor Documentation

SubsetEqual ( float  delta)
inline

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

SubsetEqual ( )
inline

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

Member Function Documentation

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

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

References fst::ApproxEqual(), and DeterminizerStar< F >::SubsetEqual::delta_.

307  {
308  size_t sz = s1->size();
309  assert(sz >= 0);
310  if (sz != s2->size()) return false;
311  typename 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

float delta_

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