diff options
author | Thomas Lively <tlively@google.com> | 2024-08-05 15:27:44 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-05 12:27:44 -0700 |
commit | 5573cdb80e2ac9aed4cd5f20c3e41dc3138ef426 (patch) | |
tree | f9a38512ef5e71f71db4e3edcaed85ad1e5b78c1 /src/support/strongly_connected_components.h | |
parent | 53d54d7e4fca4bb971676c2e93440c8f25ec6a6a (diff) | |
download | binaryen-5573cdb80e2ac9aed4cd5f20c3e41dc3138ef426.tar.gz binaryen-5573cdb80e2ac9aed4cd5f20c3e41dc3138ef426.tar.bz2 binaryen-5573cdb80e2ac9aed4cd5f20c3e41dc3138ef426.zip |
Add a utility for iterating over all topological orders (#6801)
Use an extension of Kahn's algorithm for finding topological orders that
iteratively makes every possible choice at every step to find all the
topological orders. The order being constructed and the set of possible
choices are managed in-place in the same buffer, so the algorithm takes
linear time and space plus amortized constant time per generated order.
This will be used in an upcoming type optimization.
Diffstat (limited to 'src/support/strongly_connected_components.h')
-rw-r--r-- | src/support/strongly_connected_components.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/support/strongly_connected_components.h b/src/support/strongly_connected_components.h index d54200ad9..7fcbdf14c 100644 --- a/src/support/strongly_connected_components.h +++ b/src/support/strongly_connected_components.h @@ -223,8 +223,8 @@ public: // Iterate over the strongly connected components of the graph. struct Iterator { using value_type = SCC; - using different_type = std::ptrdiff_t; - using reference = SCC; + using difference_type = std::ptrdiff_t; + using reference = SCC&; using pointer = SCC*; using iterator_category = std::input_iterator_tag; |