cols, count, rows
Constructor and Description |
---|
IntMatrix(int[][] a) |
Modifier and Type | Method and Description |
---|---|
IntMatrix |
add(IntMatrix b) |
Stream<IntPair> |
adjacent4Points(int i,
int j)
Returns the four adjacencies with order: up, right, down, left.
|
Stream<IntPair> |
adjacent8Points(int i,
int j)
Returns the eight adjacencies with order: left-up, up, right-up, right, right-down, down, left-down, left.
|
Matrix<java.lang.Integer> |
boxed() |
int[] |
column(int columnIndex) |
IntMatrix |
copy() |
IntMatrix |
copy(int fromRowIndex,
int toRowIndex) |
IntMatrix |
copy(int fromRowIndex,
int toRowIndex,
int fromColumnIndex,
int toColumnIndex) |
static IntMatrix |
diagonal(int[] leftUp2RighDownDiagonal,
int[] rightUp2LeftDownDiagonal) |
static IntMatrix |
diagonalLU2RD(int[] leftUp2RighDownDiagonal) |
static IntMatrix |
diagonalRU2LD(int[] rightUp2LeftDownDiagonal) |
u.OptionalInt |
downOf(int i,
int j) |
static IntMatrix |
empty() |
boolean |
equals(java.lang.Object obj) |
IntMatrix |
extend(int newRows,
int newCols) |
IntMatrix |
extend(int newRows,
int newCols,
int defaultValueForNewCell) |
IntMatrix |
extend(int toUp,
int toDown,
int toLeft,
int toRight) |
IntMatrix |
extend(int toUp,
int toDown,
int toLeft,
int toRight,
int defaultValueForNewCell) |
void |
fill(int val) |
void |
fill(int[][] b) |
void |
fill(int fromRowIndex,
int fromColumnIndex,
int[][] b) |
<E extends java.lang.Exception> |
flatOp(Try.Consumer<int[],E> op)
flatten -> execute
op -> set values back. |
IntList |
flatten() |
IntMatrix |
flipH() |
IntMatrix |
flipV() |
<E extends java.lang.Exception> |
forEach(int fromRowIndex,
int toRowIndex,
int fromColumnIndex,
int toColumnIndex,
Try.IntConsumer<E> action) |
<E extends java.lang.Exception> |
forEach(Try.IntConsumer<E> action) |
static IntMatrix |
from(byte[]... a) |
static IntMatrix |
from(char[]... a) |
static IntMatrix |
from(short[]... a) |
int |
get(int i,
int j) |
int |
get(IntPair point) |
int[] |
getLU2RD() |
int[] |
getRU2LD() |
int |
hashCode() |
IntMatrix |
hstack(IntMatrix b)
IntMatrix a = IntMatrix.of({{1, 2, 3}, {4, 5, 6});
IntMatrix b = IntMatrix.of({{7, 8, 9}, {10, 11, 12});
IntMatrix c = a.hstack(b);
[[1, 2, 3, 7, 8, 9],
[4, 5, 6, 10, 11, 23]]
|
u.OptionalInt |
leftOf(int i,
int j) |
<E extends java.lang.Exception> |
map(Try.IntUnaryOperator<E> func) |
<T,E extends java.lang.Exception> |
mapToObj(java.lang.Class<T> cls,
Try.IntFunction<? extends T,E> func) |
IntMatrix |
multiply(IntMatrix b) |
static IntMatrix |
of(int[]... a) |
void |
println() |
static IntMatrix |
random(int len) |
static IntMatrix |
range(int startInclusive,
int endExclusive) |
static IntMatrix |
range(int startInclusive,
int endExclusive,
int by) |
static IntMatrix |
rangeClosed(int startInclusive,
int endInclusive) |
static IntMatrix |
rangeClosed(int startInclusive,
int endInclusive,
int by) |
static IntMatrix |
repeat(int val,
int len) |
IntMatrix |
repelem(int rowRepeats,
int colRepeats)
Repeat elements
rowRepeats times in row direction and colRepeats times in column direction. |
<E extends java.lang.Exception> |
replaceIf(Try.IntBiPredicate<E> predicate,
int newValue)
Replace elements by
Predicate.test(i, j) based on points |
<E extends java.lang.Exception> |
replaceIf(Try.IntPredicate<E> predicate,
int newValue) |
IntMatrix |
repmat(int rowRepeats,
int colRepeats)
Repeat this matrix
rowRepeats times in row direction and colRepeats times in column direction. |
IntMatrix |
reshape(int newRows,
int newCols) |
void |
reverseH() |
void |
reverseV() |
u.OptionalInt |
rightOf(int i,
int j) |
IntMatrix |
rotate180()
Rotate this matrix clockwise 180
|
IntMatrix |
rotate270()
Rotate this matrix clockwise 270
|
IntMatrix |
rotate90()
Rotate this matrix clockwise 90
|
int[] |
row(int rowIndex) |
void |
set(int i,
int j,
int val) |
void |
set(IntPair point,
int val) |
void |
setColumn(int columnIndex,
int[] column) |
void |
setLU2RD(int[] diagonal) |
void |
setRow(int rowIndex,
int[] row) |
void |
setRU2LD(int[] diagonal) |
Stream<IntStream> |
streamC() |
Stream<IntStream> |
streamC(int fromColumnIndex,
int toColumnIndex) |
IntStream |
streamH() |
IntStream |
streamH(int rowIndex) |
IntStream |
streamH(int fromRowIndex,
int toRowIndex) |
IntStream |
streamLU2RD() |
Stream<IntStream> |
streamR() |
Stream<IntStream> |
streamR(int fromRowIndex,
int toRowIndex) |
IntStream |
streamRU2LD() |
IntStream |
streamV() |
IntStream |
streamV(int columnIndex) |
IntStream |
streamV(int fromColumnIndex,
int toColumnIndex) |
IntMatrix |
subtract(IntMatrix b) |
DoubleMatrix |
toDoubleMatrix() |
FloatMatrix |
toFloatMatrix() |
LongMatrix |
toLongMatrix() |
java.lang.String |
toString() |
IntMatrix |
transpose() |
<E extends java.lang.Exception> |
updateAll(Try.IntBiFunction<java.lang.Integer,E> func)
Update all elements based on points
|
<E extends java.lang.Exception> |
updateAll(Try.IntUnaryOperator<E> func) |
<E extends java.lang.Exception> |
updateColumn(int columnIndex,
Try.IntUnaryOperator<E> func) |
<E extends java.lang.Exception> |
updateLU2RD(Try.IntUnaryOperator<E> func) |
<E extends java.lang.Exception> |
updateRow(int rowIndex,
Try.IntUnaryOperator<E> func) |
<E extends java.lang.Exception> |
updateRU2LD(Try.IntUnaryOperator<E> func) |
u.OptionalInt |
upOf(int i,
int j) |
IntMatrix |
vstack(IntMatrix b)
IntMatrix a = IntMatrix.of({{1, 2, 3}, {4, 5, 6});
IntMatrix b = IntMatrix.of({{7, 8, 9}, {10, 11, 12});
IntMatrix c = a.vstack(b);
[[1, 2, 3],
[4, 5, 6],
[7, 8, 9],
[10, 11, 12]]
|
<E extends java.lang.Exception> |
zipWith(IntMatrix matrixB,
IntMatrix matrixC,
Try.IntTriFunction<java.lang.Integer,E> zipFunction) |
<E extends java.lang.Exception> |
zipWith(IntMatrix matrixB,
Try.IntBiFunction<java.lang.Integer,E> zipFunction) |
array, forEach, isEmpty, isSameShape, pointsC, pointsC, pointsH, pointsH, pointsH, pointsLU2RD, pointsR, pointsR, pointsRU2LD, pointsV, pointsV, pointsV, reshape
public static IntMatrix empty()
@SafeVarargs public static IntMatrix of(int[]... a)
@SafeVarargs public static IntMatrix from(char[]... a)
@SafeVarargs public static IntMatrix from(byte[]... a)
@SafeVarargs public static IntMatrix from(short[]... a)
public static IntMatrix random(int len)
public static IntMatrix repeat(int val, int len)
public static IntMatrix range(int startInclusive, int endExclusive)
public static IntMatrix range(int startInclusive, int endExclusive, int by)
public static IntMatrix rangeClosed(int startInclusive, int endInclusive)
public static IntMatrix rangeClosed(int startInclusive, int endInclusive, int by)
public static IntMatrix diagonalLU2RD(int[] leftUp2RighDownDiagonal)
public static IntMatrix diagonalRU2LD(int[] rightUp2LeftDownDiagonal)
public static IntMatrix diagonal(int[] leftUp2RighDownDiagonal, int[] rightUp2LeftDownDiagonal)
public int get(int i, int j)
public int get(IntPair point)
public void set(int i, int j, int val)
public void set(IntPair point, int val)
public u.OptionalInt upOf(int i, int j)
public u.OptionalInt downOf(int i, int j)
public u.OptionalInt leftOf(int i, int j)
public u.OptionalInt rightOf(int i, int j)
public Stream<IntPair> adjacent4Points(int i, int j)
null
is set if the adjacency doesn't exist.i
- j
- public Stream<IntPair> adjacent8Points(int i, int j)
null
is set if the adjacency doesn't exist.i
- j
- public int[] row(int rowIndex)
public int[] column(int columnIndex)
public void setRow(int rowIndex, int[] row)
public void setColumn(int columnIndex, int[] column)
public <E extends java.lang.Exception> void updateRow(int rowIndex, Try.IntUnaryOperator<E> func) throws E extends java.lang.Exception
E extends java.lang.Exception
public <E extends java.lang.Exception> void updateColumn(int columnIndex, Try.IntUnaryOperator<E> func) throws E extends java.lang.Exception
E extends java.lang.Exception
public int[] getLU2RD()
public void setLU2RD(int[] diagonal)
public <E extends java.lang.Exception> void updateLU2RD(Try.IntUnaryOperator<E> func) throws E extends java.lang.Exception
E extends java.lang.Exception
public int[] getRU2LD()
public void setRU2LD(int[] diagonal)
public <E extends java.lang.Exception> void updateRU2LD(Try.IntUnaryOperator<E> func) throws E extends java.lang.Exception
E extends java.lang.Exception
public <E extends java.lang.Exception> void updateAll(Try.IntUnaryOperator<E> func) throws E extends java.lang.Exception
E extends java.lang.Exception
public <E extends java.lang.Exception> void updateAll(Try.IntBiFunction<java.lang.Integer,E> func) throws E extends java.lang.Exception
func
- E extends java.lang.Exception
public <E extends java.lang.Exception> void replaceIf(Try.IntPredicate<E> predicate, int newValue) throws E extends java.lang.Exception
E extends java.lang.Exception
public <E extends java.lang.Exception> void replaceIf(Try.IntBiPredicate<E> predicate, int newValue) throws E extends java.lang.Exception
Predicate.test(i, j)
based on pointspredicate
- newValue
- E extends java.lang.Exception
public <E extends java.lang.Exception> IntMatrix map(Try.IntUnaryOperator<E> func) throws E extends java.lang.Exception
E extends java.lang.Exception
public <T,E extends java.lang.Exception> Matrix<T> mapToObj(java.lang.Class<T> cls, Try.IntFunction<? extends T,E> func) throws E extends java.lang.Exception
E extends java.lang.Exception
public void fill(int val)
public void fill(int[][] b)
public void fill(int fromRowIndex, int fromColumnIndex, int[][] b)
public IntMatrix copy()
public IntMatrix copy(int fromRowIndex, int toRowIndex)
public IntMatrix copy(int fromRowIndex, int toRowIndex, int fromColumnIndex, int toColumnIndex)
public IntMatrix extend(int newRows, int newCols)
public IntMatrix extend(int newRows, int newCols, int defaultValueForNewCell)
public IntMatrix extend(int toUp, int toDown, int toLeft, int toRight)
public IntMatrix extend(int toUp, int toDown, int toLeft, int toRight, int defaultValueForNewCell)
public void reverseH()
public void reverseV()
public IntMatrix flipH()
public IntMatrix flipV()
public IntMatrix rotate90()
AbstractMatrix
public IntMatrix rotate180()
AbstractMatrix
public IntMatrix rotate270()
AbstractMatrix
public IntMatrix transpose()
public IntMatrix reshape(int newRows, int newCols)
public IntMatrix repelem(int rowRepeats, int colRepeats)
rowRepeats
times in row direction and colRepeats
times in column direction.repelem
in class AbstractMatrix<int[],IntList,IntStream,Stream<IntStream>,IntMatrix>
rowRepeats
- colRepeats
- public IntMatrix repmat(int rowRepeats, int colRepeats)
rowRepeats
times in row direction and colRepeats
times in column direction.repmat
in class AbstractMatrix<int[],IntList,IntStream,Stream<IntStream>,IntMatrix>
rowRepeats
- colRepeats
- public IntList flatten()
public <E extends java.lang.Exception> void flatOp(Try.Consumer<int[],E> op) throws E extends java.lang.Exception
AbstractMatrix
op
-> set values back.
matrix.flatOp(a -> N.sort(a));
public IntMatrix vstack(IntMatrix b)
IntMatrix a = IntMatrix.of({{1, 2, 3}, {4, 5, 6});
IntMatrix b = IntMatrix.of({{7, 8, 9}, {10, 11, 12});
IntMatrix c = a.vstack(b);
[[1, 2, 3],
[4, 5, 6],
[7, 8, 9],
[10, 11, 12]]
b
- public IntMatrix hstack(IntMatrix b)
IntMatrix a = IntMatrix.of({{1, 2, 3}, {4, 5, 6});
IntMatrix b = IntMatrix.of({{7, 8, 9}, {10, 11, 12});
IntMatrix c = a.hstack(b);
[[1, 2, 3, 7, 8, 9],
[4, 5, 6, 10, 11, 23]]
b
- public Matrix<java.lang.Integer> boxed()
public LongMatrix toLongMatrix()
public FloatMatrix toFloatMatrix()
public DoubleMatrix toDoubleMatrix()
public <E extends java.lang.Exception> IntMatrix zipWith(IntMatrix matrixB, Try.IntBiFunction<java.lang.Integer,E> zipFunction) throws E extends java.lang.Exception
E extends java.lang.Exception
public <E extends java.lang.Exception> IntMatrix zipWith(IntMatrix matrixB, IntMatrix matrixC, Try.IntTriFunction<java.lang.Integer,E> zipFunction) throws E extends java.lang.Exception
E extends java.lang.Exception
public IntStream streamLU2RD()
streamLU2RD
in class AbstractMatrix<int[],IntList,IntStream,Stream<IntStream>,IntMatrix>
public IntStream streamRU2LD()
streamRU2LD
in class AbstractMatrix<int[],IntList,IntStream,Stream<IntStream>,IntMatrix>
public IntStream streamH()
public IntStream streamH(int rowIndex)
public IntStream streamH(int fromRowIndex, int toRowIndex)
@Beta public IntStream streamV()
public IntStream streamV(int columnIndex)
@Beta public IntStream streamV(int fromColumnIndex, int toColumnIndex)
public <E extends java.lang.Exception> void forEach(Try.IntConsumer<E> action) throws E extends java.lang.Exception
E extends java.lang.Exception
public <E extends java.lang.Exception> void forEach(int fromRowIndex, int toRowIndex, int fromColumnIndex, int toColumnIndex, Try.IntConsumer<E> action) throws E extends java.lang.Exception
E extends java.lang.Exception
public void println()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object