summaryrefslogtreecommitdiff
path: root/src/Persistence_representations/example/persistence_heat_maps.cpp
diff options
context:
space:
mode:
authorvrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2017-06-02 14:00:20 +0000
committervrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2017-06-02 14:00:20 +0000
commit4ba017094d3246cd8fe917a6c45443ba25d74b1d (patch)
tree92de401a87ee26f96c211543340b08331d58df7f /src/Persistence_representations/example/persistence_heat_maps.cpp
parent3736caa9ed742f985d743b9c959442d331110050 (diff)
Fix some cpplint
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/persistence_representation_integration@2502 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 0a6422b0fa27105b9aaba743371da3328d9039be
Diffstat (limited to 'src/Persistence_representations/example/persistence_heat_maps.cpp')
-rw-r--r--src/Persistence_representations/example/persistence_heat_maps.cpp23
1 files changed, 10 insertions, 13 deletions
diff --git a/src/Persistence_representations/example/persistence_heat_maps.cpp b/src/Persistence_representations/example/persistence_heat_maps.cpp
index a9ac5df5..2a472ac6 100644
--- a/src/Persistence_representations/example/persistence_heat_maps.cpp
+++ b/src/Persistence_representations/example/persistence_heat_maps.cpp
@@ -20,17 +20,14 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <gudhi/reader_utils.h>
#include <gudhi/Persistence_heat_maps.h>
#include <iostream>
#include <vector>
#include <utility>
-using namespace Gudhi;
-using namespace Gudhi::Persistence_representations;
-
-double epsilon = 0.0000005;
+using constant_scaling_function = Gudhi::Persistence_representations::constant_scaling_function;
+using Persistence_heat_maps = Gudhi::Persistence_representations::Persistence_heat_maps<constant_scaling_function>;
int main(int argc, char** argv) {
// create two simple vectors with birth--death pairs:
@@ -50,30 +47,30 @@ int main(int argc, char** argv) {
// over here we define a function we sill put on a top on every birth--death pair in the persistence interval. It can
// be anything. Over here we will use standard Gaussian
- std::vector<std::vector<double> > filter = create_Gaussian_filter(5, 1);
+ std::vector<std::vector<double> > filter = Gudhi::Persistence_representations::create_Gaussian_filter(5, 1);
// creating two heat maps.
- Persistence_heat_maps<constant_scaling_function> hm1(persistence1, filter, false, 20, 0, 11);
- Persistence_heat_maps<constant_scaling_function> hm2(persistence2, filter, false, 20, 0, 11);
+ Persistence_heat_maps hm1(persistence1, filter, false, 20, 0, 11);
+ Persistence_heat_maps hm2(persistence2, filter, false, 20, 0, 11);
- std::vector<Persistence_heat_maps<constant_scaling_function>*> vector_of_maps;
+ std::vector<Persistence_heat_maps*> vector_of_maps;
vector_of_maps.push_back(&hm1);
vector_of_maps.push_back(&hm2);
// compute median/mean of a vector of heat maps:
- Persistence_heat_maps<constant_scaling_function> mean;
+ Persistence_heat_maps mean;
mean.compute_mean(vector_of_maps);
- Persistence_heat_maps<constant_scaling_function> median;
+ Persistence_heat_maps median;
median.compute_median(vector_of_maps);
// to compute L^1 distance between hm1 and hm2:
std::cout << "The L^1 distance is : " << hm1.distance(hm2, 1) << std::endl;
// to average of hm1 and hm2:
- std::vector<Persistence_heat_maps<constant_scaling_function>*> to_average;
+ std::vector<Persistence_heat_maps*> to_average;
to_average.push_back(&hm1);
to_average.push_back(&hm2);
- Persistence_heat_maps<constant_scaling_function> av;
+ Persistence_heat_maps av;
av.compute_average(to_average);
// to compute scalar product of hm1 and hm2: