commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Phil Steitz <>
Subject [math] additions to MathArrays
Date Tue, 24 Nov 2015 13:52:04 GMT
I need the following methods to complete the fix for MATH-1246.  I
can add them as private methods to the KS class; but they seem
generally useful, so I propose adding them to MathArrays.  Any

  * Concatenates two arrays.
  * @param x first array
  * @param y second array
  * @return a new array consisting of the entries of x followed by
the entries of y
  * @throws NullPointerException if either x or y is null
public static double[] concat(double[] x, double[] y)

  * Returns an array consisting of the unique values in {@code data}.
  * The return array is sorted in descending order.
  * @param data
  * @return descending list of values included in the input array
public static double[] values(double[] data)

  * Adds random jitter to {@code data} using deviates sampled from
{@code dist}.
  * <p>
  * Note that jitter is applied in-place - i.e., the array
  * values are overwritten with the result of applying jitter.</p>
  * @param data input/output data array
  * @param dist probability distribution to sample for jitter values
  * @throws NullPointerException if either of the parameters is null
 public static void jitter(double[] data, RealDistribution dist)

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message