File tree Expand file tree Collapse file tree 2 files changed +16
-16
lines changed
Expand file tree Collapse file tree 2 files changed +16
-16
lines changed Original file line number Diff line number Diff line change @@ -13,22 +13,6 @@ import ..EquationModule:
1313 any,
1414 filter_map
1515
16- """
17- count_nodes(tree::AbstractNode)::Int
18-
19- Count the number of nodes in the tree.
20- """
21- function count_nodes (tree:: AbstractNode ; break_sharing= Val (false ))
22- return tree_mapreduce (
23- _ -> 1 ,
24- + ,
25- tree,
26- Int64;
27- f_on_shared= (c, is_shared) -> is_shared ? 0 : c,
28- break_sharing,
29- )
30- end
31-
3216"""
3317 count_depth(tree::AbstractNode)::Int
3418
Original file line number Diff line number Diff line change 220220# Derived functions: ##########################################################
221221# ##############################################################################
222222
223+ """
224+ count_nodes(tree::AbstractNode)::Int
225+
226+ Count the number of nodes in the tree.
227+ """
228+ function count_nodes (tree:: AbstractNode ; break_sharing= Val (false ))
229+ return tree_mapreduce (
230+ _ -> 1 ,
231+ + ,
232+ tree,
233+ Int64;
234+ f_on_shared= (c, is_shared) -> is_shared ? 0 : c,
235+ break_sharing,
236+ )
237+ end
238+
223239"""
224240 foreach(f::Function, tree::AbstractNode)
225241
You can’t perform that action at this time.
0 commit comments