All the methods implemented here use getEntry(int, int) to access
matrix elements. Derived class can provide faster implementations.
| Modifier and Type | Field and Description |
|---|---|
| private static final RealMatrixFormat | DEFAULT_FORMAT
Default format. |
| Access | Constructor and Description |
|---|---|
| protected | |
| protected | AbstractRealMatrix(final int
the number of rows in the new matrix rowDimension, final int the number of columns in the new matrix columnDimension)Create a new RealMatrix with the supplied row and column dimensions. |
| Modifier and Type | Method and Description |
|---|---|
| public RealMatrix | add(RealMatrix
matrix to be added m)Implements org. Returns the sum of |
| public void | addToEntry(int
Row index of the entry to be modified. row, int Column index of the entry to be modified. column, double value to add to the matrix entry. increment)Implements org. Adds (in place) the specified value to the specified entry of
|
| public abstract RealMatrix | |
| public void | copySubMatrix(final int
Initial row index startRow, final int Final row index (inclusive) endRow, final int Initial column index startColumn, final int Final column index (inclusive) endColumn, final double[][] The arrays where the submatrix data should be copied
(if larger than rows/columns counts, only the upper-left part will be
used) destination)Implements org. Copy a submatrix. |
| public void | copySubMatrix(int[]
Array of row indices. selectedRows, int[] Array of column indices. selectedColumns, double[][] The arrays where the submatrix data should be copied
(if larger than rows/columns counts, only the upper-left part will be
used) destination)Implements org. Copy a submatrix. |
| public abstract RealMatrix | createMatrix(int
the number of rows in the new matrix rowDimension, int the number of columns in the new matrix columnDimension)Redeclares org. Create a new RealMatrix of the same type as the instance with the supplied row and column dimensions. |
| public boolean | Returns: true if object equals thisthe object to test equality against. object)Overrides java. Returns true iff |
| public double[] | getColumn(final int
Column to be fetched. column)Implements org. Get the entries at the given column index as an array. |
| public abstract int | Returns: the number of columns.Redeclares org. Implements abstract org. Returns the number of columns of this matrix. |
| public RealMatrix | getColumnMatrix(final int
Column to be fetched. column)Implements org. Get the entries at the given column index as a column matrix. |
| public RealVector | getColumnVector(final int
Column to be fetched. column)Implements org. Get the entries at the given column index as a vector. |
| public double[][] | getData()
Implements org. Returns matrix entries as a two-dimensional array. |
| public abstract double | getEntry(int
Row index of entry to be fetched. row, int Column index of entry to be fetched. column)Redeclares org. Get the entry in the specified row and column. |
| public double | getFrobeniusNorm()
Implements org. Returns the Frobenius norm of the matrix. |
| public double | getNorm()
Implements org. Returns the maximum absolute row sum norm of the matrix. |
| public double[] | getRow(final int
Row to be fetched. row)Implements org. Get the entries at the given row index. |
| public abstract int | Returns: the number of rows.Redeclares org. Implements abstract org. Returns the number of rows of this matrix. |
| public RealMatrix | getRowMatrix(final int
Row to be fetched. row)Implements org. Get the entries at the given row index as a row matrix. |
| public RealVector | getRowVector(final int
Row to be fetched. row)Implements org. Returns the entries in row number |
| public RealMatrix | getSubMatrix(final int
Initial row index startRow, final int Final row index (inclusive) endRow, final int Initial column index startColumn, final int Final column index (inclusive) endColumn)Implements org. Gets a submatrix. |
| public RealMatrix | getSubMatrix(final int[]
Array of row indices. selectedRows, final int[] Array of column indices. selectedColumns)Implements org. Gets a submatrix. |
| public double | getTrace()
Implements org. Returns the trace of the matrix (the sum of the elements on the main diagonal). |
| public int | Returns: hashcode for matrixOverrides java. Computes a hashcode for the matrix. |
| public boolean | |
| public RealMatrix | multiply(final RealMatrix
matrix to postmultiply by m)Implements org. Returns the result of postmultiplying |
| public void | multiplyEntry(int
Row index of the entry to be modified. row, int Column index of the entry to be modified. column, double Multiplication factor for the matrix entry. factor)Implements org. Multiplies (in place) the specified entry of |
| public double[] | operate(final double[]
the vector to operate on v)Implements org. Returns the result of multiplying this by the vector |
| public RealVector | operate(final RealVector
the vector to operate on v)Implements abstract org. Implements org. Returns the result of multiplying this by the vector |
| public RealMatrix | power(final int
raise p)this to power pImplements org. Returns the result of multiplying |
| public RealMatrix | preMultiply(final RealMatrix
matrix to premultiply by m)Implements org. Returns the result of premultiplying |
| public double[] | preMultiply(final double[]
the row vector to premultiply by v)Implements org. Returns the (row) vector result of premultiplying this by the vector |
| public RealVector | preMultiply(final RealVector
the row vector to premultiply by v)Implements org. Returns the (row) vector result of premultiplying this by the vector |
| public RealMatrix | scalarAdd(final double
value to be added to each entry d)Implements org. Returns the result of adding |
| public RealMatrix | scalarMultiply(final double
value to multiply all entries by d)Implements org. Returns the result of multiplying each entry of |
| public void | setColumn(final int
Column to be set. column, final double[] Column array to be copied (must have the same number of
rows as the instance). array)Implements org. Sets the specified |
| public void | setColumnMatrix(final int
Column to be set. column, final RealMatrix Column matrix to be copied (must have one column and the
same number of rows as the instance). matrix)Implements org. Sets the specified |
| public void | setColumnVector(final int
Column to be set. column, final RealVector column vector to be copied (must have the same number of
rows as the instance). vector)Implements org. Sets the specified |
| public abstract void | setEntry(int
Row index of entry to be set. row, int Column index of entry to be set. column, double the new value of the entry. value)Redeclares org. Set the entry in the specified row and column. |
| public void | setRow(final int
Row to be set. row, final double[] Row matrix to be copied (must have the same number of
columns as the instance) array)Implements org. Sets the specified |
| public void | setRowMatrix(final int
Row to be set. row, final RealMatrix Row matrix to be copied (must have one row and the same
number of columns as the instance). matrix)Implements org. Sets the specified |
| public void | setRowVector(final int
Row to be set. row, final RealVector row vector to be copied (must have the same number of
column as the instance). vector)Implements org. Sets the specified |
| public void | setSubMatrix(final double[][]
array containing the submatrix replacement data subMatrix, final int row coordinate of the top, left element to be replaced row, final int column coordinate of the top, left element to be replaced column)Implements org. Replace the submatrix starting at |
| public RealMatrix | subtract(final RealMatrix
matrix to be subtracted m)Implements org. Returns |
| public String | Returns: a string representation for this matrixOverrides java. Get a string representation for this matrix. |
| public RealMatrix | transpose()
Implements org. Returns the transpose of this matrix. |
| public double | walkInColumnOrder(final RealMatrixChangingVisitor
visitor used to process all matrix entries visitor)Implements org. Visit (and possibly change) all matrix entries in column order. |
| public double | walkInColumnOrder(final RealMatrixPreservingVisitor
visitor used to process all matrix entries visitor)Implements org. Visit (but don't change) all matrix entries in column order. |
| public double | walkInColumnOrder(final RealMatrixChangingVisitor
visitor used to process all matrix entries visitor, final int Initial row index startRow, final int Final row index (inclusive) endRow, final int Initial column index startColumn, final int Final column index endColumn)Implements org. Visit (and possibly change) some matrix entries in column order. |
| public double | walkInColumnOrder(final RealMatrixPreservingVisitor
visitor used to process all matrix entries visitor, final int Initial row index startRow, final int Final row index (inclusive) endRow, final int Initial column index startColumn, final int Final column index endColumn)Implements org. Visit (but don't change) some matrix entries in column order. |
| public double | walkInOptimizedOrder(final RealMatrixChangingVisitor
visitor used to process all matrix entries visitor)Implements org. Visit (and possibly change) all matrix entries using the fastest possible order. |
| public double | walkInOptimizedOrder(final RealMatrixPreservingVisitor
visitor used to process all matrix entries visitor)Implements org. Visit (but don't change) all matrix entries using the fastest possible order. |
| public double | walkInOptimizedOrder(final RealMatrixChangingVisitor
visitor used to process all matrix entries visitor, final int Initial row index startRow, final int Final row index (inclusive) endRow, final int Initial column index startColumn, final int Final column index (inclusive) endColumn)Implements org. Visit (and possibly change) some matrix entries using the fastest possible order. |
| public double | walkInOptimizedOrder(final RealMatrixPreservingVisitor
visitor used to process all matrix entries visitor, final int Initial row index startRow, final int Final row index (inclusive) endRow, final int Initial column index startColumn, final int Final column index (inclusive) endColumn)Implements org. Visit (but don't change) some matrix entries using the fastest possible order. |
| public double | walkInRowOrder(final RealMatrixChangingVisitor
visitor used to process all matrix entries visitor)Implements org. Visit (and possibly change) all matrix entries in row order. |
| public double | walkInRowOrder(final RealMatrixPreservingVisitor
visitor used to process all matrix entries visitor)Implements org. Visit (but don't change) all matrix entries in row order. |
| public double | walkInRowOrder(final RealMatrixChangingVisitor
visitor used to process all matrix entries visitor, final int Initial row index startRow, final int Final row index (inclusive) endRow, final int Initial column index startColumn, final int Final column index endColumn)Implements org. Visit (and possibly change) some matrix entries in row order. |
| public double | walkInRowOrder(final RealMatrixPreservingVisitor
visitor used to process all matrix entries visitor, final int Initial row index startRow, final int Final row index (inclusive) endRow, final int Initial column index startColumn, final int Final column index endColumn)Implements org. Visit (but don't change) some matrix entries in row order. |