📄 hist_05.cc
字号:
// 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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -