summaryrefslogtreecommitdiff
path: root/lib/dihedral.c
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2018-06-26 15:13:46 -0400
committerJaron Kent-Dobias <jaron@kent-dobias.com>2018-06-26 15:13:46 -0400
commit25781a4041fa75a3394949d111be3abbefc97c26 (patch)
tree60e9db774c2257a045efabf50aea13d850d8c265 /lib/dihedral.c
parent7ee46e45abea3261b2728aa4d0f03f939e123dc7 (diff)
downloadc++-25781a4041fa75a3394949d111be3abbefc97c26.tar.gz
c++-25781a4041fa75a3394949d111be3abbefc97c26.tar.bz2
c++-25781a4041fa75a3394949d111be3abbefc97c26.zip
began generalizing the potts code to work with all finite spin spaces
Diffstat (limited to 'lib/dihedral.c')
-rw-r--r--lib/dihedral.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/dihedral.c b/lib/dihedral.c
index 623041a..ac74a23 100644
--- a/lib/dihedral.c
+++ b/lib/dihedral.c
@@ -25,4 +25,16 @@ q_t dihedral_inverse_act(q_t q, const dihedral_t *g, q_t s) {
}
}
+q_t *dihedral_gen_transformations(q_t q) {
+ q_t *transformations = (q_t *)malloc(q * q * sizeof(q_t));
+
+ for (q_t i = 0; i < q; i++) {
+ for (q_t j = 0; j < q; j++) {
+ transformations[q * i + j] = dihedral_act(q, i, j);
+ }
+ }
+
+ return transformations;
+}
+