use of com.tencent.angel.ml.matrix.psf.aggr.enhance.ArrayAggrResult in project angel by Tencent.
the class PullWithCols method merge.
@Override
public GetResult merge(List<PartitionGetResult> partResults) {
ArrayList<Long> cols = new ArrayList<>();
ArrayList<Double> result = new ArrayList<>();
for (PartitionGetResult part : partResults) {
ArrayPartitionAggrResult partResult = (ArrayPartitionAggrResult) part;
long[] keys = partResult.getCols();
double[] values = partResult.getResult();
assert (keys.length == values.length);
for (int i = 0; i < keys.length; i++) {
cols.add(keys[i]);
result.add(values[i]);
}
}
return new ArrayAggrResult(Utils.longListToArray(cols), Utils.doubleListToArray(result));
}
Aggregations