@@ -59,7 +59,7 @@ function Pl_hyperdual(x::Real, l::Integer)
59
59
" Legendre Polynomials are defined for arguments lying in -1 ⩽ x ⩽ 1" ))
60
60
61
61
hd1 = hyper (one (x))
62
- hdx = hyper (x,one (x),one (x),zero (x))
62
+ hdx = hyper (x, one (x), one (x), zero (x))
63
63
64
64
if l== 0
65
65
return hd1
@@ -82,7 +82,7 @@ function Pl_derivatives_allmodes!(arr::AbstractVector{<:Real}, x::Real,
82
82
lmax:: Integer = maximum (axes (arr,1 )), deriv= 0 )
83
83
84
84
# Only compute Pl
85
- arr_hyperdual = view (Pl_hyperdual_allmodes (x,lmax),0 : lmax)
85
+ arr_hyperdual = view (Pl_hyperdual_allmodes (x, lmax), 0 : lmax)
86
86
87
87
@inbounds @. arr[0 : lmax] = realpart (arr_hyperdual)
88
88
arr
@@ -92,10 +92,10 @@ function Pl_derivatives_allmodes!(arr::AbstractMatrix{<:Real}, x::Real,
92
92
lmax:: Integer = maximum (axes (arr,1 )),
93
93
deriv:: Integer = maximum (axes (arr,2 )))
94
94
95
- arr_hyperdual = view (Pl_hyperdual_allmodes (x,lmax),0 : lmax)
95
+ arr_hyperdual = view (Pl_hyperdual_allmodes (x, lmax), 0 : lmax)
96
96
97
- @inbounds for (d_order,f) in zip (0 : deriv,(realpart,eps1,eps1eps2))
98
- @. arr[0 : lmax,d_order] = f (arr_hyperdual)
97
+ @inbounds for (d_order,f) in zip (0 : deriv, (realpart,eps1,eps1eps2))
98
+ @. arr[0 : lmax, d_order] = f (arr_hyperdual)
99
99
end
100
100
arr
101
101
end
114
114
Computes the Legendre Polynomials ``P_l(x)`` for the argument `x` and `l = 0:lmax`.
115
115
Returns an `OffsetArray` `P` with indices `0:lmax`, where `P[l] == Pl(x,l)`
116
116
"""
117
- Pl (x:: Real ; lmax:: Integer ) = Pl_derivatives_allmodes (x,lmax,0 )[:,0 ]
117
+ Pl (x:: Real ; lmax:: Integer ) = Pl_derivatives_allmodes (x, lmax, 0 )[:,0 ]
118
118
119
119
"""
120
120
Pl(x::Real, l::Integer)
@@ -133,7 +133,7 @@ Computes the first derivatives of Legendre Polynomials ``d_xP_l(x)`` for the
133
133
argument `x` and `l = 0:lmax`.
134
134
Returns an `OffsetArray` `dP` with indices `0:lmax`, where `dP[l] = dPl(x,l)`
135
135
"""
136
- dPl (x:: Real ; lmax:: Integer ) = Pl_derivatives_allmodes (x,lmax,1 )[:,1 ]
136
+ dPl (x:: Real ; lmax:: Integer ) = Pl_derivatives_allmodes (x, lmax, 1 )[:,1 ]
137
137
138
138
"""
139
139
dPl(x::Real, l::Integer)
@@ -175,7 +175,7 @@ Returns `OffsetArray`s `P` and `dP` with indices `0:lmax`, where `P[l] == Pl(x,l
175
175
`dP[l] == dPl(x,l)`.
176
176
"""
177
177
function Pl_dPl (x:: Real ; lmax:: Integer )
178
- P = Pl_derivatives_allmodes (x,lmax,1 )
178
+ P = Pl_derivatives_allmodes (x, lmax, 1 )
179
179
P[:,0 ], P[:,1 ]
180
180
end
181
181
@@ -235,7 +235,7 @@ Computes the the first and second derivatives of Legendre Polynomials ``d_xP_l(x
235
235
and ``d_x^2P_l(x)`` for the argument `x` and the degree `l`
236
236
"""
237
237
function dPl_d2Pl (x:: Real , l:: Integer )
238
- Ph = Pl_hyperdual (x,l)
238
+ Ph = Pl_hyperdual (x, l)
239
239
eps1 (Ph), eps1eps2 (Ph)
240
240
end
241
241
@@ -279,7 +279,7 @@ The optional keyword argument `lmax` may specify the range of ``l``'s to compute
279
279
It defaults to `lmax = maximum(axes(arr,1))`
280
280
"""
281
281
Pl! (arr:: AbstractVecOrMat{<:Real} , x:: Real ; lmax:: Integer = maximum (axes (arr,1 ))) =
282
- Pl_derivatives_allmodes! (arr,x, lmax,0 )
282
+ Pl_derivatives_allmodes! (arr, x, lmax, 0 )
283
283
284
284
"""
285
285
Pl_dPl!(arr, x; [lmax = maximum(axes(arr,1))])
@@ -316,14 +316,15 @@ The optional keyword argument `lmax` may specify the range of ``l``'s to compute
316
316
It defaults to `lmax = maximum(axes(arr,1))`
317
317
"""
318
318
function dPl! (arr:: AbstractVector{<:Real} , x:: Real ; lmax:: Integer = maximum (axes (arr,1 )))
319
- P = zeros (axes (arr,1 ),0 : 1 )
319
+ P = zeros (axes (arr,1 ), 0 : 1 )
320
320
Pl_dPl_d2Pl! (P, x; lmax = lmax)
321
321
@views @. arr = P[:,1 ]
322
322
arr
323
323
end
324
324
325
325
function dPl! (arr:: AbstractMatrix{<:Real} , x:: Real ;
326
326
lmax:: Integer = maximum (axes (arr,1 )))
327
+
327
328
P = zeros (axes (arr,1 ),0 : 1 )
328
329
Pl_dPl_d2Pl! (P, x; lmax = lmax)
329
330
@views @. arr[:,1 ] = P[:,1 ]
0 commit comments