From 4010a8da315d500e023d8a1f5b70a9eab3da629c Mon Sep 17 00:00:00 2001 From: ROUVREAU Vincent Date: Thu, 19 Mar 2020 08:05:30 +0100 Subject: some cleanups --- src/Collapse/example/rips_persistence_with_sc.cpp | 6 ++---- src/Collapse/include/gudhi/FlagComplexSpMatrix.h | 23 +++++------------------ 2 files changed, 7 insertions(+), 22 deletions(-) (limited to 'src/Collapse') 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 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 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(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; } -- cgit v1.2.3