Changed the first iterator of PersistenceDiagram to accept dimension as well. Modified documentation. dev
authorAravindakshan Babu <akshan@stanford.edu>
Wed, 18 Aug 2010 15:35:48 -0700
branchdev
changeset 221 9ea8d4630907
parent 220 d07d77561661
child 222 fdfde7291a0f
Changed the first iterator of PersistenceDiagram to accept dimension as well. Modified documentation.
bindings/python/persistence-diagram.cpp
doc/python/overview.rst
doc/python/persistence-diagram.rst
doc/python/point.rst
--- a/bindings/python/persistence-diagram.cpp	Wed Aug 18 12:05:18 2010 -0700
+++ b/bindings/python/persistence-diagram.cpp	Wed Aug 18 15:35:48 2010 -0700
@@ -53,14 +53,14 @@
 
 
 template<class PersistenceDiagram, class Point>
-boost::shared_ptr<PersistenceDiagram>    init_from_points_sequence( bp::object point_sequence ){
+boost::shared_ptr<PersistenceDiagram>    init_from_points_sequence( Dimension dimension, bp::object point_sequence ){
 
     typedef bp::stl_input_iterator<Point> PointIterator;
 
     PointIterator beg = PointIterator( point_sequence ), end = PointIterator( );
     // The following line is commented out until we can figure out the Evaluator class in make_point
     //boost::shared_ptr<PersistenceDiagram> p(  new PersistenceDiagram( beg, end );
-    boost::shared_ptr<PersistenceDiagram> p(  new PersistenceDiagram( ) );
+    boost::shared_ptr<PersistenceDiagram> p(  new PersistenceDiagram( dimension ) );
 
     for( PointIterator cur=beg;  cur!=end; cur++ )
         (*p).push_back( *cur );
--- a/doc/python/overview.rst	Wed Aug 18 12:05:18 2010 -0700
+++ b/doc/python/overview.rst	Wed Aug 18 15:35:48 2010 -0700
@@ -21,5 +21,4 @@
     alphashapes.rst
     rips.rst
     zigzag-persistence.rst
-    point.rst
     persistence-diagram.rst
--- a/doc/python/persistence-diagram.rst	Wed Aug 18 12:05:18 2010 -0700
+++ b/doc/python/persistence-diagram.rst	Wed Aug 18 15:35:48 2010 -0700
@@ -3,12 +3,6 @@
 
 .. 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
@@ -16,6 +10,12 @@
     
             dia = PersistenceDiagram( 1 )
 
+    .. method:: __init__( dimension, point_seq )
+    
+        Initializes :class:`PersistenceDiagram` of specified dimension from the given sequence `seq` of :class:`Point` objects, e.g.::
+    
+            dia = PersistenceDiagram( 1, [Point(1,2)] )
+
     .. method:: append( p )
         
         Adds point `p` to the persistence diagram.
@@ -44,3 +44,41 @@
 .. function:: bottleneck_distance(dia1, dia2)
     
     Calculates the bottleneck distance between the two persistence diagrams. 
+
+
+
+:class:`Point` class
+======================
+
+.. class:: Point
+
+    .. method:: __init__( x, y [, data])
+    
+        Initializes :class:`Point` with the given real-valued coordinates and
+        optionally real value `data`, e.g.::
+    
+            s = Point( 1, 1.1, 1.11 )
+
+    .. attribute:: x
+        
+        x coordinate of the point
+
+    .. attribute:: y
+        
+        y coordinate of the point
+
+    .. attribute:: data
+        
+        Real value stored in the simplex.
+
+    .. method:: __iter__( )
+
+        Point objects are iterable, returning two or three elements depending on presence of data, e.g.::
+
+            p = Point( 1, 1.1, 1.11 )
+            for i in p:  print p
+
+            1
+            1.1
+            1.11
+
--- a/doc/python/point.rst	Wed Aug 18 12:05:18 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-:class:`Point` class
-======================
-
-.. class:: Point
-
-    .. method:: __init__( x, y [, data])
-    
-        Initializes :class:`Point` with the given real-valued coordinates and
-        optionally real value `data`, e.g.::
-    
-            s = Point( 1, 1.1, 1.11 )
-
-    .. attribute:: x
-        
-        x coordinate of the point
-
-    .. attribute:: y
-        
-        y coordinate of the point
-
-    .. attribute:: data
-        
-        Real value stored in the simplex.
-
-    .. method:: __iter__( )
-
-        Point objects are iterable, returning two or three elements depending on presence of data, e.g.::
-
-            p = Point( 1, 1.1, 1.11 )
-            for i in p:  print p
-
-            1
-            1.1
-            1.11