modified coxeter notation parsing

This commit is contained in:
David Allemang
2022-09-23 15:35:25 -04:00
parent 2ba15097ec
commit f7bf77e5f0
14 changed files with 689 additions and 155 deletions

View File

@@ -10,7 +10,5 @@
#include "group.hpp"
namespace tc {
constexpr Coset UNBOUNDED = (Coset) (-1);
Cosets solve(const Group &group, const std::vector<Gen> &sub_gens, const Coset &bound = UNBOUNDED);
}

View File

@@ -2,17 +2,9 @@
#include <cstdlib>
#include "cosets.hpp"
#include "util.hpp"
namespace tc {
using Coset = uint32_t;
using Gen = uint8_t;
using Mult = uint16_t;
constexpr Mult FREE = Mult(-1);
constexpr Coset UNSET = Coset(-1);
using Rel = std::tuple<Gen, Gen, Mult>;
struct Cosets {
Gen ngens;
std::vector<int> data;

View File

@@ -1,9 +1,10 @@
#pragma once
#include <cassert>
#include <sstream>
#include <tc/util.hpp>
#include <tc/pair_map.hpp>
#include <cassert>
namespace tc {
struct Group;

View File

@@ -1,7 +1,8 @@
#pragma once
#include "core.hpp"
#include <vector>
#include <tc/group.hpp>
namespace tc {
/**
@@ -10,55 +11,13 @@ namespace tc {
*/
Group schlafli(const std::vector<int> &mults);
namespace group {
/**
* Simplex
*/
Group A(int dim);
Group coxeter(const std::string &symbol);
/**
* Cube, Orthoplex
*/
Group B(int dim);
Group vcoxeter(const std::string &symbol, std::vector<int> &values);
/**
* Demicube, Orthoplex
*/
Group D(int dim);
/**
* E groups
*/
Group E(int dim);
/**
* 24 Cell
*/
Group F4();
/**
* Hexagon
*/
Group G2();
/**
* Icosahedron
*/
Group H(int dim);
/**
* Polygonal
*/
Group I2(int n);
/**
* Toroidal. I2(n) * I2(m)
*/
Group T(int n, int m);
/**
* Toroidal. T(n, n)
*/
Group T(int n);
template<typename ...Args>
Group coxeter(const std::string &symbol, const Args &... args) {
std::vector<int> values = {{args...}};
return vcoxeter(symbol, values);
}
}

View File

@@ -6,6 +6,17 @@
#include <functional>
namespace tc {
using Gen = uint8_t;
using Mult = uint16_t;
constexpr Mult FREE = Mult(-1);
using Coset = uint32_t;
constexpr Coset UNSET = Coset(-1);
constexpr Coset UNBOUNDED = (Coset) (-1);
using Rel = std::tuple<Gen, Gen, Mult>;
struct Action {
int from_idx = -1;
int gen = -1;