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

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

?? zone.java

?? High performance DB query
?? JAVA
字號:
/* * @(#)$Id: Zone.java,v 1.8 2004/07/02 23:59:20 huebsch Exp $ * * Copyright (c) 2001-2004 Regents of the University of California. * All rights reserved. * * This file is distributed under the terms in the attached BERKELEY-LICENSE * file. If you do not find these files, copies can be found by writing to: * Computer Science Division, Database Group, Universite of California, * 617 Soda Hall #1776, Berkeley, CA 94720-1776. Attention: Berkeley License * * Copyright (c) 2003-2004 Intel Corporation. All rights reserved. * * This file is distributed under the terms in the attached INTEL-LICENSE file. * If you do not find these files, copies can be found by writing to: * Intel Research Berkeley, 2150 Shattuck Avenue, Suite 1300, * Berkeley, CA, 94704.  Attention:  Intel License Inquiry. */package overlay.location.can;import services.network.Payload;import util.network.serialization.GenericByteBuffer;import util.network.serialization.SerializationManager;import util.network.serialization.SerializeArray;/** The class encapsulates a CAN zone.  The zone object contains real-number intervals denoting the span of an area along each dimension.  The number of dimensions is resourceLocation.can.Can.DIM. */public class Zone implements Payload {    public static long serialVersionUID =        SerializationManager.getSerialUID("overlay.location.can.Zone");    private double[][] intervals;    private double[] center;    private double[] scratchCoordinates;    public static final Zone FULL = new Zone(true);    public static final Zone PHANTOM = new Zone(false);    /**     * DeSerialize the object from the provided GenericByteBuffer.     *     * @param inputBuffer     */    public Zone(GenericByteBuffer inputBuffer) {        double[][] newIntervals = new double[Can.DIM][];        for (int i = 0; i < Can.DIM; i++) {            newIntervals[i] = SerializeArray.deSerializeDouble(inputBuffer);        }        init(newIntervals);    }    /**     * Serialize the object into the provided GenericByteBuffer.     *     * @param outputBuffer     * @return     */    public long serialize(GenericByteBuffer outputBuffer) {        for (int i = 0; i < Can.DIM; i++) {            SerializeArray.serializeDouble(outputBuffer, intervals[i]);        }        return serialVersionUID;    }    /** The full-hash-space zone */    private Zone(boolean full) {        intervals = new double[Can.DIM][2];        center = new double[Can.DIM];        scratchCoordinates = new double[Can.DIM];        for (int i = 0; i < Can.DIM; i++) {            intervals[i][0] = 0.0;            if (full == true) {                intervals[i][1] = 1.0;            } else {                intervals[i][1] = 0.0;            }        }        findCenter();    }    /**     * Create a new zone given an array of intervals.     *     * @param newIntervals     */    public Zone(double[][] newIntervals) {        init(newIntervals);    }    /**     * Create a copy of a Zone.     *     * @param oldZone     */    public Zone(Zone oldZone) {        init(oldZone.intervals);    }    private void init(double[][] newIntervals) {        intervals = new double[Can.DIM][2];        center = new double[Can.DIM];        scratchCoordinates = new double[Can.DIM];        for (int i = 0; i < Can.DIM; i++) {            intervals[i][0] = newIntervals[i][0];            intervals[i][1] = newIntervals[i][1];        }        findCenter();        if ( !validZone()) {            throw new RuntimeException("Bad zone");        }    }    /**     * Span of zone     * @return     */    public double getArea() {        double area = 1;        // find the percentage of the space for each dimension        for (int i = 0; i < Can.DIM; i++) {            area *= (intervals[i][1] - intervals[i][0]);        }        return area;    }    /** Compute the center of this zone */    private void findCenter() {        for (int i = 0; i < Can.DIM; i++) {            center[i] = (intervals[i][0] + intervals[i][1]) / 2.0;        }    }    /**     * Method getIntervals     * @return     */    public double[][] getIntervals() {        return intervals;    }    /**     * Method getCenter     * @return     */    public double[] getCenter() {        return center;    }    /**     * Returns TRUE is both zones have same center. Acts as a unique identifier for each zone     *     * @param zone     * @return     */    public boolean equalCenter(Zone zone) {        double[] yourCenter = zone.getCenter();        if (yourCenter.length != center.length) {            return false;        }        for (int k = 0; k < center.length; k++) {            if (yourCenter[k] != center[k]) {                return false;            }        }        return true;    }    /**     * Containment check.  If all coordinates are within the corresponding intervals, return true and false otherwise.     *     * @param coordinates     * @return     */    public boolean contains(double[] coordinates) {        for (int i = 0; i < Can.DIM; i++) {            if ((coordinates[i] < intervals[i][0])                    || (coordinates[i] >= intervals[i][1])) {                return false;            }        }        return true;    }    /**     * Calculate the distance from the center of this zone to the given point     *     * @param coordinates     * @return     */    public double distance(double[] coordinates) {        double distance = 0;        double projection;        for (int i = 0; i < Can.DIM; i++) {            projection = (coordinates[i] - center[i]);            projection *= projection;            distance += projection;        }        return Math.sqrt(distance);    }    /**     * Does the given zone overlap this one along the given axis?     *     * @param zone     * @param dimension     * @return     */    public boolean overlaps(Zone zone, int dimension) {        double a = intervals[dimension][0];        double b = intervals[dimension][1];        double c = zone.intervals[dimension][0];        double d = zone.intervals[dimension][1];        return (((a >= c) && (a < d)) || ((b > c) && (b <= d))                || ((c >= a) && (c < b)) || ((d > a) && (d <= b)));    }    /**     * Does the given zone overlap this one, must overlap on all dimensions     *     * @param zone     * @return     */    public boolean overlaps(Zone zone) {        for (int i = 0; i < Can.DIM; i++) {            if (this.overlaps(zone, i) == false) {                return false;            }        }        return true;    }    /**     * Check if the given zone abut me in the given direction and dimension     *     * @param zone     * @param dimension     * @param low     * @return     */    public boolean abuts(Zone zone, int dimension, boolean low) {        return ((low && (intervals[dimension][0]                         % 1.0 == zone.intervals[dimension][1]                                  % 1.0)) || ( !low && (intervals[dimension][1]                                                        % 1.0 == zone.intervals[dimension][0]                                                            % 1.0)));    }    /**     * In which dimension does the given zone neighbor me? The result     * is the dimension number or -1 if the zone doesn't neighbor me.     *     * @param zone     * @return     */    public int neighbors(Zone zone) {        int overlaps = 0;        int abuts = 0;        int abutsDim = -1;        for (int dimension = 0; dimension < Can.DIM; dimension++) {            if (overlaps(zone, dimension)) {                overlaps++;            } else {                if (abuts(zone, dimension, true)                        || abuts(zone, dimension, false)) {                    abutsDim = dimension;                    abuts++;                } else {                    return -1;                }            }        }        if ((abuts != 1) || (overlaps != Can.DIM - 1)) {            return -1;        } else {            return abutsDim;        }    }    /**     * returns true if can merge with zone     *     * @param zone     * @return     */    public boolean canMerge(Zone zone) {        double[][] currentIntervals = this.getIntervals();        double[][] arrivalIntervals = zone.getIntervals();        double[][] newIntervals = new double[Can.DIM][2];        int neighborDimension = neighbors(zone);        for (int k = 0; k < Can.DIM; k++) {            for (int j = 0; j < 2; j++) {                if (k == neighborDimension) {                    newIntervals[k][0] = Math.min(currentIntervals[k][0],                                                  arrivalIntervals[k][0]);                    newIntervals[k][1] = Math.max(currentIntervals[k][1],                                                  arrivalIntervals[k][1]);                } else {                    newIntervals[k][0] = currentIntervals[k][0];                    newIntervals[k][1] = currentIntervals[k][1];                }            }        }        Zone newZone = new Zone(newIntervals);        return (newZone.getArea() == (getArea() + zone.getArea()));    }    /**     * Find the closest-point distance of this zone to the given point     *     * @param coordinates     * @return     */    public double closestPointDistance(double[] coordinates) {        // Fill up the temporary coordinates with my closest point and then measure the distance between the two        for (int i = 0; i < Can.DIM; i++) {            // if this value is under my low value            if (coordinates[i] < intervals[i][0]) {                // Then compare its distance from my low value to its distance shifted by one tile to my high value                if ((intervals[i][0] - coordinates[i])                        < (coordinates[i] + 1.0 - intervals[i][1])) {                    // If it's closer to the low point, use the low point                    scratchCoordinates[i] = intervals[i][0];                } else {                    scratchCoordinates[i] = intervals[i][1];                }            } else if (coordinates[i] < intervals[i][1]) {                // Otherwise, if the point is under my high value (i.e., within my interval, just use the point itself                scratchCoordinates[i] = coordinates[i];            } else {                // Otherwise, (i.e., the point is over my high value), compare its distance from my high value to its distance shifted left to my low value and use my interval value that's closest                if ((coordinates[i] - intervals[i][1])                        < (intervals[i][0] - (coordinates[i] - 1.0))) {                    scratchCoordinates[i] = intervals[i][1];                } else {                    scratchCoordinates[i] = intervals[i][0];                }            }        }        // Now that we have in scratch my closest point, measure the distance from the coordinates.  Measure the closest torus distance, i.e., the distance where all points are at most .5 from each other in every dimension        double distance = 0;        double projection;        for (int i = 0; i < Can.DIM; i++) {            projection = Math.abs(coordinates[i] - scratchCoordinates[i]);            if (projection > .5) {                projection = 1.0 - projection;            }            projection *= projection;            distance += projection;        }        return Math.sqrt(distance);    }    /**     * Return the number of intervals that contain the projection of this point     *     * @param coordinates     * @return     */    public int dimensionContainment(double[] coordinates) {        int counter = 0;        for (int i = 0; i < Can.DIM; i++) {            if ((coordinates[i] >= intervals[i][0])                    && (coordinates[i] < intervals[i][1])) {                counter++;            }        }        return counter;    }    /**     * Method validZone     * @return     */    public boolean validZone() {        // Check if intervals have correct number of dimensions        if (intervals.length != Can.DIM) {            return false;        }        for (int i = 0; i < Can.DIM; i++) {            // Check to make sure interval is the proper size, 2, low and high            if (intervals[i].length != 2) {                return false;            }            // Check if low end is in bounds            if ((intervals[i][0] < 0) || (intervals[i][0] > 1)) {                return false;            }            // Check if high end is out of bounds            if ((intervals[i][1] < 0) || (intervals[i][1] > 1)) {                return false;            }            // Check if high is actually higher than low            if (intervals[i][0] >= intervals[i][1]) {                return false;            }        }        return true;    }    /**     * Method getSize     * @return     */    public int getSize() {        return (Payload.DOUBLE_SIZE * 2 * Can.DIM);    }    /**     * Method toString     * @return     */    public String toString() {        String outStr = new String("<ZONE: (");        for (int i = 0; i < Can.DIM; i++) {            outStr += intervals[i][0] + " ";        }        outStr += ") to (";        for (int i = 0; i < Can.DIM; i++) {            outStr += intervals[i][1] + " ";        }        return outStr + ")>";    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品久久久久久最新网址| 亚洲三级电影网站| 国产乱子伦视频一区二区三区| 欧美一区二区大片| 免费久久99精品国产| 日韩欧美色电影| 国产在线麻豆精品观看| 久久影院电视剧免费观看| 国产精品自拍一区| 国产精品拍天天在线| 99精品欧美一区二区蜜桃免费 | 欧美电视剧在线看免费| 久久97超碰色| 国产片一区二区| 成人h动漫精品一区二区| 最近日韩中文字幕| 在线观看区一区二| 日韩在线卡一卡二| 精品国一区二区三区| 国产成人精品亚洲777人妖 | 丝袜美腿亚洲色图| 欧美一区二区免费视频| 狠狠色丁香婷综合久久| 国产午夜精品一区二区三区嫩草| 成人性生交大片免费看中文 | 亚洲视频中文字幕| 欧美三区免费完整视频在线观看| 天天av天天翘天天综合网 | 久久免费看少妇高潮| 成人毛片视频在线观看| 亚洲免费在线播放| 欧美高清视频在线高清观看mv色露露十八 | 精品国产乱码久久久久久免费| 国产激情一区二区三区桃花岛亚洲| 国产精品不卡在线观看| 99re视频这里只有精品| 亚洲欧洲精品一区二区精品久久久| 亚洲国产精品视频| 亚洲日本在线视频观看| 亚洲精品一区在线观看| 亚洲在线中文字幕| 在线综合视频播放| 国产传媒一区在线| 中文字幕中文字幕中文字幕亚洲无线| 色欧美片视频在线观看| 日韩精品一级中文字幕精品视频免费观看 | 91麻豆精品国产91久久久久久久久| 亚洲成人一二三| 欧美mv日韩mv| av激情成人网| 日本视频免费一区| 国产精品三级电影| 欧美日韩国产大片| 国产高清成人在线| 亚洲影院免费观看| 26uuu国产日韩综合| 91香蕉视频mp4| 美女性感视频久久| 亚洲日本丝袜连裤袜办公室| 日韩视频在线永久播放| av在线不卡免费看| 男女性色大片免费观看一区二区 | 欧美国产丝袜视频| 欧美色综合网站| 国产高清亚洲一区| 性做久久久久久免费观看 | 久久精品男人天堂av| 在线观看视频一区| 国产精品1区2区3区在线观看| 亚洲一二三四在线| 国产精品无人区| 日韩丝袜美女视频| 欧美性生活久久| 成人精品视频一区| 久久国产婷婷国产香蕉| 中文字幕佐山爱一区二区免费| 日韩一级片在线观看| 色哟哟在线观看一区二区三区| 国产专区综合网| 天堂久久久久va久久久久| 1024成人网| 国产亚洲欧美在线| 91精品国产综合久久精品麻豆| 99久久精品国产精品久久| 国产在线精品视频| 亚洲一区二区三区四区五区中文| 日本一区二区综合亚洲| 日韩一级免费观看| 精品视频999| 色综合久久久久久久久| 粉嫩蜜臀av国产精品网站| 美国欧美日韩国产在线播放| 亚洲一二三专区| 亚洲欧美一区二区三区极速播放 | 色综合天天综合网天天狠天天| 国产一区在线观看麻豆| 亚洲一区二区美女| 18成人在线观看| 欧美国产欧美综合| 久久夜色精品一区| 日韩欧美成人激情| 欧美一区二区三区喷汁尤物| 欧美在线观看视频一区二区| 99国产精品久久久久| 成人做爰69片免费看网站| 国产又黄又大久久| 精品一区二区三区香蕉蜜桃| 三级久久三级久久久| 一区二区三区视频在线看| 日韩伦理av电影| 国产精品欧美一级免费| 国产欧美日产一区| 中文成人av在线| 久久久精品tv| 国产午夜久久久久| 欧美激情一区二区三区全黄| 久久九九99视频| 日韩亚洲欧美综合| 日韩一二三区不卡| 欧美电影免费提供在线观看| 日韩欧美电影在线| 日韩欧美一区二区免费| 91精品国产乱| 欧美一区二区三区在线视频| 欧美私人免费视频| 欧洲生活片亚洲生活在线观看| 一本一道综合狠狠老| 色综合一区二区| 在线观看欧美日本| 色综合久久九月婷婷色综合| 91老师国产黑色丝袜在线| 91香蕉视频污在线| 91丨porny丨国产入口| 91免费看片在线观看| 欧洲精品中文字幕| 欧美日韩国产一级二级| 欧美日韩国产在线播放网站| 91久久奴性调教| 成人在线综合网站| av电影在线观看一区| 91麻豆国产在线观看| 欧美在线观看一区| 日韩亚洲欧美高清| 久久久综合精品| 国产精品网曝门| 亚洲欧美日韩系列| 亚洲国产成人高清精品| 日本亚洲天堂网| 国内精品国产成人国产三级粉色 | 另类中文字幕网| 国产呦萝稀缺另类资源| 国产98色在线|日韩| 91女神在线视频| 337p亚洲精品色噜噜| 精品国免费一区二区三区| 久久久精品2019中文字幕之3| 国产精品久久午夜夜伦鲁鲁| 一区二区三区四区高清精品免费观看| 亚洲成a人片在线不卡一二三区| 奇米四色…亚洲| 国产高清久久久久| 色天天综合久久久久综合片| 91精品视频网| 国产欧美精品一区二区色综合| 亚洲欧美日韩中文字幕一区二区三区| 亚洲成av人片一区二区梦乃| 麻豆国产精品777777在线| 国产成人午夜99999| www.成人在线| 欧美乱妇15p| 久久免费电影网| 一区二区三区四区精品在线视频| 男男成人高潮片免费网站| 国产99久久久国产精品免费看| 91福利视频网站| 精品国产a毛片| ㊣最新国产の精品bt伙计久久| 午夜精品免费在线| 国产成人免费网站| 欧美亚洲日本一区| 久久久精品免费网站| 亚洲一区二区精品3399| 韩国一区二区三区| 色香蕉成人二区免费| 欧美不卡视频一区| 亚洲欧美日韩国产中文在线| 麻豆成人在线观看| 色综合久久综合网| 精品88久久久久88久久久| 亚洲美女免费视频| 久久99精品网久久| 欧美午夜视频网站| 国产三区在线成人av| 亚洲一区国产视频| av高清不卡在线| 久久久久久夜精品精品免费| 首页综合国产亚洲丝袜| 99re66热这里只有精品3直播 | 国产女人18水真多18精品一级做| 日本aⅴ免费视频一区二区三区|