Skip to content

Commit 31b052d

Browse files
format
1 parent f01244c commit 31b052d

File tree

4 files changed

+17
-16
lines changed

4 files changed

+17
-16
lines changed

ext/IntegralsFastGaussQuadratureExt.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ end
2727
function composite_gauss_legendre(f::F, p, lb, ub, nodes, weights, subintervals) where {F}
2828
h = (ub - lb) / subintervals
2929
I = gauss_legendre(f, p, lb, lb + h, nodes, weights)
30-
for i in 1:subintervals-1
30+
for i in 1:(subintervals - 1)
3131
_lb = lb + i * h
3232
_ub = _lb + h
3333
I += gauss_legendre(f, p, _lb, _ub, nodes, weights)

src/algorithms_sampled.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Example with sampled data:
1010
```julia
1111
using Integrals
1212
f = x -> x^2
13-
x = range(0, 1, length=20)
13+
x = range(0, 1, length = 20)
1414
y = f.(x)
1515
problem = SampledIntegralProblem(y, x)
1616
method = TrapezoidalRule()
@@ -31,7 +31,7 @@ Example with equidistant data:
3131
```julia
3232
using Integrals
3333
f = x -> x^2
34-
x = range(0, 1, length=20)
34+
x = range(0, 1, length = 20)
3535
y = f.(x)
3636
problem = SampledIntegralProblem(y, x)
3737
method = SimpsonsRule()

test/derivative_tests.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ alg_req = Dict(
1515
allows_iip = false),
1616
GaussLegendre(n = 50) => (nout = Inf, min_dim = 1, max_dim = 1, allows_batch = false,
1717
allows_iip = false),
18-
GaussLegendre(n = 50, subintervals=3) => (nout = Inf, min_dim = 1, max_dim = 1, allows_batch = false,
18+
GaussLegendre(n = 50, subintervals = 3) => (
19+
nout = Inf, min_dim = 1, max_dim = 1, allows_batch = false,
1920
allows_iip = false),
2021
QuadGKJL() => (nout = Inf, allows_batch = true, min_dim = 1, max_dim = 1,
2122
allows_iip = true),

test/gaussian_quadrature_tests.jl

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -99,19 +99,19 @@ sol = solve(prob, alg)
9999
@test sol.u -240.25235266303063249920743158729
100100

101101
# Gauss-Legendre with array-valued integrands
102-
prob = IntegralProblem((x,p)->[1,2], (-1,1))
103-
sol = solve(prob, GaussLegendre(;n=5))
104-
@test sol.u 2*[1,2]
102+
prob = IntegralProblem((x, p) -> [1, 2], (-1, 1))
103+
sol = solve(prob, GaussLegendre(; n = 5))
104+
@test sol.u 2 * [1, 2]
105105

106-
prob = IntegralProblem((x,p)->[1 2; 3 4], (-1,1))
107-
sol = solve(prob, GaussLegendre(;n=5))
108-
@test sol.u 2*[1 2; 3 4]
106+
prob = IntegralProblem((x, p) -> [1 2; 3 4], (-1, 1))
107+
sol = solve(prob, GaussLegendre(; n = 5))
108+
@test sol.u 2 * [1 2; 3 4]
109109

110110
# Composite Gauss-Legendre with array-valued integrands
111-
prob = IntegralProblem((x,p)->[1,2], (-1,1))
112-
sol = solve(prob, GaussLegendre(;n=5, subintervals=5))
113-
@test sol.u 2*[1,2]
111+
prob = IntegralProblem((x, p) -> [1, 2], (-1, 1))
112+
sol = solve(prob, GaussLegendre(; n = 5, subintervals = 5))
113+
@test sol.u 2 * [1, 2]
114114

115-
prob = IntegralProblem((x,p)->[1 2; 3 4], (-1,1))
116-
sol = solve(prob, GaussLegendre(;n=5, subintervals=5))
117-
@test sol.u 2*[1 2; 3 4]
115+
prob = IntegralProblem((x, p) -> [1 2; 3 4], (-1, 1))
116+
sol = solve(prob, GaussLegendre(; n = 5, subintervals = 5))
117+
@test sol.u 2 * [1 2; 3 4]

0 commit comments

Comments
 (0)