use of com.tencent.angel.ml.math2.vector.FloatVector in project angel by Tencent.
the class MyPull method partitionGet.
@Override
public PartitionGetResult partitionGet(PartitionGetParam partParam) {
MyPullPartParam param = (MyPullPartParam) partParam;
ServerRow msgRows = psContext.getMatrixStorageManager().getRow(param.getPartKey(), param.getDeltaId());
ServerRow sumsRow = psContext.getMatrixStorageManager().getRow(param.getPartKey(), param.getSumId());
long start = param.getPartKey().getStartCol();
long range = param.getPartKey().getEndCol() - start;
FloatVector msgs = ServerRowUtils.getVector((ServerLongFloatRow) msgRows);
FloatVector sums = ServerRowUtils.getVector((ServerLongFloatRow) sumsRow);
return new MyPullPartResult(param.getKeys(), start, msgs, sums, param.getResetProb(), param.getTol());
}
use of com.tencent.angel.ml.math2.vector.FloatVector in project angel by Tencent.
the class GetNodes method partitionGet.
@Override
public PartitionGetResult partitionGet(PartitionGetParam partParam) {
ServerPartition part = psContext.getMatrixStorageManager().getPart(partParam.getPartKey());
ServerRow ranks = psContext.getMatrixStorageManager().getRow(partParam.getPartKey(), 2);
FloatVector ranksVector = ServerRowUtils.getVector((ServerLongFloatRow) ranks);
long[] ret;
if (ranksVector instanceof IntFloatVector)
ret = gatherNodes((IntFloatVector) ranksVector, part.getPartitionKey().getStartCol());
else if (ranksVector instanceof LongFloatVector)
ret = gatherNodes((LongFloatVector) ranksVector, part.getPartitionKey().getStartCol());
else {
throw new AngelException("vector should be intfloat or longfloat but is " + ranksVector.getClass().getName());
}
return new IndexPartGetLongResult(part.getPartitionKey(), ret);
}
Aggregations