CofacetCursor

org.appliedtopology.tda4j.streams.SimplexIndexing.CofacetCursor
final class CofacetCursor(startIndex: Long, size: Int, allCofacets: Boolean)

A hasNext/vertex/index/advance() cursor over sigma's cofacets, factored out of what cofacetIteratorWithVertex used to do directly as a hand-rolled Iterator[(Int, Long)], so a caller can read vertex/index as plain field accesses with zero per-step allocation -- not even the (Int, Long) tuple an Iterator[(Int, Long)] contract forces on every next() call. hasNext/advance() are deliberately split from a single next(): vertex/index stay valid to re-read as many times as a caller wants between one advance() and the next (both PackedRipserCohomology.scala's coboundaryOf and Homology.scala read both fields off one candidate before advancing).

Decodes sigma via decodeToArray (a plain sorted Array[Int], binary-searched for membership), not apply (a Simplex[Int]/SortedSet[Int], O(log d) tree lookup per membership check) -- the same array-over-tree substitution decodeToArray's own doc motivates, folded in here since this cursor replaces cofacetIteratorWithVertex's body outright rather than wrapping it.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def advance(): Unit
def hasNext: Boolean
def index: Long
def vertex: Int