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

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

?? densehashtable.h

?? Cromfs is a compressed read-only filesystem for Linux. Cromfs is best at archiving gigabytes of big
?? H
?? 第 1 頁 / 共 3 頁
字號:
// Copyright (c) 2005, Google Inc.// All rights reserved.//// Redistribution and use in source and binary forms, with or without// modification, are permitted provided that the following conditions are// met:////     * Redistributions of source code must retain the above copyright// notice, this list of conditions and the following disclaimer.//     * Redistributions in binary form must reproduce the above// copyright notice, this list of conditions and the following disclaimer// in the documentation and/or other materials provided with the// distribution.//     * Neither the name of Google Inc. nor the names of its// contributors may be used to endorse or promote products derived from// this software without specific prior written permission.//// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.// ---// Author: Craig Silverstein//// A dense hashtable is a particular implementation of// a hashtable: one that is meant to minimize memory allocation.// It does this by using an array to store all the data.  We// steal a value from the key space to indicate "empty" array// elements (ie indices where no item lives) and another to indicate// "deleted" elements.//// (Note it is possible to change the value of the delete key// on the fly; you can even remove it, though after that point// the hashtable is insert_only until you set it again.  The empty// value however can't be changed.)//// To minimize allocation and pointer overhead, we use internal// probing, in which the hashtable is a single table, and collisions// are resolved by trying to insert again in another bucket.  The// most cache-efficient internal probing schemes are linear probing// (which suffers, alas, from clumping) and quadratic probing, which// is what we implement by default.//// Type requirements: value_type is required to be Copy Constructible// and Default Constructible. It is not required to be (and commonly// isn't) Assignable.//// You probably shouldn't use this code directly.  Use// <google/dense_hash_map> or <google/dense_hash_set> instead.// You can change the following below:// HT_OCCUPANCY_FLT      -- how full before we double size// HT_EMPTY_FLT          -- how empty before we halve size// HT_MIN_BUCKETS        -- default smallest bucket size//// You can also change enlarge_resize_percent (which defaults to// HT_OCCUPANCY_FLT), and shrink_resize_percent (which defaults to// HT_EMPTY_FLT) with set_resizing_parameters().//// How to decide what values to use?// shrink_resize_percent's default of .4 * OCCUPANCY_FLT, is probably good.// HT_MIN_BUCKETS is probably unnecessary since you can specify// (indirectly) the starting number of buckets at construct-time.// For enlarge_resize_percent, you can use this chart to try to trade-off// expected lookup time to the space taken up.  By default, this// code uses quadratic probing, though you can change it to linear// via _JUMP below if you really want to.//// From http://www.augustana.ca/~mohrj/courses/1999.fall/csc210/lecture_notes/hashing.html// NUMBER OF PROBES / LOOKUP       Successful            Unsuccessful// Quadratic collision resolution   1 - ln(1-L) - L/2    1/(1-L) - L - ln(1-L)// Linear collision resolution     [1+1/(1-L)]/2         [1+1/(1-L)2]/2//// -- enlarge_resize_percent --         0.10  0.50  0.60  0.75  0.80  0.90  0.99// QUADRATIC COLLISION RES.//    probes/successful lookup    1.05  1.44  1.62  2.01  2.21  2.85  5.11//    probes/unsuccessful lookup  1.11  2.19  2.82  4.64  5.81  11.4  103.6// LINEAR COLLISION RES.//    probes/successful lookup    1.06  1.5   1.75  2.5   3.0   5.5   50.5//    probes/unsuccessful lookup  1.12  2.5   3.6   8.5   13.0  50.0  5000.0#ifndef _DENSEHASHTABLE_H_#define _DENSEHASHTABLE_H_// The probing method// Linear probing// #define JUMP_(key, num_probes)    ( 1 )// Quadratic-ish probing#define JUMP_(key, num_probes)    ( num_probes )// Hashtable class, used to implement the hashed associative containers// hash_set and hash_map.#include <google/sparsehash/sparseconfig.h>#include <assert.h>#include <stdlib.h>             // for abort()#include <algorithm>            // For swap(), eg#include <iostream>             // For cerr#include <memory>               // For uninitialized_fill, uninitialized_copy#include <utility>              // for pair<>#include <iterator>             // for facts about iterator tags#include <google/type_traits.h> // for true_type, integral_constant, etc._START_GOOGLE_NAMESPACE_using STL_NAMESPACE::pair;template <class Value, class Key, class HashFcn,          class ExtractKey, class EqualKey, class Alloc>class dense_hashtable;template <class V, class K, class HF, class ExK, class EqK, class A>struct dense_hashtable_iterator;template <class V, class K, class HF, class ExK, class EqK, class A>struct dense_hashtable_const_iterator;// We're just an array, but we need to skip over empty and deleted elementstemplate <class V, class K, class HF, class ExK, class EqK, class A>struct dense_hashtable_iterator { public:  typedef dense_hashtable_iterator<V,K,HF,ExK,EqK,A>       iterator;  typedef dense_hashtable_const_iterator<V,K,HF,ExK,EqK,A> const_iterator;  typedef STL_NAMESPACE::forward_iterator_tag iterator_category;  typedef V value_type;  typedef ptrdiff_t difference_type;  typedef size_t size_type;  typedef V& reference;                // Value  typedef V* pointer;  // "Real" constructor and default constructor  dense_hashtable_iterator(const dense_hashtable<V,K,HF,ExK,EqK,A> *h,                           pointer it, pointer it_end, bool advance)    : ht(h), pos(it), end(it_end)   {    if (advance)  advance_past_empty_and_deleted();  }  dense_hashtable_iterator() { }  // The default destructor is fine; we don't define one  // The default operator= is fine; we don't define one  // Happy dereferencer  reference operator*() const { return *pos; }  pointer operator->() const { return &(operator*()); }  // Arithmetic.  The only hard part is making sure that  // we're not on an empty or marked-deleted array element  void advance_past_empty_and_deleted() {    while ( pos != end && (ht->test_empty(*this) || ht->test_deleted(*this)) )      ++pos;  }  iterator& operator++()   {    assert(pos != end); ++pos; advance_past_empty_and_deleted(); return *this;  }  iterator operator++(int) { iterator tmp(*this); ++*this; return tmp; }  // Comparison.  bool operator==(const iterator& it) const { return pos == it.pos; }  bool operator!=(const iterator& it) const { return pos != it.pos; }  // The actual data  const dense_hashtable<V,K,HF,ExK,EqK,A> *ht;  pointer pos, end;};// Now do it all again, but with const-ness!template <class V, class K, class HF, class ExK, class EqK, class A>struct dense_hashtable_const_iterator { public:  typedef dense_hashtable_iterator<V,K,HF,ExK,EqK,A>       iterator;  typedef dense_hashtable_const_iterator<V,K,HF,ExK,EqK,A> const_iterator;  typedef STL_NAMESPACE::forward_iterator_tag iterator_category;  typedef V value_type;  typedef ptrdiff_t difference_type;  typedef size_t size_type;  typedef const V& reference;                // Value  typedef const V* pointer;  // "Real" constructor and default constructor  dense_hashtable_const_iterator(const dense_hashtable<V,K,HF,ExK,EqK,A> *h,                                 pointer it, pointer it_end, bool advance)    : ht(h), pos(it), end(it_end)   {    if (advance)  advance_past_empty_and_deleted();  }  dense_hashtable_const_iterator() { }  // This lets us convert regular iterators to const iterators  dense_hashtable_const_iterator(const iterator &it)    : ht(it.ht), pos(it.pos), end(it.end) { }  // The default destructor is fine; we don't define one  // The default operator= is fine; we don't define one  // Happy dereferencer  reference operator*() const { return *pos; }  pointer operator->() const { return &(operator*()); }  // Arithmetic.  The only hard part is making sure that  // we're not on an empty or marked-deleted array element  void advance_past_empty_and_deleted() {    while ( pos != end && (ht->test_empty(*this) || ht->test_deleted(*this)) )      ++pos;  }  const_iterator& operator++()   {    assert(pos != end); ++pos; advance_past_empty_and_deleted(); return *this;  }  const_iterator operator++(int) { const_iterator tmp(*this); ++*this; return tmp; }  // Comparison.  bool operator==(const const_iterator& it) const { return pos == it.pos; }  bool operator!=(const const_iterator& it) const { return pos != it.pos; }  // The actual data  const dense_hashtable<V,K,HF,ExK,EqK,A> *ht;  pointer pos, end;};template <class Value, class Key, class HashFcn,          class ExtractKey, class EqualKey, class Alloc>class dense_hashtable { public:  typedef Key key_type;  typedef Value value_type;  typedef HashFcn hasher;  typedef EqualKey key_equal;  typedef size_t            size_type;  typedef ptrdiff_t         difference_type;  typedef value_type*       pointer;  typedef const value_type* const_pointer;  typedef value_type&       reference;  typedef const value_type& const_reference;  typedef dense_hashtable_iterator<Value, Key, HashFcn,                                   ExtractKey, EqualKey, Alloc>  iterator;  typedef dense_hashtable_const_iterator<Value, Key, HashFcn,                                          ExtractKey, EqualKey, Alloc>  const_iterator;  // How full we let the table get before we resize.  Knuth says .8 is  // good -- higher causes us to probe too much, though saves memory  static const float HT_OCCUPANCY_FLT; // = 0.8;  // How empty we let the table get before we resize lower.  // (0.0 means never resize lower.)  // It should be less than OCCUPANCY_FLT / 2 or we thrash resizing  static const float HT_EMPTY_FLT; // = 0.4 * HT_OCCUPANCY_FLT  // Minimum size we're willing to let hashtables be.  // Must be a power of two, and at least 4.  // Note, however, that for a given hashtable, the initial size is a  // function of the first constructor arg, and may be >HT_MIN_BUCKETS.  static const size_t HT_MIN_BUCKETS  = 32;  // ITERATOR FUNCTIONS  iterator begin()             { return iterator(this, table,                                                 table + num_buckets, true); }  iterator end()               { return iterator(this, table + num_buckets,                                                 table + num_buckets, true); }  const_iterator begin() const { return const_iterator(this, table,                                                       table+num_buckets,true);}  const_iterator end() const   { return const_iterator(this, table + num_buckets,                                                       table+num_buckets,true);}  // ACCESSOR FUNCTIONS for the things we templatize on, basically  hasher hash_funct() const { return hash; }  key_equal key_eq() const  { return equals; }  // Annoyingly, we can't copy values around, because they might have  // const components (they're probably pair<const X, Y>).  We use  // explicit destructor invocation and placement new to get around  // this.  Arg. private:  void set_value(value_type* dst, const value_type& src) {    dst->~value_type();    new(dst) value_type(src);  }  void destroy_buckets(size_type first, size_type last) {    for ( ; first != last; ++first)      table[first].~value_type();  }  // DELETE HELPER FUNCTIONS  // This lets the user describe a key that will indicate deleted  // table entries.  This key should be an "impossible" entry --  // if you try to insert it for real, you won't be able to retrieve it!  // (NB: while you pass in an entire value, only the key part is looked  // at.  This is just because I don't know how to assign just a key.) private:  void squash_deleted() {           // gets rid of any deleted entries we have    if ( num_deleted ) {            // get rid of deleted before writing      dense_hashtable tmp(*this);   // copying will get rid of deleted      swap(tmp);                    // now we are tmp    }    assert(num_deleted == 0);  } public:  void set_deleted_key(const value_type &val) {    // the empty indicator (if specified) and the deleted indicator    // must be different    assert(!use_empty || !equals(get_key(val), get_key(emptyval)));    // It's only safe to change what "deleted" means if we purge deleted guys    squash_deleted();    use_deleted = true;    set_value(&delval, val);  }  void clear_deleted_key() {    squash_deleted();

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文字幕国产一区| 亚洲一区视频在线观看视频| 国产成人在线视频免费播放| 亚洲欧洲日韩在线| 91精品国产一区二区三区香蕉| 极品少妇xxxx偷拍精品少妇| 欧美精品自拍偷拍动漫精品| 国产乱妇无码大片在线观看| 亚洲自拍偷拍图区| 久久久久久久久久看片| 色综合天天视频在线观看| 琪琪一区二区三区| 亚洲天堂精品视频| 日韩欧美成人一区| 欧美色倩网站大全免费| 国产成人精品三级| 久久精品国产秦先生| 亚洲色欲色欲www在线观看| 欧美va亚洲va在线观看蝴蝶网| 91麻豆高清视频| 国产精品综合在线视频| 亚洲国产精品综合小说图片区| 亚洲国产精品成人综合色在线婷婷| 欧美欧美欧美欧美| 色综合天天狠狠| 成熟亚洲日本毛茸茸凸凹| 蜜桃视频免费观看一区| 亚洲国产视频一区| 亚洲视频1区2区| 中文一区二区完整视频在线观看| 337p亚洲精品色噜噜狠狠| 国产又黄又大久久| 亚洲精品国产精华液| 久久久久久久久久美女| 日韩欧美一级精品久久| 91在线一区二区三区| 久久99精品久久只有精品| 亚洲影院在线观看| 综合婷婷亚洲小说| 国产午夜亚洲精品不卡| 欧美电影在哪看比较好| 91免费观看视频| 国产一区不卡视频| 美腿丝袜亚洲综合| 五月婷婷综合网| 亚洲女人的天堂| 国产精品灌醉下药二区| 久久蜜臀精品av| 精品久久久久99| 色www精品视频在线观看| 久久超级碰视频| 天堂久久一区二区三区| 亚洲桃色在线一区| 国产精品久久久久精k8| 久久精品免费在线观看| 精品成人一区二区| 精品欧美一区二区久久| 4438成人网| 在线91免费看| 欧美精品在线视频| 欧美日韩国产影片| 欧美精品自拍偷拍动漫精品| 欧美色综合天天久久综合精品| 91视频在线观看免费| 不卡视频免费播放| 成人国产一区二区三区精品| 国产精品一区二区果冻传媒| 国内精品写真在线观看| 久久成人av少妇免费| 激情五月婷婷综合| 国产精品资源在线观看| 国产福利一区二区三区视频在线| 国产乱码精品一区二区三区忘忧草| 性久久久久久久久| 蜜臀av国产精品久久久久| 玖玖九九国产精品| 国产一区二区三区不卡在线观看| 精品一区二区在线免费观看| 久久国产生活片100| 亚洲午夜私人影院| 免费在线观看一区二区三区| 免费不卡在线视频| 国产一区二区三区久久悠悠色av| 91麻豆精品91久久久久久清纯| 欧美亚日韩国产aⅴ精品中极品| 欧美性猛片xxxx免费看久爱 | 日本女人一区二区三区| 日本不卡免费在线视频| 久久99久久精品| 国产一区激情在线| 成人精品亚洲人成在线| 色综合激情五月| 制服丝袜av成人在线看| 日韩免费在线观看| 中国av一区二区三区| 亚洲色图欧美在线| 亚洲精品成人少妇| 国模无码大尺度一区二区三区| 国产91精品久久久久久久网曝门| 99精品黄色片免费大全| 欧美日韩久久不卡| 久久综合五月天婷婷伊人| 国产精品天美传媒沈樵| 亚洲香蕉伊在人在线观| 国产最新精品精品你懂的| av在线一区二区| 欧美日韩一区二区三区视频| 国产午夜精品久久久久久久 | 88在线观看91蜜桃国自产| 欧美xxxxxxxx| 亚洲精品国产a| 青青青伊人色综合久久| 成人永久aaa| 在线不卡中文字幕播放| 国产亚洲成年网址在线观看| 亚洲一区二区视频在线观看| 精品一区二区三区日韩| 日本久久电影网| 久久综合色之久久综合| 亚洲成年人影院| av影院午夜一区| 日韩午夜在线观看| 亚洲欧洲精品一区二区三区不卡| 久久国产精品99久久人人澡| 91色porny蝌蚪| 日韩午夜精品电影| 亚洲精品一二三四区| 国产乱人伦精品一区二区在线观看| 欧美无砖专区一中文字| 国产日韩欧美在线一区| 日韩精品一级二级| 一本大道av一区二区在线播放 | 精品亚洲国产成人av制服丝袜| 欧美综合色免费| 国产精品美女一区二区在线观看| 蜜臀a∨国产成人精品| 欧美性猛交xxxx黑人交| 国产精品天美传媒| 国产一区二区久久| 日韩欧美一级二级| 亚洲va中文字幕| 色欧美片视频在线观看在线视频| 久久夜色精品国产欧美乱极品| 日日骚欧美日韩| 欧美三级在线看| 亚洲精品videosex极品| 国产福利一区二区三区视频 | 色婷婷精品大在线视频| 国产欧美精品一区二区三区四区 | 色八戒一区二区三区| 亚洲欧洲精品一区二区三区不卡| 精品一区二区三区av| 日韩一区二区三区视频在线观看| 国产精品第一页第二页第三页| 久久国产精品无码网站| 欧美日韩精品高清| 日av在线不卡| 日韩欧美一区二区视频| 五月天激情综合| 91精品国产综合久久久久久漫画 | 老司机精品视频线观看86| 91精品国产综合久久久久久漫画| 亚洲国产精品视频| 欧美日韩在线精品一区二区三区激情| 亚洲精品国产一区二区精华液| 91色porny| 一个色妞综合视频在线观看| 99国产精品久久久久| 日韩一区在线播放| 国产福利一区二区三区在线视频| 久久久综合精品| 国内国产精品久久| 欧美激情一区三区| www.亚洲精品| 亚洲精品视频在线观看免费 | 天使萌一区二区三区免费观看| 欧美三级蜜桃2在线观看| 亚洲一区二区高清| 欧美精品色一区二区三区| 日韩一区精品视频| 欧美va日韩va| 国产精品资源在线看| 中文字幕一区二区三区乱码在线| av网站一区二区三区| 一区二区在线观看免费| 欧美在线999| 麻豆精品视频在线观看| 在线不卡一区二区| 久久91精品国产91久久小草| 亚洲国产高清不卡| 波多野结衣亚洲| 亚洲成人精品一区二区| 日韩视频永久免费| 成人激情午夜影院| 亚洲综合视频在线观看| 日韩一区二区三区精品视频| 国产精品18久久久久| 亚洲精品欧美综合四区| 日韩一区二区电影| 成人性生交大合|