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.
This commit is contained in:
2024-07-27 01:23:31 +01:00
parent 32314708d5
commit 1c06a4b613
2 changed files with 9 additions and 6 deletions

View File

@@ -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);