Implement triangulate (like 95% sure it's right) - memoized

Modify recontext to reorient in special cases
Move reorient as Simplexes method
Changes in geomtest and memotest to test triangulate and memoization for triangulate
This commit is contained in:
Jacob
2020-01-25 21:32:17 -05:00
parent 506320200d
commit 6b03b7d9be
5 changed files with 122 additions and 25 deletions

View File

@@ -7,16 +7,22 @@
#include <iostream>
int main () {
auto g = tc::group::B(3);
auto g = tc::schlafli({3,2});
GeomGen gg(g);
Simplexes s(1);
s.vals.push_back(0);
s.vals.push_back(1);
s.vals.push_back(0);
s.vals.push_back(2);
s.vals.push_back(1);
s.vals.push_back(2);
auto path = gg.solve().path;
//std::vector<std::string> = {"a", "b", "c"};
std::string base = "";
auto words = path.walk<std::string, std::string>(base,{"a","b","c"}, [](auto s1, auto g){return s1+g;});
for (const auto word : words) {
std::cout << word << std::endl;
}
std::vector<int> gens = {0,1,2};
auto s = gg.triangulate(gens);
s.print();
return 0;
auto g_gens = gg.group_gens();
std::vector<int> sg_gens = {1,2};

View File

@@ -51,4 +51,20 @@ int main() {
std::chrono::duration<double> t2 = e2 - s2;
std::cout << t2.count() << ": " << res2.size() << std::endl;
std::vector<int> gens = {0,1,2,3,4,5};
auto s3 = std::chrono::system_clock::now();
auto res3 = mbig.triangulate(gens);
auto e3 = std::chrono::system_clock::now();
std::chrono::duration<double> t3 = e3 - s3;
std::cout << t3.count() << ": " << res3.size() << std::endl;
auto s4 = std::chrono::system_clock::now();
auto res4 = mbig.triangulate(gens);
auto e4 = std::chrono::system_clock::now();
std::chrono::duration<double> t4 = e4 - s4;
std::cout << t4.count() << ": " << res4.size() << std::endl;
}