use of it.unimi.dsi.fastutil.longs.Long2DoubleOpenHashMap in project angel by Tencent.
the class Log method doUpdate.
@Override
protected void doUpdate(ServerSparseDoubleLongKeyRow[] rows) {
Long2DoubleOpenHashMap from = rows[0].getData();
Long2DoubleOpenHashMap to = from.clone();
to.defaultReturnValue(Math.log(to.defaultReturnValue()));
for (Map.Entry<Long, Double> entry : to.long2DoubleEntrySet()) {
to.put(entry.getKey().longValue(), Math.log(entry.getValue()));
}
}
use of it.unimi.dsi.fastutil.longs.Long2DoubleOpenHashMap in project angel by Tencent.
the class Log10 method doUpdate.
@Override
protected void doUpdate(ServerSparseDoubleLongKeyRow[] rows) {
Long2DoubleOpenHashMap from = rows[0].getData();
Long2DoubleOpenHashMap to = from.clone();
to.defaultReturnValue(Math.log10(to.defaultReturnValue()));
for (Map.Entry<Long, Double> entry : to.long2DoubleEntrySet()) {
to.put(entry.getKey().longValue(), Math.log10(entry.getValue()));
}
}
use of it.unimi.dsi.fastutil.longs.Long2DoubleOpenHashMap in project angel by Tencent.
the class MaxV method doUpdate.
@Override
protected void doUpdate(ServerSparseDoubleLongKeyRow[] rows) {
Long2DoubleOpenHashMap from1 = rows[0].getIndex2ValueMap();
Long2DoubleOpenHashMap from2 = rows[1].getIndex2ValueMap();
Long2DoubleOpenHashMap to = from1.clone();
double defaultValue = Math.max(from1.defaultReturnValue(), from2.defaultReturnValue());
to.defaultReturnValue(defaultValue);
for (Map.Entry<Long, Double> entry : to.long2DoubleEntrySet()) {
if (entry.getValue() < defaultValue) {
entry.setValue(defaultValue);
}
}
for (Map.Entry<Long, Double> entry : from2.long2DoubleEntrySet()) {
if (entry.getValue() > to.get(entry.getKey().longValue())) {
to.put(entry.getKey(), entry.getValue());
}
}
rows[2].setIndex2ValueMap(to);
}
use of it.unimi.dsi.fastutil.longs.Long2DoubleOpenHashMap in project angel by Tencent.
the class Pow method doUpdate.
@Override
protected void doUpdate(ServerSparseDoubleLongKeyRow[] rows, double[] values) {
Long2DoubleOpenHashMap from = rows[0].getData();
Long2DoubleOpenHashMap to = from.clone();
double value = values[0];
for (Map.Entry<Long, Double> entry : to.long2DoubleEntrySet()) {
to.put(entry.getKey().longValue(), Math.pow(entry.getValue(), value));
}
}
use of it.unimi.dsi.fastutil.longs.Long2DoubleOpenHashMap in project angel by Tencent.
the class Round method doUpdate.
@Override
protected void doUpdate(ServerSparseDoubleLongKeyRow[] rows) {
Long2DoubleOpenHashMap from = rows[0].getData();
Long2DoubleOpenHashMap to = from.clone();
to.defaultReturnValue(Math.round(to.defaultReturnValue()));
for (Map.Entry<Long, Double> entry : to.long2DoubleEntrySet()) {
to.put(entry.getKey(), Math.round(entry.getValue()));
}
}
Aggregations