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