|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface BigMatrix
Interface defining a real-valued matrix with basic algebraic operations, using BigDecimal representations for the entries.
Matrix element indexing is 0-based -- e.g., getEntry(0, 0)
returns the element in the first row, first column of the matrix.
Method Summary | |
---|---|
BigMatrix |
add(BigMatrix m)
Compute the sum of this and m. |
BigMatrix |
copy()
Returns a (deep) copy of this. |
java.math.BigDecimal[] |
getColumn(int col)
Returns the entries in column number col as an array. |
double[] |
getColumnAsDoubleArray(int col)
Returns the entries in column number col as an array
of double values. |
int |
getColumnDimension()
Returns the number of columns in the matrix. |
BigMatrix |
getColumnMatrix(int column)
Returns the entries in column number column
as a column matrix. |
java.math.BigDecimal[][] |
getData()
Returns matrix entries as a two-dimensional array. |
double[][] |
getDataAsDoubleArray()
Returns matrix entries as a two-dimensional array. |
java.math.BigDecimal |
getDeterminant()
Returns the determinant of this matrix. |
java.math.BigDecimal |
getEntry(int row,
int column)
Returns the entry in the specified row and column. |
double |
getEntryAsDouble(int row,
int column)
Returns the entry in the specified row and column as a double. |
java.math.BigDecimal |
getNorm()
Returns the maximum absolute row sum norm of the matrix. |
int |
getRoundingMode()
Gets the rounding mode |
java.math.BigDecimal[] |
getRow(int row)
Returns the entries in row number row as an array. |
double[] |
getRowAsDoubleArray(int row)
Returns the entries in row number row as an array
of double values. |
int |
getRowDimension()
Returns the number of rows in the matrix. |
BigMatrix |
getRowMatrix(int row)
Returns the entries in row number row
as a row matrix. |
BigMatrix |
getSubMatrix(int[] selectedRows,
int[] selectedColumns)
Gets a submatrix. |
BigMatrix |
getSubMatrix(int startRow,
int endRow,
int startColumn,
int endColumn)
Gets a submatrix. |
java.math.BigDecimal |
getTrace()
Returns the trace of the matrix (the sum of the elements on the main diagonal). |
BigMatrix |
inverse()
Returns the inverse of this matrix. |
boolean |
isSingular()
Is this a singular matrix? |
boolean |
isSquare()
Is this a square matrix? |
BigMatrix |
multiply(BigMatrix m)
Returns the result of postmultiplying this by m. |
java.math.BigDecimal[] |
operate(java.math.BigDecimal[] v)
Returns the result of multiplying this by the vector v . |
java.math.BigDecimal[] |
preMultiply(java.math.BigDecimal[] v)
Returns the (row) vector result of premultiplying this by the vector v . |
BigMatrix |
preMultiply(BigMatrix m)
Returns the result premultiplying this by m . |
BigMatrix |
scalarAdd(java.math.BigDecimal d)
Returns the result of adding d to each entry of this. |
BigMatrix |
scalarMultiply(java.math.BigDecimal d)
Returns the result multiplying each entry of this by d. |
java.math.BigDecimal[] |
solve(java.math.BigDecimal[] b)
Returns the solution vector for a linear system with coefficient matrix = this and constant vector = b . |
BigMatrix |
solve(BigMatrix b)
Returns a matrix of (column) solution vectors for linear systems with coefficient matrix = this and constant vectors = columns of b . |
BigMatrix |
subtract(BigMatrix m)
Compute this minus m. |
BigMatrix |
transpose()
Returns the transpose of this matrix. |
Method Detail |
---|
BigMatrix copy()
BigMatrix add(BigMatrix m) throws java.lang.IllegalArgumentException
m
- matrix to be added
java.lang.IllegalArgumentException
- if m is not the same size as thisBigMatrix subtract(BigMatrix m) throws java.lang.IllegalArgumentException
m
- matrix to be subtracted
java.lang.IllegalArgumentException
- if m is not the same size as thisBigMatrix scalarAdd(java.math.BigDecimal d)
d
- value to be added to each entry
BigMatrix scalarMultiply(java.math.BigDecimal d)
d
- value to multiply all entries by
BigMatrix multiply(BigMatrix m) throws java.lang.IllegalArgumentException
m
- matrix to postmultiply by
java.lang.IllegalArgumentException
- if columnDimension(this) != rowDimension(m)BigMatrix preMultiply(BigMatrix m) throws java.lang.IllegalArgumentException
m
.
m
- matrix to premultiply by
java.lang.IllegalArgumentException
- if rowDimension(this) != columnDimension(m)java.math.BigDecimal[][] getData()
double[][] getDataAsDoubleArray()
int getRoundingMode()
java.math.BigDecimal getNorm()
BigMatrix getSubMatrix(int startRow, int endRow, int startColumn, int endColumn) throws MatrixIndexException
startRow
- Initial row indexendRow
- Final row indexstartColumn
- Initial column indexendColumn
- Final column index
MatrixIndexException
- if the indices are not validBigMatrix getSubMatrix(int[] selectedRows, int[] selectedColumns) throws MatrixIndexException
selectedRows
- Array of row indices.selectedColumns
- Array of column indices.
MatrixIndexException
- if row or column selections are not validBigMatrix getRowMatrix(int row) throws MatrixIndexException
row
as a row matrix. Row indices start at 0.
row
- the row to be fetched
MatrixIndexException
- if the specified row index is invalidBigMatrix getColumnMatrix(int column) throws MatrixIndexException
column
as a column matrix. Column indices start at 0.
column
- the column to be fetched
MatrixIndexException
- if the specified column index is invalidjava.math.BigDecimal[] getRow(int row) throws MatrixIndexException
row
as an array.
Row indices start at 0. A MatrixIndexException
is thrown
unless 0 <= row < rowDimension.
row
- the row to be fetched
MatrixIndexException
- if the specified row index is not validdouble[] getRowAsDoubleArray(int row) throws MatrixIndexException
row
as an array
of double values.
Row indices start at 0. A MatrixIndexException
is thrown
unless 0 <= row < rowDimension.
row
- the row to be fetched
MatrixIndexException
- if the specified row index is not validjava.math.BigDecimal[] getColumn(int col) throws MatrixIndexException
col
as an array.
Column indices start at 0. A MatrixIndexException
is thrown
unless 0 <= column < columnDimension.
col
- the column to be fetched
MatrixIndexException
- if the specified column index is not validdouble[] getColumnAsDoubleArray(int col) throws MatrixIndexException
col
as an array
of double values.
Column indices start at 0. A MatrixIndexException
is thrown
unless 0 <= column < columnDimension.
col
- the column to be fetched
MatrixIndexException
- if the specified column index is not validjava.math.BigDecimal getEntry(int row, int column) throws MatrixIndexException
Row and column indices start at 0 and must satisfy
0 <= row < rowDimension
0 <= column < columnDimension
MatrixIndexException
is thrown.
row
- row location of entry to be fetchedcolumn
- column location of entry to be fetched
MatrixIndexException
- if the row or column index is not validdouble getEntryAsDouble(int row, int column) throws MatrixIndexException
Row and column indices start at 0 and must satisfy
0 <= row < rowDimension
0 <= column < columnDimension
MatrixIndexException
is thrown.
row
- row location of entry to be fetchedcolumn
- column location of entry to be fetched
MatrixIndexException
- if the row or column index is not validBigMatrix transpose()
BigMatrix inverse() throws InvalidMatrixException
InvalidMatrixException
- if
this is not invertiblejava.math.BigDecimal getDeterminant() throws InvalidMatrixException
InvalidMatrixException
- if
matrix is not squareboolean isSquare()
boolean isSingular()
int getRowDimension()
int getColumnDimension()
java.math.BigDecimal getTrace()
java.math.BigDecimal[] operate(java.math.BigDecimal[] v) throws java.lang.IllegalArgumentException
v
.
v
- the vector to operate on
java.lang.IllegalArgumentException
- if columnDimension != v.size()java.math.BigDecimal[] preMultiply(java.math.BigDecimal[] v) throws java.lang.IllegalArgumentException
v
.
v
- the row vector to premultiply by
java.lang.IllegalArgumentException
- if rowDimension != v.size()java.math.BigDecimal[] solve(java.math.BigDecimal[] b) throws java.lang.IllegalArgumentException, InvalidMatrixException
b
.
b
- constant vector
java.lang.IllegalArgumentException
- if this.rowDimension != b.length
InvalidMatrixException
- if this matrix is not square or is singularBigMatrix solve(BigMatrix b) throws java.lang.IllegalArgumentException, InvalidMatrixException
b
.
b
- matrix of constant vectors forming RHS of linear systems to
to solve
java.lang.IllegalArgumentException
- if this.rowDimension != row dimension
InvalidMatrixException
- if this matrix is not square or is singular
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |