Class AbstractSuccinctUndirectedGraph.CumulativeSuccessors<E>

  • Type Parameters:
    E - the graph edge type
    All Implemented Interfaces:
    it.unimi.dsi.fastutil.longs.LongIterator, java.util.Iterator<java.lang.Long>, java.util.PrimitiveIterator<java.lang.Long,​java.util.function.LongConsumer>, java.util.PrimitiveIterator.OfLong
    Enclosing class:
    AbstractSuccinctUndirectedGraph<E>

    protected static final class AbstractSuccinctUndirectedGraph.CumulativeSuccessors<E>
    extends java.lang.Object
    implements it.unimi.dsi.fastutil.longs.LongIterator
    Turns all edges x — y, x ≤ y, into a monotone sequence using the encoding x2⌈log n + y, or all edges x — y, x ≥ y, using the encoding xn + y - e, where e is the index of the edge in lexicographical order, depending on the value of the sorted parameter.
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface java.util.PrimitiveIterator

        java.util.PrimitiveIterator.OfDouble, java.util.PrimitiveIterator.OfInt, java.util.PrimitiveIterator.OfLong
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int d  
      private int e  
      private Graph<java.lang.Integer,​E> graph  
      private int i  
      private long n  
      private long next  
      private int[] s  
      private boolean sorted  
      private int sourceShift  
      private java.util.function.Function<java.lang.Integer,​java.lang.Iterable<E>> succ  
      private int x  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected CumulativeSuccessors​(Graph<java.lang.Integer,​E> graph, boolean sorted, java.util.function.Function<java.lang.Integer,​java.lang.Iterable<E>> succ)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean hasNext()  
      long nextLong()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.Iterator

        remove
      • Methods inherited from interface it.unimi.dsi.fastutil.longs.LongIterator

        forEachRemaining, forEachRemaining, next, skip
      • Methods inherited from interface java.util.PrimitiveIterator.OfLong

        forEachRemaining
    • Field Detail

      • graph

        private final Graph<java.lang.Integer,​E> graph
      • n

        private final long n
      • sourceShift

        private final int sourceShift
      • succ

        private final java.util.function.Function<java.lang.Integer,​java.lang.Iterable<E>> succ
      • sorted

        private final boolean sorted
      • x

        private int x
      • d

        private int d
      • i

        private int i
      • e

        private int e
      • next

        private long next
      • s

        private int[] s
    • Constructor Detail

      • CumulativeSuccessors

        protected CumulativeSuccessors​(Graph<java.lang.Integer,​E> graph,
                                       boolean sorted,
                                       java.util.function.Function<java.lang.Integer,​java.lang.Iterable<E>> succ)
    • Method Detail

      • hasNext

        public boolean hasNext()
        Specified by:
        hasNext in interface java.util.Iterator<E>
      • nextLong

        public long nextLong()
        Specified by:
        nextLong in interface it.unimi.dsi.fastutil.longs.LongIterator
        Specified by:
        nextLong in interface java.util.PrimitiveIterator.OfLong