Skip to content

Commit

Permalink
Try with Iterators
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeingold committed Dec 2, 2024
1 parent c9a03f0 commit 0e402c1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/integral.jl
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,10 @@ function _integral(

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

# Domain transformation: x [-1,1] ↦ t [0,1]
t(x) = (1 // 2) * x + (1 // 2)
Expand Down

0 comments on commit 0e402c1

Please sign in to comment.