Skip to content

mtsch/Ripser.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ripser.jl

Build Status Build status codecov

Simple wrapper to Ripser in Julia with almost no features and minimal dependencies.

Ripser.jl should work, but is not maintained. If you are interested in this project, it might be worth taking a look at Ripserer.jl.

Installation

This package is unregistered. To install, run it with:

(v1.0) pkg> add https://github.com/mtsch/Ripser.jl#master
(v1.0) pkg> test Ripser

Usage

ripser(dists; modulus = 2, dim_max = 1, threshold = Inf, cocycles = false)

Run Ripser on a dists, and a square (sparse) matrix of T<:AbstractFloat.

  • dists: the distance matrix. Matrix can be sparse.
  • dim_max: compute persistent homology up to this dimension.
  • threshold: compute Rips complexes up to this diameter.
  • modulus: compute homology with coefficients in the prime field Z/pZ, where p is the value given.
  • cocycles: return representative cocycles.

Returns a Vector{Vector{Tuple{T, T}}} and if cocycles is set to true, a Vector{Vector{Tuple{Vector{Int64},Int64}}}.

The first part of the result contains a persistence diagram per each dimension (and is of length dim_max + 1). Each persistence diagram is a vector of tuples, where a tuple is the persistence pair (birth, death). A single cocycle is represented as a vector of (simplex, value) pairs. They are only included if the value is nonzero. Each persistence pair gets a corresponding cocycle.

Note that representative cocycles for the zeroth dimension are not computed.