⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tintparamhashmap.java

📁 最大熵分类器
💻 JAVA
字号:
package opennlp.maxent;import gnu.trove.TIntDoubleHashMap;/** * Data structure for storing a models parameters for each outcome associated with a specific context.  */public class TIntParamHashMap extends TIntDoubleHashMap {  public TIntParamHashMap() {    super();  }    public TIntParamHashMap(int initialCapacity) {    super(initialCapacity);  }    public TIntParamHashMap(int initialCapacity, float loadFactor) {    super(initialCapacity, loadFactor);  }    public double get(int key) {    int hash, probe, index, length;    int[] set;    byte[] states;    states = _states;    set = _set;    length = states.length;    hash = key & 0x7fffffff;    index = hash % length;    if (states[index] != FREE &&        (states[index] == REMOVED || set[index] != key)) {        // see Knuth, p. 529        probe = 1 + (hash % (length - 2));        do {            index -= probe;            if (index < 0) {                index += length;            }        } while (states[index] != FREE &&                 (states[index] == REMOVED || set[index] != key));    }    return states[index] == FREE ? 0d : _values[index];  }}

⌨️ 快捷键说明

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