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

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

?? rtree.java

?? 一個java實(shí)現(xiàn)的R樹
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
     * @return An Enumeration containing all tree nodes in the correct order.     */    public Enumeration traversePreOrder() {	class PreOrderEnum implements Enumeration {	    private boolean hasNext = true;	    private Vector nodes;	    private int index = 0;	    public PreOrderEnum() {		AbstractNode root = file.readNode(0);		nodes = traversePreOrder(root);	    }	    public boolean hasMoreElements() {		return hasNext;	    }	    public Object nextElement() {		if (! hasNext) {		    throw new NoSuchElementException("traversePreOrder");		}		Object n = nodes.elementAt(index);		index++;		if (index == nodes.size()) {		    hasNext = false;		}		return n;	    }	};	return new PreOrderEnum();    }        /**     * Returns a Vector with all nodes that intersect with the given HyperCube.     * The nodes are returned in post order traversing     *     * @param h The given HyperCube that is tested for overlapping.     * @param root The node where the search should begin.     * @return A Vector containing the appropriate nodes in the correct order.     */    public Vector intersection(HyperCube h, AbstractNode root) {	if (h == null || root == null) {	    throw new IllegalArgumentException("Arguments cannot be null.");	}	if (h.getDimension() != file.dimension) {	    throw new IllegalArgumentException("HyperCube dimension different than RTree dimension.");	}	Vector v = new Vector();		if (root.getNodeMbb().intersection(h)) {	    v.addElement(root);	    if (!root.isLeaf()) {		for (int i = 0; i < root.usedSpace; i++) {		    if (root.data[i].intersection(h)) {			Vector a = intersection(h, ((Index) root).getChild(i));			for (int j = 0; j < a.size(); j++) {			    v.addElement(a.elementAt(j));			}		    }		}	    }	}	return v;    }    /**     * Returns an Enumeration with all nodes present in the tree that intersect with the given     * HyperCube. The nodes are returned in post order traversing     *     * @param h The given HyperCube that is tested for overlapping.     * @return An Enumeration containing the appropriate nodes in the correct order.     */    public Enumeration intersection(HyperCube h) {	class IntersectionEnum implements Enumeration {	    private boolean hasNext = true;	    private Vector nodes;	    private int index = 0;	    public IntersectionEnum(HyperCube hh) {		nodes = intersection(hh, file.readNode(0));		if (nodes.isEmpty()) {		    hasNext = false;		}	    }	    public boolean hasMoreElements() {		return hasNext;	    }	    	    public Object nextElement() {		if (! hasNext) {		    throw new NoSuchElementException("intersection");		}		Object c = nodes.elementAt(index);		index++;		if (index == nodes.size()) {		    hasNext = false;		}		return c;	    }	};	return new IntersectionEnum(h);    }    /**     * Returns a Vector with all Hypercubes that completely contain HyperCube <B>h</B>.     * The HyperCubes are returned in post order traversing, according to the Nodes where     * they belong.     *     * @param h The given HyperCube.     * @param root The node where the search should begin.     * @return A Vector containing the appropriate HyperCubes in the correct order.     */    public Vector enclosure(HyperCube h, AbstractNode root) {	if (h == null || root == null) throw new	    IllegalArgumentException("Arguments cannot be null.");	if (h.getDimension() != file.dimension) throw new	    IllegalArgumentException("HyperCube dimension different than RTree dimension.");	Vector v = new Vector();	if (root.getNodeMbb().enclosure(h)) {	    v.addElement(root);	    if (!root.isLeaf()) {		for (int i = 0; i < root.usedSpace; i++) {		    if (root.data[i].enclosure(h)) {			Vector a = enclosure(h, ((Index) root).getChild(i));			for (int j = 0; j < a.size(); j++) {			    v.addElement(a.elementAt(j));			}		    }		}	    }	}	return v;    }    /**     * Returns an Enumeration with all Hypercubes present in the tree that contain the given     * HyperCube. The HyperCubes are returned in post order traversing, according to the Nodes where     * they belong.     *     * @param h The given HyperCube.     * @param root The node where the search should begin.     * @return An Enumeration containing the appropriate HyperCubes in the correct order.     */    public Enumeration enclosure(HyperCube h) {	class ContainEnum implements Enumeration {	    private boolean hasNext = true;	    private Vector cubes;	    private int index = 0;	    public ContainEnum(HyperCube hh) {		cubes = enclosure(hh, file.readNode(0));		if (cubes.isEmpty()) {		    hasNext = false;		}	    }	    public boolean hasMoreElements() {		return hasNext;	    }	    	    public Object nextElement() {		if (!hasNext) throw new		    NoSuchElementException("enclosure");		Object c = cubes.elementAt(index);		index++;		if (index == cubes.size()) {		    hasNext = false;		}		return c;	    }	};	return new ContainEnum(h);    }    /**     * Returns a Vector with all Hypercubes that completely contain point <B>p</B>.     * The HyperCubes are returned in post order traversing, according to the Nodes where     * they belong.     *     * @param p The given point.     * @param root The node where the search should begin.     * @return A Vector containing the appropriate HyperCubes in the correct order.     */    public Vector enclosure(Point p, AbstractNode root) {	return enclosure(new HyperCube(p, p), root);    }    /**     * Returns an Enumeration with all Hypercubes present in the tree that contain the given     * point. The HyperCubes are returned in post order traversing, according to the Nodes where     * they belong.     *     * @param p The query point.     * @param root The node where the search should begin.     * @return An Enumeration containing the appropriate HyperCubes in the correct order.     */    public Enumeration enclosure(Point p) {	return enclosure(new HyperCube(p, p));    }    /**     * Returns the nearest HyperCube to the given point.     * [King Lum Cheung and Ada Wai-chee Fu: Enhanced Nearest Neighbor Search on the R-Tree]     *     * @param p The query point.     * @return A vector containing all the nodes lying in the search path until the nearest hypercube     *         is found. Elements are instances of AbstractNode and Data classes. The last Data instance     *         in the vector is the answer to the query.     */    public Vector nearestNeighbor(Point p) {	return nearestNeighborSearch(file.readNode(0), p, Float.POSITIVE_INFINITY);    }    /**     * Used for nearest neighbor recursive search into the RTree structure. <B>n</B> is the current     * node of the active branch list, searched. <B>p</B> is the query point. <B>nearest</B> is the      * distance of <B>p</B> from current nearest hypercube <B>h</B>.     */    protected Vector nearestNeighborSearch(AbstractNode n, Point p, float nearest) {	Vector ret = new Vector();	HyperCube h;	if (n.isLeaf()) {	    for (int i = 0; i < n.usedSpace; i++) {		float dist = n.data[i].getMinDist(p);		if (dist < nearest) {		    h = n.data[i];		    nearest = dist;		    ret.addElement(new Data(h, n.branches[i], n.pageNumber, i));		}	    }	    return ret;	} else {	    // generate Active Branch List.	    class ABLNode {		AbstractNode node;		float minDist;		public ABLNode(AbstractNode node, float minDist) {		    this.node = node;		    this.minDist = minDist;		}	    }	    ABLNode[] abl = new ABLNode[n.usedSpace];	    for (int i = 0; i < n.usedSpace; i++) {		AbstractNode ch = ((Index) n).getChild(i);		abl[i] = new ABLNode(ch , ch.getNodeMbb().getMinDist(p));	    }	    // sort ABL in ascending order of MINDIST from the query point.	    Sort.mergeSort(		abl,		new Comparator() {			public int compare(Object o1, Object o2) {			    float f = ((ABLNode) o1).minDist - 				        ((ABLNode) o2).minDist;			    // do not round the float here. It is wrong!			    if (f > 0) return 1;			    else if (f < 0) return -1;			    else  return 0;			}		}	    );	    // traverse all ABL nodes and prune irrelevant nodes according to the MINDIST heuristic.	    for (int i = 0; i < abl.length; i++) {		if (abl[i].minDist <= nearest) {		    // add node in the results vector, if it complies to the MINDIST heuristic.		    ret.addElement(abl[i].node);		    // recursively continue the search.		    Vector v = nearestNeighborSearch(abl[i].node, p, nearest);		    // find the new nearest distance and add all the nodes accessed, into the current 		    // results vector.		    try {			Object o = v.lastElement();			if (o instanceof AbstractNode) {			    for (int j = 0; j < v.size(); j++) {				ret.addElement(v.elementAt(j));			    }			    AbstractNode an = (AbstractNode) o;			    h = (HyperCube) an.getNodeMbb();			    nearest = h.getMinDist(p);			} else if (o instanceof Data) {			    // if the current node searched was a leaf, than the resulting set definetly			    // contains just one HyperCube, the nearest to the query point.			    h = ((Data) o).mbb;			    nearest = h.getMinDist(p);			    ret.addElement(o);			}		    } catch (NoSuchElementException e) {			// no nearest node or hypercube was found from this recursion step. Leave nearest			// distance intact.		    }		}	    }	    return ret;	}    }    public static void main(String[] args) {	//PersistantPageFile file = new PersistantPageFile("c:/temp/rtree.dat");	CachedPersistentPageFile file = new CachedPersistentPageFile("c:/temp/rtree.dat", 3);	//MemoryPageFile file = new MemoryPageFile();	RTree r = new RTree(2, 0.4f, 3, file, RTree.RTREE_QUADRATIC);	//RTree r = new RTree(file);	float[] f = {10, 20, 40, 70,		     30, 10, 70, 15,		     100, 70, 110, 80,		     0, 50, 30, 55,		     13, 21, 54, 78,		     3, 8, 23, 34,		     200, 29, 202, 50,		     34, 1, 35, 1,		     201, 200, 234, 203,		     56, 69, 58, 70,		     12, 67, 70, 102,		     1, 10, 10, 20	};	for (int i = 0; i < f.length;) {	    Point p1 = new Point(new float[] {f[i++],f[i++]});	    Point p2 = new Point(new float[] {f[i++],f[i++]});	    final HyperCube h = new HyperCube(p1, p2);	    r.insert(h, -2);	}	for (Enumeration e = r.traverseByLevel(); e.hasMoreElements();) {	    System.out.println(e.nextElement());	}	/*	HyperCube h = new HyperCube(new Point(new float[] {10, 15}), new Point(new float[] {23, 24}));	for (Enumeration e = r.intersection(h); e.hasMoreElements();) {	    System.out.println(e.nextElement());	}	Point p = new Point(new float[] {112, 75});	System.out.print("Nearest to " + p + " is ");	System.out.println(r.nearestNeighbor(p));	*/    }} // RTree

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产一区在线观看视频| 亚洲情趣在线观看| 韩国精品主播一区二区在线观看 | 国产精品丝袜一区| 成人高清在线视频| 一区二区三区高清在线| 7777精品伊人久久久大香线蕉| 午夜精品福利在线| 26uuu国产电影一区二区| 国产成人av电影在线| 亚洲欧美乱综合| 欧美精品 国产精品| 久久精品国产99| 日本一区二区不卡视频| 欧美性大战xxxxx久久久| 日韩国产欧美一区二区三区| 欧美xxxx老人做受| 成人污视频在线观看| 亚洲影视在线观看| 日韩精品一区二区三区蜜臀| 丁香六月综合激情| 亚洲电影在线免费观看| www激情久久| 91福利国产成人精品照片| 免费成人在线视频观看| 久久激五月天综合精品| 国产98色在线|日韩| 欧美r级电影在线观看| 99久久综合国产精品| 日本一区中文字幕| 国产精品视频一二三| 亚洲视频图片小说| 国产麻豆精品theporn| 久久精品一区二区三区不卡牛牛| 狠狠色狠狠色合久久伊人| 欧美α欧美αv大片| 国产成人在线影院| 成人免费在线播放视频| 色噜噜狠狠成人中文综合| 亚洲一区视频在线| 91精品国产一区二区三区| 久久国产视频网| 国产欧美一区二区三区在线看蜜臀 | 亚洲成a人v欧美综合天堂下载 | 亚洲精品一线二线三线无人区| 狠狠狠色丁香婷婷综合激情| 久久先锋影音av| 99久久99久久精品国产片果冻| 亚洲欧洲另类国产综合| 欧美三级日韩在线| 美女视频黄频大全不卡视频在线播放| 精品国精品自拍自在线| av电影在线观看一区| 亚洲18色成人| 国产亚洲一区字幕| 色婷婷综合久久| 日本一不卡视频| 国产精品午夜春色av| 欧美色倩网站大全免费| 久久99久久精品| 综合网在线视频| 欧美一区二区免费观在线| 丁香婷婷综合五月| 亚洲午夜在线电影| 久久精品一区蜜桃臀影院| 91在线一区二区三区| 秋霞影院一区二区| 中文字幕一区免费在线观看| 6080午夜不卡| 99亚偷拍自图区亚洲| 美女性感视频久久| 一区二区三区国产| 国产色综合一区| 在线不卡一区二区| 91美女片黄在线观看91美女| 久久精品二区亚洲w码| 亚洲欧美日韩电影| 久久久777精品电影网影网| 欧美日韩国产一区二区三区地区| 国产精品一区二区在线观看网站 | 日韩区在线观看| 99精品一区二区三区| 国产乱码精品一区二区三| 亚洲午夜日本在线观看| 国产精品欧美经典| 精品日韩99亚洲| 欧美美女网站色| 色综合久久久网| 成人免费观看av| 国产一区二区三区免费看| 日韩精品一级中文字幕精品视频免费观看| 国产精品美女久久久久久久| 欧美大片免费久久精品三p| 欧美亚洲国产一区二区三区va| 成人av免费观看| 国产成人久久精品77777最新版本| 偷窥少妇高潮呻吟av久久免费 | 亚洲视频一区二区在线| 国产三级欧美三级日产三级99| 日韩欧美一卡二卡| 欧美精品xxxxbbbb| 欧美日韩一区二区三区在线| 色婷婷久久久综合中文字幕 | 精品国产乱码久久久久久浪潮| 666欧美在线视频| 91麻豆精品国产无毒不卡在线观看 | 成人精品视频一区二区三区| 国产主播一区二区| 国产在线精品一区二区夜色 | 欧美日韩视频在线观看一区二区三区| 91玉足脚交白嫩脚丫在线播放| 成人亚洲精品久久久久软件| 高清不卡一区二区在线| 国产成人8x视频一区二区| 成人精品小蝌蚪| 91婷婷韩国欧美一区二区| a级精品国产片在线观看| 成人激情动漫在线观看| 不卡的看片网站| 91亚洲精品乱码久久久久久蜜桃| 一本久道久久综合中文字幕 | 国内成人自拍视频| 国产精品自拍三区| 成人深夜福利app| 99久久久久免费精品国产| 一本大道综合伊人精品热热| 欧美天堂亚洲电影院在线播放 | 欧亚一区二区三区| 欧美天堂亚洲电影院在线播放| 7777精品伊人久久久大香线蕉的| 欧美本精品男人aⅴ天堂| 欧美国产日韩亚洲一区| 亚洲天堂网中文字| 午夜电影久久久| 国产精品一区在线观看乱码| 91浏览器打开| 日韩一区二区三区电影| 久久亚洲二区三区| 有码一区二区三区| 麻豆视频一区二区| 99久久精品久久久久久清纯| 欧美日韩一区在线观看| 亚洲精品一区在线观看| 亚洲人精品午夜| 麻豆精品新av中文字幕| 99麻豆久久久国产精品免费优播| 欧美三级视频在线播放| 国产情人综合久久777777| 亚洲免费视频中文字幕| 久久99最新地址| 色综合激情五月| 精品蜜桃在线看| 亚洲综合999| 成人中文字幕电影| 欧美一级夜夜爽| 一区二区三区久久久| 国产精品亚洲成人| 777久久久精品| 1区2区3区精品视频| 久久福利视频一区二区| 欧美亚洲综合色| 国产欧美视频一区二区| 日本亚洲视频在线| 色一情一乱一乱一91av| 久久久综合激的五月天| 亚洲国产精品久久久久婷婷884 | 精品剧情在线观看| 亚洲国产欧美在线| 岛国一区二区在线观看| 欧美一区二区女人| 亚洲高清视频的网址| 91蜜桃免费观看视频| 国产日韩欧美亚洲| 麻豆精品在线视频| 777奇米四色成人影色区| 亚洲精品久久7777| 99精品桃花视频在线观看| 久久免费国产精品| 麻豆freexxxx性91精品| 欧美日本韩国一区| 亚洲一二三四在线| 91视频com| 国产精品第四页| 成人黄色av电影| 中文字幕欧美国产| 国产成人综合亚洲91猫咪| 日韩欧美国产综合在线一区二区三区| 亚洲一区二区在线视频| 91在线视频播放| 亚洲精品中文字幕乱码三区 | 亚洲综合一二区| 色综合一区二区| 一区二区三区免费| 在线看不卡av| 亚洲香蕉伊在人在线观| 在线精品视频一区二区三四| 洋洋成人永久网站入口| 在线精品视频小说1| 亚洲大片精品永久免费| 欧美丰满高潮xxxx喷水动漫|