@Override public void swap(int a, int b) { long[] elements = valueAddresses.elements(); long temp = elements[a]; elements[a] = elements[b]; elements[b] = temp; }
@Override public void sortDescending() { LongArrays.parallelQuickSort(data.elements(), descendingComparator); }
@Override public void sortAscending() { Arrays.parallelSort(data.elements()); }
@Override public void sortAscending() { LongArrays.parallelQuickSort(data.elements()); }
@Override public void sortDescending() { LongArrays.parallelQuickSort(data.elements(), reverseLongComparator); }
private long calculateEstimatedSize() { long elementsSize = (channels.length > 0) ? sizeOf(channels[0].elements()) : 0; long channelsArraySize = elementsSize * channels.length; long addressesArraySize = sizeOf(valueAddresses.elements()); return INSTANCE_SIZE + pagesMemorySize + channelsArraySize + addressesArraySize; }
/** * Returns a new LongColumn containing a value for each value in this column * * A widening primitive conversion from short to long does not lose any information at all; * the numeric value is preserved exactly. * * A missing value in the receiver is converted to a missing value in the result */ @Override public LongColumn asLongColumn() { LongArrayList values = new LongArrayList(); for (int f : data) { values.add(f); } values.trim(); return LongColumn.create(this.name(), values.elements()); }
/** * Returns a new LongColumn containing a value for each value in this column * * A widening primitive conversion from int to long does not lose any information at all; * the numeric value is preserved exactly. * * A missing value in the receiver is converted to a missing value in the result */ @Override public LongColumn asLongColumn() { LongArrayList values = new LongArrayList(); for (int f : data) { values.add(f); } values.trim(); return LongColumn.create(this.name(), values.elements()); }
/** * Returns a new LongColumn containing a value for each value in this column, truncating if necessary * * A narrowing primitive conversion such as this one may lose information about the overall magnitude of a * numeric value and may also lose precision and range. Specifically, if the value is too small (a negative value * of large magnitude or negative infinity), the result is the smallest representable value of type long. * * Similarly, if the value is too large (a positive value of large magnitude or positive infinity), the result is the * largest representable value of type long. * * Despite the fact that overflow, underflow, or other loss of information may occur, a narrowing primitive * conversion never results in a run-time exception. * * A missing value in the receiver is converted to a missing value in the result */ @Override public LongColumn asLongColumn() { LongArrayList values = new LongArrayList(); for (double d : data) { values.add((long) d); } values.trim(); return LongColumn.create(this.name(), values.elements()); }
/** * Returns a new LongColumn containing a value for each value in this column, truncating if necessary * * A narrowing primitive conversion such as this one may lose information about the overall magnitude of a * numeric value and may also lose precision and range. Specifically, if the value is too small (a negative value * of large magnitude or negative infinity), the result is the smallest representable value of type long. * * Similarly, if the value is too large (a positive value of large magnitude or positive infinity), the result is the * largest representable value of type long. * * Despite the fact that overflow, underflow, or other loss of information may occur, a narrowing primitive * conversion never results in a run-time exception. * * A missing value in the receiver is converted to a missing value in the result */ @Override public LongColumn asLongColumn() { LongArrayList values = new LongArrayList(); for (float f : data) { values.add((long) f); } values.trim(); return LongColumn.create(this.name(), values.elements()); }
size = sizeOf(addresses.elements()) + pagesHashStrategy.getSizeInBytes() + sizeOf(key) + sizeOf(positionToHashes); hashCollisions = hashCollisionsLocal;
private static Long2DoubleMap extractVector(Iterator<? extends Rating> ratings, IdExtractor dimension, int n) { LongArrayList ids = new LongArrayList(n > 0 ? n : LongArrayList.DEFAULT_INITIAL_CAPACITY); DoubleArrayList values = new DoubleArrayList(n > 0 ? n : DoubleArrayList.DEFAULT_INITIAL_CAPACITY); while (ratings.hasNext()) { Rating r = ratings.next(); assert ids.size() == values.size(); long id = dimension.getId(r); ids.add(id); values.add(r.getValue()); } ids.trim(); values.trim(); assert ids.elements().length == ids.size(); assert values.elements().length == values.size(); return Long2DoubleSortedArrayMap.wrapUnsorted(ids.elements(), values.elements()); }
@Override public void swap(int a, int b) { long[] elements = valueAddresses.elements(); long temp = elements[a]; elements[a] = elements[b]; elements[b] = temp; }
@Override public void swap(int a, int b) { long[] elements = valueAddresses.elements(); long temp = elements[a]; elements[a] = elements[b]; elements[b] = temp; }
@Override public void seal() { ((LongArrayList) _innerList).trim(); _elements = ((LongArrayList) _innerList).elements(); }
/** * Sorted added values * @return sorted added values */ private long[] sortedValues() { long[] ret = neighborsAdded.elements(); Arrays.sort(ret, 0, neighborsAdded.size()); return ret; }
private long calculateEstimatedSize() { long elementsSize = (channels.length > 0) ? sizeOf(channels[0].elements()) : 0; long channelsArraySize = elementsSize * channels.length; long addressesArraySize = sizeOf(valueAddresses.elements()); return INSTANCE_SIZE + pagesMemorySize + channelsArraySize + addressesArraySize; }
private long calculateEstimatedSize() { long elementsSize = (channels.length > 0) ? sizeOf(channels[0].elements()) : 0; long channelsArraySize = elementsSize * channels.length; long addressesArraySize = sizeOf(valueAddresses.elements()); return pagesMemorySize + channelsArraySize + addressesArraySize; }