Method Summary |
|
public static String | arrayToString(Object array) Returns the given Array in a string representation. |
public static String | backQuoteChars(String string) Converts carriage returns and new lines in a string into \r and \n. |
public static void | checkForRemainingOptions(String[] options) Checks if the given array contains any non-empty options. |
public static String | convertNewLines(String string) Converts carriage returns and new lines in a string into \r and \n. |
final public static double | correlation(double y1, double y2, int n) Returns the correlation coefficient of two double vectors. |
public static String | doubleToString(double value, int afterDecimalPoint) Rounds a double and converts it into String. |
public static String | doubleToString(double value, int width, int afterDecimalPoint) Rounds a double and converts it into a formatted decimal-justified String. |
public static boolean | eq(double a, double b) Tests if a is equal to b. |
public static Object | forName(Class classType, String className, String[] options) Creates a new instance of an object given it's class name and
(optional) arguments to pass to it's setOptions method. |
public static Class | getArrayClass(Class c) Returns the basic class of an array class (handles multi-dimensional
arrays). |
public static int | getArrayDimensions(Class array) Returns the dimensions of the given array. |
public static int | getArrayDimensions(Object array) Returns the dimensions of the given array. |
public static boolean | getFlag(char flag, String[] options) Checks if the given array contains the flag "-Char". |
public static boolean | getFlag(String flag, String[] options) Checks if the given array contains the flag "-String". |
public static String | getOption(char flag, String[] options) Gets an option indicated by a flag "-Char" from the given array
of strings. |
public static String | getOption(String flag, String[] options) Gets an option indicated by a flag "-String" from the given array
of strings. |
public static int | getOptionPos(char flag, String[] options) Gets the index of an option or flag indicated by a flag "-Char" from
the given array of strings. |
public static int | getOptionPos(String flag, String[] options) Gets the index of an option or flag indicated by a flag "-String" from
the given array of strings. |
public static boolean | gr(double a, double b) Tests if a is greater than b. |
public static boolean | grOrEq(double a, double b) Tests if a is greater or equal to b. |
public static double | info(int counts) Computes entropy for an array of integers. |
public static String | joinOptions(String[] optionArray) Joins all the options in an option array into a single string,
as might be used on the command line. |
public static double | kthSmallestValue(int[] array, int k) Returns the kth-smallest value in the array. |
public static double | kthSmallestValue(double[] array, int k) |
public static double | log2(double a) Returns the logarithm of a for base 2. |
public static double[] | logs2probs(double[] a) Converts an array containing the natural logarithms of
probabilities stored in a vector back into probabilities. |
public static void | main(String[] ops) Main method for testing this class. |
public static int | maxIndex(double[] doubles) Returns index of maximum element in a given
array of doubles. |
public static int | maxIndex(int[] ints) Returns index of maximum element in a given
array of integers. |
public static double | mean(double[] vector) Computes the mean for an array of doubles. |
public static int | minIndex(int[] ints) Returns index of minimum element in a given
array of integers. |
public static int | minIndex(double[] doubles) Returns index of minimum element in a given
array of doubles. |
public static void | normalize(double[] doubles) Normalizes the doubles in the array by their sum. |
public static void | normalize(double[] doubles, double sum) Normalizes the doubles in the array using the given value. |
public static String | padLeft(String inString, int length) Pads a string to a specified length, inserting spaces on the left
as required. |
public static String | padRight(String inString, int length) Pads a string to a specified length, inserting spaces on the right
as required. |
public static String[] | partitionOptions(String[] options) Returns the secondary set of options (if any) contained in
the supplied options array. |
public static int | probRound(double value, Random rand) Rounds a double to the next nearest integer value in a probabilistic
fashion (e.g. |
public static double | probToLogOdds(double prob) Returns the log-odds for a given probabilitiy. |
public static String | quote(String string) Quotes a string if it contains special characters. |
public static Properties | readProperties(String resourceName) Reads properties that inherit from three locations. |
public static String | removeSubstring(String inString, String substring) Removes all occurrences of a string from another string.
Parameters: inString - the string to remove substrings from. Parameters: substring - the substring to remove. |
public static String | replaceSubstring(String inString, String subString, String replaceString) Replaces with a new string, all occurrences of a string from
another string. |
public static String | revertNewLines(String string) Reverts \r and \n in a string into carriage returns and new lines. |
public static int | round(double value) Rounds a double to the next nearest integer value. |
public static double | roundDouble(double value, int afterDecimalPoint) Rounds a double to the given number of decimal places. |
public static boolean | sm(double a, double b) Tests if a is smaller than b. |
public static boolean | smOrEq(double a, double b) Tests if a is smaller or equal to b. |
public static int[] | sort(int[] array) Sorts a given array of integers in ascending order and returns an
array of integers with the positions of the elements of the original
array in the sorted array. |
public static int[] | sort(double[] array) Sorts a given array of doubles in ascending order and returns an
array of integers with the positions of the elements of the
original array in the sorted array. |
public static String[] | splitOptions(String quotedOptionString) Split up a string containing options into an array of strings,
one for each option. |
public static int[] | stableSort(double[] array) Sorts a given array of doubles in ascending order and returns an
array of integers with the positions of the elements of the original
array in the sorted array. |
public static double | sum(double[] doubles) Computes the sum of the elements of an array of doubles. |
public static int | sum(int[] ints) Computes the sum of the elements of an array of integers. |
public static String | unbackQuoteChars(String string) The inverse operation of backQuoteChars(). |
public static String | unquote(String string) unquotes are previously quoted string (but only if necessary), i.e., it
removes the single quotes around it. |
public static double | variance(double[] vector) Computes the variance for an array of doubles. |
public static double | xlogx(int c) Returns c*log2(c) for a given integer value c. |