removed unused sort

This commit is contained in:
=
2024-02-08 14:53:05 +01:00
parent 291b6cbea3
commit 9488bc2298
2 changed files with 15 additions and 18 deletions

View File

@@ -23,20 +23,29 @@ function _calculate_oriented_differences(cubes::Vector{Coord})
n_cubes = length(cubes)
reorientation = Vector{Coord}(undef, n_cubes)
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
reorientation[j] = orient_tuple(cubes[j], i)
end
sort!(reorientation)
reference_cube = reorientation[1]
oriented_differences[i] = Vector{Coord}(undef, n_cubes-1)
for j 1:n_cubes-1
oriented_differences[i][j] = reference_cube - reorientation[j+1]
end
_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]
oriented_differences[i] = Vector{Coord}(undef, n_cubes-1)
for j 1:n_cubes-1
oriented_differences[i][j] = reference_cube - reorientation[j+1]
end
end
function generate_children(pcube::PolyCube, n_max::Int)
cubes = pcube.cubes
allowed_growth = n_max - length(cubes)

View File

@@ -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.