summaryrefslogtreecommitdiff
path: root/src/Simplex_tree
diff options
context:
space:
mode:
authorvrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-03-14 11:00:11 +0000
committervrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-03-14 11:00:11 +0000
commit558d908404cdc2e1f5111fd9ee236cd55ab7790a (patch)
tree018eec9cb083d41801ac43ede1fe569d5c9e207e /src/Simplex_tree
parentdf8cf1a75bceb3411e98281585045fb0f5609939 (diff)
Use GUDHI_CHECK on null_simplex instead of "if"
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/alphashapes@1041 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 783218b56e34ef53fbca5bb52e8a467504c0eddc
Diffstat (limited to 'src/Simplex_tree')
-rw-r--r--src/Simplex_tree/include/gudhi/Simplex_tree.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Simplex_tree/include/gudhi/Simplex_tree.h b/src/Simplex_tree/include/gudhi/Simplex_tree.h
index 1c4587c0..813e7924 100644
--- a/src/Simplex_tree/include/gudhi/Simplex_tree.h
+++ b/src/Simplex_tree/include/gudhi/Simplex_tree.h
@@ -451,12 +451,12 @@ class Simplex_tree {
}
/** \brief Sets the filtration value of a simplex.
- *
- * No action if called on the null_simplex*/
+ * \warning In debug mode, the exception std::invalid_argument is thrown if sh is a null_simplex.
+ */
void assign_filtration(Simplex_handle sh, Filtration_value fv) {
- if (sh != null_simplex()) {
- sh->second.assign_filtration(fv);
- }
+ GUDHI_CHECK(sh == null_simplex(),
+ std::invalid_argument ("Simplex_tree::assign_filtration - cannot assign filtration on null_simplex"));
+ sh->second.assign_filtration(fv);
}
/** \brief Returns an upper bound of the filtration values of the simplices. */