--- a/examples/rips/rips-pairwise.cpp Fri Apr 10 14:35:43 2009 -0700
+++ b/examples/rips/rips-pairwise.cpp Fri May 01 15:36:25 2009 -0700
@@ -112,7 +112,6 @@
po::positional_options_description pos;
pos.add("input-file", 1);
- pos.add("output-file", 2);
po::options_description all; all.add(visible).add(hidden);
--- a/include/topology/simplex.h Fri Apr 10 14:35:43 2009 -0700
+++ b/include/topology/simplex.h Fri May 01 15:36:25 2009 -0700
@@ -114,16 +114,16 @@
* DataComparison - compare simplices based on their <data()>
* DataDimensionComparison - compare simplices based on their <data()> within each <dimension()>
*/
-
- /* Classes: Functors
- * DataEvaluator - return data given a simplex
- * DimensionExtractor - return dimesnion given a simplex
- */
struct VertexComparison;
struct VertexDimensionComparison;
struct DataComparison;
struct DataDimensionComparison;
+ /* Classes: Functors
+ *
+ * DataEvaluator - return data given a simplex
+ * DimensionExtractor - return dimesnion given a simplex
+ */
struct DataEvaluator;
struct DimensionExtractor;
--- a/tools/CMakeLists.txt Fri Apr 10 14:35:43 2009 -0700
+++ b/tools/CMakeLists.txt Fri May 01 15:36:25 2009 -0700
@@ -8,5 +8,8 @@
#find_path (QGLViewer_INCLUDE_DIR QGLViewer/qglviewer.h)
#include_directories (${QGLViewer_INCLUDE_DIR})
+add_executable (extract-diagram extract-diagram.cpp)
+target_link_libraries (extract-diagram ${libraries} ${Boost_SERIALIZATION_LIBRARY})
+
add_subdirectory (diagram-viewer)
add_subdirectory (matching)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/extract-diagram.cpp Fri May 01 15:36:25 2009 -0700
@@ -0,0 +1,30 @@
+#include <topology/persistence-diagram.h>
+
+#include <string>
+#include <map>
+#include <iostream>
+
+#include <fstream>
+#include <boost/archive/binary_iarchive.hpp>
+#include <boost/serialization/map.hpp>
+
+typedef PersistenceDiagram<> PDgm;
+
+int main(int argc, char** argv)
+{
+ if (argc < 2)
+ {
+ std::cout << "Usage: " << argv[0] << " FILENAME" << std::endl;
+ return 0;
+ }
+ std::string infilename = argv[1];
+
+ std::ifstream ifs(infilename.c_str());
+ boost::archive::binary_iarchive ia(ifs);
+
+ std::map<Dimension, PDgm> dgms;
+ ia >> dgms;
+ for (std::map<Dimension, PDgm>::const_iterator cur = dgms.begin(); cur != dgms.end(); ++cur)
+ for (PDgm::const_iterator pcur = cur->second.begin(); pcur != cur->second.end(); ++pcur)
+ std::cout << cur->first << " " << pcur->x() << " " << pcur->y() << std::endl;
+}