Basics
PersistenceDiagramsBase.PersistenceInterval — TypePersistenceIntervalThe type that represents a persistence interval. It behaves exactly like a Tuple{Float64, Float64}, but can have meta data attached to it. The metadata is accessible with getproperty.
Example
julia> interval = PersistenceInterval(1, Inf; meta1=:a, meta2=:b)
[1.0, ∞) with:
meta1: Symbol
meta2: Symbol
julia> birth(interval), death(interval), persistence(interval)
(1.0, Inf, Inf)
julia> isfinite(interval)
false
julia> propertynames(interval)
(:birth, :death, :meta1, :meta2)
julia> interval.meta1
:aPersistenceDiagramsBase.birth — Functionbirth(interval)Get the birth time of interval.
PersistenceDiagramsBase.death — Functiondeath(interval)Get the death time of interval.
PersistenceDiagramsBase.persistence — Functionpersistence(interval)Get the persistence of interval, which is equal to death - birth.
PersistenceDiagramsBase.representative — Functionrepresentative(interval::PersistenceInterval)Get the representative (co)cycle attached to interval, if it has one.
PersistenceDiagramsBase.birth_simplex — Functionbirth_simplex(interval::PersistenceInterval)Get the critical birth simplex of interval, if it has one.
PersistenceDiagramsBase.death_simplex — Functiondeath_simplex(interval::PersistenceInterval)Get the critical death simplex of interval, if it has one.
An infinite interval's death simplex is nothing.
PersistenceDiagramsBase.PersistenceDiagram — TypePersistenceDiagram{P<:PersistenceInterval} <: AbstractVector{P}Type for representing persistence diagrams. Behaves exactly like a vector of PersistenceIntervals, but is can have metadata attached to it and supports pretty printing and plotting.
Can be used as a table with any function that uses the Tables.jl interface.
Example
julia> diagram = PersistenceDiagram([(1, 3), (3, 4), (1, Inf)]; dim=1, custom_metadata=:a)
3-element 1-dimensional PersistenceDiagram:
[1.0, 3.0)
[3.0, 4.0)
[1.0, ∞)
julia> diagram[1]
[1.0, 3.0)
julia> sort(diagram; by=persistence, rev=true)
3-element 1-dimensional PersistenceDiagram:
[1.0, ∞)
[1.0, 3.0)
[3.0, 4.0)
julia> propertynames(diagram)
(:dim, :custom_metadata)
julia> dim(diagram)
1
julia> diagram.custom_metadata
:aMissing docstring for PersistenceDiagrams.table. Check Documenter's build log for details.
PersistenceDiagrams.barcode — Methodbarcode(diagram)Plot the barcode plot of persistence diagram or multiple diagrams in a collection. The infinity keyword argument determines where the infinity line is placed. If unset, the function tries to use threshold(diagram), or guess a good position to place the line at.