summaryrefslogtreecommitdiff
path: root/src/Witness_complex/example/example_witness_complex_sphere.cpp
diff options
context:
space:
mode:
authorvrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2017-02-28 16:16:08 +0000
committervrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2017-02-28 16:16:08 +0000
commitf2b63bcaa647d1ec839dbe2e5edbe5c4fde1b304 (patch)
tree106ab2bbf7c34a2b0f6cd73cb4221661a05bc9c0 /src/Witness_complex/example/example_witness_complex_sphere.cpp
parentba56545de435b62e0528d01fbde342bc4653da13 (diff)
Fix cppcheck
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/relaxed-witness@2120 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 49a5c2c6e94d9fbf235eecc92fa30e62980c7c70
Diffstat (limited to 'src/Witness_complex/example/example_witness_complex_sphere.cpp')
-rw-r--r--src/Witness_complex/example/example_witness_complex_sphere.cpp33
1 files changed, 25 insertions, 8 deletions
diff --git a/src/Witness_complex/example/example_witness_complex_sphere.cpp b/src/Witness_complex/example/example_witness_complex_sphere.cpp
index 1ea9408c..06fe3889 100644
--- a/src/Witness_complex/example/example_witness_complex_sphere.cpp
+++ b/src/Witness_complex/example/example_witness_complex_sphere.cpp
@@ -1,8 +1,26 @@
-#define BOOST_PARAMETER_MAX_ARITY 12
-
+/* This file is part of the Gudhi Library. The Gudhi library
+ * (Geometric Understanding in Higher Dimensions) is a generic C++
+ * library for computational topology.
+ *
+ * Author(s): Siargey Kachanovich
+ *
+ * Copyright (C) 2016 INRIA (France)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
-#include <sys/types.h>
-#include <sys/stat.h>
+#define BOOST_PARAMETER_MAX_ARITY 12
#include <gudhi/Simplex_tree.h>
#include <gudhi/Euclidean_witness_complex.h>
@@ -32,8 +50,9 @@ void write_data(Data_range & data, std::string filename) {
}
int main(int argc, char * const argv[]) {
- typedef Gudhi::witness_complex::Euclidean_witness_complex<CGAL::Epick_d<CGAL::Dynamic_dimension_tag>> Witness_complex;
-
+ using Kernel = CGAL::Epick_d<CGAL::Dynamic_dimension_tag>;
+ using Witness_complex = Gudhi::witness_complex::Euclidean_witness_complex<Kernel>;
+
if (argc != 2) {
std::cerr << "Usage: " << argv[0]
<< " number_of_landmarks \n";
@@ -66,8 +85,6 @@ int main(int argc, char * const argv[]) {
double time = static_cast<double>(end - start) / CLOCKS_PER_SEC;
std::cout << "Witness complex for " << number_of_landmarks << " landmarks took "
<< time << " s. \n";
- //assert(1 == 0);
- //std::cout << simplex_tree << "\n";
std::cout << "Number of simplices is: " << simplex_tree.num_simplices() << "\n";
l_time.push_back(std::make_pair(nbP, time));
}