Package edu.ucla.sspace.util.primitive

Examples of edu.ucla.sspace.util.primitive.TroveIntSet$TroveIterator


         */
        private final IntSet vertexSubset;

        public Subgraph(Set<T> validTypes, Set<Integer> vertexSubset) {
            this.validTypes = validTypes;
            this.vertexSubset = new TroveIntSet(vertexSubset);
        }
View Full Code Here


        /**
         * Creates a new subgraph from the provided set of vertices
         */
        public Subgraph(Set<Integer> vertices) {
            vertexSubset = new TroveIntSet(vertices);
        }
View Full Code Here

    /**
     * Creates a new {@code SparseDirectedEdgeSet} for the specfied vertex.
     */
    public SparseDirectedEdgeSet(int rootVertex) {
        this.rootVertex = rootVertex;
        outEdges = new TroveIntSet();
        inEdges = new TroveIntSet();
    }
View Full Code Here

    private void flushBuffer(ByteBuffer buffer, boolean force) throws IOException {
        if (buffer.position()==0) return;
        if (force || buffer.position()==buffer.limit()) {
            buffer.limit(buffer.position());
            buffer.position(0);
            IntSet failedPositions = new TroveIntSet(100);
            long time=System.currentTimeMillis();
            while (buffer.position() != buffer.limit()) {
                final int position = buffer.position();
                if (!updateFromBuffer(buffer)) failedPositions.add(position);
            }
            if (log.isInfoEnabled()) log.info(String.format("flushed buffer %d, kept %d took %d ms.",idx(buffer),failedPositions.size(),System.currentTimeMillis()-time));
            stats[idx(buffer)].written(buffer.position()/RECORD_SIZE - failedPositions.size());
            buffer.limit(capacity);
            int initialPos=failedPositions.isEmpty() ? 0 : copyFailedPositions(buffer, failedPositions);
            buffer.position(initialPos);
        }
    }
View Full Code Here

         */
        private final IntSet vertexSubset;

        public Subgraph(Set<T> validTypes, Set<Integer> vertexSubset) {
            this.validTypes = validTypes;
            this.vertexSubset = new TroveIntSet(vertexSubset);
        }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public IntSet predecessors(int vertex) {
        Set<T> in = inEdges(vertex);
        IntSet preds = new TroveIntSet();
        if (in.isEmpty())
            return preds;
        for (T e : in)
            preds.add(e.from());
        return preds;
    }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public IntSet successors(int vertex) {
        Set<T> out = outEdges(vertex);
        IntSet succs = new TroveIntSet();
        if (out.isEmpty())
            return succs;
        for (T e : out)
            succs.add(e.to());
        return succs;
    }
View Full Code Here

TOP

Related Classes of edu.ucla.sspace.util.primitive.TroveIntSet$TroveIterator

Copyright © 2018 www.massapicom. 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.