dragon.matrix
Class AbstractRow

java.lang.Object
  |
  +--dragon.matrix.AbstractRow
All Implemented Interfaces:
java.lang.Comparable, Row, java.io.Serializable
Direct Known Subclasses:
DoubleRow, IntRow

public abstract class AbstractRow
extends java.lang.Object
implements Row, java.io.Serializable

Abstract row class implementing functions of as row related operations

Copyright: Copyright (c) 2005

Company: IST, Drexel University

Version:
1.0
Author:
Davis Zhou
See Also:
Serialized Form

Field Summary
protected  int length
           
protected  float loadFactor
           
protected  int row
           
 
Constructor Summary
AbstractRow()
           
 
Method Summary
 int compareTo(java.lang.Object obj)
           
 float getLoadFactor()
           
 int getNonZeroNum()
           
 int getRowIndex()
           
 void setLoadFactor(float factor)
          Some implementations of sparse matrix cache rows in memory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface dragon.matrix.Row
getCell, getNonZeroCell, getNonZeroColumn, getNonZeroColumns, getNonZeroDoubleScore, getNonZeroIntScore, load
 

Field Detail

row

protected int row

length

protected int length

loadFactor

protected float loadFactor
Constructor Detail

AbstractRow

public AbstractRow()
Method Detail

compareTo

public int compareTo(java.lang.Object obj)
Specified by:
compareTo in interface java.lang.Comparable

getRowIndex

public int getRowIndex()
Specified by:
getRowIndex in interface Row
Returns:
the index of the row

getNonZeroNum

public int getNonZeroNum()
Specified by:
getNonZeroNum in interface Row
Returns:
the number of non-zero cells in the current row

setLoadFactor

public void setLoadFactor(float factor)
Description copied from interface: Row
Some implementations of sparse matrix cache rows in memory. In this case, it is required to have a measure to determine if the row should be removed from the cache when the cache is full.

Specified by:
setLoadFactor in interface Row
Parameters:
factor - the measure of how this row is frequently used

getLoadFactor

public float getLoadFactor()
Specified by:
getLoadFactor in interface Row