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 -- the enumeration cofacetIteratorWithVertex used to do directly as a hand-rolled Iterator[(Int, Long)], now factored out so a caller can read vertex/index as plain field accesses with zero per-step allocation, not even the (Int, Long) tuple Iterator[(Int, Long)]'s own contract forces on every next() call -- measured (.claude/WORKLOG-ripser-profiling.md's follow-up session) as ~49.8% of total allocation weight in both engines after every earlier fix in that arc, the largest remaining identified cost. 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's now 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