RealMatrix using a double[][] array to
store entries.
| Modifier and Type | Field and Description |
|---|---|
| private double[][] | data
Entries of the matrix. |
| private static final long | serialVersionUID
Serializable version identifier. |
| Access | Constructor and Description |
|---|---|
| public | |
| public | Array2DRowRealMatrix(final int
Number of rows in the new matrix. rowDimension, final int Number of columns in the new matrix. columnDimension)Create a new RealMatrix with the supplied row and column dimensions. |
| public | Array2DRowRealMatrix(final double[][]
Data for the new matrix. d)Create a new |
| public | Array2DRowRealMatrix(final double[][]
Data for new matrix. d, final boolean if copyArray)true, the input array will be copied,
otherwise it will be referenced.Create a new RealMatrix using the input array as the underlying data array. |
| public | Array2DRowRealMatrix(final double[]
Column vector holding data for new matrix. v)Create a new (column) RealMatrix using |
| Modifier and Type | Method and Description |
|---|---|
| public Array2DRowRealMatrix | Returns: this + m.Matrix to be added. m)Compute the sum of |
| public void | addToEntry(final int
Row index of the entry to be modified. row, final int Column index of the entry to be modified. column, final double value to add to the matrix entry. increment)Overrides org. Implements org. Adds (in place) the specified value to the specified entry of
|
| public RealMatrix | copy()
Implements abstract org. Implements org. Returns a (deep) copy of this. |
| private void | |
| private double[][] | Returns: a copy of the underlying data array.Get a fresh copy of the underlying data array. |
| public RealMatrix | createMatrix(final int
the number of rows in the new matrix rowDimension, final int the number of columns in the new matrix columnDimension)Implements abstract org. Implements org. Create a new RealMatrix of the same type as the instance with the supplied row and column dimensions. |
| public int | getColumnDimension()
Implements abstract org. Implements org. Returns the number of columns of this matrix. |
| public double[][] | getData()
Overrides org. Implements org. Returns matrix entries as a two-dimensional array. |
| public double[][] | |
| public double | getEntry(final int
Row index of entry to be fetched. row, final int Column index of entry to be fetched. column)Implements abstract org. Implements org. Get the entry in the specified row and column. |
| public int | getRowDimension()
Implements abstract org. Implements org. Returns the number of rows of this matrix. |
| public Array2DRowRealMatrix | Returns: this * mmatrix to postmultiply by m)Returns the result of postmultiplying |
| public void | multiplyEntry(final int
Row index of the entry to be modified. row, final int Column index of the entry to be modified. column, final double Multiplication factor for the matrix entry. factor)Overrides org. Implements org. Multiplies (in place) the specified entry of |
| public double[] | operate(final double[]
the vector to operate on v)Overrides org. Implements org. Returns the result of multiplying this by the vector |
| public double[] | preMultiply(final double[]
the row vector to premultiply by v)Overrides org. Implements org. Returns the (row) vector result of premultiplying this by the vector |
| public void | setEntry(final int
Row index of entry to be set. row, final int Column index of entry to be set. column, final double the new value of the entry. value)Implements abstract org. Implements org. Set the entry in the specified row and column. |
| 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)Overrides org. Implements org. Replace the submatrix starting at |
| public Array2DRowRealMatrix | Returns: this - mMatrix to be subtracted. m)Returns |
| public double | walkInColumnOrder(final RealMatrixChangingVisitor
visitor used to process all matrix entries visitor)Overrides org. 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)Overrides org. 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)Overrides org. 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)Overrides org. Implements org. Visit (but don't change) some matrix entries in column order. |
| public double | walkInRowOrder(final RealMatrixChangingVisitor
visitor used to process all matrix entries visitor)Overrides org. 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)Overrides org. 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)Overrides org. 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)Overrides org. Implements org. Visit (but don't change) some matrix entries in row order. |
| data | back to summary |
|---|---|
| private double[][] data Entries of the matrix. | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Serializable version identifier. | |
| Array2DRowRealMatrix | back to summary |
|---|---|
| public Array2DRowRealMatrix() Creates a matrix with no data | |
| Array2DRowRealMatrix | back to summary |
|---|---|
| public Array2DRowRealMatrix(final int rowDimension, final int columnDimension) throws NotStrictlyPositiveException Create a new RealMatrix with the supplied row and column dimensions.
| |
| Array2DRowRealMatrix | back to summary |
|---|---|
| public Array2DRowRealMatrix(final double[][] d) throws DimensionMismatchException, NoDataException, NullArgumentException Create a new The input array is copied, not referenced. This constructor has
the same effect as calling
| |
| Array2DRowRealMatrix | back to summary |
|---|---|
| public Array2DRowRealMatrix(final double[][] d, final boolean copyArray) throws DimensionMismatchException, NoDataException, NullArgumentException Create a new RealMatrix using the input array as the underlying
data array.
If an array is built specially in order to be embedded in a
RealMatrix and not used directly, the
| |
| Array2DRowRealMatrix | back to summary |
|---|---|
| public Array2DRowRealMatrix(final double[] v) Create a new (column) RealMatrix using
| |
| add | back to summary |
|---|---|
| public Array2DRowRealMatrix add(final Array2DRowRealMatrix m) throws MatrixDimensionMismatchException Compute the sum of
| |
| addToEntry | back to summary |
|---|---|
| public void addToEntry(final int row, final int column, final double increment) throws OutOfRangeException Overrides org. Implements org. Doc from org. Adds (in place) the specified value to the specified entry of
| |
| copy | back to summary |
|---|---|
| public RealMatrix copy() Implements abstract org. Implements org. Doc from org. Returns a (deep) copy of this.
| |
| copyIn | back to summary |
|---|---|
| private void copyIn(final double[][] in) throws DimensionMismatchException, NoDataException, NullArgumentException Replace data with a fresh copy of the input array.
| |
| copyOut | back to summary |
|---|---|
| private double[][] copyOut() Get a fresh copy of the underlying data array.
| |
| createMatrix | back to summary |
|---|---|
| public RealMatrix createMatrix(final int rowDimension, final int columnDimension) throws NotStrictlyPositiveException Implements abstract org. Implements org. Doc from org. Create a new RealMatrix of the same type as the instance with the supplied row and column dimensions.
| |
| getColumnDimension | back to summary |
|---|---|
| public int getColumnDimension() Implements abstract org. Implements org. Doc from org. Returns the number of columns of this matrix.
| |
| getData | back to summary |
|---|---|
| public double[][] getData() Overrides org. Implements org. Doc from org. Returns matrix entries as a two-dimensional array.
| |
| getDataRef | back to summary |
|---|---|
| public double[][] getDataRef() Get a reference to the underlying data array.
| |
| getEntry | back to summary |
|---|---|
| public double getEntry(final int row, final int column) throws OutOfRangeException Implements abstract org. Implements org. Doc from org. Get the entry in the specified row and column. Row and column indices start at 0.
| |
| getRowDimension | back to summary |
|---|---|
| public int getRowDimension() Implements abstract org. Implements org. Doc from org. Returns the number of rows of this matrix.
| |
| multiply | back to summary |
|---|---|
| public Array2DRowRealMatrix multiply(final Array2DRowRealMatrix m) throws DimensionMismatchException Returns the result of postmultiplying
| |
| multiplyEntry | back to summary |
|---|---|
| public void multiplyEntry(final int row, final int column, final double factor) throws OutOfRangeException Overrides org. Implements org. Doc from org. Multiplies (in place) the specified entry of
| |
| operate | back to summary |
|---|---|
| public double[] operate(final double[] v) throws DimensionMismatchException Overrides org. Implements org. Doc from org. Returns the result of multiplying this by the vector
| |
| preMultiply | back to summary |
|---|---|
| public double[] preMultiply(final double[] v) throws DimensionMismatchException Overrides org. Implements org. Doc from org. Returns the (row) vector result of premultiplying this by the vector
| |
| setEntry | back to summary |
|---|---|
| public void setEntry(final int row, final int column, final double value) throws OutOfRangeException Implements abstract org. Implements org. Doc from org. Set the entry in the specified row and column. Row and column indices start at 0.
| |
| setSubMatrix | back to summary |
|---|---|
| public void setSubMatrix(final double[][] subMatrix, final int row, final int column) throws NoDataException, OutOfRangeException, DimensionMismatchException, NullArgumentException Overrides org. Implements org. Doc from org. Replace the submatrix starting at
Example: 1 2 3 4 5 6 7 8 9 0 1 2and subMatrix = {{3, 4} {5,6}}, invoking
setSubMatrix(subMatrix,1,1)) will result in 1 2 3 4 5 3 4 8 9 5 6 2
| |
| subtract | back to summary |
|---|---|
| public Array2DRowRealMatrix subtract(final Array2DRowRealMatrix m) throws MatrixDimensionMismatchException Returns
| |
| walkInColumnOrder | back to summary |
|---|---|
| public double walkInColumnOrder(final RealMatrixChangingVisitor visitor) Overrides org. Implements org. Doc from org. Visit (and possibly change) all matrix entries in column order. 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 | back to summary |
|---|---|
| public double walkInColumnOrder(final RealMatrixPreservingVisitor visitor) Overrides org. Implements org. Doc from org. Visit (but don't change) all matrix entries in column order. 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 | back to summary |
|---|---|
| public double walkInColumnOrder(final RealMatrixChangingVisitor visitor, final int startRow, final int endRow, final int startColumn, final int endColumn) throws OutOfRangeException, NumberIsTooSmallException Overrides org. Implements org. Doc from org. Visit (and possibly change) some matrix entries in column order. 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.
| |
| walkInRowOrder | back to summary |
|---|---|
| public double walkInRowOrder(final RealMatrixChangingVisitor visitor) Overrides org. Implements org. Doc from org. Visit (and possibly change) all matrix entries in row order. 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 | back to summary |
|---|---|
| public double walkInRowOrder(final RealMatrixPreservingVisitor visitor) Overrides org. Implements org. Doc from org. Visit (but don't change) all matrix entries in row order. 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 | back to summary |
|---|---|
| public double walkInRowOrder(final RealMatrixChangingVisitor visitor, final int startRow, final int endRow, final int startColumn, final int endColumn) throws OutOfRangeException, NumberIsTooSmallException Overrides org. Implements org. Doc from org. Visit (and possibly change) some matrix entries in row order. 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 | back to summary |
|---|---|
| public double walkInRowOrder(final RealMatrixPreservingVisitor visitor, final int startRow, final int endRow, final int startColumn, final int endColumn) throws OutOfRangeException, NumberIsTooSmallException Overrides org. Implements org. Doc from org. Visit (but don't change) some matrix entries in row order. 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.
| |