public class DiagonalMatrix extends AbstractRealMatrix implements SymmetricMatrix, Serializable
MathUnsupportedOperationException
.
This class is up-to-date with commons-math 3.6.1.
Constructor and Description |
---|
DiagonalMatrix(double[] d)
Creates a matrix using the input array as the underlying data.
|
DiagonalMatrix(double[] d,
boolean copyArray)
Creates a matrix using the input array as the underlying data.
|
DiagonalMatrix(int dimension)
Creates a matrix with the supplied dimension.
|
Modifier and Type | Method and Description |
---|---|
DiagonalMatrix |
add(DiagonalMatrix m)
Compute the sum of
this and m . |
RealMatrix |
add(RealMatrix m)
Returns the sum of
this and m . |
SymmetricMatrix |
add(SymmetricMatrix m)
Adds a
SymmetricMatrix to this matrix. |
void |
addToEntry(int row,
int column,
double increment)
Adds (in place) the specified value to the specified entry of
this matrix. |
DiagonalMatrix |
copy()
Returns a (deep) copy of this.
|
void |
copySubMatrix(int[] selectedRows,
int[] selectedColumns,
double[][] destination)
Copy a submatrix.
|
void |
copySubMatrix(int startRow,
int endRow,
int startColumn,
int endColumn,
double[][] destination)
Copy a submatrix.
|
DiagonalMatrix |
createMatrix(int rowDimension,
int columnDimension)
Create a new RealMatrix of the same type as the instance with the
supplied
row and column dimensions.
|
boolean |
equals(Object object)
Returns true iff
object is a RealMatrix instance with the same dimensions as this
and all corresponding matrix entries are equal. |
int |
getColumnDimension()
Returns the number of columns of this matrix.
|
RealMatrix |
getColumnMatrix(int column)
Get the entries at the given column index as a column matrix.
|
double[][] |
getData()
Returns matrix entries as a two-dimensional array.
|
double[] |
getDataRef()
Gets a reference to the underlying data array.
|
double |
getEntry(int row,
int column)
Get the entry in the specified row and column.
|
double |
getFrobeniusNorm()
Returns the
Frobenius norm of the matrix.
|
DiagonalMatrix |
getInverse()
Optimized method for
DiagonalMatrix matrix. |
DiagonalMatrix |
getInverse(Decomposition decomposition)
Optimized method for
DiagonalMatrix matrix. |
double |
getNorm()
Returns the
maximum absolute row sum norm of the matrix.
|
int |
getRowDimension()
Returns the number of rows of this matrix.
|
RealMatrix |
getRowMatrix(int row)
Get the entries at the given row index as a row matrix.
|
RealMatrix |
getSubMatrix(int[] selectedRows,
int[] selectedColumns)
Gets a submatrix.
|
RealMatrix |
getSubMatrix(int startRow,
int endRow,
int startColumn,
int endColumn)
Gets a submatrix.
|
int |
hashCode()
Computes a hashcode for the diagonal matrix.
|
boolean |
isAntisymmetric(double zeroDiagonalThreshold)
Checks if this is a antisymmetric matrix
|
boolean |
isDiagonal(double threshold)
Given a threshold, is this a diagonal matrix?
|
boolean |
isInvertible(double threshold)
Given a threshold, is this an invertible matrix?
|
boolean |
isOrthogonal(double thresholdNorm,
double thresholdOrthogonality)
Given a threshold, is this an orthogonal matrix?
|
boolean |
isSingular()
Returns whether this diagonal matrix is singular, i.e. any diagonal entry is equal to
0 within the
Precision.DOUBLE_COMPARISON_EPSILON threshold. |
boolean |
isSquare()
Is this a square matrix?
|
boolean |
isSymmetric()
Checks if this is a symmetric matrix
|
boolean |
isSymmetric(double relativeSymmetryThreshold)
Checks if this is a symmetric matrix
|
DiagonalMatrix |
multiply(DiagonalMatrix m)
Returns the result of postmultiplying this × m.
|
DiagonalMatrix |
multiply(DiagonalMatrix m,
boolean toTranspose)
Returns the result of postmultiplying this × m (independently from the
toTranspose
parameter value as we use diagonal matrix). |
DiagonalMatrix |
multiply(DiagonalMatrix m,
boolean toTranspose,
double d)
Returns the result of postmultiplying d × this × m (independently from the
toTranspose parameter value as we use diagonal matrix). |
RealMatrix |
multiply(RealMatrix m)
Returns the result of postmultiplying
this by m . |
RealMatrix |
multiply(RealMatrix m,
boolean toTranspose)
Returns the result of postmultiplying this × m (if
isTranspose = false )
or this × mT (if isTranspose = true ) |
RealMatrix |
multiply(RealMatrix m,
boolean toTranspose,
double d)
Returns the result of postmultiplying d × this × m (if
toTranspose = false
) or d × this × mT (if toTranspose = true ) |
void |
multiplyEntry(int row,
int column,
double factor)
Multiplies (in place) the specified entry of
this matrix by the
specified value. |
double[] |
operate(double[] v)
Returns the result of multiplying this by the vector
v . |
DiagonalMatrix |
permutation(int[] index)
Permute the rows/columns of this matrix according to a new specified index order list.
|
DiagonalMatrix |
power(int p)
Returns the result of multiplying
this with itself p times. |
double[] |
preMultiply(double[] v)
Returns the (row) vector result of premultiplying this by the vector
v . |
RealVector |
preMultiply(RealVector v)
Returns the (row) vector result of premultiplying this by the vector
v . |
SymmetricMatrix |
quadraticMultiplication(RealMatrix m)
Gets the result of the quadratic multiplication M×S×MT, where S is
this matrix and M is the provided matrix.
|
SymmetricMatrix |
quadraticMultiplication(RealMatrix m,
boolean isTranspose)
Gets the result of the quadratic multiplication M×S×MT, where S is
this matrix and M or MT is the provided matrix.
|
SymmetricMatrix |
scalarAdd(double d)
Returns the result of adding
d to each entry of this . |
DiagonalMatrix |
scalarMultiply(double d)
Returns the result of multiplying each entry of
this by d . |
void |
setEntry(int row,
int column,
double value)
Set the entry in the specified row and column.
|
void |
setSubMatrix(double[][] subMatrix,
int row,
int column)
The method systematically throws a
MathUnsupportedOperationException as this operation is not safe when
we deal with a DiagonalMatrix . |
DiagonalMatrix |
subtract(DiagonalMatrix m)
Returns
this minus m . |
RealMatrix |
subtract(RealMatrix m)
Returns
this minus m . |
SymmetricMatrix |
subtract(SymmetricMatrix m)
Subtracts a
SymmetricMatrix from this matrix. |
DiagonalMatrix |
transpose()
Returns the transpose of this matrix.
|
double |
walkInColumnOrder(RealMatrixChangingVisitor visitor)
Visit (and possibly change) all matrix entries in column order.
|
double |
walkInColumnOrder(RealMatrixChangingVisitor visitor,
int startRow,
int endRow,
int startColumn,
int endColumn)
Visit (and possibly change) some matrix entries in column order.
|
double |
walkInColumnOrder(RealMatrixPreservingVisitor visitor)
Visit (but don't change) all matrix entries in column order.
|
double |
walkInColumnOrder(RealMatrixPreservingVisitor visitor,
int startRow,
int endRow,
int startColumn,
int endColumn)
Visit (but don't change) some matrix entries in column order.
|
double |
walkInRowOrder(RealMatrixChangingVisitor visitor)
Visit (and possibly change) all matrix entries in row order.
|
double |
walkInRowOrder(RealMatrixChangingVisitor visitor,
int startRow,
int endRow,
int startColumn,
int endColumn)
Visit (and possibly change) some matrix entries in row order.
|
double |
walkInRowOrder(RealMatrixPreservingVisitor visitor)
Visit (but don't change) all matrix entries in row order.
|
double |
walkInRowOrder(RealMatrixPreservingVisitor visitor,
int startRow,
int endRow,
int startColumn,
int endColumn)
Visit (but don't change) some matrix entries in row order.
|
concatenateDiagonally, concatenateHorizontally, concatenateVertically, equals, getColumn, getColumnVector, getDefaultDecomposition, getRow, getRowVector, getTrace, isSymmetric, operate, preMultiply, setColumn, setColumnMatrix, setColumnVector, setDefaultDecomposition, setRow, setRowMatrix, setRowVector, toString, toString, walkInOptimizedOrder, walkInOptimizedOrder, walkInOptimizedOrder, walkInOptimizedOrder
isTransposable, operateTranspose
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
concatenateDiagonally, concatenateHorizontally, concatenateVertically, equals, getColumn, getColumnVector, getDefaultDecomposition, getRow, getRowVector, getTrace, isSymmetric, operate, preMultiply, setColumn, setColumnMatrix, setColumnVector, setDefaultDecomposition, setRow, setRowMatrix, setRowVector, toString, walkInOptimizedOrder, walkInOptimizedOrder, walkInOptimizedOrder, walkInOptimizedOrder
public DiagonalMatrix(int dimension)
dimension
- Number of rows and columns in the new matrix.NotStrictlyPositiveException
- if the dimension is
not positive.public DiagonalMatrix(double[] d)
d
- Data for the new matrix.NullArgumentException
- if d
is null
.public DiagonalMatrix(double[] d, boolean copyArray)
copyArray
may be
set to false
.
This will prevent the copying and improve performance as no new
array will be built and no data will be copied.d
- Data for new matrix.copyArray
- if true
, the input array will be copied,
otherwise it will be referenced.NullArgumentException
- if d
is null
.public DiagonalMatrix createMatrix(int rowDimension, int columnDimension)
createMatrix
in interface RealMatrix
createMatrix
in class AbstractRealMatrix
rowDimension
- the number of rows in the new matrixcolumnDimension
- the number of columns in the new matrixDimensionMismatchException
- if the requested dimensions are not equal.public RealMatrix add(RealMatrix m)
this
and m
.add
in interface RealMatrix
add
in class AbstractRealMatrix
m
- matrix to be addedthis + m
public SymmetricMatrix add(SymmetricMatrix m)
SymmetricMatrix
to this matrix.add
in interface SymmetricMatrix
m
- the matrix to addpublic DiagonalMatrix add(DiagonalMatrix m)
this
and m
.m
- Matrix to be added.this + m
.MatrixDimensionMismatchException
- if m
is not the same
size as this
.public RealMatrix subtract(RealMatrix m)
this
minus m
.subtract
in interface RealMatrix
subtract
in class AbstractRealMatrix
m
- matrix to be subtractedthis - m
public SymmetricMatrix subtract(SymmetricMatrix m)
SymmetricMatrix
from this matrix.subtract
in interface SymmetricMatrix
m
- the matrix to subtractpublic DiagonalMatrix subtract(DiagonalMatrix m)
this
minus m
.m
- Matrix to be subtracted.this - m
MatrixDimensionMismatchException
- if m
is not the same
size as this
.public SymmetricMatrix scalarAdd(double d)
d
to each entry of this
.
Returns a ArrayRowSymmetricMatrix
since the matrix is symmetric.
scalarAdd
in interface RealMatrix
scalarAdd
in interface SymmetricMatrix
scalarAdd
in class AbstractRealMatrix
d
- value to be added to each entryd + this
public RealMatrix multiply(RealMatrix m)
this
by m
.multiply
in interface RealMatrix
multiply
in class AbstractRealMatrix
m
- matrix to postmultiply bythis * m
public RealMatrix multiply(RealMatrix m, boolean toTranspose)
isTranspose = false
)
or this × mT (if isTranspose = true
)multiply
in interface RealMatrix
multiply
in class AbstractRealMatrix
m
- matrix to postmultiply bytoTranspose
- if true, assumes the provided matrix is MT, otherwise assumes it is Mpublic RealMatrix multiply(RealMatrix m, boolean toTranspose, double d)
toTranspose = false
) or d × this × mT (if toTranspose = true
)multiply
in interface RealMatrix
multiply
in class AbstractRealMatrix
m
- matrix to postmultiply bytoTranspose
- indication value, true if we expect the m
matrix to be transposedd
- value to multiply all entries bypublic DiagonalMatrix multiply(DiagonalMatrix m)
m
- matrix to postmultiply bythis * m
DimensionMismatchException
- if matrices are not multiplication compatiblepublic DiagonalMatrix multiply(DiagonalMatrix m, boolean toTranspose)
toTranspose
parameter value as we use diagonal matrix).
Optimized method for diagonal matrix.m
- matrix to postmultiply bytoTranspose
- no used value for diagonal matrixthis * m
or @return this * m.transposed
DimensionMismatchException
- if matrices are not multiplication compatiblepublic DiagonalMatrix multiply(DiagonalMatrix m, boolean toTranspose, double d)
toTranspose
parameter value as we use diagonal matrix).
Optimized method for diagonal matrix.multiply
in class AbstractRealMatrix
m
- matrix to postmultiply bytoTranspose
- no used value for diagonal matrixd
- value to multiply all entries byDimensionMismatchException
- if matrices are not multiplication compatiblepublic DiagonalMatrix scalarMultiply(double d)
this
by d
.scalarMultiply
in interface RealMatrix
scalarMultiply
in interface SymmetricMatrix
scalarMultiply
in class AbstractRealMatrix
d
- value to multiply all entries byd * this
public DiagonalMatrix getInverse()
DiagonalMatrix
matrix.getInverse
in interface RealMatrix
getInverse
in interface SymmetricMatrix
getInverse
in class AbstractRealMatrix
SingularMatrixException
- if the decomposed matrix is singular.public DiagonalMatrix getInverse(Decomposition decomposition)
DiagonalMatrix
matrix.
The input Decomposition
isn't used.getInverse
in interface RealMatrix
getInverse
in interface SymmetricMatrix
getInverse
in class AbstractRealMatrix
decomposition
- decomposed matrixSingularMatrixException
- if the decomposed matrix is singular.public boolean isSingular()
0
within the
Precision.DOUBLE_COMPARISON_EPSILON
threshold.true
if the matrix is singular, false
otherwisepublic boolean isOrthogonal(double thresholdNorm, double thresholdOrthogonality)
isOrthogonal
in interface RealMatrix
isOrthogonal
in class AbstractRealMatrix
thresholdNorm
- : allowed relative error with respect to the normality of
the vectorsthresholdOrthogonality
- : allowed absolute error with respect to the mutual
orthogonality of the vectorspublic boolean isDiagonal(double threshold)
isDiagonal
in interface RealMatrix
isDiagonal
in class AbstractRealMatrix
threshold
- : allowed absolute error on non diagonal elementspublic boolean isSquare()
isSquare
in interface AnyMatrix
isSquare
in class AbstractRealMatrix
public boolean isSymmetric()
Matrix is considered symmetric if no cross-term violates default absolute and relative thresholds (
both Precision.DOUBLE_COMPARISON_EPSILON
).
isSymmetric
in interface RealMatrix
isSymmetric
in class AbstractRealMatrix
public boolean isSymmetric(double relativeSymmetryThreshold)
Matrix is considered symmetric if no cross-term violates provided relative threshold and 0 absolute threshold.
isSymmetric
in interface RealMatrix
isSymmetric
in class AbstractRealMatrix
relativeSymmetryThreshold
- relative threshold above which off-diagonal
elements are considered too different and matrix not symmetricpublic boolean isAntisymmetric(double zeroDiagonalThreshold)
isAntisymmetric
in interface RealMatrix
isAntisymmetric
in class AbstractRealMatrix
zeroDiagonalThreshold
- the threshold used in
comparisons to zero for the diagonal valuespublic DiagonalMatrix transpose()
transpose
in interface RealMatrix
transpose
in interface SymmetricMatrix
transpose
in class AbstractRealMatrix
public boolean isInvertible(double threshold)
isInvertible
in interface RealMatrix
isInvertible
in class AbstractRealMatrix
threshold
- : allowed relative error on the column vectors independencepublic double[][] getData()
getData
in interface RealMatrix
getData
in class AbstractRealMatrix
public double[] getDataRef()
public void setSubMatrix(double[][] subMatrix, int row, int column)
MathUnsupportedOperationException
as this operation is not safe when
we deal with a DiagonalMatrix
.setSubMatrix
in interface RealMatrix
setSubMatrix
in class AbstractRealMatrix
subMatrix
- array containing the submatrix replacement datarow
- row coordinate of the top, left element to be replacedcolumn
- column coordinate of the top, left element to be replacedMathUnsupportedOperationException
- systematically, since this operation is not supportedpublic double getEntry(int row, int column)
getEntry
in interface RealMatrix
getEntry
in class AbstractRealMatrix
row
- Row index of entry to be fetched.column
- Column index of entry to be fetched.(row, column)
.public void setEntry(int row, int column, double value)
setEntry
in interface RealMatrix
setEntry
in class AbstractRealMatrix
row
- Row index of entry to be set.column
- Column index of entry to be set.value
- the new value of the entry.MathUnsupportedOperationException
- if row != column
.public void addToEntry(int row, int column, double increment)
this
matrix. Row and column indices start
at 0.addToEntry
in interface RealMatrix
addToEntry
in class AbstractRealMatrix
row
- Row index of the entry to be modified.column
- Column index of the entry to be modified.increment
- value to add to the matrix entry.MathUnsupportedOperationException
- if row != column
.public void multiplyEntry(int row, int column, double factor)
this
matrix by the
specified value. Row and column indices start at 0.multiplyEntry
in interface RealMatrix
multiplyEntry
in class AbstractRealMatrix
row
- Row index of the entry to be modified.column
- Column index of the entry to be modified.factor
- Multiplication factor for the matrix entry.MathUnsupportedOperationException
- if row != column
.public DiagonalMatrix power(int p)
this
with itself p
times. Depending on the underlying storage,
instability for high powers
might occur.power
in interface RealMatrix
power
in interface SymmetricMatrix
power
in class AbstractRealMatrix
p
- raise this
to power p
this^p
public int getRowDimension()
getRowDimension
in interface AnyMatrix
getRowDimension
in class AbstractRealMatrix
public int getColumnDimension()
getColumnDimension
in interface AnyMatrix
getColumnDimension
in class AbstractRealMatrix
public double[] operate(double[] v)
v
.operate
in interface RealMatrix
operate
in class AbstractRealMatrix
v
- the vector to operate onthis * v
public double[] preMultiply(double[] v)
v
.preMultiply
in interface RealMatrix
preMultiply
in class AbstractRealMatrix
v
- the row vector to premultiply byv * this
public RealVector preMultiply(RealVector v)
v
.preMultiply
in interface RealMatrix
preMultiply
in class AbstractRealMatrix
v
- the row vector to premultiply byv * this
public SymmetricMatrix quadraticMultiplication(RealMatrix m)
quadraticMultiplication
in interface SymmetricMatrix
m
- the matrix Mpublic SymmetricMatrix quadraticMultiplication(RealMatrix m, boolean isTranspose)
quadraticMultiplication
in interface SymmetricMatrix
m
- the matrix M or the matrix MTisTranspose
- if true, assume the provided matrix is MT, otherwise assumes it is Mpublic DiagonalMatrix permutation(int[] index)
The index list must be the same dimension as the matrix and each index must be represented.
Usage example : 1 2 3 2 3 1 1 [lambda1, mu, gamma] 2 [lambda2, beta, mu] 2 [ mu, lambda2, beta] --> {2,3,1} --> 3 [ beta, lambda3, gamma] 3 [ gamma, beta, lambda3] 1 [ mu, gamma, lambda1]
permutation
in interface SymmetricMatrix
index
- Index list of the expected permutationpublic RealMatrix getRowMatrix(int row)
getRowMatrix
in interface RealMatrix
getRowMatrix
in class AbstractRealMatrix
row
- Row to be fetched.public RealMatrix getColumnMatrix(int column)
getColumnMatrix
in interface RealMatrix
getColumnMatrix
in class AbstractRealMatrix
column
- Column to be fetched.public void copySubMatrix(int startRow, int endRow, int startColumn, int endColumn, double[][] destination)
copySubMatrix
in interface RealMatrix
copySubMatrix
in class AbstractRealMatrix
startRow
- Initial row indexendRow
- Final row index (inclusive)startColumn
- Initial column indexendColumn
- Final column index (inclusive)destination
- The arrays where the submatrix data should be copied
(if larger than rows/columns counts, only the upper-left part will be
used)public void copySubMatrix(int[] selectedRows, int[] selectedColumns, double[][] destination)
copySubMatrix
in interface RealMatrix
copySubMatrix
in class AbstractRealMatrix
selectedRows
- Array of row indices.selectedColumns
- Array of column indices.destination
- The arrays where the submatrix data should be copied
(if larger than rows/columns counts, only the upper-left part will be
used)public double walkInRowOrder(RealMatrixChangingVisitor visitor)
Row order starts at upper left and iterating through all elements of a row from left to right before going to the leftmost element of the next row.
walkInRowOrder
in interface RealMatrix
walkInRowOrder
in class AbstractRealMatrix
visitor
- visitor used to process all matrix entriesRealMatrixChangingVisitor.end()
at the end
of the walkRealMatrix.walkInRowOrder(RealMatrixPreservingVisitor)
,
RealMatrix.walkInRowOrder(RealMatrixChangingVisitor, int, int, int, int)
,
RealMatrix.walkInRowOrder(RealMatrixPreservingVisitor, int, int, int, int)
,
RealMatrix.walkInColumnOrder(RealMatrixChangingVisitor)
,
RealMatrix.walkInColumnOrder(RealMatrixPreservingVisitor)
,
RealMatrix.walkInColumnOrder(RealMatrixChangingVisitor, int, int, int, int)
,
RealMatrix.walkInColumnOrder(RealMatrixPreservingVisitor, int, int, int, int)
,
RealMatrix.walkInOptimizedOrder(RealMatrixChangingVisitor)
,
RealMatrix.walkInOptimizedOrder(RealMatrixPreservingVisitor)
,
RealMatrix.walkInOptimizedOrder(RealMatrixChangingVisitor, int, int, int, int)
,
RealMatrix.walkInOptimizedOrder(RealMatrixPreservingVisitor, int, int, int, int)
public double walkInRowOrder(RealMatrixPreservingVisitor visitor)
Row order starts at upper left and iterating through all elements of a row from left to right before going to the leftmost element of the next row.
walkInRowOrder
in interface RealMatrix
walkInRowOrder
in class AbstractRealMatrix
visitor
- visitor used to process all matrix entriesRealMatrixPreservingVisitor.end()
at the end
of the walkRealMatrix.walkInRowOrder(RealMatrixChangingVisitor)
,
RealMatrix.walkInRowOrder(RealMatrixChangingVisitor, int, int, int, int)
,
RealMatrix.walkInRowOrder(RealMatrixPreservingVisitor, int, int, int, int)
,
RealMatrix.walkInColumnOrder(RealMatrixChangingVisitor)
,
RealMatrix.walkInColumnOrder(RealMatrixPreservingVisitor)
,
RealMatrix.walkInColumnOrder(RealMatrixChangingVisitor, int, int, int, int)
,
RealMatrix.walkInColumnOrder(RealMatrixPreservingVisitor, int, int, int, int)
,
RealMatrix.walkInOptimizedOrder(RealMatrixChangingVisitor)
,
RealMatrix.walkInOptimizedOrder(RealMatrixPreservingVisitor)
,
RealMatrix.walkInOptimizedOrder(RealMatrixChangingVisitor, int, int, int, int)
,
RealMatrix.walkInOptimizedOrder(RealMatrixPreservingVisitor, int, int, int, int)
public double walkInRowOrder(RealMatrixChangingVisitor visitor, int startRow, int endRow, int startColumn, int endColumn)
Row order starts at upper left and iterating through all elements of a row from left to right before going to the leftmost element of the next row.
walkInRowOrder
in interface RealMatrix
walkInRowOrder
in class AbstractRealMatrix
visitor
- visitor used to process all matrix entriesstartRow
- Initial row indexendRow
- Final row index (inclusive)startColumn
- Initial column indexendColumn
- Final column indexRealMatrixChangingVisitor.end()
at the end
of the walkRealMatrix.walkInRowOrder(RealMatrixChangingVisitor)
,
RealMatrix.walkInRowOrder(RealMatrixPreservingVisitor)
,
RealMatrix.walkInRowOrder(RealMatrixPreservingVisitor, int, int, int, int)
,
RealMatrix.walkInColumnOrder(RealMatrixChangingVisitor)
,
RealMatrix.walkInColumnOrder(RealMatrixPreservingVisitor)
,
RealMatrix.walkInColumnOrder(RealMatrixChangingVisitor, int, int, int, int)
,
RealMatrix.walkInColumnOrder(RealMatrixPreservingVisitor, int, int, int, int)
,
RealMatrix.walkInOptimizedOrder(RealMatrixChangingVisitor)
,
RealMatrix.walkInOptimizedOrder(RealMatrixPreservingVisitor)
,
RealMatrix.walkInOptimizedOrder(RealMatrixChangingVisitor, int, int, int, int)
,
RealMatrix.walkInOptimizedOrder(RealMatrixPreservingVisitor, int, int, int, int)
public double walkInRowOrder(RealMatrixPreservingVisitor visitor, int startRow, int endRow, int startColumn, int endColumn)
Row order starts at upper left and iterating through all elements of a row from left to right before going to the leftmost element of the next row.
walkInRowOrder
in interface RealMatrix
walkInRowOrder
in class AbstractRealMatrix
visitor
- visitor used to process all matrix entriesstartRow
- Initial row indexendRow
- Final row index (inclusive)startColumn
- Initial column indexendColumn
- Final column indexRealMatrixPreservingVisitor.end()
at the end
of the walkRealMatrix.walkInRowOrder(RealMatrixChangingVisitor)
,
RealMatrix.walkInRowOrder(RealMatrixPreservingVisitor)
,
RealMatrix.walkInRowOrder(RealMatrixChangingVisitor, int, int, int, int)
,
RealMatrix.walkInColumnOrder(RealMatrixChangingVisitor)
,
RealMatrix.walkInColumnOrder(RealMatrixPreservingVisitor)
,
RealMatrix.walkInColumnOrder(RealMatrixChangingVisitor, int, int, int, int)
,
RealMatrix.walkInColumnOrder(RealMatrixPreservingVisitor, int, int, int, int)
,
RealMatrix.walkInOptimizedOrder(RealMatrixChangingVisitor)
,
RealMatrix.walkInOptimizedOrder(RealMatrixPreservingVisitor)
,
RealMatrix.walkInOptimizedOrder(RealMatrixChangingVisitor, int, int, int, int)
,
RealMatrix.walkInOptimizedOrder(RealMatrixPreservingVisitor, int, int, int, int)
public double walkInColumnOrder(RealMatrixChangingVisitor visitor)
Column order starts at upper left and iterating through all elements of a column from top to bottom before going to the topmost element of the next column.
walkInColumnOrder
in interface RealMatrix
walkInColumnOrder
in class AbstractRealMatrix
visitor
- visitor used to process all matrix entriesRealMatrixChangingVisitor.end()
at the end
of the walkRealMatrix.walkInRowOrder(RealMatrixChangingVisitor)
,
RealMatrix.walkInRowOrder(RealMatrixPreservingVisitor)
,
RealMatrix.walkInRowOrder(RealMatrixChangingVisitor, int, int, int, int)
,
RealMatrix.walkInRowOrder(RealMatrixPreservingVisitor, int, int, int, int)
,
RealMatrix.walkInColumnOrder(RealMatrixPreservingVisitor)
,
RealMatrix.walkInColumnOrder(RealMatrixChangingVisitor, int, int, int, int)
,
RealMatrix.walkInColumnOrder(RealMatrixPreservingVisitor, int, int, int, int)
,
RealMatrix.walkInOptimizedOrder(RealMatrixChangingVisitor)
,
RealMatrix.walkInOptimizedOrder(RealMatrixPreservingVisitor)
,
RealMatrix.walkInOptimizedOrder(RealMatrixChangingVisitor, int, int, int, int)
,
RealMatrix.walkInOptimizedOrder(RealMatrixPreservingVisitor, int, int, int, int)
public double walkInColumnOrder(RealMatrixPreservingVisitor visitor)
Column order starts at upper left and iterating through all elements of a column from top to bottom before going to the topmost element of the next column.
walkInColumnOrder
in interface RealMatrix
walkInColumnOrder
in class AbstractRealMatrix
visitor
- visitor used to process all matrix entriesRealMatrixPreservingVisitor.end()
at the end
of the walkRealMatrix.walkInRowOrder(RealMatrixChangingVisitor)
,
RealMatrix.walkInRowOrder(RealMatrixPreservingVisitor)
,
RealMatrix.walkInRowOrder(RealMatrixChangingVisitor, int, int, int, int)
,
RealMatrix.walkInRowOrder(RealMatrixPreservingVisitor, int, int, int, int)
,
RealMatrix.walkInColumnOrder(RealMatrixChangingVisitor)
,
RealMatrix.walkInColumnOrder(RealMatrixChangingVisitor, int, int, int, int)
,
RealMatrix.walkInColumnOrder(RealMatrixPreservingVisitor, int, int, int, int)
,
RealMatrix.walkInOptimizedOrder(RealMatrixChangingVisitor)
,
RealMatrix.walkInOptimizedOrder(RealMatrixPreservingVisitor)
,
RealMatrix.walkInOptimizedOrder(RealMatrixChangingVisitor, int, int, int, int)
,
RealMatrix.walkInOptimizedOrder(RealMatrixPreservingVisitor, int, int, int, int)
public double walkInColumnOrder(RealMatrixChangingVisitor visitor, int startRow, int endRow, int startColumn, int endColumn)
Column order starts at upper left and iterating through all elements of a column from top to bottom before going to the topmost element of the next column.
walkInColumnOrder
in interface RealMatrix
walkInColumnOrder
in class AbstractRealMatrix
visitor
- visitor used to process all matrix entriesstartRow
- Initial row indexendRow
- Final row index (inclusive)startColumn
- Initial column indexendColumn
- Final column indexRealMatrixChangingVisitor.end()
at the end
of the walkRealMatrix.walkInRowOrder(RealMatrixChangingVisitor)
,
RealMatrix.walkInRowOrder(RealMatrixPreservingVisitor)
,
RealMatrix.walkInRowOrder(RealMatrixChangingVisitor, int, int, int, int)
,
RealMatrix.walkInRowOrder(RealMatrixPreservingVisitor, int, int, int, int)
,
RealMatrix.walkInColumnOrder(RealMatrixChangingVisitor)
,
RealMatrix.walkInColumnOrder(RealMatrixPreservingVisitor)
,
RealMatrix.walkInColumnOrder(RealMatrixPreservingVisitor, int, int, int, int)
,
RealMatrix.walkInOptimizedOrder(RealMatrixChangingVisitor)
,
RealMatrix.walkInOptimizedOrder(RealMatrixPreservingVisitor)
,
RealMatrix.walkInOptimizedOrder(RealMatrixChangingVisitor, int, int, int, int)
,
RealMatrix.walkInOptimizedOrder(RealMatrixPreservingVisitor, int, int, int, int)
public double walkInColumnOrder(RealMatrixPreservingVisitor visitor, int startRow, int endRow, int startColumn, int endColumn)
Column order starts at upper left and iterating through all elements of a column from top to bottom before going to the topmost element of the next column.
walkInColumnOrder
in interface RealMatrix
walkInColumnOrder
in class AbstractRealMatrix
visitor
- visitor used to process all matrix entriesstartRow
- Initial row indexendRow
- Final row index (inclusive)startColumn
- Initial column indexendColumn
- Final column indexRealMatrixPreservingVisitor.end()
at the end
of the walkRealMatrix.walkInRowOrder(RealMatrixChangingVisitor)
,
RealMatrix.walkInRowOrder(RealMatrixPreservingVisitor)
,
RealMatrix.walkInRowOrder(RealMatrixChangingVisitor, int, int, int, int)
,
RealMatrix.walkInRowOrder(RealMatrixPreservingVisitor, int, int, int, int)
,
RealMatrix.walkInColumnOrder(RealMatrixChangingVisitor)
,
RealMatrix.walkInColumnOrder(RealMatrixPreservingVisitor)
,
RealMatrix.walkInColumnOrder(RealMatrixChangingVisitor, int, int, int, int)
,
RealMatrix.walkInOptimizedOrder(RealMatrixChangingVisitor)
,
RealMatrix.walkInOptimizedOrder(RealMatrixPreservingVisitor)
,
RealMatrix.walkInOptimizedOrder(RealMatrixChangingVisitor, int, int, int, int)
,
RealMatrix.walkInOptimizedOrder(RealMatrixPreservingVisitor, int, int, int, int)
public DiagonalMatrix copy()
copy
in interface RealMatrix
copy
in interface SymmetricMatrix
copy
in class AbstractRealMatrix
public double getNorm()
getNorm
in interface RealMatrix
getNorm
in class AbstractRealMatrix
public double getFrobeniusNorm()
getFrobeniusNorm
in interface RealMatrix
getFrobeniusNorm
in class AbstractRealMatrix
public RealMatrix getSubMatrix(int startRow, int endRow, int startColumn, int endColumn)
Note that if the selected rows and columns are not the same, the returned matrix will be a regular matrix.
getSubMatrix
in interface RealMatrix
getSubMatrix
in class AbstractRealMatrix
startRow
- Initial row indexendRow
- Final row index (inclusive)startColumn
- Initial column indexendColumn
- Final column index (inclusive)public RealMatrix getSubMatrix(int[] selectedRows, int[] selectedColumns)
Note that if the selected rows and columns are not the same, the returned matrix will be a regular matrix.
getSubMatrix
in interface RealMatrix
getSubMatrix
in class AbstractRealMatrix
selectedRows
- Array of row indices.selectedColumns
- Array of column indices.public boolean equals(Object object)
object
is a RealMatrix
instance with the same dimensions as this
and all corresponding matrix entries are equal.equals
in class AbstractRealMatrix
object
- the object to test equality against.public int hashCode()
hashCode
in class AbstractRealMatrix
Copyright © 2021 CNES. All rights reserved.