Class AbstractVectorIter

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected int numPositive
      Number of positive examples in the vector.
      protected int pos
      Current position.
      protected NumberVector positive
      Vector of positive examples.
      protected int[] sort
      Order of dimensions.
      protected NumberVector vec
      Data vector.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      AbstractVectorIter advance()
      Moves the iterator forward to the next entry.
      AbstractVectorIter advance​(int count)
      Moves the iterator forward or backward by the given offset.
      int dim()
      Get the dimension in the original vector.
      int getOffset()
      Get current iterator offset.
      int numPositive()
      Return the number of positive ids.
      int numTotal()
      Return the number of all ids.
      AbstractVectorIter retract()
      Moves the iterator backward to the previous entry.
      AbstractVectorIter seek​(int off)
      Moves the iterator to the given position
      boolean test()
      True if the current object is a positive example.
      boolean tiedToPrevious()
      Test whether the score is the same as the previous objects score.
      boolean valid()
      Returns true if the iterator currently points to a valid object.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • sort

        protected int[] sort
        Order of dimensions.
      • positive

        protected NumberVector positive
        Vector of positive examples.
      • pos

        protected int pos
        Current position.
      • numPositive

        protected int numPositive
        Number of positive examples in the vector.
    • Constructor Detail

      • AbstractVectorIter

        public AbstractVectorIter​(NumberVector positive,
                                  NumberVector vec)
        Constructor.
        Parameters:
        positive - Positive examples
        vec - Vector to iterate over.
    • Method Detail

      • dim

        public int dim()
        Get the dimension in the original vector.
        Returns:
        Vector position.
      • valid

        public boolean valid()
        Description copied from interface: Iter
        Returns true if the iterator currently points to a valid object.
        Specified by:
        valid in interface Iter
        Returns:
        a boolean value, whether the position is valid.
      • advance

        public AbstractVectorIter advance()
        Description copied from interface: Iter
        Moves the iterator forward to the next entry.
        Specified by:
        advance in interface ArrayIter
        Specified by:
        advance in interface Iter
        Returns:
        The iterator itself.
      • tiedToPrevious

        public boolean tiedToPrevious()
        Description copied from interface: ScoreEvaluation.Adapter
        Test whether the score is the same as the previous objects score. When there is no previous result, implementations should return false!
        Specified by:
        tiedToPrevious in interface ScoreEvaluation.Adapter
        Returns:
        Boolean
      • getOffset

        public int getOffset()
        Description copied from interface: ArrayIter
        Get current iterator offset.
        Specified by:
        getOffset in interface ArrayIter
        Returns:
        Iterator position
      • advance

        public AbstractVectorIter advance​(int count)
        Description copied from interface: ArrayIter
        Moves the iterator forward or backward by the given offset.
        Specified by:
        advance in interface ArrayIter
        Parameters:
        count - offset to move forward or backwards
        Returns:
        Iterator
      • seek

        public AbstractVectorIter seek​(int off)
        Description copied from interface: ArrayIter
        Moves the iterator to the given position
        Specified by:
        seek in interface ArrayIter
        Parameters:
        off - Seek offset
        Returns:
        Iterator