PersistenceDiagram
class¶Initializes : an empty( no points ) PersistenceDiagram
object and sets
the dimension
attribute( must be integer ) e.g.:
dia = PersistenceDiagram( 1 )
Initializes PersistenceDiagram
of specified dimension from the given sequence seq of tuples, e.g.:
dia = PersistenceDiagram( 1, (1,2) )
The tuples must have at least 2 elements (birth, death)
.
If there is a third element, it is stored as extra data associated to
a point.
Adds point p to the persistence diagram.
Dimension of the persistence diagram. Must be an integer. Must be set at initialization.
Iterator over the points in the persistence diagram, e.g.:
for p in dia: print p
The number of points in the diagram.
Initializes a collection of PersistenceDiagram
instances from persistence
and filtration. Optional eval can determine how to extract birth and
death values from a simplex. For example, if filtration was filled using
fill_alpha_complex()
, the data
contains a pair (value, critical)
.
We can extract the value
from the tuple:
init_diagrams(persistence, filtration, lambda s: s.data[0])
Optional data argument can return arbitrary data to associate with each point, given an node of persistence.
Calculates the bottleneck distance between the two persistence diagrams.
Calculates the p-th Wasserstein distance between the two persistence diagrams.