use of it.unimi.dsi.fastutil.longs.Long2DoubleOpenHashMap in project angel by Tencent.
the class Axpy method doUpdate.
@Override
protected void doUpdate(ServerSparseDoubleLongKeyRow[] rows, double[] scalars) {
double a = scalars[0];
Long2DoubleOpenHashMap xData = rows[0].getData();
Long2DoubleOpenHashMap yData = xData.clone();
for (Map.Entry<Long, Double> entry : yData.entrySet()) {
entry.setValue(entry.getValue() * a);
}
rows[1].mergeIndexValueMap(yData);
}
use of it.unimi.dsi.fastutil.longs.Long2DoubleOpenHashMap in project angel by Tencent.
the class Copy method doUpdate.
@Override
protected void doUpdate(ServerSparseDoubleLongKeyRow[] rows) {
Long2DoubleOpenHashMap from = rows[0].getIndex2ValueMap();
Long2DoubleOpenHashMap to = from.clone();
rows[1].setIndex2ValueMap(to);
}
use of it.unimi.dsi.fastutil.longs.Long2DoubleOpenHashMap in project angel by Tencent.
the class Exp method doUpdate.
@Override
protected void doUpdate(ServerSparseDoubleLongKeyRow[] rows) {
Long2DoubleOpenHashMap from = rows[0].getData();
Long2DoubleOpenHashMap to = from.clone();
to.defaultReturnValue(Math.exp(to.defaultReturnValue()));
for (Map.Entry<Long, Double> entry : to.long2DoubleEntrySet()) {
to.put(entry.getKey().longValue(), Math.exp(entry.getValue()));
}
}
use of it.unimi.dsi.fastutil.longs.Long2DoubleOpenHashMap in project angel by Tencent.
the class Floor method doUpdate.
@Override
protected void doUpdate(ServerSparseDoubleLongKeyRow[] rows) {
Long2DoubleOpenHashMap from = rows[0].getData();
Long2DoubleOpenHashMap to = from.clone();
to.defaultReturnValue(Math.floor(to.defaultReturnValue()));
for (Map.Entry<Long, Double> entry : to.long2DoubleEntrySet()) {
to.put(entry.getKey().longValue(), Math.floor(entry.getValue()));
}
}
use of it.unimi.dsi.fastutil.longs.Long2DoubleOpenHashMap in project angel by Tencent.
the class Log1p method doUpdate.
@Override
protected void doUpdate(ServerSparseDoubleLongKeyRow[] rows) {
Long2DoubleOpenHashMap from = rows[0].getData();
Long2DoubleOpenHashMap to = from.clone();
to.defaultReturnValue(Math.log1p(to.defaultReturnValue()));
for (Map.Entry<Long, Double> entry : to.long2DoubleEntrySet()) {
to.put(entry.getKey().longValue(), Math.log1p(entry.getValue()));
}
}
Aggregations