Package edu.rit.util
Class Arrays
java.lang.Object
edu.rit.util.Arrays
Class 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.
- Version:
- 19-Nov-2007
- Author:
- Alan Kaminsky
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidallocate(boolean[][] matrix, int ncols) Allocate the elements in the given Boolean matrix.static voidAllocate 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 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 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 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 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 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 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 the elements within the given row index range in the given short matrix.static <T,ST extends T>
voidAllocate the elements in the given object matrix.static <T,ST extends T>
voidAllocate the elements within the given row and column index ranges in the given object matrix.static <T,ST extends T>
voidAllocate the elements within the given row index range in the given object matrix.static <T,ST extends T>
voidAllocate the elements within the given index range in the given object array.static <T,ST extends T>
voidAllocate all elements 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 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 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 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 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 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 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 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 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 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 Details
-
allocate
public static <T,ST extends T> void allocate(T[] array, Class<ST> type) throws InstantiationException, IllegalAccessException Allocate 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- Array element data type that extends T.- Parameters:
array- Array.type- Class for the objects to be created.- Throws:
NullPointerException- (unchecked exception) Thrown if any argument is null.InstantiationException- Thrown if an instance of the given class cannot be instantiated.IllegalAccessException- Thrown if the given class or its no-argument constructor is not accessible.InstantiationException- if any.IllegalAccessException- if any.
-
allocate
public static <T,ST extends T> void allocate(T[] array, Range range, Class<ST> type) throws InstantiationException, IllegalAccessException Allocate 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- Array element data type that extends T.- Parameters:
array- Array.range- Range of indexes to allocate.type- Class for the objects to be created.- Throws:
NullPointerException- (unchecked exception) Thrown if any argument is null.IndexOutOfBoundsException- (unchecked exception) Thrown if any index in therangeis outside the bounds of thearray.InstantiationException- Thrown if an instance of the given class cannot be instantiated.IllegalAccessException- Thrown if the given class or its no-argument constructor is not accessible.InstantiationException- if any.IllegalAccessException- if any.
-
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:
NullPointerException- (unchecked exception) Thrown if any argument is null.NegativeArraySizeException- (unchecked exception) Thrown ifncols< 0.
-
allocate
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:
NullPointerException- (unchecked exception) Thrown if any argument is null.IndexOutOfBoundsException- (unchecked exception) Thrown if any index in therowRangeis outside the row bounds of thematrix.NegativeArraySizeException- (unchecked exception) Thrown ifncols< 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:
NullPointerException- (unchecked exception) Thrown if any argument is null.NegativeArraySizeException- (unchecked exception) Thrown ifncols< 0.
-
allocate
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:
NullPointerException- (unchecked exception) Thrown if any argument is null.IndexOutOfBoundsException- (unchecked exception) Thrown if any index in therowRangeis outside the row bounds of thematrix.NegativeArraySizeException- (unchecked exception) Thrown ifncols< 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:
NullPointerException- (unchecked exception) Thrown if any argument is null.NegativeArraySizeException- (unchecked exception) Thrown ifncols< 0.
-
allocate
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:
NullPointerException- (unchecked exception) Thrown if any argument is null.IndexOutOfBoundsException- (unchecked exception) Thrown if any index in therowRangeis outside the row bounds of thematrix.NegativeArraySizeException- (unchecked exception) Thrown ifncols< 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:
NullPointerException- (unchecked exception) Thrown if any argument is null.NegativeArraySizeException- (unchecked exception) Thrown ifncols< 0.
-
allocate
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:
NullPointerException- (unchecked exception) Thrown if any argument is null.IndexOutOfBoundsException- (unchecked exception) Thrown if any index in therowRangeis outside the row bounds of thematrix.NegativeArraySizeException- (unchecked exception) Thrown ifncols< 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:
NullPointerException- (unchecked exception) Thrown if any argument is null.NegativeArraySizeException- (unchecked exception) Thrown ifncols< 0.
-
allocate
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:
NullPointerException- (unchecked exception) Thrown if any argument is null.IndexOutOfBoundsException- (unchecked exception) Thrown if any index in therowRangeis outside the row bounds of thematrix.NegativeArraySizeException- (unchecked exception) Thrown ifncols< 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:
NullPointerException- (unchecked exception) Thrown if any argument is null.NegativeArraySizeException- (unchecked exception) Thrown ifncols< 0.
-
allocate
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:
NullPointerException- (unchecked exception) Thrown if any argument is null.IndexOutOfBoundsException- (unchecked exception) Thrown if any index in therowRangeis outside the row bounds of thematrix.NegativeArraySizeException- (unchecked exception) Thrown ifncols< 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:
NullPointerException- (unchecked exception) Thrown if any argument is null.NegativeArraySizeException- (unchecked exception) Thrown ifncols< 0.
-
allocate
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:
NullPointerException- (unchecked exception) Thrown if any argument is null.IndexOutOfBoundsException- (unchecked exception) Thrown if any index in therowRangeis outside the row bounds of thematrix.NegativeArraySizeException- (unchecked exception) Thrown ifncols< 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:
NullPointerException- (unchecked exception) Thrown if any argument is null.NegativeArraySizeException- (unchecked exception) Thrown ifncols< 0.
-
allocate
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:
NullPointerException- (unchecked exception) Thrown if any argument is null.IndexOutOfBoundsException- (unchecked exception) Thrown if any index in therowRangeis outside the row bounds of thematrix.NegativeArraySizeException- (unchecked exception) Thrown ifncols< 0.
-
allocate
public static <T,ST extends T> void allocate(T[][] matrix, int ncols, Class<ST> type) throws InstantiationException, IllegalAccessException Allocate 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- Array element data type that extends T.- Parameters:
matrix- Matrix.ncols- Number of columns in each row.type- Class for the objects to be created.- Throws:
NullPointerException- (unchecked exception) Thrown if any argument is null.NegativeArraySizeException- (unchecked exception) Thrown ifncols< 0.InstantiationException- Thrown if an instance of the given class cannot be instantiated.IllegalAccessException- Thrown if the given class or its no-argument constructor is not accessible.InstantiationException- if any.IllegalAccessException- if any.
-
allocate
public static <T,ST extends T> void allocate(T[][] matrix, Range rowRange, int ncols, Class<ST> type) throws InstantiationException, IllegalAccessException Allocate 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- Array element data type that extends T.- 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:
NullPointerException- (unchecked exception) Thrown if any argument is null.IndexOutOfBoundsException- (unchecked exception) Thrown if any index in therowRangeis outside the row bounds of thematrix.NegativeArraySizeException- (unchecked exception) Thrown ifncols< 0.InstantiationException- Thrown if an instance of the given class cannot be instantiated.IllegalAccessException- Thrown if the given class or its no-argument constructor is not accessible.InstantiationException- if any.IllegalAccessException- if any.
-
allocate
public static <T,ST extends T> void allocate(T[][] matrix, Range rowRange, int ncols, Range colRange, Class<ST> type) throws InstantiationException, IllegalAccessException Allocate 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- Array element data type that extends T.- 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:
NullPointerException- (unchecked exception) Thrown if any argument is null.IndexOutOfBoundsException- (unchecked exception) Thrown if any index in therowRangeis outside the row bounds of thematrix. Thrown if any index in thecolRangeis outside the bounds 0 ..ncols-1.NegativeArraySizeException- (unchecked exception) Thrown ifncols< 0.InstantiationException- Thrown if an instance of the given class cannot be instantiated.IllegalAccessException- Thrown if the given class or its no-argument constructor is not accessible.InstantiationException- if any.IllegalAccessException- if any.
-
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:
NullPointerException- (unchecked exception) Thrown if any argument is null.
-
deallocate
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:
NullPointerException- (unchecked exception) Thrown if any argument is null.IndexOutOfBoundsException- (unchecked exception) Thrown if any index in therangeis outside the bounds of thearray.
-
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:
NullPointerException- (unchecked exception) Thrown if any argument is null.
-
deallocate
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:
NullPointerException- (unchecked exception) Thrown if any argument is null.IndexOutOfBoundsException- (unchecked exception) Thrown if any index in therowRangeis outside the row bounds of thematrix.
-
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:
NullPointerException- (unchecked exception) Thrown if any argument is null.
-
deallocate
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:
NullPointerException- (unchecked exception) Thrown if any argument is null.IndexOutOfBoundsException- (unchecked exception) Thrown if any index in therowRangeis outside the row bounds of thematrix.
-
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:
NullPointerException- (unchecked exception) Thrown if any argument is null.
-
deallocate
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:
NullPointerException- (unchecked exception) Thrown if any argument is null.IndexOutOfBoundsException- (unchecked exception) Thrown if any index in therowRangeis outside the row bounds of thematrix.
-
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:
NullPointerException- (unchecked exception) Thrown if any argument is null.
-
deallocate
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:
NullPointerException- (unchecked exception) Thrown if any argument is null.IndexOutOfBoundsException- (unchecked exception) Thrown if any index in therowRangeis outside the row bounds of thematrix.
-
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:
NullPointerException- (unchecked exception) Thrown if any argument is null.
-
deallocate
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:
NullPointerException- (unchecked exception) Thrown if any argument is null.IndexOutOfBoundsException- (unchecked exception) Thrown if any index in therowRangeis outside the row bounds of thematrix.
-
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:
NullPointerException- (unchecked exception) Thrown if any argument is null.
-
deallocate
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:
NullPointerException- (unchecked exception) Thrown if any argument is null.IndexOutOfBoundsException- (unchecked exception) Thrown if any index in therowRangeis outside the row bounds of thematrix.
-
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:
NullPointerException- (unchecked exception) Thrown if any argument is null.
-
deallocate
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:
NullPointerException- (unchecked exception) Thrown if any argument is null.IndexOutOfBoundsException- (unchecked exception) Thrown if any index in therowRangeis outside the row bounds of thematrix.
-
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:
NullPointerException- (unchecked exception) Thrown if any argument is null.
-
deallocate
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:
NullPointerException- (unchecked exception) Thrown if any argument is null.IndexOutOfBoundsException- (unchecked exception) Thrown if any index in therowRangeis outside the row bounds of thematrix.
-
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:
NullPointerException- (unchecked exception) Thrown if any argument is null.
-
deallocate
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:
NullPointerException- (unchecked exception) Thrown if any argument is null.IndexOutOfBoundsException- (unchecked exception) Thrown if any index in therowRangeis outside the row bounds of thematrix.
-
deallocate
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:
NullPointerException- (unchecked exception) Thrown if any argument is null.IndexOutOfBoundsException- (unchecked exception) Thrown if any index in therowRangeis outside the row bounds of thematrix. Thrown if any index in thecolRangeis outside the bounds 0 ..ncols-1.
-
copy
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 ofsrcRange's length anddstRange's length. Either or both ofsrcRange's anddstRange'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:
NullPointerException- (unchecked exception) Thrown if any argument is null.IndexOutOfBoundsException- (unchecked exception) Thrown if any index insrcRangeis outside the bounds of the source array. Thrown if any index indstRangeis outside the bounds of the destination array.
-
copy
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 ofsrcRange's length anddstRange's length. Either or both ofsrcRange's anddstRange'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:
NullPointerException- (unchecked exception) Thrown if any argument is null.IndexOutOfBoundsException- (unchecked exception) Thrown if any index insrcRangeis outside the bounds of the source array. Thrown if any index indstRangeis outside the bounds of the destination array.
-
copy
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 ofsrcRange's length anddstRange's length. Either or both ofsrcRange's anddstRange'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:
NullPointerException- (unchecked exception) Thrown if any argument is null.IndexOutOfBoundsException- (unchecked exception) Thrown if any index insrcRangeis outside the bounds of the source array. Thrown if any index indstRangeis outside the bounds of the destination array.
-
copy
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 ofsrcRange's length anddstRange's length. Either or both ofsrcRange's anddstRange'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:
NullPointerException- (unchecked exception) Thrown if any argument is null.IndexOutOfBoundsException- (unchecked exception) Thrown if any index insrcRangeis outside the bounds of the source array. Thrown if any index indstRangeis outside the bounds of the destination array.
-
copy
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 ofsrcRange's length anddstRange's length. Either or both ofsrcRange's anddstRange'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:
NullPointerException- (unchecked exception) Thrown if any argument is null.IndexOutOfBoundsException- (unchecked exception) Thrown if any index insrcRangeis outside the bounds of the source array. Thrown if any index indstRangeis outside the bounds of the destination array.
-
copy
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 ofsrcRange's length anddstRange's length. Either or both ofsrcRange's anddstRange'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:
NullPointerException- (unchecked exception) Thrown if any argument is null.IndexOutOfBoundsException- (unchecked exception) Thrown if any index insrcRangeis outside the bounds of the source array. Thrown if any index indstRangeis outside the bounds of the destination array.
-
copy
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 ofsrcRange's length anddstRange's length. Either or both ofsrcRange's anddstRange'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:
NullPointerException- (unchecked exception) Thrown if any argument is null.IndexOutOfBoundsException- (unchecked exception) Thrown if any index insrcRangeis outside the bounds of the source array. Thrown if any index indstRangeis outside the bounds of the destination array.
-
copy
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 ofsrcRange's length anddstRange's length. Either or both ofsrcRange's anddstRange'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:
NullPointerException- (unchecked exception) Thrown if any argument is null.IndexOutOfBoundsException- (unchecked exception) Thrown if any index insrcRangeis outside the bounds of the source array. Thrown if any index indstRangeis outside the bounds of the destination array.
-
copy
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 ofsrcRange's length anddstRange's length. Either or both ofsrcRange's anddstRange'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:
DT- Destination array element data type.ST- Array element data type that extends DT.- Parameters:
src- Source array.srcRange- Range of source elements.dst- Destination array.dstRange- Range of destination elements.- Throws:
NullPointerException- (unchecked exception) Thrown if any argument is null.IndexOutOfBoundsException- (unchecked exception) Thrown if any index insrcRangeis outside the bounds of the source array. Thrown if any index indstRangeis 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 ofsrcRowRange's length anddstRowRange's length. Within each row, the number of columns copied is the smaller ofsrcColRange's length anddstColRange's length. Any ofsrcRowRange's,srcColRange's,dstRowRange's, anddstColRange'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:
NullPointerException- (unchecked exception) Thrown if any argument is null.IndexOutOfBoundsException- (unchecked exception) Thrown if any index insrcRowRangeis outside the row bounds of the source matrix. Thrown if any index insrcColRangeis outside the column bounds of the source matrix. Thrown if any index indstRowRangeis outside the row bounds of the destination matrix. Thrown if any index indstColRangeis 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 ofsrcRowRange's length anddstRowRange's length. Within each row, the number of columns copied is the smaller ofsrcColRange's length anddstColRange's length. Any ofsrcRowRange's,srcColRange's,dstRowRange's, anddstColRange'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:
NullPointerException- (unchecked exception) Thrown if any argument is null.IndexOutOfBoundsException- (unchecked exception) Thrown if any index insrcRowRangeis outside the row bounds of the source matrix. Thrown if any index insrcColRangeis outside the column bounds of the source matrix. Thrown if any index indstRowRangeis outside the row bounds of the destination matrix. Thrown if any index indstColRangeis 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 ofsrcRowRange's length anddstRowRange's length. Within each row, the number of columns copied is the smaller ofsrcColRange's length anddstColRange's length. Any ofsrcRowRange's,srcColRange's,dstRowRange's, anddstColRange'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:
NullPointerException- (unchecked exception) Thrown if any argument is null.IndexOutOfBoundsException- (unchecked exception) Thrown if any index insrcRowRangeis outside the row bounds of the source matrix. Thrown if any index insrcColRangeis outside the column bounds of the source matrix. Thrown if any index indstRowRangeis outside the row bounds of the destination matrix. Thrown if any index indstColRangeis 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 ofsrcRowRange's length anddstRowRange's length. Within each row, the number of columns copied is the smaller ofsrcColRange's length anddstColRange's length. Any ofsrcRowRange's,srcColRange's,dstRowRange's, anddstColRange'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:
NullPointerException- (unchecked exception) Thrown if any argument is null.IndexOutOfBoundsException- (unchecked exception) Thrown if any index insrcRowRangeis outside the row bounds of the source matrix. Thrown if any index insrcColRangeis outside the column bounds of the source matrix. Thrown if any index indstRowRangeis outside the row bounds of the destination matrix. Thrown if any index indstColRangeis 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 ofsrcRowRange's length anddstRowRange's length. Within each row, the number of columns copied is the smaller ofsrcColRange's length anddstColRange's length. Any ofsrcRowRange's,srcColRange's,dstRowRange's, anddstColRange'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:
NullPointerException- (unchecked exception) Thrown if any argument is null.IndexOutOfBoundsException- (unchecked exception) Thrown if any index insrcRowRangeis outside the row bounds of the source matrix. Thrown if any index insrcColRangeis outside the column bounds of the source matrix. Thrown if any index indstRowRangeis outside the row bounds of the destination matrix. Thrown if any index indstColRangeis 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 ofsrcRowRange's length anddstRowRange's length. Within each row, the number of columns copied is the smaller ofsrcColRange's length anddstColRange's length. Any ofsrcRowRange's,srcColRange's,dstRowRange's, anddstColRange'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:
NullPointerException- (unchecked exception) Thrown if any argument is null.IndexOutOfBoundsException- (unchecked exception) Thrown if any index insrcRowRangeis outside the row bounds of the source matrix. Thrown if any index insrcColRangeis outside the column bounds of the source matrix. Thrown if any index indstRowRangeis outside the row bounds of the destination matrix. Thrown if any index indstColRangeis 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 ofsrcRowRange's length anddstRowRange's length. Within each row, the number of columns copied is the smaller ofsrcColRange's length anddstColRange's length. Any ofsrcRowRange's,srcColRange's,dstRowRange's, anddstColRange'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:
NullPointerException- (unchecked exception) Thrown if any argument is null.IndexOutOfBoundsException- (unchecked exception) Thrown if any index insrcRowRangeis outside the row bounds of the source matrix. Thrown if any index insrcColRangeis outside the column bounds of the source matrix. Thrown if any index indstRowRangeis outside the row bounds of the destination matrix. Thrown if any index indstColRangeis 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 ofsrcRowRange's length anddstRowRange's length. Within each row, the number of columns copied is the smaller ofsrcColRange's length anddstColRange's length. Any ofsrcRowRange's,srcColRange's,dstRowRange's, anddstColRange'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:
NullPointerException- (unchecked exception) Thrown if any argument is null.IndexOutOfBoundsException- (unchecked exception) Thrown if any index insrcRowRangeis outside the row bounds of the source matrix. Thrown if any index insrcColRangeis outside the column bounds of the source matrix. Thrown if any index indstRowRangeis outside the row bounds of the destination matrix. Thrown if any index indstColRangeis 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 ofsrcRowRange's length anddstRowRange's length. Within each row, the number of columns copied is the smaller ofsrcColRange's length anddstColRange's length. Any ofsrcRowRange's,srcColRange's,dstRowRange's, anddstColRange'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:
DT- Destination matrix element data type.ST- Array element data type that extends DT.- 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:
NullPointerException- (unchecked exception) Thrown if any argument is null.IndexOutOfBoundsException- (unchecked exception) Thrown if any index insrcRowRangeis outside the row bounds of the source matrix. Thrown if any index insrcColRangeis outside the column bounds of the source matrix. Thrown if any index indstRowRangeis outside the row bounds of the destination matrix. Thrown if any index indstColRangeis 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. Ifarrayis 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. Ifarrayis 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. Ifarrayis 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. Ifarrayis 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. Ifarrayis 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. Ifarrayis 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. Ifarrayis 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. Ifarrayis 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. Ifarrayis 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. Ifmatrixis 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. Ifmatrixis 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. Ifmatrixis 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. Ifmatrixis 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. Ifmatrixis 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. Ifmatrixis 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. Ifmatrixis 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. Ifmatrixis 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. Ifmatrixis 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. Ifmatrixis null or the given row is not allocated, 0 is returned.- Parameters:
matrix- Matrix.i- Row index.- Returns:
- Number of rows in
matrix. - Throws:
ArrayIndexOutOfBoundsException- (unchecked exception) Thrown ifiis 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. Ifmatrixis null or the given row is not allocated, 0 is returned.- Parameters:
matrix- Matrix.i- Row index.- Returns:
- Number of rows in
matrix. - Throws:
ArrayIndexOutOfBoundsException- (unchecked exception) Thrown ifiis 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. Ifmatrixis null or the given row is not allocated, 0 is returned.- Parameters:
matrix- Matrix.i- Row index.- Returns:
- Number of rows in
matrix. - Throws:
ArrayIndexOutOfBoundsException- (unchecked exception) Thrown ifiis 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. Ifmatrixis null or the given row is not allocated, 0 is returned.- Parameters:
matrix- Matrix.i- Row index.- Returns:
- Number of rows in
matrix. - Throws:
ArrayIndexOutOfBoundsException- (unchecked exception) Thrown ifiis 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. Ifmatrixis null or the given row is not allocated, 0 is returned.- Parameters:
matrix- Matrix.i- Row index.- Returns:
- Number of rows in
matrix. - Throws:
ArrayIndexOutOfBoundsException- (unchecked exception) Thrown ifiis 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. Ifmatrixis null or the given row is not allocated, 0 is returned.- Parameters:
matrix- Matrix.i- Row index.- Returns:
- Number of rows in
matrix. - Throws:
ArrayIndexOutOfBoundsException- (unchecked exception) Thrown ifiis 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. Ifmatrixis null or the given row is not allocated, 0 is returned.- Parameters:
matrix- Matrix.i- Row index.- Returns:
- Number of rows in
matrix. - Throws:
ArrayIndexOutOfBoundsException- (unchecked exception) Thrown ifiis 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. Ifmatrixis null or the given row is not allocated, 0 is returned.- Parameters:
matrix- Matrix.i- Row index.- Returns:
- Number of rows in
matrix. - Throws:
ArrayIndexOutOfBoundsException- (unchecked exception) Thrown ifiis 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. Ifmatrixis 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:
ArrayIndexOutOfBoundsException- (unchecked exception) Thrown ifiis out of bounds.
-