jebl.util
public class Utils extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
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 boolean isContains(java.lang.String[] set, java.lang.String query)
set
- the set of stringsquery
- the query stringpublic static double[] getCopy(double[] array)
public static double getSum(double[] array)
array
- The array to sum uppublic static double getMax(double[] array)
array
- The array to checkpublic static 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 double getMin(double[] array)
array
- The array to checkpublic static double getMean(double[] array)
array
- the valuespublic static double[] getCopy(double[] array, int start, int end)
public static double[] getCopy(double[] array, int start)
public static byte[] getCopy(byte[] array)
array
- the bytes to copypublic static java.lang.String[] getCopy(java.lang.String[] array)
array
- the strings to copypublic static double[][] getCopy(double[][] array)
public static int[][] getCopy(int[][] matrix)
matrix
- the matrix to clonepublic static double[][][] getCopy(double[][][] array)
public static byte[][] getCopy(byte[][] array)
public static boolean[][] getCopy(boolean[][] array)
public static int[] getCopy(int[] array)
public static int[] getCopy(int[] array, int startingIndex)
public static void copy(double[][] source, double[][] dest)
public static java.lang.String toString(double[] array, int number)
number
- number of elements to process starting from first elementpublic static java.lang.String toString(java.lang.Object[] array, int number)
number
- number of elements to process starting from first elementpublic static java.lang.String toString(java.lang.Object[] array, java.lang.String divider)
public static 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 java.lang.String toString(java.lang.Object[] array)
public static java.lang.String toString(double[] array)
public static java.lang.String toString(int[] array)
public static java.lang.String toString(int[] array, int number)
public static java.lang.String toString(double[][] array)
public static java.lang.String toString(int[][] array)
public static int getArgmax(int[] array)
array
- The array to examinepublic static int getArgmax(double[] array)
array
- The array to examinehttp://code.google.com/p/jebl2/