Skip to content

Commit

Permalink
Docs
Browse files Browse the repository at this point in the history
  • Loading branch information
WhiteBlackGoose authored Jul 22, 2022
1 parent 7edb564 commit 2d9ebae
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions Sources/AngouriMath/AngouriMath/Core/Entity/Entity.Definition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,16 +134,28 @@ public abstract partial record Entity : ILatexiseable
/// <remarks>A depth-first enumeration is required by
/// <see cref="AngouriMath.Functions.TreeAnalyzer.GetMinimumSubtree"/></remarks>
/// <summary>
/// The list of all nodes of the given expression
/// The list of all subnodes of the given expression, including its own. Traverses
/// the tree the following order:
/// <ol>
/// <li>The node itself</li>
/// <li>All nodes from all children</li>
/// </ol>
/// </summary>
/// <example>
/// <code>
/// Entity expr = "a + b / 2 ^ 3";
/// Console.WriteLine(string.Join(", ", expr.Nodes));
/// for (var node in expr.Nodes)
/// Console.WriteLine(node);
/// </code>
/// Output:
/// <code>
/// a + b / 2 ^ 3, a, b / 2 ^ 3, b, 2 ^ 3, 2, 3
/// a + b / 2 ^ 3
/// a
/// b / 2 ^ 3
/// b
/// 2 ^ 3
/// 2
/// 3
/// </code>
/// </example>
public IEnumerable<Entity> Nodes => nodes.GetValue(static @this => @this.DirectChildren.SelectMany(c => c.Nodes).Prepend(@this), this);
Expand Down Expand Up @@ -694,4 +706,4 @@ public IReadOnlyList<Variable> Vars
/// </example>
public bool IsConstantLeaf => this is Boolean or Number or Set.SpecialSet;
}
}
}

0 comments on commit 2d9ebae

Please sign in to comment.