Class ReduceArrays
Note: The operations in class ReduceArrays are not multiple thread safe.
- Version:
- 20-Jun-2007
- Author:
- Alan Kaminsky
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
reduce
(boolean[][] src, Range srcRowRange, Range srcColRange, boolean[][] dst, Range dstRowRange, Range dstColRange, BooleanOp op) Combine a range of elements from one Boolean matrix with a range of elements in another Boolean matrix.static void
Combine a range of elements from one Boolean array with a range of elements in another Boolean array.static void
reduce
(byte[][] src, Range srcRowRange, Range srcColRange, byte[][] dst, Range dstRowRange, Range dstColRange, ByteOp op) Combine a range of elements from one byte matrix with a range of elements in another byte matrix.static void
Combine a range of elements from one byte array with a range of elements in another byte array.static void
reduce
(char[][] src, Range srcRowRange, Range srcColRange, char[][] dst, Range dstRowRange, Range dstColRange, CharacterOp op) Combine a range of elements from one character matrix with a range of elements in another character matrix.static void
reduce
(char[] src, Range srcRange, char[] dst, Range dstRange, CharacterOp op) Combine a range of elements from one character array with a range of elements in another character array.static void
reduce
(double[][] src, Range srcRowRange, Range srcColRange, double[][] dst, Range dstRowRange, Range dstColRange, DoubleOp op) Combine a range of elements from one double matrix with a range of elements in another double matrix.static void
Combine a range of elements from one double array with a range of elements in another double array.static void
reduce
(float[][] src, Range srcRowRange, Range srcColRange, float[][] dst, Range dstRowRange, Range dstColRange, FloatOp op) Combine a range of elements from one float matrix with a range of elements in another float matrix.static void
Combine a range of elements from one float array with a range of elements in another float array.static void
reduce
(int[][] src, Range srcRowRange, Range srcColRange, int[][] dst, Range dstRowRange, Range dstColRange, IntegerOp op) Combine a range of elements from one integer matrix with a range of elements in another integer matrix.static void
Combine a range of elements from one integer array with a range of elements in another integer array.static void
reduce
(long[][] src, Range srcRowRange, Range srcColRange, long[][] dst, Range dstRowRange, Range dstColRange, LongOp op) Combine a range of elements from one long matrix with a range of elements in another long matrix.static void
Combine a range of elements from one long array with a range of elements in another long array.static void
reduce
(short[][] src, Range srcRowRange, Range srcColRange, short[][] dst, Range dstRowRange, Range dstColRange, ShortOp op) Combine a range of elements from one short matrix with a range of elements in another short matrix.static void
Combine a range of elements from one short array with a range of elements in another short array.static <DT,
ST extends DT>
voidreduce
(ST[][] src, Range srcRowRange, Range srcColRange, DT[][] dst, Range dstRowRange, Range dstColRange, ObjectOp<DT> op) Combine a range of elements from one object matrix with a range of elements in another object matrix.static <DT,
ST extends DT>
voidCombine a range of elements from one object array with a range of elements in another object array.
-
Method Details
-
reduce
public static void reduce(boolean[] src, Range srcRange, boolean[] dst, Range dstRange, BooleanOp op) Combine a range of elements from one Boolean array with a range of elements in another Boolean array. The number of elements combined is the smaller ofsrcRange
's length anddstRange
's length. Either or both ofsrcRange
's anddstRange
's strides may be greater than 1.For each destination array element D in the destination range and each corresponding source array element S in the source range, D is set to D op S.
- Parameters:
src
- Source array.srcRange
- Range of source elements.dst
- Destination array.dstRange
- Range of destination elements.op
- Binary operation.- Throws:
NullPointerException
- (unchecked exception) Thrown if any argument is null.IndexOutOfBoundsException
- (unchecked exception) Thrown if any index insrcRange
is outside the bounds of the source array. Thrown if any index indstRange
is outside the bounds of the destination array.
-
reduce
Combine a range of elements from one byte array with a range of elements in another byte array. The number of elements combined is the smaller ofsrcRange
's length anddstRange
's length. Either or both ofsrcRange
's anddstRange
's strides may be greater than 1.For each destination array element D in the destination range and each corresponding source array element S in the source range, D is set to D op S.
- Parameters:
src
- Source array.srcRange
- Range of source elements.dst
- Destination array.dstRange
- Range of destination elements.op
- Binary operation.- Throws:
NullPointerException
- (unchecked exception) Thrown if any argument is null.IndexOutOfBoundsException
- (unchecked exception) Thrown if any index insrcRange
is outside the bounds of the source array. Thrown if any index indstRange
is outside the bounds of the destination array.
-
reduce
Combine a range of elements from one character array with a range of elements in another character array. The number of elements combined is the smaller ofsrcRange
's length anddstRange
's length. Either or both ofsrcRange
's anddstRange
's strides may be greater than 1.For each destination array element D in the destination range and each corresponding source array element S in the source range, D is set to D op S.
- Parameters:
src
- Source array.srcRange
- Range of source elements.dst
- Destination array.dstRange
- Range of destination elements.op
- Binary operation.- Throws:
NullPointerException
- (unchecked exception) Thrown if any argument is null.IndexOutOfBoundsException
- (unchecked exception) Thrown if any index insrcRange
is outside the bounds of the source array. Thrown if any index indstRange
is outside the bounds of the destination array.
-
reduce
Combine a range of elements from one double array with a range of elements in another double array. The number of elements combined is the smaller ofsrcRange
's length anddstRange
's length. Either or both ofsrcRange
's anddstRange
's strides may be greater than 1.For each destination array element D in the destination range and each corresponding source array element S in the source range, D is set to D op S.
- Parameters:
src
- Source array.srcRange
- Range of source elements.dst
- Destination array.dstRange
- Range of destination elements.op
- Binary operation.- Throws:
NullPointerException
- (unchecked exception) Thrown if any argument is null.IndexOutOfBoundsException
- (unchecked exception) Thrown if any index insrcRange
is outside the bounds of the source array. Thrown if any index indstRange
is outside the bounds of the destination array.
-
reduce
Combine a range of elements from one float array with a range of elements in another float array. The number of elements combined is the smaller ofsrcRange
's length anddstRange
's length. Either or both ofsrcRange
's anddstRange
's strides may be greater than 1.For each destination array element D in the destination range and each corresponding source array element S in the source range, D is set to D op S.
- Parameters:
src
- Source array.srcRange
- Range of source elements.dst
- Destination array.dstRange
- Range of destination elements.op
- Binary operation.- Throws:
NullPointerException
- (unchecked exception) Thrown if any argument is null.IndexOutOfBoundsException
- (unchecked exception) Thrown if any index insrcRange
is outside the bounds of the source array. Thrown if any index indstRange
is outside the bounds of the destination array.
-
reduce
Combine a range of elements from one integer array with a range of elements in another integer array. The number of elements combined is the smaller ofsrcRange
's length anddstRange
's length. Either or both ofsrcRange
's anddstRange
's strides may be greater than 1.For each destination array element D in the destination range and each corresponding source array element S in the source range, D is set to D op S.
- Parameters:
src
- Source array.srcRange
- Range of source elements.dst
- Destination array.dstRange
- Range of destination elements.op
- Binary operation.- Throws:
NullPointerException
- (unchecked exception) Thrown if any argument is null.IndexOutOfBoundsException
- (unchecked exception) Thrown if any index insrcRange
is outside the bounds of the source array. Thrown if any index indstRange
is outside the bounds of the destination array.
-
reduce
Combine a range of elements from one long array with a range of elements in another long array. The number of elements combined is the smaller ofsrcRange
's length anddstRange
's length. Either or both ofsrcRange
's anddstRange
's strides may be greater than 1.For each destination array element D in the destination range and each corresponding source array element S in the source range, D is set to D op S.
- Parameters:
src
- Source array.srcRange
- Range of source elements.dst
- Destination array.dstRange
- Range of destination elements.op
- Binary operation.- Throws:
NullPointerException
- (unchecked exception) Thrown if any argument is null.IndexOutOfBoundsException
- (unchecked exception) Thrown if any index insrcRange
is outside the bounds of the source array. Thrown if any index indstRange
is outside the bounds of the destination array.
-
reduce
Combine a range of elements from one short array with a range of elements in another short array. The number of elements combined is the smaller ofsrcRange
's length anddstRange
's length. Either or both ofsrcRange
's anddstRange
's strides may be greater than 1.For each destination array element D in the destination range and each corresponding source array element S in the source range, D is set to D op S.
- Parameters:
src
- Source array.srcRange
- Range of source elements.dst
- Destination array.dstRange
- Range of destination elements.op
- Binary operation.- Throws:
NullPointerException
- (unchecked exception) Thrown if any argument is null.IndexOutOfBoundsException
- (unchecked exception) Thrown if any index insrcRange
is outside the bounds of the source array. Thrown if any index indstRange
is outside the bounds of the destination array.
-
reduce
public static <DT,ST extends DT> void reduce(ST[] src, Range srcRange, DT[] dst, Range dstRange, ObjectOp<DT> op) Combine a range of elements from one object array with a range of elements in another object array. The number of elements combined is the smaller ofsrcRange
's length anddstRange
's length. Either or both ofsrcRange
's anddstRange
's strides may be greater than 1.For each destination array element D in the destination range and each corresponding source array element S in the source range, D is set to D op S.
- Type Parameters:
DT
- Destination array element data type.ST
- Data type that extends the destination matrix element data type.- Parameters:
src
- Source array.srcRange
- Range of source elements.dst
- Destination array.dstRange
- Range of destination elements.op
- Binary operation.- Throws:
NullPointerException
- (unchecked exception) Thrown if any argument is null.IndexOutOfBoundsException
- (unchecked exception) Thrown if any index insrcRange
is outside the bounds of the source array. Thrown if any index indstRange
is outside the bounds of the destination array.
-
reduce
public static void reduce(boolean[][] src, Range srcRowRange, Range srcColRange, boolean[][] dst, Range dstRowRange, Range dstColRange, BooleanOp op) Combine a range of elements from one Boolean matrix with a range of elements in another Boolean matrix. The number of rows combined is the smaller ofsrcRowRange
's length anddstRowRange
's length. Within each row, the number of columns combined 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.For each destination matrix element D in the destination row and column ranges and each corresponding source matrix element S in the source row and column ranges, D is set to D op S.
- 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.op
- Binary operation.- Throws:
NullPointerException
- (unchecked exception) Thrown if any argument is null.IndexOutOfBoundsException
- (unchecked exception) Thrown if any index insrcRowRange
is outside the row bounds of the source matrix. Thrown if any index insrcColRange
is outside the column bounds of the source matrix. Thrown if any index indstRowRange
is outside the row bounds of the destination matrix. Thrown if any index indstColRange
is outside the column bounds of the destination matrix.
-
reduce
public static void reduce(byte[][] src, Range srcRowRange, Range srcColRange, byte[][] dst, Range dstRowRange, Range dstColRange, ByteOp op) Combine a range of elements from one byte matrix with a range of elements in another byte matrix. The number of rows combined is the smaller ofsrcRowRange
's length anddstRowRange
's length. Within each row, the number of columns combined 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.For each destination matrix element D in the destination row and column ranges and each corresponding source matrix element S in the source row and column ranges, D is set to D op S.
- 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.op
- Binary operation.- Throws:
NullPointerException
- (unchecked exception) Thrown if any argument is null.IndexOutOfBoundsException
- (unchecked exception) Thrown if any index insrcRowRange
is outside the row bounds of the source matrix. Thrown if any index insrcColRange
is outside the column bounds of the source matrix. Thrown if any index indstRowRange
is outside the row bounds of the destination matrix. Thrown if any index indstColRange
is outside the column bounds of the destination matrix.
-
reduce
public static void reduce(char[][] src, Range srcRowRange, Range srcColRange, char[][] dst, Range dstRowRange, Range dstColRange, CharacterOp op) Combine a range of elements from one character matrix with a range of elements in another character matrix. The number of rows combined is the smaller ofsrcRowRange
's length anddstRowRange
's length. Within each row, the number of columns combined 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.For each destination matrix element D in the destination row and column ranges and each corresponding source matrix element S in the source row and column ranges, D is set to D op S.
- 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.op
- Binary operation.- Throws:
NullPointerException
- (unchecked exception) Thrown if any argument is null.IndexOutOfBoundsException
- (unchecked exception) Thrown if any index insrcRowRange
is outside the row bounds of the source matrix. Thrown if any index insrcColRange
is outside the column bounds of the source matrix. Thrown if any index indstRowRange
is outside the row bounds of the destination matrix. Thrown if any index indstColRange
is outside the column bounds of the destination matrix.
-
reduce
public static void reduce(double[][] src, Range srcRowRange, Range srcColRange, double[][] dst, Range dstRowRange, Range dstColRange, DoubleOp op) Combine a range of elements from one double matrix with a range of elements in another double matrix. The number of rows combined is the smaller ofsrcRowRange
's length anddstRowRange
's length. Within each row, the number of columns combined 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.op
- Binary operation.- Throws:
NullPointerException
- (unchecked exception) Thrown if any argument is null.IndexOutOfBoundsException
- (unchecked exception) Thrown if any index insrcRowRange
is outside the row bounds of the source matrix. Thrown if any index insrcColRange
is outside the column bounds of the source matrix. Thrown if any index indstRowRange
is outside the row bounds of the destination matrix. Thrown if any index indstColRange
is outside the column bounds of the destination matrix.
-
reduce
public static void reduce(float[][] src, Range srcRowRange, Range srcColRange, float[][] dst, Range dstRowRange, Range dstColRange, FloatOp op) Combine a range of elements from one float matrix with a range of elements in another float matrix. The number of rows combined is the smaller ofsrcRowRange
's length anddstRowRange
's length. Within each row, the number of columns combined 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.For each destination matrix element D in the destination row and column ranges and each corresponding source matrix element S in the source row and column ranges, D is set to D op S.
- 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.op
- Binary operation.- Throws:
NullPointerException
- (unchecked exception) Thrown if any argument is null.IndexOutOfBoundsException
- (unchecked exception) Thrown if any index insrcRowRange
is outside the row bounds of the source matrix. Thrown if any index insrcColRange
is outside the column bounds of the source matrix. Thrown if any index indstRowRange
is outside the row bounds of the destination matrix. Thrown if any index indstColRange
is outside the column bounds of the destination matrix.
-
reduce
public static void reduce(int[][] src, Range srcRowRange, Range srcColRange, int[][] dst, Range dstRowRange, Range dstColRange, IntegerOp op) Combine a range of elements from one integer matrix with a range of elements in another integer matrix. The number of rows combined is the smaller ofsrcRowRange
's length anddstRowRange
's length. Within each row, the number of columns combined 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.For each destination matrix element D in the destination row and column ranges and each corresponding source matrix element S in the source row and column ranges, D is set to D op S.
- 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.op
- Binary operation.- Throws:
NullPointerException
- (unchecked exception) Thrown if any argument is null.IndexOutOfBoundsException
- (unchecked exception) Thrown if any index insrcRowRange
is outside the row bounds of the source matrix. Thrown if any index insrcColRange
is outside the column bounds of the source matrix. Thrown if any index indstRowRange
is outside the row bounds of the destination matrix. Thrown if any index indstColRange
is outside the column bounds of the destination matrix.
-
reduce
public static void reduce(long[][] src, Range srcRowRange, Range srcColRange, long[][] dst, Range dstRowRange, Range dstColRange, LongOp op) Combine a range of elements from one long matrix with a range of elements in another long matrix. The number of rows combined is the smaller ofsrcRowRange
's length anddstRowRange
's length. Within each row, the number of columns combined 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.For each destination matrix element D in the destination row and column ranges and each corresponding source matrix element S in the source row and column ranges, D is set to D op S.
- 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.op
- Binary operation.- Throws:
NullPointerException
- (unchecked exception) Thrown if any argument is null.IndexOutOfBoundsException
- (unchecked exception) Thrown if any index insrcRowRange
is outside the row bounds of the source matrix. Thrown if any index insrcColRange
is outside the column bounds of the source matrix. Thrown if any index indstRowRange
is outside the row bounds of the destination matrix. Thrown if any index indstColRange
is outside the column bounds of the destination matrix.
-
reduce
public static void reduce(short[][] src, Range srcRowRange, Range srcColRange, short[][] dst, Range dstRowRange, Range dstColRange, ShortOp op) Combine a range of elements from one short matrix with a range of elements in another short matrix. The number of rows combined is the smaller ofsrcRowRange
's length anddstRowRange
's length. Within each row, the number of columns combined 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.For each destination matrix element D in the destination row and column ranges and each corresponding source matrix element S in the source row and column ranges, D is set to D op S.
- 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.op
- Binary operation.- Throws:
NullPointerException
- (unchecked exception) Thrown if any argument is null.IndexOutOfBoundsException
- (unchecked exception) Thrown if any index insrcRowRange
is outside the row bounds of the source matrix. Thrown if any index insrcColRange
is outside the column bounds of the source matrix. Thrown if any index indstRowRange
is outside the row bounds of the destination matrix. Thrown if any index indstColRange
is outside the column bounds of the destination matrix.
-
reduce
public static <DT,ST extends DT> void reduce(ST[][] src, Range srcRowRange, Range srcColRange, DT[][] dst, Range dstRowRange, Range dstColRange, ObjectOp<DT> op) Combine a range of elements from one object matrix with a range of elements in another object matrix. The number of rows combined is the smaller ofsrcRowRange
's length anddstRowRange
's length. Within each row, the number of columns combined 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.For each destination matrix element D in the destination row and column ranges and each corresponding source matrix element S in the source row and column ranges, D is set to D op S.
- Type Parameters:
DT
- Destination matrix element data type.ST
- Data type that extends the 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.op
- Binary operation.- Throws:
NullPointerException
- (unchecked exception) Thrown if any argument is null.IndexOutOfBoundsException
- (unchecked exception) Thrown if any index insrcRowRange
is outside the row bounds of the source matrix. Thrown if any index insrcColRange
is outside the column bounds of the source matrix. Thrown if any index indstRowRange
is outside the row bounds of the destination matrix. Thrown if any index indstColRange
is outside the column bounds of the destination matrix.
-