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

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

?? tree2tree.java

?? 生物物種進化歷程的演示
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/*   Copyright (c) 2002 Compaq Computer Corporation      SOFTWARE RELEASE      Permission is hereby granted, free of charge, to any person obtaining   a copy of this software and associated documentation files (the   "Software"), to deal in the Software without restriction, including   without limitation the rights to use, copy, modify, merge, publish,   distribute, sublicense, and/or sell copies of the Software, and to   permit persons to whom the Software is furnished to do so, subject to   the following conditions:      - 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 names of Compaq Research, Compaq Computer Corporation     nor the names of its contributors may be used to endorse or promote     products derived from this Software without specific prior written     permission.      THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.    IN NO EVENT SHALL COMPAQ COMPUTER CORPORATION BE LIABLE FOR ANY CLAIM,   DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR   OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR   THE USE OR OTHER DEALINGS IN THE SOFTWARE.*/package TreeJuxtaposer;import AccordionTreeDrawer.*;//import AccordionTreeDrawer.AccordionTreeDrawer;//import AccordionTreeDrawer.Tree;//import AccordionTreeDrawer.TreeNode;import java.util.*;/** * Tree2Tree does the precomputation for each pair of trees. The two * precomputation tasks are computing the best corresponding node for * each node and building the range query data structures. * * @author  Tamara Munzner, Serdar Tasiran, Li Zhang, Yunhong Zhou * @version  * @see     AccordionDrawer.Tree * @see     TreeJuxtaposer.RangeTree */class Tree2Tree {	// the trees being compared    Tree treeA, treeB;	// for X2Y: an entry for each node in X if the subtree under X is a forest in Y	Hashtable A2B, B2A;    /**     * The hashmaps that store the best matchings. A2B (B2A) stores     * the best match of treeB (treeA) node to treeA (treeB).     */    // the vector that stores the best corresponding nodes for    // different levels. each element of the vector is a hashmap that    // is indexed by nodes    Vector bestA2B, bestB2A;    // to deal with edge weights and leaves    float epsilon = 0.1f;    //    HashMap bestA2B, bestB2A;//    RangeTree rangeAB, rangeBA;        // do all the necessary preprocessing    Tree2Tree(Tree t1, Tree t2, int eL) {	treeA = t1;	treeB = t2;	long start, current;	bestA2B = new Vector(eL);	bestB2A = new Vector(eL);	start = System.currentTimeMillis();	// initialization the data structures for answering the	// queries of getBestCorrNode and isRangeInRange.	computeBestMatch(treeA, treeB, bestA2B, eL);	current = System.currentTimeMillis();	System.out.println("best match 1 total preprocessed: "+(current-start)/1000.0f+" sec");	start = current;	computeBestMatch(treeB, treeA, bestB2A, eL);	current = System.currentTimeMillis();	System.out.println("best match 2 total preprocessed: "+(current-start)/1000.0f+" sec");	start = current;		// initialize the data structure for rectangular range searching//	rangeAB = new RangeTree(treeA, treeB, this);//	rangeBA = new RangeTree(treeB, treeA, this);//	current = System.currentTimeMillis();//	System.out.println("range tree preprocessed: "+(current-start)/1000.0f+" sec");    }	/**	 * clean method, called when a tree is deleted	 * @see TreePairs.removeTree	 *	 */		public void close(){		   A2B.clear();		   B2A.clear();			   bestA2B.clear();		   bestB2A.clear();//		   this = null;		}	private void addNodeToForest(TreeNode node, ArrayList array, Hashtable hash)	{		Integer nodeInteger = new Integer(node.key);		if (hash.get(nodeInteger) == null)		{			array.add(nodeInteger);			hash.put(nodeInteger, node);		}	}	private void removeNodeFromForest(TreeNode node, ArrayList array, Hashtable hash)	{		Integer nodeInteger = new Integer(node.key);		if (hash.get(nodeInteger) == null)		{			array.remove(nodeInteger);			hash.remove(nodeInteger);		}	}	/*	 * return an ArrayList of a reduced number of elements from ArrayList	 * based on the number of leaves; bigger subtrees are kept, ties broken	 * by taking any subtree with maximum number of leaves not already in forest	 */	private ArrayList reduceNodeListToCutoff(ArrayList node, int cutoff)	{		//System.out.println("reducing nodelist to cutoff");		int subtreeSize[] = new int[node.size()];		for (int i = 0; i < node.size(); i++)		{			subtreeSize[i] = ((TreeNode)node.get(i)).numberLeaves;		}		Arrays.sort(subtreeSize); // sort array in ascending order		int subtreeSizeCutoff = subtreeSize[node.size() - cutoff] + 1; // find (cutoff + 1) subtree size		ArrayList returnList = new ArrayList();		for (int i = 0; i < node.size(); i++)		{			TreeNode currentNode = (TreeNode)node.get(i);			if (currentNode.numberLeaves >= subtreeSizeCutoff)				returnList.add(currentNode);		}		subtreeSizeCutoff--;		for (int i = 0; i < node.size() && returnList.size() < cutoff; i++)		{			TreeNode currentNode = (TreeNode)node.get(i);			if (currentNode.numberLeaves == subtreeSizeCutoff)				returnList.add(currentNode);		}		return returnList;	}		private void computeForest(Hashtable X2Y, Tree treeX, Tree treeY,		AccordionTreeDrawer atdY, int cutoff)	{		//posorder = children first, then parents		for (TreeNode nX = treeX.posorderStartNode; nX != null; nX = nX.posorderNext)		{			ArrayList currListX = null;			TreeNode nY = getBestCorrNode(treeX, nX, treeY, 0);			if (nY == null) // no BCN for nX, give up				continue;			Hashtable nXHash = null;			if (!nX.isLeaf()) // add children of nY to currListY			//  (iff child is BCN of a descendent of nX)			{				currListX = new ArrayList();				nXHash = new Hashtable();				addNodeToForest(nY, currListX, nXHash);				// add nY reference (sort later)				for (int i = 0; i < nX.numberChildren(); i++) {					TreeNode nXChild = nX.getChild(i);					TreeNode nYChild = getBestCorrNode(treeX, nXChild, treeY, 0);					ArrayList nXChildList = (ArrayList)X2Y.get(nXChild);					if (nXChildList != null) {						for (int j = 0; j < nXChildList.size(); j++) // go through forest of nXChild						{							TreeNode nYj = (TreeNode)nXChildList.get(j);							if (nY.getMin() > nYj.getMin() || nY.getMax() < nYj.getMax())							// nY is not an ancestor of nYj; nYj could be an ancestor of nY								addNodeToForest(nYj, currListX, nXHash);							if (nYj.getMin() <= nY.getMin() && nYj.getMax() >= nY.getMax())							// nYj is an ancestor of nY, remove nY								removeNodeFromForest(nY, currListX, nXHash);						}					}					// add child					if (nYChild != null && !nY.isAncestorOf(nYChild))						addNodeToForest(nYChild, currListX, nXHash);											// reduce (to cutoff) large forests under children of current node					if (nXChildList != null && nXChildList.size() > cutoff)					{						ArrayList newNXChildList = reduceNodeListToCutoff(nXChildList, cutoff);						X2Y.remove(nXChild);						X2Y.put(nXChild, newNXChildList);					}				}			}			ArrayList finalArrayX = new ArrayList(); // final forest calculation						// sort nBChildList by key			if (currListX != null) {				Object tempObjects[] = currListX.toArray();				Integer tempArray[] = new Integer[tempObjects.length];				for (int i = 0; i < tempObjects.length; i++)				  tempArray[i] = (Integer)tempObjects[i];				Arrays.sort(tempArray);				for (int i = 0; i < tempArray.length; i++)				{					TreeNode node = (TreeNode)nXHash.get(tempArray[i]);					if (node != null)					{						finalArrayX.add(node);						nXHash.remove(tempArray[i]);					}				}			}						// add finalArrayX to X2Y referenced by nX if finalArrayX has more than one element			if (finalArrayX != null && finalArrayX.size() > 1)				X2Y.put(nX, finalArrayX);		} // end of current nX	}	/*	 * preprocessing: calculate and store forests that correspond to subtrees	 * A2B/B2A: hash tables that map nodes (roots of subtrees) from A/B to forests of nodes (subtrees) in B/A	 * all work is done in computeForest	 */	public void subtree2Forest(AccordionTreeDrawer atdA, AccordionTreeDrawer atdB, int eL)	{		final int cutoff = 100; // allow at most "cutoff" items in a node's forest array		float start = System.currentTimeMillis();		A2B = new Hashtable();		computeForest(A2B, treeA, treeB, atdB, cutoff);		B2A = new Hashtable();		computeForest(B2A, treeB, treeA, atdA, cutoff);		float time = (System.currentTimeMillis() - start) / 1000;		System.out.println("Time to preprocess forest pair: " + time);	}    /**     * Computes the node in Tree "other" whose set of descendant     * leaves best matches that of TreeNode n in Tree "source"     *      * The best match is the node n' maximizing the following score     * | S(n) Intersection S(n') | / | S(n) Union S(n') |      *      * where S(n) is the set of leaves that are descendants of node n.     *      * @author   Tamara Munzner, Serdar Tasiran, Li Zhang, Yunhong Zhou     *      * @see      AccordionDrawer.Tree     * @see      AccordionDrawer.TreeNode     * @see      TreeJuxtaposer.NodeScorePair     */    TreeNode getBestCorrNode(Tree source, TreeNode n, Tree other, int el) {        HashMap h = null;	if((source == treeA)&&(other == treeB))	{	    h = (HashMap)bestA2B.elementAt(el);	}	else if((source == treeB)&&(other == treeA))	{	    h = (HashMap)bestB2A.elementAt(el);	}	if (h == null) return null;	    NodeScorePair p = ((NodeScorePair)(h.get(n)));    if (p != null)        return p.node;    return null;    }    float getBestCorrNodeScore(Tree source, TreeNode n, Tree other, int el) {	if((source == treeA)&&(other == treeB))	    return ((NodeScorePair)(((HashMap)(bestA2B.elementAt(el))).get(n))).score;	else if((source == treeB)&&(other == treeA))	    return ((NodeScorePair)(((HashMap)(bestB2A.elementAt(el))).get(n))).score;	else return -1.0f;    }	// return an ArrayList of RangeInTree objects that correspond to n from source	ArrayList getCorrRange(Tree source, TreeNode n, Tree other, int el)	{		int min = n.getMin();		if ((source == treeA)&&(other == treeB))			return (ArrayList)A2B.get(n);		else if ((source == treeB) && (other == treeA))			return (ArrayList)B2A.get(n);		return null;	}//    /** //     * Given a node range in one tree, say whether there's an overlap//     * with the node range in the other tree. //     * Returns number of overlapping nodes, possibly 0//     * //     * @author   Tamara Munzner, Serdar Tasiran, Li Zhang, Yunhong Zhou//     * //     * @see      AccordionDrawer.Tree//     * @see      AccordionDrawer.TreeNode//     */////    int isRangeInRange(Tree source, int AMin, int AMax, //		       Tree other, int BMin, int BMax) throws Exception{//	if((source == treeA)&&(other == treeB)) //	    return rangeAB.query2D(AMin, AMax, BMin, BMax);//	else if((source == treeB)&&(other == treeA)) //	    return rangeBA.query2D(AMin, AMax, BMin, BMax);//	else//	    return -1;//    }    class NodeScorePair {	TreeNode node = null;	float score = 0.0f;	NodeScorePair(TreeNode n, float s) { node = n; score = s; }    };    /**      * Attachment to a node that is needed as temporary data structure     * when computing best corresponding nodes     **/    class TmpD {	int tmpScore = 0;	float uSum = 0;	float lSum = 0;	TreeNode tmpParent = null;	TreeNode tmpPosorderNext = null;	TmpD() {;}    };    /**     *     * For each node om Tree t1, computes the best matching node in     * Tree t2 and stores it in HashMap h12     *      * @see      AccordionDrawer.Tree     * @see      TreeJuxtaposer.computeBestMatch     * @see      TreeJuxtaposer.NodeScorePair     */        void computeBestMatch(Tree t1, Tree t2, Vector v12, int eL) {		TmpD[] tmpData = new TmpD[t2.nodes.size()];

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产自产2019最新不卡| 国产精品美女久久久久aⅴ国产馆| 亚洲欧美成人一区二区三区| 成人app网站| 国产精品美女视频| 不卡视频一二三| 亚洲免费观看视频| 欧美在线你懂的| 午夜欧美大尺度福利影院在线看| 在线播放亚洲一区| 久久se精品一区精品二区| 国产亚洲欧美日韩俺去了| 丁香婷婷深情五月亚洲| 自拍偷拍亚洲激情| 欧美日韩中文国产| 久久99在线观看| 国产欧美日韩综合| 97久久超碰精品国产| 亚洲国产精品久久不卡毛片| 日韩一二三四区| 国产大陆亚洲精品国产| 椎名由奈av一区二区三区| 欧美午夜寂寞影院| 极品美女销魂一区二区三区| 中文字幕在线播放不卡一区| 在线观看国产91| 精品一区二区在线视频| 中文字幕在线不卡一区| 91精品国产综合久久婷婷香蕉| 精品一区二区三区免费观看| 国产精品久久久久7777按摩 | 精品国产亚洲一区二区三区在线观看| 精品亚洲欧美一区| 综合精品久久久| 日韩免费观看2025年上映的电影| eeuss鲁片一区二区三区| 午夜精品一区二区三区免费视频| 久久这里都是精品| 日本高清免费不卡视频| 国内精品免费**视频| 亚洲综合一区在线| 久久免费视频色| 欧美日韩免费一区二区三区视频| 国产一区二三区好的| 亚洲最新在线观看| 久久综合九色综合久久久精品综合| 99re热这里只有精品视频| 毛片基地黄久久久久久天堂| 国产精品久久看| 精品国产99国产精品| 欧美综合久久久| 岛国精品在线观看| 久久99精品久久久久| 一区二区三区在线免费观看| 国产亚洲欧洲997久久综合| 91精品国产麻豆国产自产在线 | 日韩理论片一区二区| 精品国产免费久久| 欧美日韩综合色| 一本高清dvd不卡在线观看| 国产成人精品综合在线观看| 青娱乐精品视频| 亚洲午夜成aⅴ人片| 亚洲视频精选在线| 中文字幕欧美国产| 亚洲精品一线二线三线| 日韩欧美视频一区| 88在线观看91蜜桃国自产| 欧美自拍偷拍一区| 在线观看免费成人| 欧美亚洲综合色| 91久久精品网| 91美女片黄在线观看91美女| 成人精品一区二区三区中文字幕| 国产精品一区久久久久| 国精产品一区一区三区mba视频 | 久久综合九色欧美综合狠狠| 日韩三级视频在线观看| 欧美一区二区三区色| 欧美三级蜜桃2在线观看| 91成人免费在线视频| 在线亚洲高清视频| 在线观看亚洲a| 欧美熟乱第一页| 91精品国产91综合久久蜜臀| 8v天堂国产在线一区二区| 日韩一区二区三区视频| 日韩女优视频免费观看| 久久久不卡网国产精品一区| 久久久久久久久久电影| 国产日韩欧美一区二区三区综合| 久久久久久久久岛国免费| 久久亚洲影视婷婷| 91在线观看视频| 色一区在线观看| 国内成人自拍视频| 夫妻av一区二区| 久久99久久久久| 国产v日产∨综合v精品视频| 国产精品888| 国产精品一二三| 丰满亚洲少妇av| 久久精品av麻豆的观看方式| 国产精品亚洲第一区在线暖暖韩国| 免费观看日韩av| 国产真实乱偷精品视频免| 国产精品自拍毛片| 国产**成人网毛片九色| 懂色av一区二区三区免费看| 99精品热视频| 在线视频一区二区三| 欧美日韩高清一区二区不卡| 欧美成人国产一区二区| 久久影院午夜片一区| 国产精品沙发午睡系列990531| 国产精品久久久久婷婷| 亚洲精品视频在线| 国产精品电影一区二区| 婷婷成人激情在线网| 免费看欧美美女黄的网站| 国产精品1024| 一本高清dvd不卡在线观看| 欧美日韩大陆在线| 欧美不卡一区二区三区四区| 国产亚洲欧美在线| 亚洲精品成人在线| 日韩国产在线一| 国产一区二区福利| 国产v综合v亚洲欧| 91美女视频网站| 日韩一级成人av| 国产精品国产三级国产普通话99| 亚洲不卡一区二区三区| 狠狠色综合色综合网络| 懂色av一区二区在线播放| 日本精品视频一区二区三区| 久久综合精品国产一区二区三区| 综合自拍亚洲综合图不卡区| 视频一区国产视频| 成人激情综合网站| 91.麻豆视频| 亚洲猫色日本管| 韩国av一区二区三区| 91久久精品一区二区| 久久婷婷国产综合精品青草| 国产精品国产精品国产专区不蜜| 精品一区二区av| 在线精品视频一区二区三四| 欧美一卡在线观看| 亚洲另类中文字| 国产在线观看一区二区 | 欧美色网站导航| 国产偷国产偷亚洲高清人白洁| 一区二区三区自拍| 懂色一区二区三区免费观看| 欧美另类高清zo欧美| 亚洲自拍另类综合| 福利一区二区在线| 欧美成va人片在线观看| 三级成人在线视频| 国产精品 欧美精品| 国产色婷婷亚洲99精品小说| 天天综合色天天| 色8久久精品久久久久久蜜| 中文字幕精品三区| 久久精品国产精品亚洲精品| 欧美一区二区成人| 亚洲成人777| 99久久伊人精品| 国产亚洲一区二区三区四区| 奇米影视一区二区三区小说| 日本精品视频一区二区| 国产精品毛片a∨一区二区三区| 蜜臀精品一区二区三区在线观看 | 精品亚洲aⅴ乱码一区二区三区| 欧美羞羞免费网站| 国产精品第四页| 国产大陆精品国产| 日韩欧美一级片| 国产精品一区不卡| 国产色综合一区| 高清shemale亚洲人妖| 国产午夜亚洲精品午夜鲁丝片| 日韩精品乱码免费| 在线观看一区二区视频| 亚洲影视资源网| 欧美少妇一区二区| 香蕉成人啪国产精品视频综合网 | 一区二区三区欧美日韩| 成人小视频在线| 亚洲国产成人一区二区三区| 国产.欧美.日韩| 一区二区三区丝袜| 欧洲精品一区二区| 亚洲成a人在线观看| 欧美精品精品一区| 视频一区二区三区入口| 91精品国产综合久久香蕉的特点| 日韩中文字幕一区二区三区| 欧美疯狂做受xxxx富婆|