Skip to content

Commit 1467230

Browse files
authored
export subtrees (#85)
* export subtrees, SubtreeIterator * set version to 2.12.0
1 parent 14388f2 commit 1467230

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "RootedTrees"
22
uuid = "47965b36-3f3e-11e9-0dcf-4570dfd42a8c"
33
authors = ["Hendrik Ranocha <mail@ranocha.de> and contributors"]
4-
version = "2.11.1"
4+
version = "2.12.0"
55

66
[deps]
77
Latexify = "23fbe1c1-3f47-55db-b15f-69d7ec21a316"

src/RootedTrees.jl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ export residual_order_condition, elementary_weight, derivative_weight
1919

2020
export count_trees
2121

22+
export subtrees, SubtreeIterator
23+
2224
export partition_forest, PartitionForestIterator,
2325
partition_skeleton,
2426
all_partitions, PartitionIterator
@@ -547,6 +549,15 @@ function count_trees(order)
547549
end
548550

549551
# subtrees
552+
"""
553+
SubtreeIterator(t::AbstractRootedTree)
554+
555+
Lazy iterator representation of the [`subtrees`](@ref) of the rooted
556+
tree `t`.
557+
Similar to [`RootedTreeIterator`](@ref), you should `copy` the iterates
558+
if you want to store or modify them during the iteration since they may be
559+
views to internal caches.
560+
"""
550561
struct SubtreeIterator{Tree <: AbstractRootedTree}
551562
t::Tree
552563
end
@@ -581,6 +592,8 @@ end
581592
subtrees(t::RootedTree)
582593
583594
Returns a vector of all subtrees of `t`.
595+
596+
See also [`SubtreeIterator`](@ref).
584597
"""
585598
function subtrees(t::RootedTree)
586599
subtr = typeof(t)[]

0 commit comments

Comments
 (0)