Class AbstractRealVector.SparseEntryIterator

  • All Implemented Interfaces:
    java.util.Iterator<RealVector.Entry>
    Enclosing class:
    AbstractRealVector

    protected class AbstractRealVector.SparseEntryIterator
    extends java.lang.Object
    implements java.util.Iterator<RealVector.Entry>
    This class should rare 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, not use 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)
    • Constructor Detail

      • SparseEntryIterator

        protected SparseEntryIterator()
        Simple constructor.