Commit cb077a23 authored by Manuel Schrauth's avatar Manuel Schrauth
Browse files

expand test to include brute force algorithm

parent a974f1b8
Pipeline #15289 failed with stages
in 8 minutes and 43 seconds
......@@ -3,15 +3,15 @@ from hypertiling import HyperbolicTiling
from hypertiling.neighbours import find
kernel = "flo"
lattices = [(3,7,7,), (7,3,7), (5,4,6), (4,5,6), (9,3,4), (4,10,3), (3,8,4), (6,4,4)]
print("Testing different neighbour search algorithms against each other")
class TestCompareNeighbours(unittest.TestCase):
def test_comp_nbrs(self):
kernel = "flo"
lattices = [(3,7,7,), (7,3,7), (5,4,6), (4,5,6), (9,3,4), (4,10,3), (3,8,4), (6,4,4)]
for p, q, nlayer in lattices:
print("Constructing", p, q, nlayer, "lattice")
T = HyperbolicTiling(p, q, nlayer, kernel=kernel, center="cell")
......@@ -22,6 +22,19 @@ class TestCompareNeighbours(unittest.TestCase):
self.assertTrue(nbrs1 == nbrs2)
kernel = "flo"
lattices = [(3,7,4), (7,3,4), (5,4,4), (4,5,4), (9,3,4), (4,10,3), (3,8,4), (6,4,4)]
for p, q, nlayer in lattices:
print("Constructing", p, q, nlayer, "lattice")
T = HyperbolicTiling(p, q, nlayer, kernel=kernel, center="cell")
T.generate()
nbrs1 = find(T, which="optimized")
nbrs2 = find(T, which="brute_force")
self.assertTrue(nbrs1 == nbrs2)
if __name__ == '__main__':
unittest.main()
Supports Markdown
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