You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
broadcasted(::LazyQuasiArrayStyle{1}, ::typeof(Base.literal_pow), ::Base.RefValue{typeof(^)}, w::AbstractJacobiWeight, ::Base.RefValue{Val{k}}) where k =
13
+
broadcasted(::LazyQuasiArrayStyle{1}, ::typeof(Base.literal_pow), ::Base.RefValue{typeof(^)}, w::AbstractJacobiWeight, ::Base.RefValue{Val{k}}) where k =
14
14
JacobiWeight(k * w.a, k * w.b)
15
15
16
16
struct JacobiWeight{T} <:AbstractJacobiWeight{T}
@@ -136,7 +136,7 @@ Jacobi(P::Legendre{T}) where T = Jacobi(zero(T), zero(T))
136
136
"""
137
137
jacobip(n, a, b, z)
138
138
139
-
computes the `n`-th Jacobi polynomial, orthogonal with
139
+
computes the `n`-th Jacobi polynomial, orthogonal with
140
140
respec to `(1-x)^a*(1+x)^b`, at `z`.
141
141
"""
142
142
jacobip(n::Integer, a, b, z::Number) = Base.unsafe_getindex(Jacobi{promote_type(typeof(a), typeof(b), typeof(z))}(a,b), z, n+1)
@@ -237,25 +237,40 @@ end
237
237
# Mass Matrix
238
238
#########
239
239
240
-
legendre_massmatrix(::Type{T}) where T =Diagonal(convert(T,2) ./ (2(0:∞) .+1))
240
+
# massmatrix(P) = Weighted(P)'P
241
+
massmatrix(P::Legendre{T}) where T =Diagonal(convert(T,2) ./ (2(0:∞) .+1))
241
242
243
+
244
+
245
+
"""
246
+
legendre_massmatrix
247
+
248
+
computes the massmatrix by first re-expanding in Legendre
249
+
"""
242
250
functionlegendre_massmatrix(Ac, B)
243
251
A =parent(Ac)
244
252
P =Legendre{eltype(B)}()
245
-
(P\A)'*legendre_massmatrix(eltype(P))*(P\B)
253
+
(P\A)'*massmatrix(P)*(P\B)
246
254
end
247
255
248
-
@simplify*(Ac::QuasiAdjoint{<:Any,<:Legendre}, B::Legendre) =legendre_massmatrix(Ac, B)
Copy file name to clipboardExpand all lines: src/clenshaw.jl
+17-6Lines changed: 17 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -133,7 +133,9 @@ Base.@propagate_inbounds function _clenshaw_next!(n, A::AbstractVector, ::Zeros,
133
133
end
134
134
135
135
Base.@propagate_inboundsfunction_clenshaw_next!(n, A::AbstractVector, B::AbstractVector, C::AbstractVector, x::AbstractMatrix, c, bn1::AbstractMatrix{T}, bn2::AbstractMatrix{T}) where T
0 commit comments