diff options
author | mcarrier <mcarrier@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2018-08-13 23:17:08 +0000 |
---|---|---|
committer | mcarrier <mcarrier@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2018-08-13 23:17:08 +0000 |
commit | 5f5a7a21e9db73eaf9dc2604cb0de3066f7a4fb6 (patch) | |
tree | 0e68f4ae883d8e2e7e57b01bce1413173ba3124e /src/Persistence_representations/include/gudhi/common_persistence_representations.h | |
parent | 4560e97df7abb106c420c7f05747d26f2972b5aa (diff) | |
parent | 0784baddd1392727289a972b8374b3c2dca940a9 (diff) |
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/kernels@3778 636b058d-ea47-450e-bf9e-a15bfbe3eedb
Former-commit-id: 189ac5572f69842e1d8d1cec68ca6a4f62e39bd4
Diffstat (limited to 'src/Persistence_representations/include/gudhi/common_persistence_representations.h')
-rw-r--r-- | src/Persistence_representations/include/gudhi/common_persistence_representations.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/Persistence_representations/include/gudhi/common_persistence_representations.h b/src/Persistence_representations/include/gudhi/common_persistence_representations.h index 66ed3bf8..f0cd8146 100644 --- a/src/Persistence_representations/include/gudhi/common_persistence_representations.h +++ b/src/Persistence_representations/include/gudhi/common_persistence_representations.h @@ -43,16 +43,15 @@ static constexpr double pi = boost::math::constants::pi<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. + * In this module, we use the name Kernel for the representation of a function taking a pair of two points in the plane and returning a double. */ -using Weight = std::function<double (std::pair<double, double>) >; -using Kernel = std::function<double (std::pair<double, double>, std::pair<double, double> )>; +using Kernel2D = std::function<double (std::pair<double, double>, std::pair<double, double> )>; -Kernel Gaussian_kernel(double sigma){ +inline Kernel2D Gaussian_kernel(double sigma){ return [=](std::pair<double, double> p, std::pair<double, double> q){return (1.0 / (std::sqrt(2*pi)*sigma)) * std::exp( -((p.first-q.first)*(p.first-q.first) + (p.second-q.second)*(p.second-q.second)) / (2*sigma*sigma) );}; } -Kernel polynomial_kernel(double c, double d){ +inline Kernel2D 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);}; } |