|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.math3.linear.RealVector.SparseEntryIterator
protected class RealVector.SparseEntryIterator
This class should rarely be used, but is here to provide a default implementation of sparseIterator(), which is implemented by walking over the entries, skipping those whose values are the default one. Concrete subclasses which are SparseVector implementations should make their own sparse iterator, rather than using this one. This implementation might be useful for ArrayRealVector, when expensive operations which preserve the default value are to be done on the entries, and the fraction of non-default values is small (i.e. someone took a SparseVector, and passed it into the copy-constructor of ArrayRealVector)
Field Summary | |
---|---|
private RealVector.Entry |
current
Last entry returned by next() . |
private int |
dim
Dimension of the vector. |
private RealVector.Entry |
next
Next entry for next() to return. |
Constructor Summary | |
---|---|
protected |
RealVector.SparseEntryIterator()
Simple constructor. |
Method Summary | |
---|---|
protected void |
advance(RealVector.Entry e)
Advance an entry up to the next nonzero one. |
boolean |
hasNext()
|
RealVector.Entry |
next()
|
void |
remove()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final int dim
private RealVector.Entry current
next()
.
private RealVector.Entry next
next()
to return.
Constructor Detail |
---|
protected RealVector.SparseEntryIterator()
Method Detail |
---|
protected void advance(RealVector.Entry e)
e
- entry to advance.public boolean hasNext()
hasNext
in interface Iterator<RealVector.Entry>
public RealVector.Entry next()
next
in interface Iterator<RealVector.Entry>
public void remove()
remove
in interface Iterator<RealVector.Entry>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |