SheehyRipsSimplexStream

org.appliedtopology.tda4j.SheehyRipsSimplexStream
See theSheehyRipsSimplexStream companion object
open class SheehyRipsSimplexStream(val ambientMetricSpace: FiniteMetricSpace[Int], val permutation: GreedyPermutation, val epsilon: Double, keepCriterion: PartialFunction[Simplex[Int], Boolean] = ..., maxFiltrationValue: Option[Double] = ..., parallelFiltrationValue: Boolean = ...) extends RipserCofaceSimplexStream

The sparse Vietoris-Rips filtration of Cavanna, Jahanseir and Sheehy, "A Geometric Perspective on Sparse Filtrations" (arXiv:1506.03797, CCCG 2015): the greedy-permutation form of Sheehy's linear-size approximation ("Linear-Size Approximations to the Vietoris-Rips Filtration", DCG 2013, arXiv:1203.6786). Its barcode is a (1 + epsilon)-multiplicative approximation of the Vietoris-Rips barcode (Theorem 5), from a complex of size linear in the number of points for data of bounded doubling dimension. (Sheehy 2013's epsilon is a different parameter: its factor is 1/(1 - 2 epsilon).) The edges are computed from all pairs, O(n^2), rather than by the paper's O(n log n) neighbour search: the complex to reduce is small, its construction is not.

==The construction==

Given a greedy permutation with insertion radii lambda_p (Infinity for the first point) and epsilon in (0, 1):

  • the ball of p at scale alpha has radius min(alpha, lambda_p (1 + epsilon) / epsilon);
  • it is empty from alpha > lambda_p (1 + epsilon)^2 / epsilon on (vanish(p)): no new simplex uses p after that, though nothing already present is removed (the filtration is the running union of the nerves);
  • an edge {p, q} is born at the smallest alpha at which the two balls meet (Algorithm 3, edgeBirth);
  • a simplex is born at the latest birth of its edges, if that is at most the earliest vanish of its vertices (Section 5.3), and never otherwise.

Algorithm 3 computes an edge's birth without the vanish check that Section 5.3 requires of every simplex (for epsilon = 1, lambda_p = 1, lambda_q = 10, d = 10 it gives 8, while p vanishes at 4); edgeBirth applies the check to edges too.

Units: the paper's alpha is a radius; every value here is doubled, so that values are diameters like every other Vietoris-Rips filtration (an unsparsified edge gets exactly its length).

maxFiltrationValue is always clamped to maxFiniteFiltrationValue, the largest finite edge birth: the enclosing radius is no bound here, and an unclamped Infinity threshold would admit simplices that should never appear.

The value of a simplex is not its diameter, so the Ripser engines do not apply; the naive, chunks and cohomology engines do.

Attributes

Companion
object
Experimental
true
Source
SheehyRipsStream.scala
Graph
Supertypes
trait CofaceSimplexStream[Int, Double]
trait LevelwiseSimplexStream[Int, Double]
trait StratifiedCellStream[Simplex[Int], Double]
trait CellStream[Simplex[Int], Double]
trait IterableOnce[Simplex[Int]]
trait Filtration[Simplex[Int], Double]
trait Filterable[Double]
class Object
trait Matchable
class Any
Show all

Members list

Value members

Inherited methods

override def flatLayers: Option[Iterator[Layer]]

The dimensions 0, 1, ... as FlatLayerStream.Layers, each built when the iterator reaches it, up to the last one that has a cell. None for a stream that cannot give its cells as arrays (then iterate it for cells).

The dimensions 0, 1, ... as FlatLayerStream.Layers, each built when the iterator reaches it, up to the last one that has a cell. None for a stream that cannot give its cells as arrays (then iterate it for cells).

Attributes

Definition Classes
Inherited from:
RipserCofaceSimplexStream
Source
SimplexStream.scala
def homologyDegreeLimit: Option[Int]

Some(k) for a complex cut off to compute homology in degrees 0..k (what VietorisRips(points, maxDimension = k) returns, holding cells up to dimension k + 1): its higher degrees are not the homology of the full complex. None (the default) for a complete complex.

Some(k) for a complex cut off to compute homology in degrees 0..k (what VietorisRips(points, maxDimension = k) returns, holding cells up to dimension k + 1): its higher degrees are not the homology of the full complex. None (the default) for a complete complex.

Attributes

Inherited from:
StratifiedCellStream
Source
SimplexStream.scala
override def iterateDimension: PartialFunction[Int, Iterator[Simplex[Int]]]

The cells of dimension d, oldest first. The domain must be contiguous from 0 (0, 1, ..., k, or empty, or all of the naturals): iterator stops at the first dimension where this is undefined.

The cells of dimension d, oldest first. The domain must be contiguous from 0 (0, 1, ..., k, or empty, or all of the naturals): iterator stops at the first dimension where this is undefined.

Attributes

Definition Classes
Inherited from:
RipserCofaceSimplexStream
Source
SimplexStream.scala
override def iterator: Iterator[Simplex[Int]]

All the cells, dimension by dimension. Stops at the first undefined dimension (takeWhile, never filter, which would search forever past the last one).

All the cells, dimension by dimension. Stops at the first undefined dimension (takeWhile, never filter, which would search forever past the last one).

Attributes

Definition Classes
StratifiedCellStream -> IterableOnce
Inherited from:
StratifiedCellStream
Source
SimplexStream.scala
def knownSize: Int

The number of elements in this collection, if it can be cheaply computed, -1 otherwise. Cheaply usually means: Not requiring a collection traversal.

The number of elements in this collection, if it can be cheaply computed, -1 otherwise. Cheaply usually means: Not requiring a collection traversal.

Attributes

Inherited from:
IterableOnce
Source
IterableOnce.scala
def stepper[S <: Stepper[_]](implicit shape: StepperShape[Simplex[Int], S]): S

Returns a scala.collection.Stepper for the elements of this collection.

Returns a scala.collection.Stepper for the elements of this collection.

The Stepper enables creating a Java stream to operate on the collection, see scala.jdk.StreamConverters. For collections holding primitive values, the Stepper can be used as an iterator which doesn't box the elements.

The implicit scala.collection.StepperShape parameter defines the resulting Stepper type according to the element type of this collection.

  • For collections of Int, Short, Byte or Char, an scala.collection.IntStepper is returned
  • For collections of Double or Float, a scala.collection.DoubleStepper is returned
  • For collections of Long a scala.collection.LongStepper is returned
  • For any other element type, an scala.collection.AnyStepper is returned

Note that this method is overridden in subclasses and the return type is refined to S with EfficientSplit, for example scala.collection.IndexedSeqOps.stepper. For Steppers marked with scala.collection.Stepper.EfficientSplit, the converters in scala.jdk.StreamConverters allow creating parallel streams, whereas bare Steppers can be converted only to sequential streams.

Attributes

Inherited from:
IterableOnce
Source
IterableOnce.scala

Concrete fields

val epsilon: Double

Attributes

Source
SheehyRipsStream.scala

Inherited fields

var currentDimension: Int

Attributes

Inherited from:
EnumeratingCofaceSimplexStream
Source
SimplexStream.scala
var currentDimensionCache: Queue[Simplex[Int]]

Attributes

Inherited from:
EnumeratingCofaceSimplexStream
Source
SimplexStream.scala
lazy val edges: Iterable[Simplex[Int]]

Attributes

Inherited from:
EnumeratingCofaceSimplexStream
Source
SimplexStream.scala
override val filtrationOrdering: Ordering[Simplex[Int]]

Filtration value reversed, then dimension, then colexicographic order of the vertex sets (their combinatorial index), the refinement Ripser's apparent pairs are defined with. A total order: without a tie-break, a triangle and its longest edge would compare equal and collide in the reduction. iterateDimension sorts by this same ordering reversed, so iteration order and pivot order agree.

Filtration value reversed, then dimension, then colexicographic order of the vertex sets (their combinatorial index), the refinement Ripser's apparent pairs are defined with. A total order: without a tie-break, a triangle and its longest edge would compare equal and collide in the reduction. iterateDimension sorts by this same ordering reversed, so iteration order and pivot order agree.

Attributes

Inherited from:
EnumeratingCofaceSimplexStream
Source
SimplexStream.scala
override val filtrationValue: PartialFunction[Simplex[Int], Double]

Attributes

Inherited from:
EnumeratingCofaceSimplexStream
Source
SimplexStream.scala
val largest: Double

Attributes

Inherited from:
DoubleFiltration
Source
SimplexStream.scala
var lastDimensionCache: IndexedSeq[Simplex[Int]]

Attributes

Inherited from:
EnumeratingCofaceSimplexStream
Source
SimplexStream.scala
val smallest: Double

Attributes

Inherited from:
DoubleFiltration
Source
SimplexStream.scala