summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/doc/file_formats.h57
-rw-r--r--src/common/doc/main_page.h35
-rw-r--r--src/common/include/gudhi/distance_functions.h5
3 files changed, 86 insertions, 11 deletions
diff --git a/src/common/doc/file_formats.h b/src/common/doc/file_formats.h
index 3b3d9248..c60ed15a 100644
--- a/src/common/doc/file_formats.h
+++ b/src/common/doc/file_formats.h
@@ -57,10 +57,10 @@ namespace Gudhi {
\section FileFormatsIsoCuboid Iso-cuboid
- Such a file describes an iso-oriented cuboid with diagonal opposite vertices (min_hx, min_hy, min_hz,...) and (max_hx, max_hy, max_hz, ...). The format is:<br>
+ Such a file describes an iso-oriented cuboid with diagonal opposite vertices (min_x, min_y, min_z,...) and (max_x, max_y, max_z, ...). The format is:<br>
\verbatim
- min_hx min_hy [min_hz ...]
- max_hx max_hy [max_hz ...]
+ min_x min_y [min_z ...]
+ max_x max_y [max_z ...]
\endverbatim
Here is a simple sample file in the 3D case:
@@ -68,6 +68,57 @@ namespace Gudhi {
-1. -1. -1.
1. 1. 1.
\endverbatim
+
+
+ \section FileFormatsPerseus Perseus
+
+ This file format is the format used by the Perseus software
+ (http://www.sas.upenn.edu/~vnanda/perseus/) by Vidit Nanda.
+ The first line contains a number d begin the dimension of the
+ bitmap (2 in the example below). Next d lines are the numbers of top dimensional cubes in each dimensions (3 and 3
+ in the example below). Next, in lexicographical order, the filtration of top dimensional cubes is given (1 4 6 8
+ 20 4 7 6 5 in the example below).
+
+ \image html "exampleBitmap.png" "Example of a input data."
+
+ The input file for the following complex is:
+ \verbatim
+ 2
+ 3
+ 3
+ 1
+ 4
+ 6
+ 8
+ 20
+ 4
+ 7
+ 6
+ 5
+ \endverbatim
+
+ To indicate periodic boundary conditions in a
+ given direction, then number of top dimensional cells in this direction have to be multiplied by -1. For instance:
+
+ \verbatim
+ 2
+ -3
+ 3
+ 1
+ 4
+ 6
+ 8
+ 20
+ 4
+ 7
+ 6
+ 5
+ \endverbatim
+
+ Indicate that we have imposed periodic boundary conditions in the direction x, but not in the direction y.
+
+ Other sample files can be found in the `data/bitmap` folder.
+
*/
} // namespace Gudhi
diff --git a/src/common/doc/main_page.h b/src/common/doc/main_page.h
index 34d3893d..148ee670 100644
--- a/src/common/doc/main_page.h
+++ b/src/common/doc/main_page.h
@@ -99,7 +99,7 @@
<tr>
<td width="25%">
<b>Author:</b> Mathieu Carri&egrave;re<br>
- <b>Introduced in:</b> GUDHI 2.0.1<br>
+ <b>Introduced in:</b> GUDHI 2.1.0<br>
<b>Copyright:</b> GPL v3<br>
</td>
<td width="75%">
@@ -170,6 +170,7 @@
</table>
\section Toolbox Toolbox
+
\subsection BottleneckDistanceToolbox Bottleneck distance
\image html "perturb_pd.png" "Bottleneck distance is the length of the longest edge"
<table border="0">
@@ -229,7 +230,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
@@ -328,7 +347,7 @@ make doxygen
* \li <a href="_bottleneck_distance_2bottleneck_basic_example_8cpp-example.html">
* Bottleneck_distance/bottleneck_basic_example.cpp</a>
* \li <a href="_bottleneck_distance_2bottleneck_read_file_8cpp-example.html">
- * Bottleneck_distance/bottleneck_read_file.cpp</a>
+ * Bottleneck_distance/bottleneck_distance.cpp</a>
* \li <a href="_spatial_searching_2example_spatial_searching_8cpp-example.html">
* Spatial_searching/example_spatial_searching.cpp</a>
* \li <a href="_subsampling_2example_choose_n_farthest_points_8cpp-example.html">
@@ -411,9 +430,9 @@ make doxygen
* \li <a href="_alpha_complex_2weighted_alpha_complex_3d_persistence_8cpp-example.html">
* Alpha_complex/weighted_alpha_complex_3d_persistence.cpp</a>
* \li <a href="_bitmap_cubical_complex_2_bitmap_cubical_complex_8cpp-example.html">
- * Bitmap_cubical_complex/Bitmap_cubical_complex.cpp</a>
+ * Bitmap_cubical_complex/cubical_complex_persistence.cpp</a>
* \li <a href="_bitmap_cubical_complex_2_bitmap_cubical_complex_periodic_boundary_conditions_8cpp-example.html">
- * Bitmap_cubical_complex/Bitmap_cubical_complex_periodic_boundary_conditions.cpp</a>
+ * Bitmap_cubical_complex/periodic_cubical_complex_persistence.cpp</a>
* \li <a href="_bitmap_cubical_complex_2_random_bitmap_cubical_complex_8cpp-example.html">
* Bitmap_cubical_complex/Random_bitmap_cubical_complex.cpp</a>
* \li <a href="_simplex_tree_2simple_simplex_tree_8cpp-example.html">
@@ -491,9 +510,9 @@ make doxygen
* @example Alpha_complex/weighted_alpha_complex_3d_persistence.cpp
* @example Bottleneck_distance/alpha_rips_persistence_bottleneck_distance.cpp
* @example Bottleneck_distance/bottleneck_basic_example.cpp
- * @example Bottleneck_distance/bottleneck_read_file.cpp
- * @example Bitmap_cubical_complex/Bitmap_cubical_complex.cpp
- * @example Bitmap_cubical_complex/Bitmap_cubical_complex_periodic_boundary_conditions.cpp
+ * @example Bottleneck_distance/bottleneck_distance.cpp
+ * @example Bitmap_cubical_complex/cubical_complex_persistence.cpp
+ * @example Bitmap_cubical_complex/periodic_cubical_complex_persistence.cpp
* @example Bitmap_cubical_complex/Random_bitmap_cubical_complex.cpp
* @example common/example_CGAL_3D_points_off_reader.cpp
* @example common/example_CGAL_points_off_reader.cpp
@@ -532,4 +551,4 @@ make doxygen
* @example Witness_complex/weak_witness_persistence.cpp
* @example Witness_complex/strong_witness_persistence.cpp
*/
-
+
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