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<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.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) |
DoubleMatrix |
extend(int newRows,
int newCols) |
DoubleMatrix |
extend(int newRows,
int newCols,
double defaultValueForNewCell) |
DoubleMatrix |
extend(int toUp,
int toDown,
int toLeft,
int toRight) |
DoubleMatrix |
extend(int toUp,
int toDown,
int toLeft,
int toRight,
double defaultValueForNewCell) |
void |
fill(double val) |
void |
fill(double[][] b) |
void |
fill(int fromRowIndex,
int fromColumnIndex,
double[][] b) |
DoubleList |
flatten() |
DoubleMatrix |
flipH() |
DoubleMatrix |
flipV() |
<E extends java.lang.Exception> |
forEach(int fromRowIndex,
int toRowIndex,
int fromColumnIndex,
int toColumnIndex,
Try.DoubleConsumer<E> action) |
<E extends java.lang.Exception> |
forEach(Try.DoubleConsumer<E> action) |
static DoubleMatrix |
from(float[]... a) |
static DoubleMatrix |
from(int[]... a) |
static DoubleMatrix |
from(long[]... a) |
double |
get(int i,
int j) |
double |
get(IntPair point) |
double[] |
getLU2RD() |
double[] |
getRU2LD() |
int |
hashCode() |
DoubleMatrix |
hstack(DoubleMatrix b) |
OptionalDouble |
leftOf(int i,
int j) |
<E extends java.lang.Exception> |
map(Try.DoubleUnaryOperator<E> func) |
<T,E extends java.lang.Exception> |
mapToObj(java.lang.Class<T> cls,
Try.DoubleFunction<? extends T,E> 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. |
<E extends java.lang.Exception> |
replaceIf(Try.DoublePredicate<E> predicate,
double newValue) |
<E extends java.lang.Exception> |
replaceIf(Try.IntBiPredicate<E> 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(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() |
<E extends java.lang.Exception> |
updateAll(Try.DoubleUnaryOperator<E> func) |
<E extends java.lang.Exception> |
updateAll(Try.IntBiFunction<java.lang.Double,E> func)
Update all elements based on points
|
<E extends java.lang.Exception> |
updateColumn(int columnIndex,
Try.DoubleUnaryOperator<E> func) |
<E extends java.lang.Exception> |
updateLU2RD(Try.DoubleUnaryOperator<E> func) |
<E extends java.lang.Exception> |
updateRow(int rowIndex,
Try.DoubleUnaryOperator<E> func) |
<E extends java.lang.Exception> |
updateRU2LD(Try.DoubleUnaryOperator<E> func) |
OptionalDouble |
upOf(int i,
int j) |
DoubleMatrix |
vstack(DoubleMatrix b) |
<E extends java.lang.Exception> |
zipWith(DoubleMatrix matrixB,
DoubleMatrix matrixC,
Try.DoubleTriFunction<java.lang.Double,E> zipFunction) |
<E extends java.lang.Exception> |
zipWith(DoubleMatrix matrixB,
Try.DoubleBiFunction<java.lang.Double,E> zipFunction) |
array, forEach, 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 get(int i, int j)
public double get(IntPair point)
public void set(int i, int j, double val)
public void set(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<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 double[] row(int rowIndex)
public double[] column(int columnIndex)
public void setRow(int rowIndex, double[] row)
public void setColumn(int columnIndex, double[] column)
public <E extends java.lang.Exception> void updateRow(int rowIndex, Try.DoubleUnaryOperator<E> func) throws E extends java.lang.Exception
E extends java.lang.Exception
public <E extends java.lang.Exception> void updateColumn(int columnIndex, Try.DoubleUnaryOperator<E> func) throws E extends java.lang.Exception
E extends java.lang.Exception
public double[] getLU2RD()
public void setLU2RD(double[] diagonal)
public <E extends java.lang.Exception> void updateLU2RD(Try.DoubleUnaryOperator<E> func) throws E extends java.lang.Exception
E extends java.lang.Exception
public double[] getRU2LD()
public void setRU2LD(double[] diagonal)
public <E extends java.lang.Exception> void updateRU2LD(Try.DoubleUnaryOperator<E> func) throws E extends java.lang.Exception
E extends java.lang.Exception
public <E extends java.lang.Exception> void updateAll(Try.DoubleUnaryOperator<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.Double,E> func) throws E extends java.lang.Exception
func
- E extends java.lang.Exception
public <E extends java.lang.Exception> void replaceIf(Try.DoublePredicate<E> predicate, double newValue) throws E extends java.lang.Exception
E extends java.lang.Exception
public <E extends java.lang.Exception> void replaceIf(Try.IntBiPredicate<E> predicate, double 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> DoubleMatrix map(Try.DoubleUnaryOperator<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.DoubleFunction<? extends T,E> func) throws E extends java.lang.Exception
E extends java.lang.Exception
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 DoubleMatrix extend(int newRows, int newCols)
public DoubleMatrix extend(int newRows, int newCols, double defaultValueForNewCell)
public DoubleMatrix extend(int toUp, int toDown, int toLeft, int toRight)
public DoubleMatrix extend(int toUp, int toDown, int toLeft, int toRight, double defaultValueForNewCell)
public void reverseH()
public void reverseV()
public DoubleMatrix flipH()
IntMatrix.flipH()
public DoubleMatrix flipV()
IntMatrix.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
- IntMatrix.repelem(int, int)
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
- IntMatrix.repmat(int, int)
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 <E extends java.lang.Exception> DoubleMatrix zipWith(DoubleMatrix matrixB, Try.DoubleBiFunction<java.lang.Double,E> zipFunction) throws E extends java.lang.Exception
E extends java.lang.Exception
public <E extends java.lang.Exception> DoubleMatrix zipWith(DoubleMatrix matrixB, DoubleMatrix matrixC, Try.DoubleTriFunction<java.lang.Double,E> zipFunction) throws E extends java.lang.Exception
E extends java.lang.Exception
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 <E extends java.lang.Exception> void forEach(Try.DoubleConsumer<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.DoubleConsumer<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