Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ language: julia
os:
- linux
julia:
- 0.7
- 1.0
- 1.1
- 1.2
- nightly
notifications:
email: false
Expand Down
34 changes: 34 additions & 0 deletions Manifest.toml
Original file line number Diff line number Diff line change
@@ -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"
21 changes: 21 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -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"]
3 changes: 0 additions & 3 deletions REQUIRE

This file was deleted.

6 changes: 4 additions & 2 deletions src/cell.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
13 changes: 10 additions & 3 deletions test/cell.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,22 @@ 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])
parents3D = [p for p in allparents(cell3D[2,2,2][1,1,1])]

@test parents3D[1] === cell3D[2,2,2]
@test parents3D[2] === cell3D

noparents = [p for p in allparents(cell2D)]
@test length(noparents) == 0
end
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