public class Utils
extends java.lang.Object
Constructor | Description |
---|---|
Utils() |
Modifier and Type | Method | Description |
---|---|---|
static int |
argmax(double[] array) |
Deprecated.
|
static int |
argmax(int[] array) |
Deprecated.
|
static MultivariateFunction |
combineMultivariateFunction(MultivariateFunction base,
Parameterized[] additionalParameters) |
Creates an interface between a parameterised object to allow it to act as
a multivariate minimum.
|
static void |
copy(double[][] source,
double[][] dest) |
Copies all of source into dest - assumes dest to be large enough
|
static int |
getArgmax(double[] array) |
Find the maximum "argument" (of a double array)
|
static int |
getArgmax(int[] array) |
Find the maximum "argument"
|
static boolean[][] |
getCopy(boolean[][] array) |
Clones an array of booleans
|
static byte[] |
getCopy(byte[] array) |
Clones an array of bytes
|
static byte[][] |
getCopy(byte[][] array) |
Clones an array of bytes
|
static double[] |
getCopy(double[] array) |
Clones an array of doubles
|
static double[][] |
getCopy(double[][] array) |
Clones an array of doubles
|
static double[][][] |
getCopy(double[][][] array) |
Clones an array of doubles
|
static double[] |
getCopy(double[] array,
int start) |
Clones an array of doubles from index start (inclusive) to end
|
static double[] |
getCopy(double[] array,
int start,
int end) |
Clones an array of doubles from index start (inclusive) to index end (exclusive)
|
static int[] |
getCopy(int[] array) |
Clones an array of ints
|
static int[][] |
getCopy(int[][] matrix) |
Clones a matrix of ints
|
static int[] |
getCopy(int[] array,
int startingIndex) |
Clones an array of ints
|
static java.lang.String[] |
getCopy(java.lang.String[] array) |
Clones an array of Strings
|
static double |
getMax(double[] array) |
Calculate the max of an array
|
static double |
getMax(double[] array,
int start,
int end) |
Calculate the max of an array
|
static double |
getMean(double[] array) |
Calculate the mean value of an array
|
static double |
getMin(double[] array) |
Calculate the min of an array
|
static double |
getSum(double[] array) |
Calculate the total of an array
|
static boolean |
isContains(java.lang.String[] set,
java.lang.String query) |
Test if a string occurs within a set
|
static java.lang.String |
toString(double[] array) |
A simple toString method for an array of doubles.
|
static java.lang.String |
toString(double[][] array) |
A simple toString method for an array of doubles.
|
static java.lang.String |
toString(double[] array,
int number) |
A simple toString method for an array of doubles.
|
static java.lang.String |
toString(int[] array) |
A simple toString method for an array of ints.
|
static java.lang.String |
toString(int[][] array) |
A simple toString method for an array of ints.
|
static java.lang.String |
toString(int[] array,
int number) |
|
static java.lang.String |
toString(java.lang.Object[] array) |
A simple toString method for an array of doubles.
|
static java.lang.String |
toString(java.lang.Object[] array,
int number) |
A simple toString method for an array of objects.
|
static java.lang.String |
toString(java.lang.Object[] array,
java.lang.String divider) |
A simple toString method for an array of objects.
|
static java.lang.String |
toString(java.lang.Object[] array,
java.lang.String divider,
int number) |
A simple toString method for an array of objects.
|
public static final boolean isContains(java.lang.String[] set, java.lang.String query)
set
- the set of stringsquery
- the query stringpublic static final double[] getCopy(double[] array)
public static final double getSum(double[] array)
array
- The array to sum uppublic static final double getMax(double[] array)
array
- The array to checkpublic static final double getMax(double[] array, int start, int end)
array
- The array to checkstart
- the first index to checkend
- the index after the last index to checkpublic static final double getMin(double[] array)
array
- The array to checkpublic static final double getMean(double[] array)
array
- the valuespublic static final double[] getCopy(double[] array, int start, int end)
public static final double[] getCopy(double[] array, int start)
public static final byte[] getCopy(byte[] array)
array
- the bytes to copypublic static final java.lang.String[] getCopy(java.lang.String[] array)
array
- the strings to copypublic static final double[][] getCopy(double[][] array)
public static final int[][] getCopy(int[][] matrix)
matrix
- the matrix to clonepublic static final double[][][] getCopy(double[][][] array)
public static final byte[][] getCopy(byte[][] array)
public static final boolean[][] getCopy(boolean[][] array)
public static final int[] getCopy(int[] array)
public static final int[] getCopy(int[] array, int startingIndex)
startingIndex
- , starts copying from this indexpublic static final void copy(double[][] source, double[][] dest)
public static final java.lang.String toString(double[] array, int number)
number
- number of elements to process starting from first elementpublic static final java.lang.String toString(java.lang.Object[] array, int number)
number
- number of elements to process starting from first elementpublic static final java.lang.String toString(java.lang.Object[] array, java.lang.String divider)
number
- number of elements to process starting from first elementpublic static final java.lang.String toString(java.lang.Object[] array, java.lang.String divider, int number)
number
- number of elements to process starting from first elementpublic static final java.lang.String toString(java.lang.Object[] array)
public static final java.lang.String toString(double[] array)
public static final java.lang.String toString(int[] array)
public static final java.lang.String toString(int[] array, int number)
public static final java.lang.String toString(double[][] array)
public static final java.lang.String toString(int[][] array)
public static final int argmax(int[] array)
getArgmax()
public static final int getArgmax(int[] array)
array
- The array to examinepublic static final int argmax(double[] array)
getArgmax()
public static final int getArgmax(double[] array)
array
- The array to examinepublic static final MultivariateFunction combineMultivariateFunction(MultivariateFunction base, Parameterized[] additionalParameters)