hist_05.cc

来自「这是一个从音频信号里提取特征参量的程序」· CC 代码 · 共 52 行

CC
52
字号
// file: $isip/class/search/History/hist_05.cc//// isip include files//#include "History.h"// method: hash//// arguments://   long capacity: (input) hash table capacity//// return: logical error status//// hash function for the hypothesis path class//long History::hash(long capacity_a) const {  // declare local variables  //  ulong hash_index = 0;  // when the history is empty return zero  //  if (isEmpty()) {    return hash_index;  }  // save the current state  //  const_cast<History *>(this)->setMark();    // loop over all elemenst in the stack  //  for (boolean more = const_cast<History *>(this)->gotoFirst();       more;       more = const_cast<History *>(this)->gotoNext()) {    ulong index = const_cast<History *>(this)->getCurr()->getHashIndex();        hash_index = (hash_index << 5) ^ (hash_index >> 27) ^ index;  }  // restore the saved state  //  const_cast<History *>(this)->gotoMark();      // return the hash index  //    return (hash_index % (capacity_a - 1));}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?