| Modifier and Type | Field and Description |
|---|---|
| private final double[] | data
Entries of the diagonal. |
| private static final long | serialVersionUID
Serializable version identifier. |
| Access | Constructor and Description |
|---|---|
| public | DiagonalMatrix(final int
Number of rows and columns in the new matrix. dimension)Creates a matrix with the supplied dimension. |
| public | DiagonalMatrix(final double[]
Data for the new matrix. d)Creates a matrix using the input array as the underlying data. |
| public | DiagonalMatrix(final double[]
Data for new matrix. d, final boolean if copyArray)true, the input array will be copied,
otherwise it will be referenced.Creates a matrix using the input array as the underlying data. |
| Modifier and Type | Method and Description |
|---|---|
| public DiagonalMatrix | |
| 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. |
| 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. |
| private void | |
| 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 DiagonalMatrix | |
| public DiagonalMatrix | Returns: the inverse ofmSingularity threshold. threshold)Computes the inverse of this diagonal matrix. |
| public boolean | Returns: true if the matrix is singular, false otherwiseSingularity threshold. threshold)Returns whether this diagonal matrix is singular, i.e. any diagonal entry
is equal to |
| public DiagonalMatrix | Returns: this * mmatrix to postmultiply by m)Returns the result of postmultiplying |
| public RealMatrix | Returns: this * mmatrix to postmultiply by m)Overrides org. Implements org. 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 RealVector | preMultiply(final RealVector
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 DiagonalMatrix |
| data | back to summary |
|---|---|
| private final double[] data Entries of the diagonal. | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Serializable version identifier. | |
| DiagonalMatrix | back to summary |
|---|---|
| public DiagonalMatrix(final int dimension) throws NotStrictlyPositiveException Creates a matrix with the supplied dimension.
| |
| DiagonalMatrix | back to summary |
|---|---|
| public DiagonalMatrix(final double[] d) Creates a matrix using the input array as the underlying data.
| |
| DiagonalMatrix | back to summary |
|---|---|
| public DiagonalMatrix(final double[] d, final boolean copyArray) throws NullArgumentException Creates a matrix using the input array as the underlying data.
| |
| add | back to summary |
|---|---|
| public DiagonalMatrix add(final DiagonalMatrix 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, NumberIsTooLargeException 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.
| |
| createMatrix | back to summary |
|---|---|
| public RealMatrix createMatrix(final int rowDimension, final int columnDimension) throws NotStrictlyPositiveException, DimensionMismatchException 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.
| |
| ensureZero | back to summary |
|---|---|
| private void ensureZero(final double value) throws NumberIsTooLargeException Ensure a value is zero.
| |
| 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() Gets 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.
| |
| inverse | back to summary |
|---|---|
| public DiagonalMatrix inverse() throws SingularMatrixException Computes the inverse of this diagonal matrix. Note this method will use a singularity threshold of 0,
use
| |
| inverse | back to summary |
|---|---|
| public DiagonalMatrix inverse(double threshold) throws SingularMatrixException Computes the inverse of this diagonal matrix.
| |
| isSingular | back to summary |
|---|---|
| public boolean isSingular(double threshold) Returns whether this diagonal matrix is singular, i.e. any diagonal entry
is equal to
| |
| multiply | back to summary |
|---|---|
| public DiagonalMatrix multiply(final DiagonalMatrix m) throws DimensionMismatchException Returns the result of postmultiplying
| |
| multiply | back to summary |
|---|---|
| public RealMatrix multiply(final RealMatrix m) throws DimensionMismatchException Overrides org. Implements org. 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
| |
| preMultiply | back to summary |
|---|---|
| public RealVector preMultiply(final RealVector 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, NumberIsTooLargeException Implements abstract org. Implements org. Doc from org. Set the entry in the specified row and column. Row and column indices start at 0.
| |
| subtract | back to summary |
|---|---|
| public DiagonalMatrix subtract(final DiagonalMatrix m) throws MatrixDimensionMismatchException Returns
| |