|
1 | 1 | # This file contains tests for the generic functions in `src/neighborhood_search.jl` and |
2 | 2 | # tests comparing all NHS implementations against the `TrivialNeighborhoodSearch`. |
3 | 3 | @testset verbose=true "Neighborhood Searches" begin |
4 | | - neighborhood_searches = [ |
5 | | - (coords, min, max) -> TrivialNeighborhoodSearch{size(coords, 1)}(0.1, |
6 | | - axes(coords, 2), |
7 | | - periodic_box_min_corner = min, |
8 | | - periodic_box_max_corner = max), |
9 | | - (coords, min, max) -> GridNeighborhoodSearch{size(coords, 1)}(0.1, size(coords, 2), |
10 | | - periodic_box_min_corner = min, |
11 | | - periodic_box_max_corner = max), |
12 | | - ] |
13 | | - neighborhood_searches_names = [ |
14 | | - "`TrivialNeighborhoodSearch`", |
15 | | - "`GridNeighborhoodSearch`", |
16 | | - ] |
17 | | - |
18 | 4 | @testset verbose=true "Periodicity" begin |
19 | 5 | # These examples are constructed by hand and are therefore a good test for the |
20 | 6 | # trivial neighborhood search as well. |
|
48 | 34 | @testset verbose=true "$(names[i])" for i in eachindex(names) |
49 | 35 | coords = coordinates[i] |
50 | 36 |
|
| 37 | + neighborhood_searches = [ |
| 38 | + TrivialNeighborhoodSearch{size(coords, 1)}(0.1, axes(coords, 2), |
| 39 | + periodic_box_min_corner = periodic_boxes[i][1], |
| 40 | + periodic_box_max_corner = periodic_boxes[i][2]), |
| 41 | + GridNeighborhoodSearch{size(coords, 1)}(0.1, size(coords, 2), |
| 42 | + periodic_box_min_corner = periodic_boxes[i][1], |
| 43 | + periodic_box_max_corner = periodic_boxes[i][2]), |
| 44 | + ] |
| 45 | + neighborhood_searches_names = [ |
| 46 | + "`TrivialNeighborhoodSearch`", |
| 47 | + "`GridNeighborhoodSearch`", |
| 48 | + ] |
| 49 | + |
51 | 50 | # Run this for every neighborhood search |
52 | 51 | @testset "$(neighborhood_searches_names[j])" for j in eachindex(neighborhood_searches_names) |
53 | | - nhs = neighborhood_searches[j](coords, periodic_boxes[i]...) |
| 52 | + nhs = neighborhood_searches[j] |
54 | 53 |
|
55 | 54 | initialize!(nhs, coords, coords) |
56 | 55 |
|
|
0 commit comments