Skip to content

Commit

Permalink
Documentation changes
Browse files Browse the repository at this point in the history
Minor stylistic revision.
  • Loading branch information
mkg33 committed Oct 16, 2020
1 parent 5da3dac commit 750acf0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
16 changes: 8 additions & 8 deletions README.md
Expand Up @@ -16,7 +16,7 @@ many breaking changes in the near future.

### Construction

`RootedTree`s are represented using level sequences, i.e. `AbstractVector`s
`RootedTree`s are represented using level sequences, i.e., `AbstractVector`s
containing the distances of the nodes from the root, cf.
Beyer, Terry, and Sandra Mitchell Hedetniemi.
"Constant time generation of rooted trees."
Expand All @@ -28,7 +28,7 @@ RootedTree{Int64}: [1, 2, 3, 2]
```
In the notation of [Butcher (Numerical Methods for ODEs, 2016)](https://doi.org/10.1002/9781119121534),
this tree can be written as `[[τ²] τ]` or `(τ ∘ τ) ∘ (τ ∘ τ)`, where
`` is the non-asociative Butcher product of `RootedTree`s, which is also
`` is the non-associative Butcher product of `RootedTree`s, which is also
implemented.

To get the representation of a `RootedTree` introduced by Butcher, use `butcher_representation`:
Expand All @@ -46,7 +46,7 @@ A `RootedTreeIterator(order::Integer)` can be used to iterate efficiently
over all `RootedTree`s of a given `order`.

Be careful that the iterator is stateful for efficiency reasons, so you might
need to use `copy` appropriately, e.g.
need to use `copy` appropriately, e.g.,
```julia
julia> map(identity, RootedTreeIterator(4))
4-element Array{RootedTrees.RootedTree{Int64,Array{Int64,1}},1}:
Expand All @@ -67,11 +67,11 @@ julia> map(copy, RootedTreeIterator(4))

The usual functions on `RootedTree`s are implemented, cf.
[Butcher (Numerical Methods for ODEs, 2016)](https://doi.org/10.1002/9781119121534).
- `order(t::RootedTree)`: The order of a `RootedTree`, i.e. the length of it's level sequence.
- `σ(t::RootedTree)`:The symmetry `σ` of a rooted tree, i.e. the order of the group of automorphisms on a particular labelling (of the vertices) of `t`.
- `γ(t::RootedTree)`: The density `γ(t)` of a rooted tree, i.e. the product over all vertices of `t` of the order of the subtree rooted at that vertex.
- `α(t::RootedTree)`: The number of monotonic labellings of `t` not equivalent under the symmetry group.
- `β(t::RootedTree)`: The total number of labellings of `t` not equivalent under the symmetry group.
- `order(t::RootedTree)`: The order of a `RootedTree`, i.e., the length of its level sequence.
- `σ(t::RootedTree)`: The symmetry `σ` of a rooted tree, i.e., the order of the group of automorphisms on a particular labelling (of the vertices) of `t`.
- `γ(t::RootedTree)`: The density `γ(t)` of a rooted tree, i.e., the product over all vertices of `t` of the order of the subtree rooted at that vertex.
- `α(t::RootedTree)`: The number of monotonic labelings of `t` not equivalent under the symmetry group.
- `β(t::RootedTree)`: The total number of labelings of `t` not equivalent under the symmetry group.

Additionally, functions on trees connected to Runge-Kutta methods are implemented.
- `elementary_weight(t, A, b, c)`: Compute the elementary weight Φ(`t`) of `t::RootedTree` for the Butcher coefficients `A, b, c` of a Runge-Kutta method.
Expand Down
22 changes: 11 additions & 11 deletions src/RootedTrees.jl
Expand Up @@ -66,15 +66,15 @@ copy(t::RootedTree) = RootedTree(copy(t.level_sequence), t.iscanonical)
# # # Test, whether there is exactly one root element at the beginning of sequence, if necessary.
# # root = sequence[1]
# # for level in sequence[2:end]
# # level <= root && throw(ArgumentError("Rooted trees must have exactly one element at root-level at the beginning."))
# # level <= root && throw(ArgumentError("Rooted trees must have exactly one element at root level at the beginning."))
# # end
# #end
# # If there is only one element, the sequence must be valid.
# if length(sequence) > 1
# # Test, whether there is exactly one root element at the beginning of sequence, if necessary.
# root = sequence[1]
# for level in sequence[2:end]
# level <= root && throw(ArgumentError("Rooted trees must have exactly one element at root-level at the beginning."))
# level <= root && throw(ArgumentError("Rooted trees must have exactly one element at root level at the beginning."))
# end
# end
#
Expand Down Expand Up @@ -109,7 +109,7 @@ end
"""
canonical_representation!(t::RootedTree)
Change the representation of the rooted tree `t` to the canonical one, i.e. the
Change the representation of the rooted tree `t` to the canonical one, i.e., the
one with lexicographically biggest level sequence.
"""
function canonical_representation!(t::RootedTree)
Expand All @@ -133,7 +133,7 @@ end
canonical_representation(t::RootedTree)
Returns a new tree using the canonical representation of the rooted tree `t`,
i.e. the one with lexicographically biggest level sequence.
i.e., the one with lexicographically biggest level sequence.
"""
function canonical_representation(t::RootedTree)
canonical_representation!(copy(t))
Expand Down Expand Up @@ -271,15 +271,15 @@ end
"""
order(t::RootedTree)
The `order` of a rooted tree, i.e. the length of it's level sequence.
The `order` of a rooted tree, i.e., the length of its level sequence.
"""
order(t::RootedTree) = length(t.level_sequence)


"""
σ(t::RootedTree)
The symmetry `σ` of a rooted tree `t`, i.e. the order of the group of automorphisms
The symmetry `σ` of a rooted tree `t`, i.e., the order of the group of automorphisms
on a particular labelling (of the vertices) of `t`.
Reference: Section 301 of
Expand Down Expand Up @@ -315,7 +315,7 @@ end
"""
γ(t::RootedTree)
The density `γ(t)` of a rooted tree, i.e. the product over all vertices of `t`
The density `γ(t)` of a rooted tree, i.e., the product over all vertices of `t`
of the order of the subtree rooted at that vertex.
Reference: Section 301 of
Expand All @@ -342,7 +342,7 @@ end
"""
α(t::RootedTree)
The number of monotonic labellings of `t` not equivalent under the symmetry group.
The number of monotonic labelings of `t` not equivalent under the symmetry group.
Reference: Section 302 of
Butcher, John Charles.
Expand All @@ -357,7 +357,7 @@ end
"""
β(t::RootedTree)
The total number of labellings of `t` not equivalent under the symmetry group.
The total number of labelings of `t` not equivalent under the symmetry group.
Reference: Section 302 of
Butcher, John Charles.
Expand Down Expand Up @@ -480,9 +480,9 @@ function butcher_representation(t::RootedTree)
end
result = "[" * result * "]"

# normalise the result by grouping repeated occurences of τ
# normalize the result by grouping repeated occurrences of τ
# TODO: Decide whether powers should also be used for subtrees,
# e.g. "[[τ]²]" instead of "[[τ][τ]]"
# e.g., "[[τ]²]" instead of "[[τ][τ]]"
# for rootedtree([1, 2, 3, 2, 3]).
# Currently, powers are only used for τ.
for n in order(t):-1:2
Expand Down

0 comments on commit 750acf0

Please sign in to comment.