Skip to content

Commit

Permalink
Improve choosing dividing axis direction
Browse files Browse the repository at this point in the history
  • Loading branch information
pabloferz committed Aug 1, 2017
1 parent c2fece2 commit 21e075b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/genz-malik.jl
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ error `E` (via the given `norm`), and the suggested coordinate `k` ∈ `1:n`
to subdivide next.
"""
function (g::GenzMalik{n,T})(f, a::SVector{n}, b::SVector{n}, norm=vecnorm) where {n,T}
c = (a+b)*T(0.5)
Δ = (b-a)*T(0.5)
V = abs(prod))
c = T(0.5).*(a.+b)
Δ = T(0.5).*abs.(b.-a)
V = prod(Δ)

f₁ = f(c)

Expand All @@ -138,6 +138,8 @@ function (g::GenzMalik{n,T})(f, a::SVector{n}, b::SVector{n}, norm=vecnorm) wher
if divdiff > maxdivdiff
kdivide = i
maxdivdiff = divdiff
elseif divdiff == maxdivdiff && Δ[i] > Δ[kdivide]
kdivide = i
end
end

Expand Down

0 comments on commit 21e075b

Please sign in to comment.