public class ArrayUtils extends Object
Modifier and Type | Method and Description |
---|---|
static Complex[] |
divide(Complex[] a,
double f)
Returns a new array where each element of the array
a is divided by f . |
static double[] |
divide(double[] a,
double f)
Returns a new array where each element of the array
a is divided by f . |
static Complex[] |
multiply(Complex[] a,
double f)
Returns a new array where each element of the array
a is multiplied with the factor f . |
static double[] |
multiply(double[] a,
double f)
Returns a new array where each element of the array
a is multiplied with the factor f . |
static double[] |
reverse(double[] a)
Returns a reverse copy of the passed array.
|
static Complex[] |
sortByAbsImNegImRe(Complex[] a)
Returns a copy of a Complex array, sorted by abs(im) | -im | re.
|
static Complex[] |
sortByImRe(Complex[] a)
Returns a copy of a Complex array, sorted by imaginary and real parts.
|
static double[] |
sortByMagnitude(double[] a)
Returns a copy of a double array, sorted by magnitude (absolute value).
|
static Complex[] |
toComplex(double[] a)
Converts a
double array into a Complex array. |
static double[] |
toDouble(Complex[] a,
double eps)
Converts a
Complex array into a double array. |
static double[] |
toDouble(Double[] a)
Converts a
Double (Object) array into a double array. |
static double[] |
toDouble(int[] a)
Converts an integer array into a
double array. |
static Double[] |
toObject(double[] a)
Converts a
double array into a Double (Object) array. |
static String |
toString(Complex[] a)
Returns a string representation of an array.
|
static String |
toString(double[] a)
Returns a string representation of an array.
|
static Complex[] |
zeros(int n)
Returns an array of
n Complex zeros. |
public static Complex[] zeros(int n)
n
Complex
zeros.public static double[] toDouble(Complex[] a, double eps)
Complex
array into a double
array.
Verifies that all imaginary parts are equal or below eps
.public static double[] toDouble(int[] a)
double
array.public static double[] toDouble(Double[] a)
Double
(Object) array into a double
array.public static Complex[] toComplex(double[] a)
double
array into a Complex
array.public static Double[] toObject(double[] a)
double
array into a Double
(Object) array.public static double[] multiply(double[] a, double f)
a
is multiplied with the factor f
.public static Complex[] multiply(Complex[] a, double f)
a
is multiplied with the factor f
.public static double[] divide(double[] a, double f)
a
is divided by f
.public static Complex[] divide(Complex[] a, double f)
a
is divided by f
.public static double[] reverse(double[] a)
public static double[] sortByMagnitude(double[] a)
public static Complex[] sortByImRe(Complex[] a)
public static Complex[] sortByAbsImNegImRe(Complex[] a)
public static String toString(double[] a)