From 4ec96cd1553812ff6d867b45dc9a2893e2e44e2f Mon Sep 17 00:00:00 2001 From: David Allemang Date: Thu, 24 Feb 2022 17:32:19 -0500 Subject: [PATCH] WIP: Add todo comments --- include/solver.hpp | 11 +++++++++++ src/geometrytest.cpp | 3 +++ 2 files changed, 14 insertions(+) diff --git a/include/solver.hpp b/include/solver.hpp index c1edd73..9074aaf 100644 --- a/include/solver.hpp +++ b/include/solver.hpp @@ -14,6 +14,8 @@ * Produce a list of all generators for the group context. The range [0..group.ngens). */ std::vector generators(const tc::Group &context) { + // todo if tc::Group has 'global' generators, then this will be a member of tc::Group. + // std::iota would populate a 'default' list of names, if names are not provided. std::vector g_gens(context.ngens); std::iota(g_gens.begin(), g_gens.end(), 0); return g_gens; @@ -26,6 +28,7 @@ std::vector recontext_gens( const tc::Group &context, std::vector g_gens, std::vector sg_gens) { + // todo ideally tc::Group will deal in 'global' generators so this stell will be unecessary. std::sort(g_gens.begin(), g_gens.end()); @@ -52,6 +55,7 @@ tc::Cosets solve( const std::vector &g_gens, const std::vector &sg_gens ) { + // todo this should also be handled with 'global' generators. const auto proper_sg_gens = recontext_gens(context, g_gens, sg_gens); return context.subgroup(g_gens).solve(proper_sg_gens); } @@ -78,6 +82,7 @@ Prims recontext( const std::vector &g_gens, const std::vector &sg_gens ) { + // todo this will be simpler with 'global' gens, but it's still not free... const auto proper_sg_gens = recontext_gens(context, g_gens, sg_gens); const auto table = solve(context, g_gens, {}); const auto path = solve(context, sg_gens, {}).path; @@ -100,6 +105,7 @@ Prims recontext( */ template Prims merge(const std::vector> &meshes) { + // todo (?) might be possible with NullaryExpr size_t cols = 0; for (const auto &mesh: meshes) { cols += mesh.cols(); @@ -124,6 +130,8 @@ std::vector> tile( const std::vector &g_gens, const std::vector &sg_gens ) { + // todo convert to nullaryexpr. + // some stuff will be easier with global generators, but not all. Prims base = recontext(prims, context, g_gens, sg_gens); const auto proper_sg_gens = recontext_gens(context, g_gens, sg_gens); @@ -149,6 +157,7 @@ std::vector> tile( template [[nodiscard]] Prims fan(Prims prims, int root) { + // todo convert to nullaryexpr. Prims res(N + 1, prims.cols()); res.topRows(1) = Prims<1>::Constant(1, prims.cols(), root); @@ -165,6 +174,8 @@ Prims triangulate( const tc::Group &context, const std::vector &g_gens ) { + // todo (?) might be possible with nullaryexpr + // not so sure, though. if (g_gens.size() + 1 != N) // todo make static assert throw std::logic_error("g_gens size must be one less than N"); diff --git a/src/geometrytest.cpp b/src/geometrytest.cpp index 674dc11..f48b872 100644 --- a/src/geometrytest.cpp +++ b/src/geometrytest.cpp @@ -20,6 +20,8 @@ Eigen::Matrix make_points( const tc::Group &group, const Eigen::Vector &root ) { + // todo clean up mirror / plane_intersections / barycentric + // ideally barycentric will work in rotors, so that stellations etc. will be possible auto mirrors = mirror(group); auto corners = plane_intersections(mirrors); auto start = barycentric(corners, root); @@ -42,6 +44,7 @@ Eigen::Matrix make_cells( auto gens = generators(group); auto combos = combinations(gens, N - 1); + // todo clean up merge(hull(...)) Eigen::Matrix cells = merge(hull(group, combos, exclude)); return cells;