LayeredInorderSimplexStream

org.appliedtopology.tda4j.LayeredInorderSimplexStream
See theLayeredInorderSimplexStream companion class

Attributes

Companion
class
Experimental
true
Source
LayeredInorderSimplexStream.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Type members

Classlikes

enum Candidates

How the candidate vertices of a simplex (those within its diameter of all its vertices) are found.

How the candidate vertices of a simplex (those within its diameter of all its vertices) are found.

Attributes

Source
LayeredInorderSimplexStream.scala
Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
open class DoubleBuffer

A growable Array[Double].

A growable Array[Double].

Attributes

Source
LayeredInorderSimplexStream.scala
Supertypes
class Object
trait Matchable
class Any
open class FlagGenerator(val n: Int, val threshold: Double, val candidates: Candidates, edgeList: Edges, val deadline: Array[Double])

Builds the layers of the flag complex of a weighted graph on the vertices 0 until n, up to threshold: a set of vertices is a simplex when all its pairs are edges, and its value is the largest edge weight, the diameter in the paper. Vietoris-Rips is the graph with an edge for every pair within threshold (Generator).

Builds the layers of the flag complex of a weighted graph on the vertices 0 until n, up to threshold: a set of vertices is a simplex when all its pairs are edges, and its value is the largest edge weight, the diameter in the paper. Vietoris-Rips is the graph with an edge for every pair within threshold (Generator).

The paper writes vertices in decreasing order and lets the facet without the largest vertex generate a simplex when it can. Here vertices ascend and the smallest vertex plays that part, which makes simplices with the same first longest edge come out colexicographically descending. For a simplex u0 < u1 < ... < uk of diameter α whose first longest edge (the full-length edge a < b with the largest a, then the largest b) is ab:

  1. any w < u0 within α of every vertex gives w u0 ... uk;
  2. if a = u0 (every full-length edge contains u0), any u0 < w < u1 within α of u0 and closer than α to the rest gives u0 w u1 ... uk;
  3. if moreover b = u1 (the only full-length edge is u0 u1), any u1 < w < u2 (any w > u1 for an edge) closer than α to every vertex gives u0 u1 w u2 ... uk.

In each case the new simplex keeps the first longest edge ab, so the diameter is never recomputed. The candidates are emitted largest first. On points in general position (no two distances equal) that is already the colexicographically descending order of each tie; elsewhere a run of equal diameters that comes out of order is sorted, and counted in tieRunsSorted.

Only the edge weights are read, so any flag filtration whose simplices take the largest weight of their edges can be built with it. A vertex w can also leave: with deadline(w) < α the vertex is added to no simplex of value α (Sheehy's sparse Rips complex, where a point vanishes from the nerve after a scale); an empty deadline means no vertex does. A vertex's own value never matters for the layers from dimension 1 on, provided no edge is below the values of its ends, as in the DTM filtration.

Value parameters

deadline

per vertex, the last value at which it can join a simplex; empty for no deadline

edges

the edges within threshold, unsorted, each once with a < b (FlagGenerator.ofEdges checks and builds them)

Attributes

Companion
object
Source
LayeredInorderSimplexStream.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Generator
object FlagGenerator

Attributes

Companion
class
Source
LayeredInorderSimplexStream.scala
Supertypes
class Object
trait Matchable
class Any
Self type
open class Generator(n: Int, distance: (Int, Int) => Double, threshold: Double, candidates: Candidates = ...) extends FlagGenerator

Builds the layers of the Vietoris-Rips complex of the n points with the given distance, up to threshold: the flag complex of the graph with an edge for every pair within threshold (FlagGenerator).

Builds the layers of the Vietoris-Rips complex of the n points with the given distance, up to threshold: the flag complex of the graph with an edge for every pair within threshold (FlagGenerator).

Attributes

Source
LayeredInorderSimplexStream.scala
Supertypes
class Object
trait Matchable
class Any
open class IntBuffer

A growable Array[Int].

A growable Array[Int].

Attributes

Source
LayeredInorderSimplexStream.scala
Supertypes
class Object
trait Matchable
class Any
open class Layer(val dim: Int, val size: Int, val vertices: Array[Int], val root: Array[Int])

One dimension in filtration order. Simplex i has the ascending vertices vertices(i * (dim + 1) until (i + 1) * (dim + 1)); its first longest edge is edge root(i) of the generator's edge list, and that edge's length is its diameter.

One dimension in filtration order. Simplex i has the ascending vertices vertices(i * (dim + 1) until (i + 1) * (dim + 1)); its first longest edge is edge root(i) of the generator's edge list, and that edge's length is its diameter.

Attributes

Source
LayeredInorderSimplexStream.scala
Supertypes
class Object
trait Matchable
class Any

Value members

Concrete methods

def distanceOf(space: FiniteMetricSpace[Int]): (Int, Int) => Double

space.distance as a function of two Ints that does not box them: a call through FiniteMetricSpace[Int] goes to the generic distance(VertexT, VertexT) and allocates two Integers per pair, which the pass over all n^2 / 2 pairs of Generator pays for, while a class that declares distance(Int, Int) is called directly.

space.distance as a function of two Ints that does not box them: a call through FiniteMetricSpace[Int] goes to the generic distance(VertexT, VertexT) and allocates two Integers per pair, which the pass over all n^2 / 2 pairs of Generator pays for, while a class that declares distance(Int, Int) is called directly.

Attributes

Source
LayeredInorderSimplexStream.scala
inline def sortIndices(count: Int, inline compare: (Int, Int) => Int): Array[Int]

0 until count stably sorted by compare: a merge sort on primitive indices, over insertion-sorted blocks, whose merge of two neighbours moves only the part of each that overlaps the other. A sequence that is nearly in order, as the runs of equal diameter the generator emits are, costs little more at a block size above its disorder than the comparisons that find the overlap.

0 until count stably sorted by compare: a merge sort on primitive indices, over insertion-sorted blocks, whose merge of two neighbours moves only the part of each that overlaps the other. A sequence that is nearly in order, as the runs of equal diameter the generator emits are, costs little more at a block size above its disorder than the comparisons that find the overlap.

Attributes

Source
LayeredInorderSimplexStream.scala