SimplexTree.insert

SimplexTree.SimplexTree.insert(simplices)

Inserts simplices into the Simplex Tree.

By definition, inserting a simplex also inserts all of its faces. If the simplex already exists in the complex, the tree is not modified.

Parameters

Name Type Description Default
simplices Iterable[Collection] Iterable of simplices to insert (each of which are SimplexLike) required
Note

If the iterable is an 2-dim np.ndarray, then a p-simplex is inserted along each contiguous p+1 stride. Otherwise, each element of the iterable to casted to a Simplex and then inserted into the tree.

Examples

from simplextree import SimplexTree
st = SimplexTree([range(3)])
print(st)
Simplex Tree with (3, 3, 1) (0, 1, 2)-simplices
st.insert([[0,1]])
print(st)
Simplex Tree with (3, 3, 1) (0, 1, 2)-simplices