Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zigzag persistence part1 #917

Merged
merged 69 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from 67 commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
5407637
restore after merge
hschreiber Jul 17, 2023
f03a8bf
Merge remote-tracking branch 'origin/persistence_matrix' into zigzag_…
hschreiber Jul 18, 2023
3f8409f
doc and concepts
hschreiber Jul 21, 2023
2e5a20b
deleting files not wanted for the PR
hschreiber Jul 21, 2023
bfc5642
doc main page
hschreiber Jul 21, 2023
688b381
restore cmake files
hschreiber Jul 21, 2023
f7087fc
restore cmake files
hschreiber Jul 21, 2023
15fbc53
restore cmake files
hschreiber Jul 21, 2023
87ba652
Merge branch 'GUDHI:master' into zigzag_persistence
hschreiber Aug 4, 2023
d8d07c5
simplex tree options correction
hschreiber Aug 21, 2023
0644ca6
sync with upstream Gudhi-devel
hschreiber Aug 21, 2023
394e33e
doc
hschreiber Aug 21, 2023
7178d45
first update merge
hschreiber Aug 21, 2023
5c4f9d7
second update merge
hschreiber Aug 21, 2023
2c79bc2
merge error fix
hschreiber Aug 21, 2023
f85ffb9
removal of useless simplex tree options
hschreiber Aug 21, 2023
902db3b
Merge branch 'GUDHI:master' into zigzag_persistence
hschreiber Aug 22, 2023
da925a0
update from upstream master
hschreiber Apr 18, 2024
5208e5d
Merge branch 'GUDHI:master' into zigzag_persistence
hschreiber Apr 18, 2024
4436039
update persistence matrix
hschreiber Apr 19, 2024
e384378
update persistence matrix
hschreiber Apr 19, 2024
0c7d3e6
generalized to faces instead of simplices
hschreiber May 31, 2024
ece1294
updates concepts
hschreiber May 31, 2024
20ae249
updates concepts
hschreiber May 31, 2024
df39f9c
zigzag doc update
hschreiber May 31, 2024
c192cd6
merge upstream update
hschreiber May 31, 2024
cadfb5c
merge Persistence_matrix update
hschreiber May 31, 2024
03e7b7d
small fixes
hschreiber May 31, 2024
26161a7
persistence diagram: list -> vector
hschreiber May 31, 2024
9c44409
removal of useless abs
hschreiber May 31, 2024
3fb6227
merge upstream
hschreiber Jun 18, 2024
2b46f13
split of zigzag computation and filtration values management
hschreiber Jun 20, 2024
dcc8bad
Merge remote-tracking branch 'origin/persistence_matrix' into zigzag_…
hschreiber Jun 20, 2024
dfdaaac
change of default values
hschreiber Jun 21, 2024
f7a431b
Merge branch 'GUDHI:master' into zigzag_persistence
hschreiber Jun 27, 2024
8698036
Merge branch 'zigzag_persistence' of github.com:hschreiber/gudhi-deve…
hschreiber Jun 27, 2024
91dca3b
Merge remote-tracking branch 'origin/matrix_intervals' into zigzag_pe…
hschreiber Jun 28, 2024
e51a1f3
change of barcode + minor corrections
hschreiber Jun 28, 2024
585432c
update example cmake
hschreiber Jun 28, 2024
55d510a
rename files to gudhi convention
hschreiber Jul 8, 2024
0c332e3
Merge branch 'GUDHI:master' into zigzag_persistence
hschreiber Jul 8, 2024
bf19ed5
fix version problem with boost::unordered_flat_map
hschreiber Jul 9, 2024
46a7d8a
Merge remote-tracking branch 'origin/master' into zigzag_persistence
hschreiber Jul 10, 2024
c42a263
corrections from merge with upstream
hschreiber Jul 10, 2024
efa2546
remove doxygen warnings
hschreiber Jul 11, 2024
cfdc161
dox fix
hschreiber Jul 11, 2024
e025cec
doc fix
hschreiber Jul 11, 2024
99f99ae
small changes
hschreiber Jul 18, 2024
6dc4219
Update src/Zigzag_persistence/include/gudhi/zigzag_persistence.h
hschreiber Jul 18, 2024
9446bad
Update src/Zigzag_persistence/include/gudhi/zigzag_persistence.h
hschreiber Jul 18, 2024
32e3053
Merge branch 'GUDHI:master' into zigzag_persistence
hschreiber Jul 18, 2024
bbd3d90
doc
hschreiber Jul 19, 2024
c7edb91
replacing map_index_to_filtration_value->pair with get_filtration_val…
hschreiber Jul 19, 2024
3472160
doc
hschreiber Jul 19, 2024
744ac47
dim bug fix
hschreiber Jul 22, 2024
7d84dbf
doc
hschreiber Jul 22, 2024
564f751
doc
hschreiber Jul 22, 2024
bd6d9b5
doc
hschreiber Jul 23, 2024
4de6a26
Merge branch 'GUDHI:master' into zigzag_persistence
hschreiber Sep 17, 2024
4f40d8b
upstream merge
hschreiber Sep 17, 2024
6a0fad2
renaming after Gudhi convention
hschreiber Sep 17, 2024
2b2a569
doc
hschreiber Sep 17, 2024
1e31a4b
doc
hschreiber Sep 18, 2024
54c00a6
Merge branch 'GUDHI:master' into zigzag_persistence
hschreiber Oct 21, 2024
5db9b3a
name change from 'face' to 'cell'
hschreiber Oct 21, 2024
915b5ea
removal of 'erase_birth_history'
hschreiber Oct 21, 2024
b3158e3
replacing set with vector for boundary translation
hschreiber Oct 22, 2024
5213928
Update src/common/doc/main_page.md
hschreiber Oct 24, 2024
f4c5345
Update src/Zigzag_persistence/doc/COPYRIGHT
hschreiber Oct 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ add_gudhi_module(Toplex_map)
add_gudhi_module(Witness_complex)
add_gudhi_module(Nerve_GIC)
add_gudhi_module(Persistence_matrix)
add_gudhi_module(Zigzag_persistence)

# Include module CMake subdirectories
# GUDHI_SUB_DIRECTORIES is managed in CMAKE_MODULE_PATH/GUDHI_modules.cmake
Expand Down
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ add_gudhi_module(Toplex_map)
add_gudhi_module(Witness_complex)
add_gudhi_module(Nerve_GIC)
add_gudhi_module(Persistence_matrix)
add_gudhi_module(Zigzag_persistence)

set(GUDHI_BIBLIO_DIR ${CMAKE_SOURCE_DIR})
# For "make doxygen" - Requires GUDHI_USER_VERSION_DIR to be set
Expand Down
80 changes: 80 additions & 0 deletions src/Zigzag_persistence/concept/ZigzagOptions.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
* See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
* Author(s): Hannah Schreiber
*
* Copyright (C) 2024 Inria
*
* Modification(s):
* - YYYY/MM Author: Description of the modification
*/

#ifndef CONCEPT_ZZ_OPTIONS_TYPE_H_
#define CONCEPT_ZZ_OPTIONS_TYPE_H_

/** @file ZigzagOptions.h
* @brief Contains @ref Gudhi::zigzag_persistence::ZigzagOptions and
* @ref Gudhi::zigzag_persistence::FilteredZigzagOptions concept.
*/

namespace Gudhi {
namespace zigzag_persistence {

/**
* @ingroup zigzag_persistence
*
* @brief List of options used for the filtered zigzag persistence computation.
*/
struct FilteredZigzagOptions {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to derive from ZigzagOptions, as a way to say that this concept refines the other one?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but I wanted to wait to see what I do with erase_birth_history and if there will not be other not-shared options.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like no non-shared option has popped up?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. I was just suddenly not sure how clear it is to make one concept inherit the other in the documentation. It risk to be overlooked, no? But you are right. I will change that in the other branch with the oscillating rips.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can also add in the text that it refines the other concept. Yes, we'll see in the other branch what it looks like.

/**
* @brief Numerical type for the cell IDs used internally and other indexations. It must be signed.
*/
using Internal_key = unspecified;

/**
* @brief Type for the cell IDs used at insertion and in the boundaries given as argument.
* Has to be usable as key in a hashtable, so "hashable" and comparable.
*/
using Cell_key = unspecified;

/**
* @brief Type for filtration values.
*/
using Filtration_value = unspecified;

/**
* @brief Type for the dimension values.
*/
using Dimension = unspecified;

/**
* @brief Column type used by the internal matrix.
*/
static const Gudhi::persistence_matrix::Column_types column_type;
};

/**
* @ingroup zigzag_persistence
*
* @brief List of options used for the zigzag persistence computation.
*/
struct ZigzagOptions {
/**
* @brief Numerical type for the cell IDs used internally and other indexations. It must be signed.
*/
using Internal_key = unspecified;

/**
* @brief Type for the dimension values.
*/
using Dimension = unspecified;

/**
* @brief Column type used by the internal matrix.
*/
static const Gudhi::persistence_matrix::Column_types column_type;
};

} // namespace zigzag_persistence
} // namespace Gudhi

#endif // CONCEPT_ZZ_OPTIONS_TYPE_H_
12 changes: 12 additions & 0 deletions src/Zigzag_persistence/doc/COPYRIGHT
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
The files of this directory are part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@VincentRouvreau Can you remind me why we have this file in every doc/ subdirectory? Is it because there are images, where we cannot include the text? And having some global statement somewhere would have been complicated because of exceptions?

See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.

Author(s): Vincent Rouvreau

Copyright (C) 2015 Inria
hschreiber marked this conversation as resolved.
Show resolved Hide resolved

This gives everyone the freedoms to use openFrameworks in any context:
commercial or non-commercial, public or private, open or closed source.

You should have received a copy of the MIT License along with this program.
If not, see https://opensource.org/licenses/MIT.
97 changes: 97 additions & 0 deletions src/Zigzag_persistence/doc/Intro_zigzag_persistence.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
* See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
* Author(s): Hannah Schreiber
*
* Copyright (C) 2023 Inria
*
* Modification(s):
* - YYYY/MM Author: Description of the modification
*/

#ifndef DOC_ZIGZAG_PERSISTENCE_INTRO_ZIGZAG_PERSISTENCE_H_
#define DOC_ZIGZAG_PERSISTENCE_INTRO_ZIGZAG_PERSISTENCE_H_

// needs namespace for Doxygen to link on classes
namespace Gudhi {
namespace zigzag_persistence {

/** \defgroup zigzag_persistence Zigzag Persistence
* @{
* \author Clément Maria, Hannah Schreiber
*
* \section zigzagintro Zigzag Persistence
*
* We refer to the introduction page \ref persistent_cohomology for persistent (co)homology for an introduction
* to the topic.
* Zigzag persistence is a generalization of the latter. While standard persistence only allows to grow the filtered
* complex by adding cells, zigzag persistence also allows removals. Hence the name "zigzag", as the module
* diagram will have arrows alternating between forward and backward.
*
* The module consists of the @ref Zigzag_persistence class and two wrappers @ref Filtered_zigzag_persistence and
* @ref Filtered_zigzag_persistence_with_storage "":
* - @ref Zigzag_persistence computes the persistence of a sequence of insertions and removals. A cell can be inserted
* or removed one at a time and the returned persistence pairs / bars are indexed on the operation numbers.
* For example, if a cycle is born at operation number 6 and dies at operation number 7, it will output a bar starting
* at 6 and ending at 7.
* - @ref Filtered_zigzag_persistence and @ref Filtered_zigzag_persistence_with_storage are adding the notion of
* "filtration value" to @ref Zigzag_persistence. At each call, an operation can be associated to a filtration value,
* which will be used to index the returned bars instead (bars with new length 0 are then ignored). The two classes
* also have more flexible inputs (the boundaries do not have to be ordered, nor identified continuously
* from 0). The difference between both classes is on the way they manage the memory: @ref Filtered_zigzag_persistence
* removes systematically all unnecessary information and outputs a pair as soon it is closed, while
* @ref Filtered_zigzag_persistence_with_storage will store all informations about filtration values and bars until the
* end and output the pairs only when asked. Depending on the use and the length of the filtration, one will be more
* efficient than the other and vice versa.
*
* The implementation is based on the algorithm introduced in \cite zigzag.
*
hschreiber marked this conversation as resolved.
Show resolved Hide resolved
* \subsection zigzaginterface Stream-like interface
mglisse marked this conversation as resolved.
Show resolved Hide resolved
*
* As removals are possible in zigzag filtration, the maximal size of the complex does not depend on the length of the
* filtration anymore. This makes it possible to build very long fine tuned filtrations with relatively small complexes
* which can be processed without overreaching memory space. For this purpose, it is possible to feed the module with
* information about the filtration "on the fly" to avoid loading the whole filtration at once. Information about the
* current barcode can be retrieved between any steps via callback methods.
*
* \section zigzagexamples Examples
*
* \subsection zzminusage Minimalistic examples
*
* \li \gudhi_example_link{Zigzag_persistence,example_usage_zigzag_persistence.cpp} - A simple example to showcase how
* to use the @ref Zigzag_persistence class to compute a barcode.
* <details>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this doesn't work with the version of doxygen we use in the CI, we really need to upgrade before the next release (not this PR).

* @dontinclude example_usage_zigzag_persistence.cpp
* @skip #include
* @until return 0;
* @skipline }
* </details>
* \li \gudhi_example_link{Zigzag_persistence,example_usage_filtered_zigzag_persistence.cpp} - A simple example to
* showcase how to use the @ref Filtered_zigzag_persistence class to compute a barcode.
* <details>
* @dontinclude example_usage_filtered_zigzag_persistence.cpp
* @skip #include
* @until return 0;
* @skipline }
* </details>
* \li \gudhi_example_link{Zigzag_persistence,example_usage_filtered_zigzag_persistence_with_storage.cpp} - A simple
* example to showcase how to use the @ref Filtered_zigzag_persistence_with_storage class to compute a barcode.
* <details open>
* @dontinclude example_usage_filtered_zigzag_persistence_with_storage.cpp
* @skip #include
* @until return 0;
* @skipline }
* </details>
*
* \subsection zzexamples More elaborate examples
*
* \li \gudhi_example_link{Zigzag_persistence,example_zigzag_filtration_as_input_loop.cpp} - A simple example to showcase how
* to use the @ref Filtered_zigzag_persistence_with_storage class within an input loop.
* \li \gudhi_example_link{Zigzag_persistence,example_zzfiltration_from_file.cpp} - An example of a "stream-like" usage
* with @ref Filtered_zigzag_persistence by reading off the filtration from a file.
*
* @}
*/
} // namespace zigzag_persistence
} // namespace Gudhi

#endif // DOC_ZIGZAG_PERSISTENCE_INTRO_ZIGZAG_PERSISTENCE_H_
Binary file added src/Zigzag_persistence/doc/zigzag_ex.png
hschreiber marked this conversation as resolved.
Show resolved Hide resolved
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions src/Zigzag_persistence/example/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
project(Zigzag_persistence_examples)

add_executable_with_targets(Zigzag_persistence_example_usage_zigzag_persistence example_usage_zigzag_persistence.cpp TBB::tbb)
add_test(NAME Zigzag_persistence_example_usage_zigzag_persistence COMMAND $<TARGET_FILE:Zigzag_persistence_example_usage_zigzag_persistence>)

add_executable_with_targets(Zigzag_persistence_example_usage_filtered_zigzag_persistence example_usage_filtered_zigzag_persistence.cpp TBB::tbb)
add_test(NAME Zigzag_persistence_example_usage_filtered_zigzag_persistence COMMAND $<TARGET_FILE:Zigzag_persistence_example_usage_filtered_zigzag_persistence>)

add_executable_with_targets(Zigzag_persistence_example_usage_filtered_zigzag_persistence_with_storage example_usage_filtered_zigzag_persistence_with_storage.cpp TBB::tbb)
add_test(NAME Zigzag_persistence_example_usage_filtered_zigzag_persistence_with_storage COMMAND $<TARGET_FILE:Zigzag_persistence_example_usage_filtered_zigzag_persistence_with_storage>)

add_executable_with_targets(Zigzag_persistence_example_zigzag_filtration_as_input_loop example_zigzag_filtration_as_input_loop.cpp TBB::tbb)
add_test(NAME Zigzag_persistence_example_zigzag_filtration_as_input_loop COMMAND $<TARGET_FILE:Zigzag_persistence_example_zigzag_filtration_as_input_loop>)

add_executable_with_targets(Zigzag_persistence_example_zzfiltration_from_file example_zzfiltration_from_file.cpp TBB::tbb)
file(COPY "zigzag_filtration_example.txt" DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/)
add_test(NAME Zigzag_persistence_example_zzfiltration_from_file COMMAND $<TARGET_FILE:Zigzag_persistence_example_zzfiltration_from_file> "${CMAKE_CURRENT_BINARY_DIR}/zigzag_filtration_example.txt")




Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
* See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
* Author(s): Hannah Schreiber
*
* Copyright (C) 2024 Inria
*
* Modification(s):
* - YYYY/MM Author: Description of the modification
*/

#include <iostream>

#include <gudhi/filtered_zigzag_persistence.h>

using Zigzag_persistence = Gudhi::zigzag_persistence::Filtered_zigzag_persistence<>;
using Dimension = Zigzag_persistence::Dimension;
using Filtration_value = Zigzag_persistence::Filtration_value;

int main() {
std::clog << "********* Minimalistic example of usage of the Filtered_zigzag_persistence class ********" << std::endl;

// Filtered_zigzag_persistence(callback) with for example callback method as a anonymous lambda
Zigzag_persistence zp([](Dimension dim, Filtration_value birth, Filtration_value death) {
std::cout << "[" << dim << "] " << birth << " - " << death << std::endl;
});

// It is important that the operations of insertions and removals are made **in the same order** as in the zigzag
// filtration ones wants to compute the barcode from.
// A cell can be identified in the boundaries by any given numerical label, it is just important that the given
// filtration values are monotonous (ie., either only increasing or only decreasing).

// inserts vertex 2 at filtration value 0.1 -> birth at 0.1 of 0-cycle
zp.insert_cell(2, {}, 0, 0.1);
// inserts vertex 4 at filtration value 0.1 -> birth at 0.1 of 0-cycle
zp.insert_cell(4, {}, 0, 0.1);
// inserts edge 5 = (2,4) at filtration value 0.3 -> death at 0.3 -> outputs (0, 0.1, 0.3)
zp.insert_cell(5, {2, 4}, 1, 0.3);
// inserts vertex 3 at filtration value 0.4 -> birth at 0.4 of 0-cycle
zp.insert_cell(3, {}, 0, 0.4);
// inserts edge 6 = (2,3) at filtration value 0.4 -> death at 0.4 of the cycle born at 0.4 -> outputs nothing
zp.insert_cell(6, {2, 3}, 1, 0.4);
// inserts edge 9 = (3,4) at filtration value 1.2 -> birth at 1.2 of 1-cycle
zp.insert_cell(9, {4, 3}, 1, 1.2);
// removes edge 6 at filtration value 1.5 -> death at 1.5 -> outputs (1, 1.2, 1.5)
zp.remove_cell(6, 1.5);
// removes edge 5 at filtration value 2.0 -> birth at 2.0 of 0-cycle
zp.remove_cell(5, 2.0);

// Only the closed bars where output so far, so the open/infinite bars still need to be retrieved.

// in this example, computes (0, 0.1) and (0, 2.0)
zp.get_current_infinite_intervals([](Dimension dim, Filtration_value birth) {
std::cout << "[" << dim << "] " << birth << " - inf" << std::endl;
});

return 0;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
* See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
* Author(s): Hannah Schreiber
*
* Copyright (C) 2024 Inria
*
* Modification(s):
* - YYYY/MM Author: Description of the modification
*/

#include <iostream>

#include <gudhi/filtered_zigzag_persistence.h>

using Zigzag_persistence = Gudhi::zigzag_persistence::Filtered_zigzag_persistence_with_storage<>;

int main() {
std::clog << "** Minimalistic example of usage of the Filtered_zigzag_persistence_with_storage class **" << std::endl;
hschreiber marked this conversation as resolved.
Show resolved Hide resolved

Zigzag_persistence zp;

// It is important that the operations of insertions and removals are made **in the same order** as in the zigzag
// filtration ones wants to compute the barcode from.
// A cell can be identified in the boundaries by any given numerical label, it is just important that the given
// filtration values are monotonous (ie., either only increasing or only decreasing).

// inserts vertex 2 at filtration value 0.1 -> birth at 0.1 of 0-cycle
zp.insert_cell(2, {}, 0, 0.1);
// inserts vertex 4 at filtration value 0.1 -> birth at 0.1 of 0-cycle
zp.insert_cell(4, {}, 0, 0.1);
// inserts edge 5 = (2,4) at filtration value 0.3 -> death at 0.3 -> stores (0, 0.1, 0.3)
zp.insert_cell(5, {2, 4}, 1, 0.3);
// inserts vertex 3 at filtration value 0.4 -> birth at 0.4 of 0-cycle
zp.insert_cell(3, {}, 0, 0.4);
// inserts edge 6 = (2,3) at filtration value 0.4 -> death at 0.4 of the cycle born at 0.4 -> stores nothing
zp.insert_cell(6, {2, 3}, 1, 0.4);
// inserts edge 9 = (3,4) at filtration value 1.2 -> birth at 1.2 of 1-cycle
zp.insert_cell(9, {4, 3}, 1, 1.2);
// removes edge 6 at filtration value 1.5 -> death at 1.5 -> stores (1, 1.2, 1.5)
zp.remove_cell(6, 1.5);
// removes edge 5 at filtration value 2.0 -> birth at 2.0 of 0-cycle
zp.remove_cell(5, 2.0);

// The bars are stored within the class and where not output at all for now.
hschreiber marked this conversation as resolved.
Show resolved Hide resolved

// get all bars in a vector
auto barcode = zp.get_persistence_diagram();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should use zp.get_persistence_diagram(0, true) so it matches the other examples? It can also be a hint to users that the documentation of this function may be useful. On the other hand, it complicates (slightly) the example.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to keep the example as simple as possible. It shows also what the default parameters do. But I have no strong opinion about it.


// do something with the vector, e.g., stream out content:
for (auto& bar : barcode) {
std::cout << bar << std::endl;
}

return 0;
hschreiber marked this conversation as resolved.
Show resolved Hide resolved
}
Loading
Loading