Search in sources :

Example 1 with CompIntDoubleRowUpdateSplit

use of com.tencent.angel.psagent.matrix.oplog.cache.CompIntDoubleRowUpdateSplit in project angel by Tencent.

the class CompIntDoubleVectorSplitter method split.

@Override
public Map<PartitionKey, RowUpdateSplit> split(Vector vector, List<PartitionKey> parts) {
    IntDoubleVector[] vecParts = ((CompIntDoubleVector) vector).getPartitions();
    assert vecParts.length == parts.size();
    Map<PartitionKey, RowUpdateSplit> updateSplitMap = new HashMap<>(parts.size());
    for (int i = 0; i < vecParts.length; i++) {
        updateSplitMap.put(parts.get(i), new CompIntDoubleRowUpdateSplit(vector.getRowId(), vecParts[i], (int) (parts.get(i).getEndCol() - parts.get(i).getStartCol())));
    }
    return updateSplitMap;
}
Also used : HashMap(java.util.HashMap) PartitionKey(com.tencent.angel.PartitionKey) CompIntDoubleRowUpdateSplit(com.tencent.angel.psagent.matrix.oplog.cache.CompIntDoubleRowUpdateSplit) RowUpdateSplit(com.tencent.angel.psagent.matrix.oplog.cache.RowUpdateSplit) CompIntDoubleVector(com.tencent.angel.ml.math2.vector.CompIntDoubleVector) CompIntDoubleRowUpdateSplit(com.tencent.angel.psagent.matrix.oplog.cache.CompIntDoubleRowUpdateSplit) IntDoubleVector(com.tencent.angel.ml.math2.vector.IntDoubleVector) CompIntDoubleVector(com.tencent.angel.ml.math2.vector.CompIntDoubleVector)

Aggregations

PartitionKey (com.tencent.angel.PartitionKey)1 CompIntDoubleVector (com.tencent.angel.ml.math2.vector.CompIntDoubleVector)1 IntDoubleVector (com.tencent.angel.ml.math2.vector.IntDoubleVector)1 CompIntDoubleRowUpdateSplit (com.tencent.angel.psagent.matrix.oplog.cache.CompIntDoubleRowUpdateSplit)1 RowUpdateSplit (com.tencent.angel.psagent.matrix.oplog.cache.RowUpdateSplit)1 HashMap (java.util.HashMap)1