|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnl.telin.mymedia.analysis.infgain.SparseVector<K>
public class SparseVector<K extends java.lang.Number>
The SparseVector is a indexed vector where 0 values have been removed.
Constructor Summary | |
---|---|
SparseVector()
Constructor, initializes size to 0 |
Method Summary | |
---|---|
java.lang.Float |
addTo(int position,
java.lang.Float a)
add value to existing value at indexed position |
java.lang.Integer |
addTo(int position,
java.lang.Integer a)
add value to existing value at indexed position |
void |
divideElementsBy(float fraction)
divide existing values by a certain value |
void |
divideElementsBy(int fraction)
divide existing values by a certain value |
java.lang.Float |
getFloatAt(int position)
get Flaot value from position |
java.lang.Integer |
getIntegerAt(int position)
get Integer value from position |
java.util.Iterator<java.lang.Integer> |
getKeyIterator()
|
int |
getNrOfNonZeroValues()
|
int |
getSize()
|
void |
positiveDiff(SparseVector<java.lang.Float> distr)
remove values that have a negative difference with provided distr. |
boolean |
setAt(int position,
K value)
set value at indexed position |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SparseVector()
Method Detail |
---|
public int getSize()
public int getNrOfNonZeroValues()
public boolean setAt(int position, K value)
position
- the positionvalue
- the value
public java.lang.Float getFloatAt(int position)
position
- the position
public java.lang.Integer getIntegerAt(int position)
position
- the position
public java.lang.Float addTo(int position, java.lang.Float a)
position
- the positiona
- the value to be added
public java.lang.Integer addTo(int position, java.lang.Integer a)
position
- the positiona
- the value to be added
public java.util.Iterator<java.lang.Integer> getKeyIterator()
public void divideElementsBy(int fraction)
fraction
- the dividerpublic void divideElementsBy(float fraction)
fraction
- the dividerpublic void positiveDiff(SparseVector<java.lang.Float> distr)
distr
- the distribution to compare to.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |