aboutsummaryrefslogtreecommitdiff
path: root/src/numerics.hpp
AgeCommit message (Collapse)Author
2024-07-26NodeAllocator can now get nodes by value or by referenceAryadev Chavali
Abstracting the interface more, such that callers can use functions rather than accessing internals directly, allows me to refactor the allocator without having to do a ton of edits all across the source tree.
2024-07-26Changed from int64_t to optional<word_t> for pointers in NodeAryadev Chavali
2024-07-26`iterate` now computes highest value fraction it generated.Aryadev Chavali
Not very useful, but isn't a massive performance waster (I think) and it will be useful when thinking about colour schemes in graphics.
2024-07-26Rework MAX macro to use `<` operatorAryadev Chavali
MAX now works with Fraction's
2024-07-26Introduce normalised value in fraction classAryadev Chavali
Bit of a cheat but it would allow us to do some interesting graphical stuff later.
2024-07-26Rework node constructor and general procedure APIAryadev Chavali
Node constructor is now completely default constructed i.e. no constructor arguments required. The iterate function takes the queue by reference, so it can update the caller's state. Finally, to_string for a Node now uses the node allocator and an index to print out trees. Seems simpler and more in line with the current implementation.
2024-07-26Made header file for a separate numerics fileAryadev Chavali
Separates the (basically) completed cw_tree implementation in a separate module so we can spend time implementing graphics in main. NOTE: nodes are now generated from a node allocator, which just wraps around the vector. We also take an allocator and queue by reference in the iterate procedure now.