BlockParallelReduction

org.appliedtopology.tda4j.BlockParallelReduction

An experiment (JVM only, #192): persistent cohomology of a Vietoris-Rips complex over F_p, degree by degree with clearing as Ripser does (degree 0 by union-find), on explicit coboundary matrices, reduced either sequentially or by edge blocks on a thread pool. Both reductions run the same column arithmetic on the same matrices.

Cells are ordered by block (a cell's first longest edge, by length, then smaller end, then larger end), then dimension, then the layered generator's order. A coface's block is never before its face's, so a column's entries lie in its own block or later ones, and only columns of the same block can have their pivot inside it. Phase 1 reduces each block's columns (in reverse order, as cohomology goes) by that block's columns only, while the pivot stays in the block: every pair it makes is one the sequential reduction makes. A column whose pivot leaves its block is deferred. Phase 2a reduces the deferred columns, in parallel, by the columns phase 1 paired (final, so only read); phase 2b finishes them one by one in order. A positive chunk merges consecutive blocks into units of at least that many columns, which is the chunk algorithm of Bauer, Kerber and Reininghaus with chunk boundaries on block boundaries (all the argument needs is that a unit is contiguous in the order).

java -cp $CP org.appliedtopology.tda4j.BlockParallelReduction      [trials] [seed] [p]

dataset is cube (uniform in the unit cube of R^d), torus or sphere (in R^3, with noise), or alpha: for the cloud's alpha complex instead (blocks by filtration value, fromStream; threshold ignored); method is seq, blocks-, chunks--, packed (PackedRipserCohomologyEngine, pairs only), packed-cocycles, verb (alpha: AlphaShapes, then Persistence), check (every method agrees) or dump (the points as CSV, for C++ Ripser). Each run builds the matrices once and reduces trials times; times are medians.

Attributes

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

Members list

Type members

Classlikes

open class Cells(val dim: Int, val vertices: Array[Int], val value: Array[Double], val block: Array[Int])

One dimension's cells in filtration order: dim + 1 ascending vertices each, value, block.

One dimension's cells in filtration order: dim + 1 ascending vertices each, value, block.

Attributes

Source
BlockParallelReduction.scala
Supertypes
class Object
trait Matchable
class Any
open class Coboundary(val columns: Cells, val rows: Cells, val start: Array[Int], val entryRow: Array[Int], val entryCoeff: Array[Int])

The coboundary from columns (degree-d cells) to rows (degree-(d+1) cells) over F_p, in compressed columns: column j's entries are start(j) until start(j + 1) of entryRow (ascending) and entryCoeff.

The coboundary from columns (degree-d cells) to rows (degree-(d+1) cells) over F_p, in compressed columns: column j's entries are start(j) until start(j + 1) of entryRow (ascending) and entryCoeff.

Attributes

Source
BlockParallelReduction.scala
Supertypes
class Object
trait Matchable
class Any
open class Degree(val store: Store, val cleared: Array[Boolean], val owner: Array[Int], val stats: Stats)

One degree reduced: owner(r) is the column whose pivot is row r, or -1.

One degree reduced: owner(r) is the column whose pivot is row r, or -1.

Attributes

Source
BlockParallelReduction.scala
Supertypes
class Object
trait Matchable
class Any
enum Method

Attributes

Source
BlockParallelReduction.scala
Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
open class Result(val cells: Vector[Cells], val h0Deaths: Array[Boolean], val degrees: Vector[Degree])

Persistent cohomology in degrees 0 .. maxDim: degree 0 by union-find over the edges in order (its deaths clear degree 1), then each degree reduced by method, its pivots clearing the next degree.

Persistent cohomology in degrees 0 .. maxDim: degree 0 by union-find over the edges in order (its deaths clear degree 1), then each degree reduced by method, its pivots clearing the next degree.

Attributes

Source
BlockParallelReduction.scala
Supertypes
class Object
trait Matchable
class Any
open class Scratch

Per-thread merge buffers.

Per-thread merge buffers.

Attributes

Source
BlockParallelReduction.scala
Supertypes
class Object
trait Matchable
class Any
open class Stats(val degree: Int, val columns: Int, val cleared: Int)

How one degree's reduction went.

How one degree's reduction went.

Attributes

Source
BlockParallelReduction.scala
Supertypes
class Object
trait Matchable
class Any
open class Store(val cob: Coboundary, p: Int, cocycles: Boolean)

One degree's columns as they are reduced: a column not yet changed is its slice of the coboundary. With cocycles, also the reduction matrix (V, over column indices; a column never changed is itself).

One degree's columns as they are reduced: a column not yet changed is its slice of the coboundary. With cocycles, also the reduction matrix (V, over column indices; a column never changed is itself).

Attributes

Source
BlockParallelReduction.scala
Supertypes
class Object
trait Matchable
class Any

Value members

Concrete methods

def coboundary(n: Int, columns: Cells, rows: Cells, p: Int): Coboundary

Attributes

Source
BlockParallelReduction.scala
def complex(n: Int, distance: (Int, Int) => Double, threshold: Double, top: Int): Vector[Cells]

The cells of dimensions 0 .. top within threshold, in filtration order; blocks are numbered 0 until edges.

The cells of dimensions 0 .. top within threshold, in filtration order; blocks are numbered 0 until edges.

Attributes

Source
BlockParallelReduction.scala
def endpoint(e: BarcodeEndpoint[Double]): Double

Attributes

Source
BlockParallelReduction.scala
def fromStream(stream: LevelwiseSimplexStream[Int, Double], top: Int): Vector[Cells]

The cells of dimensions 0 .. top of any filtered complex on vertices 0 until n, ordered by value, then dimension, then the stream's own order, with one block per filtration value. On points in general position the cells of one value are one Vietoris-Rips edge block, or one interval of an alpha complex's radius function.

The cells of dimensions 0 .. top of any filtered complex on vertices 0 until n, ordered by value, then dimension, then the stream's own order, with one block per filtration value. On points in general position the cells of one value are one Vietoris-Rips edge block, or one interval of an alpha complex's radius function.

Attributes

Source
BlockParallelReduction.scala
def h0Deaths(cells: Vector[Cells]): Array[Boolean]

Attributes

Source
BlockParallelReduction.scala
def main(args: Array[String]): Unit

Attributes

Source
BlockParallelReduction.scala
def method(name: String): Method

Attributes

Source
BlockParallelReduction.scala
def packedBars(metricSpace: FiniteMetricSpace[Int], maxDim: Int, threshold: Double, p: Int): Vector[(Int, Double, Double)]

The packed Ripser engine's bars of positive length, as Result.bars lists them.

The packed Ripser engine's bars of positive length, as Result.bars lists them.

Attributes

Source
BlockParallelReduction.scala
def persistence(cells: Vector[Cells], cobs: Vector[Coboundary], p: Int, method: Method, cocycles: Boolean, pool: ExecutorService): Result

Attributes

Source
BlockParallelReduction.scala
def points(dataset: String, n: Int, rng: Random): Array[Array[Double]]

Attributes

Source
BlockParallelReduction.scala
def reduce(cob: Coboundary, cleared: Array[Boolean], p: Int, method: Method, cocycles: Boolean, pool: ExecutorService): Degree

Attributes

Source
BlockParallelReduction.scala