-
Notifications
You must be signed in to change notification settings - Fork 275
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix replace_node on nodes with indirect node refs
Model.replace_node failed if a node n contained a reference to another node m, when m only occurs in one of the (grand)children of n. Since replace_node used the breadth-first Model.walk method, the reference to m would be replaced before m is replaced in the (grand)children of n. However, this fails because set_ref verifies that the a new node reference occurs in the graph. This change resolves this issue by replacing nodes using a depth-first search in post-order. This amounts to doing a topological sort of the transposed graph.
- Loading branch information
Showing
2 changed files
with
81 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters