Description Usage Arguments Details Examples
Generates vertex ids representing 0-simplices not in the tree.
1 | generate_ids(st, n)
|
st |
a simplex tree. |
n |
the number of ids to generate. |
This function generates new vertex ids for use in situations which involve generating new
new 0-simplices, e.g. insertions, contractions, collapses, etc. There are two 'policies' which designate
the generating mechanism of these ids: 'compressed' and 'unique'. 'compressed' generates vertex ids
sequentially, starting at 0. 'unique' tracks an incremental internal counter, which is updated on every
call to generate_ids
. The new ids under the 'unique' policy generates the first sequential n
ids that are strictly greater max
(counter, max vertex id).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | st <- simplex_tree()
print(st$id_policy)
## "compressed"
st %>% generate_ids(3)
## 0 1 2
st %>% generate_ids(3)
## 0 1 2
st %>% insert(list(1,2,3))
print(st$vertices)
## 1 2 3
st %>% insert(as.list(st %>% generate_ids(2)))
st %>% print_simplices()
# 0, 1, 2, 3, 4
st %>% remove(4)
st %>% generate_ids(1)
# 4
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.