diff options
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/doc/main_page.h | 18 | ||||
-rw-r--r-- | src/common/include/gudhi/distance_functions.h | 5 |
2 files changed, 23 insertions, 0 deletions
diff --git a/src/common/doc/main_page.h b/src/common/doc/main_page.h index bd4615f5..ec968558 100644 --- a/src/common/doc/main_page.h +++ b/src/common/doc/main_page.h @@ -211,7 +211,25 @@ <b>User manual:</b> \ref persistent_cohomology - <b>Reference manual:</b> Gudhi::persistent_cohomology::Persistent_cohomology </td> </tr> +</table> + \subsection PersistenceRepresentationsToolbox Persistence representations + \image html "average_landscape.png" "Persistence representations" +<table border="0"> + <tr> + <td width="25%"> + <b>Author:</b> Pawel Dlotko<br> + <b>Introduced in:</b> GUDHI 2.1.0<br> + <b>Copyright:</b> GPL v3<br> + </td> + <td width="75%"> + It contains implementation of various representations of persistence diagrams; diagrams themselves, persistence + landscapes (rigorous and grid version), persistence heath maps, vectors and others. It implements basic + functionalities which are neccessary to use persistence in statistics and machine learning.<br> + <b>User manual:</b> \ref Persistence_representations + </td> + </tr> </table> + */ /*! \page installation GUDHI installation diff --git a/src/common/include/gudhi/distance_functions.h b/src/common/include/gudhi/distance_functions.h index f6e2ab5a..c556155e 100644 --- a/src/common/include/gudhi/distance_functions.h +++ b/src/common/include/gudhi/distance_functions.h @@ -26,6 +26,7 @@ #include <cmath> // for std::sqrt #include <type_traits> // for std::decay #include <iterator> // for std::begin, std::end +#include <utility> namespace Gudhi { @@ -48,6 +49,10 @@ class Euclidean_distance { } return std::sqrt(dist); } + template< typename T > + T operator() (const std::pair< T, T >& f, const std::pair< T, T >& s) { + return sqrt((f.first-s.first)*(f.first-s.first) + (f.second-s.second)*(f.second-s.second)); + } }; } // namespace Gudhi |