mirror of
https://github.com/allemangD/toddcox-visualize.git
synced 2025-11-10 12:02:47 -05:00
move headers to tc directory.
This commit is contained in:
30
include/tc/cosets.h
Normal file
30
include/tc/cosets.h
Normal file
@@ -0,0 +1,30 @@
|
||||
#pragma once
|
||||
|
||||
#include "groups.h"
|
||||
#include <vector>
|
||||
|
||||
namespace tc {
|
||||
struct Action {
|
||||
int coset = -1;
|
||||
int gen = -1;
|
||||
};
|
||||
|
||||
struct Cosets {
|
||||
int ngens;
|
||||
std::vector<int> data;
|
||||
std::vector<Action> path;
|
||||
int len;
|
||||
|
||||
explicit Cosets(int ngens);
|
||||
|
||||
void add_row();
|
||||
|
||||
void put(int coset, int gen, int target);
|
||||
|
||||
void put(int idx, int target);
|
||||
|
||||
[[nodiscard]] int get(int coset, int gen) const;
|
||||
|
||||
[[nodiscard]] int get(int idx) const;
|
||||
};
|
||||
}
|
||||
92
include/tc/groups.h
Normal file
92
include/tc/groups.h
Normal file
@@ -0,0 +1,92 @@
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include <vector>
|
||||
|
||||
namespace tc {
|
||||
struct Rel {
|
||||
std::array<int, 2> gens;
|
||||
int mult;
|
||||
};
|
||||
|
||||
/**
|
||||
* A presentation of a coxeter group. Contains a number of generators and some relations of the form (ab)^n = e
|
||||
*/
|
||||
struct Group {
|
||||
const int ngens;
|
||||
std::vector<std::vector<int>> _mults; // lookup table for multiplicities
|
||||
std::string name;
|
||||
|
||||
explicit Group(int ngens, const std::vector<Rel> &rels = {}, std::string name = "G");
|
||||
|
||||
void setmult(Rel rel);
|
||||
|
||||
[[nodiscard]] std::vector<Rel> get_rels() const;
|
||||
|
||||
[[nodiscard]] Group product(const Group &other) const;
|
||||
|
||||
[[nodiscard]] Group power(int p) const;
|
||||
};
|
||||
|
||||
Group operator*(const Group &g, const Group &h);
|
||||
|
||||
Group operator^(const Group &g, const int &p);
|
||||
|
||||
/**
|
||||
* Construct a group from a (simplified) Schlafli Symbol of the form [a, b, ..., c]
|
||||
* @param mults: The sequence of multiplicites between adjacent generators.
|
||||
*/
|
||||
Group schlafli(const std::vector<int> &mults);
|
||||
|
||||
namespace group {
|
||||
/**
|
||||
* Simplex
|
||||
*/
|
||||
Group A(int dim);
|
||||
|
||||
/**
|
||||
* Cube, Orthoplex
|
||||
*/
|
||||
Group B(int dim);
|
||||
|
||||
/**
|
||||
* 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);
|
||||
}
|
||||
}
|
||||
7
include/tc/solver.h
Normal file
7
include/tc/solver.h
Normal file
@@ -0,0 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "cosets.h"
|
||||
|
||||
namespace tc {
|
||||
Cosets solve(const Group &g, const std::vector<int> &sub_gens = {});
|
||||
}
|
||||
Reference in New Issue
Block a user