|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--edu.iu.iv.common.datamodels.matrixmodel.SparseDoubleMatrixModel
An adapter class that implements the DoubleMatrixModel interface and extends the
Cern Colt API's fast hashed implementation of a sparse 2D matrix.
This type of matrix model is oriented towards users who have data in matrix format that is sparsely
filled. An example of such a matrix is a term-document matrix where most terms occur in very few
documents, resulting in an extremely sparse matrix. Using a sparse matrix model for such problems
instead of a dense one usually results in significantly lower memory utilization and higher performance.
Users new to to using matrices are urged to use the methods defined by the interface rather than
using the inherited methods directly since this model is optimized for speed at the cost of error
checking. Some methods such as getQuick and setQuick do not do any
bounds checking and hence the result of such function calls is undefined in case of error.
We recommend you to read the documentation for the CERN Colt API.
SparseDoubleMatrix2D| Constructor Summary | |
SparseDoubleMatrixModel(double[][] values)
Creates a matrix and fills them with the elements of the array passed in. |
|
SparseDoubleMatrixModel(int numRows,
int numCols)
Creates a matrix with numRows rows and numCols columns and fills them with zero values. |
|
| Method Summary | |
double |
get(int row,
int column)
Gets the element at the specified row and column. |
java.lang.String |
getColumnLabel(int column)
Gets the label for the specified column. |
int |
getNumberOfColumns()
|
int |
getNumberOfRows()
|
java.lang.String |
getRowLabel(int row)
Gets the label for the specified row. |
void |
set(int row,
int column,
double value)
Sets the value of the element at the specified row and column. |
void |
setColumnLabel(int column,
java.lang.String text)
Sets the label at the specified column to the specified text. |
void |
setRowLabel(int row,
java.lang.String text)
Sets the label of the specified row to the specified text. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public SparseDoubleMatrixModel(int numRows,
int numCols)
numRows - The number of rows for this matrix.numCols - The number of columns for this matrix.public SparseDoubleMatrixModel(double[][] values)
values - The array containing matrix elements.| Method Detail |
public void set(int row,
int column,
double value)
DoubleMatrixModel
set in interface DoubleMatrixModelrow - The row number.column - The column number.value - The value of the element.DoubleMatrixModel.set(int, int, double)
public double get(int row,
int column)
DoubleMatrixModel
get in interface DoubleMatrixModelrow - The row number of this element.column - The column number of this element.
DoubleMatrixModel.get(int, int)
public void setColumnLabel(int column,
java.lang.String text)
DoubleMatrixModel
setColumnLabel in interface DoubleMatrixModelcolumn - The column number.text - The text of the label.DoubleMatrixModel.setColumnLabel(int, java.lang.String)public java.lang.String getColumnLabel(int column)
DoubleMatrixModel
getColumnLabel in interface DoubleMatrixModelcolumn - The column number.
DoubleMatrixModel.getColumnLabel(int)
public void setRowLabel(int row,
java.lang.String text)
DoubleMatrixModel
setRowLabel in interface DoubleMatrixModelrow - The row number.text - The text of the label.DoubleMatrixModel.setRowLabel(int, java.lang.String)public java.lang.String getRowLabel(int row)
DoubleMatrixModel
getRowLabel in interface DoubleMatrixModelrow - The row number.
DoubleMatrixModel.getRowLabel(int)public int getNumberOfRows()
getNumberOfRows in interface DoubleMatrixModelpublic int getNumberOfColumns()
getNumberOfColumns in interface DoubleMatrixModel
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||