use of java.nio.DoubleBuffer in project angel by Tencent.
the class Expm1 method doUpdate.
@Override
protected void doUpdate(ServerDenseDoubleRow[] rows) {
try {
rows[1].getLock().writeLock().lock();
DoubleBuffer from = rows[0].getData();
DoubleBuffer to = rows[1].getData();
int size = rows[0].size();
for (int i = 0; i < size; i++) {
to.put(i, Math.expm1(from.get(i)));
}
} finally {
rows[1].getLock().writeLock().unlock();
}
}
use of java.nio.DoubleBuffer in project angel by Tencent.
the class Log method doUpdate.
@Override
protected void doUpdate(ServerDenseDoubleRow[] rows) {
try {
rows[1].getLock().writeLock().lock();
DoubleBuffer from = rows[0].getData();
DoubleBuffer to = rows[1].getData();
int size = rows[0].size();
for (int i = 0; i < size; i++) {
to.put(i, Math.log(from.get(i)));
}
} finally {
rows[1].getLock().writeLock().unlock();
}
}
use of java.nio.DoubleBuffer in project angel by Tencent.
the class Log10 method doUpdate.
@Override
protected void doUpdate(ServerDenseDoubleRow[] rows) {
try {
rows[1].getLock().writeLock().lock();
DoubleBuffer from = rows[0].getData();
DoubleBuffer to = rows[1].getData();
int size = rows[0].size();
for (int i = 0; i < size; i++) {
to.put(i, Math.log10(from.get(i)));
}
} finally {
rows[1].getLock().writeLock().unlock();
}
}
use of java.nio.DoubleBuffer in project angel by Tencent.
the class Log1p method doUpdate.
@Override
protected void doUpdate(ServerDenseDoubleRow[] rows) {
try {
rows[1].getLock().writeLock().lock();
DoubleBuffer from = rows[0].getData();
DoubleBuffer to = rows[1].getData();
int size = rows[0].size();
for (int i = 0; i < size; i++) {
to.put(i, Math.log1p(from.get(i)));
}
} finally {
rows[1].getLock().writeLock().unlock();
}
}
use of java.nio.DoubleBuffer in project angel by Tencent.
the class MaxV method doUpdate.
@Override
protected void doUpdate(ServerDenseDoubleRow[] rows) {
try {
rows[2].getLock().writeLock().lock();
DoubleBuffer from1 = rows[0].getData();
DoubleBuffer from2 = rows[1].getData();
DoubleBuffer to = rows[2].getData();
int size = rows[0].size();
for (int i = 0; i < size; i++) {
to.put(i, Math.max(from1.get(i), from2.get(i)));
}
} finally {
rows[2].getLock().writeLock().unlock();
}
}
Aggregations