summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2015-06-24 10:02:20 +0000
committervrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2015-06-24 10:02:20 +0000
commit540b437fbc207a980ab5cb7945f1a6d42aab40a7 (patch)
treeb5e6881fa8274eecb411d1f9078c4e3d99cd7dfd
parentd7c885fc4eaa06be6e6b57b8c3bd622b82a20c77 (diff)
parentfbdb713ed3f321e7a983eb4c50a8b26a37f3c193 (diff)
Merged changes from constify-ST branch
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/trunk@640 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 0968f17b9a51c24d350367b94b1c36edcc7c69a4
-rw-r--r--src/Persistent_cohomology/include/gudhi/Persistent_cohomology/Field_Zp.h2
-rw-r--r--src/Simplex_tree/include/gudhi/Simplex_tree.h32
2 files changed, 17 insertions, 17 deletions
diff --git a/src/Persistent_cohomology/include/gudhi/Persistent_cohomology/Field_Zp.h b/src/Persistent_cohomology/include/gudhi/Persistent_cohomology/Field_Zp.h
index 2349cdac..2a4c8692 100644
--- a/src/Persistent_cohomology/include/gudhi/Persistent_cohomology/Field_Zp.h
+++ b/src/Persistent_cohomology/include/gudhi/Persistent_cohomology/Field_Zp.h
@@ -85,7 +85,7 @@ class Field_Zp {
return add_id_all;
}
/** \brief Returns the multiplicative identity \f$1_{\Bbbk}\f$ of the field.*/
- const Element& multiplicative_identity(Element P = 0) const {
+ const Element& multiplicative_identity(Element = 0) const {
return mult_id_all;
}
/** Returns the inverse in the field. Modifies P.*/
diff --git a/src/Simplex_tree/include/gudhi/Simplex_tree.h b/src/Simplex_tree/include/gudhi/Simplex_tree.h
index b79e3c8f..9d0cf755 100644
--- a/src/Simplex_tree/include/gudhi/Simplex_tree.h
+++ b/src/Simplex_tree/include/gudhi/Simplex_tree.h
@@ -325,7 +325,7 @@ class Simplex_tree {
/** \brief Returns the filtration value of a simplex.
*
* Called on the null_simplex, returns INFINITY. */
- Filtration_value filtration(Simplex_handle sh) {
+ Filtration_value filtration(Simplex_handle sh) const {
if (sh != null_simplex()) {
return sh->second.filtration();
} else {
@@ -333,34 +333,34 @@ class Simplex_tree {
} // filtration(); }
}
/** \brief Returns an upper bound of the filtration values of the simplices. */
- Filtration_value filtration() {
+ Filtration_value filtration() const {
return threshold_;
}
/** \brief Returns a Simplex_handle different from all Simplex_handles
* associated to the simplices in the simplicial complex.
*
* One can call filtration(null_simplex()). */
- Simplex_handle null_simplex() {
+ Simplex_handle null_simplex() const {
return Dictionary_it(NULL);
}
/** \brief Returns a key different for all keys associated to the
* simplices of the simplicial complex. */
- Simplex_key null_key() {
+ Simplex_key null_key() const {
return -1;
}
/** \brief Returns a Vertex_handle different from all Vertex_handles associated
* to the vertices of the simplicial complex. */
- Vertex_handle null_vertex() {
+ Vertex_handle null_vertex() const {
return null_vertex_;
}
/** \brief Returns the number of vertices in the complex. */
- size_t num_vertices() {
+ size_t num_vertices() const {
return root_.members_.size();
}
/** \brief Returns the number of simplices in the complex.
*
* Does not count the empty simplex. */
- const unsigned int& num_simplices() const {
+ unsigned int num_simplices() const {
return num_simplices_;
}
@@ -377,13 +377,13 @@ class Simplex_tree {
return dim - 1;
}
/** \brief Returns an upper bound on the dimension of the simplicial complex. */
- int dimension() {
+ int dimension() const {
return dimension_;
}
/** \brief Returns true iff the node in the simplex tree pointed by
* sh has children.*/
- bool has_children(Simplex_handle sh) {
+ bool has_children(Simplex_handle sh) const {
return (sh->second.children()->parent() == sh->first);
}
@@ -563,7 +563,7 @@ class Simplex_tree {
threshold_ = fil;
}
/** Set a number of simplices for the simplicial complex. */
- void set_num_simplices(const unsigned int& num_simplices) {
+ void set_num_simplices(unsigned int num_simplices) {
num_simplices_ = num_simplices;
}
/** Set a dimension for the simplicial complex. */
@@ -771,10 +771,10 @@ class Simplex_tree {
}
/** \brief Intersects Dictionary 1 [begin1;end1) with Dictionary 2 [begin2,end2)
* and assigns the maximal possible Filtration_value to the Nodes. */
- void intersection(std::vector<std::pair<Vertex_handle, Node> >& intersection,
- Dictionary_it begin1, Dictionary_it end1,
- Dictionary_it begin2, Dictionary_it end2,
- Filtration_value filtration) {
+ static void intersection(std::vector<std::pair<Vertex_handle, Node> >& intersection,
+ Dictionary_it begin1, Dictionary_it end1,
+ Dictionary_it begin2, Dictionary_it end2,
+ Filtration_value filtration) {
if (begin1 == end1 || begin2 == end2)
return; // ----->>
while (true) {
@@ -801,8 +801,8 @@ class Simplex_tree {
}
}
/** Maximum over 3 values.*/
- Filtration_value maximum(Filtration_value a, Filtration_value b,
- Filtration_value c) {
+ static Filtration_value maximum(Filtration_value a, Filtration_value b,
+ Filtration_value c) {
Filtration_value max = (a < b) ? b : a;
return ((max < c) ? c : max);
}