public final class ByteMatrix extends AbstractMatrix<byte[],ByteList,ByteStream,Stream<ByteStream>,ByteMatrix>
cols, count, rows
Constructor and Description |
---|
ByteMatrix(byte[][] a) |
Modifier and Type | Method and Description |
---|---|
ByteMatrix |
add(ByteMatrix 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.
|
byte[][] |
array() |
Matrix<java.lang.Byte> |
boxed() |
byte[] |
column(int columnIndex) |
ByteMatrix |
copy() |
ByteMatrix |
copy(int fromRowIndex,
int toRowIndex) |
ByteMatrix |
copy(int fromRowIndex,
int toRowIndex,
int fromColumnIndex,
int toColumnIndex) |
static ByteMatrix |
diagonal(byte[] leftUp2RighDownDiagonal,
byte[] rightUp2LeftDownDiagonal) |
static ByteMatrix |
diagonalLU2RD(byte[] leftUp2RighDownDiagonal) |
static ByteMatrix |
diagonalRU2LD(byte[] rightUp2LeftDownDiagonal) |
OptionalByte |
downOf(int i,
int j) |
static ByteMatrix |
empty() |
boolean |
equals(java.lang.Object obj) |
void |
fill(byte val) |
void |
fill(byte[][] b) |
void |
fill(int fromRowIndex,
int fromColumnIndex,
byte[][] b) |
ByteList |
flatten() |
ByteMatrix |
flipH() |
ByteMatrix |
flipV() |
void |
forEach(ByteConsumer action) |
void |
forEach(int fromRowIndex,
int toRowIndex,
int fromColumnIndex,
int toColumnIndex,
ByteConsumer action) |
byte |
get(int i,
int j) |
byte |
get(Pair.IntPair point) |
byte[] |
getLU2RD() |
byte[] |
getRU2LD() |
int |
hashCode() |
ByteMatrix |
hstack(ByteMatrix b) |
OptionalByte |
leftOf(int i,
int j) |
ByteMatrix |
map(ByteUnaryOperator func) |
<T> Matrix<T> |
mapToObj(java.lang.Class<T> cls,
ByteFunction<? extends T> func) |
ByteMatrix |
multiply(ByteMatrix b) |
static ByteMatrix |
of(byte[]... a) |
static ByteMatrix |
random(int len) |
static ByteMatrix |
range(byte startInclusive,
byte endExclusive) |
static ByteMatrix |
range(byte startInclusive,
byte endExclusive,
byte by) |
static ByteMatrix |
rangeClosed(byte startInclusive,
byte endInclusive) |
static ByteMatrix |
rangeClosed(byte startInclusive,
byte endInclusive,
byte by) |
static ByteMatrix |
repeat(byte val,
int len) |
ByteMatrix |
repelem(int rowRepeats,
int colRepeats)
Repeat elements
rowRepeats times in row direction and colRepeats times in column direction. |
void |
replaceIf(BytePredicate predicate,
byte newValue) |
void |
replaceIf(IntBiPredicate predicate,
byte newValue)
Replace elements by
Predicate.test(i, j) based on points |
ByteMatrix |
repmat(int rowRepeats,
int colRepeats)
Repeat this matrix
rowRepeats times in row direction and colRepeats times in column direction. |
ByteMatrix |
reshape(int newRows,
int newCols) |
void |
reverseH() |
void |
reverseV() |
OptionalByte |
rightOf(int i,
int j) |
ByteMatrix |
rotate180()
Rotate this matrix clockwise 180
|
ByteMatrix |
rotate270()
Rotate this matrix clockwise 270
|
ByteMatrix |
rotate90()
Rotate this matrix clockwise 90
|
byte[] |
row(int rowIndex) |
void |
set(int i,
int j,
byte val) |
void |
set(Pair.IntPair point,
byte val) |
void |
setColumn(int columnIndex,
byte[] column) |
void |
setLU2RD(byte[] diagonal) |
void |
setRow(int rowIndex,
byte[] row) |
void |
setRU2LD(byte[] diagonal) |
Stream<ByteStream> |
streamC() |
Stream<ByteStream> |
streamC(int fromColumnIndex,
int toColumnIndex) |
ByteStream |
streamH() |
ByteStream |
streamH(int rowIndex) |
ByteStream |
streamH(int fromRowIndex,
int toRowIndex) |
ByteStream |
streamLU2RD() |
Stream<ByteStream> |
streamR() |
Stream<ByteStream> |
streamR(int fromRowIndex,
int toRowIndex) |
ByteStream |
streamRU2LD() |
ByteStream |
streamV() |
ByteStream |
streamV(int columnIndex) |
ByteStream |
streamV(int fromColumnIndex,
int toColumnIndex) |
ByteMatrix |
subtract(ByteMatrix b) |
DoubleMatrix |
toDoubleMatrix() |
FloatMatrix |
toFloatMatrix() |
IntMatrix |
toIntMatrix() |
LongMatrix |
toLongMatrix() |
java.lang.String |
toString() |
ByteMatrix |
transpose() |
void |
updateAll(ByteUnaryOperator func) |
void |
updateAll(IntBiFunction<java.lang.Byte> func)
Update all elements based on points
|
void |
updateColumn(int columnIndex,
ByteUnaryOperator func) |
void |
updateLU2RD(ByteUnaryOperator func) |
void |
updateRow(int rowIndex,
ByteUnaryOperator func) |
void |
updateRU2LD(ByteUnaryOperator func) |
OptionalByte |
upOf(int i,
int j) |
ByteMatrix |
vstack(ByteMatrix b) |
ByteMatrix |
zipWith(ByteMatrix matrixB,
ByteBiFunction<java.lang.Byte> zipFunction) |
ByteMatrix |
zipWith(ByteMatrix matrixB,
ByteMatrix matrixC,
ByteTriFunction<java.lang.Byte> zipFunction) |
isEmpty, isSameShape, pointsC, pointsC, pointsH, pointsH, pointsH, pointsLU2RD, pointsR, pointsR, pointsRU2LD, pointsV, pointsV, pointsV, println, reshape
public static ByteMatrix empty()
@SafeVarargs public static ByteMatrix of(byte[]... a)
public static ByteMatrix random(int len)
public static ByteMatrix repeat(byte val, int len)
public static ByteMatrix range(byte startInclusive, byte endExclusive)
public static ByteMatrix range(byte startInclusive, byte endExclusive, byte by)
public static ByteMatrix rangeClosed(byte startInclusive, byte endInclusive)
public static ByteMatrix rangeClosed(byte startInclusive, byte endInclusive, byte by)
public static ByteMatrix diagonalLU2RD(byte[] leftUp2RighDownDiagonal)
public static ByteMatrix diagonalRU2LD(byte[] rightUp2LeftDownDiagonal)
public static ByteMatrix diagonal(byte[] leftUp2RighDownDiagonal, byte[] rightUp2LeftDownDiagonal)
public byte[][] array()
public byte get(int i, int j)
public byte get(Pair.IntPair point)
public void set(int i, int j, byte val)
public void set(Pair.IntPair point, byte val)
public OptionalByte upOf(int i, int j)
public OptionalByte downOf(int i, int j)
public OptionalByte leftOf(int i, int j)
public OptionalByte 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 byte[] row(int rowIndex)
public byte[] column(int columnIndex)
public void setRow(int rowIndex, byte[] row)
public void setColumn(int columnIndex, byte[] column)
public void updateRow(int rowIndex, ByteUnaryOperator func)
public void updateColumn(int columnIndex, ByteUnaryOperator func)
public byte[] getLU2RD()
public void setLU2RD(byte[] diagonal)
public void updateLU2RD(ByteUnaryOperator func)
public byte[] getRU2LD()
public void setRU2LD(byte[] diagonal)
public void updateRU2LD(ByteUnaryOperator func)
public void updateAll(ByteUnaryOperator func)
public void updateAll(IntBiFunction<java.lang.Byte> func)
func
- public void replaceIf(BytePredicate predicate, byte newValue)
public void replaceIf(IntBiPredicate predicate, byte newValue)
Predicate.test(i, j)
based on pointspredicate
- newValue
- public ByteMatrix map(ByteUnaryOperator func)
public <T> Matrix<T> mapToObj(java.lang.Class<T> cls, ByteFunction<? extends T> func)
public void fill(byte val)
public void fill(byte[][] b)
public void fill(int fromRowIndex, int fromColumnIndex, byte[][] b)
public ByteMatrix copy()
copy
in class AbstractMatrix<byte[],ByteList,ByteStream,Stream<ByteStream>,ByteMatrix>
public ByteMatrix copy(int fromRowIndex, int toRowIndex)
copy
in class AbstractMatrix<byte[],ByteList,ByteStream,Stream<ByteStream>,ByteMatrix>
public ByteMatrix copy(int fromRowIndex, int toRowIndex, int fromColumnIndex, int toColumnIndex)
copy
in class AbstractMatrix<byte[],ByteList,ByteStream,Stream<ByteStream>,ByteMatrix>
public void reverseH()
public void reverseV()
public ByteMatrix flipH()
public ByteMatrix flipV()
public ByteMatrix rotate90()
AbstractMatrix
rotate90
in class AbstractMatrix<byte[],ByteList,ByteStream,Stream<ByteStream>,ByteMatrix>
public ByteMatrix rotate180()
AbstractMatrix
rotate180
in class AbstractMatrix<byte[],ByteList,ByteStream,Stream<ByteStream>,ByteMatrix>
public ByteMatrix rotate270()
AbstractMatrix
rotate270
in class AbstractMatrix<byte[],ByteList,ByteStream,Stream<ByteStream>,ByteMatrix>
public ByteMatrix transpose()
transpose
in class AbstractMatrix<byte[],ByteList,ByteStream,Stream<ByteStream>,ByteMatrix>
public ByteMatrix reshape(int newRows, int newCols)
reshape
in class AbstractMatrix<byte[],ByteList,ByteStream,Stream<ByteStream>,ByteMatrix>
public ByteMatrix repelem(int rowRepeats, int colRepeats)
rowRepeats
times in row direction and colRepeats
times in column direction.repelem
in class AbstractMatrix<byte[],ByteList,ByteStream,Stream<ByteStream>,ByteMatrix>
rowRepeats
- colRepeats
- public ByteMatrix repmat(int rowRepeats, int colRepeats)
rowRepeats
times in row direction and colRepeats
times in column direction.repmat
in class AbstractMatrix<byte[],ByteList,ByteStream,Stream<ByteStream>,ByteMatrix>
rowRepeats
- colRepeats
- public ByteList flatten()
flatten
in class AbstractMatrix<byte[],ByteList,ByteStream,Stream<ByteStream>,ByteMatrix>
public ByteMatrix vstack(ByteMatrix b)
b
- IntMatrix.vstack(IntMatrix)
public ByteMatrix hstack(ByteMatrix b)
b
- IntMatrix.hstack(IntMatrix)
public ByteMatrix add(ByteMatrix b)
public ByteMatrix subtract(ByteMatrix b)
public ByteMatrix multiply(ByteMatrix b)
public Matrix<java.lang.Byte> boxed()
public IntMatrix toIntMatrix()
public LongMatrix toLongMatrix()
public FloatMatrix toFloatMatrix()
public DoubleMatrix toDoubleMatrix()
public ByteMatrix zipWith(ByteMatrix matrixB, ByteBiFunction<java.lang.Byte> zipFunction)
public ByteMatrix zipWith(ByteMatrix matrixB, ByteMatrix matrixC, ByteTriFunction<java.lang.Byte> zipFunction)
public ByteStream streamLU2RD()
streamLU2RD
in class AbstractMatrix<byte[],ByteList,ByteStream,Stream<ByteStream>,ByteMatrix>
public ByteStream streamRU2LD()
streamRU2LD
in class AbstractMatrix<byte[],ByteList,ByteStream,Stream<ByteStream>,ByteMatrix>
public ByteStream streamH()
streamH
in class AbstractMatrix<byte[],ByteList,ByteStream,Stream<ByteStream>,ByteMatrix>
public ByteStream streamH(int rowIndex)
streamH
in class AbstractMatrix<byte[],ByteList,ByteStream,Stream<ByteStream>,ByteMatrix>
public ByteStream streamH(int fromRowIndex, int toRowIndex)
streamH
in class AbstractMatrix<byte[],ByteList,ByteStream,Stream<ByteStream>,ByteMatrix>
fromRowIndex
- toRowIndex
- @Beta public ByteStream streamV()
streamV
in class AbstractMatrix<byte[],ByteList,ByteStream,Stream<ByteStream>,ByteMatrix>
public ByteStream streamV(int columnIndex)
streamV
in class AbstractMatrix<byte[],ByteList,ByteStream,Stream<ByteStream>,ByteMatrix>
@Beta public ByteStream streamV(int fromColumnIndex, int toColumnIndex)
streamV
in class AbstractMatrix<byte[],ByteList,ByteStream,Stream<ByteStream>,ByteMatrix>
fromColumnIndex
- toColumnIndex
- public Stream<ByteStream> streamR()
streamR
in class AbstractMatrix<byte[],ByteList,ByteStream,Stream<ByteStream>,ByteMatrix>
public Stream<ByteStream> streamR(int fromRowIndex, int toRowIndex)
streamR
in class AbstractMatrix<byte[],ByteList,ByteStream,Stream<ByteStream>,ByteMatrix>
fromRowIndex
- toRowIndex
- @Beta public Stream<ByteStream> streamC()
streamC
in class AbstractMatrix<byte[],ByteList,ByteStream,Stream<ByteStream>,ByteMatrix>
@Beta public Stream<ByteStream> streamC(int fromColumnIndex, int toColumnIndex)
streamC
in class AbstractMatrix<byte[],ByteList,ByteStream,Stream<ByteStream>,ByteMatrix>
fromColumnIndex
- toColumnIndex
- public void forEach(ByteConsumer action)
public void forEach(int fromRowIndex, int toRowIndex, int fromColumnIndex, int toColumnIndex, ByteConsumer 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