public interface SparseMatrix extends Matrix
Interface of sparse matrix
Copyright: Copyright (c) 2005
Company: IST, Drexel University
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(Cell cell)
Add a cell to the sparse matrix.
|
Cell |
createCell(int row,
int column,
byte[] data)
This method will be called when the sparse matrix loads data from a binary file.
|
Cell |
createCell(int row,
int column,
String data)
This method will be called when the sparse matrix loads data from a text file.
|
SparseMatrix |
createSparseMatrix()
This method return an empty sparse matrix with the same implemented type as the current matrix.
|
boolean |
finalizeData()
It is equal to calling finalizeData(true)
|
boolean |
finalizeData(boolean sorting)
Any sparse matrix has two possible modes, writing mode and reading mode.
|
void |
flush()
Many implementations of sparse matrix cache cells in memory.
|
boolean |
genCooccurrenceMatrix(IntSparseMatrix outputCooccurMatrix)
The cell (i,j) in the output cooccurrence matrix stores the cooccurrence count of the i-th row and the j-th row.
|
boolean |
genCooccurrenceMatrix(SparseMatrix matrixY,
int minOccurrence,
IntSparseMatrix outputCooccurMatrix)
The cell (i,j) in the output cooccurrence matrix stores the cooccurrence count of the i-th row in the current matrix and the j-th row
in the matrixY.
|
boolean |
genCooccurrenceMatrix(SparseMatrix matrixY,
IntSparseMatrix outputCooccurMatrix)
The cell (i,j) in the output cooccurrence matrix stores the cooccurrence count of the i-th row in the current matrix and the j-th row
in the matrixY.
|
Cell |
getCell(int row,
int column)
If the specified cell doesn't exist, this method will return null.
|
Cell |
getNonZeroCellInColumn(int column,
int index)
This method returns the index-th non-zero cell in the given row.
|
Cell |
getNonZeroCellInRow(int row,
int index)
This method returns the index-th non-zero cell in the given column.
|
int |
getNonZeroColumnInRow(int row,
int index)
This method returns the column index of the index-th non-zero cell in the given row.
|
int[] |
getNonZeroColumnsInRow(int row)
If the given row has n non-zero cells, this method returns a n-length integer array.
|
double |
getNonZeroDoubleScoreInColumn(int column,
int index)
This method returns the double score of the index-th non-zero cell in the given column.
|
double |
getNonZeroDoubleScoreInRow(int row,
int index)
This method returns the double score of the index-th non-zero cell in the given row.
|
double[] |
getNonZeroDoubleScoresInColumn(int column)
If the given column has n non-zero cells, this method returns a n-length double array.
|
double[] |
getNonZeroDoubleScoresInRow(int row)
If the given row has n non-zero cells, this method returns a n-length double array.
|
int |
getNonZeroIntScoreInColumn(int column,
int index)
This method returns the integer score of the index-th non-zero cell in the given column.
|
int |
getNonZeroIntScoreInRow(int row,
int index)
This method returns the integer score of the index-th non-zero cell in the given row.
|
int[] |
getNonZeroIntScoresInColumn(int column)
If the given column has n non-zero cells, this method returns a n-length integer array.
|
int[] |
getNonZeroIntScoresInRow(int row)
If the given row has n non-zero cells, this method returns a n-length integer array.
|
int |
getNonZeroNum() |
int |
getNonZeroNumInColumn(int column)
If the transposed matrix is not set yet, this method will automatically generate the transposed matrix.
|
int |
getNonZeroNumInRow(int row) |
int |
getNonZeroRowInColumn(int column,
int index)
This method returns the row index of the index-th non-zero cell in the given column.
|
int[] |
getNonZeroRowsInColumn(int column)
If the given column has n non-zero cells, this method returns a n-length integer array.
|
boolean |
isFinalized()
If this method returns true, one can not add data to the sparse matrix any more.
|
close, columns, cosine, getBaseColumn, getBaseRow, getCellDataLength, getCooccurrenceCount, getDouble, getInt, getTranspose, rows, setTranspose, transposeint getNonZeroNum()
int getNonZeroNumInRow(int row)
row - the index of the rowint getNonZeroNumInColumn(int column)
column - the index of the columnint getNonZeroColumnInRow(int row,
int index)
row - the index of the rowindex - the index-th non-zero cellint getNonZeroRowInColumn(int column,
int index)
column - the index of the columnindex - the index-th non-zero cellint[] getNonZeroColumnsInRow(int row)
row - the index of rowint[] getNonZeroRowsInColumn(int column)
column - the index of the columnCell getNonZeroCellInRow(int row, int index)
row - the index of the rowindex - the index-th non-zero cellCell getNonZeroCellInColumn(int column, int index)
column - the index of the columnindex - the index-th non-zero celldouble getNonZeroDoubleScoreInRow(int row,
int index)
row - the index of the row.index - the index-th non-zero celldouble getNonZeroDoubleScoreInColumn(int column,
int index)
column - the index of the columnindex - the index-th non-zero celldouble[] getNonZeroDoubleScoresInRow(int row)
row - the index of rowdouble[] getNonZeroDoubleScoresInColumn(int column)
column - the index of the columnint getNonZeroIntScoreInRow(int row,
int index)
row - the index of the row.index - the index-th non-zero cellint getNonZeroIntScoreInColumn(int column,
int index)
column - the index of the columnindex - the index-th non-zero cellint[] getNonZeroIntScoresInRow(int row)
row - the index of rowint[] getNonZeroIntScoresInColumn(int column)
column - the index of the columnboolean genCooccurrenceMatrix(IntSparseMatrix outputCooccurMatrix)
outputCooccurMatrix - the output cooccurrence matrixboolean genCooccurrenceMatrix(SparseMatrix matrixY, IntSparseMatrix outputCooccurMatrix)
matrixY - another sparse matrixoutputCooccurMatrix - the output cooccurrence matrixboolean genCooccurrenceMatrix(SparseMatrix matrixY, int minOccurrence, IntSparseMatrix outputCooccurMatrix)
matrixY - another sparse matrixminOccurrence - the minimum cooccurrence countoutputCooccurMatrix - the output cooccurrence matrixCell getCell(int row, int column)
row - the index of row in the matrixcolumn - the index of column in the matrixboolean add(Cell cell)
cell - the input cellvoid flush()
boolean finalizeData()
boolean finalizeData(boolean sorting)
sorting - if need to sort the added cells before finalization.boolean isFinalized()
SparseMatrix createSparseMatrix()
Cell createCell(int row, int column, byte[] data)
row - the row index of the cellcolumn - the column index of the celldata - the input data for the cellCopyright © 2018 JULIE Lab, Germany. All rights reserved.