Description Usage Arguments Details Value Fields Properties Methods Author(s) References Examples
Simplex tree class exposed as an Rcpp Module.
1 | simplex_tree(simplices = NULL)
|
simplices |
optional simplices to initialize the simplex tree with. See |
A simplex tree is an ordered trie-like structure specialized for storing and doing general computation
simplicial complexes. Here is figure of a simplex tree, taken from the original paper (see 1):
The current implementation provides a subset of the functionality described in the paper.
A queryable simplex tree, as a Rcpp_SimplexTree object (Rcpp module).
n_simplicesA vector, where each index k denotes the number (k-1)-simplices.
dimensionThe dimension of the simplicial complex.
Properties are actively bound shortcuts to various methods of the simplex tree that may be thought of as fields. Unlike fields, however, properties are not explicitly stored: they are generated on access.
id_policy The policy used to generate new vertex ids. May be assigned "compressed" or "unique". See generate_ids.
verticesThe 0-simplices of the simplicial complex, as a matrix.
edgesThe 1-simplices of the simplicial complex, as a matrix.
trianglesThe 2-simplices of the simplicial complex, as a matrix.
quadsThe 3-simplices of the simplicial complex, as a matrix.
connected_componentsThe connected components of the simplicial complex.
as_XPtrCreates an external pointer.
clearClears the simplex tree.
generate_idsGenerates new vertex ids according to the set policy.
degreeReturns the degree of each given vertex.
adjacentReturns vertices adjacent to a given vertex.
insertInserts a simplex into the trie.
removeRemoves a simplex from the trie.
findReturns whether a simplex exists in the trie.
collapsePerforms an elementary collapse.
contractPerforms an edge contraction.
expandPerforms an k-expansion.
traverseTraverses a subset of the simplex tree, applying a function to each simplex.
ltraverseTraverses a subset of the simplex tree, applying a function to each simplex and returning the result as a list.
is_faceChecks for faces.
is_treeChecks if the simplicial complex is a tree.
as_listConverts the simplicial complex to a list.
as_adjacency_matrixConverts the 1-skeleton to an adjacency matrix.
as_adjacency_listConverts the 1-skeleton to an adjacency list.
as_edgelistConverts the 1-skeleton to an edgelist.
Matt Piekenbrock
Boissonnat, Jean-Daniel, and Clement Maria. "The simplex tree: An efficient data structure for general simplicial complexes." Algorithmica 70.3 (2014): 406-427.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | ## Recreating simplex tree from figure.
st <- simplex_tree()
st %>% insert(list(1:3, 2:5, c(6, 7, 9), 7:8, 10))
plot(st)
## Example insertion
st <- simplex_tree(list(1:3, 4:5, 6)) ## Inserts one 2-simplex, one 1-simplex, and one 0-simplex
print(st)
# Simplex Tree with (6, 4, 1) (0, 1, 2)-simplices
## More detailed look at structure
print_simplices(st, "tree")
# 1 (h = 2): .( 2 3 )..( 3 )
# 2 (h = 1): .( 3 )
# 3 (h = 0):
# 4 (h = 1): .( 5 )
# 5 (h = 0):
# 6 (h = 0):
## Print the set of simplices making up the star of the simplex '2'
print_simplices(st %>% cofaces(2))
# 2, 2 3, 1 2, 1 2 3
## Retrieves list of all simplices in DFS order, starting with the empty face
dfs_list <- ltraverse(st %>% preorder(empty_face), identity)
## Get connected components
print(st$connected_components)
# [1] 1 1 1 4 4 5
## Use clone() to make copies of the complex (don't use the assignment `<-`)
new_st <- st %>% clone()
## Other more internal methods available via `$`
list_of_simplices <- st$as_list()
adj_matrix <- st$as_adjacency_matrix()
# ... see also as_adjacency_list(), as_edge_list(), etc
|
Attaching package: ‘simplextree’
The following object is masked from ‘package:utils’:
find
The following objects are masked from ‘package:base’:
remove, serialize
Simplex Tree with (6, 4, 1) (0, 1, 2)-simplices
1 (h = 2): .( 2 3 )..( 3 )
2 (h = 1): .( 3 )
3 (h = 0):
4 (h = 1): .( 5 )
5 (h = 0):
6 (h = 0):
2, 2 3, 1 2, 1 2 3
[1] 1 1 1 4 4 5
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.