@Deprecated
public final class ArraysMDE
extends java.lang.Object
Arrays
and
Collections
.Modifier and Type | Class and Description |
---|---|
static class |
ArraysMDE.ComparableArrayComparatorLengthFirst<T extends java.lang.Comparable<T>>
Deprecated.
Compare two arrays first by length (a shorter array is considered less), and if of equal length
compare lexically (element-by-element).
|
static class |
ArraysMDE.ComparableArrayComparatorLexical<T extends java.lang.Comparable<T>>
Deprecated.
Compare two arrays lexically (element-by-element).
|
static class |
ArraysMDE.DoubleArrayComparatorLexical
Deprecated.
Compare two arrays lexically (element-by-element).
|
static class |
ArraysMDE.IntArrayComparatorLengthFirst
Deprecated.
Compare two arrays first by length (a shorter array is considered less), and if of equal length
compare lexically (element-by-element).
|
static class |
ArraysMDE.IntArrayComparatorLexical
Deprecated.
Compare two arrays lexically (element-by-element).
|
static class |
ArraysMDE.LongArrayComparatorLengthFirst
Deprecated.
Compare two arrays first by length (a shorter array is considered less), and if of equal length
compare lexically (element-by-element).
|
static class |
ArraysMDE.LongArrayComparatorLexical
Deprecated.
Compare two arrays lexically (element-by-element).
|
static class |
ArraysMDE.ObjectArrayComparatorLengthFirst
Deprecated.
Compare two arrays first by length (a shorter array is considered less), and if of equal length
compare lexically (element-by-element).
|
static class |
ArraysMDE.ObjectArrayComparatorLexical
Deprecated.
Compare two arrays lexically (element-by-element).
|
static class |
ArraysMDE.StringArrayComparatorLexical
Deprecated.
Compare two arrays lexically (element-by-element).
|
Modifier and Type | Method and Description |
---|---|
static boolean |
all_null(java.util.List<?> a)
Deprecated.
Return true if all elements of a are null.
|
static boolean |
all_null(java.lang.Object[] a)
Deprecated.
Return true if all elements of a are null.
|
static boolean |
any_null(java.util.List<?> a)
Deprecated.
Return true if a contains null.
|
static boolean |
any_null(java.lang.Object[] a)
Deprecated.
Return true if a contains null.
|
static boolean[] |
concat(boolean[] a,
boolean[] b)
Deprecated.
Return an array that contains all the elements of both argument arrays, in order.
|
static byte[] |
concat(byte[] a,
byte[] b)
Deprecated.
Return an array that contains all the elements of both argument arrays, in order.
|
static char[] |
concat(char[] a,
char[] b)
Deprecated.
Return an array that contains all the elements of both argument arrays, in order.
|
static double[] |
concat(double[] a,
double[] b)
Deprecated.
Return an array that contains all the elements of both argument arrays, in order.
|
static float[] |
concat(float[] a,
float[] b)
Deprecated.
Return an array that contains all the elements of both argument arrays, in order.
|
static int[] |
concat(int[] a,
int[] b)
Deprecated.
Return an array that contains all the elements of both argument arrays, in order.
|
static <T> T[] |
concat(java.util.List<T> a,
java.util.List<T> b)
Deprecated.
Return an array that contains all the elements of both argument arrays, in order.
|
static <T> T[] |
concat(java.util.List<T> a,
T[] b)
Deprecated.
Return an array that contains all the elements of both argument arrays, in order.
|
static long[] |
concat(long[] a,
long[] b)
Deprecated.
Return an array that contains all the elements of both argument arrays, in order.
|
static short[] |
concat(short[] a,
short[] b)
Deprecated.
Return an array that contains all the elements of both argument arrays, in order.
|
static java.lang.String[] |
concat(java.lang.String[] a,
java.lang.String[] b)
Deprecated.
Return an array that contains all the elements of both argument arrays, in order.
|
static <T> T[] |
concat(T[] a,
java.util.List<T> b)
Deprecated.
Return an array that contains all the elements of both argument arrays, in order.
|
static <T> T[] |
concat(T[] a,
T[] b)
Deprecated.
Return an array that contains all the elements of both argument arrays, in order.
|
static int |
element_range(int[] a)
Deprecated.
Return the difference between the smallest and largest array elements.
|
static long |
element_range(long[] a)
Deprecated.
Return the difference between the smallest and largest array elements.
|
static int[] |
fn_compose(int[] a,
int[] b)
Deprecated.
Return the composition of the given two functions, all of which are represented as arrays.
|
static int[] |
fn_identity(int length)
Deprecated.
Return an array [0..lenth).
|
static int[] |
fn_inverse_permutation(int[] a)
Deprecated.
Requires that fn_is_permutation(a) holds.
|
static int[] |
fn_inverse(int[] a,
int arange)
Deprecated.
Return the inverse of the given function, which is represented as an array.
|
static boolean |
fn_is_permutation(int[] a)
Deprecated.
Returns true if the array is a permutation of [0..a.length).
|
static boolean |
fn_is_total(int[] a)
Deprecated.
Return true iff the array does not contain -1.
|
static int |
indexOf(boolean[] a,
boolean elt)
Deprecated.
Searches for the first occurrence of the given element in the array.
|
static int |
indexOf(boolean[] a,
boolean[] sub)
Deprecated.
Searches for the first subsequence of the array that matches the given array elementwise.
|
static int |
indexOf(boolean[] a,
boolean elt,
int minindex,
int indexlimit)
Deprecated.
Searches for the first occurrence of the given element in the array.
|
static int |
indexOf(double[] a,
double elt)
Deprecated.
Searches for the first occurrence of the given element in the array.
|
static int |
indexOf(double[] a,
double[] sub)
Deprecated.
Searches for the first subsequence of the array that matches the given array elementwise.
|
static int |
indexOf(int[] a,
int elt)
Deprecated.
Searches for the first occurrence of the given element in the array.
|
static int |
indexOf(int[] a,
int[] sub)
Deprecated.
Searches for the first subsequence of the array that matches the given array elementwise.
|
static int |
indexOf(int[] a,
int elt,
int minindex,
int indexlimit)
Deprecated.
Searches for the first occurrence of the given element in the array.
|
static int |
indexOf(java.util.List<?> a,
java.util.List<?> sub)
Deprecated.
Searches for the first subsequence of the list that matches the given list elementwise, testing
for equality using the equals method.
|
static int |
indexOf(java.util.List<?> a,
java.lang.Object[] sub)
Deprecated.
Searches for the first subsequence of the list that matches the given array elementwise,
testing for equality using the equals method.
|
static int |
indexOf(java.util.List<? extends java.lang.Object> a,
java.lang.Object elt)
Deprecated.
Searches for the first occurrence of the given element in the list, testing for equality using
the equals method.
|
static int |
indexOf(java.util.List<? extends java.lang.Object> a,
java.lang.Object elt,
int minindex,
int indexlimit)
Deprecated.
Searches for the first occurrence of the given element in the list, testing for equality using
the equals method.
|
static int |
indexOf(long[] a,
long elt)
Deprecated.
Searches for the first occurrence of the given element in the array.
|
static int |
indexOf(long[] a,
long[] sub)
Deprecated.
Searches for the first subsequence of the array that matches the given array elementwise.
|
static int |
indexOf(long[] a,
long elt,
int minindex,
int indexlimit)
Deprecated.
Searches for the first occurrence of the given element in the array.
|
static int |
indexOf(java.lang.Object[] a,
java.util.List<?> sub)
Deprecated.
Searches for the first subsequence of the array that matches the given list elementwise,
testing for equality using the equals method.
|
static int |
indexOf(java.lang.Object[] a,
java.lang.Object[] sub)
Deprecated.
Searches for the first subsequence of the array that matches the given array elementwise,
testing for equality using the equals method.
|
static <T> int |
indexOf(T[] a,
java.lang.Object elt)
Deprecated.
Searches for the first occurrence of the given element in the array, testing for equality using
the equals method.
|
static <T> int |
indexOf(T[] a,
java.lang.Object elt,
int minindex,
int indexlimit)
Deprecated.
Searches for the first occurrence of the given element in the array, testing for equality using
the equals method.
|
static int |
indexOfEq(java.util.List<?> a,
java.util.List<?> sub)
Deprecated.
Searches for the first subsequence of the list that matches the given list elementwise, testing
for equality using == (not the equals method).
|
static int |
indexOfEq(java.util.List<?> a,
java.lang.Object[] sub)
Deprecated.
Searches for the first subsequence of the list that matches the given array elementwise,
testing for equality using == (not the equals method).
|
static int |
indexOfEq(java.util.List<? extends java.lang.Object> a,
java.lang.Object elt)
Deprecated.
Searches for the first occurrence of the given element in the list, testing for equality using
== (not the equals method).
|
static int |
indexOfEq(java.util.List<? extends java.lang.Object> a,
java.lang.Object elt,
int minindex,
int indexlimit)
Deprecated.
Searches for the first occurrence of the given element in the list, testing for equality using
== (not the equals method).
|
static int |
indexOfEq(java.lang.Object[] a,
java.util.List<?> sub)
Deprecated.
Searches for the first subsequence of the array that matches the given list elementwise,
testing for equality using == (not the equals method).
|
static int |
indexOfEq(java.lang.Object[] a,
java.lang.Object elt)
Deprecated.
Searches for the first occurrence of the given element in the array, testing for equality using
== (not the equals method).
|
static int |
indexOfEq(java.lang.Object[] a,
java.lang.Object[] sub)
Deprecated.
Searches for the first subsequence of the array that matches the given array elementwise,
testing for equality using == (not the equals method).
|
static int |
indexOfEq(java.lang.Object[] a,
java.lang.Object elt,
int minindex,
int indexlimit)
Deprecated.
Searches for the first occurrence of the given element in the array, testing for equality using
== (not the equals method).
|
static boolean |
isSubarray(boolean[] a,
boolean[] sub,
int a_offset)
Deprecated.
Determines whether the second array is a subarray of the first, starting at the specified index
of the first.
|
static boolean |
isSubarray(double[] a,
double[] sub,
int a_offset)
Deprecated.
Determines whether the second array is a subarray of the first, starting at the specified index
of the first.
|
static boolean |
isSubarray(int[] a,
int[] sub,
int a_offset)
Deprecated.
Determines whether the second array is a subarray of the first, starting at the specified index
of the first.
|
static boolean |
isSubarray(java.util.List<?> a,
java.util.List<?> sub,
int a_offset)
Deprecated.
Determines whether the second array is a subarray of the first, starting at the specified index
of the first, testing for equality using the equals method.
|
static boolean |
isSubarray(java.util.List<?> a,
java.lang.Object[] sub,
int a_offset)
Deprecated.
Determines whether the second array is a subarray of the first, starting at the specified index
of the first, testing for equality using the equals method.
|
static boolean |
isSubarray(long[] a,
long[] sub,
int a_offset)
Deprecated.
Determines whether the second array is a subarray of the first, starting at the specified index
of the first.
|
static boolean |
isSubarray(java.lang.Object[] a,
java.util.List<?> sub,
int a_offset)
Deprecated.
Determines whether the second array is a subarray of the first, starting at the specified index
of the first, testing for equality using the equals method.
|
static boolean |
isSubarray(java.lang.Object[] a,
java.lang.Object[] sub,
int a_offset)
Deprecated.
Determines whether the second array is a subarray of the first, starting at the specified index
of the first, testing for equality using the equals method.
|
static boolean |
isSubarrayEq(java.util.List<?> a,
java.util.List<?> sub,
int a_offset)
Deprecated.
Determines whether the second array is a subarray of the first, starting at the specified index
of the first, testing for equality using == (not the equals method).
|
static boolean |
isSubarrayEq(java.util.List<?> a,
java.lang.Object[] sub,
int a_offset)
Deprecated.
Determines whether the second array is a subarray of the first, starting at the specified index
of the first, testing for equality using == (not the equals method).
|
static boolean |
isSubarrayEq(java.lang.Object[] a,
java.util.List<?> sub,
int a_offset)
Deprecated.
Determines whether the second array is a subarray of the first, starting at the specified index
of the first, testing for equality using == (not the equals method).
|
static boolean |
isSubarrayEq(java.lang.Object[] a,
java.lang.Object[] sub,
int a_offset)
Deprecated.
Determines whether the second array is a subarray of the first, starting at the specified index
of the first, testing for equality using == (not the equals method).
|
static boolean |
isSubset(double[] smaller,
double[] bigger)
Deprecated.
Return whether smaller is a subset of bigger.
|
static boolean |
isSubset(long[] smaller,
long[] bigger)
Deprecated.
Return whether smaller is a subset of bigger.
|
static boolean |
isSubset(java.lang.String[] smaller,
java.lang.String[] bigger)
Deprecated.
Return whether smaller is a subset of bigger.
|
static int |
length(java.lang.Object obj)
Deprecated.
Casts obj down to the proper array type then calls .length.
|
static double |
max(double[] a)
Deprecated.
Return the largest value in the array.
|
static java.lang.Double |
max(java.lang.Double[] a)
Deprecated.
Return the largest value in the array.
|
static int |
max(int[] a)
Deprecated.
Return the largest value in the array.
|
static java.lang.Integer |
max(java.lang.Integer[] a)
Deprecated.
Return the largest value in the array.
|
static long |
max(long[] a)
Deprecated.
Return the largest value in the array.
|
static java.lang.Long |
max(java.lang.Long[] a)
Deprecated.
Return the largest value in the array.
|
static int[] |
min_max(int[] a)
Deprecated.
Return a two-element array containing the smallest and largest values in the array.
|
static long[] |
min_max(long[] a)
Deprecated.
Return a two-element array containing the smallest and largest values in the array.
|
static double |
min(double[] a)
Deprecated.
Return the smallest value in the array.
|
static java.lang.Double |
min(java.lang.Double[] a)
Deprecated.
Return the smallest value in the array.
|
static int |
min(int[] a)
Deprecated.
Return the smallest value in the array.
|
static java.lang.Integer |
min(java.lang.Integer[] a)
Deprecated.
Return the smallest value in the array.
|
static long |
min(long[] a)
Deprecated.
Return the smallest value in the array.
|
static java.lang.Long |
min(java.lang.Long[] a)
Deprecated.
Return the smallest value in the array.
|
static boolean |
noDuplicates(boolean[] a)
Deprecated.
Return true iff a does not contain duplicate elements.
|
static boolean |
noDuplicates(byte[] a)
Deprecated.
Return true iff a does not contain duplicate elements.
|
static boolean |
noDuplicates(char[] a)
Deprecated.
Return true iff a does not contain duplicate elements.
|
static boolean |
noDuplicates(double[] a)
Deprecated.
Return true iff a does not contain duplicate elements.
|
static boolean |
noDuplicates(float[] a)
Deprecated.
Return true iff a does not contain duplicate elements.
|
static boolean |
noDuplicates(int[] a)
Deprecated.
Return true iff a does not contain duplicate elements.
|
static <T> boolean |
noDuplicates(java.util.List<T> a)
Deprecated.
Return true iff a does not contain duplicate elements.
|
static boolean |
noDuplicates(long[] a)
Deprecated.
Return true iff a does not contain duplicate elements.
|
static boolean |
noDuplicates(java.lang.Object[] a)
Deprecated.
Return true iff a does not contain duplicate elements.
|
static boolean |
noDuplicates(short[] a)
Deprecated.
Return true iff a does not contain duplicate elements.
|
static boolean |
noDuplicates(java.lang.String[] a)
Deprecated.
Return true iff a does not contain duplicate elements.
|
static int[] |
partial_fn_compose(int[] a,
int[] b)
Deprecated.
Return the composition of the given two (possibly partial) functions, all of which are
represented as arrays.
|
static <T> java.util.List<plume.ArraysMDE.Partitioning<T>> |
partitionInto(java.util.Collection<T> elts,
int k)
Deprecated.
Partition a set of non-null elements into exactly k subsets.
|
static <T> java.util.List<plume.ArraysMDE.Partitioning<T>> |
partitionInto(java.util.Queue<T> elts,
int k)
Deprecated.
Partition a set of elements into exactly k subsets.
|
static <T> java.util.List<plume.ArraysMDE.Partitioning<T>> |
partitionIntoHelper(java.util.Queue<T> elts,
java.util.List<plume.ArraysMDE.Partitioning<T>> resultSoFar,
int numEmptyParts,
int numNonemptyParts)
Deprecated.
Returns a set of partitionings, each of size numEmptyParts + numNonemptyParts.
|
static boolean |
sorted_descending(int[] a)
Deprecated.
Returns whether the array is sorted in desending order.
|
static boolean |
sorted_descending(long[] a)
Deprecated.
Returns whether the array is sorted in desending order.
|
static boolean |
sorted(int[] a)
Deprecated.
Returns whether the array is sorted.
|
static boolean |
sorted(long[] a)
Deprecated.
Returns whether the array is sorted.
|
static boolean[] |
subarray(boolean[] a,
int startindex,
int length)
Deprecated.
Return a subarray of the given array.
|
static byte[] |
subarray(byte[] a,
int startindex,
int length)
Deprecated.
Return a subarray of the given array.
|
static char[] |
subarray(char[] a,
int startindex,
int length)
Deprecated.
Return a subarray of the given array.
|
static double[] |
subarray(double[] a,
int startindex,
int length)
Deprecated.
Return a subarray of the given array.
|
static float[] |
subarray(float[] a,
int startindex,
int length)
Deprecated.
Return a subarray of the given array.
|
static int[] |
subarray(int[] a,
int startindex,
int length)
Deprecated.
Return a subarray of the given array.
|
static <T> java.util.List<T> |
subarray(java.util.List<T> a,
int startindex,
int length)
Deprecated.
Return a sublist of the given list.
|
static long[] |
subarray(long[] a,
int startindex,
int length)
Deprecated.
Return a subarray of the given array.
|
static java.lang.Object[] |
subarray(java.lang.Object[] a,
int startindex,
int length)
Deprecated.
Return a subarray of the given array.
|
static short[] |
subarray(short[] a,
int startindex,
int length)
Deprecated.
Return a subarray of the given array.
|
static java.lang.String[] |
subarray(java.lang.String[] a,
int startindex,
int length)
Deprecated.
Return a subarray of the given array.
|
static double |
sum(double[] a)
Deprecated.
Returns the sum of an array of doubles.
|
static double |
sum(double[][] a)
Deprecated.
Returns the sum of all the elements of a 2d array of doubles.
|
static int |
sum(int[] a)
Deprecated.
Returns the sum of an array of integers.
|
static int |
sum(int[][] a)
Deprecated.
Returns the sum of all the elements of a 2d array of integers.
|
static java.lang.String |
toString(boolean[] a)
Deprecated.
Return a string representation of the array.
|
static java.lang.String |
toString(java.util.Collection<?> a)
Deprecated.
Return a string representation of the collection.
|
static java.lang.String |
toString(java.util.Collection<?> a,
boolean quoted)
Deprecated.
Return a string representation of the collection.
|
static java.lang.String |
toString(double[] a)
Deprecated.
Return a string representation of the array.
|
static java.lang.String |
toString(float[] a)
Deprecated.
Return a string representation of the array.
|
static java.lang.String |
toString(int[] a)
Deprecated.
|
static java.lang.String |
toString(long[] a)
Deprecated.
Return a string representation of the array.
|
static java.lang.String |
toString(java.lang.Object obj)
Deprecated.
Casts obj down to the proper array type then calls the appropriate toString() method.
|
static java.lang.String |
toString(java.lang.Object[] a)
Deprecated.
Return a string representation of the array.
|
static java.lang.String |
toString(java.lang.Object[] a,
boolean quoted)
Deprecated.
Return a string representation of the array.
|
static java.lang.String |
toStringQuoted(java.util.Collection<?> a)
Deprecated.
Return a string representation of the collection.
|
static java.lang.String |
toStringQuoted(java.lang.Object[] a)
Deprecated.
Return a string representation of the array.
|
public static int min(int[] a)
a
- an arrayjava.lang.ArrayIndexOutOfBoundsException
- if the array has length 0public static long min(long[] a)
a
- an arrayjava.lang.ArrayIndexOutOfBoundsException
- if the array has length 0public static double min(double[] a)
a
- an arrayjava.lang.ArrayIndexOutOfBoundsException
- if the array has length 0public static java.lang.Integer min(java.lang.Integer[] a)
a
- an arrayjava.lang.ArrayIndexOutOfBoundsException
- if the array has length 0public static java.lang.Long min(java.lang.Long[] a)
a
- an arrayjava.lang.ArrayIndexOutOfBoundsException
- if the array has length 0public static java.lang.Double min(java.lang.Double[] a)
a
- an arrayjava.lang.ArrayIndexOutOfBoundsException
- if the array has length 0public static int max(int[] a)
a
- an arrayjava.lang.ArrayIndexOutOfBoundsException
- if the array has length 0public static long max(long[] a)
a
- an arrayjava.lang.ArrayIndexOutOfBoundsException
- if the array has length 0public static double max(double[] a)
a
- an arrayjava.lang.ArrayIndexOutOfBoundsException
- if the array has length 0public static java.lang.Integer max(java.lang.Integer[] a)
a
- an arrayjava.lang.ArrayIndexOutOfBoundsException
- if the array has length 0public static java.lang.Long max(java.lang.Long[] a)
a
- an arrayjava.lang.ArrayIndexOutOfBoundsException
- if the array has length 0public static java.lang.Double max(java.lang.Double[] a)
a
- an arrayjava.lang.ArrayIndexOutOfBoundsException
- if the array has length 0public static int[] min_max(int[] a)
a
- an arrayjava.lang.ArrayIndexOutOfBoundsException
- if the array has length 0public static long[] min_max(long[] a)
a
- an arrayjava.lang.ArrayIndexOutOfBoundsException
- if the array has length 0public static int element_range(int[] a)
a
- an arrayjava.lang.ArrayIndexOutOfBoundsException
- if the array has length 0public static long element_range(long[] a)
a
- an arrayjava.lang.ArrayIndexOutOfBoundsException
- if the array has length 0public static int sum(int[] a)
a
- an arraypublic static int sum(int[][] a)
a
- a 2d arraypublic static double sum(double[] a)
a
- an arraypublic static double sum(double[][] a)
a
- a 2d arraypublic static <T> int indexOf(T[] a, java.lang.Object elt)
T
- type of the elements of the arraya
- an arrayelt
- the element to search forList.indexOf(java.lang.Object)
public static <T> int indexOf(T[] a, java.lang.Object elt, int minindex, int indexlimit)
T
- the type of the elementsa
- an arrayelt
- the element to search forminindex
- first index at which to searchindexlimit
- first index at which not to searchminindex ≤ i <
indexlimit
, or -1 if the element is not found in that section of the arrayList.indexOf(java.lang.Object)
public static int indexOf(java.util.List<? extends java.lang.Object> a, java.lang.Object elt)
a
- a listelt
- the element to search forList.indexOf(java.lang.Object)
public static int indexOf(java.util.List<? extends java.lang.Object> a, java.lang.Object elt, int minindex, int indexlimit)
a
- a listelt
- the element to search forminindex
- first index at which to searchindexlimit
- first index at which not to searchminindex ≤ i <
indexlimit
, or -1 if the element is not found in that section of the listList.indexOf(java.lang.Object)
public static int indexOfEq(java.lang.Object[] a, java.lang.Object elt)
a
- an arrayelt
- the element to search forArrayList.indexOf(java.lang.Object)
public static int indexOfEq(java.lang.Object[] a, java.lang.Object elt, int minindex, int indexlimit)
a
- an arrayelt
- the element to search forminindex
- first index at which to searchindexlimit
- first index at which not to searchminindex ≤ i <
indexlimit
, or -1 if the element is not found in that section of the arrayArrayList.indexOf(java.lang.Object)
public static int indexOfEq(java.util.List<? extends java.lang.Object> a, java.lang.Object elt)
a
- a listelt
- the element to search forArrayList.indexOf(java.lang.Object)
public static int indexOfEq(java.util.List<? extends java.lang.Object> a, java.lang.Object elt, int minindex, int indexlimit)
a
- a listelt
- the element to search forminindex
- first index at which to searchindexlimit
- first index at which not to searchminindex ≤ i <
indexlimit
, or -1 if the element is not found in that section of the listArrayList.indexOf(java.lang.Object)
public static int indexOf(int[] a, int elt)
a
- an arrayelt
- the element to search forArrayList.indexOf(java.lang.Object)
public static int indexOf(long[] a, long elt)
a
- an arrayelt
- the element to search forArrayList.indexOf(java.lang.Object)
public static int indexOf(int[] a, int elt, int minindex, int indexlimit)
a
- an arrayelt
- the element to search forminindex
- first index at which to searchindexlimit
- first index at which not to searchminindex ≤ i <
indexlimit
, or -1 if the element is not found in the arrayArrayList.indexOf(java.lang.Object)
public static int indexOf(long[] a, long elt, int minindex, int indexlimit)
a
- an arrayelt
- the element to search forminindex
- first index at which to searchindexlimit
- first index at which not to searchminindex ≤ i <
indexlimit
, or -1 if the element is not found in the arrayArrayList.indexOf(java.lang.Object)
public static int indexOf(boolean[] a, boolean elt)
a
- an arrayelt
- the element to search forArrayList.indexOf(java.lang.Object)
public static int indexOf(double[] a, double elt)
a
- an arrayelt
- the element to search forArrayList.indexOf(java.lang.Object)
public static int indexOf(boolean[] a, boolean elt, int minindex, int indexlimit)
a
- an arrayelt
- the element to search forminindex
- first index at which to searchindexlimit
- first index at which not to searchminindex ≤ i <
indexlimit
, or -1 if the element is not found in the arrayArrayList.indexOf(java.lang.Object)
public static int indexOf(java.lang.Object[] a, java.lang.Object[] sub)
a
- an arraysub
- subsequence to search forArrayList.indexOf(java.lang.Object)
,
String.indexOf(java.lang.String)
public static int indexOfEq(java.lang.Object[] a, java.lang.Object[] sub)
a
- an arraysub
- subsequence to search forArrayList.indexOf(java.lang.Object)
,
String.indexOf(java.lang.String)
public static int indexOf(java.util.List<?> a, java.lang.Object[] sub)
a
- a listsub
- subsequence to search forArrayList.indexOf(java.lang.Object)
,
String.indexOf(java.lang.String)
public static int indexOfEq(java.util.List<?> a, java.lang.Object[] sub)
a
- a listsub
- subsequence to search forArrayList.indexOf(java.lang.Object)
,
String.indexOf(java.lang.String)
public static int indexOf(java.lang.Object[] a, java.util.List<?> sub)
a
- a listsub
- subsequence to search forArrayList.indexOf(java.lang.Object)
,
String.indexOf(java.lang.String)
public static int indexOfEq(java.lang.Object[] a, java.util.List<?> sub)
a
- a listsub
- subsequence to search forArrayList.indexOf(java.lang.Object)
,
String.indexOf(java.lang.String)
public static int indexOf(java.util.List<?> a, java.util.List<?> sub)
a
- a listsub
- subsequence to search forArrayList.indexOf(java.lang.Object)
,
String.indexOf(java.lang.String)
public static int indexOfEq(java.util.List<?> a, java.util.List<?> sub)
a
- a listsub
- subsequence to search forArrayList.indexOf(java.lang.Object)
,
String.indexOf(java.lang.String)
public static int indexOf(int[] a, int[] sub)
a
- an arraysub
- subsequence to search forArrayList.indexOf(java.lang.Object)
,
String.indexOf(java.lang.String)
public static int indexOf(double[] a, double[] sub)
a
- an arraysub
- subsequence to search forArrayList.indexOf(java.lang.Object)
,
String.indexOf(java.lang.String)
public static int indexOf(long[] a, long[] sub)
a
- an arraysub
- subsequence to search forArrayList.indexOf(java.lang.Object)
,
String.indexOf(java.lang.String)
public static int indexOf(boolean[] a, boolean[] sub)
a
- an arraysub
- subsequence to search forArrayList.indexOf(java.lang.Object)
,
String.indexOf(java.lang.String)
public static java.lang.Object[] subarray(java.lang.Object[] a, int startindex, int length)
a
- the original arraystartindex
- the first index to be includedlength
- the number of elements to include (not an end index, to avoid confusion over
whether it would be the last included index or the first non-included index)public static <T> java.util.List<T> subarray(java.util.List<T> a, int startindex, int length)
T
- type of the elementsa
- the original liststartindex
- the first index to be includedlength
- the number of elements to include (not an end index, to avoid confusion over
whether it would be the last included index or the first non-included index)public static java.lang.String[] subarray(java.lang.String[] a, int startindex, int length)
a
- the original arraystartindex
- the first index to be includedlength
- the number of elements to include (not an end index, to avoid confusion over
whether it would be the last included index or the first non-included index)public static byte[] subarray(byte[] a, int startindex, int length)
a
- the original arraystartindex
- the first index to be includedlength
- the number of elements to include (not an end index, to avoid confusion over
whether it would be the last included index or the first non-included index)public static boolean[] subarray(boolean[] a, int startindex, int length)
a
- the original arraystartindex
- the first index to be includedlength
- the number of elements to include (not an end index, to avoid confusion over
whether it would be the last included index or the first non-included index)public static char[] subarray(char[] a, int startindex, int length)
a
- the original arraystartindex
- the first index to be includedlength
- the number of elements to include (not an end index, to avoid confusion over
whether it would be the last included index or the first non-included index)public static double[] subarray(double[] a, int startindex, int length)
a
- the original arraystartindex
- the first index to be includedlength
- the number of elements to include (not an end index, to avoid confusion over
whether it would be the last included index or the first non-included index)public static float[] subarray(float[] a, int startindex, int length)
a
- the original arraystartindex
- the first index to be includedlength
- the number of elements to include (not an end index, to avoid confusion over
whether it would be the last included index or the first non-included index)public static int[] subarray(int[] a, int startindex, int length)
a
- the original arraystartindex
- the first index to be includedlength
- the number of elements to include (not an end index, to avoid confusion over
whether it would be the last included index or the first non-included index)public static long[] subarray(long[] a, int startindex, int length)
a
- the original arraystartindex
- the first index to be includedlength
- the number of elements to include (not an end index, to avoid confusion over
whether it would be the last included index or the first non-included index)public static short[] subarray(short[] a, int startindex, int length)
a
- the original arraystartindex
- the first index to be includedlength
- the number of elements to include (not an end index, to avoid confusion over
whether it would be the last included index or the first non-included index)public static boolean isSubarray(java.lang.Object[] a, java.lang.Object[] sub, int a_offset)
a
- an arraysub
- subsequence to search fora_offset
- first index at which to search. Must be non-negative. The routine works and
returns false even if a_affset
is too large to be a valid index for a
.public static boolean isSubarrayEq(java.lang.Object[] a, java.lang.Object[] sub, int a_offset)
a
- an arraysub
- subsequence to search fora_offset
- first index at which to search. Must be non-negative. The routine works and
returns false even if a_affset
is too large to be a valid index for a
.public static boolean isSubarray(java.lang.Object[] a, java.util.List<?> sub, int a_offset)
a
- an arraysub
- subsequence to search fora_offset
- first index at which to search. Must be non-negative. The routine works and
returns false even if a_affset
is too large to be a valid index for a
.public static boolean isSubarrayEq(java.lang.Object[] a, java.util.List<?> sub, int a_offset)
a
- an arraysub
- subsequence to search fora_offset
- first index at which to search. Must be non-negative. The routine works and
returns false even if a_affset
is too large to be a valid index for a
.public static boolean isSubarray(java.util.List<?> a, java.lang.Object[] sub, int a_offset)
a
- a listsub
- subsequence to search fora_offset
- first index at which to search. Must be non-negative. The routine works and
returns false even if a_affset
is too large to be a valid index for a
.public static boolean isSubarrayEq(java.util.List<?> a, java.lang.Object[] sub, int a_offset)
a
- a listsub
- subsequence to search fora_offset
- first index at which to search. Must be non-negative. The routine works and
returns false even if a_affset
is too large to be a valid index for a
.public static boolean isSubarray(java.util.List<?> a, java.util.List<?> sub, int a_offset)
a
- a listsub
- subsequence to search fora_offset
- first index at which to search. Must be non-negative. The routine works and
returns false even if a_affset
is too large to be a valid index for a
.public static boolean isSubarrayEq(java.util.List<?> a, java.util.List<?> sub, int a_offset)
a
- a listsub
- subsequence to search fora_offset
- first index at which to search. Must be non-negative. The routine works and
returns false even if a_affset
is too large to be a valid index for a
.public static boolean isSubarray(int[] a, int[] sub, int a_offset)
a
- an arraysub
- subsequence to search fora_offset
- first index at which to search. Must be non-negative. The routine works and
returns false even if a_affset
is too large to be a valid index for a
.public static boolean isSubarray(long[] a, long[] sub, int a_offset)
a
- an arraysub
- subsequence to search fora_offset
- first index at which to search. Must be non-negative. The routine works and
returns false even if a_affset
is too large to be a valid index for a
.public static boolean isSubarray(double[] a, double[] sub, int a_offset)
a
- an arraysub
- subsequence to search fora_offset
- first index at which to search. Must be non-negative. The routine works and
returns false even if a_affset
is too large to be a valid index for a
.public static boolean isSubarray(boolean[] a, boolean[] sub, int a_offset)
a
- an arraysub
- subsequence to search fora_offset
- first index at which to search. Must be non-negative. The routine works and
returns false even if a_affset
is too large to be a valid index for a
.public static <T> T[] concat(T[] a, T[] b)
T
- the type of the sequence elementsa
- the first sequence to concatenateb
- the second sequence to concatenatepublic static <T> T[] concat(T[] a, java.util.List<T> b)
T
- the type of the sequence elementsa
- the first sequence to concatenateb
- the second sequence to concatenatepublic static <T> T[] concat(java.util.List<T> a, T[] b)
T
- the type of the sequence elementsa
- the first sequence to concatenateb
- the second sequence to concatenatepublic static <T> T[] concat(java.util.List<T> a, java.util.List<T> b)
T
- the type of the sequence elementsa
- the first sequence to concatenateb
- the second sequence to concatenatepublic static java.lang.String[] concat(java.lang.String[] a, java.lang.String[] b)
a
- the first array to concatenateb
- the second array to concatenatepublic static byte[] concat(byte[] a, byte[] b)
a
- the first sequence to concatenateb
- the second sequence to concatenatepublic static boolean[] concat(boolean[] a, boolean[] b)
a
- the first sequence to concatenateb
- the second sequence to concatenatepublic static char[] concat(char[] a, char[] b)
a
- the first sequence to concatenateb
- the second sequence to concatenatepublic static double[] concat(double[] a, double[] b)
a
- the first sequence to concatenateb
- the second sequence to concatenatepublic static float[] concat(float[] a, float[] b)
a
- the first sequence to concatenateb
- the second sequence to concatenatepublic static int[] concat(int[] a, int[] b)
a
- the first sequence to concatenateb
- the second sequence to concatenatepublic static long[] concat(long[] a, long[] b)
a
- the first sequence to concatenateb
- the second sequence to concatenatepublic static short[] concat(short[] a, short[] b)
a
- the first sequence to concatenateb
- the second sequence to concatenatepublic static java.lang.String toString(java.lang.Object[] a)
a
- an arrayAbstractCollection.toString()
public static java.lang.String toStringQuoted(java.lang.Object[] a)
a
- an arrayAbstractCollection.toString()
public static java.lang.String toString(java.lang.Object[] a, boolean quoted)
a
- an arrayquoted
- whether to quote the array elementsAbstractCollection.toString()
public static java.lang.String toString(java.util.Collection<?> a)
a
- a collectionAbstractCollection.toString()
public static java.lang.String toStringQuoted(java.util.Collection<?> a)
a
- a collectionAbstractCollection.toString()
public static java.lang.String toString(java.util.Collection<?> a, boolean quoted)
a
- a collectionquoted
- whether to quote the collection elements that are Java stringsAbstractCollection.toString()
@Deprecated public static java.lang.String toString(int[] a)
a
- an arrayAbstractCollection.toString()
public static java.lang.String toString(long[] a)
a
- an arrayAbstractCollection.toString()
public static java.lang.String toString(double[] a)
a
- an arrayAbstractCollection.toString()
public static java.lang.String toString(float[] a)
a
- an arrayAbstractCollection.toString()
public static java.lang.String toString(boolean[] a)
a
- an arrayAbstractCollection.toString()
public static java.lang.String toString(java.lang.Object obj) throws java.lang.IllegalArgumentException
obj
- an arrayjava.lang.IllegalArgumentException
- if obj is null or is not one of the types mentioned abovepublic static int length(java.lang.Object obj) throws java.lang.IllegalArgumentException
obj
- a listjava.lang.IllegalArgumentException
- if obj is null or is not one of the types mentioned abovepublic static boolean sorted(int[] a)
a
- an arraypublic static boolean sorted(long[] a)
a
- an arraypublic static boolean sorted_descending(int[] a)
a
- an arraypublic static boolean sorted_descending(long[] a)
a
- an arraypublic static boolean noDuplicates(boolean[] a)
The implementation uses O(n) time and O(n) space.
a
- an arraypublic static boolean noDuplicates(byte[] a)
The implementation uses O(n) time and O(n) space.
a
- an arraypublic static boolean noDuplicates(char[] a)
The implementation uses O(n) time and O(n) space.
a
- an arraypublic static boolean noDuplicates(float[] a)
The implementation uses O(n) time and O(n) space.
a
- an arraypublic static boolean noDuplicates(short[] a)
The implementation uses O(n) time and O(n) space.
a
- an arraypublic static boolean noDuplicates(int[] a)
The implementation uses O(n) time and O(n) space.
a
- an arraypublic static boolean noDuplicates(double[] a)
Double.equals(java.lang.Object)
.
The implementation uses O(n) time and O(n) space.
a
- an arraypublic static boolean noDuplicates(long[] a)
The implementation uses O(n) time and O(n) space.
a
- an arraypublic static boolean noDuplicates(java.lang.String[] a)
The implementation uses O(n) time and O(n) space.
a
- an arraypublic static boolean noDuplicates(java.lang.Object[] a)
The implementation uses O(n) time and O(n) space.
a
- an arraypublic static <T> boolean noDuplicates(java.util.List<T> a)
The implementation uses O(n) time and O(n) space.
T
- the type of the elementsa
- a listpublic static boolean fn_is_permutation(int[] a)
a
- an array, representing a functionpublic static boolean fn_is_total(int[] a)
a
- an array, representing a functionpublic static int[] fn_identity(int length)
length
- the length of the resultpublic static int[] fn_inverse_permutation(int[] a)
a
- the input permutationfn_is_permutation(int[])
public static int[] fn_inverse(int[] a, int arange)
a
- an array representing a function from [0..a.length) to [0..arange); each element of a
is between 0 (inclusive) and arange (exclusive)arange
- length of the argument's range and the result's domainjava.lang.IllegalArgumentException
- if a value of a is outside of arangejava.lang.UnsupportedOperationException
- when the function is not invertiblepublic static int[] fn_compose(int[] a, int[] b)
a
- function from [0..a.length) to [0..b.length)b
- function from [0..b.length) to range Rpublic static int[] partial_fn_compose(int[] a, int[] b)
a
- function from [0..a.length) to [-1..b.length)b
- function from [0..b.length) to range Rpublic static boolean isSubset(long[] smaller, long[] bigger)
The implementation is to use collections because we want to take advantage of HashSet's constant time membership tests.
smaller
- first set to testbigger
- second set to testpublic static boolean isSubset(double[] smaller, double[] bigger)
The implementation is to use collections because we want to take advantage of HashSet's constant time membership tests.
smaller
- first set to testbigger
- second set to testpublic static boolean isSubset(java.lang.String[] smaller, java.lang.String[] bigger)
The implementation is to use collections because we want to take advantage of HashSet's constant time membership tests.
smaller
- first set to testbigger
- second set to testpublic static boolean any_null(java.lang.Object[] a)
a
- an arraypublic static boolean all_null(java.lang.Object[] a)
a
- an arraypublic static boolean any_null(java.util.List<?> a)
a
- an arraypublic static boolean all_null(java.util.List<?> a)
a
- an arraypublic static <T> java.util.List<plume.ArraysMDE.Partitioning<T>> partitionInto(java.util.Collection<T> elts, int k)
List<List<T>>
, where the union of the inner lists is elts
. This method returns a list
of such partitionings.T
- type of items to be partitionedelts
- items to be partitionedk
- number of subsets into which to partition elts
public static <T> java.util.List<plume.ArraysMDE.Partitioning<T>> partitionInto(java.util.Queue<T> elts, int k)
List<List<T>>
, where the union of the inner lists is elts
. This method returns a list
of such partitionings.T
- type of items to be partitionedelts
- items to be partitionedk
- number of subsets into which to partition elts
public static <T> java.util.List<plume.ArraysMDE.Partitioning<T>> partitionIntoHelper(java.util.Queue<T> elts, java.util.List<plume.ArraysMDE.Partitioning<T>> resultSoFar, int numEmptyParts, int numNonemptyParts)
partitionInto(java.util.Collection<T>, int)
.T
- type of items to be partitionedelts
- the elements that remain to be added to the partitioningsresultSoFar
- a list of partitionings, each of which has numNonemptyParts partsnumEmptyParts
- the number of partitions in the partitioning that are empty so farnumNonemptyParts
- the number of partitions in the partitioning that have at least one
member so far