Skip to content

Commit

Permalink
Rename variables for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeingold committed Dec 2, 2024
1 parent f6d2c10 commit cb5a1b6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/integral.jl
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ function _integral(

# Get Gauss-Legendre nodes and weights of type FP for a region [-1,1]ᴺ
xs, ws = FastGaussQuadrature.gausslegendre(rule.n)
weights = Iterators.product(ntuple(Returns(FP.(ws)), N)...) # TODO Iterators
nodes = Iterators.product(ntuple(Returns(FP.(xs)), N)...) # TODO Iterators
weight_grid = Iterators.product(ntuple(Returns(FP.(ws)), N)...) # TODO Iterators
node_grid = Iterators.product(ntuple(Returns(FP.(xs)), N)...) # TODO Iterators

# Domain transformation: x [-1,1] ↦ t [0,1]
t(x) = (1 // 2) * x + (1 // 2)
Expand All @@ -89,7 +89,7 @@ function _integral(
prod(weights) * f(geometry(ts...)) * differential(geometry, ts, diff_method)
end

return (1 // (2^N)) .* sum(integrand, zip(weights, nodes))
return (1 // (2^N)) .* sum(integrand, zip(weight_grid, node_grid))
end

# HAdaptiveCubature
Expand Down

0 comments on commit cb5a1b6

Please sign in to comment.