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

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

?? topology.java

?? The ElectricTM VLSI Design System is an open-source Electronic Design Automation (EDA) system that c
?? JAVA
字號(hào):
/* -*- tab-width: 4 -*- * * Electric(tm) VLSI Design System * * File: Topology.java * Written by: Dmitry Nadezhin, Sun Microsystems. * * Copyright (c) 2006 Sun Microsystems and Static Free Software * * Electric(tm) is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * Electric(tm) is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Electric(tm); see the file COPYING.  If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, Mass 02111-1307, USA. */package com.sun.electric.database.topology;import com.sun.electric.database.CellRevision;import com.sun.electric.database.ImmutableArcInst;import com.sun.electric.database.geometry.Poly;import com.sun.electric.database.hierarchy.Cell;import com.sun.electric.database.hierarchy.EDatabase;import com.sun.electric.database.id.CellId;import com.sun.electric.database.text.ImmutableArrayList;import com.sun.electric.database.text.Name;import com.sun.electric.database.text.TextUtils;import com.sun.electric.technology.BoundsBuilder;import java.awt.geom.Rectangle2D;import java.util.ArrayList;import java.util.Arrays;import java.util.Iterator;/** * A class to manage nodes and arcs of a Cell. */public class Topology {    /** Owner cell of this Topology. */                             final Cell cell;    /** A maximal suffix of temporary arc name. */                  private int maxArcSuffix = -1;    /** Chronological list of ArcInst in this Cell. */              private final ArrayList<ArcInst> chronArcs = new ArrayList<ArcInst>();    /** A list of ArcInsts in this Cell. */							private final ArrayList<ArcInst> arcs = new ArrayList<ArcInst>();    /** True if arc bounds are valid. */                            boolean validArcBounds;	/** The geometric data structure. */							private RTNode rTree = RTNode.makeTopLevel();    /** True of RTree matches node/arc sizes */                     private boolean rTreeFresh;    /** Creates a new instance of Topology */    public Topology(Cell cell, boolean loadBackup) {        this.cell = cell;        if (loadBackup)            updateArcs(cell.backup().cellRevision);    }	/****************************** ARCS ******************************/	/**	 * Method to return an Iterator over all ArcInst objects in this Cell.	 * @return an Iterator over all ArcInst objects in this Cell.	 */	public synchronized Iterator<ArcInst> getArcs()	{        ArrayList<ArcInst> arcsCopy = new ArrayList<ArcInst>(arcs);		return arcsCopy.iterator();	}	/**	 * Method to return the number of ArcInst objects in this Cell.	 * @return the number of ArcInst objects in this Cell.	 */	public int getNumArcs()	{		return arcs.size();	}	/**	 * Method to return the ArcInst at specified position.	 * @param arcIndex specified position of ArcInst.	 * @return the ArcInst at specified position..	 */	public final ArcInst getArc(int arcIndex)	{		return arcs.get(arcIndex);	}	/**	 * Method to return the ArcInst by its chronological index.	 * @param arcId chronological index of ArcInst.	 * @return the ArcInst with specified chronological index.	 */	public ArcInst getArcById(int arcId)	{		return arcId < chronArcs.size() ? chronArcs.get(arcId) : null;	}    public int[] getArcIndexByArcIdMap() {        int[] arcIndexByArcIdMap = new int[chronArcs.size()];        Arrays.fill(arcIndexByArcIdMap, -1);        for (int arcIndex = 0; arcIndex < getNumArcs(); arcIndex++) {            int arcId = getArc(arcIndex).getArcId();            assert arcIndexByArcIdMap[arcId] == -1;            arcIndexByArcIdMap[arcId] = arcIndex;        }        return arcIndexByArcIdMap;    }	/**	 * Method to find a named ArcInst on this Cell.	 * @param name the name of the ArcInst.	 * @return the ArcInst.  Returns null if none with that name are found.	 */	public ArcInst findArc(String name)	{		int arcIndex = searchArc(name, 0);		if (arcIndex >= 0) return arcs.get(arcIndex);		arcIndex = - arcIndex - 1;		if (arcIndex < arcs.size())		{			ArcInst ai = arcs.get(arcIndex);			if (ai.getName().equals(name)) return ai;		}		return null;	}	/**	 * Method to add a new ArcInst to the cell.	 * @param ai the ArcInst to be included in the cell.	 */	void addArc(ArcInst ai)	{        cell.setTopologyModified();        validArcBounds = false;        unfreshRTree();		int arcIndex = searchArc(ai);		assert arcIndex < 0;		arcIndex = - arcIndex - 1;		arcs.add(arcIndex, ai);        int arcId = ai.getArcId();        while (chronArcs.size() <= arcId) chronArcs.add(null);        assert chronArcs.get(arcId) == null;        chronArcs.set(arcId, ai);        // update maximal arc name suffux temporary name		if (ai.isUsernamed()) return;		Name name = ai.getNameKey();        assert name.getBasename() == ImmutableArcInst.BASENAME;        maxArcSuffix = Math.max(maxArcSuffix, name.getNumSuffix());        cell.setDirty();	}	/**	 * Method to return unique autoname for ArcInst in this cell.	 * @return a unique autoname for ArcInst in this cell.	 */	Name getArcAutoname()	{        if (maxArcSuffix < Integer.MAX_VALUE)            return ImmutableArcInst.BASENAME.findSuffixed(++maxArcSuffix);        for (int i = 0;; i++) {            Name name = ImmutableArcInst.BASENAME.findSuffixed(i);            if (!hasTempArcName(name)) return name;        }	}	/**	 * Method check if ArcInst with specified temporary name key exists in a cell.	 * @param name specified temorary name key.	 */	boolean hasTempArcName(Name name)	{		return name.isTempname() && findArc(name.toString()) != null;	}	/**	 * Method to remove an ArcInst from the cell.	 * @param ai the ArcInst to be removed from the cell.	 */	void removeArc(ArcInst ai)	{		cell.checkChanging();        cell.setTopologyModified();        unfreshRTree();		assert ai.isLinked();		int arcIndex = searchArc(ai);		ArcInst removedAi = arcs.remove(arcIndex);		assert removedAi == ai;        int arcId = ai.getArcId();        assert chronArcs.get(arcId) == ai;        chronArcs.set(arcId, null);        cell.setDirty();	}    public ImmutableArcInst[] backupArcs(ImmutableArrayList<ImmutableArcInst> oldArcs) {        ImmutableArcInst[] newArcs = new ImmutableArcInst[arcs.size()];        boolean changed = arcs.size() != oldArcs.size();        for (int i = 0; i < arcs.size(); i++) {            ArcInst ai = arcs.get(i);            ImmutableArcInst d = ai.getD();            changed = changed || oldArcs.get(i) != d;            newArcs[i] = d;        }        return changed ? newArcs : null;    }    public void updateArcs(CellRevision newRevision) {        validArcBounds = false;        arcs.clear();        maxArcSuffix = -1;        for (int i = 0; i < newRevision.arcs.size(); i++) {            ImmutableArcInst d = newRevision.arcs.get(i);            while (d.arcId >= chronArcs.size()) chronArcs.add(null);            ArcInst ai = chronArcs.get(d.arcId);            PortInst headPi = cell.getPortInst(d.headNodeId, d.headPortId);            PortInst tailPi = cell.getPortInst(d.tailNodeId, d.tailPortId);            if (ai != null && (/*!full ||*/ ai.getHeadPortInst() == headPi && ai.getTailPortInst() == tailPi)) {                ai.setDInUndo(d);            } else {                ai = new ArcInst(this, d, headPi, tailPi);                chronArcs.set(d.arcId, ai);            }            arcs.add(ai);            if (!ai.isUsernamed()) {                Name name = ai.getNameKey();                assert name.getBasename() == ImmutableArcInst.BASENAME;                maxArcSuffix = Math.max(maxArcSuffix, name.getNumSuffix());            }        }        int arcCount = 0;        for (int i = 0; i < chronArcs.size(); i++) {            ArcInst ai = chronArcs.get(i);            if (ai == null) continue;            int arcIndex = searchArc(ai);            if (arcIndex < 0 || arcIndex >= arcs.size() || ai != arcs.get(arcIndex)) {                chronArcs.set(i, null);                continue;            }            arcCount++;        }        assert arcCount == arcs.size();    }    /**     * Low-level routine.     */    public void computeArcBounds() {        if (!cell.getDatabase().canComputeBounds())            return;        int[] intCoords = new int[4];        BoundsBuilder b = new BoundsBuilder(cell);        for (int arcIndex = 0; arcIndex < arcs.size(); arcIndex++) {            ArcInst ai = arcs.get(arcIndex);            ai.computeBounds(b, intCoords);        }        validArcBounds = true;    }    private int searchArc(ArcInst ai) {        return searchArc(ai.getName(), ai.getArcId());    }    /**     * Searches the arcs for the specified (name,arcId) using the binary     * search algorithm.     * @param name the name to be searched.	 * @param arcId the arcId index to be searched.     * @return index of the search name, if it is contained in the arcs;     *	       otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The     *	       <i>insertion point</i> is defined as the point at which the     *	       ArcInst would be inserted into the list: the index of the first     *	       element greater than the name, or <tt>arcs.size()</tt>, if all     *	       elements in the list are less than the specified name.  Note     *	       that this guarantees that the return value will be &gt;= 0 if     *	       and only if the ArcInst is found.     */	private int searchArc(String name, int arcId)	{		int low = 0;		int high = arcs.size()-1;        int pick = high; // initially try the last postition		while (low <= high) {			ArcInst ai = arcs.get(pick);			int cmp = TextUtils.STRING_NUMBER_ORDER.compare(ai.getName(), name);			if (cmp == 0) cmp = ai.getArcId() - arcId;			if (cmp < 0)				low = pick + 1;			else if (cmp > 0)				high = pick - 1;			else				return pick; // ArcInst found			pick = (low + high) >> 1; // try in a middle		}		return -(low + 1);  // ArcInst not found.    }//    void setArcsModified() {//        cell.checkChanging();//        cell.setTopologyModified();//    }	/****************************** GRAPHICS ******************************/    /**	 * Method to return an interator over all RTBounds objects in a given area of this Cell that allows     * to ignore elements touching the area.     * Note that Geometric objects implement RTBounds, so for database searches, the iterator     * returns Geometrics (NodeInsts and ArcInsts).	 * @param bounds the specified area to search.     * @param includeEdges true if RTBounds objects along edges are considered in.	 * @return an iterator over all of the RTBounds objects in that area.	 */    public Iterator<RTBounds> searchIterator(Rectangle2D bounds, boolean includeEdges) {        return new RTNode.Search(bounds, getRTree(), includeEdges);    }    public void unfreshRTree() {        rTreeFresh = false;    }	/**	 * Method to R-Tree of this Cell.	 * The R-Tree organizes all of the Geometric objects spatially for quick search.	 * @return R-Tree of this Cell.	 */    public RTNode getRTree() {        if (rTreeFresh) return rTree;        EDatabase database = cell.getDatabase();        if (database.canComputeBounds()) {            rebuildRTree();            rTreeFresh = true;//        } else {//            Snapshot snapshotBefore = database.getFreshSnapshot();//            rebuildRTree();//            rTreeFresh = snapshotBefore != null && database.getFreshSnapshot() == snapshotBefore;        }        return rTree;    }    public void rebuildRTree() {//        long startTime = System.currentTimeMillis();        if (!validArcBounds)            computeArcBounds();        CellId cellId = cell.getId();        RTNode root = RTNode.makeTopLevel();        for (Iterator<NodeInst> it = cell.getNodes(); it.hasNext(); ) {            NodeInst ni = it.next();            root = RTNode.linkGeom(cellId, root, ni);        }        for (Iterator<ArcInst> it = cell.getArcs(); it.hasNext(); ) {            ArcInst ai = it.next();            root = RTNode.linkGeom(cellId, root, ai);        }        root.checkRTree(0, cellId);        rTree = root;        rTreeFresh = true;//        long stopTime = System.currentTimeMillis();//        if (Job.getDebug()) System.out.println("Rebuilding R-Tree in " + this + " took " + (stopTime - startTime) + " msec");    }    /**     * Method to check invariants in this Cell.     * @exception AssertionError if invariants are not valid     */    public void check() {        // check arcs        ArcInst prevAi = null;        Poly.Builder polyBuilder = Poly.newGridBuilder();        for(int arcIndex = 0; arcIndex < arcs.size(); arcIndex++) {            ArcInst ai = arcs.get(arcIndex);            ImmutableArcInst a = ai.getD();            assert ai.getParent() == cell;            assert chronArcs.get(a.arcId) == ai;            if (prevAi != null) {                int cmp = TextUtils.STRING_NUMBER_ORDER.compare(prevAi.getName(), ai.getName());                assert cmp <= 0;                if (cmp == 0)                    assert prevAi.getArcId() < a.arcId;            }            assert ai.getHeadPortInst() == cell.getPortInst(a.headNodeId, a.headPortId);            assert ai.getTailPortInst() == cell.getPortInst(a.tailNodeId, a.tailPortId);            ai.check(polyBuilder);            prevAi = ai;        }        for (int arcId = 0; arcId < chronArcs.size(); arcId++) {            ArcInst ai = chronArcs.get(arcId);            if (ai == null) continue;            assert ai.getArcId() == arcId;            int arcIndex = searchArc(ai);            assert ai == arcs.get(arcIndex);        }        if (rTreeFresh)            rTree.checkRTree(0, cell.getId());    }}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一级久久久久久久大片| 亚洲不卡一区二区三区| 精品国产区一区| 欧美一区二区三区视频免费播放| 色婷婷国产精品综合在线观看| www.欧美日韩| 成人午夜在线免费| 国产sm精品调教视频网站| 国产美女精品人人做人人爽| 国产一区二区不卡在线| 免费在线视频一区| 狠狠色狠狠色综合系列| 高清不卡在线观看| 黄色精品一二区| 五月综合激情网| 91丨九色丨蝌蚪丨老版| 色天天综合色天天久久| 国内精品国产成人| 秋霞午夜鲁丝一区二区老狼| 一区二区三区电影在线播| 国产欧美一区二区精品忘忧草 | 91理论电影在线观看| 久久精品国产澳门| 五月天亚洲婷婷| 亚洲国产欧美另类丝袜| 亚洲三级在线免费观看| 欧美高清在线视频| 久久精品男人天堂av| 欧美mv日韩mv国产网站app| 6080午夜不卡| 欧美另类z0zxhd电影| 欧洲激情一区二区| 不卡在线视频中文字幕| 成人免费毛片app| 国产ts人妖一区二区| 国产中文一区二区三区| 国产在线播放一区三区四| 蜜臀va亚洲va欧美va天堂| 日韩av电影免费观看高清完整版| 亚洲第一久久影院| 亚洲电影一级黄| 视频一区在线视频| 欧美aaa在线| 久久精品国产亚洲高清剧情介绍| 日本在线不卡一区| 蜜臀av性久久久久蜜臀aⅴ流畅| 日韩av一级电影| 日韩综合小视频| 美女久久久精品| 久久国内精品视频| 国产一区二区三区香蕉| 国产精品综合久久| 成人h精品动漫一区二区三区| 成人福利在线看| 日本黄色一区二区| 欧美日韩中文字幕一区二区| 欧美区在线观看| 欧美一区二区黄| 欧美xxx久久| 中文字幕av一区二区三区| 国产精品视频yy9299一区| 亚洲视频你懂的| 亚洲成在人线免费| 久久精品久久久精品美女| 久久精品国产一区二区三 | 欧美浪妇xxxx高跟鞋交| 欧美午夜一区二区| 欧美一二三区精品| 久久九九影视网| 国产精品每日更新在线播放网址| 亚洲人妖av一区二区| 一区二区三区日韩欧美| 亚洲成人一区在线| 国产综合久久久久久鬼色 | 亚洲色图色小说| 香蕉影视欧美成人| 国产精品一区二区免费不卡 | 精品美女被调教视频大全网站| 国产欧美日韩在线视频| 一区二区三区精品视频| 久久精品国产**网站演员| 成人影视亚洲图片在线| 欧美日韩一区二区三区在线看| 精品久久久久久久人人人人传媒 | 亚洲国产精品精华液2区45| 亚洲欧美一区二区三区极速播放| 日产国产欧美视频一区精品| 国产白丝网站精品污在线入口| 91免费国产视频网站| 91精品国产综合久久久蜜臀粉嫩 | 亚洲色图制服诱惑| 日韩经典一区二区| 97久久超碰国产精品电影| 欧美一区二区视频免费观看| 国产欧美精品一区二区色综合 | 麻豆91在线播放| 99re成人精品视频| 精品国产免费久久| 亚洲一区二区三区国产| 国产v综合v亚洲欧| 亚洲摸摸操操av| 精品一区二区三区免费播放| 91在线视频官网| 精品国产一区二区三区久久久蜜月| 国产精品免费久久久久| 青青草原综合久久大伊人精品| 波多野结衣精品在线| 欧美va在线播放| 日韩成人精品视频| 色婷婷久久综合| 26uuuu精品一区二区| 亚洲成av人片www| 色婷婷久久久亚洲一区二区三区| 国产亚洲自拍一区| 美女爽到高潮91| 欧美日韩一二区| 国产精品国产三级国产aⅴ中文| 久久99国产精品尤物| 欧美日韩亚洲综合在线| 亚洲精品视频在线观看网站| 国产精品一级片在线观看| 欧美一级二级在线观看| 午夜一区二区三区在线观看| 91日韩一区二区三区| 国产精品久久久久久久蜜臀 | 欧日韩精品视频| 国产精品不卡一区| 国产99久久久国产精品| 久久在线观看免费| 久久激情综合网| 91精品在线一区二区| 亚洲成av人片一区二区三区| 欧美主播一区二区三区| 一区二区日韩av| 99re8在线精品视频免费播放| 国产精品久久久久久久久搜平片| 国产一区二区伦理| 久久日一线二线三线suv| 麻豆成人免费电影| 欧美大肚乱孕交hd孕妇| 国产综合成人久久大片91| 久久综合给合久久狠狠狠97色69| 激情文学综合插| 精品国产sm最大网站免费看| 久久99久久精品| 久久影院午夜论| 国产电影精品久久禁18| 国产精品久久久久四虎| 91亚洲男人天堂| 亚洲欧美日韩一区| 在线观看日韩高清av| 午夜电影网一区| 精品免费一区二区三区| 国产精品一区二区在线观看网站| 国产亚洲福利社区一区| www.欧美亚洲| 亚洲午夜日本在线观看| 91精品综合久久久久久| 国产麻豆精品视频| 日韩一区欧美一区| 欧洲国内综合视频| 免费视频一区二区| 久久久影视传媒| av高清不卡在线| 亚洲成人激情综合网| 日韩三级伦理片妻子的秘密按摩| 国产一区二区三区日韩| 国产精品传媒视频| 在线综合视频播放| 韩国欧美国产1区| 亚洲男人都懂的| 日韩欧美国产电影| 99久久夜色精品国产网站| 亚洲狠狠爱一区二区三区| 亚洲精品一区二区三区四区高清| 成人国产精品免费观看| 五月综合激情网| 日本一区二区不卡视频| 欧美三级电影精品| 丁香网亚洲国际| 亚洲电影第三页| 国产精品嫩草久久久久| 337p亚洲精品色噜噜噜| 豆国产96在线|亚洲| 亚洲午夜激情av| 国产日韩av一区二区| 欧美综合天天夜夜久久| 国产一区二区网址| 亚洲第一搞黄网站| 国产清纯美女被跳蛋高潮一区二区久久w| 91麻豆免费看| 久久99精品一区二区三区 | 国产精品一区二区在线观看不卡| 一区二区三区四区亚洲| 久久色成人在线| 欧美日韩国产一级片| 高清不卡一二三区| 日韩av电影一区| 亚洲国产日韩a在线播放性色| 久久精品亚洲国产奇米99|