Commit 190f6fa5 authored by Adam P. Goucher's avatar Adam P. Goucher

Bugfix

parent 98dd2f11
Pipeline #49902704 passed with stages
in 7 minutes and 39 seconds
......@@ -85,7 +85,7 @@ def matperms(pts):
adjt = [[a[i] for a in adj] for i in range(d)]
# Transform by adjugate matrix:
pts = [[sum([x*y for (x, y) in zip(a, m)]) for a in adjt] for m in pts]
ptsset = {tuple(p): i for (i, p) in enumerate(pts)}
ptsset = {tuple([x*det for x in p]): i for (i, p) in enumerate(pts)}
for t in permutations(t):
t = tuple(t)
......
......@@ -22,15 +22,25 @@ class TestTreeduce(unittest.TestCase):
'''
Test ability to determine symmetry group of a cross.
'''
mp = automorph.matperms([[0, 0], [1, 0], [0, 1], [-1, 0], [0, -1]])
mp = list(automorph.matperms([[0, 0], [1, 0], [0, 1], [-1, 0], [0, -1]]))
mp2 = [[0, 1, 2, 3, 4], [0, 2, 1, 4, 3], [0, 1, 4, 3, 2], [0, 4, 1, 2, 3],
[0, 2, 3, 4, 1], [0, 3, 2, 1, 4], [0, 3, 4, 1, 2], [0, 4, 3, 2, 1]]
self.assertEqual(set(map(tuple, mp)), set(map(tuple, mp2)))
mp3 = automorph.matperms([[0, 0], [4, 3], [-3, 4], [-4, -3], [3, -4]])
mp3 = list(automorph.matperms([[0, 0], [4, 3], [-3, 4], [-4, -3], [3, -4]]))
self.assertEqual(set(map(tuple, mp)), set(map(tuple, mp3)))
self.assertEqual(set(map(tuple, mp3)), set(map(tuple, mp2)))
mp = list(automorph.matperms([[0], [5], [-5], [7], [-7]]))
self.assertEqual(len(mp), 2)
d3 = [(x, y, z) for x in [-1, 0, 1] for y in [-1, 0, 1] for z in [-1, 0, 1] if x*x + y*y + z*z == 2]
mp = list(automorph.matperms(d3))
self.assertEqual(len(mp), 48)
def test_reduce(self):
'''
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment