|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Interface defining a real-valued matrix with basic algebraic operations
Method Summary | |
RealMatrix |
add(RealMatrix m)
Compute the sum of this and m. |
RealMatrix |
copy()
Returns a (deep) copy of this. |
double[] |
getColumn(int col)
Returns the entries in column number col as an array. |
int |
getColumnDimension()
Returns the number of columns in the matrix. |
double[][] |
getData()
Returns matrix entries as a two-dimensional array. |
double |
getDeterminant()
Returns the determinant of this matrix. |
double |
getEntry(int row,
int column)
Returns the entry in the specified row and column. |
double |
getNorm()
Returns the maximum absolute row sum norm of the matrix. |
int |
getRank()
Returns the rank of the matrix. |
double[] |
getRow(int row)
Returns the entries in row number row as an array. |
int |
getRowDimension()
Returns the number of rows in the matrix. |
double |
getTrace()
Returns the trace of the matrix (the sum of the elements on the main diagonal). |
RealMatrix |
inverse()
Returns the inverse of this matrix. |
boolean |
isSingular()
Is this a singular matrix? |
boolean |
isSquare()
Is this a square matrix? |
RealMatrix |
multiply(RealMatrix m)
Returns the result postmultiplying this by m. |
double[] |
operate(double[] v)
Returns the result of multiplying this by the vector v . |
RealMatrix |
preMultiply(double[] v)
Returns the result of premultiplying this by the vector v . |
RealMatrix |
scalarAdd(double d)
Returns the result of adding d to each entry of this. |
RealMatrix |
scalarMultiply(double d)
Returns the result multiplying each entry of this by d. |
void |
setData(double[][] data)
Overwrites the underlying data for the matrix with a fresh copy of data . |
void |
setEntry(int row,
int column,
double value)
Sets the entry in the specified row and column to the specified value. |
double[] |
solve(double[] b)
Returns the solution vector for a linear system with coefficient matrix = this and constant vector = b . |
RealMatrix |
solve(RealMatrix b)
Returns a matrix of (column) solution vectors for linear systems with coefficient matrix = this and constant vectors = columns of b . |
RealMatrix |
subtract(RealMatrix m)
Compute this minus m. |
RealMatrix |
transpose()
Returns the transpose of this matrix. |
Method Detail |
public RealMatrix copy()
public RealMatrix add(RealMatrix m) throws IllegalArgumentException
m
- matrix to be added
IllegalArgumentException
- if m is not the same size as thispublic RealMatrix subtract(RealMatrix m) throws IllegalArgumentException
m
- matrix to be subtracted
IllegalArgumentException
- if m is not the same size as thispublic int getRank()
public RealMatrix scalarAdd(double d)
d
- value to be added to each entry
public RealMatrix scalarMultiply(double d)
d
- value to multiply all entries by
public RealMatrix multiply(RealMatrix m) throws IllegalArgumentException
m
- matrix to postmultiply by
IllegalArgumentException
- if columnDimension(this) != rowDimension(m)public double[][] getData()
public void setData(double[][] data)
data
.
data
- 2-dimensional array of entriespublic double getNorm()
public double[] getRow(int row) throws IllegalArgumentException
row
as an array.
row
- the row to be fetched
IllegalArgumentException
- if row > rowDimensionpublic double[] getColumn(int col) throws IllegalArgumentException
col
as an array.
col
- column to fetch
IllegalArgumentException
- if column > columnDimensionpublic double getEntry(int row, int column) throws IllegalArgumentException
row
- row location of entry to be fetchedcolumn
- column location of entry to be fetched
IllegalArgumentException
- if entry does not existpublic void setEntry(int row, int column, double value) throws IllegalArgumentException
row
- row location of entry to be setcolumn
- column location of entry to be setvalue
- value to set
IllegalArgumentException
- if entry does not existpublic RealMatrix transpose()
public RealMatrix inverse() throws IllegalArgumentException
IllegalArgumentException
- if *this is not invertiblepublic double getDeterminant()
public boolean isSquare()
public boolean isSingular()
public int getRowDimension()
public int getColumnDimension()
public double getTrace()
public double[] operate(double[] v) throws IllegalArgumentException
v
.
v
- the vector to operate on
IllegalArgumentException
- if columnDimension != v.size()public RealMatrix preMultiply(double[] v) throws IllegalArgumentException
v
.
v
- the row vector to premultiply by
IllegalArgumentException
- if rowDimension != v.size()public double[] solve(double[] b) throws IllegalArgumentException
b
.
b
- constant vector
IllegalArgumentException
- if rowDimension != b.length or matrix
is singularpublic RealMatrix solve(RealMatrix b) throws IllegalArgumentException
b
.
b
- matrix of constant vectors forming RHS of linear systems to
to solve
IllegalArgumentException
- if rowDimension != row dimension of b
or this is not square or singular
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |