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<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.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) |
ShortMatrix |
extend(int newRows,
int newCols) |
ShortMatrix |
extend(int toUp,
int toDown,
int toLeft,
int toRight) |
ShortMatrix |
extend(int toUp,
int toDown,
int toLeft,
int toRight,
short defaultValueForNewCell) |
ShortMatrix |
extend(int newRows,
int newCols,
short defaultValueForNewCell) |
void |
fill(int fromRowIndex,
int fromColumnIndex,
short[][] b) |
void |
fill(short val) |
void |
fill(short[][] b) |
ShortList |
flatten() |
ShortMatrix |
flipH() |
ShortMatrix |
flipV() |
<E extends java.lang.Exception> |
forEach(int fromRowIndex,
int toRowIndex,
int fromColumnIndex,
int toColumnIndex,
Try.ShortConsumer<E> action) |
<E extends java.lang.Exception> |
forEach(Try.ShortConsumer<E> action) |
short |
get(int i,
int j) |
short |
get(IntPair point) |
short[] |
getLU2RD() |
short[] |
getRU2LD() |
int |
hashCode() |
ShortMatrix |
hstack(ShortMatrix b) |
OptionalShort |
leftOf(int i,
int j) |
<E extends java.lang.Exception> |
map(Try.ShortUnaryOperator<E> func) |
<T,E extends java.lang.Exception> |
mapToObj(java.lang.Class<T> cls,
Try.ShortFunction<? extends T,E> 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. |
<E extends java.lang.Exception> |
replaceIf(Try.IntBiPredicate<E> predicate,
short newValue)
Replace elements by
Predicate.test(i, j) based on points |
<E extends java.lang.Exception> |
replaceIf(Try.ShortPredicate<E> 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(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() |
<E extends java.lang.Exception> |
updateAll(Try.IntBiFunction<java.lang.Short,E> func)
Update all elements based on points
|
<E extends java.lang.Exception> |
updateAll(Try.ShortUnaryOperator<E> func) |
<E extends java.lang.Exception> |
updateColumn(int columnIndex,
Try.ShortUnaryOperator<E> func) |
<E extends java.lang.Exception> |
updateLU2RD(Try.ShortUnaryOperator<E> func) |
<E extends java.lang.Exception> |
updateRow(int rowIndex,
Try.ShortUnaryOperator<E> func) |
<E extends java.lang.Exception> |
updateRU2LD(Try.ShortUnaryOperator<E> func) |
OptionalShort |
upOf(int i,
int j) |
ShortMatrix |
vstack(ShortMatrix b) |
<E extends java.lang.Exception> |
zipWith(ShortMatrix matrixB,
ShortMatrix matrixC,
Try.ShortTriFunction<java.lang.Short,E> zipFunction) |
<E extends java.lang.Exception> |
zipWith(ShortMatrix matrixB,
Try.ShortBiFunction<java.lang.Short,E> zipFunction) |
array, forEach, 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 get(int i, int j)
public short get(IntPair point)
public void set(int i, int j, short val)
public void set(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<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 short[] row(int rowIndex)
public short[] column(int columnIndex)
public void setRow(int rowIndex, short[] row)
public void setColumn(int columnIndex, short[] column)
public <E extends java.lang.Exception> void updateRow(int rowIndex, Try.ShortUnaryOperator<E> func) throws E extends java.lang.Exception
E extends java.lang.Exception
public <E extends java.lang.Exception> void updateColumn(int columnIndex, Try.ShortUnaryOperator<E> func) throws E extends java.lang.Exception
E extends java.lang.Exception
public short[] getLU2RD()
public void setLU2RD(short[] diagonal)
public <E extends java.lang.Exception> void updateLU2RD(Try.ShortUnaryOperator<E> func) throws E extends java.lang.Exception
E extends java.lang.Exception
public short[] getRU2LD()
public void setRU2LD(short[] diagonal)
public <E extends java.lang.Exception> void updateRU2LD(Try.ShortUnaryOperator<E> func) throws E extends java.lang.Exception
E extends java.lang.Exception
public <E extends java.lang.Exception> void updateAll(Try.ShortUnaryOperator<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.Short,E> func) throws E extends java.lang.Exception
func
- E extends java.lang.Exception
public <E extends java.lang.Exception> void replaceIf(Try.ShortPredicate<E> predicate, short newValue) throws E extends java.lang.Exception
E extends java.lang.Exception
public <E extends java.lang.Exception> void replaceIf(Try.IntBiPredicate<E> predicate, short 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> ShortMatrix map(Try.ShortUnaryOperator<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.ShortFunction<? extends T,E> func) throws E extends java.lang.Exception
E extends java.lang.Exception
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 ShortMatrix extend(int newRows, int newCols)
public ShortMatrix extend(int newRows, int newCols, short defaultValueForNewCell)
public ShortMatrix extend(int toUp, int toDown, int toLeft, int toRight)
public ShortMatrix extend(int toUp, int toDown, int toLeft, int toRight, short defaultValueForNewCell)
public void reverseH()
public void reverseV()
public ShortMatrix flipH()
IntMatrix.flipH()
public ShortMatrix flipV()
IntMatrix.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
- IntMatrix.repelem(int, int)
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
- IntMatrix.repmat(int, int)
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 <E extends java.lang.Exception> ShortMatrix zipWith(ShortMatrix matrixB, Try.ShortBiFunction<java.lang.Short,E> zipFunction) throws E extends java.lang.Exception
E extends java.lang.Exception
public <E extends java.lang.Exception> ShortMatrix zipWith(ShortMatrix matrixB, ShortMatrix matrixC, Try.ShortTriFunction<java.lang.Short,E> zipFunction) throws E extends java.lang.Exception
E extends java.lang.Exception
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 <E extends java.lang.Exception> void forEach(Try.ShortConsumer<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.ShortConsumer<E> action) throws E extends java.lang.Exception
E extends java.lang.Exception
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