GUDHI / gudhi-devel

The GUDHI library is a generic open source C++ library, with a Python interface, for Topological Data Analysis (TDA) and Higher Dimensional Geometry Understanding.
https://gudhi.inria.fr/
MIT License
245 stars 65 forks source link

[Persistence_matrix] move bar type outside #1083

Open hschreiber opened 1 week ago

hschreiber commented 1 week ago

To be able to use it also for Zigzag persistence (PR #917) more easily.

I also added the possibility to use std::get and std::tuple_size for the bars for the compatibility with other modules. std::tuple_size just doesn't work for structure inheriting from a Persistence_interval.

hschreiber commented 1 week ago

I guess we have different stylistic tastes. I tend to favor short:

* `Persistence_interval(dimension_type dim, event_value_type birth, event_value_type death)` doesn't need any description (it should still appear in the doc), the declaration is self-documenting.

* A comment at the beginning that Persistence_interval is usable like a tuple that stores birth, death and dim in this order with std::tuple_element, std::tuple_size, std::get and structured binding, may be clearer than explicitly and redundantly documenting each specialization and overload.

But we don't have to follow my tastes 😉

By experience I realized that the more redundant the documentation is, the better the people are understanding it... Even though I personally also find it often too much. So, I will try to make a mix of the two approaches by adding what you mentioned in the main description.