CindexVectorHasher Struct Reference

#include <nnet-common.h>

Public Member Functions

size_t operator() (const std::vector< Cindex > &cindex_vector) const noexcept
 

Detailed Description

Definition at line 125 of file nnet-common.h.

Member Function Documentation

◆ operator()()

size_t operator() ( const std::vector< Cindex > &  cindex_vector) const
noexcept

Definition at line 376 of file nnet-common.cc.

377  {
378  // this is an arbitrarily chosen prime.
379  size_t kPrime = 23539, ans = 0;
380  std::vector<Cindex>::const_iterator iter = cindex_vector.begin(),
381  end = cindex_vector.end();
382  CindexHasher cindex_hasher;
383  for (; iter != end; ++iter)
384  ans = cindex_hasher(*iter) + kPrime * ans;
385  return ans;
386 }

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