亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? tobjectfloathashmap.java

?? 常用機器學習算法,java編寫源代碼,內含常用分類算法,包括說明文檔
?? JAVA
字號:
///////////////////////////////////////////////////////////////////////////////// Copyright (c) 2001, Eric D. Friedman All Rights Reserved.//// This library is free software; you can redistribute it and/or// modify it under the terms of the GNU Lesser General Public// License as published by the Free Software Foundation; either// version 2.1 of the License, or (at your option) any later version.//// This library is distributed in the hope that it will be useful,// but WITHOUT ANY WARRANTY; without even the implied warranty of// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the// GNU General Public License for more details.//// You should have received a copy of the GNU Lesser General Public// License along with this program; if not, write to the Free Software// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.///////////////////////////////////////////////////////////////////////////////package gnu.trove;import java.io.IOException;import java.io.ObjectInputStream;import java.io.ObjectOutputStream;import java.io.Serializable;/** * An open addressed Map implementation for Object keys and float values. * * Created: Sun Nov  4 08:52:45 2001 * * @author Eric D. Friedman * @version $Id: TObjectFloatHashMap.java,v 1.1.1.1 2003/07/14 19:36:04 mccallum Exp $ */public class TObjectFloatHashMap extends TObjectHash implements Serializable {    /** the values of the map */    protected transient float[] _values;    /**     * Creates a new <code>TObjectFloatHashMap</code> instance with the default     * capacity and load factor.     */    public TObjectFloatHashMap() {        super();    }    /**     * Creates a new <code>TObjectFloatHashMap</code> instance with a prime     * capacity equal to or greater than <tt>initialCapacity</tt> and     * with the default load factor.     *     * @param initialCapacity an <code>int</code> value     */    public TObjectFloatHashMap(int initialCapacity) {        super(initialCapacity);    }    /**     * Creates a new <code>TObjectFloatHashMap</code> instance with a prime     * capacity equal to or greater than <tt>initialCapacity</tt> and     * with the specified load factor.     *     * @param initialCapacity an <code>int</code> value     * @param loadFactor a <code>float</code> value     */    public TObjectFloatHashMap(int initialCapacity, float loadFactor) {        super(initialCapacity, loadFactor);    }    /**     * Creates a new <code>TObjectFloatHashMap</code> instance with the default     * capacity and load factor.     * @param strategy used to compute hash codes and to compare keys.     */    public TObjectFloatHashMap(TObjectHashingStrategy strategy) {        super(strategy);    }    /**     * Creates a new <code>TObjectFloatHashMap</code> instance whose capacity     * is the next highest prime above <tt>initialCapacity + 1</tt>     * unless that value is already prime.     *     * @param initialCapacity an <code>int</code> value     * @param strategy used to compute hash codes and to compare keys.     */    public TObjectFloatHashMap(int initialCapacity, TObjectHashingStrategy strategy) {        super(initialCapacity, strategy);    }    /**     * Creates a new <code>TObjectFloatHashMap</code> instance with a prime     * value at or near the specified capacity and load factor.     *     * @param initialCapacity used to find a prime capacity for the table.     * @param loadFactor used to calculate the threshold over which     * rehashing takes place.     * @param strategy used to compute hash codes and to compare keys.     */    public TObjectFloatHashMap(int initialCapacity, float loadFactor, TObjectHashingStrategy strategy) {        super(initialCapacity, loadFactor, strategy);    }    /**     * @return an iterator over the entries in this map     */    public TObjectFloatIterator iterator() {        return new TObjectFloatIterator(this);    }    /**     * initializes the hashtable to a prime capacity which is at least     * <tt>initialCapacity + 1</tt>.       *     * @param initialCapacity an <code>int</code> value     * @return the actual capacity chosen     */    protected int setUp(int initialCapacity) {        int capacity;        capacity = super.setUp(initialCapacity);        _values = new float[capacity];        return capacity;    }    /**     * Inserts a key/value pair into the map.     *     * @param key an <code>Object</code> value     * @param value an <code>float</code> value     * @return the previous value associated with <tt>key</tt>,     * or null if none was found.     */    public float put(Object key, float value) {        float previous = (float)0;        int index = insertionIndex(key);        boolean isNewMapping = true;        if (index < 0) {            index = -index -1;            previous = _values[index];            isNewMapping = false;        }        Object oldKey = _set[index];        _set[index] = key;        _values[index] = value;        if (isNewMapping) {            postInsertHook(oldKey == null);        }        return previous;    }    /**     * rehashes the map to the new capacity.     *     * @param newCapacity an <code>int</code> value     */    protected void rehash(int newCapacity) {        int oldCapacity = _set.length;        Object oldKeys[] = _set;        float oldVals[] = _values;        _set = new Object[newCapacity];        _values = new float[newCapacity];        for (int i = oldCapacity; i-- > 0;) {          if(oldKeys[i] != null && oldKeys[i] != REMOVED) {                Object o = oldKeys[i];                int index = insertionIndex(o);                _set[index] = o;                _values[index] = oldVals[i];            }        }    }    /**     * retrieves the value for <tt>key</tt>     *     * @param key an <code>Object</code> value     * @return the value of <tt>key</tt> or null if no such mapping exists.     */    public float get(Object key) {        int index = index(key);        return index < 0 ? (float)0 : _values[index];    }    /**     * Empties the map.     *     */    public void clear() {        super.clear();        Object[] keys = _set;        float[] vals = _values;        for (int i = keys.length; i-- > 0;) {            keys[i] = null;            vals[i] = (float)0;        }    }    /**     * Deletes a key/value pair from the map.     *     * @param key an <code>Object</code> value     * @return an <code>float</code> value     */    public float remove(Object key) {        float prev = (float)0;        int index = index(key);        if (index >= 0) {            prev = _values[index];            removeAt(index);    // clear key,state; adjust size        }        return prev;    }    /**     * Compares this map with another map for equality of their stored     * entries.     *     * @param other an <code>Object</code> value     * @return a <code>boolean</code> value     */    public boolean equals(Object other) {        if (! (other instanceof TObjectFloatHashMap)) {            return false;        }        TObjectFloatHashMap that = (TObjectFloatHashMap)other;        if (that.size() != this.size()) {            return false;        }        return forEachEntry(new EqProcedure(that));    }    private static final class EqProcedure implements TObjectFloatProcedure {        private final TObjectFloatHashMap _otherMap;        EqProcedure(TObjectFloatHashMap otherMap) {            _otherMap = otherMap;        }        public final boolean execute(Object key, float value) {            int index = _otherMap.index(key);            if (index >= 0 && eq(value, _otherMap.get(key))) {                return true;            }            return false;        }        /**         * Compare two floats for equality.         */        private final boolean eq(float v1, float v2) {            return v1 == v2;        }    }    /**     * removes the mapping at <tt>index</tt> from the map.     *     * @param index an <code>int</code> value     */    protected void removeAt(int index) {        super.removeAt(index);  // clear key, state; adjust size        _values[index] = (float)0;    }    /**     * Returns the values of the map.     *     * @return a <code>Collection</code> value     */    public float[] getValues() {        float[] vals = new float[size()];        float[] v = _values;        Object[] keys = _set;        for (int i = v.length, j = 0; i-- > 0;) {          if (keys[i] != null && keys[i] != REMOVED) {            vals[j++] = v[i];          }        }        return vals;    }    /**     * returns the keys of the map.     *     * @return a <code>Set</code> value     */    public Object[] keys() {        Object[] keys = new Object[size()];        Object[] k = _set;        for (int i = k.length, j = 0; i-- > 0;) {          if (k[i] != null && k[i] != REMOVED) {            keys[j++] = k[i];          }        }        return keys;    }    /**     * checks for the presence of <tt>val</tt> in the values of the map.     *     * @param val an <code>float</code> value     * @return a <code>boolean</code> value     */    public boolean containsValue(float val) {        Object[] keys = _set;        float[] vals = _values;        for (int i = vals.length; i-- > 0;) {            if (keys[i] != null && keys[i] != REMOVED && val == vals[i]) {                return true;            }        }        return false;    }    /**     * checks for the present of <tt>key</tt> in the keys of the map.     *     * @param key an <code>Object</code> value     * @return a <code>boolean</code> value     */    public boolean containsKey(Object key) {        return contains(key);    }    /**     * Executes <tt>procedure</tt> for each key in the map.     *     * @param procedure a <code>TObjectProcedure</code> value     * @return false if the loop over the keys terminated because     * the procedure returned false for some key.     */    public boolean forEachKey(TObjectProcedure procedure) {        return forEach(procedure);    }    /**     * Executes <tt>procedure</tt> for each value in the map.     *     * @param procedure a <code>TFloatProcedure</code> value     * @return false if the loop over the values terminated because     * the procedure returned false for some value.     */    public boolean forEachValue(TFloatProcedure procedure) {        Object[] keys = _set;        float[] values = _values;        for (int i = values.length; i-- > 0;) {            if (keys[i] != null && keys[i] != REMOVED                && ! procedure.execute(values[i])) {                return false;            }        }        return true;    }    /**     * Executes <tt>procedure</tt> for each key/value entry in the     * map.     *     * @param procedure a <code>TOObjectFloatProcedure</code> value     * @return false if the loop over the entries terminated because     * the procedure returned false for some entry.     */    public boolean forEachEntry(TObjectFloatProcedure procedure) {        Object[] keys = _set;        float[] values = _values;        for (int i = keys.length; i-- > 0;) {            if (keys[i] != null                && keys[i] != REMOVED                && ! procedure.execute(keys[i],values[i])) {                return false;            }        }        return true;    }    /**     * Retains only those entries in the map for which the procedure     * returns a true value.     *     * @param procedure determines which entries to keep     * @return true if the map was modified.     */    public boolean retainEntries(TObjectFloatProcedure procedure) {        boolean modified = false;        Object[] keys = _set;        float[] values = _values;        for (int i = keys.length; i-- > 0;) {            if (keys[i] != null                && keys[i] != REMOVED                && ! procedure.execute(keys[i],values[i])) {                removeAt(i);                modified = true;            }        }        return modified;    }    /**     * Transform the values in this map using <tt>function</tt>.     *     * @param function a <code>TFloatFunction</code> value     */    public void transformValues(TFloatFunction function) {        Object[] keys = _set;        float[] values = _values;        for (int i = values.length; i-- > 0;) {            if (keys[i] != null && keys[i] != REMOVED) {                values[i] = function.execute(values[i]);            }        }    }    /**     * Increments the primitive value mapped to key by 1     *     * @param key the key of the value to increment     * @return true if a mapping was found and modified.     */    public boolean increment(Object key) {        return adjustValue(key, (float)1);    }    /**     * Adjusts the primitive value mapped to key.     *     * @param key the key of the value to increment     * @param amount the amount to adjust the value by.     * @return true if a mapping was found and modified.     */    public boolean adjustValue(Object key, float amount) {        int index = index(key);        if (index < 0) {            return false;        } else {            _values[index] += amount;            return true;        }    }    private void writeObject(ObjectOutputStream stream)        throws IOException {        stream.defaultWriteObject();        // number of entries        stream.writeInt(_size);        SerializationProcedure writeProcedure = new SerializationProcedure(stream);        if (! forEachEntry(writeProcedure)) {            throw writeProcedure.exception;        }    }    private void readObject(ObjectInputStream stream)        throws IOException, ClassNotFoundException {        stream.defaultReadObject();        int size = stream.readInt();        setUp(size);        while (size-- > 0) {            Object key = stream.readObject();            float val = stream.readFloat();            put(key, val);        }    }} // TObjectFloatHashMap

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
青青草97国产精品免费观看 | 欧美一区三区四区| 色8久久精品久久久久久蜜| 欧美日韩在线播放一区| 精品国精品国产尤物美女| 久久久一区二区三区| 国产精品天美传媒| 婷婷一区二区三区| 国产精品一区在线观看乱码| 91久久精品一区二区| 精品国产凹凸成av人网站| 国产精品国产三级国产aⅴ入口| 偷窥少妇高潮呻吟av久久免费| 国产成人av电影在线| 欧美日韩激情一区二区| 国产色产综合产在线视频| 天天综合天天做天天综合| 国产成人综合亚洲网站| 欧洲精品在线观看| 久久精品视频免费| 婷婷综合久久一区二区三区| 91在线观看污| 久久精品欧美日韩精品| 天天综合天天综合色| 99re视频精品| 日本一区二区视频在线| 日韩高清欧美激情| 欧美影院一区二区三区| 国产网站一区二区三区| 另类成人小视频在线| 色综合久久88色综合天天6| 精品国产一区二区三区久久久蜜月| 亚洲午夜久久久久| av一区二区三区| 国产三级精品三级| 精品一区在线看| 在线播放视频一区| 一区二区三区小说| 不卡一区二区在线| 久久久久国产成人精品亚洲午夜 | 91久久精品午夜一区二区| 国产女主播一区| 国产精品996| 亚洲精品一区二区三区福利| 99视频热这里只有精品免费| 91丨porny丨户外露出| 日韩午夜电影av| 天天综合网天天综合色| 欧美在线免费观看亚洲| 亚洲丝袜另类动漫二区| 成人午夜激情视频| 欧美国产一区视频在线观看| 国产美女一区二区三区| 国产喂奶挤奶一区二区三区| 国产高清视频一区| 亚洲国产高清不卡| 国产传媒久久文化传媒| 国产精品成人在线观看| 91麻豆成人久久精品二区三区| 国产精品动漫网站| 色系网站成人免费| 亚洲国产日韩a在线播放性色| 欧美日韩日本视频| 日本在线观看不卡视频| 欧美一区二区三级| 国产精品久久久久影院老司| 91久久精品网| 亚洲一二三区视频在线观看| 欧美综合天天夜夜久久| 男人的天堂久久精品| 日韩欧美激情一区| 高清国产午夜精品久久久久久| 中文字幕一区在线观看| 欧美日韩综合在线| 丝瓜av网站精品一区二区| 欧美精品一区二区久久久| 国产91精品一区二区麻豆网站| 亚洲女与黑人做爰| 4438x成人网最大色成网站| 极品美女销魂一区二区三区免费| 久久精品这里都是精品| 99精品国产一区二区三区不卡| 一级精品视频在线观看宜春院| 欧美精品v国产精品v日韩精品| 极品少妇一区二区三区精品视频| 日韩中文字幕av电影| 欧美一区二区三区小说| 国产精品1024| 日韩免费电影网站| 亚洲人成7777| 欧美挠脚心视频网站| 一区二区三区资源| 国产精品成人一区二区三区夜夜夜 | 欧美探花视频资源| 丝袜美腿亚洲色图| 国产成人激情av| 亚洲天堂成人网| 在线看日韩精品电影| 久久av资源站| 国产精品久久久久aaaa| 3d成人动漫网站| 国产米奇在线777精品观看| 亚洲精品一卡二卡| 91精品国产一区二区三区蜜臀 | 日韩一级黄色大片| 欧美老肥妇做.爰bbww| 欧美一卡在线观看| 粉嫩一区二区三区在线看| 香蕉久久一区二区不卡无毒影院| 中文字幕国产一区| 日韩欧美一二三四区| 欧美巨大另类极品videosbest| 国产成人福利片| 国产精品中文字幕欧美| 三级欧美韩日大片在线看| 一色桃子久久精品亚洲| 欧美一区二区二区| 成人国产精品免费| 日韩精品成人一区二区三区| 亚洲一区在线看| 亚洲国产精品一区二区久久恐怖片 | 精品一二线国产| 国产精品888| 国产东北露脸精品视频| 国产1区2区3区精品美女| 久久精品国产精品亚洲精品| 午夜精品免费在线| 欧美一区二区三区免费| 555www色欧美视频| 欧美日韩二区三区| 日韩欧美一区在线| www一区二区| 日韩电影在线观看网站| 另类小说视频一区二区| 国内精品伊人久久久久av影院| 国产成人自拍高清视频在线免费播放| 国产一区二区导航在线播放| 色婷婷精品久久二区二区蜜臀av | 亚洲日本在线天堂| 一区二区三区精品在线观看| 亚洲国产精品天堂| 欧美三级中文字| 青青草国产成人av片免费| 欧美videos大乳护士334| 国模冰冰炮一区二区| 欧美激情一区二区三区全黄 | 人禽交欧美网站| 精品国产免费人成在线观看| 风间由美性色一区二区三区| 国产精品久久三区| 7777精品伊人久久久大香线蕉 | 日韩欧美中文字幕制服| 日韩你懂的在线观看| 天堂成人国产精品一区| 91免费视频观看| 亚洲精品中文字幕在线观看| 91麻豆swag| 午夜精品福利久久久| 在线不卡中文字幕| 国产宾馆实践打屁股91| 亚洲电影在线播放| 一区二区三区在线看| 99久久国产免费看| 亚洲一区二区在线免费看| 3d成人动漫网站| 成人爱爱电影网址| 蜜臀精品久久久久久蜜臀 | 久久只精品国产| 国产区在线观看成人精品| 欧美日韩aaa| 在线亚洲欧美专区二区| 97精品国产露脸对白| 高清beeg欧美| 成人深夜视频在线观看| 国产精品18久久久久| 精品久久久久久最新网址| 91看片淫黄大片一级在线观看| 精品一区在线看| 首页亚洲欧美制服丝腿| 午夜视频在线观看一区二区三区| 久久综合中文字幕| 欧美大片在线观看一区| 91在线观看免费视频| 日韩av一级片| 亚洲一二三四久久| 亚洲色图一区二区三区| 亚洲天堂av老司机| 亚洲一区二区三区自拍| 1000部国产精品成人观看| 亚洲国产成人在线| 亚洲美女免费视频| 日韩主播视频在线| 亚洲精品老司机| 奇米综合一区二区三区精品视频| 国产在线精品一区二区三区不卡| 一本一本大道香蕉久在线精品| 日韩一区二区三区免费看 | 欧美日产国产精品| 国产人久久人人人人爽| 亚洲v中文字幕|