diff --git a/.travis.yml b/.travis.yml index 7f7f31a..fa45e08 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,8 +3,9 @@ language: julia os: - linux julia: - - 0.7 - 1.0 + - 1.1 + - 1.2 - nightly notifications: email: false diff --git a/Manifest.toml b/Manifest.toml new file mode 100644 index 0000000..8b25cfd --- /dev/null +++ b/Manifest.toml @@ -0,0 +1,34 @@ +# This file is machine-generated - editing it directly is not advised + +[[IterTools]] +git-tree-sha1 = "2ebe60d7343962966d1779a74a760f13217a6901" +uuid = "c8e1da08-722c-5040-9ed9-7db0dc04731e" +version = "1.2.0" + +[[Libdl]] +uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb" + +[[LinearAlgebra]] +deps = ["Libdl"] +uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" + +[[Random]] +deps = ["Serialization"] +uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" + +[[Serialization]] +uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b" + +[[SparseArrays]] +deps = ["LinearAlgebra", "Random"] +uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" + +[[StaticArrays]] +deps = ["LinearAlgebra", "Random", "Statistics"] +git-tree-sha1 = "db23bbf50064c582b6f2b9b043c8e7e98ea8c0c6" +uuid = "90137ffa-7385-5640-81b9-e52037218182" +version = "0.11.0" + +[[Statistics]] +deps = ["LinearAlgebra", "SparseArrays"] +uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" diff --git a/Project.toml b/Project.toml new file mode 100644 index 0000000..d9de5a8 --- /dev/null +++ b/Project.toml @@ -0,0 +1,21 @@ +name = "RegionTrees" +uuid = "dee08c22-ab7f-5625-9660-a9af2021b33f" + +[deps] +IterTools = "c8e1da08-722c-5040-9ed9-7db0dc04731e" +LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" +StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" + +[compat] +Interpolations = "0.9, 0.10, 0.11, 0.12" +IterTools = "1" +StaticArrays = "0.5, 0.6, 0.7, 0.8, 0.9, 0.10, 0.11" +julia = "1" + +[extras] +Interpolations = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59" +LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" + +[targets] +test = ["LinearAlgebra", "Test", "Interpolations"] diff --git a/REQUIRE b/REQUIRE deleted file mode 100644 index cebc49b..0000000 --- a/REQUIRE +++ /dev/null @@ -1,3 +0,0 @@ -julia 0.7 -StaticArrays 0.5.1 -IterTools 0.1 diff --git a/src/cell.jl b/src/cell.jl index 5974434..a1a7c2a 100644 --- a/src/cell.jl +++ b/src/cell.jl @@ -39,8 +39,10 @@ show(io::IO, cell::Cell) = print(io, "Cell: $(cell.boundary)") @inline getindex(cell::Cell, I...) = getindex(cell.children, I...) function child_boundary(cell::Cell, indices) - HyperRectangle(cell.boundary.origin + 0.5 * (SVector(indices) - 1) .* cell.boundary.widths, - cell.boundary.widths / 2) + half_widths = cell.boundary.widths ./ 2 + HyperRectangle( + cell.boundary.origin + (SVector(indices) - 1) .* half_widths, + half_widths) end @generated function map_children(f::Function, cell::Cell{Data, N, T, L}) where {Data, N, T, L} diff --git a/test/cell.jl b/test/cell.jl index f944349..9a7a2d5 100644 --- a/test/cell.jl +++ b/test/cell.jl @@ -44,7 +44,7 @@ end @test parents2D[1] === cell2D[1,1] @test parents2D[2] === cell2D - + cell3D = Cell(SVector(-1., -2, -3), SVector(2., 4, 6), 0) split!(cell3D) split!(cell3D[2,2,2]) @@ -52,7 +52,14 @@ end @test parents3D[1] === cell3D[2,2,2] @test parents3D[2] === cell3D - + noparents = [p for p in allparents(cell2D)] @test length(noparents) == 0 -end \ No newline at end of file +end + +@testset "non-float64 types" begin + # https://github.com/rdeits/RegionTrees.jl/pull/22 + root = Cell(SVector(0f0, 0f0, 0f0), SVector(1f0, 1f0, 1f0)) + split!(root) + @test length(root.children) == 8 +end