summaryrefslogtreecommitdiff
path: root/lib/dihinf.c
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2018-03-20 19:06:50 -0400
committerJaron Kent-Dobias <jaron@kent-dobias.com>2018-03-20 19:06:50 -0400
commit2928df0a4b4be30cde2b11bdcf2698875d5b9536 (patch)
tree38116f528ff090610ec9463064fd1296af7967b6 /lib/dihinf.c
parentaf50f36935953b096fba19113ae5b0a602278796 (diff)
downloadc++-2928df0a4b4be30cde2b11bdcf2698875d5b9536.tar.gz
c++-2928df0a4b4be30cde2b11bdcf2698875d5b9536.tar.bz2
c++-2928df0a4b4be30cde2b11bdcf2698875d5b9536.zip
new system
Diffstat (limited to 'lib/dihinf.c')
-rw-r--r--lib/dihinf.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/dihinf.c b/lib/dihinf.c
new file mode 100644
index 0000000..4f88a7a
--- /dev/null
+++ b/lib/dihinf.c
@@ -0,0 +1,28 @@
+
+#include "dihinf.h"
+
+dihinf_t *dihinf_compose(h_t g1i, const dihinf_t *g2) {
+ // we only need to consider the action of reflections
+ dihinf_t *g3 = (dihinf_t *)malloc(1 * sizeof(dihinf_t));
+
+ g3->r = !g2->r;
+ g3->i = g1i - g2->i;
+
+ return g3;
+}
+
+h_t dihinf_act(h_t gi, h_t s) {
+ // we only need to consider the action of reflections
+
+ return gi - s;
+}
+
+h_t dihinf_inverse_act(const dihinf_t *g, h_t s) {
+ if (g->r) {
+ return g->i - s;
+ } else {
+ return s - g->i;
+ }
+}
+
+