|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--dragon.matrix.AbstractMatrix
|
+--dragon.matrix.AbstractSparseMatrix
Abstract Sparse matrix implements the interface of sparse matrix which can be called by any data type's sparse matrix such as double and integer
Copyright: Copyright (c) 2005
Company: IST, Drexel University
| Field Summary | |
protected boolean |
isFinalized
|
protected boolean |
mergeMode
|
protected boolean |
miniMode
|
| Fields inherited from class dragon.matrix.AbstractMatrix |
cellDataLength, columnBase, columns, rowBase, rows, transposeMatrix |
| Constructor Summary | |
AbstractSparseMatrix(boolean mergeMode,
boolean miniMode,
int cellDataLength)
|
|
| Method Summary | |
double |
cosine(int rowA,
int rowB)
This method treats each row a vector and return the cosine similarity of two rows. |
boolean |
finalizeData()
It is equal to calling finalizeData(true) |
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. |
static boolean |
genTranslationMatrix(IntSparseMatrix inputCooccurMatrix,
DoubleSparseMatrix outputTransMatrix)
|
int |
getCooccurrenceCount(int rowA,
int rowB)
If two cells in the same column have non-zero scores, they will be counted as co-occurred. |
double |
getDouble(int row,
int column)
Return the score stored in the specified cell. |
int |
getInt(int row,
int column)
Return the score stored in the specified cell. |
Cell |
getNonZeroCellInColumn(int column,
int index)
This method returns the index-th non-zero cell in the given row. |
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 |
getNonZeroNumInColumn(int column)
If the transposed matrix is not set yet, this method will automatically generate the transposed matrix. |
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. |
Matrix |
transpose()
if one has set the transposed matrix by calling the method setTranspose, this method simply return that transposed matrix. |
| Methods inherited from class dragon.matrix.AbstractMatrix |
columns, getBaseColumn, getBaseRow, getCellDataLength, getTranspose, rows, setTranspose |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface dragon.matrix.SparseMatrix |
add, createCell, createCell, createSparseMatrix, finalizeData, flush, getCell, getNonZeroCellInRow, getNonZeroColumnInRow, getNonZeroColumnsInRow, getNonZeroNum, getNonZeroNumInRow |
| Methods inherited from interface dragon.matrix.Matrix |
close, columns, getBaseColumn, getBaseRow, getCellDataLength, getTranspose, rows, setTranspose |
| Field Detail |
protected boolean isFinalized
protected boolean mergeMode
protected boolean miniMode
| Constructor Detail |
public AbstractSparseMatrix(boolean mergeMode,
boolean miniMode,
int cellDataLength)
| Method Detail |
public boolean isFinalized()
SparseMatrix
isFinalized in interface SparseMatrixpublic boolean finalizeData()
SparseMatrix
finalizeData in interface SparseMatrix
public Cell getNonZeroCellInColumn(int column,
int index)
SparseMatrix
getNonZeroCellInColumn in interface SparseMatrixcolumn - the index of the columnindex - the index-th non-zero cell
public int getNonZeroNumInColumn(int column)
SparseMatrix
getNonZeroNumInColumn in interface SparseMatrixcolumn - the index of the column
public int getNonZeroRowInColumn(int column,
int index)
SparseMatrix
getNonZeroRowInColumn in interface SparseMatrixcolumn - the index of the columnindex - the index-th non-zero cell
public int[] getNonZeroRowsInColumn(int column)
SparseMatrix
getNonZeroRowsInColumn in interface SparseMatrixcolumn - the index of the column
public double getDouble(int row,
int column)
Matrix
getDouble in interface Matrixrow - the row index of the cellcolumn - the column index of the cell
public int getInt(int row,
int column)
Matrix
getInt in interface Matrixrow - the row index of the cellcolumn - the column index of the cell
public double getNonZeroDoubleScoreInColumn(int column,
int index)
SparseMatrix
getNonZeroDoubleScoreInColumn in interface SparseMatrixcolumn - the index of the columnindex - the index-th non-zero cell
public double[] getNonZeroDoubleScoresInColumn(int column)
SparseMatrix
getNonZeroDoubleScoresInColumn in interface SparseMatrixcolumn - the index of the column
public int getNonZeroIntScoreInColumn(int column,
int index)
SparseMatrix
getNonZeroIntScoreInColumn in interface SparseMatrixcolumn - the index of the columnindex - the index-th non-zero cell
public int[] getNonZeroIntScoresInColumn(int column)
SparseMatrix
getNonZeroIntScoresInColumn in interface SparseMatrixcolumn - the index of the column
public double getNonZeroDoubleScoreInRow(int row,
int index)
SparseMatrix
getNonZeroDoubleScoreInRow in interface SparseMatrixrow - the index of the row.index - the index-th non-zero cell
public int getNonZeroIntScoreInRow(int row,
int index)
SparseMatrix
getNonZeroIntScoreInRow in interface SparseMatrixrow - the index of the row.index - the index-th non-zero cell
public double[] getNonZeroDoubleScoresInRow(int row)
SparseMatrix
getNonZeroDoubleScoresInRow in interface SparseMatrixrow - the index of row
public int[] getNonZeroIntScoresInRow(int row)
SparseMatrix
getNonZeroIntScoresInRow in interface SparseMatrixrow - the index of row
public boolean genCooccurrenceMatrix(IntSparseMatrix outputCooccurMatrix)
SparseMatrix
genCooccurrenceMatrix in interface SparseMatrixoutputCooccurMatrix - the output cooccurrence matrix
public boolean genCooccurrenceMatrix(SparseMatrix matrixY,
IntSparseMatrix outputCooccurMatrix)
SparseMatrix
genCooccurrenceMatrix in interface SparseMatrixmatrixY - another sparse matrixoutputCooccurMatrix - the output cooccurrence matrix
public boolean genCooccurrenceMatrix(SparseMatrix matrixY,
int minOccurrence,
IntSparseMatrix outputCooccurMatrix)
SparseMatrix
genCooccurrenceMatrix in interface SparseMatrixmatrixY - another sparse matrixminOccurrence - the minimum cooccurrence countoutputCooccurMatrix - the output cooccurrence matrix
public int getCooccurrenceCount(int rowA,
int rowB)
Matrix
getCooccurrenceCount in interface MatrixrowA - the index of the first rowrowB - the index of the second row
public double cosine(int rowA,
int rowB)
Matrix
cosine in interface MatrixrowA - the row index of the first vectorrowB - the row index of the second vector
public static boolean genTranslationMatrix(IntSparseMatrix inputCooccurMatrix,
DoubleSparseMatrix outputTransMatrix)
public Matrix transpose()
Matrix
transpose in interface Matrixtranspose in class AbstractMatrix
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||