doc/python/persistence-diagram.rst
author Aravindakshan Babu <akshan@stanford.edu>
Wed, 18 Aug 2010 12:05:18 -0700
branchdev
changeset 220 d07d77561661
parent 219 5311343eb2f5
child 221 9ea8d4630907
permissions -rw-r--r--
Removed the points iterator in PersistenceDaigram; replaced it with a __iter__ method. Got rid of some python code in __init__.py, since it was not needed with the above change. Changed the docs to reflect this.

:class:`PersistenceDiagram` class
==================================

.. class:: PersistenceDiagram

    .. method:: __init__( point_seq )
    
        Initializes :class:`PersistenceDiagram` from the given sequence `seq` of `Point` objects, e.g.::
    
            dia = PersistenceDiagram( [Point(1,2)] )

    .. method:: __init__( dimension )
    
        Initializes : an empty( no points ) :class:`PersistenceDiagram` object and sets
        the :attr:`~PersistenceDiagram.dimension` attribute( must be integer ) e.g.::
    
            dia = PersistenceDiagram( 1 )

    .. method:: append( p )
        
        Adds point `p` to the persistence diagram.

    .. attribute:: dimension

        Dimension of the persistence diagram. Must be an integer. Must be set at initialization.

    .. method:: __iter__( )

        Iterator over the points in the persistence diagram,
        e.g.::
            
            for p in dia: print p

    .. method:: __len__( )

        :returns: The number of points in the diagram.



Utility functions for persistence diagrams
--------------------------------------------


.. function:: bottleneck_distance(dia1, dia2)
    
    Calculates the bottleneck distance between the two persistence diagrams.