summaryrefslogtreecommitdiff
path: root/src/Persistence_representations/example/persistence_heat_maps.cpp
diff options
context:
space:
mode:
authormcarrier <mcarrier@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2018-09-18 20:48:24 +0000
committermcarrier <mcarrier@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2018-09-18 20:48:24 +0000
commit8f9e4f64a2df82205a3a4551e0443b9e2a45edae (patch)
treebb6d3f365a496bac16a504316356e814642054cb /src/Persistence_representations/example/persistence_heat_maps.cpp
parentce07cbf7aef1e94694f3677ae356c9c548466b5a (diff)
templated Kernel parameter in Persistence heat maps
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/kernels@3896 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: b496194cbe5447fe040140e9fbef3beb39fd9fbc
Diffstat (limited to 'src/Persistence_representations/example/persistence_heat_maps.cpp')
-rw-r--r--src/Persistence_representations/example/persistence_heat_maps.cpp21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/Persistence_representations/example/persistence_heat_maps.cpp b/src/Persistence_representations/example/persistence_heat_maps.cpp
index 5874336e..c177c009 100644
--- a/src/Persistence_representations/example/persistence_heat_maps.cpp
+++ b/src/Persistence_representations/example/persistence_heat_maps.cpp
@@ -27,8 +27,9 @@
#include <vector>
#include <utility>
+using Gaussian_kernel = Gudhi::Persistence_representations::Gaussian_kernel_2D;
using constant_scaling_function = Gudhi::Persistence_representations::constant_scaling_function;
-using Persistence_heat_maps = Gudhi::Persistence_representations::Persistence_heat_maps<constant_scaling_function>;
+using Persistence_heat_maps = Gudhi::Persistence_representations::Persistence_heat_maps<constant_scaling_function, Gaussian_kernel>;
int main(int argc, char** argv) {
// create two simple vectors with birth--death pairs:
@@ -77,16 +78,14 @@ int main(int argc, char** argv) {
// to compute scalar product of hm1 and hm2:
std::cout << "Scalar product is : " << hm1.compute_scalar_product(hm2) << std::endl;
- Gudhi::Persistence_representations::Kernel2D k = Gudhi::Persistence_representations::Gaussian_kernel(1.0);
-
- Persistence_heat_maps hm1k(persistence1, k);
- Persistence_heat_maps hm2k(persistence2, k);
-
- Persistence_heat_maps hm1i(persistence1, 20, 20, 0, 11, 0, 11, k);
- Persistence_heat_maps hm2i(persistence2, 20, 20, 0, 11, 0, 11, k);
-
- std::cout << "Scalar product computed with exact kernel is : " << hm1i.compute_scalar_product(hm2i) << std::endl;
- std::cout << "Kernel value between PDs seen as functions is : " << hm1k.compute_scalar_product(hm2k) << std::endl;
+ // Mathieu's code ************************************************************************************************************
+ Persistence_heat_maps hm1k(persistence1);
+ Persistence_heat_maps hm2k(persistence2);
+ Persistence_heat_maps hm1i(persistence1, 20, 20, 0, 11, 0, 11);
+ Persistence_heat_maps hm2i(persistence2, 20, 20, 0, 11, 0, 11);
+ std::cout << "Scalar product computed with exact 2D kernel on grid is : " << hm1i.compute_scalar_product(hm2i) << std::endl;
+ std::cout << "Scalar product computed with exact 2D kernel is : " << hm1k.compute_scalar_product(hm2k) << std::endl;
+ // ***************************************************************************************************************************
return 0;
}