diff options
author | Aryadev Chavali <aryadev@aryadevchavali.com> | 2024-07-27 01:23:31 +0100 |
---|---|---|
committer | Aryadev Chavali <aryadev@aryadevchavali.com> | 2024-07-27 01:23:31 +0100 |
commit | 1c06a4b61303bf18d4ff72ff959074e17e1dd25a (patch) | |
tree | 80ad9e82453c10e9f48cd0a7aa9f4a391bb2d71d /src/numerics.hpp | |
parent | 32314708d564c5e7373f6f5f543c4768f856931c (diff) | |
download | cw_tree-1c06a4b61303bf18d4ff72ff959074e17e1dd25a.tar.gz cw_tree-1c06a4b61303bf18d4ff72ff959074e17e1dd25a.tar.bz2 cw_tree-1c06a4b61303bf18d4ff72ff959074e17e1dd25a.zip |
iterate now returns a tuple of the three fractions worked on
The left, currently processed (centre) and right fractions are
returned by iterate. This allows us to see exactly what fractions
have been generated/worked on in every iteration.
Diffstat (limited to 'src/numerics.hpp')
-rw-r--r-- | src/numerics.hpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/numerics.hpp b/src/numerics.hpp index d437cab..6d6004c 100644 --- a/src/numerics.hpp +++ b/src/numerics.hpp @@ -22,6 +22,7 @@ #include <optional> #include <queue> #include <string> +#include <tuple> #include <vector> #define MIN(A, B) ((A) < (B) ? (A) : (B)) @@ -59,7 +60,8 @@ struct NodeAllocator }; word_t gcd(word_t a, word_t b); -Fraction iterate(std::queue<word_t> &queue, NodeAllocator &allocator); +std::tuple<Fraction, Fraction, Fraction> iterate(std::queue<word_t> &queue, + NodeAllocator &allocator); std::string to_string(const Fraction &); std::string to_string(const NodeAllocator &, const index_t, int depth = 1); |