Constructor and Description |
---|
ArrayMath() |
Modifier and Type | Method and Description |
---|---|
static double[] |
abs(double[] in)
Returns the absolute values for a double[]
|
static double[] |
absi(double[] in)
Returns the absolute values for a double[] (in-place)
|
static double[] |
add(double[] in1,
double factor)
Returns in1 + factor element-wise
|
static double[] |
add(double[] in1,
double[] in2)
Returns in1+in2 element-wise where in1 and in2 are double[]s
|
static double[] |
addi(double[] in1,
double factor)
Returns in1 + factor element-wise (in-place)
|
static double[] |
addi(double[] in1,
double[] in2)
Returns in1+in2 element-wise where in1 and in2 are double[]s
|
static boolean |
any(boolean[] in)
Returns true where any element in the input is true
|
static double[] |
cusum(double[] in)
Returns the cumulative sum of the elements of the input.
|
static double[] |
cusumi(double[] in)
Returns the cumulative y of the elements of the input (in-place).
|
static double[] |
diff(double[] in)
Returns the first derivative for a double[]
|
static double[] |
diffi(double[] in)
Returns the first derivative for a double[] (in-place).
|
static double[] |
diffpad(double[] in) |
static double[] |
div(double[] in1,
double factor)
Returns in1/factor element-wise where in1 is a double[] and factor is
scalar
|
static double[] |
div(double[] in1,
double[] in2)
Returns in1/in2 element-wise where in1 and in2 are double[]s
|
static double[] |
divi(double[] in1,
double factor)
Returns in1/factor element-wise where in1 is a double[] and factor is
scalar (in-place)
|
static double[] |
divi(double[] in1,
double[] in2)
Returns in1/in2 element-wise where in1 and in2 are double[]s (in-place)
|
static double |
dot(double[] in1,
double[] in2)
Returns scalar dot product of in1 & in2
|
static double[] |
fill(int len,
int start,
int inc)
Fills a double[] of length len, with values beginning with start and
incrementing by inc.
|
static boolean[] |
filli(boolean[] in,
boolean constant)
Fills the input with the specified value (in-place)
|
static double[] |
filli(double[] in,
double constant)
Fills the input with the specified value (in-place)
|
static boolean[] |
isEqual(double[] in,
double x)
Returns true for in==x element-wise.
|
static boolean[] |
isGE(double[] in,
double x)
Returns true where in is greater than or equal to x, element-wise.
|
static boolean[] |
isGT(double[] in,
double x)
Returns true where in is greater than x, element-wise.
|
static boolean[] |
isInfinite(double[] in)
Returns true where in equals +infinity or -infinity, element-wise.
|
static boolean[] |
isLE(double[] in,
double x)
Returns true where in has magnitude less than or equal to x,
element-wise.
|
static boolean[] |
isLT(double[] in,
double x)
Returns true where in has magnitude less than x, element-wise.
|
static boolean[] |
isNaN(double[] in)
Returns true where in is Not-a-Number element-wise.
|
static boolean[] |
isZero(double[] in)
Returns true for in==0 (or -0) element-wise
|
static double[] |
linspace(double start,
double stop,
int n) |
static double[] |
log10(double[] in)
Returns the Math.log10() for a double[]
|
static double[] |
log10i(double[] in)
Returns the Math.log10() for a double[] (in-place)
|
static double |
max(double[] in)
Returns maximum value ignoring NaNs.
|
static double[] |
max(double[] in,
double factor)
Returns a vector containing the maximum for each element from the input
and the factor supplied.
|
static double[] |
max(double[] in1,
double[] in2)
Returns a vector containing the maximum for each element from the inputs.
|
static double[] |
maxi(double[] in1,
double factor)
Returns a vector containing the maximum for each element from the input
and factor.
|
static double[] |
maxi(double[] in1,
double[] in2)
Returns a vector containing the maximum for each element from the inputs.
|
static double |
min(double[] in)
Returns minimum value ignoring NaNs.
|
static double[] |
min(double[] in,
double factor)
Returns a vector containing the minimum for each element from the input
and the factor supplied.
|
static double[] |
min(double[] in1,
double[] in2)
Returns a vector containing the minimum for each element from the inputs.
|
static double[] |
mini(double[] in1,
double factor)
Returns a vector containing the minimum for each element from the inputs.
|
static double[] |
mini(double[] in1,
double[] in2)
Returns a vector containing the minimum for each element from the inputs.
|
static double[] |
minmax(double[] in)
Returns double[2] array containing the minimum and maximum values
ignoring NaNs.
|
static int[] |
minmax(int[] in)
Returns int[2] array containing the minimum and maximum values ignoring
NaNs.
|
static double[] |
mul(double[] in1,
double factor)
Returns in1*factor element-wise where in1 is a double[] and factor is
scalar
|
static double[] |
mul(double[] in1,
double[] in2)
Returns in1*in2 element-wise where in1 and in2 are double[]s
|
static double[] |
muli(double[] in1,
double factor)
Returns in1*factor element-wise where in1 is a double[] and factor is
scalar (in-place)
|
static double[] |
muli(double[] in1,
double[] in2)
Returns in1*in2 element-wise where in1 and in2 are double[]s (in-place)
|
static double[] |
neg(double[] in)
Returns the negated input
|
static double[] |
negi(double[] in)
Returns the negated input (in-place)
|
static double[] |
pow(double[] in,
double exponent)
Returns the Math.pow() for a double[]
|
static double[] |
powi(double[] in,
double exponent)
Returns the Math.pow() for a double[] (in-place)
|
double[] |
repVeci(double[] in,
double[] vec)
Repetitively fills the vector in with the values from vec
|
static double[] |
sqrt(double[] in)
Returns the square roots for a double[]
|
static double[] |
sqrti(double[] in)
Returns the square roots for a double[] (in-place)
|
static double[] |
sub(double[] in,
double factor)
Returns in-factor element-wise
|
static double[] |
sub(double[] in1,
double[] in2)
Returns in1-in2 element-wise where in1 and in2 are double[]s
|
static double[] |
subi(double[] in,
double factor)
Returns in-factor element-wise (in-place)
|
static double[] |
subi(double[] in1,
double[] in2)
Returns in1-in2 element-wise where in1 and in2 are double[]s
|
static double[] |
subi(double factor,
double[] in1)
Returns factor - in1 element-wise where in1 is a double[] and factor is
scalar (in-place)
|
static double |
sum(double[] in)
Returns the sum of the elements of the input.
|
static double |
sum(double[] in,
int idx0,
int idx1) |
public static double sum(double[] in)
in
- the input arraypublic static double sum(double[] in, int idx0, int idx1)
public static double[] cusum(double[] in)
in
- the input arraypublic static double[] cusumi(double[] in)
in
- the input arraypublic static double[] abs(double[] in)
in
- the input arraypublic static double[] absi(double[] in)
in
- the input arraypublic static double[] sqrt(double[] in)
in
- the input arraypublic static double[] sqrti(double[] in)
in
- the input arraypublic static double[] neg(double[] in)
in
- the input arraypublic static double[] negi(double[] in)
in
- the input arraypublic static double[] log10(double[] in)
in
- the input arraypublic static double[] log10i(double[] in)
in
- the input arraypublic static double[] pow(double[] in, double exponent)
in
- the input arrayexponent
- the exponentpublic static double[] powi(double[] in, double exponent)
in
- the input arrayexponent
- the exponentpublic static double[] diff(double[] in)
in
- the input arraypublic static double[] diffpad(double[] in)
public static double[] diffi(double[] in)
in
- the input arraypublic static double[] fill(int len, int start, int inc)
len
- the length of the array to createstart
- the starting valueinc
- the increment between elementspublic static double[] filli(double[] in, double constant)
in
- the input arrayconstant
- the constant value to fill the array withpublic static boolean[] filli(boolean[] in, boolean constant)
in
- the input arrayconstant
- the constant value to fill the array withpublic static double[] div(double[] in1, double[] in2)
in1
- the numerator arrayin2
- the divisor arraypublic static double[] divi(double[] in1, double[] in2)
in1
- the numerator arrayin2
- the divisor arraypublic static double[] div(double[] in1, double factor)
in1
- the numerator arrayfactor
- the scalar divisorpublic static double[] divi(double[] in1, double factor)
in1
- the input arrayfactor
- the divisorpublic static double[] subi(double factor, double[] in1)
in1
- the input arrayfactor
- the scalar to subtractpublic static double[] mul(double[] in1, double[] in2)
in1
- input array 1in2
- input array 2public static double[] muli(double[] in1, double[] in2)
in1
- input array 1in2
- input array 2public static double[] mul(double[] in1, double factor)
in1
- the input arrayfactor
- a scalar factorpublic static double[] muli(double[] in1, double factor)
in1
- the input arrayfactor
- a scalar factorpublic static double[] add(double[] in1, double[] in2)
in1
- input array 1in2
- input array 2public static double[] addi(double[] in1, double[] in2)
in1
- input array 1in2
- input array 2public static double[] add(double[] in1, double factor)
in1
- the input arrayfactor
- the factor to addpublic static double[] addi(double[] in1, double factor)
in1
- the input arrayfactor
- the factor to addpublic static double[] sub(double[] in1, double[] in2)
in1
- input array 1in2
- input array 2public static double[] subi(double[] in1, double[] in2)
in1
- input array 1in2
- input array 2public static double[] sub(double[] in, double factor)
in
- input arrayfactor
- the value to subtractpublic static double[] subi(double[] in, double factor)
in
- input arrayfactor
- the value to subtractpublic static double dot(double[] in1, double[] in2)
in1
- input array 1in2
- input array 2public static boolean[] isZero(double[] in)
in
- the input arraypublic static boolean[] isEqual(double[] in, double x)
in
- the input arrayx
- the value to compare topublic static boolean[] isLT(double[] in, double x)
in
- the input arrayx
- the value to compare topublic static boolean[] isLE(double[] in, double x)
in
- the input arrayx
- the value to compare topublic static boolean[] isGT(double[] in, double x)
in
- the input arrayx
- the value to compare topublic static boolean[] isGE(double[] in, double x)
in
- the input arrayx
- the value to compare topublic static boolean[] isNaN(double[] in)
in
- the input arraypublic static boolean[] isInfinite(double[] in)
in
- the input arraypublic static boolean any(boolean[] in)
in
- the input arraypublic static double min(double[] in)
in
- a double[]public static double max(double[] in)
in
- a double[]public static double[] min(double[] in1, double[] in2)
in1
- input array 1in2
- input array 2public static double[] mini(double[] in1, double[] in2)
in1
- input array 1in2
- input array 2public static double[] min(double[] in, double factor)
in
- input arrayfactor
- to comapre the input topublic static double[] max(double[] in, double factor)
in
- input arrayfactor
- to compare topublic static double[] max(double[] in1, double[] in2)
in1
- input array 1in2
- input array 2public static double[] maxi(double[] in1, double[] in2)
in1
- input array 1in2
- input array 2public static double[] maxi(double[] in1, double factor)
in1
- input array 1factor
- public static double[] mini(double[] in1, double factor)
in1
- input array 1factor
- a scalar valuepublic static double[] minmax(double[] in)
in
- a double[]public static int[] minmax(int[] in)
in
- a int[]public double[] repVeci(double[] in, double[] vec)
in
- the array to fillvec
- the source valuespublic static double[] linspace(double start, double stop, int n)