public final class DoubleFunctions extends Object
| Modifier and Type | Method and Description |
|---|---|
static double[] |
append(double[] original,
double value)
Append the given value to the end of the original array, and return the result in a new array.
|
static double[] |
arrayFrom(Collection<? extends Number> data)
Create a new primitive double array from the given collection of numbers.
|
static double[] |
arrayFrom(double... data)
Create and return a new array from the given data.
|
static double[] |
arrayFrom(Number[] data)
Create a new primitive double array from the given boxed Number array.
|
static double[] |
boxCox(double[] data,
double lambda)
Transform the given data using a Box-Cox transformation with the given lambda value.
|
static double[] |
combine(double[]... arrays)
Create a new array by combining the elements of the input arrays in the order given.
|
static double[][] |
combine(double[][]... twoDArrays)
Create a new array by combining the elements of the input arrays in the order given.
|
static double[][] |
copy(double[][] values) |
static double[] |
fill(int size,
double value)
Create and return a new array of the given size with every value set to the given value.
|
static double[] |
inverseBoxCox(double[] data,
double lambda)
Invert the Box-Cox transformation, returning the original untransformed data.
|
static List<Double> |
listFrom(double... data)
Create a new list of boxed Doubles from the given array of primitive doubles.
|
static double[][] |
push(double[] values,
double[][] original) |
static double[] |
push(double value,
double[] original) |
static double[] |
round(double[] values,
int precision)
Round the given values to the specified precision.
|
static double |
round(double value,
int precision)
Round the given value to the specified precision.
|
static double[] |
slice(double[] data,
int from,
int to)
Return a slice of the data between the given indices.
|
static double[] |
sqrt(double... data)
Take the square root of each element of the given array and return the result in a new array.
|
static double[][] |
twoDArrayFrom(List<List<Double>> data) |
static List<List<Double>> |
twoDListFrom(double[]... data) |
public static double[] arrayFrom(double... data)
data - the data to create a new array from.public static double[] combine(double[]... arrays)
arrays - the arrays to combine.public static double[][] combine(double[][]... twoDArrays)
twoDArrays - the arrays to combine.public static double[] append(double[] original,
double value)
original - the array to be appended.value - the value to append to the end of the array.public static double[] push(double value,
double[] original)
public static double[][] push(double[] values,
double[][] original)
public static double[] arrayFrom(Collection<? extends Number> data)
data - the data to use in the new array.public static double[] arrayFrom(Number[] data)
data - the data to use in the new array.public static double[] fill(int size,
double value)
size - the number of elements of the new array.value - the value to fill every element of the array with.public static List<Double> listFrom(double... data)
data - the data to populate the new list with.public static double[] slice(double[] data,
int from,
int to)
data - the data to slice.from - the starting index.to - the ending index. The value at this index is excluded from the result.public static double[] boxCox(double[] data,
double lambda)
data - the data to transform.lambda - the Box-Cox parameter.public static double[] inverseBoxCox(double[] data,
double lambda)
data - the transformed data to invert.lambda - the Box-Cox parameter used in the transformation.public static double[] sqrt(double... data)
data - the data to take the square root of.public static double round(double value,
int precision)
value - the value to round.precision - the decimal place precision to round to.public static double[] round(double[] values,
int precision)
values - the values to round.precision - the decimal place precision to round to.public static double[][] copy(double[][] values)