--- a/include/topology/static-persistence.hpp Tue Dec 01 20:34:31 2009 -0800
+++ b/include/topology/static-persistence.hpp Wed Dec 02 14:03:54 2009 -0800
@@ -4,6 +4,8 @@
#include <boost/utility.hpp>
#include <utilities/property-maps.h>
+#include <boost/foreach.hpp>
+
#ifdef LOGGING
static rlog::RLogChannel* rlPersistence = DEF_CHANNEL("topology/persistence", rlog::Log_Debug);
#endif // LOGGING
@@ -54,6 +56,14 @@
OrderElement& oe = *j;
typename OrderElement::Cycle& z = oe.cycle;
rLog(rlPersistence, " has boundary: %s", z.tostring(outmap).c_str());
+
+ // Sparsify the cycle by removing the negative elements (TODO: make parameter based)
+ typename OrderElement::Cycle zz;
+ BOOST_FOREACH(OrderIndex i, z)
+ if (i->sign()) // positive
+ zz.push_back(i);
+ z.swap(zz);
+ // --------------------------
CountNum(cPersistencePairBoundaries, oe.cycle.size());
Count(cPersistencePair);