public class Dbl extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
Dbl.ReduceBy
Public interface for a very fast reduce by.
|
Constructor and Description |
---|
Dbl() |
Modifier and Type | Method and Description |
---|---|
static double[] |
add(double[] array,
double v) |
static double[] |
add(double[] array,
double[] array2) |
static double[] |
array(double... array) |
static double[] |
arrayOfDouble(int size)
Creates an array of bytes
|
static double[] |
compact(double[] array) |
static double[] |
copy(double[] array) |
static double[] |
endSliceOf(double[] array,
int endIndex) |
static boolean |
equals(double[] expected,
double[] got)
Checks to see if two arrays are equals
|
static boolean |
equals(double expected,
double got)
Compares two values
|
static boolean |
equals(int start,
int end,
double[] expected,
double[] got)
Checks to see if two arrays are equals
|
static boolean |
equalsOrDie(double[] expected,
double[] got)
Checks to see if two arrays are equals
|
static boolean |
equalsOrDie(double expected,
double got)
Checks to see if two values are the same
|
static double[] |
grow(double[] array) |
static double[] |
grow(double[] array,
int size) |
static int |
hashCode(double[] array) |
static int |
hashCode(int start,
int end,
double[] array) |
static double |
idx(double[] array,
int index) |
static void |
idx(double[] array,
int index,
double value) |
static boolean |
in(double value,
double[] array) |
static double[] |
insert(double[] array,
int idx,
double v) |
static double[] |
insert(double[] array,
int fromIndex,
double[] values) |
static int |
len(double[] array) |
static double |
max(double[] values)
max
|
static double |
max(double[] values,
int length)
max
|
static double |
max(double[] values,
int start,
int length)
Max
|
static double |
mean(double[] values)
Average
|
static double |
mean(double[] values,
int length)
Average
|
static double |
median(double[] values)
Calculate Median
|
static double |
median(double[] values,
int length)
Calculate Median
|
static double |
median(double[] values,
int start,
int length)
Calculate Median
|
static double |
min(double[] values)
Min
|
static double |
min(double[] values,
int length)
Min
|
static double |
min(double[] values,
int start,
int length)
Min
|
static double |
reduceBy(double[] array,
Dbl.ReduceBy reduceBy)
A very fast reduce by.
|
static double |
reduceBy(double[] array,
int length,
Dbl.ReduceBy reduceBy) |
static double |
reduceBy(double[] array,
int start,
int length,
Dbl.ReduceBy reduceBy) |
static double |
reduceBy(double[] array,
int start,
int length,
Object object)
Reduce By
|
static double |
reduceBy(double[] array,
int length,
Object object)
Reduce By
|
static double |
reduceBy(double[] array,
int length,
Object function,
String functionName)
Reduce By
|
static <T> double |
reduceBy(double[] array,
T object)
Reduce by functional support for int arrays.
|
static <T> double |
reduceBy(double[] array,
T object,
String methodName)
Reduce by functional support for int arrays.
|
static double[] |
shrink(double[] array,
int size) |
static double[] |
slc(double[] array,
int startIndex) |
static double[] |
slc(double[] array,
int startIndex,
int endIndex) |
static double[] |
slcEnd(double[] array,
int endIndex) |
static double[] |
sliceOf(double[] array,
int startIndex,
int endIndex) |
static double |
standardDeviation(double[] values)
Calculate standard deviation.
|
static double |
standardDeviation(double[] values,
int length)
Calculate standard deviation.
|
static double |
standardDeviation(double[] values,
int start,
int length)
Calculate standard deviation.
|
static double |
sum(double[] values)
Sum
|
static double |
sum(double[] values,
int length)
Sum
Provides overflow protection.
|
static double |
sum(double[] values,
int start,
int length)
Sum
Provides overflow protection.
|
static double |
variance(double[] values)
Calculate Variance.
|
static double |
variance(double[] values,
int length)
Calculate Variance.
|
static double |
variance(double[] values,
int start,
int length)
Calculate Variance.
|
static double |
varianceDouble(double[] values,
int start,
int length)
Calculate Variance.
|
public static double[] grow(double[] array, int size)
public static double[] grow(double[] array)
public static double[] shrink(double[] array, int size)
public static double[] compact(double[] array)
public static double[] arrayOfDouble(int size)
size
- size of the array you want to makepublic static double[] array(double... array)
array
- public static int len(double[] array)
public static double idx(double[] array, int index)
public static void idx(double[] array, int index, double value)
public static double[] sliceOf(double[] array, int startIndex, int endIndex)
public static double[] slc(double[] array, int startIndex, int endIndex)
public static double[] slc(double[] array, int startIndex)
public static double[] endSliceOf(double[] array, int endIndex)
public static double[] slcEnd(double[] array, int endIndex)
public static boolean in(double value, double[] array)
public static double[] copy(double[] array)
public static double[] add(double[] array, double v)
public static double[] add(double[] array, double[] array2)
public static double[] insert(double[] array, int idx, double v)
public static double[] insert(double[] array, int fromIndex, double[] values)
public static boolean equalsOrDie(double[] expected, double[] got)
expected
- expected arraygot
- got arraypublic static boolean equals(double[] expected, double[] got)
expected
- expected arraygot
- got arraypublic static double reduceBy(double[] array, Dbl.ReduceBy reduceBy)
array
- array of items to reduce byreduceBy
- reduceBy interfacepublic static double reduceBy(double[] array, int start, int length, Dbl.ReduceBy reduceBy)
array
- array of items to reduce bystart
- where to start in the arraylength
- where to end in the arrayreduceBy
- the function to do the reduce bypublic static double reduceBy(double[] array, int length, Dbl.ReduceBy reduceBy)
array
- array of items to reduce bylength
- where to end in the arrayreduceBy
- the function to do the reduce bypublic static <T> double reduceBy(double[] array, T object)
T
- the type of objectarray
- array of items to reduce byobject
- object that contains the reduce by functionpublic static <T> double reduceBy(double[] array, T object, String methodName)
T
- the type of objectarray
- array of items to reduce byobject
- object that contains the reduce by functionpublic static double reduceBy(double[] array, int length, Object object)
array
- array of items to reduce bylength
- where to end in the arrayobject
- functionpublic static double reduceBy(double[] array, int length, Object function, String functionName)
array
- array of items to reduce bylength
- where to end in the arrayfunction
- functionfunction
- functionNamepublic static double reduceBy(double[] array, int start, int length, Object object)
array
- array of items to reduce bylength
- where to end in the arrayobject
- functionpublic static boolean equalsOrDie(double expected, double got)
expected
- expected valuegot
- got valuepublic static boolean equals(double expected, double got)
expected
- expected valuegot
- got valuepublic static double sum(double[] values)
values
- values in intpublic static double sum(double[] values, int length)
values
- values in intpublic static double sum(double[] values, int start, int length)
values
- values in intpublic static double max(double[] values, int start, int length)
values
- values in intpublic static double max(double[] values)
values
- values in intpublic static double max(double[] values, int length)
values
- values in intpublic static double min(double[] values, int start, int length)
values
- values in intpublic static double min(double[] values)
values
- values in intpublic static double min(double[] values, int length)
values
- values in intpublic static double mean(double[] values, int length)
values
- valuespublic static double mean(double[] values)
values
- values in intpublic static double variance(double[] values, int start, int length)
values
- valuesstart
- startlength
- lengthpublic static double varianceDouble(double[] values, int start, int length)
values
- valuesstart
- startlength
- lengthpublic static double variance(double[] values, int length)
values
- valueslength
- lengthpublic static double variance(double[] values)
values
- valuespublic static double standardDeviation(double[] values, int start, int length)
values
- valuesstart
- startlength
- lengthpublic static double standardDeviation(double[] values, int length)
values
- valueslength
- lengthpublic static double standardDeviation(double[] values)
values
- valuespublic static double median(double[] values, int start, int length)
start
- startvalues
- valueslength
- lengthpublic static double median(double[] values, int length)
values
- valueslength
- lengthpublic static double median(double[] values)
values
- valuespublic static boolean equals(int start, int end, double[] expected, double[] got)
expected
- expected arraygot
- got arraypublic static int hashCode(double[] array)
public static int hashCode(int start, int end, double[] array)
Copyright © 2014. All rights reserved.