public interface SparseFeatureVector<D> extends FeatureVector<D>
FeatureVector.Factory<V extends FeatureVector<? extends D>,D>
TYPE
Modifier and Type | Method and Description |
---|---|
default int |
iter()
Iterator over non-zero features only, ascending.
|
default int |
iterAdvance(int iter)
Advance the iterator to the next position.
|
int |
iterDim(int iter)
Get the dimension an iterator points to.
|
default int |
iterRetract(int iter)
Retract the iterator to the next position.
|
boolean |
iterValid(int iter)
Test the iterator position for validity.
|
getDimensionality, getValue, toString
default int iter()
iterDim(int)
to get the actual dimension. In fact,
usually this will be the ith non-zero value, assuming an array
representation.
Think of this number as an iterator. For efficiency, it has a primitive
type!
Intended usage:
for (int iter = v.iter(); v.iterValid(iter); iter = v.iterAdvance(iter)) {
final int dim = v.iterDim(iter);
// Do something.
}
int iterDim(int iter)
iter
- Iterator positiondefault int iterAdvance(int iter)
iter
- Previous iterator positiondefault int iterRetract(int iter)
iter
- Next iterator positionboolean iterValid(int iter)
iter
- Iterator positiontrue
when it refers to a valid position.Copyright © 2019 ELKI Development Team. License information.