edu.rit.util
Class Arrays
- java.lang.Object
-
- edu.rit.util.Arrays
-
public class Arrays extends java.lang.ObjectClass Arrays provides static methods for various operations on arrays and matrices of primitive types and object types.Note: The operations in class Arrays are not multiple thread safe.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static voidallocate(boolean[][] matrix, int ncols)Allocate the elements in the given Boolean matrix.static voidallocate(boolean[][] matrix, Range rowRange, int ncols)Allocate the elements within the given row index range in the given Boolean matrix.static voidallocate(byte[][] matrix, int ncols)Allocate the elements in the given byte matrix.static voidallocate(byte[][] matrix, Range rowRange, int ncols)Allocate the elements within the given row index range in the given byte matrix.static voidallocate(char[][] matrix, int ncols)Allocate the elements in the given character matrix.static voidallocate(char[][] matrix, Range rowRange, int ncols)Allocate the elements within the given row index range in the given character matrix.static voidallocate(double[][] matrix, int ncols)Allocate the elements in the given double matrix.static voidallocate(double[][] matrix, Range rowRange, int ncols)Allocate the elements within the given row index range in the given double matrix.static voidallocate(float[][] matrix, int ncols)Allocate the elements in the given float matrix.static voidallocate(float[][] matrix, Range rowRange, int ncols)Allocate the elements within the given row index range in the given float matrix.static voidallocate(int[][] matrix, int ncols)Allocate the elements in the given integer matrix.static voidallocate(int[][] matrix, Range rowRange, int ncols)Allocate the elements within the given row index range in the given integer matrix.static voidallocate(long[][] matrix, int ncols)Allocate the elements in the given long matrix.static voidallocate(long[][] matrix, Range rowRange, int ncols)Allocate the elements within the given row index range in the given long matrix.static voidallocate(short[][] matrix, int ncols)Allocate the elements in the given short matrix.static voidallocate(short[][] matrix, Range rowRange, int ncols)Allocate the elements within the given row index range in the given short matrix.static <T,ST extends T>
voidallocate(T[][] matrix, int ncols, java.lang.Class<ST> type)Allocate the elements in the given object matrix.static <T,ST extends T>
voidallocate(T[][] matrix, Range rowRange, int ncols, java.lang.Class<ST> type)Allocate the elements within the given row index range in the given object matrix.static <T,ST extends T>
voidallocate(T[][] matrix, Range rowRange, int ncols, Range colRange, java.lang.Class<ST> type)Allocate the elements within the given row and column index ranges in the given object matrix.static <T,ST extends T>
voidallocate(T[] array, java.lang.Class<ST> type)Allocate all elements in the given object array.static <T,ST extends T>
voidallocate(T[] array, Range range, java.lang.Class<ST> type)Allocate the elements within the given index range in the given object array.static intcolLength(boolean[][] matrix, int i)Determine the number of columns in the given row of the given Boolean matrix.static intcolLength(byte[][] matrix, int i)Determine the number of columns in the given row of the given byte matrix.static intcolLength(char[][] matrix, int i)Determine the number of columns in the given row of the given character matrix.static intcolLength(double[][] matrix, int i)Determine the number of columns in the given row of the given double matrix.static intcolLength(float[][] matrix, int i)Determine the number of columns in the given row of the given float matrix.static intcolLength(int[][] matrix, int i)Determine the number of columns in the given row of the given integer matrix.static intcolLength(long[][] matrix, int i)Determine the number of columns in the given row of the given long matrix.static intcolLength(short[][] matrix, int i)Determine the number of columns in the given row of the given short matrix.static <T> intcolLength(T[][] matrix, int i)Determine the number of columns in the given row of the given object matrix.static voidcopy(boolean[][] src, Range srcRowRange, Range srcColRange, boolean[][] dst, Range dstRowRange, Range dstColRange)Copy a range of elements from one Boolean matrix to a range of elements in another Boolean matrix.static voidcopy(boolean[] src, Range srcRange, boolean[] dst, Range dstRange)Copy a range of elements from one Boolean array to a range of elements in another Boolean array.static voidcopy(byte[][] src, Range srcRowRange, Range srcColRange, byte[][] dst, Range dstRowRange, Range dstColRange)Copy a range of elements from one byte matrix to a range of elements in another byte matrix.static voidcopy(byte[] src, Range srcRange, byte[] dst, Range dstRange)Copy a range of elements from one byte array to a range of elements in another byte array.static voidcopy(char[][] src, Range srcRowRange, Range srcColRange, char[][] dst, Range dstRowRange, Range dstColRange)Copy a range of elements from one character matrix to a range of elements in another character matrix.static voidcopy(char[] src, Range srcRange, char[] dst, Range dstRange)Copy a range of elements from one character array to a range of elements in another character array.static voidcopy(double[][] src, Range srcRowRange, Range srcColRange, double[][] dst, Range dstRowRange, Range dstColRange)Copy a range of elements from one double matrix to a range of elements in another double matrix.static voidcopy(double[] src, Range srcRange, double[] dst, Range dstRange)Copy a range of elements from one double array to a range of elements in another double array.static voidcopy(float[][] src, Range srcRowRange, Range srcColRange, float[][] dst, Range dstRowRange, Range dstColRange)Copy a range of elements from one float matrix to a range of elements in another float matrix.static voidcopy(float[] src, Range srcRange, float[] dst, Range dstRange)Copy a range of elements from one float array to a range of elements in another float array.static voidcopy(int[][] src, Range srcRowRange, Range srcColRange, int[][] dst, Range dstRowRange, Range dstColRange)Copy a range of elements from one integer matrix to a range of elements in another integer matrix.static voidcopy(int[] src, Range srcRange, int[] dst, Range dstRange)Copy a range of elements from one integer array to a range of elements in another integer array.static voidcopy(long[][] src, Range srcRowRange, Range srcColRange, long[][] dst, Range dstRowRange, Range dstColRange)Copy a range of elements from one long matrix to a range of elements in another long matrix.static voidcopy(long[] src, Range srcRange, long[] dst, Range dstRange)Copy a range of elements from one long array to a range of elements in another long array.static voidcopy(short[][] src, Range srcRowRange, Range srcColRange, short[][] dst, Range dstRowRange, Range dstColRange)Copy a range of elements from one short matrix to a range of elements in another short matrix.static voidcopy(short[] src, Range srcRange, short[] dst, Range dstRange)Copy a range of elements from one short array to a range of elements in another short array.static <DT,ST extends DT>
voidcopy(ST[][] src, Range srcRowRange, Range srcColRange, DT[][] dst, Range dstRowRange, Range dstColRange)Copy a range of elements from one object matrix to a range of elements in another object matrix.static <DT,ST extends DT>
voidcopy(ST[] src, Range srcRange, DT[] dst, Range dstRange)Copy a range of elements from one object array to a range of elements in another object array.static voiddeallocate(boolean[][] matrix)Deallocate the elements in the given Boolean matrix.static voiddeallocate(boolean[][] matrix, Range rowRange)Deallocate the elements within the given row index range in the given Boolean matrix.static voiddeallocate(byte[][] matrix)Deallocate the elements in the given byte matrix.static voiddeallocate(byte[][] matrix, Range rowRange)Deallocate the elements within the given row index range in the given byte matrix.static voiddeallocate(char[][] matrix)Deallocate the elements in the given character matrix.static voiddeallocate(char[][] matrix, Range rowRange)Deallocate the elements within the given row index range in the given character matrix.static voiddeallocate(double[][] matrix)Deallocate the elements in the given double matrix.static voiddeallocate(double[][] matrix, Range rowRange)Deallocate the elements within the given row index range in the given double matrix.static voiddeallocate(float[][] matrix)Deallocate the elements in the given float matrix.static voiddeallocate(float[][] matrix, Range rowRange)Deallocate the elements within the given row index range in the given float matrix.static voiddeallocate(int[][] matrix)Deallocate the elements in the given integer matrix.static voiddeallocate(int[][] matrix, Range rowRange)Deallocate the elements within the given row index range in the given integer matrix.static voiddeallocate(long[][] matrix)Deallocate the elements in the given long matrix.static voiddeallocate(long[][] matrix, Range rowRange)Deallocate the elements within the given row index range in the given long matrix.static voiddeallocate(short[][] matrix)Deallocate the elements in the given short matrix.static voiddeallocate(short[][] matrix, Range rowRange)Deallocate the elements within the given row index range in the given short matrix.static <T> voiddeallocate(T[] array)Deallocate all elements in the given object array.static <T> voiddeallocate(T[][] matrix)Deallocate the elements in the given object matrix.static <T> voiddeallocate(T[][] matrix, Range rowRange)Deallocate the elements within the given row index range in the given object matrix.static <T> voiddeallocate(T[][] matrix, Range rowRange, Range colRange)Deallocate the elements within the given row and column index ranges in the given object matrix.static <T> voiddeallocate(T[] array, Range range)Deallocate the elements within the given index range in the given object array.static intlength(boolean[] array)Determine the number of elements in the given Boolean array.static intlength(byte[] array)Determine the number of elements in the given byte array.static intlength(char[] array)Determine the number of elements in the given character array.static intlength(double[] array)Determine the number of elements in the given double array.static intlength(float[] array)Determine the number of elements in the given float array.static intlength(int[] array)Determine the number of elements in the given integer array.static intlength(long[] array)Determine the number of elements in the given long array.static intlength(short[] array)Determine the number of elements in the given short array.static <T> intlength(T[] array)Determine the number of elements in the given object array.static introwLength(boolean[][] matrix)Determine the number of rows in the given Boolean matrix.static introwLength(byte[][] matrix)Determine the number of rows in the given byte matrix.static introwLength(char[][] matrix)Determine the number of rows in the given character matrix.static introwLength(double[][] matrix)Determine the number of rows in the given double matrix.static introwLength(float[][] matrix)Determine the number of rows in the given float matrix.static introwLength(int[][] matrix)Determine the number of rows in the given integer matrix.static introwLength(long[][] matrix)Determine the number of rows in the given long matrix.static introwLength(short[][] matrix)Determine the number of rows in the given short matrix.static <T> introwLength(T[][] matrix)Determine the number of rows in the given object matrix.
-
-
-
Method Detail
-
allocate
public static <T,ST extends T> void allocate(T[] array, java.lang.Class<ST> type) throws java.lang.InstantiationException, java.lang.IllegalAccessExceptionAllocate all elements in the given object array. Each array element (object) is created using the given class's no-argument constructor.- Type Parameters:
T- Array element data type.ST- Data type of the objects to be created.- Parameters:
array- Array.type- Class for the objects to be created.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if any argument is null.java.lang.InstantiationException- Thrown if an instance of the given class cannot be instantiated.java.lang.IllegalAccessException- Thrown if the given class or its no-argument constructor is not accessible.
-
allocate
public static <T,ST extends T> void allocate(T[] array, Range range, java.lang.Class<ST> type) throws java.lang.InstantiationException, java.lang.IllegalAccessExceptionAllocate the elements within the given index range in the given object array. Each array element (object) is created using the given class's no-argument constructor.- Type Parameters:
T- Array element data type.ST- Data type of the objects to be created.- Parameters:
array- Array.range- Range of indexes to allocate.type- Class for the objects to be created.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if any argument is null.java.lang.IndexOutOfBoundsException- (unchecked exception) Thrown if any index in the range is outside the bounds of the array.java.lang.InstantiationException- Thrown if an instance of the given class cannot be instantiated.java.lang.IllegalAccessException- Thrown if the given class or its no-argument constructor is not accessible.
-
allocate
public static void allocate(boolean[][] matrix, int ncols)Allocate the elements in the given Boolean matrix. Each matrix row in the full row index range (0..matrix.length-1) is allocated with the given number of columns.- Parameters:
matrix- Matrix.ncols- Number of columns in each row.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if any argument is null.java.lang.NegativeArraySizeException- (unchecked exception) Thrown if ncols < 0.
-
allocate
public static void allocate(boolean[][] matrix, Range rowRange, int ncols)Allocate the elements within the given row index range in the given Boolean matrix. Each matrix row in the given row index range is allocated with the given number of columns.- Parameters:
matrix- Matrix.rowRange- Range of row indexes to allocate.ncols- Number of columns in each row.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if any argument is null.java.lang.IndexOutOfBoundsException- (unchecked exception) Thrown if any index in the rowRange is outside the row bounds of the matrix.java.lang.NegativeArraySizeException- (unchecked exception) Thrown if ncols < 0.
-
allocate
public static void allocate(byte[][] matrix, int ncols)Allocate the elements in the given byte matrix. Each matrix row in the full row index range (0..matrix.length-1) is allocated with the given number of columns.- Parameters:
matrix- Matrix.ncols- Number of columns in each row.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if any argument is null.java.lang.NegativeArraySizeException- (unchecked exception) Thrown if ncols < 0.
-
allocate
public static void allocate(byte[][] matrix, Range rowRange, int ncols)Allocate the elements within the given row index range in the given byte matrix. Each matrix row in the given row index range is allocated with the given number of columns.- Parameters:
matrix- Matrix.rowRange- Range of row indexes to allocate.ncols- Number of columns in each row.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if any argument is null.java.lang.IndexOutOfBoundsException- (unchecked exception) Thrown if any index in the rowRange is outside the row bounds of the matrix.java.lang.NegativeArraySizeException- (unchecked exception) Thrown if ncols < 0.
-
allocate
public static void allocate(char[][] matrix, int ncols)Allocate the elements in the given character matrix. Each matrix row in the full row index range (0..matrix.length-1) is allocated with the given number of columns.- Parameters:
matrix- Matrix.ncols- Number of columns in each row.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if any argument is null.java.lang.NegativeArraySizeException- (unchecked exception) Thrown if ncols < 0.
-
allocate
public static void allocate(char[][] matrix, Range rowRange, int ncols)Allocate the elements within the given row index range in the given character matrix. Each matrix row in the given row index range is allocated with the given number of columns.- Parameters:
matrix- Matrix.rowRange- Range of row indexes to allocate.ncols- Number of columns in each row.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if any argument is null.java.lang.IndexOutOfBoundsException- (unchecked exception) Thrown if any index in the rowRange is outside the row bounds of the matrix.java.lang.NegativeArraySizeException- (unchecked exception) Thrown if ncols < 0.
-
allocate
public static void allocate(double[][] matrix, int ncols)Allocate the elements in the given double matrix. Each matrix row in the full row index range (0..matrix.length-1) is allocated with the given number of columns.- Parameters:
matrix- Matrix.ncols- Number of columns in each row.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if any argument is null.java.lang.NegativeArraySizeException- (unchecked exception) Thrown if ncols < 0.
-
allocate
public static void allocate(double[][] matrix, Range rowRange, int ncols)Allocate the elements within the given row index range in the given double matrix. Each matrix row in the given row index range is allocated with the given number of columns.- Parameters:
matrix- Matrix.rowRange- Range of row indexes to allocate.ncols- Number of columns in each row.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if any argument is null.java.lang.IndexOutOfBoundsException- (unchecked exception) Thrown if any index in the rowRange is outside the row bounds of the matrix.java.lang.NegativeArraySizeException- (unchecked exception) Thrown if ncols < 0.
-
allocate
public static void allocate(float[][] matrix, int ncols)Allocate the elements in the given float matrix. Each matrix row in the full row index range (0..matrix.length-1) is allocated with the given number of columns.- Parameters:
matrix- Matrix.ncols- Number of columns in each row.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if any argument is null.java.lang.NegativeArraySizeException- (unchecked exception) Thrown if ncols < 0.
-
allocate
public static void allocate(float[][] matrix, Range rowRange, int ncols)Allocate the elements within the given row index range in the given float matrix. Each matrix row in the given row index range is allocated with the given number of columns.- Parameters:
matrix- Matrix.rowRange- Range of row indexes to allocate.ncols- Number of columns in each row.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if any argument is null.java.lang.IndexOutOfBoundsException- (unchecked exception) Thrown if any index in the rowRange is outside the row bounds of the matrix.java.lang.NegativeArraySizeException- (unchecked exception) Thrown if ncols < 0.
-
allocate
public static void allocate(int[][] matrix, int ncols)Allocate the elements in the given integer matrix. Each matrix row in the full row index range (0..matrix.length-1) is allocated with the given number of columns.- Parameters:
matrix- Matrix.ncols- Number of columns in each row.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if any argument is null.java.lang.NegativeArraySizeException- (unchecked exception) Thrown if ncols < 0.
-
allocate
public static void allocate(int[][] matrix, Range rowRange, int ncols)Allocate the elements within the given row index range in the given integer matrix. Each matrix row in the given row index range is allocated with the given number of columns.- Parameters:
matrix- Matrix.rowRange- Range of row indexes to allocate.ncols- Number of columns in each row.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if any argument is null.java.lang.IndexOutOfBoundsException- (unchecked exception) Thrown if any index in the rowRange is outside the row bounds of the matrix.java.lang.NegativeArraySizeException- (unchecked exception) Thrown if ncols < 0.
-
allocate
public static void allocate(long[][] matrix, int ncols)Allocate the elements in the given long matrix. Each matrix row in the full row index range (0..matrix.length-1) is allocated with the given number of columns.- Parameters:
matrix- Matrix.ncols- Number of columns in each row.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if any argument is null.java.lang.NegativeArraySizeException- (unchecked exception) Thrown if ncols < 0.
-
allocate
public static void allocate(long[][] matrix, Range rowRange, int ncols)Allocate the elements within the given row index range in the given long matrix. Each matrix row in the given row index range is allocated with the given number of columns.- Parameters:
matrix- Matrix.rowRange- Range of row indexes to allocate.ncols- Number of columns in each row.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if any argument is null.java.lang.IndexOutOfBoundsException- (unchecked exception) Thrown if any index in the rowRange is outside the row bounds of the matrix.java.lang.NegativeArraySizeException- (unchecked exception) Thrown if ncols < 0.
-
allocate
public static void allocate(short[][] matrix, int ncols)Allocate the elements in the given short matrix. Each matrix row in the full row index range (0..matrix.length-1) is allocated with the given number of columns.- Parameters:
matrix- Matrix.ncols- Number of columns in each row.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if any argument is null.java.lang.NegativeArraySizeException- (unchecked exception) Thrown if ncols < 0.
-
allocate
public static void allocate(short[][] matrix, Range rowRange, int ncols)Allocate the elements within the given row index range in the given short matrix. Each matrix row in the given row index range is allocated with the given number of columns.- Parameters:
matrix- Matrix.rowRange- Range of row indexes to allocate.ncols- Number of columns in each row.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if any argument is null.java.lang.IndexOutOfBoundsException- (unchecked exception) Thrown if any index in the rowRange is outside the row bounds of the matrix.java.lang.NegativeArraySizeException- (unchecked exception) Thrown if ncols < 0.
-
allocate
public static <T,ST extends T> void allocate(T[][] matrix, int ncols, java.lang.Class<ST> type) throws java.lang.InstantiationException, java.lang.IllegalAccessExceptionAllocate the elements in the given object matrix. Each matrix row in the full row range (0..matrix.length-1) is allocated with the given number of columns. Within each row, the full column range (0..ncols-1) of elements is allocated. Each matrix element (object) is created using the given class's no-argument constructor.- Type Parameters:
T- Matrix element data type.ST- Data type of the objects to be created.- Parameters:
matrix- Matrix.ncols- Number of columns in each row.type- Class for the objects to be created.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if any argument is null.java.lang.NegativeArraySizeException- (unchecked exception) Thrown if ncols < 0.java.lang.InstantiationException- Thrown if an instance of the given class cannot be instantiated.java.lang.IllegalAccessException- Thrown if the given class or its no-argument constructor is not accessible.
-
allocate
public static <T,ST extends T> void allocate(T[][] matrix, Range rowRange, int ncols, java.lang.Class<ST> type) throws java.lang.InstantiationException, java.lang.IllegalAccessExceptionAllocate the elements within the given row index range in the given object matrix. Each matrix row in the given row index range is allocated with the given number of columns. Within each row, the full column range (0..ncols-1) of elements is allocated. Each matrix element (object) is created using the given class's no-argument constructor.- Type Parameters:
T- Matrix element data type.ST- Data type of the objects to be created.- Parameters:
matrix- Matrix.rowRange- Range of row indexes to allocate.ncols- Number of columns in each row.type- Class for the objects to be created.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if any argument is null.java.lang.IndexOutOfBoundsException- (unchecked exception) Thrown if any index in the rowRange is outside the row bounds of the matrix.java.lang.NegativeArraySizeException- (unchecked exception) Thrown if ncols < 0.java.lang.InstantiationException- Thrown if an instance of the given class cannot be instantiated.java.lang.IllegalAccessException- Thrown if the given class or its no-argument constructor is not accessible.
-
allocate
public static <T,ST extends T> void allocate(T[][] matrix, Range rowRange, int ncols, Range colRange, java.lang.Class<ST> type) throws java.lang.InstantiationException, java.lang.IllegalAccessExceptionAllocate the elements within the given row and column index ranges in the given object matrix. Each matrix row is allocated with the given number of columns. Each matrix element (object) is created using the given class's no-argument constructor.- Type Parameters:
T- Matrix element data type.ST- Data type of the objects to be created.- Parameters:
matrix- Matrix.rowRange- Range of row indexes to allocate.ncols- Number of columns in each row.colRange- Range of column indexes to allocate.type- Class for the objects to be created.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if any argument is null.java.lang.IndexOutOfBoundsException- (unchecked exception) Thrown if any index in the rowRange is outside the row bounds of the matrix. Thrown if any index in the colRange is outside the bounds 0 .. ncols-1.java.lang.NegativeArraySizeException- (unchecked exception) Thrown if ncols < 0.java.lang.InstantiationException- Thrown if an instance of the given class cannot be instantiated.java.lang.IllegalAccessException- Thrown if the given class or its no-argument constructor is not accessible.
-
deallocate
public static <T> void deallocate(T[] array)
Deallocate all elements in the given object array. Each array element is set to null.- Type Parameters:
T- Array element data type.- Parameters:
array- Array.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if any argument is null.
-
deallocate
public static <T> void deallocate(T[] array, Range range)Deallocate the elements within the given index range in the given object array. Each array element is set to null.- Type Parameters:
T- Array element data type.- Parameters:
array- Array.range- Range of indexes to deallocate.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if any argument is null.java.lang.IndexOutOfBoundsException- (unchecked exception) Thrown if any index in the range is outside the bounds of the array.
-
deallocate
public static void deallocate(boolean[][] matrix)
Deallocate the elements in the given Boolean matrix. Each matrix row in the full row index range (0..matrix.length-1) is set to null.- Parameters:
matrix- Matrix.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if any argument is null.
-
deallocate
public static void deallocate(boolean[][] matrix, Range rowRange)Deallocate the elements within the given row index range in the given Boolean matrix. Each matrix row in the given row index range is set to null.- Parameters:
matrix- Matrix.rowRange- Range of row indexes to deallocate.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if any argument is null.java.lang.IndexOutOfBoundsException- (unchecked exception) Thrown if any index in the rowRange is outside the row bounds of the matrix.
-
deallocate
public static void deallocate(byte[][] matrix)
Deallocate the elements in the given byte matrix. Each matrix row in the full row index range (0..matrix.length-1) is set to null.- Parameters:
matrix- Matrix.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if any argument is null.
-
deallocate
public static void deallocate(byte[][] matrix, Range rowRange)Deallocate the elements within the given row index range in the given byte matrix. Each matrix row in the given row index range is set to null.- Parameters:
matrix- Matrix.rowRange- Range of row indexes to deallocate.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if any argument is null.java.lang.IndexOutOfBoundsException- (unchecked exception) Thrown if any index in the rowRange is outside the row bounds of the matrix.
-
deallocate
public static void deallocate(char[][] matrix)
Deallocate the elements in the given character matrix. Each matrix row in the full row index range (0..matrix.length-1) is set to null.- Parameters:
matrix- Matrix.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if any argument is null.
-
deallocate
public static void deallocate(char[][] matrix, Range rowRange)Deallocate the elements within the given row index range in the given character matrix. Each matrix row in the given row index range is set to null.- Parameters:
matrix- Matrix.rowRange- Range of row indexes to deallocate.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if any argument is null.java.lang.IndexOutOfBoundsException- (unchecked exception) Thrown if any index in the rowRange is outside the row bounds of the matrix.
-
deallocate
public static void deallocate(double[][] matrix)
Deallocate the elements in the given double matrix. Each matrix row in the full row index range (0..matrix.length-1) is set to null.- Parameters:
matrix- Matrix.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if any argument is null.
-
deallocate
public static void deallocate(double[][] matrix, Range rowRange)Deallocate the elements within the given row index range in the given double matrix. Each matrix row in the given row index range is set to null.- Parameters:
matrix- Matrix.rowRange- Range of row indexes to deallocate.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if any argument is null.java.lang.IndexOutOfBoundsException- (unchecked exception) Thrown if any index in the rowRange is outside the row bounds of the matrix.
-
deallocate
public static void deallocate(float[][] matrix)
Deallocate the elements in the given float matrix. Each matrix row in the full row index range (0..matrix.length-1) is set to null.- Parameters:
matrix- Matrix.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if any argument is null.
-
deallocate
public static void deallocate(float[][] matrix, Range rowRange)Deallocate the elements within the given row index range in the given float matrix. Each matrix row in the given row index range is set to null.- Parameters:
matrix- Matrix.rowRange- Range of row indexes to deallocate.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if any argument is null.java.lang.IndexOutOfBoundsException- (unchecked exception) Thrown if any index in the rowRange is outside the row bounds of the matrix.
-
deallocate
public static void deallocate(int[][] matrix)
Deallocate the elements in the given integer matrix. Each matrix row in the full row index range (0..matrix.length-1) is set to null.- Parameters:
matrix- Matrix.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if any argument is null.
-
deallocate
public static void deallocate(int[][] matrix, Range rowRange)Deallocate the elements within the given row index range in the given integer matrix. Each matrix row in the given row index range is set to null.- Parameters:
matrix- Matrix.rowRange- Range of row indexes to deallocate.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if any argument is null.java.lang.IndexOutOfBoundsException- (unchecked exception) Thrown if any index in the rowRange is outside the row bounds of the matrix.
-
deallocate
public static void deallocate(long[][] matrix)
Deallocate the elements in the given long matrix. Each matrix row in the full row index range (0..matrix.length-1) is set to null.- Parameters:
matrix- Matrix.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if any argument is null.
-
deallocate
public static void deallocate(long[][] matrix, Range rowRange)Deallocate the elements within the given row index range in the given long matrix. Each matrix row in the given row index range is set to null.- Parameters:
matrix- Matrix.rowRange- Range of row indexes to deallocate.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if any argument is null.java.lang.IndexOutOfBoundsException- (unchecked exception) Thrown if any index in the rowRange is outside the row bounds of the matrix.
-
deallocate
public static void deallocate(short[][] matrix)
Deallocate the elements in the given short matrix. Each matrix row in the full row index range (0..matrix.length-1) is set to null.- Parameters:
matrix- Matrix.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if any argument is null.
-
deallocate
public static void deallocate(short[][] matrix, Range rowRange)Deallocate the elements within the given row index range in the given short matrix. Each matrix row in the given row index range is set to null.- Parameters:
matrix- Matrix.rowRange- Range of row indexes to deallocate.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if any argument is null.java.lang.IndexOutOfBoundsException- (unchecked exception) Thrown if any index in the rowRange is outside the row bounds of the matrix.
-
deallocate
public static <T> void deallocate(T[][] matrix)
Deallocate the elements in the given object matrix. Each matrix row in the full row index range (0..matrix.length-1) is set to null.- Type Parameters:
T- Matrix element data type.- Parameters:
matrix- Matrix.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if any argument is null.
-
deallocate
public static <T> void deallocate(T[][] matrix, Range rowRange)Deallocate the elements within the given row index range in the given object matrix. Each matrix row in the given row index range is set to null.- Type Parameters:
T- Matrix element data type.- Parameters:
matrix- Matrix.rowRange- Range of row indexes to deallocate.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if any argument is null.java.lang.IndexOutOfBoundsException- (unchecked exception) Thrown if any index in the rowRange is outside the row bounds of the matrix.
-
deallocate
public static <T> void deallocate(T[][] matrix, Range rowRange, Range colRange)Deallocate the elements within the given row and column index ranges in the given object matrix. Each matrix element within the given row and column index ranges is set to null.- Type Parameters:
T- Matrix element data type.- Parameters:
matrix- Matrix.rowRange- Range of row indexes to deallocate.colRange- Range of column indexes to deallocate.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if any argument is null.java.lang.IndexOutOfBoundsException- (unchecked exception) Thrown if any index in the rowRange is outside the row bounds of the matrix. Thrown if any index in the colRange is outside the bounds 0 .. ncols-1.
-
copy
public static void copy(boolean[] src, Range srcRange, boolean[] dst, Range dstRange)Copy a range of elements from one Boolean array to a range of elements in another Boolean array. The number of elements copied is the smaller of srcRange's length and dstRange's length. Either or both of srcRange's and dstRange's strides may be greater than 1.- Parameters:
src- Source array.srcRange- Range of source elements.dst- Destination array.dstRange- Range of destination elements.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if any argument is null.java.lang.IndexOutOfBoundsException- (unchecked exception) Thrown if any index in srcRange is outside the bounds of the source array. Thrown if any index in dstRange is outside the bounds of the destination array.
-
copy
public static void copy(byte[] src, Range srcRange, byte[] dst, Range dstRange)Copy a range of elements from one byte array to a range of elements in another byte array. The number of elements copied is the smaller of srcRange's length and dstRange's length. Either or both of srcRange's and dstRange's strides may be greater than 1.- Parameters:
src- Source array.srcRange- Range of source elements.dst- Destination array.dstRange- Range of destination elements.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if any argument is null.java.lang.IndexOutOfBoundsException- (unchecked exception) Thrown if any index in srcRange is outside the bounds of the source array. Thrown if any index in dstRange is outside the bounds of the destination array.
-
copy
public static void copy(char[] src, Range srcRange, char[] dst, Range dstRange)Copy a range of elements from one character array to a range of elements in another character array. The number of elements copied is the smaller of srcRange's length and dstRange's length. Either or both of srcRange's and dstRange's strides may be greater than 1.- Parameters:
src- Source array.srcRange- Range of source elements.dst- Destination array.dstRange- Range of destination elements.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if any argument is null.java.lang.IndexOutOfBoundsException- (unchecked exception) Thrown if any index in srcRange is outside the bounds of the source array. Thrown if any index in dstRange is outside the bounds of the destination array.
-
copy
public static void copy(double[] src, Range srcRange, double[] dst, Range dstRange)Copy a range of elements from one double array to a range of elements in another double array. The number of elements copied is the smaller of srcRange's length and dstRange's length. Either or both of srcRange's and dstRange's strides may be greater than 1.- Parameters:
src- Source array.srcRange- Range of source elements.dst- Destination array.dstRange- Range of destination elements.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if any argument is null.java.lang.IndexOutOfBoundsException- (unchecked exception) Thrown if any index in srcRange is outside the bounds of the source array. Thrown if any index in dstRange is outside the bounds of the destination array.
-
copy
public static void copy(float[] src, Range srcRange, float[] dst, Range dstRange)Copy a range of elements from one float array to a range of elements in another float array. The number of elements copied is the smaller of srcRange's length and dstRange's length. Either or both of srcRange's and dstRange's strides may be greater than 1.- Parameters:
src- Source array.srcRange- Range of source elements.dst- Destination array.dstRange- Range of destination elements.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if any argument is null.java.lang.IndexOutOfBoundsException- (unchecked exception) Thrown if any index in srcRange is outside the bounds of the source array. Thrown if any index in dstRange is outside the bounds of the destination array.
-
copy
public static void copy(int[] src, Range srcRange, int[] dst, Range dstRange)Copy a range of elements from one integer array to a range of elements in another integer array. The number of elements copied is the smaller of srcRange's length and dstRange's length. Either or both of srcRange's and dstRange's strides may be greater than 1.- Parameters:
src- Source array.srcRange- Range of source elements.dst- Destination array.dstRange- Range of destination elements.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if any argument is null.java.lang.IndexOutOfBoundsException- (unchecked exception) Thrown if any index in srcRange is outside the bounds of the source array. Thrown if any index in dstRange is outside the bounds of the destination array.
-
copy
public static void copy(long[] src, Range srcRange, long[] dst, Range dstRange)Copy a range of elements from one long array to a range of elements in another long array. The number of elements copied is the smaller of srcRange's length and dstRange's length. Either or both of srcRange's and dstRange's strides may be greater than 1.- Parameters:
src- Source array.srcRange- Range of source elements.dst- Destination array.dstRange- Range of destination elements.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if any argument is null.java.lang.IndexOutOfBoundsException- (unchecked exception) Thrown if any index in srcRange is outside the bounds of the source array. Thrown if any index in dstRange is outside the bounds of the destination array.
-
copy
public static void copy(short[] src, Range srcRange, short[] dst, Range dstRange)Copy a range of elements from one short array to a range of elements in another short array. The number of elements copied is the smaller of srcRange's length and dstRange's length. Either or both of srcRange's and dstRange's strides may be greater than 1.- Parameters:
src- Source array.srcRange- Range of source elements.dst- Destination array.dstRange- Range of destination elements.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if any argument is null.java.lang.IndexOutOfBoundsException- (unchecked exception) Thrown if any index in srcRange is outside the bounds of the source array. Thrown if any index in dstRange is outside the bounds of the destination array.
-
copy
public static <DT,ST extends DT> void copy(ST[] src, Range srcRange, DT[] dst, Range dstRange)Copy a range of elements from one object array to a range of elements in another object array. The number of elements copied is the smaller of srcRange's length and dstRange's length. Either or both of srcRange's and dstRange's strides may be greater than 1.Note: This method does a shallow copy. Only the references to the array elements are copied from the source array to the destination array.
- Type Parameters:
ST- Source array element data type.DT- Destination array element data type.- Parameters:
src- Source array.srcRange- Range of source elements.dst- Destination array.dstRange- Range of destination elements.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if any argument is null.java.lang.IndexOutOfBoundsException- (unchecked exception) Thrown if any index in srcRange is outside the bounds of the source array. Thrown if any index in dstRange is outside the bounds of the destination array.
-
copy
public static void copy(boolean[][] src, Range srcRowRange, Range srcColRange, boolean[][] dst, Range dstRowRange, Range dstColRange)Copy a range of elements from one Boolean matrix to a range of elements in another Boolean matrix. The number of rows copied is the smaller of srcRowRange's length and dstRowRange's length. Within each row, the number of columns copied is the smaller of srcColRange's length and dstColRange's length. Any of srcRowRange's, srcColRange's, dstRowRange's, and dstColRange's strides may be greater than 1. It is assumed that the source matrix is fully allocated; each row in the source matrix is the same length; the destination matrix is fully allocated; and each row in the destination matrix is the same length.- Parameters:
src- Source matrix.srcRowRange- Range of source rows.srcColRange- Range of source columns.dst- Destination matrix.dstRowRange- Range of destination rows.dstColRange- Range of destination columns.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if any argument is null.java.lang.IndexOutOfBoundsException- (unchecked exception) Thrown if any index in srcRowRange is outside the row bounds of the source matrix. Thrown if any index in srcColRange is outside the column bounds of the source matrix. Thrown if any index in dstRowRange is outside the row bounds of the destination matrix. Thrown if any index in dstColRange is outside the column bounds of the destination matrix.
-
copy
public static void copy(byte[][] src, Range srcRowRange, Range srcColRange, byte[][] dst, Range dstRowRange, Range dstColRange)Copy a range of elements from one byte matrix to a range of elements in another byte matrix. The number of rows copied is the smaller of srcRowRange's length and dstRowRange's length. Within each row, the number of columns copied is the smaller of srcColRange's length and dstColRange's length. Any of srcRowRange's, srcColRange's, dstRowRange's, and dstColRange's strides may be greater than 1. It is assumed that the source matrix is fully allocated; each row in the source matrix is the same length; the destination matrix is fully allocated; and each row in the destination matrix is the same length.- Parameters:
src- Source matrix.srcRowRange- Range of source rows.srcColRange- Range of source columns.dst- Destination matrix.dstRowRange- Range of destination rows.dstColRange- Range of destination columns.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if any argument is null.java.lang.IndexOutOfBoundsException- (unchecked exception) Thrown if any index in srcRowRange is outside the row bounds of the source matrix. Thrown if any index in srcColRange is outside the column bounds of the source matrix. Thrown if any index in dstRowRange is outside the row bounds of the destination matrix. Thrown if any index in dstColRange is outside the column bounds of the destination matrix.
-
copy
public static void copy(char[][] src, Range srcRowRange, Range srcColRange, char[][] dst, Range dstRowRange, Range dstColRange)Copy a range of elements from one character matrix to a range of elements in another character matrix. The number of rows copied is the smaller of srcRowRange's length and dstRowRange's length. Within each row, the number of columns copied is the smaller of srcColRange's length and dstColRange's length. Any of srcRowRange's, srcColRange's, dstRowRange's, and dstColRange's strides may be greater than 1. It is assumed that the source matrix is fully allocated; each row in the source matrix is the same length; the destination matrix is fully allocated; and each row in the destination matrix is the same length.- Parameters:
src- Source matrix.srcRowRange- Range of source rows.srcColRange- Range of source columns.dst- Destination matrix.dstRowRange- Range of destination rows.dstColRange- Range of destination columns.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if any argument is null.java.lang.IndexOutOfBoundsException- (unchecked exception) Thrown if any index in srcRowRange is outside the row bounds of the source matrix. Thrown if any index in srcColRange is outside the column bounds of the source matrix. Thrown if any index in dstRowRange is outside the row bounds of the destination matrix. Thrown if any index in dstColRange is outside the column bounds of the destination matrix.
-
copy
public static void copy(double[][] src, Range srcRowRange, Range srcColRange, double[][] dst, Range dstRowRange, Range dstColRange)Copy a range of elements from one double matrix to a range of elements in another double matrix. The number of rows copied is the smaller of srcRowRange's length and dstRowRange's length. Within each row, the number of columns copied is the smaller of srcColRange's length and dstColRange's length. Any of srcRowRange's, srcColRange's, dstRowRange's, and dstColRange's strides may be greater than 1. It is assumed that the source matrix is fully allocated; each row in the source matrix is the same length; the destination matrix is fully allocated; and each row in the destination matrix is the same length.- Parameters:
src- Source matrix.srcRowRange- Range of source rows.srcColRange- Range of source columns.dst- Destination matrix.dstRowRange- Range of destination rows.dstColRange- Range of destination columns.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if any argument is null.java.lang.IndexOutOfBoundsException- (unchecked exception) Thrown if any index in srcRowRange is outside the row bounds of the source matrix. Thrown if any index in srcColRange is outside the column bounds of the source matrix. Thrown if any index in dstRowRange is outside the row bounds of the destination matrix. Thrown if any index in dstColRange is outside the column bounds of the destination matrix.
-
copy
public static void copy(float[][] src, Range srcRowRange, Range srcColRange, float[][] dst, Range dstRowRange, Range dstColRange)Copy a range of elements from one float matrix to a range of elements in another float matrix. The number of rows copied is the smaller of srcRowRange's length and dstRowRange's length. Within each row, the number of columns copied is the smaller of srcColRange's length and dstColRange's length. Any of srcRowRange's, srcColRange's, dstRowRange's, and dstColRange's strides may be greater than 1. It is assumed that the source matrix is fully allocated; each row in the source matrix is the same length; the destination matrix is fully allocated; and each row in the destination matrix is the same length.- Parameters:
src- Source matrix.srcRowRange- Range of source rows.srcColRange- Range of source columns.dst- Destination matrix.dstRowRange- Range of destination rows.dstColRange- Range of destination columns.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if any argument is null.java.lang.IndexOutOfBoundsException- (unchecked exception) Thrown if any index in srcRowRange is outside the row bounds of the source matrix. Thrown if any index in srcColRange is outside the column bounds of the source matrix. Thrown if any index in dstRowRange is outside the row bounds of the destination matrix. Thrown if any index in dstColRange is outside the column bounds of the destination matrix.
-
copy
public static void copy(int[][] src, Range srcRowRange, Range srcColRange, int[][] dst, Range dstRowRange, Range dstColRange)Copy a range of elements from one integer matrix to a range of elements in another integer matrix. The number of rows copied is the smaller of srcRowRange's length and dstRowRange's length. Within each row, the number of columns copied is the smaller of srcColRange's length and dstColRange's length. Any of srcRowRange's, srcColRange's, dstRowRange's, and dstColRange's strides may be greater than 1. It is assumed that the source matrix is fully allocated; each row in the source matrix is the same length; the destination matrix is fully allocated; and each row in the destination matrix is the same length.- Parameters:
src- Source matrix.srcRowRange- Range of source rows.srcColRange- Range of source columns.dst- Destination matrix.dstRowRange- Range of destination rows.dstColRange- Range of destination columns.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if any argument is null.java.lang.IndexOutOfBoundsException- (unchecked exception) Thrown if any index in srcRowRange is outside the row bounds of the source matrix. Thrown if any index in srcColRange is outside the column bounds of the source matrix. Thrown if any index in dstRowRange is outside the row bounds of the destination matrix. Thrown if any index in dstColRange is outside the column bounds of the destination matrix.
-
copy
public static void copy(long[][] src, Range srcRowRange, Range srcColRange, long[][] dst, Range dstRowRange, Range dstColRange)Copy a range of elements from one long matrix to a range of elements in another long matrix. The number of rows copied is the smaller of srcRowRange's length and dstRowRange's length. Within each row, the number of columns copied is the smaller of srcColRange's length and dstColRange's length. Any of srcRowRange's, srcColRange's, dstRowRange's, and dstColRange's strides may be greater than 1. It is assumed that the source matrix is fully allocated; each row in the source matrix is the same length; the destination matrix is fully allocated; and each row in the destination matrix is the same length.- Parameters:
src- Source matrix.srcRowRange- Range of source rows.srcColRange- Range of source columns.dst- Destination matrix.dstRowRange- Range of destination rows.dstColRange- Range of destination columns.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if any argument is null.java.lang.IndexOutOfBoundsException- (unchecked exception) Thrown if any index in srcRowRange is outside the row bounds of the source matrix. Thrown if any index in srcColRange is outside the column bounds of the source matrix. Thrown if any index in dstRowRange is outside the row bounds of the destination matrix. Thrown if any index in dstColRange is outside the column bounds of the destination matrix.
-
copy
public static void copy(short[][] src, Range srcRowRange, Range srcColRange, short[][] dst, Range dstRowRange, Range dstColRange)Copy a range of elements from one short matrix to a range of elements in another short matrix. The number of rows copied is the smaller of srcRowRange's length and dstRowRange's length. Within each row, the number of columns copied is the smaller of srcColRange's length and dstColRange's length. Any of srcRowRange's, srcColRange's, dstRowRange's, and dstColRange's strides may be greater than 1. It is assumed that the source matrix is fully allocated; each row in the source matrix is the same length; the destination matrix is fully allocated; and each row in the destination matrix is the same length.- Parameters:
src- Source matrix.srcRowRange- Range of source rows.srcColRange- Range of source columns.dst- Destination matrix.dstRowRange- Range of destination rows.dstColRange- Range of destination columns.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if any argument is null.java.lang.IndexOutOfBoundsException- (unchecked exception) Thrown if any index in srcRowRange is outside the row bounds of the source matrix. Thrown if any index in srcColRange is outside the column bounds of the source matrix. Thrown if any index in dstRowRange is outside the row bounds of the destination matrix. Thrown if any index in dstColRange is outside the column bounds of the destination matrix.
-
copy
public static <DT,ST extends DT> void copy(ST[][] src, Range srcRowRange, Range srcColRange, DT[][] dst, Range dstRowRange, Range dstColRange)Copy a range of elements from one object matrix to a range of elements in another object matrix. The number of rows copied is the smaller of srcRowRange's length and dstRowRange's length. Within each row, the number of columns copied is the smaller of srcColRange's length and dstColRange's length. Any of srcRowRange's, srcColRange's, dstRowRange's, and dstColRange's strides may be greater than 1. It is assumed that the source matrix is fully allocated; each row in the source matrix is the same length; the destination matrix is fully allocated; and each row in the destination matrix is the same length.Note: This method does a shallow copy. Only the references to the matrix elements are copied from the source matrix to the destination matrix.
- Type Parameters:
ST- Source matrix element data type.DT- Destination matrix element data type.- Parameters:
src- Source matrix.srcRowRange- Range of source rows.srcColRange- Range of source columns.dst- Destination matrix.dstRowRange- Range of destination rows.dstColRange- Range of destination columns.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if any argument is null.java.lang.IndexOutOfBoundsException- (unchecked exception) Thrown if any index in srcRowRange is outside the row bounds of the source matrix. Thrown if any index in srcColRange is outside the column bounds of the source matrix. Thrown if any index in dstRowRange is outside the row bounds of the destination matrix. Thrown if any index in dstColRange is outside the column bounds of the destination matrix.
-
length
public static int length(boolean[] array)
Determine the number of elements in the given Boolean array. If array is null, 0 is returned.- Parameters:
array- Array.- Returns:
- Number of elements in array.
-
length
public static int length(byte[] array)
Determine the number of elements in the given byte array. If array is null, 0 is returned.- Parameters:
array- Array.- Returns:
- Number of elements in array.
-
length
public static int length(char[] array)
Determine the number of elements in the given character array. If array is null, 0 is returned.- Parameters:
array- Array.- Returns:
- Number of elements in array.
-
length
public static int length(double[] array)
Determine the number of elements in the given double array. If array is null, 0 is returned.- Parameters:
array- Array.- Returns:
- Number of elements in array.
-
length
public static int length(float[] array)
Determine the number of elements in the given float array. If array is null, 0 is returned.- Parameters:
array- Array.- Returns:
- Number of elements in array.
-
length
public static int length(int[] array)
Determine the number of elements in the given integer array. If array is null, 0 is returned.- Parameters:
array- Array.- Returns:
- Number of elements in array.
-
length
public static int length(long[] array)
Determine the number of elements in the given long array. If array is null, 0 is returned.- Parameters:
array- Array.- Returns:
- Number of elements in array.
-
length
public static int length(short[] array)
Determine the number of elements in the given short array. If array is null, 0 is returned.- Parameters:
array- Array.- Returns:
- Number of elements in array.
-
length
public static <T> int length(T[] array)
Determine the number of elements in the given object array. If array is null, 0 is returned.- Type Parameters:
T- Array element data type.- Parameters:
array- Array.- Returns:
- Number of elements in array.
-
rowLength
public static int rowLength(boolean[][] matrix)
Determine the number of rows in the given Boolean matrix. If matrix is null, 0 is returned.- Parameters:
matrix- Matrix.- Returns:
- Number of rows in matrix.
-
rowLength
public static int rowLength(byte[][] matrix)
Determine the number of rows in the given byte matrix. If matrix is null, 0 is returned.- Parameters:
matrix- Matrix.- Returns:
- Number of rows in matrix.
-
rowLength
public static int rowLength(char[][] matrix)
Determine the number of rows in the given character matrix. If matrix is null, 0 is returned.- Parameters:
matrix- Matrix.- Returns:
- Number of rows in matrix.
-
rowLength
public static int rowLength(double[][] matrix)
Determine the number of rows in the given double matrix. If matrix is null, 0 is returned.- Parameters:
matrix- Matrix.- Returns:
- Number of rows in matrix.
-
rowLength
public static int rowLength(float[][] matrix)
Determine the number of rows in the given float matrix. If matrix is null, 0 is returned.- Parameters:
matrix- Matrix.- Returns:
- Number of rows in matrix.
-
rowLength
public static int rowLength(int[][] matrix)
Determine the number of rows in the given integer matrix. If matrix is null, 0 is returned.- Parameters:
matrix- Matrix.- Returns:
- Number of rows in matrix.
-
rowLength
public static int rowLength(long[][] matrix)
Determine the number of rows in the given long matrix. If matrix is null, 0 is returned.- Parameters:
matrix- Matrix.- Returns:
- Number of rows in matrix.
-
rowLength
public static int rowLength(short[][] matrix)
Determine the number of rows in the given short matrix. If matrix is null, 0 is returned.- Parameters:
matrix- Matrix.- Returns:
- Number of rows in matrix.
-
rowLength
public static <T> int rowLength(T[][] matrix)
Determine the number of rows in the given object matrix. If matrix is null, 0 is returned.- Type Parameters:
T- Matrix element data type.- Parameters:
matrix- Matrix.- Returns:
- Number of rows in matrix.
-
colLength
public static int colLength(boolean[][] matrix, int i)Determine the number of columns in the given row of the given Boolean matrix. If matrix is null or the given row is not allocated, 0 is returned.- Parameters:
matrix- Matrix.i- Row index.- Returns:
- Number of rows in matrix.
- Throws:
java.lang.ArrayIndexOutOfBoundsException- (unchecked exception) Thrown if i is out of bounds.
-
colLength
public static int colLength(byte[][] matrix, int i)Determine the number of columns in the given row of the given byte matrix. If matrix is null or the given row is not allocated, 0 is returned.- Parameters:
matrix- Matrix.i- Row index.- Returns:
- Number of rows in matrix.
- Throws:
java.lang.ArrayIndexOutOfBoundsException- (unchecked exception) Thrown if i is out of bounds.
-
colLength
public static int colLength(char[][] matrix, int i)Determine the number of columns in the given row of the given character matrix. If matrix is null or the given row is not allocated, 0 is returned.- Parameters:
matrix- Matrix.i- Row index.- Returns:
- Number of rows in matrix.
- Throws:
java.lang.ArrayIndexOutOfBoundsException- (unchecked exception) Thrown if i is out of bounds.
-
colLength
public static int colLength(double[][] matrix, int i)Determine the number of columns in the given row of the given double matrix. If matrix is null or the given row is not allocated, 0 is returned.- Parameters:
matrix- Matrix.i- Row index.- Returns:
- Number of rows in matrix.
- Throws:
java.lang.ArrayIndexOutOfBoundsException- (unchecked exception) Thrown if i is out of bounds.
-
colLength
public static int colLength(float[][] matrix, int i)Determine the number of columns in the given row of the given float matrix. If matrix is null or the given row is not allocated, 0 is returned.- Parameters:
matrix- Matrix.i- Row index.- Returns:
- Number of rows in matrix.
- Throws:
java.lang.ArrayIndexOutOfBoundsException- (unchecked exception) Thrown if i is out of bounds.
-
colLength
public static int colLength(int[][] matrix, int i)Determine the number of columns in the given row of the given integer matrix. If matrix is null or the given row is not allocated, 0 is returned.- Parameters:
matrix- Matrix.i- Row index.- Returns:
- Number of rows in matrix.
- Throws:
java.lang.ArrayIndexOutOfBoundsException- (unchecked exception) Thrown if i is out of bounds.
-
colLength
public static int colLength(long[][] matrix, int i)Determine the number of columns in the given row of the given long matrix. If matrix is null or the given row is not allocated, 0 is returned.- Parameters:
matrix- Matrix.i- Row index.- Returns:
- Number of rows in matrix.
- Throws:
java.lang.ArrayIndexOutOfBoundsException- (unchecked exception) Thrown if i is out of bounds.
-
colLength
public static int colLength(short[][] matrix, int i)Determine the number of columns in the given row of the given short matrix. If matrix is null or the given row is not allocated, 0 is returned.- Parameters:
matrix- Matrix.i- Row index.- Returns:
- Number of rows in matrix.
- Throws:
java.lang.ArrayIndexOutOfBoundsException- (unchecked exception) Thrown if i is out of bounds.
-
colLength
public static <T> int colLength(T[][] matrix, int i)Determine the number of columns in the given row of the given object matrix. If matrix is null or the given row is not allocated, 0 is returned.- Type Parameters:
T- Matrix element data type.- Parameters:
matrix- Matrix.i- Row index.- Returns:
- Number of rows in matrix.
- Throws:
java.lang.ArrayIndexOutOfBoundsException- (unchecked exception) Thrown if i is out of bounds.
-
-
DMelt 3.0 © DataMelt by jWork.ORG