use of it.unimi.dsi.fastutil.longs.Long2DoubleOpenHashMap in project angel by Tencent.
the class AddS method doUpdate.
@Override
protected void doUpdate(ServerSparseDoubleLongKeyRow[] rows, double[] scalars) {
double scalar = scalars[0];
Long2DoubleOpenHashMap from = rows[0].getData();
Long2DoubleOpenHashMap to = from.clone();
to.defaultReturnValue(scalar);
for (Map.Entry<Long, Double> entry : to.long2DoubleEntrySet()) {
to.addTo(entry.getKey(), scalar);
}
rows[1].setIndex2ValueMap(to);
}
use of it.unimi.dsi.fastutil.longs.Long2DoubleOpenHashMap in project angel by Tencent.
the class Ceil method doUpdate.
@Override
protected void doUpdate(ServerSparseDoubleLongKeyRow[] rows) {
Long2DoubleOpenHashMap from = rows[0].getIndex2ValueMap();
Long2DoubleOpenHashMap to = from.clone();
to.defaultReturnValue(Math.ceil(to.defaultReturnValue()));
for (Map.Entry<Long, Double> entry : to.long2DoubleEntrySet()) {
entry.setValue(Math.ceil(entry.getValue()));
}
}
use of it.unimi.dsi.fastutil.longs.Long2DoubleOpenHashMap in project angel by Tencent.
the class DivS method doUpdate.
@Override
protected void doUpdate(ServerSparseDoubleLongKeyRow[] rows, double[] scalars) {
Long2DoubleOpenHashMap from = rows[0].getIndex2ValueMap();
Long2DoubleOpenHashMap to = from.clone();
double value = scalars[0];
double defaultValue = to.defaultReturnValue();
to.defaultReturnValue(defaultValue / value);
for (Map.Entry<Long, Double> entry : to.long2DoubleEntrySet()) {
to.put(entry.getKey().longValue(), entry.getValue() / defaultValue);
}
rows[1].setIndex2ValueMap(to);
}
use of it.unimi.dsi.fastutil.longs.Long2DoubleOpenHashMap in project angel by Tencent.
the class Expm1 method doUpdate.
@Override
protected void doUpdate(ServerSparseDoubleLongKeyRow[] rows) {
Long2DoubleOpenHashMap from = rows[0].getData();
Long2DoubleOpenHashMap to = from.clone();
to.defaultReturnValue(Math.expm1(to.defaultReturnValue()));
for (Map.Entry<Long, Double> entry : to.long2DoubleEntrySet()) {
to.put(entry.getKey().longValue(), Math.expm1(entry.getValue()));
}
}
use of it.unimi.dsi.fastutil.longs.Long2DoubleOpenHashMap in project angel by Tencent.
the class Fill method doUpdate.
@Override
protected void doUpdate(ServerSparseDoubleLongKeyRow[] rows, double[] values) {
Long2DoubleOpenHashMap data = new Long2DoubleOpenHashMap();
data.defaultReturnValue(values[0]);
rows[0].setIndex2ValueMap(data);
}
Aggregations