Examples of InputGraph


Examples of com.sun.hotspot.igv.data.InputGraph

    private static InputGraph createDiff(InputGraph a, InputGraph b, Set<Pair> pairs) {
        Group g = new Group();
        g.setMethod(a.getGroup().getMethod());
        g.setAssembly(a.getGroup().getAssembly());
        g.getProperties().setProperty("name", "Difference");
        InputGraph graph = new InputGraph(g, null);
        graph.setName(a.getName() + ", " + b.getName());
        graph.setIsDifferenceGraph(true);

        Set<InputNode> nodesA = new HashSet<InputNode>(a.getNodes());
        Set<InputNode> nodesB = new HashSet<InputNode>(b.getNodes());

        Map<InputNode, InputNode> inputNodeMap = new HashMap<InputNode, InputNode>();
        for (Pair p : pairs) {
            InputNode n = p.getN1();
            assert nodesA.contains(n);
            InputNode nB = p.getN2();
            assert nodesB.contains(nB);

            nodesA.remove(n);
            nodesB.remove(nB);
            InputNode n2 = new InputNode(n);
            inputNodeMap.put(n, n2);
            inputNodeMap.put(nB, n2);
            graph.addNode(n2);
            markAsChanged(n2, n, nB);
        }

        for (InputNode n : nodesA) {
            InputNode n2 = new InputNode(n);
            graph.addNode(n2);
            markAsNew(n2);
            inputNodeMap.put(n, n2);
        }

        for (InputNode n : nodesB) {
            InputNode n2 = new InputNode(n);
            n2.setId(-n2.getId());
            graph.addNode(n2);
            markAsDeleted(n2);
            inputNodeMap.put(n, n2);
        }

        Collection<InputEdge> edgesA = a.getEdges();
        Collection<InputEdge> edgesB = b.getEdges();

        Set<InputEdge> newEdges = new HashSet<InputEdge>();

        for (InputEdge e : edgesA) {
            int from = e.getFrom();
            int to = e.getTo();
            InputNode nodeFrom = inputNodeMap.get(a.getNode(from));
            InputNode nodeTo = inputNodeMap.get(a.getNode(to));
            char index = e.getToIndex();

            InputEdge newEdge = new InputEdge(index, nodeFrom.getId(), nodeTo.getId());
            if (!newEdges.contains(newEdge)) {
                markAsNew(newEdge);
                newEdges.add(newEdge);
                graph.addEdge(newEdge);
            }
        }

        for (InputEdge e : edgesB) {
            int from = e.getFrom();
            int to = e.getTo();
            InputNode nodeFrom = inputNodeMap.get(b.getNode(from));
            InputNode nodeTo = inputNodeMap.get(b.getNode(to));
            char index = e.getToIndex();

            InputEdge newEdge = new InputEdge(index, nodeFrom.getId(), nodeTo.getId());
            if (!newEdges.contains(newEdge)) {
                markAsDeleted(newEdge);
                newEdges.add(newEdge);
                graph.addEdge(newEdge);
            } else {
                newEdges.remove(newEdge);
                graph.removeEdge(newEdge);
                markAsSame(newEdge);
                newEdges.add(newEdge);
                graph.addEdge(newEdge);
            }
        }

        g.addGraph(graph);
        return graph;
View Full Code Here

Examples of com.sun.hotspot.igv.data.InputGraph

    public void resultChanged(LookupEvent lookupEvent) {
        final InputGraphProvider p = Lookup.getDefault().lookup(InputGraphProvider.class);
        if (p != null) {
            SwingUtilities.invokeLater(new Runnable() {
                public void run() {
            InputGraph graph = p.getGraph();
            if (graph != null) {
                Group g = graph.getGroup();
                rootNode.update(graph, g.getMethod());
            }
        }
            });
        }
View Full Code Here

Examples of com.sun.hotspot.igv.data.InputGraph

    public void openDiff() {

        final GraphViewer viewer = Lookup.getDefault().lookup(GraphViewer.class);

        if(viewer != null) {
            InputGraph diffGraph = Difference.createDiffGraph(a, b);
            viewer.view(diffGraph);
        }
    }
View Full Code Here

Examples of com.sun.hotspot.igv.data.InputGraph

        final InputGraphProvider p = Lookup.getDefault().lookup(InputGraphProvider.class);
        if (p != null) {
            SwingUtilities.invokeLater(new Runnable() {
                public void run() {
            InputGraph g = p.getGraph();
            if (g != null) {
                scene.setGraph(g);
            }
        }
            });
View Full Code Here

Examples of com.sun.hotspot.igv.data.InputGraph

        return diagram;
    }

    public InputGraph getGraphToView() {
        if (getFirstGraph() != getSecondGraph()) {
            InputGraph inputGraph = Difference.createDiffGraph(getSecondGraph(), getFirstGraph());
            return inputGraph;
        } else {
            InputGraph inputGraph = getFirstGraph();
            return inputGraph;
        }
    }
View Full Code Here

Examples of com.sun.hotspot.igv.data.InputGraph

    @Override
    public <T extends Node.Cookie> T getCookie(Class<T> aClass) {
        if (aClass == DiffGraphCookie.class) {
            InputGraphProvider graphProvider = Utilities.actionsGlobalContext().lookup(InputGraphProvider.class);

            InputGraph graphA = null;
            if (graphProvider != null) {
                graphA = graphProvider.getGraph();
            }

            if (graphA != null && !graphA.isDifferenceGraph()) {
                return (T) new DiffGraphCookie(graphA, graph);
            }
        }

        return super.getCookie(aClass);
View Full Code Here

Examples of com.sun.hotspot.igv.data.InputGraph

        if (g.getMethod() != null) {
            export(writer, g.getMethod());
        }

        InputGraph previous = null;
        for (InputGraph graph : g.getGraphs()) {
            export(writer, graph, previous, true);
            previous = graph;
        }
View Full Code Here

Examples of org.renjin.compiler.pipeline.accessor.InputGraph

public class RowMeanJitter implements FunctionJitter  {

  @Override
  public void compute(ComputeMethod method, DeferredNode node) {

    InputGraph inputGraph = new InputGraph(node);

    Accessor matrix = Accessors.create(node.getOperand(0), inputGraph);
    matrix.init(method);

    int meansLocal = method.reserveLocal(1);
View Full Code Here

Examples of org.renjin.compiler.pipeline.accessor.InputGraph

public class MeanJitter implements FunctionJitter {

  @Override
  public void compute(ComputeMethod method, DeferredNode node) {

    InputGraph inputGraph = new InputGraph(node);

    Accessor accessor = Accessors.create(node.getOperands().get(0), inputGraph);
    accessor.init(method);

    MethodVisitor mv = method.getVisitor();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.