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