diff options
Diffstat (limited to 'src/Witness_complex/test/witness_complex_points.cpp')
-rw-r--r-- | src/Witness_complex/test/witness_complex_points.cpp | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/src/Witness_complex/test/witness_complex_points.cpp b/src/Witness_complex/test/witness_complex_points.cpp index 3850bd82..78f01e08 100644 --- a/src/Witness_complex/test/witness_complex_points.cpp +++ b/src/Witness_complex/test/witness_complex_points.cpp @@ -20,36 +20,38 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#include <iostream> -#include <ctime> +#define BOOST_TEST_DYN_LINK +#define BOOST_TEST_MODULE "witness_complex_points" +#include <boost/test/unit_test.hpp> +#include <boost/mpl/list.hpp> + #include <gudhi/Simplex_tree.h> #include <gudhi/Witness_complex.h> #include <gudhi/Landmark_choice_by_random_point.h> #include <gudhi/Landmark_choice_by_furthest_point.h> +#include <iostream> +#include <vector> -using namespace Gudhi; -using namespace Gudhi::witness_complex; - -typedef std::vector< Vertex_handle > typeVectorVertex; -typedef Witness_complex<Simplex_tree<>> WitnessComplex; typedef std::vector<double> Point; -//typedef std::pair<typeVectorVertex, Filtration_value> typeSimplex; -//typedef std::pair< Simplex_tree<>::Simplex_handle, bool > typePairSimplexBool; +typedef std::vector< Vertex_handle > typeVectorVertex; +typedef Gudhi::Simplex_tree<> Simplex_tree; +typedef Gudhi::witness_complex::Witness_complex<Simplex_tree> WitnessComplex; +typedef Gudhi::witness_complex::Landmark_choice_by_random_point Landmark_choice_by_random_point; +typedef Gudhi::witness_complex::Landmark_choice_by_furthest_point Landmark_choice_by_furthest_point; -int main (int argc, char * const argv[]) -{ +BOOST_AUTO_TEST_CASE(witness_complex_points) { std::vector< typeVectorVertex > knn; std::vector< Point > points; // Add grid points as witnesses for (double i = 0; i < 10; i += 1.0) for (double j = 0; j < 10; j += 1.0) for (double k = 0; k < 10; k += 1.0) - points.push_back(Point({i,j,k})); + points.push_back(Point({i, j, k})); bool b_print_output = false; // First test: random choice - Simplex_tree<> complex1; + Simplex_tree complex1; Landmark_choice_by_random_point lcrp(points, 100, knn); assert(!knn.empty()); WitnessComplex witnessComplex1(knn, complex1, 100, 3); @@ -57,7 +59,7 @@ int main (int argc, char * const argv[]) // Second test: furthest choice knn.clear(); - Simplex_tree<> complex2; + Simplex_tree complex2; Landmark_choice_by_furthest_point lcfp(points, 100, knn); WitnessComplex witnessComplex2(knn, complex2, 100, 3); assert(witnessComplex2.is_witness_complex(knn, b_print_output)); |