How to use the gudhi.MiniSimplexTree function in gudhi

To help you get started, we’ve selected a few gudhi examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github GUDHI / gudhi-devel / src / cython / example / mini_simplex_tree_example.py View on Github external
print("#####################################################################")
print("MiniSimplexTree creation from insertion")

""" Complex to build.
     1   3
     o---o
    /X\ /
   o---o   o
   2   0   4
"""

triangle012 = [0, 1, 2]
edge03 = [0, 3]
edge13 = [1, 3]
vertex4 = [4]
mini_st = gudhi.MiniSimplexTree()
mini_st.insert(triangle012)
mini_st.insert(edge03)
mini_st.insert(edge13)
mini_st.insert(vertex4)

# FIXME: Remove this line
mini_st.set_dimension(2)

# initialize_filtration required before plain_homology
mini_st.initialize_filtration()

print("persistence(homology_coeff_field=2)=")
print(mini_st.persistence(homology_coeff_field=2))

edge02 = [0, 2]
if mini_st.find(edge02):