#include <gudhi/Persistence_heat_maps.h>
#include <gudhi/common_persistence_representations.h>
#include <iostream>
#include <vector>
#include <utility>
#include <functional>
#include <cmath>
std::function<double(std::pair<double, double>, std::pair<double, double>)> Gaussian_function(double sigma) {
return [=](std::pair<double, double> p, std::pair<double, double> q) {
return std::exp(-((p.first - q.first) * (p.first - q.first) + (p.second - q.second) * (p.second - q.second)) /
(sigma));
};
}
int main(int argc, char** argv) {
std::vector<std::pair<double, double> > persistence1;
std::vector<std::pair<double, double> > persistence2;
persistence1.push_back(std::make_pair(1, 2));
persistence1.push_back(std::make_pair(6, 8));
persistence1.push_back(std::make_pair(0, 4));
persistence1.push_back(std::make_pair(3, 8));
persistence2.push_back(std::make_pair(2, 9));
persistence2.push_back(std::make_pair(1, 6));
persistence2.push_back(std::make_pair(3, 5));
persistence2.push_back(std::make_pair(6, 10));
std::vector<std::vector<double> > filter = Gudhi::Persistence_representations::create_Gaussian_filter(5, 1);
std::vector<Persistence_heat_maps*> vector_of_maps;
vector_of_maps.push_back(&hm1);
vector_of_maps.push_back(&hm2);
std::clog <<
"The L^1 distance is : " << hm1.
distance(hm2, 1) << std::endl;
std::vector<Persistence_heat_maps*> to_average;
to_average.push_back(&hm1);
to_average.push_back(&hm2);
std::clog <<
"Scalar product computed with exact 2D kernel on grid is : " << hm1i.
compute_scalar_product(hm2i)
<< std::endl;
std::clog <<
"Scalar product computed with exact 2D kernel is : " << hm1k.
compute_scalar_product(hm2k) << std::endl;
return 0;
}