summaryrefslogtreecommitdiff
path: root/src/Collapse/include
diff options
context:
space:
mode:
authorROUVREAU Vincent <vincent.rouvreau@inria.fr>2020-03-19 07:47:18 +0100
committerROUVREAU Vincent <vincent.rouvreau@inria.fr>2020-03-19 07:47:18 +0100
commit1142403db4ba255e0f5c9f8082a158780df51148 (patch)
tree88d0d5453599ee43934a4305ad53f80dc9bc3748 /src/Collapse/include
parentc8ae4d46d42340140d8687994f322d288e47a3bb (diff)
some cleanups
Diffstat (limited to 'src/Collapse/include')
-rw-r--r--src/Collapse/include/gudhi/FlagComplexSpMatrix.h45
1 files changed, 2 insertions, 43 deletions
diff --git a/src/Collapse/include/gudhi/FlagComplexSpMatrix.h b/src/Collapse/include/gudhi/FlagComplexSpMatrix.h
index d3e58d4f..7d6d6d22 100644
--- a/src/Collapse/include/gudhi/FlagComplexSpMatrix.h
+++ b/src/Collapse/include/gudhi/FlagComplexSpMatrix.h
@@ -217,7 +217,6 @@ class FlagComplexSpMatrix
bool vertexCollapsed;
bool edgeCollapsed;
//Variable to indicate if filtered-edge-collapse has to be performed.
- bool filtEdgeCol;
int expansion_limit;
void init()
@@ -244,7 +243,6 @@ class FlagComplexSpMatrix
vertexCollapsed = false;
edgeCollapsed = false;
- filtEdgeCol = false;
}
//! Function for computing the sparse-matrix corresponding to the core of the complex. It also prepares the working list filteredEgdeIter for edge collapses
@@ -633,26 +631,8 @@ public:
<B>rowToVertex</B>, <B>vertexToRow</B>, <B>rows</B>, <B>cols</B>, <B>sparseRowAdjMatrix</B> are initialised here.
<B>vertDomnIndicator</B>, <B>rowInsertIndicator</B> ,<B>rowIterator<B> are initialised by init() function which is called at the begining of this. <br>
*/
- //Filtered_sorted_edge_list * edge_t = new Filtered_sorted_edge_list();
- FlagComplexSpMatrix(const size_t & num_vertices, const Filtered_sorted_edge_list &edge_t) {
- init();
-
- filtEdgeCol = false;
- sparseRowAdjMatrix = sparseRowMatrix(expansion_limit*num_vertices, expansion_limit*num_vertices); // Initializing sparseRowAdjMatrix, This is a row-major sparse matrix.
-
- for(size_t bgn_idx = 0; bgn_idx < edge_t.size(); bgn_idx++) {
- std::vector<size_t> s = {std::get<1>(edge_t.at(bgn_idx)), std::get<2>(edge_t.at(bgn_idx))};
- insert_new_edges(std::get<1>(edge_t.at(bgn_idx)), std::get<2>(edge_t.at(bgn_idx)), 1);
- }
- sparseRowAdjMatrix.makeCompressed();
-
- // std::cout << sparseRowAdjMatrix << std::endl;
- }
- FlagComplexSpMatrix(const size_t & num_vertices, const Filtered_sorted_edge_list & edge_t, const bool fEdgeCol) {
- if(fEdgeCol)
- {
+ FlagComplexSpMatrix(const size_t & num_vertices, const Filtered_sorted_edge_list & edge_t) {
init();
- filtEdgeCol = true;
sparseRowAdjMatrix = sparseRowMatrix(num_vertices, num_vertices); // Initializing sparseRowAdjMatrix, This is a row-major sparse matrix.
for(size_t bgn_idx = 0; bgn_idx < edge_t.size(); bgn_idx++) {
@@ -662,11 +642,6 @@ public:
}
// sparseRowAdjMatrix.makeCompressed();
- }
- else
- FlagComplexSpMatrix(num_vertices, edge_t);
-
- // std::cout << sparseRowAdjMatrix << std::endl;
}
//! Destructor.
@@ -697,25 +672,9 @@ public:
after_vertex_collapse();
return collapseTime;
}
-
- // Performs edge collapse in of a given sparse-matrix(graph) without considering the filtration value.
- // double strong_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 Collapse : " << collapseTime << " ms\n" << std::endl;
- // //Post processing...
- // after_edge_collapse();
- // return collapseTime;
- // }
-
// Performs edge collapse in a decreasing sequence of the filtration value.
- Filtered_sorted_edge_list filtered_edge_collapse(double steps) {
+ Filtered_sorted_edge_list filtered_edge_collapse() {
auto begin_collapse = std::chrono::high_resolution_clock::now();
critical_core_edges();
vertexCollapsed = false;