From 558d908404cdc2e1f5111fd9ee236cd55ab7790a Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Mon, 14 Mar 2016 11:00:11 +0000 Subject: 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 --- src/Simplex_tree/include/gudhi/Simplex_tree.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/Simplex_tree/include') 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. */ -- cgit v1.2.3