summaryrefslogtreecommitdiff
path: root/lib/dihedral.h
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2018-10-10 21:45:32 -0400
committerJaron Kent-Dobias <jaron@kent-dobias.com>2018-10-10 21:45:32 -0400
commita43ff1f98e9b9814f858bccb11c174b418458491 (patch)
treeae7e094d914eddb8a1ae9548420ba8c2f329ffae /lib/dihedral.h
parent6e264d243f0b29d90e90b605b6cdeab8227129c9 (diff)
downloadc++-a43ff1f98e9b9814f858bccb11c174b418458491.tar.gz
c++-a43ff1f98e9b9814f858bccb11c174b418458491.tar.bz2
c++-a43ff1f98e9b9814f858bccb11c174b418458491.zip
big rearrangement of files to make libraries and example (research) files clearer, and changed to c++ std lib random numbers
Diffstat (limited to 'lib/dihedral.h')
-rw-r--r--lib/dihedral.h48
1 files changed, 0 insertions, 48 deletions
diff --git a/lib/dihedral.h b/lib/dihedral.h
deleted file mode 100644
index 8d0472b..0000000
--- a/lib/dihedral.h
+++ /dev/null
@@ -1,48 +0,0 @@
-
-#pragma once
-
-#include "types.h"
-#include "potts.h"
-
-template <q_t q>
-class dihedral_t {
- public:
- bool is_reflection;
- q_t x;
-
- dihedral_t() : is_reflection(false), x(0) {}
- dihedral_t(bool x, q_t y) : is_reflection(x), x(y) {}
-
- potts_t<q> act(const potts_t<q>& s) const {
- if (this->is_reflection) {
- return potts_t<q>(((q + this->x) - s.x) % q);
- } else {
- return potts_t<q>((this->x + s.x) % q);
- }
- }
-
- dihedral_t<q> act(dihedral_t<q> r) const {
- if (this->is_reflection) {
- return dihedral_t<q>(!(r.is_reflection), ((q + this->x) - r.x) % q);
- } else {
- return dihedral_t<q>(r.is_reflection, (this->x + r.x) % q);
- }
- }
-
- potts_t<q> act_inverse(potts_t<q> s) const {
- if (this->is_reflection) {
- return this->act(s);
- } else {
- return potts_t<q>(((s.x + q) - this->x) % q);
- }
- }
-
- dihedral_t<q> act_inverse(dihedral_t<q> r) const {
- if (this->is_reflection) {
- return this->act(r);
- } else {
- return dihedral_t<q>(r.is_reflection, ((r.x + q) - this->x) % q);
- }
- }
-};
-