|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.math.linear.AbstractRealMatrix
org.apache.commons.math.linear.OpenMapRealMatrix
public class OpenMapRealMatrix
Sparse matrix implementation based on an open addressed map.
| Constructor Summary | |
|---|---|
OpenMapRealMatrix(int rowDimension,
int columnDimension)
Build a sparse matrix with the supplied row and column dimensions. |
|
OpenMapRealMatrix(OpenMapRealMatrix matrix)
Build a matrix by copying another one. |
|
| Method Summary | |
|---|---|
OpenMapRealMatrix |
add(OpenMapRealMatrix m)
Compute the sum of this and m. |
OpenMapRealMatrix |
add(RealMatrix m)
Compute the sum of this and m. |
void |
addToEntry(int row,
int column,
double increment)
Change an entry in the specified row and column. |
OpenMapRealMatrix |
copy()
Returns a (deep) copy of this. |
OpenMapRealMatrix |
createMatrix(int rowDimension,
int columnDimension)
Create a new RealMatrix of the same type as the instance with the supplied row and column dimensions. |
int |
getColumnDimension()
Returns the number of columns in the matrix. |
double |
getEntry(int row,
int column)
Returns the entry in the specified row and column. |
int |
getRowDimension()
Returns the number of rows in the matrix. |
OpenMapRealMatrix |
multiply(OpenMapRealMatrix m)
Returns the result of postmultiplying this by m. |
RealMatrix |
multiply(RealMatrix m)
Returns the result of postmultiplying this by m. |
void |
multiplyEntry(int row,
int column,
double factor)
Change an entry in the specified row and column. |
void |
setEntry(int row,
int column,
double value)
Set the entry in the specified row and column. |
OpenMapRealMatrix |
subtract(OpenMapRealMatrix m)
Compute this minus m. |
OpenMapRealMatrix |
subtract(RealMatrix m)
Compute this minus m. |
| Methods inherited from class org.apache.commons.math.linear.AbstractRealMatrix |
|---|
copySubMatrix, copySubMatrix, equals, getColumn, getColumnMatrix, getColumnVector, getData, getDeterminant, getFrobeniusNorm, getNorm, getRow, getRowMatrix, getRowVector, getSubMatrix, getSubMatrix, getTrace, hashCode, inverse, isSingular, isSquare, luDecompose, operate, operate, preMultiply, preMultiply, preMultiply, scalarAdd, scalarMultiply, setColumn, setColumnMatrix, setColumnVector, setRow, setRowMatrix, setRowVector, setSubMatrix, solve, solve, toString, transpose, walkInColumnOrder, walkInColumnOrder, walkInColumnOrder, walkInColumnOrder, walkInOptimizedOrder, walkInOptimizedOrder, walkInOptimizedOrder, walkInOptimizedOrder, walkInRowOrder, walkInRowOrder, walkInRowOrder, walkInRowOrder |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.apache.commons.math.linear.RealMatrix |
|---|
copySubMatrix, copySubMatrix, getColumn, getColumnMatrix, getColumnVector, getData, getDeterminant, getFrobeniusNorm, getNorm, getRow, getRowMatrix, getRowVector, getSubMatrix, getSubMatrix, getTrace, inverse, isSingular, operate, operate, preMultiply, preMultiply, preMultiply, scalarAdd, scalarMultiply, setColumn, setColumnMatrix, setColumnVector, setRow, setRowMatrix, setRowVector, setSubMatrix, solve, solve, transpose, walkInColumnOrder, walkInColumnOrder, walkInColumnOrder, walkInColumnOrder, walkInOptimizedOrder, walkInOptimizedOrder, walkInOptimizedOrder, walkInOptimizedOrder, walkInRowOrder, walkInRowOrder, walkInRowOrder, walkInRowOrder |
| Methods inherited from interface org.apache.commons.math.linear.AnyMatrix |
|---|
isSquare |
| Constructor Detail |
|---|
public OpenMapRealMatrix(int rowDimension,
int columnDimension)
rowDimension - number of rows of the matrixcolumnDimension - number of columns of the matrixpublic OpenMapRealMatrix(OpenMapRealMatrix matrix)
matrix - matrix to copy| Method Detail |
|---|
public OpenMapRealMatrix copy()
copy in interface RealMatrixcopy in class AbstractRealMatrix
public OpenMapRealMatrix createMatrix(int rowDimension,
int columnDimension)
throws IllegalArgumentException
createMatrix in interface RealMatrixcreateMatrix in class AbstractRealMatrixrowDimension - the number of rows in the new matrixcolumnDimension - the number of columns in the new matrix
IllegalArgumentException - if row or column dimension is not positivepublic int getColumnDimension()
getColumnDimension in interface AnyMatrixgetColumnDimension in class AbstractRealMatrix
public OpenMapRealMatrix add(RealMatrix m)
throws IllegalArgumentException
add in interface RealMatrixadd in class AbstractRealMatrixm - matrix to be added
IllegalArgumentException - if m is not the same size as this
public OpenMapRealMatrix add(OpenMapRealMatrix m)
throws IllegalArgumentException
m.
m - matrix to be added
IllegalArgumentException - if m is not the same size as this
public OpenMapRealMatrix subtract(RealMatrix m)
throws IllegalArgumentException
subtract in interface RealMatrixsubtract in class AbstractRealMatrixm - matrix to be subtracted
IllegalArgumentException - if m is not the same size as this
public OpenMapRealMatrix subtract(OpenMapRealMatrix m)
throws IllegalArgumentException
m.
m - matrix to be subtracted
IllegalArgumentException - if m is not the same size as this
public RealMatrix multiply(RealMatrix m)
throws IllegalArgumentException
multiply in interface RealMatrixmultiply in class AbstractRealMatrixm - matrix to postmultiply by
IllegalArgumentException - if columnDimension(this) != rowDimension(m)
public OpenMapRealMatrix multiply(OpenMapRealMatrix m)
throws IllegalArgumentException
m - matrix to postmultiply by
IllegalArgumentException - if columnDimension(this) != rowDimension(m)
public double getEntry(int row,
int column)
throws MatrixIndexException
Row and column indices start at 0 and must satisfy
0 <= row < rowDimension 0 <= column < columnDimensionMatrixIndexException is thrown.
getEntry in interface RealMatrixgetEntry in class AbstractRealMatrixrow - row location of entry to be fetchedcolumn - column location of entry to be fetched
MatrixIndexException - if the row or column index is not validpublic int getRowDimension()
getRowDimension in interface AnyMatrixgetRowDimension in class AbstractRealMatrix
public void setEntry(int row,
int column,
double value)
throws MatrixIndexException
Row and column indices start at 0 and must satisfy
0 <= row < rowDimension 0 <= column < columnDimensionMatrixIndexException is thrown.
setEntry in interface RealMatrixsetEntry in class AbstractRealMatrixrow - row location of entry to be setcolumn - column location of entry to be setvalue - matrix entry to be set in row,column
MatrixIndexException - if the row or column index is not valid
public void addToEntry(int row,
int column,
double increment)
throws MatrixIndexException
Row and column indices start at 0 and must satisfy
0 <= row < rowDimension 0 <= column < columnDimensionMatrixIndexException is thrown.
addToEntry in interface RealMatrixaddToEntry in class AbstractRealMatrixrow - row location of entry to be setcolumn - column location of entry to be setincrement - value to add to the current matrix entry in row,column
MatrixIndexException - if the row or column index is not valid
public void multiplyEntry(int row,
int column,
double factor)
throws MatrixIndexException
Row and column indices start at 0 and must satisfy
0 <= row < rowDimension 0 <= column < columnDimensionMatrixIndexException is thrown.
multiplyEntry in interface RealMatrixmultiplyEntry in class AbstractRealMatrixrow - row location of entry to be setcolumn - column location of entry to be setfactor - multiplication factor for the current matrix entry in row,column
MatrixIndexException - if the row or column index is not valid
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||