make-zigzag-subsamples.py doesn't output the union, rips-consistency-zigzag.cpp fixed show_progress dev
authorDmitriy Morozov <dmitriy@mrzv.org>
Wed, 12 Aug 2009 11:32:42 -0700
branchdev
changeset 161 4bfb7c31ab28
parent 160 1b30e507e8aa
child 162 eec482c29319
make-zigzag-subsamples.py doesn't output the union, rips-consistency-zigzag.cpp fixed show_progress
examples/consistency/make-zigzag-subsamples.py
examples/consistency/rips-consistency-zigzag.cpp
--- a/examples/consistency/make-zigzag-subsamples.py	Mon Aug 10 16:48:13 2009 -0700
+++ b/examples/consistency/make-zigzag-subsamples.py	Wed Aug 12 11:32:42 2009 -0700
@@ -27,10 +27,10 @@
     for c in count:
         counts.append(' '.join(map(str, xrange(cur, cur+c))) + '\n')
         cur += c
-        counts.append(' '.join(map(str, xrange(cur-c, cur+c))) + '\n')
+        # counts.append(' '.join(map(str, xrange(cur-c, cur+c))) + '\n')
     
     with open(subsamples_fn, 'w') as f:
-        f.writelines(counts[:-1])
+        f.writelines(counts)
 
 
 if __name__ == '__main__':
@@ -38,7 +38,7 @@
         print "Usage: %s POINTS SUBSAMPLES POINTS1 [POINTS2 [POINTS3 [...]]]" % argv[0]
         print
         print "Creates a file POINTS with the union of POINTS* and SUBSAMPLES which lists"
-        print "the indices of the points and their pairwise unions, one per line"
+        print "the indices of the points one per line"
         exit()
 
     points_fn = argv[1]
--- a/examples/consistency/rips-consistency-zigzag.cpp	Mon Aug 10 16:48:13 2009 -0700
+++ b/examples/consistency/rips-consistency-zigzag.cpp	Wed Aug 12 11:32:42 2009 -0700
@@ -121,6 +121,8 @@
         while (line_in >> sample)
             subsamples.back().push_back(sample);
     }
+    AssertMsg(subsamples.front().size() == 0, "The first subsample should be empty");
+    AssertMsg(subsamples.back().size() == 0, "The last subsample should be empty");     // it's a convenient artifact of the stream processing above
     
     std::cout << "Subsample size:" << std::endl;
     for (unsigned i = 0; i < subsamples.size(); ++i)
@@ -141,7 +143,7 @@
     SimplexVector       subcomplex, across;
     
     rInfo("Commencing computation");
-    boost::progress_display show_progress(subsamples.size());
+    boost::progress_display show_progress(subsamples.size() - 1);
     for (unsigned i = 0; i < subsamples.size() - 1; ++i)
     {
         // Take union of subsamples i and i+1