@Override public void sortAscending() { FloatArrays.parallelQuickSort(data.elements()); }
@Override public void sortDescending() { FloatArrays.parallelQuickSort(data.elements(), descendingComparator); }
/** * Returns a new FloatColumn containing a value for each value in this column * * A widening primitive conversion from a long to a float does not lose information about the overall magnitude * of a numeric value. It may, however, result in loss of precision - that is, the result may lose some of the * least significant bits of the value. In this case, the resulting floating-point value will be a correctly * rounded version of the integer value, using IEEE 754 round-to-nearest mode. * * Despite the fact that a loss of precision may occur, a widening 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 FloatColumn asFloatColumn() { FloatArrayList values = new FloatArrayList(); for (long d : data) { values.add(d); } values.trim(); return FloatColumn.create(this.name(), values.elements()); }
/** * Returns a new FloatColumn containing a value for each value in this column, truncating if necessary. * * A widening primitive conversion from an int to a float does not lose information about the overall magnitude * of a numeric value. It may, however, result in loss of precision - that is, the result may lose some of the * least significant bits of the value. In this case, the resulting floating-point value will be a correctly * rounded version of the integer value, using IEEE 754 round-to-nearest mode. * * Despite the fact that a loss of precision may occur, a widening 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 FloatColumn asFloatColumn() { FloatArrayList values = new FloatArrayList(); for (int d : data) { values.add(d); } values.trim(); return FloatColumn.create(this.name(), values.elements()); }
/** * Returns a new FloatColumn containing a value for each value in this column, truncating if necessary. * * A widening primitive conversion from an int to a float does not lose information about the overall magnitude * of a numeric value. It may, however, result in loss of precision - that is, the result may lose some of the * least significant bits of the value. In this case, the resulting floating-point value will be a correctly * rounded version of the integer value, using IEEE 754 round-to-nearest mode. * * Despite the fact that a loss of precision may occur, a widening 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 FloatColumn asFloatColumn() { FloatArrayList values = new FloatArrayList(); for (int d : data) { values.add(d); } values.trim(); return FloatColumn.create(this.name(), values.elements()); }
/** * Returns a new FloatColumn 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 float. * * 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 float. * * 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 FloatColumn asFloatColumn() { FloatArrayList values = new FloatArrayList(); for (double d : data) { values.add((float) d); } values.trim(); return FloatColumn.create(this.name(), values.elements()); } }
@Override public int indexOf(Object o) { float val; if (o instanceof String) val = parse((String) o); else val = (Float) o; float[] elements = ((FloatArrayList) _innerList).elements(); return Arrays.binarySearch(elements, val); }
@Override public void sortAscending() { FloatArrays.parallelQuickSort(data.elements()); }
@Override public void sortAscending() { Arrays.parallelSort(data.elements()); }
@Override public void sortDescending() { FloatArrays.parallelQuickSort(data.elements(), reverseFloatComparator); }
@Override public void sortDescending() { FloatArrays.parallelQuickSort(data.elements(), descendingComparator); }
@Override public void seal() { ((FloatArrayList) _innerList).trim(); _elements = ((FloatArrayList) _innerList).elements(); int negativeIndexCheck = 1; // reverse negative elements, because string order and numeric orders are completely opposite if (_elements.length > negativeIndexCheck && _elements[negativeIndexCheck] < 0) { int endPosition = indexOfWithType((short) 0); if (endPosition < 0) { endPosition = -1 * endPosition - 1; } float tmp; for (int i = 0; i < (endPosition - negativeIndexCheck) / 2; i++) { tmp = _elements[i + negativeIndexCheck]; _elements[i + negativeIndexCheck] = _elements[endPosition - i - 1]; _elements[endPosition - i - 1] = tmp; } } }
/** * Returns a new FloatColumn containing a value for each value in this column * * A widening primitive conversion from a long to a float does not lose information about the overall magnitude * of a numeric value. It may, however, result in loss of precision - that is, the result may lose some of the * least significant bits of the value. In this case, the resulting floating-point value will be a correctly * rounded version of the integer value, using IEEE 754 round-to-nearest mode. * * Despite the fact that a loss of precision may occur, a widening 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 FloatColumn asFloatColumn() { FloatArrayList values = new FloatArrayList(); for (long d : data) { values.add(d); } values.trim(); return FloatColumn.create(this.name(), values.elements()); }
/** * Returns a new FloatColumn containing a value for each value in this column, truncating if necessary. * * A widening primitive conversion from an int to a float does not lose information about the overall magnitude * of a numeric value. It may, however, result in loss of precision - that is, the result may lose some of the * least significant bits of the value. In this case, the resulting floating-point value will be a correctly * rounded version of the integer value, using IEEE 754 round-to-nearest mode. * * Despite the fact that a loss of precision may occur, a widening 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 FloatColumn asFloatColumn() { FloatArrayList values = new FloatArrayList(); for (int d : data) { values.add(d); } values.trim(); return FloatColumn.create(this.name(), values.elements()); }
/** * Returns a new FloatColumn containing a value for each value in this column, truncating if necessary. * * A widening primitive conversion from an int to a float does not lose information about the overall magnitude * of a numeric value. It may, however, result in loss of precision - that is, the result may lose some of the * least significant bits of the value. In this case, the resulting floating-point value will be a correctly * rounded version of the integer value, using IEEE 754 round-to-nearest mode. * * Despite the fact that a loss of precision may occur, a widening 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 FloatColumn asFloatColumn() { FloatArrayList values = new FloatArrayList(); for (int d : data) { values.add(d); } values.trim(); return FloatColumn.create(this.name(), values.elements()); }
/** * Returns a new FloatColumn 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 float. * * 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 float. * * 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 FloatColumn asFloatColumn() { FloatArrayList values = new FloatArrayList(); for (double d : data) { values.add((float) d); } values.trim(); return FloatColumn.create(this.name(), values.elements()); } }