summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorROUVREAU Vincent <vincent.rouvreau@inria.fr>2020-03-19 08:05:30 +0100
committerROUVREAU Vincent <vincent.rouvreau@inria.fr>2020-03-19 08:05:30 +0100
commit4010a8da315d500e023d8a1f5b70a9eab3da629c (patch)
treebf35d7e247085c061fb2a881efe4dd1b9d6ffc1b
parent1142403db4ba255e0f5c9f8082a158780df51148 (diff)
some cleanups
-rw-r--r--src/Collapse/example/rips_persistence_with_sc.cpp6
-rw-r--r--src/Collapse/include/gudhi/FlagComplexSpMatrix.h23
2 files changed, 7 insertions, 22 deletions
diff --git a/src/Collapse/example/rips_persistence_with_sc.cpp b/src/Collapse/example/rips_persistence_with_sc.cpp
index f16588cf..46ec8eca 100644
--- a/src/Collapse/example/rips_persistence_with_sc.cpp
+++ b/src/Collapse/example/rips_persistence_with_sc.cpp
@@ -29,7 +29,7 @@ public:
doubleVector distances ;
std::pair<std::size_t, std::size_t> e;
for(std::size_t indx = 0; indx < number_of_points; indx++) {
- for (int j = 0; j <= indx; j++) {
+ for (std::size_t j = 0; j <= indx; j++) {
if( j == indx)
distances.push_back(0);
@@ -80,13 +80,11 @@ int main(int argc, char * const argv[]) {
filediag_aft = filediag_aft+"_"+ out_file_name+ ".txt";
- double currentCreationTime = 0.0;
-
Distance_matrix distances;
Distance_matrix *sparse_distances = new Distance_matrix();
- if(manifold == 'f' || manifold =='f') {
+ if(manifold == 'f') {
Gudhi::Points_off_reader<Point> off_reader(in_file_name);
if (!off_reader.is_valid()) {
std::cerr << "Unable to read file " << in_file_name << "\n";
diff --git a/src/Collapse/include/gudhi/FlagComplexSpMatrix.h b/src/Collapse/include/gudhi/FlagComplexSpMatrix.h
index 7d6d6d22..a1174084 100644
--- a/src/Collapse/include/gudhi/FlagComplexSpMatrix.h
+++ b/src/Collapse/include/gudhi/FlagComplexSpMatrix.h
@@ -250,10 +250,10 @@ class FlagComplexSpMatrix
{
sparse_colpsd_adj_Matrix = new sparseRowMatrix(rows,rows); // Just for debugging purpose.
oneSimplices.clear();
- if(not filteredEgdeIter.empty())
+ if(not filteredEgdeIter.empty()) {
std::cout << "Working list for edge collapses are not empty before the edge-collapse." << std::endl;
-
- for(int rw = 0 ; rw < rows ; ++rw)
+ }
+ for(std::size_t rw = 0 ; rw < rows ; ++rw)
{
if(not vertDomnIndicator[rw]) //If the current column is not dominated
{
@@ -468,8 +468,6 @@ class FlagComplexSpMatrix
EdgeFilt fec = fEgdeVector.at(endIdx);
insert_new_edges(std::get<0>(std::get<0>(fec)), std::get<1>(std::get<0>(fec)),std::get<1>(fec)); // Inserts the edge in the sparse matrix to update the graph (G_i)
- // cfiltVal = std::get<1>(fEgdeVector.at(endIdx));
- // std::cout << "The current processing index is " << endIdx << std::endl;
Edge e = std::get<0>(fec);
Vertex u = std::get<0>(e);
@@ -675,21 +673,9 @@ public:
// Performs edge collapse in a decreasing sequence of the filtration value.
Filtered_sorted_edge_list filtered_edge_collapse() {
- auto begin_collapse = std::chrono::high_resolution_clock::now();
critical_core_edges();
vertexCollapsed = false;
edgeCollapsed = true;
- auto end_collapse = std::chrono::high_resolution_clock::now();
-
- auto collapseTime = std::chrono::duration<double, std::milli>(end_collapse- begin_collapse).count();
- std::cout << "Time of filtered edge Collapse : " << collapseTime << " ms\n" << std::endl;
- //Post processing...
- // after_edge_collapse();
- // std::cout << sparseRowAdjMatrix << std::endl;
- // for(auto idx = criticalCoreEdges.begin(); idx != criticalCoreEdges.end(); idx++ )
- // {
- // std::cout <<
- // }
return criticalCoreEdges;
}
@@ -805,8 +791,9 @@ public:
vertexVector active_neighbors(const Vertex & v) {
vertexVector nb;
auto rw_v = vertexToRow.find(v);
- if(rw_v != vertexToRow.end())
+ if(rw_v != vertexToRow.end()) {
nb = vertex_closed_active_neighbours(rw_v->second);
+ }
return nb;
}