Ripser

org.appliedtopology.tda4j.Ripser
object Ripser

Ripser's input formats (point-cloud, lower-distance, upper-distance, distance, binary, sparse), with the conventions of ripser.cpp. Not supported: dipha (use Dipha).

Attributes

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

Members list

Value members

Concrete methods

def formatBinaryLowerDistanceMatrix(matrix: Array[Array[Double]]): Array[Byte]

Attributes

Source
Ripser.scala
def formatLowerDistanceMatrix(matrix: Array[Array[Double]]): String

Attributes

Source
Ripser.scala
def formatPointCloud(points: Array[Array[Double]]): String

Attributes

Source
Ripser.scala
def formatSparseDistanceMatrix(matrix: Array[Array[Double]]): String

The sparse text of matrix: a line i j d for each pair i < j whose distance is finite.

The sparse text of matrix: a line i j d for each pair i < j whose distance is finite.

Attributes

Source
Ripser.scala
def formatUpperDistanceMatrix(matrix: Array[Array[Double]]): String

Attributes

Source
Ripser.scala
def maxFiniteDistance(matrix: Array[Array[Double]]): Double

The largest distance in matrix that is not infinite (0 if there is none): the threshold at which a sparse matrix is the flag complex of its listed edges.

The largest distance in matrix that is not infinite (0 if there is none): the threshold at which a sparse matrix is the flag complex of its listed edges.

Attributes

Source
Ripser.scala
def parseBinaryLowerDistanceMatrix(bytes: Array[Byte]): Array[Array[Double]]

readBinaryLowerDistanceMatrix on the bytes of such a file.

readBinaryLowerDistanceMatrix on the bytes of such a file.

Attributes

Source
Ripser.scala
def parseDistanceMatrix(text: String, origin: String = ...): Array[Array[Double]]

--format distance (Ripser's own default): a dense n x n matrix, one row per line, but ONLY the strictly lower triangle of each line is actually read (for (j = 0; j < i && s >> value; ++j)) -- so line i (0-indexed) must have at least i values, and anything at or past the diagonal is ignored outright, never cross-checked against the lower triangle.

--format distance (Ripser's own default): a dense n x n matrix, one row per line, but ONLY the strictly lower triangle of each line is actually read (for (j = 0; j < i && s >> value; ++j)) -- so line i (0-indexed) must have at least i values, and anything at or past the diagonal is ignored outright, never cross-checked against the lower triangle.

Attributes

Source
Ripser.scala
def parseLowerDistanceMatrix(text: String): Array[Array[Double]]

--format lower-distance: every value in the file (across line breaks; comma- or whitespace-separated) is one flat token stream: row i (i = 1 until n) contributes i entries d(i,0),...,d(i,i-1), rows concatenated in order -- confirmed against read_lower_distance_matrix/compressed_lower_distance_matrix's init_rows in ripser.cpp directly.

--format lower-distance: every value in the file (across line breaks; comma- or whitespace-separated) is one flat token stream: row i (i = 1 until n) contributes i entries d(i,0),...,d(i,i-1), rows concatenated in order -- confirmed against read_lower_distance_matrix/compressed_lower_distance_matrix's init_rows in ripser.cpp directly.

Attributes

Source
Ripser.scala
def parsePointCloud(text: String): Array[Array[Double]]

One point per line, whitespace- or comma-separated coordinates -- Ripser's default --format point-cloud.

One point per line, whitespace- or comma-separated coordinates -- Ripser's default --format point-cloud.

Attributes

Source
Ripser.scala
def parseSparseDistanceMatrix(text: String, origin: String = ...): Array[Array[Double]]

--format sparse: one i j d triple per line (0-based vertex numbers and the distance, separated by commas or whitespace), a pair listed once. The number of points is the largest index plus one, as in ripser.cpp (a last vertex with no edge cannot be named). A pair that is not listed has no edge: its distance is +Infinity in the result, and a threshold below that leaves it out of the complex. Lines with i == j are skipped, as Ripser skips them; a pair listed twice is refused (Ripser would count it as two edges).

--format sparse: one i j d triple per line (0-based vertex numbers and the distance, separated by commas or whitespace), a pair listed once. The number of points is the largest index plus one, as in ripser.cpp (a last vertex with no edge cannot be named). A pair that is not listed has no edge: its distance is +Infinity in the result, and a threshold below that leaves it out of the complex. Lines with i == j are skipped, as Ripser skips them; a pair listed twice is refused (Ripser would count it as two edges).

Ripser's default threshold is infinite, so a complex built from this matrix needs the largest listed distance as its maxFiltrationValue (maxFiniteDistance) to be the flag complex of the listed edges.

Attributes

Source
Ripser.scala
def parseSparseGraph(text: String, origin: String = ...): WeightedGraph

The sparse text as a WeightedGraph: the same lines, held as neighbour lists (n + 2 m numbers) instead of an n x n matrix, for a network too large for a matrix. Persistence(graph) is then the flag complex of the listed edges (FlagComplex) up to the longest one. The rules are those of parseSparseDistanceMatrix: the number of vertices is the largest index plus one, loops are skipped and a pair listed twice is refused.

The sparse text as a WeightedGraph: the same lines, held as neighbour lists (n + 2 m numbers) instead of an n x n matrix, for a network too large for a matrix. Persistence(graph) is then the flag complex of the listed edges (FlagComplex) up to the longest one. The rules are those of parseSparseDistanceMatrix: the number of vertices is the largest index plus one, loops are skipped and a pair listed twice is refused.

Attributes

Source
Ripser.scala
def parseUpperDistanceMatrix(text: String): Array[Array[Double]]

upper-distance: the entries above the diagonal, row by row (d(0,1), ..., d(0,n-1), d(1,2), ...).

upper-distance: the entries above the diagonal, row by row (d(0,1), ..., d(0,n-1), d(1,2), ...).

Attributes

Source
Ripser.scala

Attributes

Source
Ripser.scala
def readBinaryLowerDistanceMatrix(path: String): Array[Array[Double]]

--format binary: no header at all, just raw little-endian IEEE-754 float32 values read until EOF, in the same flat lower-triangular order as readLowerDistanceMatrix -- Ripser's own value_t is typedef float value_t, NOT double (confirmed directly against ripser.cpp's own typedef), so every value narrows to 32 bits on write and widens back to Double on read; this is real precision loss, matching what real ripser --format binary output already has baked in, not something this reader introduces.

--format binary: no header at all, just raw little-endian IEEE-754 float32 values read until EOF, in the same flat lower-triangular order as readLowerDistanceMatrix -- Ripser's own value_t is typedef float value_t, NOT double (confirmed directly against ripser.cpp's own typedef), so every value narrows to 32 bits on write and widens back to Double on read; this is real precision loss, matching what real ripser --format binary output already has baked in, not something this reader introduces.

Attributes

Source
Ripser.scala
def readDistanceMatrix(path: String): Array[Array[Double]]

Attributes

Source
Ripser.scala

Attributes

Source
Ripser.scala
def readLowerDistanceMatrix(path: String): Array[Array[Double]]

Attributes

Source
Ripser.scala
def readPointCloud(path: String): Array[Array[Double]]

Attributes

Source
Ripser.scala
def readSparseDistanceMatrix(path: String): Array[Array[Double]]

Attributes

Source
Ripser.scala
def readSparseGraph(path: String): WeightedGraph

Attributes

Source
Ripser.scala
def readUpperDistanceMatrix(path: String): Array[Array[Double]]

Attributes

Source
Ripser.scala
def writeBinaryLowerDistanceMatrix(path: String, matrix: Array[Array[Double]]): Unit

Attributes

Source
Ripser.scala
def writeLowerDistanceMatrix(path: String, matrix: Array[Array[Double]]): Unit

Attributes

Source
Ripser.scala
def writePointCloud(path: String, points: Array[Array[Double]]): Unit

Attributes

Source
Ripser.scala
def writeSparseDistanceMatrix(path: String, matrix: Array[Array[Double]]): Unit

Attributes

Source
Ripser.scala
def writeUpperDistanceMatrix(path: String, matrix: Array[Array[Double]]): Unit

Attributes

Source
Ripser.scala