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