use of it.unimi.dsi.fastutil.longs.LongArrayList in project presto by prestodb.
the class TestColumnIndexFilter method assertRows.
private static void assertRows(RowRanges ranges, long... expectedRows) {
LongList actualList = new LongArrayList();
ranges.iterator().forEachRemaining((long value) -> actualList.add(value));
assertArrayEquals(Arrays.toString(expectedRows) + " != " + actualList, expectedRows, actualList.toLongArray());
}
use of it.unimi.dsi.fastutil.longs.LongArrayList in project symja_android_library by axkr.
the class DateTimeColumn method lag.
@Override
public DateTimeColumn lag(int n) {
int srcPos = n >= 0 ? 0 : 0 - n;
long[] dest = new long[size()];
int destPos = n <= 0 ? 0 : n;
int length = n >= 0 ? size() - n : size() + n;
for (int i = 0; i < size(); i++) {
dest[i] = DateTimeColumnType.missingValueIndicator();
}
System.arraycopy(data.toLongArray(), srcPos, dest, destPos, length);
DateTimeColumn copy = emptyCopy(size());
copy.data = new LongArrayList(dest);
copy.setName(name() + " lag(" + n + ")");
return copy;
}
use of it.unimi.dsi.fastutil.longs.LongArrayList in project druid by druid-io.
the class GenericIndexedWriter method initializeHeaderOutLong.
private void initializeHeaderOutLong() throws IOException {
headerOutLong = new LongArrayList();
try (final DataInputStream headerOutAsIntInput = new DataInputStream(headerOut.asInputStream())) {
for (int i = 0; i < numWritten; i++) {
int count = headerOutAsIntInput.readInt();
headerOutLong.add(count);
}
}
}
use of it.unimi.dsi.fastutil.longs.LongArrayList in project angel by Tencent.
the class CooLongFloatMatrix method getRow.
@Override
public Vector getRow(int idx) {
LongArrayList cols = new LongArrayList();
FloatArrayList data = new FloatArrayList();
for (int i = 0; i < rowIndices.length; i++) {
if (rowIndices[i] == idx) {
cols.add(colIndices[i]);
data.add(values[i]);
}
}
LongFloatSparseVectorStorage storage = new LongFloatSparseVectorStorage(shape[1], cols.toLongArray(), data.toFloatArray());
return new LongFloatVector(getMatrixId(), idx, getClock(), shape[1], storage);
}
use of it.unimi.dsi.fastutil.longs.LongArrayList in project angel by Tencent.
the class CooLongFloatMatrix method getCol.
@Override
public Vector getCol(int idx) {
LongArrayList cols = new LongArrayList();
FloatArrayList data = new FloatArrayList();
for (int i = 0; i < colIndices.length; i++) {
if (colIndices[i] == idx) {
cols.add(rowIndices[i]);
data.add(values[i]);
}
}
LongFloatSparseVectorStorage storage = new LongFloatSparseVectorStorage(shape[0], cols.toLongArray(), data.toFloatArray());
return new LongFloatVector(getMatrixId(), 0, getClock(), shape[0], storage);
}
Aggregations