org.appliedtopology.tda4j.barcode

Members list

Type members

Experimental classlikes

object Barcode

Stateless: every method here is a pure function of its arguments, so this is an object, not a class you instantiate per call (as it was before, Barcode[F, A]().method(...), with no state ever carried between the construction and the one call).

Stateless: every method here is a pure function of its arguments, so this is an object, not a class you instantiate per call (as it was before, Barcode[F, A]().method(...), with no state ever carried between the construction and the one call).

Attributes

Experimental
true
Supertypes
class Object
trait Matchable
class Any
Self type
Barcode.type
class BarcodeContext[FiltrationT]()(using evidence$1: Ordering[FiltrationT])

Attributes

Experimental
true
Supertypes
class Object
trait Matchable
class Any

Bottleneck and Wasserstein distance between two persistence diagrams, plus the ground-metric convention they share. Hand-rolled per .claude/WORKLOG-mainstream-feature-gap-analysis.md item 4: pure bipartite matching over diagram points (each also matchable to its own projection onto the diagonal birth = death), not a boundary- matrix optimization like the circular-coordinates/optimal-cycles items -- no relation to Barcode's map/kernel/cokernel algebra, hence its own file/object.

Bottleneck and Wasserstein distance between two persistence diagrams, plus the ground-metric convention they share. Hand-rolled per .claude/WORKLOG-mainstream-feature-gap-analysis.md item 4: pure bipartite matching over diagram points (each also matchable to its own projection onto the diagonal birth = death), not a boundary- matrix optimization like the circular-coordinates/optimal-cycles items -- no relation to Barcode's map/kernel/cokernel algebra, hence its own file/object.

Parameter naming and the ground-metric/aggregation split follow Hera (anigmetov/hera) and GUDHI's own wasserstein_distance, cross-checked against both (not recalled from memory, and independently re-derived below) rather than assumed: groundNorm (GUDHI/Hera's internal_p) is the norm on the birth-death plane used to cost a single matched pair; order (GUDHI/Hera's order/wasserstein_power, called q in Kerber-Morozov-Nigmetov 2017) is the exponent used to aggregate all matched pairs' costs into one number. As order -> Infinity this aggregation becomes a max, i.e. Wasserstein converges to bottleneck -- but wassersteinDistance below only accepts finite order (seeding a Hungarian cost matrix with cost^Infinity is not meaningful); call bottleneckDistance directly for that case, matching how GUDHI/Hera expose them as separate entry points rather than one function with an infinite default.

'''Essential (never-dying) bars''': matched only to other essential bars, never to the diagonal (infinite persistence means infinite distance to the diagonal under any ground norm) and never to a finite bar (infinite vs. finite death is likewise infinitely bad). If the two diagrams have different numbers of essential bars, the distance is Double.PositiveInfinity -- there is no finite matching. When the counts agree, essential bars carry no usable death coordinate (both are "the same" point at infinity, contributing nothing to the cost), so they are matched purely by ascending birth value; this is provably cost-minimal for both the sum-of- powers (Wasserstein) and max (bottleneck) aggregations, by the standard line-matching exchange argument (for any x1 < x2, y1 < y2: max/sum of the sorted pairing (x1,y1),(x2,y2) never exceeds the crossed pairing (x1,y2),(x2,y1)), so it can be resolved directly instead of routed through the general bipartite solvers below. This also keeps Infinity values out of the Hungarian/Hopcroft-Karp cost matrices entirely (an Infinity - Infinity = NaN landmine in the Hungarian potential updates, avoided by construction rather than guarded against).

Attributes

Experimental
true
Supertypes
class Object
trait Matchable
class Any
Self type
sealed trait BarcodeEndpoint[FiltrationT]

Attributes

Experimental
true
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class ClosedEndpoint[FiltrationT]
class NegativeInfinity[FiltrationT]
class OpenEndpoint[FiltrationT]
class PositiveInfinity[FiltrationT]
case class ClosedEndpoint[FiltrationT](value: FiltrationT)(using evidence$1: Ordering[FiltrationT]) extends BarcodeEndpoint[FiltrationT]

Attributes

Experimental
true
Supertypes
trait Serializable
trait Product
trait Equals
trait BarcodeEndpoint[FiltrationT]
class Object
trait Matchable
class Any
Show all
case class NegativeInfinity[FiltrationT]()(using evidence$1: Ordering[FiltrationT]) extends BarcodeEndpoint[FiltrationT]

Attributes

Experimental
true
Supertypes
trait Serializable
trait Product
trait Equals
trait BarcodeEndpoint[FiltrationT]
class Object
trait Matchable
class Any
Show all
case class OpenEndpoint[FiltrationT](value: FiltrationT)(using evidence$1: Ordering[FiltrationT]) extends BarcodeEndpoint[FiltrationT]

Attributes

Experimental
true
Supertypes
trait Serializable
trait Product
trait Equals
trait BarcodeEndpoint[FiltrationT]
class Object
trait Matchable
class Any
Show all

Utility functions for working with persistence bars.

Utility functions for working with persistence bars.

For any cases not covered by these simplistic factory method, the programmer gets to instantiate their own PersistenceBar object.

Attributes

Companion
class
Experimental
true
Supertypes
class Object
trait Matchable
class Any
Self type
case class PersistenceBar[FiltrationT, AnnotationT](dim: Int, lower: BarcodeEndpoint[FiltrationT], upper: BarcodeEndpoint[FiltrationT], annotation: Option[AnnotationT] = ...)(using evidence$1: Ordering[FiltrationT])

A persistence bar has a lower and upper endpoint, where we assume (but do not enforce) that lower < upper in the expected ordering on the filtration type; a dimension; and optionally some annotation (this will be used extensively to carry representative chains in homology computations)

A persistence bar has a lower and upper endpoint, where we assume (but do not enforce) that lower < upper in the expected ordering on the filtration type; a dimension; and optionally some annotation (this will be used extensively to carry representative chains in homology computations)

Type parameters

AnnotationT

Type of the annotation (we would expect this to be Chain).

FiltrationT

Type of the filtration parameter

Attributes

Companion
object
Experimental
true
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class PositiveInfinity[FiltrationT]()(using evidence$1: Ordering[FiltrationT]) extends BarcodeEndpoint[FiltrationT]

Attributes

Experimental
true
Supertypes
trait Serializable
trait Product
trait Equals
trait BarcodeEndpoint[FiltrationT]
class Object
trait Matchable
class Any
Show all
object Vectorization

Diagram vectorizations: persistence landscapes (Bubenik 2013) and persistence images (Adams et al. 2017), turning a barcode into a fixed-size numeric array for downstream (e.g. ML) use. Per .claude/WORKLOG-mainstream-feature-gap-analysis.md item 8 -- pure array/geometry code on PersistenceBar, no relation to BarcodeDistance's matching machinery beyond sharing DiagramPoint's extraction helper.

Diagram vectorizations: persistence landscapes (Bubenik 2013) and persistence images (Adams et al. 2017), turning a barcode into a fixed-size numeric array for downstream (e.g. ML) use. Per .claude/WORKLOG-mainstream-feature-gap-analysis.md item 8 -- pure array/geometry code on PersistenceBar, no relation to BarcodeDistance's matching machinery beyond sharing DiagramPoint's extraction helper.

'''Essential (never-dying) bars''' are handled differently by the two vectorizations below, and deliberately so rather than by one blanket policy -- each is documented at its own def:

  • landscape includes them: a tent function max(0, min(t - birth, death - t)) degrades to the unbounded ramp t - birth exactly at death = Infinity, which is already finite and meaningful at every t the caller's own finite grid ever evaluates, so no special-casing is needed.
  • persistenceImage drops them: a Gaussian centered at (birth, Infinity) in birth-persistence coordinates has no overlap with any finite pixel grid, so silently keeping it would either underflow to an all-zero contribution (an implicit policy, not a decided one) or need an arbitrary finite substitute death value (which landscape's case doesn't need and this one has no principled way to choose either).

Attributes

Experimental
true
Supertypes
class Object
trait Matchable
class Any
Self type

Types

type BarcodeGenerators[FiltrationT, CellT, CoefficientT] = List[PersistenceBar[FiltrationT, Chain[CellT, CoefficientT]]]

Givens

Experimental givens

given given_Ordering_BarcodeEndpoint: [FiltrationT] => Ordering[FiltrationT] => given_Ordering_BarcodeEndpoint[FiltrationT]

Attributes

Experimental
true