From 5a8c3af15a2b2e11fd75ee4859dbcd2d0006e0ae Mon Sep 17 00:00:00 2001 From: allem Date: Wed, 8 Jan 2020 20:27:46 -0500 Subject: [PATCH] change signature of path walk to allow differently typed generators. --- example/path.cpp | 7 +------ include/tc/core.hpp | 6 +++--- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/example/path.cpp b/example/path.cpp index fca33e3..e2175a6 100644 --- a/example/path.cpp +++ b/example/path.cpp @@ -7,7 +7,7 @@ int main() { auto cube = tc::group::B(3); auto vars = cube.solve(); - auto words = vars.path.walk( + auto words = vars.path.walk( "", {"a", "b", "c"}, [](auto a, auto b) { return a + b; } @@ -17,10 +17,5 @@ int main() { std::cout << word << std::endl; } -// for (size_t target = 1; target < vars.size(); target++) { -// auto &action = vars.path.get(target); -// std::cout << action.from_idx << " * " << action.gen << " = " << target << std::endl; -// } - return 0; } diff --git a/include/tc/core.hpp b/include/tc/core.hpp index 2041959..147935c 100644 --- a/include/tc/core.hpp +++ b/include/tc/core.hpp @@ -30,11 +30,11 @@ namespace tc { void put(int from_idx, int gen, int to_idx); - template + template [[nodiscard]] std::vector walk( T start, - std::vector gens, - std::function op + std::vector gens, + std::function op ) const { std::vector res(size()); res[0] = start;