|
||||||||||
| 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
|
+--dragon.matrix.AbstractGiantSparseMatrix
The abstract sparse matrix for handling extreme large sparse matrirwhich will write matrix data to disk whenever it's over fulsh interval by default 1000,000 and superior to AbstractSuperSparseMatrix, however it's lack of some basic matrix operation functions such as getNonZeroColumnInRow privided by AbstractSuperSparseMatrix because it focuses on storing and loading matrix to disk efficiently
Copyright: Copyright (c) 2005
Company: IST, Drexel University
| Field Summary | |
protected AbstractFlatSparseMatrix |
cacheMatrix
|
protected int |
flushInterval
|
protected java.lang.String |
indexFilename
|
protected SparseMatrixFactory |
matrixFactory
|
protected java.lang.String |
matrixFilename
|
protected java.io.RandomAccessFile |
rafIndex
|
protected java.io.RandomAccessFile |
rafMatrix
|
protected int |
totalCell
|
| Fields inherited from class dragon.matrix.AbstractSparseMatrix |
isFinalized, mergeMode, miniMode |
| Fields inherited from class dragon.matrix.AbstractMatrix |
cellDataLength, columnBase, columns, rowBase, rows, transposeMatrix |
| Constructor Summary | |
AbstractGiantSparseMatrix(java.lang.String indexFilename,
java.lang.String matrixFilename,
int cellDataLength)
|
|
AbstractGiantSparseMatrix(java.lang.String indexFilename,
java.lang.String matrixFilename,
int cellDataLength,
boolean mergeMode,
boolean miniMode)
|
|
| Method Summary | |
boolean |
add(Cell cell)
Add a cell to the sparse matrix. |
void |
close()
Close the matrix and release all resources. |
protected abstract AbstractFlatSparseMatrix |
createFlatSparseMatrix(boolean mergeMode,
boolean miniMode)
|
protected abstract Row |
createRow(int row,
int columns,
byte[] data)
|
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. |
Cell |
getCell(int row,
int col)
If the specified cell doesn't exist, this method will return null. |
java.lang.String |
getIndexFilename()
|
java.lang.String |
getMatrixFilename()
|
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. |
int |
getNonZeroNum()
|
int |
getNonZeroNumInRow(int row)
|
protected Row |
getRow(int index)
|
void |
setFlushInterval(int interval)
|
| 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 |
createCell, createCell, createSparseMatrix |
| Methods inherited from interface dragon.matrix.Matrix |
columns, getBaseColumn, getBaseRow, getCellDataLength, getTranspose, rows, setTranspose |
| Field Detail |
protected java.lang.String indexFilename
protected java.lang.String matrixFilename
protected int totalCell
protected java.io.RandomAccessFile rafIndex
protected java.io.RandomAccessFile rafMatrix
protected AbstractFlatSparseMatrix cacheMatrix
protected int flushInterval
protected SparseMatrixFactory matrixFactory
| Constructor Detail |
public AbstractGiantSparseMatrix(java.lang.String indexFilename,
java.lang.String matrixFilename,
int cellDataLength)
public AbstractGiantSparseMatrix(java.lang.String indexFilename,
java.lang.String matrixFilename,
int cellDataLength,
boolean mergeMode,
boolean miniMode)
| Method Detail |
protected abstract Row createRow(int row,
int columns,
byte[] data)
protected abstract AbstractFlatSparseMatrix createFlatSparseMatrix(boolean mergeMode,
boolean miniMode)
public void setFlushInterval(int interval)
public void close()
Matrix
public boolean add(Cell cell)
SparseMatrix
cell - the input cell
public void flush()
SparseMatrix
public boolean finalizeData(boolean sorting)
SparseMatrix
sorting - if need to sort the added cells before finalization.
public java.lang.String getMatrixFilename()
public java.lang.String getIndexFilename()
public int getNonZeroNum()
public int getNonZeroNumInRow(int row)
row - the index of the row
public int getNonZeroColumnInRow(int row,
int index)
SparseMatrix
row - the index of the rowindex - the index-th non-zero cell
public int[] getNonZeroColumnsInRow(int row)
SparseMatrix
row - the index of row
public Cell getCell(int row,
int col)
SparseMatrix
row - the index of row in the matrixcol - the index of column in the matrix
public Cell getNonZeroCellInRow(int row,
int index)
SparseMatrix
row - the index of the rowindex - the index-th non-zero cell
protected Row getRow(int index)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||