A
- PL
- ES
- element streamRS
- row/column stream.X
- public abstract class AbstractMatrix<A,PL,ES,RS,X extends AbstractMatrix<A,PL,ES,RS,X>>
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
int |
cols
Column length.
|
long |
count |
int |
rows
Row length.
|
Modifier and Type | Method and Description |
---|---|
A[] |
array() |
abstract X |
copy() |
abstract X |
copy(int fromRowIndex,
int toRowIndex) |
abstract X |
copy(int fromRowIndex,
int toRowIndex,
int fromColumnIndex,
int toColumnIndex) |
abstract PL |
flatten() |
<E extends java.lang.Exception> |
forEach(Try.IntBiConsumer<E> action)
for (int i = 0; i < rows; i++) {
for (int j = 0; j < cols; j++) {
action.accept(i, j);
}
}
|
boolean |
isEmpty() |
boolean |
isSameShape(X x) |
Stream<Stream<IntPair>> |
pointsC() |
Stream<Stream<IntPair>> |
pointsC(int fromColumnIndex,
int toColumnIndex) |
Stream<IntPair> |
pointsH() |
Stream<IntPair> |
pointsH(int rowIndex) |
Stream<IntPair> |
pointsH(int fromRowIndex,
int toRowIndex) |
Stream<IntPair> |
pointsLU2RD() |
Stream<Stream<IntPair>> |
pointsR() |
Stream<Stream<IntPair>> |
pointsR(int fromRowIndex,
int toRowIndex) |
Stream<IntPair> |
pointsRU2LD() |
Stream<IntPair> |
pointsV() |
Stream<IntPair> |
pointsV(int columnIndex) |
Stream<IntPair> |
pointsV(int fromColumnIndex,
int toColumnIndex) |
void |
println() |
abstract X |
repelem(int rowRepeats,
int colRepeats)
Repeat elements
rowRepeats times in row direction and colRepeats times in column direction. |
abstract X |
repmat(int rowRepeats,
int colRepeats)
Repeat this matrix
rowRepeats times in row direction and colRepeats times in column direction. |
X |
reshape(int newCols) |
abstract X |
reshape(int newRows,
int newCols) |
abstract X |
rotate180()
Rotate this matrix clockwise 180
|
abstract X |
rotate270()
Rotate this matrix clockwise 270
|
abstract X |
rotate90()
Rotate this matrix clockwise 90
|
abstract RS |
streamC() |
abstract RS |
streamC(int fromColumnIndex,
int toColumnIndex) |
abstract ES |
streamH() |
abstract ES |
streamH(int rowIndex) |
abstract ES |
streamH(int fromRowIndex,
int toRowIndex) |
abstract ES |
streamLU2RD() |
abstract RS |
streamR() |
abstract RS |
streamR(int fromRowIndex,
int toRowIndex) |
abstract ES |
streamRU2LD() |
abstract ES |
streamV() |
abstract ES |
streamV(int columnIndex) |
abstract ES |
streamV(int fromColumnIndex,
int toColumnIndex) |
abstract X |
transpose() |
public final int rows
public final int cols
public final long count
public A[] array()
public void println()
public boolean isEmpty()
public abstract X copy()
public abstract X copy(int fromRowIndex, int toRowIndex)
fromRowIndex
- toRowIndex
- public abstract X copy(int fromRowIndex, int toRowIndex, int fromColumnIndex, int toColumnIndex)
fromRowIndex
- toRowIndex
- fromColumnIndex
- toColumnIndex
- public abstract X rotate90()
public abstract X rotate180()
public abstract X rotate270()
public abstract X transpose()
public X reshape(int newCols)
public abstract X reshape(int newRows, int newCols)
public boolean isSameShape(X x)
public abstract X repelem(int rowRepeats, int colRepeats)
rowRepeats
times in row direction and colRepeats
times in column direction.rowRepeats
- colRepeats
- public abstract X repmat(int rowRepeats, int colRepeats)
rowRepeats
times in row direction and colRepeats
times in column direction.rowRepeats
- colRepeats
- public abstract PL flatten()
public <E extends java.lang.Exception> void forEach(Try.IntBiConsumer<E> action) throws E extends java.lang.Exception
for (int i = 0; i < rows; i++) {
for (int j = 0; j < cols; j++) {
action.accept(i, j);
}
}
action
- E
E extends java.lang.Exception
public abstract ES streamLU2RD()
public abstract ES streamRU2LD()
public abstract ES streamH()
public abstract ES streamH(int rowIndex)
public abstract ES streamH(int fromRowIndex, int toRowIndex)
public abstract ES streamV()
public abstract ES streamV(int columnIndex)
public abstract ES streamV(int fromColumnIndex, int toColumnIndex)
public abstract RS streamR()
public abstract RS streamR(int fromRowIndex, int toRowIndex)
public abstract RS streamC()
public abstract RS streamC(int fromColumnIndex, int toColumnIndex)