Example usage for org.apache.commons.collections.primitives DoubleList add

List of usage examples for org.apache.commons.collections.primitives DoubleList add

Introduction

In this page you can find the example usage for org.apache.commons.collections.primitives DoubleList add.

Prototype

boolean add(double element);

Source Link

Document

Appends the specified element to the end of me (optional operation).

Usage

From source file:de.unibayreuth.bayeos.goat.table.MassenTableModel.java

private void removeRows(int[] r) {
    ByteList stat = new ArrayByteList(r.length);
    IntList von = new ArrayIntList(r.length);
    DoubleList wert = new ArrayDoubleList(r.length);

    for (int i = 0; i < r.length; i++) {
        stat.add(statusList.get(r[i]));//from  w  ww .  j ava 2s.  c o m
        von.add(vonList.get(r[i]));
        wert.add(wertList.get(r[i]));
    }
    statusList.removeAll(stat);
    vonList.removeAll(von);
    wertList.removeAll(wert);
}

From source file:cz.cuni.lf1.lge.ThunderSTORM.results.ModifiedLoess.java

/**
 * Compute an interpolating function by performing a loess fit
 * on the data at the original abscissae and then building a cubic spline
 * with a/*from www .j  av a 2 s  .c  om*/
 * {@link org.apache.commons.math3.analysis.interpolation.SplineInterpolator}
 * on the resulting fit.
 *
 * @param xval the arguments for the interpolation points
 * @param yval the values for the interpolation points
 * @return A cubic spline built upon a loess fit to the data at the original abscissae
 * @throws NonMonotonicSequenceException if {@code xval} not sorted in
 * strictly increasing order.
 * @throws DimensionMismatchException if {@code xval} and {@code yval} have
 * different sizes.
 * @throws NoDataException if {@code xval} or {@code yval} has zero size.
 * @throws NotFiniteNumberException if any of the arguments and values are
 * not finite real numbers.
 * @throws NumberIsTooSmallException if the bandwidth is too small to
 * accomodate the size of the input data (i.e. the bandwidth must be
 * larger than 2/n).
 */
public final PolynomialSplineFunction interpolate(double[] xval, double[] yval)
        throws NonMonotonicSequenceException, DimensionMismatchException, NoDataException,
        NotFiniteNumberException, NumberIsTooSmallException {
    double[] smoothed = smooth(xval, yval);
    DoubleList newX = new ArrayDoubleList();
    DoubleList newSmoothed = new ArrayDoubleList();
    newX.add(xval[0]);
    newSmoothed.add(smoothed[0]);
    for (int i = 1; i < xval.length; i++) {
        if (xval[i] != xval[i - 1]) {
            newX.add(xval[i]);
            newSmoothed.add(smoothed[i]);
        }
    }
    xval = newX.toArray();
    smoothed = newSmoothed.toArray();

    return new SplineInterpolator().interpolate(xval, smoothed);
}