summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile24
-rw-r--r--ripser.cpp23
-rw-r--r--ripser.xcodeproj/project.pbxproj1
3 files changed, 26 insertions, 22 deletions
diff --git a/Makefile b/Makefile
index 90543db..3704813 100644
--- a/Makefile
+++ b/Makefile
@@ -1,24 +1,8 @@
-build: ripser
+build: ripser-representatives
-all: ripser ripser-coeff ripser-reduction ripser-coeff-reduction ripser-debug
-
-
-ripser: ripser.cpp
- c++ -std=c++11 ripser.cpp -o ripser -Ofast -D NDEBUG -D USE_GOOGLE_HASHMAP
-
-ripser-coeff: ripser.cpp
- c++ -std=c++11 ripser.cpp -o ripser-coeff -Ofast -D NDEBUG -D USE_GOOGLE_HASHMAP -D USE_COEFFICIENTS
-
-ripser-reduction: ripser.cpp
- c++ -std=c++11 ripser.cpp -o ripser-reduction -Ofast -D NDEBUG -D USE_GOOGLE_HASHMAP -D ASSEMBLE_REDUCTION_MATRIX
-
-ripser-coeff-reduction: ripser.cpp
- c++ -std=c++11 ripser.cpp -o ripser-coeff-reduction -Ofast -D NDEBUG -D USE_GOOGLE_HASHMAP -D USE_COEFFICIENTS -D ASSEMBLE_REDUCTION_MATRIX
-
-ripser-debug: ripser.cpp
- c++ -std=c++11 ripser.cpp -o ripser-debug -g -D USE_GOOGLE_HASHMAP
-
+ripser-representatives: ripser.cpp
+ c++ -std=c++11 ripser.cpp -o ripser-representatives -Ofast -D NDEBUG -D USE_COEFFICIENTS -D ASSEMBLE_REDUCTION_MATRIX -D USE_GOOGLE_HASHMAP
clean:
- rm -f ripser ripser-coeff ripser-reduction ripser-coeff-reduction ripser-debug
+ rm -f ripser-representatives
diff --git a/ripser.cpp b/ripser.cpp
index d3aa615..430f063 100644
--- a/ripser.cpp
+++ b/ripser.cpp
@@ -36,6 +36,8 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
#include <sstream>
#include <unordered_map>
+#include "prettyprint.hpp"
+
#ifdef USE_GOOGLE_HASHMAP
#include <sparsehash/sparse_hash_map>
template <class Key, class T> class hash_map : public google::sparse_hash_map<Key, T> {
@@ -631,7 +633,15 @@ public:
#ifdef INDICATE_PROGRESS
std::cout << "\033[K";
#endif
- std::cout << " [" << diameter << ", )" << std::endl << std::flush;
+// std::cout << " [" << diameter << ", )" << std::endl << std::flush;
+ std::cout << " [" << diameter << ", ): {";
+ auto cocycle = reduction_column;
+ while (get_index(pivot = get_pivot(cocycle, modulus)) != -1) {
+ std::cout << vertices_of_simplex(get_index(pivot), dim, n, binomial_coeff) << ":" << get_coefficient(pivot);
+ cocycle.pop();
+ if (get_index(pivot = get_pivot(cocycle, modulus)) != -1) std::cout << ", ";
+ }
+ std::cout << "}" << std::endl;
#endif
break;
}
@@ -643,8 +653,17 @@ public:
#ifdef INDICATE_PROGRESS
std::cout << "\033[K";
#endif
- std::cout << " [" << diameter << "," << death << ")" << std::endl << std::flush;
+// std::cout << " [" << diameter << "," << death << ")" << std::endl << std::flush;
+ std::cout << " [" << diameter << "," << death << "): {";
+ auto cocycle = reduction_column;
+ diameter_entry_t e;
+ while (get_index(e = get_pivot(cocycle, modulus)) != -1) {
+ std::cout << vertices_of_simplex(get_index(e), dim, n, binomial_coeff) << ":" << get_coefficient(pivot);
+ cocycle.pop();
+ if (get_index(e = get_pivot(cocycle, modulus)) != -1) std::cout << ", ";
}
+ std::cout << "}" << std::endl;
+ }
#endif
pivot_column_index.insert(std::make_pair(get_index(pivot), i));
diff --git a/ripser.xcodeproj/project.pbxproj b/ripser.xcodeproj/project.pbxproj
index 24c7d8b..3578fa0 100644
--- a/ripser.xcodeproj/project.pbxproj
+++ b/ripser.xcodeproj/project.pbxproj
@@ -217,6 +217,7 @@
_FILE_FORMAT_LOWER_DISTANCE_MATRIX,
_FILE_FORMAT_POINT_CLOUD,
_USE_COEFFICIENTS,
+ ASSEMBLE_REDUCTION_MATRIX,
INDICATE_PROGRESS,
);
PRODUCT_NAME = "$(TARGET_NAME)";