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 312 of file determinize-star-inl.h.

Constructor & Destructor Documentation

SubsetEqual ( float  delta)
inline

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

SubsetEqual ( )
inline

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

Member Function Documentation

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

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

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

315  {
316  size_t sz = s1->size();
317  assert(sz >= 0);
318  if (sz != s2->size()) return false;
319  typename vector<Element>::const_iterator iter1 = s1->begin(),
320  iter1_end = s1->end(), iter2 = s2->begin();
321  for (; iter1 < iter1_end; ++iter1, ++iter2) {
322  if (iter1->state != iter2->state ||
323  iter1->string != iter2->string ||
324  ! ApproxEqual(iter1->weight, iter2->weight, delta_))
325  return false;
326  }
327  return true;
328  }
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: