restructure files
This commit is contained in:
@@ -13,7 +13,6 @@ add_custom_command(
|
|||||||
${CMAKE_CURRENT_BINARY_DIR}/shaders
|
${CMAKE_CURRENT_BINARY_DIR}/shaders
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(coxeter src/tc.cpp)
|
add_executable(coxeter scr/coxeter.cpp)
|
||||||
|
add_executable(mirror src/mirrors.cpp)
|
||||||
add_executable(mirror src/mirror.cpp)
|
|
||||||
target_link_libraries(mirror PRIVATE glm)
|
target_link_libraries(mirror PRIVATE glm)
|
||||||
|
|||||||
27
cosets/src/coxeter.cpp
Normal file
27
cosets/src/coxeter.cpp
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
#include "util/coxeter.hpp"
|
||||||
|
|
||||||
|
int main(int argc, char *argv[]) {
|
||||||
|
std::vector<std::vector<int>> ids{
|
||||||
|
{0, 0},
|
||||||
|
{1, 1},
|
||||||
|
{2, 2},
|
||||||
|
{0, 1, 0, 1, 0, 1, 0, 1},
|
||||||
|
{1, 2, 1, 2, 1, 2},
|
||||||
|
{0, 2, 0, 2}
|
||||||
|
};
|
||||||
|
|
||||||
|
Table *table = solve(3, {0, 1}, ids);
|
||||||
|
|
||||||
|
std::cout << table->size() << std::endl;
|
||||||
|
std::cout << *table << std::endl;
|
||||||
|
|
||||||
|
for (const auto &v : table->words()) {
|
||||||
|
std::cout << "[ ";
|
||||||
|
for (auto e : v) {
|
||||||
|
std::cout << e << " ";
|
||||||
|
}
|
||||||
|
std::cout << "]\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
15
cosets/src/mirrors.cpp
Normal file
15
cosets/src/mirrors.cpp
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
#include "util/mirrors.hpp"
|
||||||
|
|
||||||
|
int main(int argc, char *argv[]) {
|
||||||
|
auto normals = mirror<3>({
|
||||||
|
{},
|
||||||
|
{4},
|
||||||
|
{2, 3}
|
||||||
|
});
|
||||||
|
|
||||||
|
for (const auto &normal : normals) {
|
||||||
|
std::cout << glm::to_string(normal) << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -195,29 +195,3 @@ std::ostream &operator<<(std::ostream &out, const Table &table) {
|
|||||||
|
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
|
||||||
std::vector<std::vector<int>> ids{
|
|
||||||
{0, 0},
|
|
||||||
{1, 1},
|
|
||||||
{2, 2},
|
|
||||||
{0, 1, 0, 1, 0, 1, 0, 1},
|
|
||||||
{1, 2, 1, 2, 1, 2},
|
|
||||||
{0, 2, 0, 2}
|
|
||||||
};
|
|
||||||
|
|
||||||
Table *table = solve(3, {0, 1}, ids);
|
|
||||||
|
|
||||||
std::cout << table->size() << std::endl;
|
|
||||||
std::cout << *table << std::endl;
|
|
||||||
|
|
||||||
for (const auto &v : table->words()) {
|
|
||||||
std::cout << "[ ";
|
|
||||||
for (auto e : v) {
|
|
||||||
std::cout << e << " ";
|
|
||||||
}
|
|
||||||
std::cout << "]\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
#include <glm/gtx/string_cast.hpp>
|
#include <glm/gtx/string_cast.hpp>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
|
|
||||||
#include "util/numeric.hpp"
|
#include "numeric.hpp"
|
||||||
|
|
||||||
template<int N>
|
template<int N>
|
||||||
std::vector<glm::vec4> mirror(const float (&arr)[N][N]) {
|
std::vector<glm::vec4> mirror(const float (&arr)[N][N]) {
|
||||||
@@ -32,17 +32,3 @@ std::vector<glm::vec4> mirror(const float (&arr)[N][N]) {
|
|||||||
|
|
||||||
return mirrors;
|
return mirrors;
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
|
||||||
auto normals = mirror<3>({
|
|
||||||
{},
|
|
||||||
{4},
|
|
||||||
{2, 3}
|
|
||||||
});
|
|
||||||
|
|
||||||
for (const auto &normal : normals) {
|
|
||||||
std::cout << glm::to_string(normal) << std::endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user