Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.commons.math.linear
Class BigMatrixImpl

    java.lang.Object
      org.apache.commons.math.linear.BigMatrixImpl

All Implemented Interfaces:
  Serializable, AnyMatrix, BigMatrix

Deprecated. as of 2.0, replaced by `Array2DRowFieldMatrix` with a `BigReal` parameter

    @Deprecated
    public class BigMatrixImpl

extends Object
implements BigMatrix, Serializable

Implementation of `BigMatrix` using a BigDecimal[][] array to store entries and LU decompostion to support linear system solution and inverse.

The LU decompostion is performed as needed, to support the following operations:

- solve
- isSingular
- getDeterminant
- inverse

Usage notes:

- The LU decomposition is stored and reused on subsequent calls. If matrix data are modified using any of the public setXxx methods, the saved decomposition is discarded. If data are modified via references to the underlying array obtained using `getDataRef()`, then the stored LU decomposition will not be discarded. In this case, you need to explicitly invoke `LUDecompose()` to recompute the decomposition before using any of the methods above.
- As specified in the `BigMatrix` interface, matrix element indexing is 0-based -- e.g., `getEntry(0, 0)` returns the element in the first row, first column of the matrix.

Version:
  $Revision: 1042376 $ $Date: 2010-12-05 16:54:55 +0100 (dim. 05 dÃ©c. 2010) $
See Also:
  Serialized Form

Field Summary
`protected BigDecimal[][]` | `data` Deprecated. Entries of the matrix
`protected BigDecimal[][]` | `lu` Deprecated. Entries of cached LU decomposition.
`protected int` | `parity` Deprecated. Parity of the permutation associated with the LU decomposition
`protected int[]` | `permutation` Deprecated. Permutation associated with LU decomposition

Constructor Summary
`BigMatrixImpl()` Deprecated. Creates a matrix with no data
`BigMatrixImpl(BigDecimal[] v)` Deprecated. Create a new (column) BigMatrix using `v` as the data for the unique column of the `v.length x 1` matrix created.
`BigMatrixImpl(BigDecimal[][] d)` Deprecated. Create a new BigMatrix using `d` as the underlying data array.
`BigMatrixImpl(BigDecimal[][] d, boolean copyArray)` Deprecated. Create a new BigMatrix using the input array as the underlying data array.
`BigMatrixImpl(double[][] d)` Deprecated. Create a new BigMatrix using `d` as the underlying data array.
`BigMatrixImpl(int rowDimension, int columnDimension)` Deprecated. Create a new BigMatrix with the supplied row and column dimensions.
`BigMatrixImpl(String[][] d)` Deprecated. Create a new BigMatrix using the values represented by the strings in `d` as the underlying data array.

Method Summary
`BigMatrix` | `add(BigMatrix m)` Deprecated. Compute the sum of this and `m`.
`BigMatrixImpl` | `add(BigMatrixImpl m)` Deprecated. Compute the sum of this and `m`.
`BigMatrix` | `copy()` Deprecated. Create a new BigMatrix which is a copy of this.
`boolean` | `equals(Object object)` Deprecated. Returns true iff `object` is a `BigMatrixImpl` instance with the same dimensions as this and all corresponding matrix entries are equal.
`BigDecimal[]` | `getColumn(int col)` Deprecated. Returns the entries in column number `col` as an array.
`double[]` | `getColumnAsDoubleArray(int col)` Deprecated. Returns the entries in column number `col` as an array of double values.
`int` | `getColumnDimension()` Deprecated. Returns the number of columns in the matrix.
`BigMatrix` | `getColumnMatrix(int column)` Deprecated. Returns the entries in column number `column` as a column matrix.
`BigDecimal[][]` | `getData()` Deprecated. Returns matrix entries as a two-dimensional array.
`double[][]` | `getDataAsDoubleArray()` Deprecated. Returns matrix entries as a two-dimensional array.
`BigDecimal[][]` | `getDataRef()` Deprecated. Returns a reference to the underlying data array.
`BigDecimal` | `getDeterminant()` Deprecated. Returns the determinant of this matrix.
`BigDecimal` | `getEntry(int row, int column)` Deprecated. Returns the entry in the specified row and column.
`double` | `getEntryAsDouble(int row, int column)` Deprecated. Returns the entry in the specified row and column as a double.
`protected BigMatrix` | `getLUMatrix()` Deprecated. Returns the LU decomposition as a BigMatrix.
`BigDecimal` | `getNorm()` Deprecated. Returns the maximum absolute row sum norm of the matrix.
`protected int[]` | `getPermutation()` Deprecated. Returns the permutation associated with the lu decomposition.
`int` | `getRoundingMode()` Deprecated. Gets the rounding mode for division operations The default is `BigDecimal.ROUND_HALF_UP`
`BigDecimal[]` | `getRow(int row)` Deprecated. Returns the entries in row number `row` as an array.
`double[]` | `getRowAsDoubleArray(int row)` Deprecated. Returns the entries in row number `row` as an array of double values.
`int` | `getRowDimension()` Deprecated. Returns the number of rows in the matrix.
`BigMatrix` | `getRowMatrix(int row)` Deprecated. Returns the entries in row number `row` as a row matrix.
`int` | `getScale()` Deprecated. Sets the scale for division operations.
`BigMatrix` | `getSubMatrix(int[] selectedRows, int[] selectedColumns)` Deprecated. Gets a submatrix.
`BigMatrix` | `getSubMatrix(int startRow, int endRow, int startColumn, int endColumn)` Deprecated. Gets a submatrix.
`BigDecimal` | `getTrace()` Deprecated. Returns the trace of the matrix (the sum of the elements on the main diagonal).
`int` | `hashCode()` Deprecated. Computes a hashcode for the matrix.
`BigMatrix` | `inverse()` Deprecated. Returns the inverse matrix if this matrix is invertible.
`boolean` | `isSingular()` Deprecated. Is this a singular matrix?
`boolean` | `isSquare()` Deprecated. Is this a square matrix?
`void` | `luDecompose()` Deprecated. Computes a new LU decompostion for this matrix, storing the result for use by other methods.
`BigMatrix` | `multiply(BigMatrix m)` Deprecated. Returns the result of postmultiplying this by `m`.
`BigMatrixImpl` | `multiply(BigMatrixImpl m)` Deprecated. Returns the result of postmultiplying this by `m`.
`BigDecimal[]` | `operate(BigDecimal[] v)` Deprecated. Returns the result of multiplying this by the vector `v`.
`BigDecimal[]` | `operate(double[] v)` Deprecated. Returns the result of multiplying this by the vector `v`.
`BigDecimal[]` | `preMultiply(BigDecimal[] v)` Deprecated. Returns the (row) vector result of premultiplying this by the vector `v`.
`BigMatrix` | `preMultiply(BigMatrix m)` Deprecated. Returns the result premultiplying this by `m`.
`BigMatrix` | `scalarAdd(BigDecimal d)` Deprecated. Returns the result of adding d to each entry of this.
`BigMatrix` | `scalarMultiply(BigDecimal d)` Deprecated. Returns the result of multiplying each entry of this by `d`
`void` | `setRoundingMode(int roundingMode)` Deprecated. Sets the rounding mode for decimal divisions.
`void` | `setScale(int scale)` Deprecated. Sets the scale for division operations.
`void` | `setSubMatrix(BigDecimal[][] subMatrix, int row, int column)` Deprecated. Replace the submatrix starting at `row, column` using data in the input `subMatrix` array.
`BigDecimal[]` | `solve(BigDecimal[] b)` Deprecated. Returns a matrix of (column) solution vectors for linear systems with coefficient matrix = this and constant vectors = columns of `b`.
`BigMatrix` | `solve(BigMatrix b)` Deprecated. Returns a matrix of (column) solution vectors for linear systems with coefficient matrix = this and constant vectors = columns of `b`.
`BigDecimal[]` | `solve(double[] b)` Deprecated. Returns a matrix of (column) solution vectors for linear systems with coefficient matrix = this and constant vectors = columns of `b`.
`BigMatrix` | `subtract(BigMatrix m)` Deprecated. Compute this minus `m`.
`BigMatrixImpl` | `subtract(BigMatrixImpl m)` Deprecated. Compute this minus `m`.
`String` | `toString()` Deprecated. Get a string representation for this matrix.
`BigMatrix` | `transpose()` Deprecated. Returns the transpose matrix.

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Field Detail

### data

    protected BigDecimal[][] data

  Deprecated.
  Entries of the matrix

### lu

    protected BigDecimal[][] lu

  Deprecated.
  Entries of cached LU decomposition. All updates to data (other than luDecompose()) *must* set this to null

### permutation

    protected int[] permutation

  Deprecated.
  Permutation associated with LU decomposition

### parity

    protected int parity

  Deprecated.
  Parity of the permutation associated with the LU decomposition

Constructor Detail

### BigMatrixImpl

    public BigMatrixImpl()

  Deprecated.
  Creates a matrix with no data

### BigMatrixImpl

    public BigMatrixImpl(int rowDimension,
                         int columnDimension)

  Deprecated.
  Create a new BigMatrix with the supplied row and column dimensions.

  Parameters:
    `rowDimension` - the number of rows in the new matrix
    `columnDimension` - the number of columns in the new matrix
  Throws:
    `IllegalArgumentException` - if row or column dimension is not positive

### BigMatrixImpl

    public BigMatrixImpl(BigDecimal[][] d)

  Deprecated.
  Create a new BigMatrix using `d` as the underlying data array.

  The input array is copied, not referenced. This constructor has the same effect as calling `BigMatrixImpl(BigDecimal[][], boolean)` with the second argument set to `true`.

  Parameters:
    `d` - data for new matrix
  Throws:
    `IllegalArgumentException` - if `d` is not rectangular (not all rows have the same length) or empty
    `NullPointerException` - if `d` is null

### BigMatrixImpl

    public BigMatrixImpl(BigDecimal[][] d,
                         boolean copyArray)

  Deprecated.
  Create a new BigMatrix using the input array as the underlying data array.

  If an array is built specially in order to be embedded in a BigMatrix and not used directly, the `copyArray` may be set to `false`

  Parameters:
    `d` - data for new matrix
    `copyArray` - if true, the input array will be copied, otherwise it will be referenced
  Throws:
    `IllegalArgumentException` - if `d` is not rectangular (not all rows have the same length) or empty
    `NullPointerException` - if `d` is null
  See Also:
    `BigMatrixImpl(BigDecimal[][])`

### BigMatrixImpl

    public BigMatrixImpl(double[][] d)

  Deprecated.
  Create a new BigMatrix using `d` as the underlying data array.

  Since the underlying array will hold `BigDecimal` instances, it will be created.

  Parameters:
    `d` - data for new matrix
  Throws:
    `IllegalArgumentException` - if `d` is not rectangular (not all rows have the same length) or empty
    `NullPointerException` - if `d` is null

### BigMatrixImpl

    public BigMatrixImpl(String[][] d)

  Deprecated.
  Create a new BigMatrix using the values represented by the strings in `d` as the underlying data array.

  Parameters:
    `d` - data for new matrix
  Throws:
    `IllegalArgumentException` - if `d` is not rectangular (not all rows have the same length) or empty
    `NullPointerException` - if `d` is null

### BigMatrixImpl

    public BigMatrixImpl(BigDecimal[] v)

  Deprecated.
  Create a new (column) BigMatrix using `v` as the data for the unique column of the `v.length x 1` matrix created.

  The input array is copied, not referenced.

  Parameters:
    `v` - column vector holding data for new matrix

Method Detail

### copy

    public BigMatrix copy()

  Deprecated.
  Create a new BigMatrix which is a copy of this.

  Specified by:
    `copy` in interface `BigMatrix`
  Returns:
    the cloned matrix

### add

    public BigMatrix add(BigMatrix m)
                  throws IllegalArgumentException

  Deprecated.
  Compute the sum of this and `m`.

  Specified by:
    `add` in interface `BigMatrix`
  Parameters:
    `m` - matrix to be added
  Returns:
    this + m
  Throws:
    `IllegalArgumentException` - if m is not the same size as this

### add

    public BigMatrixImpl add(BigMatrixImpl m)
                      throws IllegalArgumentException

  Deprecated.
  Compute the sum of this and `m`.

  Parameters:
    `m` - matrix to be added
  Returns:
    this + m
  Throws:
    `IllegalArgumentException` - if m is not the same size as this

### subtract

    public BigMatrix subtract(BigMatrix m)
                       throws IllegalArgumentException

  Deprecated.
  Compute this minus `m`.

  Specified by:
    `subtract` in interface `BigMatrix`
  Parameters:
    `m` - matrix to be subtracted
  Returns:
    this + m
  Throws:
    `IllegalArgumentException` - if m is not the same size as this

### subtract

    public BigMatrixImpl subtract(BigMatrixImpl m)
                           throws IllegalArgumentException

  Deprecated.
  Compute this minus `m`.

  Parameters:
    `m` - matrix to be subtracted
  Returns:
    this + m
  Throws:
    `IllegalArgumentException` - if m is not the same size as this

### scalarAdd

    public BigMatrix scalarAdd(BigDecimal d)

  Deprecated.
  Returns the result of adding d to each entry of this.

  Specified by:
    `scalarAdd` in interface `BigMatrix`
  Parameters:
    `d` - value to be added to each entry
  Returns:
    d + this

### scalarMultiply

    public BigMatrix scalarMultiply(BigDecimal d)

  Deprecated.
  Returns the result of multiplying each entry of this by `d`

  Specified by:
    `scalarMultiply` in interface `BigMatrix`
  Parameters:
    `d` - value to multiply all entries by
  Returns:
    d * this

### multiply

    public BigMatrix multiply(BigMatrix m)
                       throws IllegalArgumentException

  Deprecated.
  Returns the result of postmultiplying this by `m`.

  Specified by:
    `multiply` in interface `BigMatrix`
  Parameters:
    `m` - matrix to postmultiply by
  Returns:
    this*m
  Throws:
    `IllegalArgumentException` - if columnDimension(this) != rowDimension(m)

### multiply

    public BigMatrixImpl multiply(BigMatrixImpl m)
                           throws IllegalArgumentException

  Deprecated.
  Returns the result of postmultiplying this by `m`.

  Parameters:
    `m` - matrix to postmultiply by
  Returns:
    this*m
  Throws:
    `IllegalArgumentException` - if columnDimension(this) != rowDimension(m)

### preMultiply

    public BigMatrix preMultiply(BigMatrix m)
                          throws IllegalArgumentException

  Deprecated.
  Returns the result premultiplying this by `m`.

  Specified by:
    `preMultiply` in interface `BigMatrix`
  Parameters:
    `m` - matrix to premultiply by
  Returns:
    m * this
  Throws:
    `IllegalArgumentException` - if rowDimension(this) != columnDimension(m)

### getData

    public BigDecimal[][] getData()

  Deprecated.
  Returns matrix entries as a two-dimensional array.

  Makes a fresh copy of the underlying data.

  Specified by:
    `getData` in interface `BigMatrix`
  Returns:
    2-dimensional array of entries

### getDataAsDoubleArray

    public double[][] getDataAsDoubleArray()

  Deprecated.
  Returns matrix entries as a two-dimensional array.

  Makes a fresh copy of the underlying data converted to `double` values.

  Specified by:
    `getDataAsDoubleArray` in interface `BigMatrix`
  Returns:
    2-dimensional array of entries

### getDataRef

    public BigDecimal[][] getDataRef()

  Deprecated.
  Returns a reference to the underlying data array.

  Does not make a fresh copy of the underlying data.

  Returns:
    2-dimensional array of entries

### getRoundingMode

    public int getRoundingMode()

  Deprecated.
  Gets the rounding mode for division operations The default is `BigDecimal.ROUND_HALF_UP`

  Specified by:
    `getRoundingMode` in interface `BigMatrix`
  Returns:
    the rounding mode.
  See Also:
    `BigDecimal`

### setRoundingMode

    public void setRoundingMode(int roundingMode)

  Deprecated.
  Sets the rounding mode for decimal divisions.

  Parameters:
    `roundingMode` - rounding mode for decimal divisions
  See Also:
    `BigDecimal`

### getScale

    public int getScale()

  Deprecated.
  Sets the scale for division operations. The default is 64

  Returns:
    the scale
  See Also:
    `BigDecimal`

### setScale

    public void setScale(int scale)

  Deprecated.
  Sets the scale for division operations.

  Parameters:
    `scale` - scale for division operations
  See Also:
    `BigDecimal`

### getNorm

    public BigDecimal getNorm()

  Deprecated.
  Returns the maximum absolute row sum norm of the matrix.

  Specified by:
    `getNorm` in interface `BigMatrix`
  Returns:
    norm

### getSubMatrix

    public BigMatrix getSubMatrix(int startRow,
                                  int endRow,
                                  int startColumn,
                                  int endColumn)
                           throws MatrixIndexException

  Deprecated.
  Gets a submatrix. Rows and columns are indicated counting from 0 to n-1.

  Specified by:
    `getSubMatrix` in interface `BigMatrix`
  Parameters:
    `startRow` - Initial row index
    `endRow` - Final row index
    `startColumn` - Initial column index
    `endColumn` - Final column index
  Returns:
    The subMatrix containing the data of the specified rows and columns
  Throws:
    `MatrixIndexException` - if row or column selections are not valid

### getSubMatrix

    public BigMatrix getSubMatrix(int[] selectedRows,
                                  int[] selectedColumns)
                           throws MatrixIndexException

  Deprecated.
  Gets a submatrix. Rows and columns are indicated counting from 0 to n-1.

  Specified by:
    `getSubMatrix` in interface `BigMatrix`
  Parameters:
    `selectedRows` - Array of row indices must be non-empty
    `selectedColumns` - Array of column indices must be non-empty
  Returns:
    The subMatrix containing the data in the specified rows and columns
  Throws:
    `MatrixIndexException` - if supplied row or column index arrays are not valid

### setSubMatrix

    public void setSubMatrix(BigDecimal[][] subMatrix,
                             int row,
                             int column)
                      throws MatrixIndexException

  Deprecated.
  Replace the submatrix starting at `row, column` using data in the input `subMatrix` array. Indexes are 0-based.

  Example:
  Starting with

       1  2  3  4
       5  6  7  8
       9  0  1  2

  and `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

  Parameters:
    `subMatrix` - array containing the submatrix replacement data
    `row` - row coordinate of the top, left element to be replaced
    `column` - column coordinate of the top, left element to be replaced
  Throws:
    `MatrixIndexException` - if subMatrix does not fit into this matrix from element in (row, column)
    `IllegalArgumentException` - if `subMatrix` is not rectangular (not all rows have the same length) or empty
    `NullPointerException` - if `subMatrix` is null
  Since:
    1.1

### getRowMatrix

    public BigMatrix getRowMatrix(int row)
                           throws MatrixIndexException

  Deprecated.
  Returns the entries in row number `row` as a row matrix. Row indices start at 0.

  Specified by:
    `getRowMatrix` in interface `BigMatrix`
  Parameters:
    `row` - the row to be fetched
  Returns:
    row matrix
  Throws:
    `MatrixIndexException` - if the specified row index is invalid

### getColumnMatrix

    public BigMatrix getColumnMatrix(int column)
                              throws MatrixIndexException

  Deprecated.
  Returns the entries in column number `column` as a column matrix. Column indices start at 0.

  Specified by:
    `getColumnMatrix` in interface `BigMatrix`
  Parameters:
    `column` - the column to be fetched
  Returns:
    column matrix
  Throws:
    `MatrixIndexException` - if the specified column index is invalid

### getRow

    public BigDecimal[] getRow(int row)
                        throws MatrixIndexException

  Deprecated.
  Returns the entries in row number `row` as an array.

  Row indices start at 0. A `MatrixIndexException` is thrown unless `0 <= row < rowDimension.`

  Specified by:
    `getRow` in interface `BigMatrix`
  Parameters:
    `row` - the row to be fetched
  Returns:
    array of entries in the row
  Throws:
    `MatrixIndexException` - if the specified row index is not valid

### getRowAsDoubleArray

    public double[] getRowAsDoubleArray(int row)
                                 throws MatrixIndexException

  Deprecated.
  Returns the entries in row number `row` as an array of double values.

  Row indices start at 0. A `MatrixIndexException` is thrown unless `0 <= row < rowDimension.`

  Specified by:
    `getRowAsDoubleArray` in interface `BigMatrix`
  Parameters:
    `row` - the row to be fetched
  Returns:
    array of entries in the row
  Throws:
    `MatrixIndexException` - if the specified row index is not valid

### getColumn

    public BigDecimal[] getColumn(int col)
                           throws MatrixIndexException

  Deprecated.
  Returns the entries in column number `col` as an array.

  Column indices start at 0. A `MatrixIndexException` is thrown unless `0 <= column < columnDimension.`

  Specified by:
    `getColumn` in interface `BigMatrix`
  Parameters:
    `col` - the column to be fetched
  Returns:
    array of entries in the column
  Throws:
    `MatrixIndexException` - if the specified column index is not valid

### getColumnAsDoubleArray

    public double[] getColumnAsDoubleArray(int col)
                                    throws MatrixIndexException

  Deprecated.
  Returns the entries in column number `col` as an array of double values.

  Column indices start at 0. A `MatrixIndexException` is thrown unless `0 <= column < columnDimension.`

  Specified by:
    `getColumnAsDoubleArray` in interface `BigMatrix`
  Parameters:
    `col` - the column to be fetched
  Returns:
    array of entries in the column
  Throws:
    `MatrixIndexException` - if the specified column index is not valid

### getEntry

    public BigDecimal getEntry(int row,
                               int column)
                        throws MatrixIndexException

  Deprecated.
  Returns the entry in the specified row and column.

  Row and column indices start at 0 and must satisfy

  - `0 <= row < rowDimension`
  - `0 <= column < columnDimension`
  otherwise a `MatrixIndexException` is thrown.

  Specified by:
    `getEntry` in interface `BigMatrix`
  Parameters:
    `row` - row location of entry to be fetched
    `column` - column location of entry to be fetched
  Returns:
    matrix entry in row,column
  Throws:
    `MatrixIndexException` - if the row or column index is not valid

### getEntryAsDouble

    public double getEntryAsDouble(int row,
                                   int column)
                            throws MatrixIndexException

  Deprecated.
  Returns the entry in the specified row and column as a double.

  Row and column indices start at 0 and must satisfy

  - `0 <= row < rowDimension`
  - `0 <= column < columnDimension`
  otherwise a `MatrixIndexException` is thrown.

  Specified by:
    `getEntryAsDouble` in interface `BigMatrix`
  Parameters:
    `row` - row location of entry to be fetched
    `column` - column location of entry to be fetched
  Returns:
    matrix entry in row,column
  Throws:
    `MatrixIndexException` - if the row or column index is not valid

### transpose

    public BigMatrix transpose()

  Deprecated.
  Returns the transpose matrix.

  Specified by:
    `transpose` in interface `BigMatrix`
  Returns:
    transpose matrix

### inverse

    public BigMatrix inverse()
                      throws InvalidMatrixException

  Deprecated.
  Returns the inverse matrix if this matrix is invertible.

  Specified by:
    `inverse` in interface `BigMatrix`
  Returns:
    inverse matrix
  Throws:
    `InvalidMatrixException` - if this is not invertible

### getDeterminant

    public BigDecimal getDeterminant()
                              throws InvalidMatrixException

  Deprecated.
  Returns the determinant of this matrix.

  Specified by:
    `getDeterminant` in interface `BigMatrix`
  Returns:
    determinant
  Throws:
    `InvalidMatrixException` - if matrix is not square

### isSquare

    public boolean isSquare()

  Deprecated.
  Is this a square matrix?

  Specified by:
    `isSquare` in interface `AnyMatrix`
  Returns:
    true if the matrix is square (rowDimension = columnDimension)

### isSingular

    public boolean isSingular()

  Deprecated.
  Is this a singular matrix?

  Returns:
    true if the matrix is singular

### getRowDimension

    public int getRowDimension()

  Deprecated.
  Returns the number of rows in the matrix.

  Specified by:
    `getRowDimension` in interface `AnyMatrix`
  Returns:
    rowDimension

### getColumnDimension

    public int getColumnDimension()

  Deprecated.
  Returns the number of columns in the matrix.

  Specified by:
    `getColumnDimension` in interface `AnyMatrix`
  Returns:
    columnDimension

### getTrace

    public BigDecimal getTrace()
                        throws IllegalArgumentException

  Deprecated.
  Returns the trace of the matrix (the sum of the elements on the main diagonal).

  Specified by:
    `getTrace` in interface `BigMatrix`
  Returns:
    trace
  Throws:
    `IllegalArgumentException` - if this matrix is not square.

### operate

    public BigDecimal[] operate(BigDecimal[] v)
                         throws IllegalArgumentException

  Deprecated.
  Returns the result of multiplying this by the vector `v`.

  Specified by:
    `operate` in interface `BigMatrix`
  Parameters:
    `v` - the vector to operate on
  Returns:
    this*v
  Throws:
    `IllegalArgumentException` - if columnDimension != v.size()

### operate

    public BigDecimal[] operate(double[] v)
                         throws IllegalArgumentException

  Deprecated.
  Returns the result of multiplying this by the vector `v`.

  Parameters:
    `v` - the vector to operate on
  Returns:
    this*v
  Throws:
    `IllegalArgumentException` - if columnDimension != v.size()

### preMultiply

    public BigDecimal[] preMultiply(BigDecimal[] v)
                             throws IllegalArgumentException

  Deprecated.
  Returns the (row) vector result of premultiplying this by the vector `v`.

  Specified by:
    `preMultiply` in interface `BigMatrix`
  Parameters:
    `v` - the row vector to premultiply by
  Returns:
    v*this
  Throws:
    `IllegalArgumentException` - if rowDimension != v.size()

### solve

    public BigDecimal[] solve(BigDecimal[] b)
                       throws IllegalArgumentException,
                              InvalidMatrixException

  Deprecated.
  Returns a matrix of (column) solution vectors for linear systems with coefficient matrix = this and constant vectors = columns of `b`.

  Specified by:
    `solve` in interface `BigMatrix`
  Parameters:
    `b` - array of constants forming RHS of linear systems to to solve
  Returns:
    solution array
  Throws:
    `IllegalArgumentException` - if this.rowDimension != row dimension
    `InvalidMatrixException` - if this matrix is not square or is singular

### solve

    public BigDecimal[] solve(double[] b)
                       throws IllegalArgumentException,
                              InvalidMatrixException

  Deprecated.
  Returns a matrix of (column) solution vectors for linear systems with coefficient matrix = this and constant vectors = columns of `b`.

  Parameters:
    `b` - array of constants forming RHS of linear systems to to solve
  Returns:
    solution array
  Throws:
    `IllegalArgumentException` - if this.rowDimension != row dimension
    `InvalidMatrixException` - if this matrix is not square or is singular

### solve

    public BigMatrix solve(BigMatrix b)
                    throws IllegalArgumentException,
                           InvalidMatrixException

  Deprecated.
  Returns a matrix of (column) solution vectors for linear systems with coefficient matrix = this and constant vectors = columns of `b`.

  Specified by:
    `solve` in interface `BigMatrix`
  Parameters:
    `b` - matrix of constant vectors forming RHS of linear systems to to solve
  Returns:
    matrix of solution vectors
  Throws:
    `IllegalArgumentException` - if this.rowDimension != row dimension
    `InvalidMatrixException` - if this matrix is not square or is singular

### luDecompose

    public void luDecompose()
                     throws InvalidMatrixException

  Deprecated.
  Computes a new LU decompostion for this matrix, storing the result for use by other methods.

  Implementation Note:
  Uses Crout's algortithm, with partial pivoting.

  Usage Note:
  This method should rarely be invoked directly. Its only use is to force recomputation of the LU decomposition when changes have been made to the underlying data using direct array references. Changes made using setXxx methods will trigger recomputation when needed automatically.

  Throws:
    `InvalidMatrixException` - if the matrix is non-square or singular.

### toString

    public String toString()

  Deprecated.
  Get a string representation for this matrix.

  Overrides:
    `toString` in class `Object`
  Returns:
    a string representation for this matrix

### equals

    public boolean equals(Object object)

  Deprecated.
  Returns true iff `object` is a `BigMatrixImpl` instance with the same dimensions as this and all corresponding matrix entries are equal. BigDecimal.equals is used to compare corresponding entries.

  Overrides:
    `equals` in class `Object`
  Parameters:
    `object` - the object to test equality against.
  Returns:
    true if object equals this

### hashCode

    public int hashCode()

  Deprecated.
  Computes a hashcode for the matrix.

  Overrides:
    `hashCode` in class `Object`
  Returns:
    hashcode for matrix

### getLUMatrix

    protected BigMatrix getLUMatrix()
                             throws InvalidMatrixException

  Deprecated.
  Returns the LU decomposition as a BigMatrix. Returns a fresh copy of the cached LU matrix if this has been computed; otherwise the composition is computed and cached for use by other methods. Since a copy is returned in either case, changes to the returned matrix do not affect the LU decomposition property.

  The matrix returned is a compact representation of the LU decomposition. Elements below the main diagonal correspond to entries of the "L" matrix; elements on and above the main diagonal correspond to entries of the "U" matrix.

  Example:

           Returned matrix                L                  U
               2  3  1                   1  0  0            2  3  1
               5  4  6                   5  1  0            0  4  6
               1  7  8                   1  7  1            0  0  8

  The L and U matrices satisfy the matrix equation LU = permuteRows(this),
  where permuteRows reorders the rows of the matrix to follow the order determined by the permutation property.

  Returns:
    LU decomposition matrix
  Throws:
    `InvalidMatrixException` - if the matrix is non-square or singular.

### getPermutation

    protected int[] getPermutation()

  Deprecated.
  Returns the permutation associated with the lu decomposition. The entries of the array represent a permutation of the numbers 0, ... , nRows - 1.

  Example: permutation = [1, 2, 0] means current 2nd row is first, current third row is second and current first row is last.

  Returns a fresh copy of the array.

  Returns:
    the permutation

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003-2011 The Apache Software Foundation. All Rights Reserved.