Add simplicial_complex::clear()
authorStefan Huber <shuber@sthu.org>
Sun, 24 Nov 2013 14:07:43 +0000 (15:07 +0100)
committerStefan Huber <shuber@sthu.org>
Tue, 14 Jan 2014 15:19:07 +0000 (16:19 +0100)
include/libstick-0.1/simplicialcomplex.h

index 4dddc791b619fe3faab6fdbeebce239012672ad8..482e12d3edbcd13b46fe3f0f9eb2feee48562273 100644 (file)
@@ -198,6 +198,11 @@ class simplicial_complex {
             add_simplex(simplex::create_minusonedim_simplex());
         }
 
+        /** Remove all simplices except the dummy simplex */
+        void clear() {
+            simplices.resize(1);
+        }
+
         /** Return number of simplices. */
         size_t size() const {
             return simplices.size();