diff options
author | mcarrier <mcarrier@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2018-06-23 04:59:39 +0000 |
---|---|---|
committer | mcarrier <mcarrier@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2018-06-23 04:59:39 +0000 |
commit | 0741c3eabbfece1c73ac76aa44adbe2904b6124d (patch) | |
tree | 83fc9edee2be2c5b1fc73d9d3cc1ddc4a66c828b /src/Persistence_representations/include/gudhi/common_persistence_representations.h | |
parent | 10c6f6be72a2631cd1a1d28ed61343d55bd2b759 (diff) |
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/kernels@3628 636b058d-ea47-450e-bf9e-a15bfbe3eedb
Former-commit-id: 12f32a1c8ca31e7e0a40e1c3502e2a3d810d5bc5
Diffstat (limited to 'src/Persistence_representations/include/gudhi/common_persistence_representations.h')
-rw-r--r-- | src/Persistence_representations/include/gudhi/common_persistence_representations.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/Persistence_representations/include/gudhi/common_persistence_representations.h b/src/Persistence_representations/include/gudhi/common_persistence_representations.h index 539eee60..024c99ec 100644 --- a/src/Persistence_representations/include/gudhi/common_persistence_representations.h +++ b/src/Persistence_representations/include/gudhi/common_persistence_representations.h @@ -40,12 +40,23 @@ static constexpr double pi = boost::math::constants::pi<double>(); /** * In this module, we use the name Persistence_diagram for the representation of a diagram in a vector of pairs of two double. */ -using Persistence_diagram = std::vector<std::pair<double,double> >; +using Persistence_diagram = std::vector<std::pair<double, double> >; /** * In this module, we use the name Weight for the representation of a function taking a pair of two double and returning a double. */ -using Weight = std::function<double (std::pair<double,double>) >; +using Weight = std::function<double (std::pair<double, double>) >; +using Kernel = std::function<double (std::pair<double, double>, std::pair<double, double> )>; + +Kernel Gaussian_kernel(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*sigma) );}; +} + +Kernel polynomial_kernel(double c, double d){ + return [=](std::pair<double, double> p, std::pair<double, double> q){return std::pow( p.first*q.first + p.second*q.second + c, d);}; +} + + // double epsi = std::numeric_limits<double>::epsilon(); double epsi = 0.000005; |