Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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):