cols, count, rows
Constructor and Description |
---|
IntMatrix(int[][] a) |
Modifier and Type | Method and Description |
---|---|
IntMatrix |
add(IntMatrix b) |
Stream<Pair.IntPair> |
adjacent4Points(int i,
int j)
Returns the four adjacencies with order: up, right, down, left.
|
Stream<Pair.IntPair> |
adjacent8Points(int i,
int j)
Returns the eight adjacencies with order: left-up, up, right-up, right, right-down, down, left-down, left.
|
int[][] |
array() |
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) |
OptionalInt |
downOf(int i,
int j) |
static IntMatrix |
empty() |
boolean |
equals(java.lang.Object obj) |
void |
fill(int val) |
void |
fill(int[][] b) |
void |
fill(int fromRowIndex,
int fromColumnIndex,
int[][] b) |
IntList |
flatten() |
IntMatrix |
flipH() |
IntMatrix |
flipV() |
void |
forEach(IntConsumer action) |
void |
forEach(int fromRowIndex,
int toRowIndex,
int fromColumnIndex,
int toColumnIndex,
IntConsumer action) |
static IntMatrix |
from(byte[]... a) |
static IntMatrix |
from(char[]... a) |
static IntMatrix |
from(short[]... a) |
int |
get(int i,
int j) |
int |
get(Pair.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.vstack(b);
[[1, 2, 3, 7, 8, 9],
[4, 5, 6, 10, 11, 23]]
|
OptionalInt |
leftOf(int i,
int j) |
IntMatrix |
map(IntUnaryOperator func) |
<T> Matrix<T> |
mapToObj(java.lang.Class<T> cls,
IntFunction<? extends T> func) |
IntMatrix |
multiply(IntMatrix b) |
static IntMatrix |
of(int[]... a) |
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. |
void |
replaceIf(IntBiPredicate predicate,
int newValue)
Replace elements by
Predicate.test(i, j) based on points |
void |
replaceIf(IntPredicate 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() |
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(Pair.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() |
void |
updateAll(IntBiFunction<java.lang.Integer> func)
Update all elements based on points
|
void |
updateAll(IntUnaryOperator func) |
void |
updateColumn(int columnIndex,
IntUnaryOperator func) |
void |
updateLU2RD(IntUnaryOperator func) |
void |
updateRow(int rowIndex,
IntUnaryOperator func) |
void |
updateRU2LD(IntUnaryOperator func) |
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]]
|
IntMatrix |
zipWith(IntMatrix matrixB,
IntBiFunction<java.lang.Integer> zipFunction) |
IntMatrix |
zipWith(IntMatrix matrixB,
IntMatrix matrixC,
IntTriFunction<java.lang.Integer> zipFunction) |
isEmpty, isSameShape, pointsC, pointsC, pointsH, pointsH, pointsH, pointsLU2RD, pointsR, pointsR, pointsRU2LD, pointsV, pointsV, pointsV, println, 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[][] array()
public int get(int i, int j)
public int get(Pair.IntPair point)
public void set(int i, int j, int val)
public void set(Pair.IntPair point, int val)
public OptionalInt upOf(int i, int j)
public OptionalInt downOf(int i, int j)
public OptionalInt leftOf(int i, int j)
public OptionalInt rightOf(int i, int j)
public Stream<Pair.IntPair> adjacent4Points(int i, int j)
null
is set if the adjacency doesn't exist.i
- j
- public Stream<Pair.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 void updateRow(int rowIndex, IntUnaryOperator func)
public void updateColumn(int columnIndex, IntUnaryOperator func)
public int[] getLU2RD()
public void setLU2RD(int[] diagonal)
public void updateLU2RD(IntUnaryOperator func)
public int[] getRU2LD()
public void setRU2LD(int[] diagonal)
public void updateRU2LD(IntUnaryOperator func)
public void updateAll(IntUnaryOperator func)
public void updateAll(IntBiFunction<java.lang.Integer> func)
func
- public void replaceIf(IntPredicate predicate, int newValue)
public void replaceIf(IntBiPredicate predicate, int newValue)
Predicate.test(i, j)
based on pointspredicate
- newValue
- public IntMatrix map(IntUnaryOperator func)
public <T> Matrix<T> mapToObj(java.lang.Class<T> cls, IntFunction<? extends T> func)
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 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.public IntMatrix repmat(int rowRepeats, int colRepeats)
rowRepeats
times in row direction and colRepeats
times in column direction.public IntList flatten()
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.vstack(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 IntMatrix zipWith(IntMatrix matrixB, IntBiFunction<java.lang.Integer> zipFunction)
public IntMatrix zipWith(IntMatrix matrixB, IntMatrix matrixC, IntTriFunction<java.lang.Integer> zipFunction)
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 void forEach(IntConsumer action)
public void forEach(int fromRowIndex, int toRowIndex, int fromColumnIndex, int toColumnIndex, IntConsumer action)
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