Skip to content

Commit

Permalink
More tests
Browse files Browse the repository at this point in the history
  • Loading branch information
roflmaostc committed Dec 22, 2023
1 parent f976853 commit b0beb84
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,12 @@ using Zygote
test_rrule(iradon, y, [0, π/4, π/2, 2π, 0.1, 0.00001] ChainRulesTestUtils.NoTangent(), 0.01 ChainRulesTestUtils.NoTangent())
end


@testset "utils" begin
@test RadonKA.find_intersections(0.0, 0.0, 4.0, 2.0) [0.0 1.0 2.0 2.0 3.0 4.0; 0.0 0.5 1.0 1.0 1.5 2.0]
@test RadonKA.find_intersections(0, 0, 2, 2) [0 1 1 2; 0 1 1 2]
@test RadonKA.find_intersections(0.0, 0.75, 2.75, 4.0) [0.0 0.21153846153846156 1.0 1.0576923076923077 1.9038461538461537 2.0 2.75; 0.75 1.0 1.9318181818181819 2.0 3.0 3.1136363636363638 4.0]
@test all(RadonKA.rays_on_circle(randn((8, 8)), 0.0) .≈ ([5.5, 3.26393202250021, 2.6715728752538097, 2.5, 2.6715728752538097, 3.26393202250021, 5.5], [2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5], [5.5, 7.73606797749979, 8.32842712474619, 8.5, 8.32842712474619, 7.73606797749979, 5.5], [2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5]))
end

end

0 comments on commit b0beb84

Please sign in to comment.