dragon.matrix
Class AbstractDenseMatrix
java.lang.Object
|
+--dragon.matrix.AbstractMatrix
|
+--dragon.matrix.AbstractDenseMatrix
- All Implemented Interfaces:
- DenseMatrix, Matrix, java.io.Serializable
- Direct Known Subclasses:
- DoubleFlatDenseMatrix, IntFlatDenseMatrix
- public abstract class AbstractDenseMatrix
- extends AbstractMatrix
- implements DenseMatrix, java.io.Serializable
Implements basic functions of interface--DenseMatrix and extends class AbstractMatrix
Description:
Copyright: Copyright (c) 2005
Company: IST, Drexel University
- Version:
- 1.0
- Author:
- Davis Zhou
- See Also:
- Serialized Form
|
Method Summary |
double |
cosine(int rowA,
int rowB)
This method treats each row a vector and return the cosine similarity of two rows. |
int |
getCooccurrenceCount(int rowA,
int rowB)
If two cells in the same column have non-zero scores, they will be counted as co-occurred. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface dragon.matrix.Matrix |
close, columns, getBaseColumn, getBaseRow, getCellDataLength, getDouble, getInt, getTranspose, rows, setTranspose, transpose |
AbstractDenseMatrix
public AbstractDenseMatrix(int row,
int column,
int cellDataLength)
cosine
public double cosine(int rowA,
int rowB)
- Description copied from interface:
Matrix
- This method treats each row a vector and return the cosine similarity of two rows.
- Specified by:
cosine in interface Matrix
- Parameters:
rowA - the row index of the first vectorrowB - the row index of the second vector
- Returns:
- the cosine similarity of two given rows.
getCooccurrenceCount
public int getCooccurrenceCount(int rowA,
int rowB)
- Description copied from interface:
Matrix
- If two cells in the same column have non-zero scores, they will be counted as co-occurred.
- Specified by:
getCooccurrenceCount in interface Matrix
- Parameters:
rowA - the index of the first rowrowB - the index of the second row
- Returns:
- the cooccurrence count