diff options
author | pdlotko <pdlotko@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2017-08-14 19:43:45 +0000 |
---|---|---|
committer | pdlotko <pdlotko@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2017-08-14 19:43:45 +0000 |
commit | e2c0166fcbf17e91cf5ed7b6159f80d64b49cc0b (patch) | |
tree | 8b406841de67ed77647a9c4153bbb88dee90a60a /src/Persistence_representations/test/persistence_lanscapes_test.cpp | |
parent | 871bf8d781f88536942a92f9003509eaaa4e2e12 (diff) |
Adding a code that use Clement's procedure to read files. Correcting some samll errors. Now the code is ready.
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/persistence_representation_integration@2610 636b058d-ea47-450e-bf9e-a15bfbe3eedb
Former-commit-id: b2947d1c484d661eca6c32fe5386461e741b76f9
Diffstat (limited to 'src/Persistence_representations/test/persistence_lanscapes_test.cpp')
-rw-r--r-- | src/Persistence_representations/test/persistence_lanscapes_test.cpp | 40 |
1 files changed, 32 insertions, 8 deletions
diff --git a/src/Persistence_representations/test/persistence_lanscapes_test.cpp b/src/Persistence_representations/test/persistence_lanscapes_test.cpp index 22686560..206035c7 100644 --- a/src/Persistence_representations/test/persistence_lanscapes_test.cpp +++ b/src/Persistence_representations/test/persistence_lanscapes_test.cpp @@ -34,12 +34,12 @@ using namespace Gudhi::Persistence_representations; double epsilon = 0.0000005; -BOOST_AUTO_TEST_CASE(check_construction_of_landscape) { +BOOST_AUTO_TEST_CASE(check_construction_of_landscape) { std::vector<std::pair<double, double> > diag = - read_persistence_intervals_in_one_dimension_from_file("data/file_with_diagram"); + read_persistence_intervals_in_one_dimension_from_file("data/file_with_diagram"); Persistence_landscape p(diag); - Persistence_landscape q; - q.load_landscape_from_file("data/file_with_landscape_from_file_with_diagram"); + Persistence_landscape q; + q.load_landscape_from_file("data/file_with_landscape_from_file_with_diagram"); BOOST_CHECK(p == q); } @@ -47,10 +47,12 @@ BOOST_AUTO_TEST_CASE(check_construction_of_landscape_form_gudhi_style_file) { Persistence_landscape p("data/persistence_file_with_four_entries_per_line", 1); // p.print_to_file("persistence_file_with_four_entries_per_line_landscape"); Persistence_landscape q; - q.load_landscape_from_file("data/persistence_file_with_four_entries_per_line_landscape"); + q.load_landscape_from_file("data/persistence_file_with_four_entries_per_line_landscape"); BOOST_CHECK(p == q); } + + BOOST_AUTO_TEST_CASE(check_computations_of_integrals) { std::vector<std::pair<double, double> > diag = read_persistence_intervals_in_one_dimension_from_file("data/file_with_diagram"); @@ -217,9 +219,7 @@ BOOST_AUTO_TEST_CASE(check_computations_of_distances) { Persistence_landscape q(diag2); BOOST_CHECK(fabs(p.distance(q) - 25.5824) <= 0.00005); BOOST_CHECK(fabs(p.distance(q, 2) - 2.12636) <= 0.00001); - BOOST_CHECK(fabs(p.distance(q, std::numeric_limits<double>::max()) - 0.359068) <= 0.00001); - std::cerr << "p.distance( q , std::numeric_limits<double>::max() ) : " - << p.distance(q, std::numeric_limits<double>::max()) << std::endl; + BOOST_CHECK(fabs(p.distance(q, std::numeric_limits<double>::max()) - 0.359068) <= 0.00001); } BOOST_AUTO_TEST_CASE(check_computations_of_scalar_product) { @@ -232,6 +232,30 @@ BOOST_AUTO_TEST_CASE(check_computations_of_scalar_product) { BOOST_CHECK(fabs(p.compute_scalar_product(q) - 0.754498) <= 0.00001); } + + + + + + + + + + + + + + + + + + + + + + + + // Below I am storing the code used to generate tests for that functionality. /* if ( argc != 2 ) |