|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.rapidminer.example.table.DataRow
com.rapidminer.example.table.AbstractSparseArrayDataRow
public abstract class AbstractSparseArrayDataRow
Implementation of DataRow that is backed by primitive arrays. Should always be used if more than 50% of the data is sparse. As fast (or even faster than map implementation) but needs considerably less memory.
| Constructor Summary | |
|---|---|
AbstractSparseArrayDataRow()
Creates an empty sparse array data row with size 0. |
|
AbstractSparseArrayDataRow(int size)
Creates a sparse array data row of the given size. |
|
| Method Summary | |
|---|---|
void |
ensureNumberOfColumns(int numberOfColumns)
Does nothing. |
protected double |
get(int val,
double defaultValue)
Returns the desired data for the given attribute. |
protected abstract double[] |
getAllValues()
|
int[] |
getNonDefaultIndices()
Returns an array of all attribute indices with corresponding non-default values. |
double[] |
getNonDefaultValues()
Returns an array of all non-default attribute values. |
protected abstract double |
getValue(int index)
|
protected abstract void |
removeValue(int index)
|
protected abstract void |
resizeValues(int length)
|
protected void |
set(int index,
double value,
double defaultValue)
Sets the given data for the given attribute. |
protected abstract void |
setValue(int index,
double value)
|
protected void |
swap(int a,
int b)
Swaps x[a] with x[b]. |
protected abstract void |
swapValues(int a,
int b)
|
java.lang.String |
toString()
Returns a string representation of the data row. |
void |
trim()
Trims the data row to the number of actually used elements. |
| Methods inherited from class com.rapidminer.example.table.DataRow |
|---|
get, set |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractSparseArrayDataRow()
public AbstractSparseArrayDataRow(int size)
| Method Detail |
|---|
protected abstract void removeValue(int index)
protected abstract void resizeValues(int length)
protected abstract void setValue(int index,
double value)
protected abstract double getValue(int index)
protected abstract void swapValues(int a,
int b)
protected abstract double[] getAllValues()
protected void swap(int a,
int b)
protected double get(int val,
double defaultValue)
get in class DataRow
protected void set(int index,
double value,
double defaultValue)
set in class DataRowpublic int[] getNonDefaultIndices()
SparseDataRow
getNonDefaultIndices in interface SparseDataRowpublic double[] getNonDefaultValues()
SparseDataRow
getNonDefaultValues in interface SparseDataRowpublic void ensureNumberOfColumns(int numberOfColumns)
ensureNumberOfColumns in class DataRowpublic void trim()
trim in class DataRowpublic java.lang.String toString()
toString in class DataRow
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||