Skip to content

Commit

Permalink
fixed bug in test
Browse files Browse the repository at this point in the history
  • Loading branch information
ryarazi committed Sep 5, 2024
1 parent 7b66d11 commit 02f837d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,11 @@ using LinearAlgebra
direction = normalize(@SVector randn(3))
center = @SVector rand(3)
las = Laser(σ, direction, center) #laser is pointed to xy plane

photons_r = Matrix{Float64}(undef, 3, 100000)
for i in 1:size(photons_r, 2)
photons_r[:, i] = sample_source(las).r

photons = [sample_source(las) for _ in 1:100000]
photons_r = Matrix{Float64}(undef, 3, length(photons))
for (i, p) in enumerate(photons)
photons_r[:, i] = p.r
end

@test isapprox(vec(mean(photons_r, dims=2)), center, atol=5.e-2) #center is ok
Expand Down

0 comments on commit 02f837d

Please sign in to comment.