Package edu.cmu.graphchi.datablocks

Examples of edu.cmu.graphchi.datablocks.ChiPointer


        ChiVertex.blockManager = blockMgr;
        ChiVertex<Float, Float> vertex = new ChiVertex<Float, Float>(1, new VertexDegree(0, 0));
        assertEquals(vertex.getId(), 1);

        int offset = 1024;
        ChiPointer vertexDataPtr = new ChiPointer(blockId, offset);

        blockMgr.writeValue(vertexDataPtr, floatConv, 3.0f);
        vertex.setDataPtr(vertexDataPtr);

        assertEquals(vertex.getValue(), 3.0f, 1e-15);
View Full Code Here


        ChiVertex<Float, Float> vertex = new ChiVertex<Float, Float>(5, new VertexDegree(nInedges, 0));
        assertEquals(vertex.getId(), 5);

        for(int i=0; i < nInedges; i++) {
            blockMgr.writeValue(new ChiPointer(blockId, i * 4), floatConv, (float) Math.sin(i / 2));
            vertex.addInEdge(blockId, i * 4, i * 7 + 5);
        }
        assertEquals(vertex.numOutEdges(), 0);

        assert(vertex.numInEdges() == nInedges);
View Full Code Here

        assertEquals(vertex.getId(), 5);

        assertEquals(vertex.numOutEdges(), 0);

        for(int i=0; i < nOutedges; i++) {
            blockMgr.writeValue(new ChiPointer(blockId, i * 4), floatConv, (float) Math.cos(i / 2));
            vertex.addOutEdge(blockId, i * 4, i * 7 + 5);
            assertEquals(vertex.numOutEdges(), i + 1);
        }
        assertEquals(vertex.numInEdges(), 0);

View Full Code Here

TOP

Related Classes of edu.cmu.graphchi.datablocks.ChiPointer

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.