FiltrationOrdering

org.appliedtopology.tda4j.streams.FiltrationOrdering

Attributes

Experimental
true
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def canonical[C](fv: PartialFunction[C, Double], dim: C => Int, tieBreak: Ordering[C]): Ordering[C]

The canonical filtrationOrdering shape every stream in this codebase's ordering contract must produce (CLAUDE.md's stream rules 1/2): primary key filtration value REVERSED (smaller-under-this-ordering means younger -- Chain's pivot-selection machinery needs "smaller" to mean "younger"), then dimension ascending, then a caller-supplied tie-break. A cell either side's fv is undefined for falls through to the dimension/tie-break keys alone, matching every existing call site's behavior.

The canonical filtrationOrdering shape every stream in this codebase's ordering contract must produce (CLAUDE.md's stream rules 1/2): primary key filtration value REVERSED (smaller-under-this-ordering means younger -- Chain's pivot-selection machinery needs "smaller" to mean "younger"), then dimension ascending, then a caller-supplied tie-break. A cell either side's fv is undefined for falls through to the dimension/tie-break keys alone, matching every existing call site's behavior.

fv stays a PartialFunction, not C => Option[Double]: every call site already had one on hand (no .lift allocation needed), and this sits directly on Chain.reduceBy's SortedMap/PriorityQueue comparison path -- the hottest loop in every engine.

Attributes