Simplex class

class Simplex
__init__(seq[, data])

Initializes Simplex from the given sequence seq and optionally real value data, e.g.:

s = Simplex([1,2,3], 7.8)
add(v)

Adds vertex v to the simplex, increasing its dimension by 1.

See also

join()

boundary

Iterator over the boundary \partial \sigma of the simplex, e.g.:

for sb in s.boundary: print sb
contains(v)
Returns:

True iff the simplex contains vertex v.

dimension()
Returns:

the dimension of the simplex (one less than its number of vertices).

join(other)

Joins the current simplex with the other simplex. The method copies over the vertices from the other simplex.

data

Real value stored in the simplex.

vertices

(Sorted) vertices of the simplex accessible as a sequence, e.g.:

for v in s.vertices: print v,
__hash__()
__eq__(other)

Simplices are hashable, and equality comparable, and therefore can be stored in a dictionary. Simplices are equal if their vertices are the same.

Utility functions for manipulating simplices

The first function vertex_cmp() is a Python interface to a C++ function. The rest are pure Python functions defined in bindings/python/dionysus/__init__.py.

vertex_cmp(s1, s2)

Compares the two simplices with respect to the lexicographic order of their vertices.

vertex_dim_cmp(s1, s2)

Compares the two simplices with respect to their dimension, and lexicographically within the same dimension.

data_cmp(s1, s2)

Compares the two simplices with respect to the data (real values) they store.

data_dim_cmp(s1, s2)

Compares the two simplices with respect to their dimension and within the same dimension with respect to their data.