removed unused sort
This commit is contained in:
@@ -23,19 +23,28 @@ function _calculate_oriented_differences(cubes::Vector{Coord})
|
|||||||
n_cubes = length(cubes)
|
n_cubes = length(cubes)
|
||||||
reorientation = Vector{Coord}(undef, n_cubes)
|
reorientation = Vector{Coord}(undef, n_cubes)
|
||||||
oriented_differences = Vector{Vector{Coord}}(undef, n_orientations)
|
oriented_differences = Vector{Vector{Coord}}(undef, n_orientations)
|
||||||
for i ∈ 1:n_orientations
|
|
||||||
|
sort!(cubes)
|
||||||
|
_compute_differences!(oriented_differences, cubes, 1)
|
||||||
|
|
||||||
|
for i ∈ 2:n_orientations
|
||||||
for j ∈ 1:n_cubes
|
for j ∈ 1:n_cubes
|
||||||
reorientation[j] = orient_tuple(cubes[j], i)
|
reorientation[j] = orient_tuple(cubes[j], i)
|
||||||
end
|
end
|
||||||
sort!(reorientation)
|
sort!(reorientation)
|
||||||
|
_compute_differences!(oriented_differences, reorientation, i)
|
||||||
|
end
|
||||||
|
return oriented_differences
|
||||||
|
end
|
||||||
|
|
||||||
|
function _compute_differences!(oriented_differences::Vector{Vector{Coord}}, reorientation::Vector{Coord}, i::Int)
|
||||||
|
n_cubes = length(reorientation)
|
||||||
reference_cube = reorientation[1]
|
reference_cube = reorientation[1]
|
||||||
oriented_differences[i] = Vector{Coord}(undef, n_cubes-1)
|
oriented_differences[i] = Vector{Coord}(undef, n_cubes-1)
|
||||||
for j ∈ 1:n_cubes-1
|
for j ∈ 1:n_cubes-1
|
||||||
oriented_differences[i][j] = reference_cube - reorientation[j+1]
|
oriented_differences[i][j] = reference_cube - reorientation[j+1]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return oriented_differences
|
|
||||||
end
|
|
||||||
|
|
||||||
function generate_children(pcube::PolyCube, n_max::Int)
|
function generate_children(pcube::PolyCube, n_max::Int)
|
||||||
cubes = pcube.cubes
|
cubes = pcube.cubes
|
||||||
|
|||||||
12
test_results
12
test_results
@@ -1,12 +0,0 @@
|
|||||||
=====|main|=====
|
|
||||||
BenchmarkTools.Trial: 36 samples with 1 evaluation.
|
|
||||||
Range (min … max): 131.581 ms … 159.500 ms ┊ GC (min … max): 0.00% … 3.94%
|
|
||||||
Time (median): 137.621 ms ┊ GC (median): 0.00%
|
|
||||||
Time (mean ± σ): 140.185 ms ± 7.360 ms ┊ GC (mean ± σ): 1.12% ± 1.50%
|
|
||||||
|
|
||||||
▃▃▃ █ █ ▃ ▃ ▃ ▃
|
|
||||||
▇███▁▇▁▁█▇█▇▇█▁█▁▁▁▇▇▇█▁▁▇▇▁▁▁▇▁▇▁▁▁▁▁█▁▁▁▇▁▁▁▁▁▁▁▇▁▁▁▁▁▁▁▇▁▇ ▁
|
|
||||||
132 ms Histogram: frequency by time 160 ms <
|
|
||||||
|
|
||||||
Memory estimate: 16.63 MiB, allocs estimate: 371299.
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user