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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? scorerdocqueue.cs

?? 介紹有關(guān)全文檢索的類庫,以lucene為例,在.net環(huán)境下實現(xiàn)多種類型文檔的全文檢索.
?? CS
字號:
/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */


/* Derived from Lucene.Net.Util.PriorityQueue of March 2005 */
using System;

using Scorer = Lucene.Net.Search.Scorer;

namespace Lucene.Net.Util
{
	
	/// <summary>A ScorerDocQueue maintains a partial ordering of its Scorers such that the
	/// least Scorer can always be found in constant time.  Put()'s and pop()'s
	/// require log(size) time. The ordering is by Scorer.doc().
	/// </summary>
	public class ScorerDocQueue
	{
		// later: SpansQueue for spans with doc and term positions
		private HeapedScorerDoc[] heap;
		private int maxSize;
		private int size;
		
		private class HeapedScorerDoc
		{
			private void  InitBlock(ScorerDocQueue enclosingInstance)
			{
				this.enclosingInstance = enclosingInstance;
			}
			private ScorerDocQueue enclosingInstance;
			public ScorerDocQueue Enclosing_Instance
			{
				get
				{
					return enclosingInstance;
				}
				
			}
			internal Scorer scorer;
			internal int doc;
			
			internal HeapedScorerDoc(ScorerDocQueue enclosingInstance, Scorer s):this(enclosingInstance, s, s.Doc())
			{
			}
			
			internal HeapedScorerDoc(ScorerDocQueue enclosingInstance, Scorer scorer, int doc)
			{
				InitBlock(enclosingInstance);
				this.scorer = scorer;
				this.doc = doc;
			}
			
			internal virtual void  Adjust()
			{
				doc = scorer.Doc();
			}
		}
		
		private HeapedScorerDoc topHSD; // same as heap[1], only for speed
		
		/// <summary>Create a ScorerDocQueue with a maximum size. </summary>
		public ScorerDocQueue(int maxSize)
		{
			// assert maxSize >= 0;
			size = 0;
			int heapSize = maxSize + 1;
			heap = new HeapedScorerDoc[heapSize];
			this.maxSize = maxSize;
			topHSD = heap[1]; // initially null
		}
		
		/// <summary> Adds a Scorer to a ScorerDocQueue in log(size) time.
		/// If one tries to add more Scorers than maxSize
		/// a SystemException (ArrayIndexOutOfBound) is thrown.
		/// </summary>
		public void  Put(Scorer scorer)
		{
			size++;
			heap[size] = new HeapedScorerDoc(this, scorer);
			UpHeap();
		}
		
		/// <summary> Adds a Scorer to the ScorerDocQueue in log(size) time if either
		/// the ScorerDocQueue is not full, or not lessThan(scorer, top()).
		/// </summary>
		/// <param name="">scorer
		/// </param>
		/// <returns> true if scorer is added, false otherwise.
		/// </returns>
		public virtual bool Insert(Scorer scorer)
		{
			if (size < maxSize)
			{
				Put(scorer);
				return true;
			}
			else
			{
				int docNr = scorer.Doc();
				if ((size > 0) && (!(docNr < topHSD.doc)))
				{
					// heap[1] is top()
					heap[1] = new HeapedScorerDoc(this, scorer, docNr);
					DownHeap();
					return true;
				}
				else
				{
					return false;
				}
			}
		}
		
		/// <summary>Returns the least Scorer of the ScorerDocQueue in constant time.
		/// Should not be used when the queue is empty.
		/// </summary>
		public Scorer Top()
		{
			// assert size > 0;
			return topHSD.scorer;
		}
		
		/// <summary>Returns document number of the least Scorer of the ScorerDocQueue
		/// in constant time.
		/// Should not be used when the queue is empty.
		/// </summary>
		public int TopDoc()
		{
			// assert size > 0;
			return topHSD.doc;
		}
		
		public float TopScore()
		{
			// assert size > 0;
			return topHSD.scorer.Score();
		}
		
		public bool TopNextAndAdjustElsePop()
		{
			return CheckAdjustElsePop(topHSD.scorer.Next());
		}
		
		public bool TopSkipToAndAdjustElsePop(int target)
		{
			return CheckAdjustElsePop(topHSD.scorer.SkipTo(target));
		}
		
		private bool CheckAdjustElsePop(bool cond)
		{
			if (cond)
			{
				// see also adjustTop
				topHSD.doc = topHSD.scorer.Doc();
			}
			else
			{
				// see also popNoResult
				heap[1] = heap[size]; // move last to first
				heap[size] = null;
				size--;
			}
			DownHeap();
			return cond;
		}
		
		/// <summary>Removes and returns the least scorer of the ScorerDocQueue in log(size)
		/// time.
		/// Should not be used when the queue is empty.
		/// </summary>
		public Scorer Pop()
		{
			// assert size > 0;
			Scorer result = topHSD.scorer;
			PopNoResult();
			return result;
		}
		
		/// <summary>Removes the least scorer of the ScorerDocQueue in log(size) time.
		/// Should not be used when the queue is empty.
		/// </summary>
		private void  PopNoResult()
		{
			heap[1] = heap[size]; // move last to first
			heap[size] = null;
			size--;
			DownHeap(); // adjust heap
		}
		
		/// <summary>Should be called when the scorer at top changes doc() value.
		/// Still log(n) worst case, but it's at least twice as fast to <pre>
		/// { pq.top().change(); pq.adjustTop(); }
		/// </pre> instead of <pre>
		/// { o = pq.pop(); o.change(); pq.push(o); }
		/// </pre>
		/// </summary>
		public void  AdjustTop()
		{
			// assert size > 0;
			topHSD.Adjust();
			DownHeap();
		}
		
		/// <summary>Returns the number of scorers currently stored in the ScorerDocQueue. </summary>
		public int Size()
		{
			return size;
		}
		
		/// <summary>Removes all entries from the ScorerDocQueue. </summary>
		public void  Clear()
		{
			for (int i = 0; i <= size; i++)
			{
				heap[i] = null;
			}
			size = 0;
		}
		
		private void  UpHeap()
		{
			int i = size;
			HeapedScorerDoc node = heap[i]; // save bottom node
			int j = SupportClass.Number.URShift(i, 1);
			while ((j > 0) && (node.doc < heap[j].doc))
			{
				heap[i] = heap[j]; // shift parents down
				i = j;
				j = SupportClass.Number.URShift(j, 1);
			}
			heap[i] = node; // install saved node
			topHSD = heap[1];
		}
		
		private void  DownHeap()
		{
			int i = 1;
			HeapedScorerDoc node = heap[i]; // save top node
			int j = i << 1; // find smaller child
			int k = j + 1;
			if ((k <= size) && (heap[k].doc < heap[j].doc))
			{
				j = k;
			}
			while ((j <= size) && (heap[j].doc < node.doc))
			{
				heap[i] = heap[j]; // shift up child
				i = j;
				j = i << 1;
				k = j + 1;
				if (k <= size && (heap[k].doc < heap[j].doc))
				{
					j = k;
				}
			}
			heap[i] = node; // install saved node
			topHSD = heap[1];
		}
	}
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
水野朝阳av一区二区三区| 欧美日韩国产成人在线免费| 欧美大片国产精品| 精品无人码麻豆乱码1区2区 | 美女视频免费一区| 日韩精品一区二区三区中文精品| 免费观看成人鲁鲁鲁鲁鲁视频| 欧美成人在线直播| 国产自产视频一区二区三区| 亚洲国产精品高清| 色综合天天综合| 亚洲国产日韩综合久久精品| 91精品国产综合久久精品麻豆| 久久成人久久爱| 国产精品伦理在线| 欧美色视频在线| 久久97超碰国产精品超碰| 欧美国产日韩精品免费观看| 色av综合在线| 六月丁香婷婷久久| 欧美韩国日本综合| 欧美日韩国产一二三| 经典三级视频一区| 亚洲欧洲制服丝袜| 精品久久国产97色综合| 99久久精品免费| 午夜精品久久久久影视| 国产拍揄自揄精品视频麻豆 | 色狠狠一区二区三区香蕉| 亚洲成人动漫av| 久久久久久毛片| 色婷婷av一区二区| 久久激情五月激情| 亚洲精品视频观看| 久久午夜色播影院免费高清| 日本乱码高清不卡字幕| 麻豆成人久久精品二区三区小说| 中文字幕一区二区视频| 欧美一区二区三区视频免费 | 一区二区三区免费看视频| 日韩一区二区三区四区五区六区| av电影天堂一区二区在线观看| 美腿丝袜一区二区三区| 一区二区三区在线不卡| 久久久噜噜噜久噜久久综合| 欧美精品自拍偷拍动漫精品| 成人av中文字幕| 久久99久久99| 日韩精品一级二级| 一区二区三区中文字幕| 国产蜜臀av在线一区二区三区 | 欧美成人一级视频| 91福利在线导航| 成人av在线播放网址| 秋霞电影网一区二区| 一区二区三区在线免费播放| 国产精品妹子av| 国产视频不卡一区| 精品少妇一区二区三区日产乱码 | 精品无码三级在线观看视频| 午夜亚洲国产au精品一区二区| 一色桃子久久精品亚洲| 国产视频一区不卡| 国产欧美视频一区二区三区| 日韩欧美的一区| 欧美一区二区三区精品| 在线成人小视频| 欧美日韩免费视频| 91国偷自产一区二区开放时间 | 蜜臀久久99精品久久久画质超高清 | 久久精品国产秦先生| 日韩精品91亚洲二区在线观看| 一区二区三区精品视频| 亚洲欧美偷拍卡通变态| 中文字幕在线一区| 国产精品久久久久一区| 日本一区二区电影| 国产精品国产自产拍高清av王其| 久久久精品影视| 久久无码av三级| 精品国产sm最大网站免费看 | 中文字幕欧美三区| 国产精品私房写真福利视频| 国产精品久久久久影视| 亚洲天堂成人在线观看| 一区av在线播放| 午夜欧美电影在线观看| 日韩精品每日更新| 精品一区二区三区在线观看国产| 蜜桃在线一区二区三区| 国产一区二区三区四| 成人黄页毛片网站| 91蜜桃婷婷狠狠久久综合9色| 一本色道**综合亚洲精品蜜桃冫| 在线一区二区三区四区| 欧美日韩成人一区| 精品成人免费观看| 国产精品久久午夜夜伦鲁鲁| 一区二区三区中文免费| 日本不卡123| 国产高清在线观看免费不卡| 成人精品鲁一区一区二区| 91在线播放网址| 欧美日本一区二区在线观看| 精品福利一二区| 国产精品久久久久影院| 亚洲丰满少妇videoshd| 精品一区二区三区香蕉蜜桃| 成人av集中营| 欧美亚洲动漫制服丝袜| 日韩一区二区三区在线观看| 亚洲国产成人自拍| 亚洲6080在线| 国产91在线观看丝袜| 欧美午夜在线观看| 国产偷国产偷精品高清尤物| 亚洲午夜在线电影| 国产中文一区二区三区| 91高清在线观看| 久久久久久久久久电影| 亚洲综合无码一区二区| 国产一区91精品张津瑜| 日本道精品一区二区三区| 精品久久久久久久一区二区蜜臀| 亚洲欧美一区二区三区国产精品| 久久成人麻豆午夜电影| 欧美午夜精品免费| 国产精品欧美一区喷水| 美国av一区二区| 欧美天天综合网| 欧美国产精品中文字幕| 美国十次综合导航| 91久久免费观看| 国产欧美综合色| 日韩成人免费电影| 色婷婷精品久久二区二区蜜臀av| 日韩欧美一级在线播放| 亚洲一区二区三区不卡国产欧美 | 国产精品网站在线| 免费不卡在线观看| 欧美在线观看视频在线| 国产精品拍天天在线| 国产专区综合网| 91精品啪在线观看国产60岁| 亚洲色图一区二区三区| 国产精品亚洲成人| 欧美成人伊人久久综合网| 丝袜诱惑亚洲看片| 欧美亚男人的天堂| 一区二区在线观看av| 成人免费高清在线| 国产亚洲精品7777| 久久99国产精品免费网站| 欧美日韩精品一区二区三区| 亚洲青青青在线视频| 99视频精品在线| 国产精品久久毛片| 国产成人在线视频网址| 亚洲精品一区在线观看| 青娱乐精品视频| 在线电影国产精品| 青青青爽久久午夜综合久久午夜| 91麻豆精品国产91久久久使用方法| 亚洲激情中文1区| 91麻豆成人久久精品二区三区| 久久久99久久| 国产福利一区在线| 久久免费视频色| 国产一区二区三区四区五区美女| 久久中文娱乐网| 国产精品正在播放| 国产婷婷色一区二区三区| 国产999精品久久久久久绿帽| 国产欧美日韩麻豆91| 成人精品在线视频观看| 成人欧美一区二区三区| 一本色道久久综合亚洲aⅴ蜜桃 | 欧美一区二区视频在线观看2022| 日本人妖一区二区| 精品久久免费看| 韩国午夜理伦三级不卡影院| 久久精品人人做人人爽97| 成人午夜激情片| 亚洲精品久久7777| 欧美日韩高清一区二区不卡| 青青草一区二区三区| 久久久久一区二区三区四区| 粉嫩高潮美女一区二区三区| 1区2区3区国产精品| 欧美亚洲高清一区| 另类成人小视频在线| 久久先锋影音av| 99精品视频在线观看| 亚洲成人激情av| 久久奇米777| 色综合久久综合网欧美综合网| 亚洲国产精品天堂| 精品国产一区二区三区av性色| 成人在线视频一区二区| 亚洲主播在线播放|