PackedRipserCohomologyEngine

org.appliedtopology.tda4j.PackedRipserCohomologyEngine
open class PackedRipserCohomologyEngine[CoefficientT](metricSpace: FiniteMetricSpace[Int], maxDimension: Int, useApparentPairs: Boolean = ..., maxFiltrationValue: Option[Double] = ..., neighbourLists: Option[Boolean] = ..., wideIndices: Option[Boolean] = ..., useEmergentPairs: Boolean = ..., useUnionFind: Boolean = ...)(using evidence$1: Field { type Self = CoefficientT; })

Persistent cohomology of the Vietoris-Rips complex of a metric space by Bauer's Ripser algorithm (arXiv:1908.02518): the fast engine for Vietoris-Rips, and the MATLAB/CLI default there. Cells are packed as (diameter, combinatorial index) pairs (DiameterIndex, Ripser's diameter_index_t); clearing, apparent pairs, emergent pairs and the enclosing-radius cutoff as in Ripser.

Reports degrees 0 .. maxDimension, each bar with its representative cocycle over DiameterIndex cells: decode a cell of a degree-k bar with vertices(cell, k + 1). maxFiltrationValue defaults to the minimum enclosing radius, past which nothing new is born. useApparentPairs = false, useEmergentPairs = false and useUnionFind = false turn off the apparent-pair shortcut, the emergent-pair shortcut and the pairing of degree 0 by union-find over the edges (the elder rule, as Ripser does it), which change no output (for benchmarking). An emergent pair is a column whose oldest cofacet of the same diameter is the pivot of no earlier column: it is paired with that cofacet without being reduced, and kept only as the simplex that makes it (rebuilt if a later column needs it), which saves the memory of its stored column.

Under a threshold that keeps few of the pairs (a large point cloud with a small maxFiltrationValue), cofacets are found from each vertex's list of neighbours within the threshold instead of by trying every vertex, as Ripser does with a sparse distance matrix. The lists are built when at most a quarter of all pairs are within the threshold (neighbourLists = Some(true) or Some(false) decides it instead); the output is the same either way.

The combinatorial index of a simplex is one Long while the indices of every simplex up to dimension maxDimension + 1 fit in one, and two words (WideSimplexIndexing, up to 126 bits) beyond: for 16,000 points to degree 3, or 122,000 to degree 2. The choice is made before the run (wideIndices decides it instead) and changes no output.

Attributes

Experimental
true
Source
PackedRipserCohomology.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Type members

Classlikes

open class DiameterIndex(val diameter: Double, val index: Long)

A simplex as its (diameter, combinatorial index): the cell type of the returned chains. The index is one Long while that holds it. With two-word indices (usesWideIndices) a cell whose index passes 63 bits is a WideDiameterIndex, which also holds high, the bits above the low 63 that index keeps; every other cell has high = 0 and no second word in memory. Decode with vertices. Equality and hash use the index alone (both words), so the same simplex reached by different floating-point paths is one key.

A simplex as its (diameter, combinatorial index): the cell type of the returned chains. The index is one Long while that holds it. With two-word indices (usesWideIndices) a cell whose index passes 63 bits is a WideDiameterIndex, which also holds high, the bits above the low 63 that index keeps; every other cell has high = 0 and no second word in memory. Decode with vertices. Equality and hash use the index alone (both words), so the same simplex reached by different floating-point paths is one key.

Attributes

Companion
object
Source
PackedRipserCohomology.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object DiameterIndex

Attributes

Companion
class
Source
PackedRipserCohomology.scala
Supertypes
class Object
trait Matchable
class Any
Self type
final class WideDiameterIndex(diameter: Double, index: Long, val high: Long) extends DiameterIndex

Attributes

Source
PackedRipserCohomology.scala
Supertypes
class Object
trait Matchable
class Any

Value members

Concrete methods

How many simplices of degrees 1 and up the last run paired directly as apparent pairs, without reducing their coboundary (degree 0 is paired by union-find).

How many simplices of degrees 1 and up the last run paired directly as apparent pairs, without reducing their coboundary (degree 0 is paired by union-find).

Attributes

Source
PackedRipserCohomology.scala
def boundaryOf(tau: DiameterIndex, dim: Int): Seq[(DiameterIndex, CoefficientT)]

The boundary of a dim-simplex: the facet without its i-th smallest vertex, with sign (-1)^i.

The boundary of a dim-simplex: the facet without its i-th smallest vertex, with sign (-1)^i.

Attributes

Source
PackedRipserCohomology.scala
def coboundaryOf(sigma: DiameterIndex, size: Int): Chain[DiameterIndex, CoefficientT]

The coboundary of sigma (with size vertices) in the complex truncated at maxFiltrationValue, as in RipserCohomologyEngine.coboundaryOf. Defined up to dimension maxDimension.

The coboundary of sigma (with size vertices) in the complex truncated at maxFiltrationValue, as in RipserCohomologyEngine.coboundaryOf. Defined up to dimension maxDimension.

Attributes

Source
PackedRipserCohomology.scala

How many simplices of degrees 1 and up the last run paired as emergent pairs: their oldest same-diameter cofacet was no earlier column's pivot, so the coboundary was already reduced and was never put on the working column.

How many simplices of degrees 1 and up the last run paired as emergent pairs: their oldest same-diameter cofacet was no earlier column's pivot, so the coboundary was already reduced and was never put on the working column.

Attributes

Source
PackedRipserCohomology.scala
def longestListedEdge: Option[Double]

The longest edge within the threshold, read off the neighbour lists when the engine has them (0.0 when there is none), else None: the number FiniteMetricSpace.longestDistanceWithin finds with a pass of its own.

The longest edge within the threshold, read off the neighbour lists when the engine has them (0.0 when there is none), else None: the number FiniteMetricSpace.longestDistanceWithin finds with a pass of its own.

Attributes

Source
PackedRipserCohomology.scala
def pairedCohomology(cocycles: Boolean = ..., zeroLengthCocycles: Boolean = ...): List[(PersistenceBar[Double, Chain[DiameterIndex, CoefficientT]], Pair[DiameterIndex])]

Every bar, zero-length ones included, with the cells that open and close it. Cocycles are built only where asked (representative is None elsewhere): with cocycles = false none, with zeroLengthCocycles = false none for zero-length bars. The pairing never depends on them.

Every bar, zero-length ones included, with the cells that open and close it. Cocycles are built only where asked (representative is None elsewhere): with cocycles = false none, with zeroLengthCocycles = false none for zero-length bars. The pairing never depends on them.

Attributes

Source
PackedRipserCohomology.scala
def persistentCohomology(includeZeroLength: Boolean = ...): List[PersistenceBar[Double, Chain[DiameterIndex, CoefficientT]]]

Every bar of degree 0 .. maxDimension, each with its representative cocycle (over DiameterIndex cells; decode with si); zero-length bars only if includeZeroLength.

Every bar of degree 0 .. maxDimension, each with its representative cocycle (over DiameterIndex cells; decode with si); zero-length bars only if includeZeroLength.

Attributes

Source
PackedRipserCohomology.scala
def persistentHomology(includeZeroLength: Boolean = ...): List[PersistenceBar[Double, Chain[DiameterIndex, CoefficientT]]]

The same bars with '''cycles''' as representatives (over DiameterIndex cells): the pairing comes from the cohomology computation, and only the boundary columns of the death simplices are reduced (Involution).

The same bars with '''cycles''' as representatives (over DiameterIndex cells): the pairing comes from the cohomology computation, and only the boundary columns of the death simplices are reduced (Involution).

Attributes

Source
PackedRipserCohomology.scala

Attributes

Source
PackedRipserCohomology.scala

Attributes

Source
PackedRipserCohomology.scala
def usesNeighbourLists: Boolean

Whether cofacets come from neighbour lists (diagnostics and tests).

Whether cofacets come from neighbour lists (diagnostics and tests).

Attributes

Source
PackedRipserCohomology.scala
def vertices(cell: DiameterIndex, size: Int): Array[Int]

The vertices, ascending, of a cell with size vertices: a cell of a degree-k bar's representative has k + 1 (cocycles and cycles alike).

The vertices, ascending, of a cell with size vertices: a cell of a degree-k bar's representative has k + 1 (cocycles and cycles alike).

Attributes

Source
PackedRipserCohomology.scala

Concrete fields

The combinatorial number system of this metric space's simplices with one-word indices. Decode the cells of returned chains with vertices, which also reads two-word indices.

The combinatorial number system of this metric space's simplices with one-word indices. Decode the cells of returned chains with vertices, which also reads two-word indices.

Attributes

Source
PackedRipserCohomology.scala
val usesWideIndices: Boolean

Whether simplices are indexed by two words (WideSimplexIndexing) instead of one Long.

Whether simplices are indexed by two words (WideSimplexIndexing) instead of one Long.

Attributes

Source
PackedRipserCohomology.scala

Givens

Givens

given packedOrdering: Ordering[DiameterIndex]

Attributes

Source
PackedRipserCohomology.scala