Package edu.cmu.graphchi.util

Examples of edu.cmu.graphchi.util.IdFloat


        // It would be better to have an iterator for the vertex data.
        VertexAggregator.foreach(engine.numVertices(), graphName, new FloatPairConverter(), new ForeachCallback<FloatPair>() {
            @Override
            public void callback(int vertexId, FloatPair vertexValue) {
                if (vertexValue.first > 0) {
                    results.add(new IdFloat(engine.getVertexIdTranslate().backward(vertexId), vertexValue.first));
                }
            }
        });
        engine = null;
        resultIter = results.iterator();
View Full Code Here



    @Override
    protected Tuple getNextResult(TupleFactory tupleFactory) throws ExecException {
        if (resultIter.hasNext()) {
            IdFloat res = resultIter.next();
            Tuple t = tupleFactory.newTuple(2);
            t.set(0, res.getValue());
            t.set(1, res.getVertexId());
            return t;
        } else {
            return null;
        }
    }
View Full Code Here

        // Collect results - into memory ... This may consume a lot of memory.
        // It would be better to have an iterator for the vertex data.
        VertexAggregator.foreach(engine.numVertices(), graphName, new FloatPairConverter(), new ForeachCallback<FloatPair>() {
            public void callback(int vertexId, FloatPair vertexValue) {
                if (vertexValue.first > 0) {
                    results.add(new IdFloat(engine.getVertexIdTranslate().backward(vertexId), vertexValue.first));
                }
            }
        });
        engine = null;
        resultIter = results.iterator();
View Full Code Here


    @Override
    protected Tuple getNextResult(TupleFactory tupleFactory) throws ExecException {
        if (resultIter.hasNext()) {
            IdFloat res = resultIter.next();
            Tuple t = tupleFactory.newTuple(2);
            t.set(0, res.getValue());
            t.set(1, res.getVertexId());
            return t;
        } else {
            return null;
        }
    }
View Full Code Here

TOP

Related Classes of edu.cmu.graphchi.util.IdFloat

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.