use of java.nio.DoubleBuffer in project angel by Tencent.
the class MapInPlace method doUpdate.
@Override
protected void doUpdate(ServerDenseDoubleRow[] rows, Serialize func) {
MapFunc mapper = (MapFunc) func;
DoubleBuffer rowData = rows[0].getData();
int size = rows[0].size();
for (int i = 0; i < size; i++) {
rowData.put(i, mapper.call(rowData.get(i)));
}
}
use of java.nio.DoubleBuffer in project angel by Tencent.
the class MapWithIndex method doUpdate.
@Override
protected void doUpdate(ServerDenseDoubleRow[] rows, Serialize func) {
MapWithIndexFunc mapper = (MapWithIndexFunc) func;
DoubleBuffer from = rows[0].getData();
DoubleBuffer to = rows[1].getData();
int size = rows[0].size();
int startCol = (int) rows[0].getStartCol();
for (int i = 0; i < size; i++) {
to.put(i, mapper.call(startCol + i, from.get(i)));
}
}
use of java.nio.DoubleBuffer in project angel by Tencent.
the class Zip2MapWithIndex method doUpdate.
@Override
protected void doUpdate(ServerDenseDoubleRow[] rows, Serialize func) {
Zip2MapWithIndexFunc mapper = (Zip2MapWithIndexFunc) func;
DoubleBuffer from1 = rows[0].getData();
DoubleBuffer from2 = rows[1].getData();
DoubleBuffer to = rows[2].getData();
int size = rows[0].size();
int startCol = (int) rows[0].getStartCol();
for (int i = 0; i < size; i++) {
to.put(i, mapper.call(startCol + i, from1.get(i), from2.get(i)));
}
}
use of java.nio.DoubleBuffer in project angel by Tencent.
the class Zip3MapWithIndex method doUpdate.
@Override
protected void doUpdate(ServerDenseDoubleRow[] rows, Serialize func) {
Zip3MapWithIndexFunc mapper = (Zip3MapWithIndexFunc) func;
DoubleBuffer from1 = rows[0].getData();
DoubleBuffer from2 = rows[1].getData();
DoubleBuffer from3 = rows[2].getData();
DoubleBuffer to = rows[3].getData();
int startCol = (int) rows[0].getStartCol();
int size = rows[0].size();
for (int i = 0; i < size; i++) {
to.put(i, mapper.call(startCol + i, from1.get(i), from2.get(i), from3.get(i)));
}
}
use of java.nio.DoubleBuffer in project angel by Tencent.
the class Push method doUpdate.
@Override
protected void doUpdate(ServerDenseDoubleRow row, double[] values) {
DoubleBuffer data = row.getData();
int size = row.size();
for (int i = 0; i < size; i++) {
data.put(i, values[i]);
}
}
Aggregations