EventMapVectorHash Struct Reference

#include <event-map.h>

Public Member Functions

size_t operator() (const EventType &vec)
 
size_t operator() (const EventType *ptr)
 

Detailed Description

Definition at line 71 of file event-map.h.

Member Function Documentation

◆ operator()() [1/2]

size_t operator() ( const EventType vec)

Definition at line 264 of file event-map.cc.

References KALDI_ASSERT.

264  {
265  EventType::const_iterator iter = vec.begin(), end = vec.end();
266  size_t ans = 0;
267  const size_t kPrime1=47087, kPrime2=1321;
268  for (; iter != end; ++iter) {
269 #ifdef KALDI_PARANOID // Check names are distinct and increasing.
270  EventType::const_iterator iter2=iter; iter2++;
271  if (iter2 != end) { KALDI_ASSERT(iter->first < iter2->first); }
272 #endif
273  ans += iter->first + kPrime1*iter->second;
274  ans *= kPrime2;
275  }
276  return ans;
277 }
#define KALDI_ASSERT(cond)
Definition: kaldi-error.h:185

◆ operator()() [2/2]

size_t operator() ( const EventType ptr)
inline

Definition at line 74 of file event-map.h.

74 { return (*this)(*ptr); }

The documentation for this struct was generated from the following files: