| Modifier and Type | Class and Description |
|---|---|
| public static interface | MathArrays.
Real-valued function that operate on an array or a part of it. |
| public static enum | MathArrays.
Specification of ordering direction. |
| private static class | MathArrays.
A helper data structure holding a double and an integer value. |
| public static enum | MathArrays.
Specification for indicating that some operation applies before or after a given index. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static < the type of the field elements T> T[] | Returns: a new arrayfield to which array elements belong field, final int of the array length)Build an array of elements. |
| public static < the type of the field elements T> T[][] | Returns: a new arrayfield to which array elements belong field, final int number of rows in the array rows, final int number of columns (may be negative to build partial
arrays in the same way columns)new Field[rows][] works)Build a double dimension array of elements. |
| public static boolean | Returns: true if the arrays have the same length.Array. a, double[] Array. b, boolean Whether to throw an exception if the check fails. abort)Check that both arrays have the same length. |
| public static void | |
| public static boolean | Returns: true if the arrays have the same length.Array. a, int[] Array. b, boolean Whether to throw an exception if the check fails. abort)Check that both arrays have the same length. |
| public static void | |
| public static void | checkNonNegative(final long[]
Array to be tested in)Check that all entries of the input array are >= 0. |
| public static void | |
| public static void | |
| public static boolean | Returns: true if the array is sorted.Values. val, MathArrays.Ordering direction. dir,Whether the order should be strict. strict, boolean Whether to throw an exception if the check fails. abort)Check that the given array is sorted. |
| public static void | checkOrder(double[]
Values. val, MathArrays.Ordering direction. dir,Whether the order should be strict. strict)Check that the given array is sorted. |
| public static void | |
| public static void | checkPositive(final double[]
Array to be tested in)Check that all entries of the input array are strictly positive. |
| public static void | checkRectangular(final long[][]
array to be tested in)Throws DimensionMismatchException if the input array is not rectangular. |
| public static double[] | Returns: a new array consisting of the entries of the argument arrayslist of double[] arrays to concatenate x)Concatenates a sequence of arrays. |
| public static double[] | Returns: the convolution ofx and h.
This array's length will be x.length + h.length - 1.First sequence.
Typically, this sequence will represent an input signal to a system. x, double[] Second sequence.
Typically, this sequence will represent the impulse response of the system. h)Calculates the convolution between two sequences. |
| public static int[] | Returns: the copied array.Array to be copied. source)Creates a copy of the |
| public static double[] | Returns: the copied array.Array to be copied. source)Creates a copy of the |
| public static int[] | Returns: the copied array.Array to be copied. source, int Number of entries to copy. If smaller then the source
length, the copy will be truncated, if larger it will padded with
zeroes. len)Creates a copy of the |
| public static double[] | Returns: the copied array.Array to be copied. source, int Number of entries to copy. If smaller then the source
length, the copy will be truncated, if larger it will padded with
zeroes. len)Creates a copy of the |
| public static double[] | Returns: the copied array.Array to be copied. source, int Initial index of the range to be copied, inclusive. from, int Final index of the range to be copied, exclusive. (This index may lie outside the array.) to)Creates a copy of the |
| public static double | Returns: the cosine of the angle between the vectors.Cartesian coordinates of the first vector. v1, double[] Cartesian coordinates of the second vector. v2)Calculates the cosine of the angle between two vectors. |
| public static double | Returns: the L2 distance between the two pointsthe first point p1, double[] the second point p2)Calculates the L2 (Euclidean) distance between two points. |
| public static double | Returns: the L2 distance between the two pointsthe first point p1, int[] the second point p2)Calculates the L2 (Euclidean) distance between two points. |
| public static double | Returns: the L1 distance between the two pointsthe first point p1, double[] the second point p2)Calculates the L1 (sum of abs) distance between two points. |
| public static int | Returns: the L1 distance between the two pointsthe first point p1, int[] the second point p2)Calculates the L1 (sum of abs) distance between two points. |
| public static double | Returns: the L∞ distance between the two pointsthe first point p1, double[] the second point p2)Calculates the L∞ (max of abs) distance between two points. |
| public static int | Returns: the L∞ distance between the two pointsthe first point p1, int[] the second point p2)Calculates the L∞ (max of abs) distance between two points. |
| public static double[] | Returns: a new arrayr where r[i] = a[i] + b[i].First term of the addition. a, double[] Second term of the addition. b)Creates an array whose contents will be the element-by-element addition of the arguments. |
| public static double[] | Returns: a new arrayr where r[i] = a[i] / b[i].Numerator of the division. a, double[] Denominator of the division. b)Creates an array whose contents will be the element-by-element division of the first argument by the second. |
| public static double[] | Returns: a new arrayr where r[i] = a[i] * b[i].First factor of the multiplication. a, double[] Second factor of the multiplication. b)Creates an array whose contents will be the element-by-element multiplication of the arguments. |
| public static double[] | Returns: a new arrayr where r[i] = a[i] - b[i].First term. a, double[] Element to be subtracted. b)Creates an array whose contents will be the element-by-element subtraction of the second argument from the first. |
| public static boolean | Returns: true if the values are both null or have same dimension and equal elements.first array x, float[] second array y)Returns true iff both arguments are null or have same dimensions and all
their elements are equal as defined by
|
| public static boolean | Returns: true if the values are both null or have same
dimension and equal elements.First array. x, double[] Second array. y)Returns |
| public static boolean | Returns: true if the values are both null or have same dimension and equal elementsfirst array x, float[] second array y)Returns true iff both arguments are null or have same dimensions and all
their elements are equal as defined by
|
| public static boolean | Returns: true if the values are both null or have same
dimension and equal elements.First array. x, double[] Second array. y)Returns |
| public static < the type of the elements in the specified array T extends Comparable | Returns: true if sorted, false otherwise.Values. val, MathArrays.Ordering direction. dir,Whether the order should be strict. strict)Check that an array is monotonically increasing or decreasing. |
| public static boolean | Returns: true if sorted, false otherwise.Values. val, MathArrays.Ordering direction. dir,Whether the order should be strict. strict)Check that an array is monotonically increasing or decreasing. |
| public static double | Returns: Σi ai bi.Factors. a, final double[] Factors. b)Compute a linear combination accurately. |
| public static double | Returns: a1×b1 + a2×b2first factor of the first term a1, final double second factor of the first term b1, final double first factor of the second term a2, final double second factor of the second term b2)Compute a linear combination accurately. |
| public static double | Returns: a1×b1 + a2×b2 + a3×b3first factor of the first term a1, final double second factor of the first term b1, final double first factor of the second term a2, final double second factor of the second term b2, final double first factor of the third term a3, final double second factor of the third term b3)Compute a linear combination accurately. |
| public static double | Returns: a1×b1 + a2×b2 + a3×b3 + a4×b4first factor of the first term a1, final double second factor of the first term b1, final double first factor of the second term a2, final double second factor of the second term b2, final double first factor of the third term a3, final double second factor of the third term b3, final double first factor of the third term a4, final double second factor of the third term b4)Compute a linear combination accurately. |
| public static int[] | Returns: an array whose entries are the numbers 0, 1, ...,n-1.
If n == 0, the returned array is empty.Natural number. n)Returns an array representing the natural number |
| public static double[] | Returns: the normalized array.Input array to be normalized values, double Target sum for the normalized array normalizedSum)Normalizes an array to make it sum to a specified value. |
| public static double | Returns: the 2-norm of the vector.Vector of doubles. v)Returns the Cartesian norm (2-norm), handling both overflow and underflow. |
| public static double[] | Returns: scaled copy of array with each entry multiplied by val.Scalar. val, final double[] Array to scale. arr)Create a copy of an array scaled by a value. |
| public static void | scaleInPlace(double
Scalar val, final double[] Array to scale arr)Multiply each element of an array by a value. |
| public static int[] | Returns: an array whose entries are the numbersstart, start + stride, ..., start + (size - 1) * stride.
If size == 0, the returned array is empty.Natural number. size, int Natural number. start, int Natural number. stride)Returns an array of |
| public static void | shuffle(int[]
Array whose entries will be shuffled (in-place). list, int Index at which shuffling begins. start, MathArrays.Shuffling is performed for index positions between
posstart and either the end (if Position#TAIL)
or the beginning (if Position#HEAD) of the array.Shuffle the entries of the given array. |
| public static void | shuffle(int[]
Array whose entries will be shuffled (in-place). list, int Index at which shuffling begins. start, MathArrays.Shuffling is performed for index positions between
pos,start and either the end (if Position#TAIL)
or the beginning (if Position#HEAD) of the array.Random number generator. rng)Shuffle the entries of the given array, using the Fisher–Yates algorithm. |
| public static void | shuffle(int[]
Array whose entries will be shuffled (in-place). list, RandomGenerator Random number generator. rng)Shuffle the entries of the given array. |
| public static void | shuffle(int[]
Array whose entries will be shuffled (in-place). list)Shuffle the entries of the given array. |
| public static void | sortInPlace(double[]
Array to be sorted and used as a pattern for permutation
of the other arrays. x, double[]... Set of arrays whose permutations of entries will follow
those performed on yList)x.Sort an array in ascending order in place and perform the same reordering of entries on other arrays. |
| public static void | sortInPlace(double[]
Array to be sorted and used as a pattern for permutation
of the other arrays. x, final MathArrays.Order direction. dir,Set of arrays whose permutations of entries will follow
those performed on yList)x.Sort an array in place and perform the same reordering of entries on other arrays. |
| public static double[] | Returns: descending list of values included in the input arrayarray to scan data)Returns an array consisting of the unique values in |
| public static boolean | Returns: true if the parameters are valid and designate a subarray of positive lengththe input array values, final int index of the first array element to include begin, final int the number of elements to include length)This method is used to verify that the input parameters designate a subarray of positive length. |
| public static boolean | Returns: true if the parameters are validthe input array values, final int index of the first array element to include begin, final int the number of elements to include length, final boolean if allowEmpty)true then zero length arrays are allowedThis method is used to verify that the input parameters designate a subarray of positive length. |
| public static boolean | Returns: true if the parameters are valid and designate a subarray of positive lengththe input array values, final double[] the weights array weights, final int index of the first array element to include begin, final int the number of elements to include length)This method is used to verify that the begin and length parameters designate a subarray of positive length and the weights are all non-negative, non-NaN, finite, and not all zero. |
| public static boolean | Returns: true if the parameters are valid.the input array. values, final double[] the weights array. weights, final int index of the first array element to include. begin, final int the number of elements to include. length, final boolean if allowEmpty)true than allow zero length arrays to pass.This method is used to verify that the begin and length parameters designate a subarray of positive length and the weights are all non-negative, non-NaN, finite, and not all zero. |