summaryrefslogtreecommitdiff
path: root/ripser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ripser.cpp')
-rw-r--r--ripser.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/ripser.cpp b/ripser.cpp
index d12c3a4..b6b7094 100644
--- a/ripser.cpp
+++ b/ripser.cpp
@@ -778,11 +778,22 @@ int main(int argc, char** argv) {
if (!point.empty()) points.push_back(point);
}
- euclidean_distance_matrix dist(std::move(points));
- index_t n = dist.size();
+ euclidean_distance_matrix eucl_dist(std::move(points));
+
+ index_t n = eucl_dist.size();
std::cout << "point cloud with " << n << " points" << std::endl;
+ std::vector<value_t> distances;
+
+ for (int i = 0; i < n; ++i)
+ for (int j = 0; j < i; ++j)
+ if (i > j) distances.push_back(eucl_dist(i,j));
+
+ compressed_lower_distance_matrix dist(std::move(distances));
+
+ std::cout << "distance matrix with " << n << " points" << std::endl;
+
#endif
#ifdef FILE_FORMAT_LOWER_TRIANGULAR_CSV