Search in sources :

Example 6 with LongElementStorage

use of com.tencent.angel.ps.storage.vector.storage.LongElementStorage in project angel by Tencent.

the class NnzEdge method processRow.

@Override
public double processRow(ServerRow row) {
    LongElementStorage storage = ((ServerLongAnyRow) row).getStorage();
    ObjectIterator<Long2ObjectMap.Entry<IElement>> it = storage.iterator();
    long size = 0;
    while (it.hasNext()) {
        Node node = (Node) (it.next().getValue());
        if (node.getNeighbors() != null) {
            size += node.getNeighbors().length;
        }
    }
    return size;
}
Also used : Node(com.tencent.angel.graph.data.Node) LongElementStorage(com.tencent.angel.ps.storage.vector.storage.LongElementStorage) ServerLongAnyRow(com.tencent.angel.ps.storage.vector.ServerLongAnyRow)

Example 7 with LongElementStorage

use of com.tencent.angel.ps.storage.vector.storage.LongElementStorage in project angel by Tencent.

the class NnzNeighbor method processRow.

@Override
public double processRow(ServerRow row) {
    LongElementStorage storage = ((ServerLongAnyRow) row).getStorage();
    ObjectIterator<Long2ObjectMap.Entry<IElement>> it = storage.iterator();
    int size = 0;
    while (it.hasNext()) {
        Node node = (Node) (it.next().getValue());
        if (node.getNeighbors() != null) {
            size++;
        }
    }
    return size;
}
Also used : Node(com.tencent.angel.graph.data.Node) LongElementStorage(com.tencent.angel.ps.storage.vector.storage.LongElementStorage) ServerLongAnyRow(com.tencent.angel.ps.storage.vector.ServerLongAnyRow)

Aggregations

LongElementStorage (com.tencent.angel.ps.storage.vector.storage.LongElementStorage)7 ServerLongAnyRow (com.tencent.angel.ps.storage.vector.ServerLongAnyRow)6 GraphNode (com.tencent.angel.graph.data.GraphNode)3 Node (com.tencent.angel.graph.data.Node)3 IElement (com.tencent.angel.ps.storage.vector.element.IElement)1 Long2ObjectMap (it.unimi.dsi.fastutil.longs.Long2ObjectMap)1 Entry (java.util.Map.Entry)1