Skip to content

Commit 485dd5c

Browse files
committed
Overload _getindex instead of getindex for orthogonal polynomials
1 parent 9fff7da commit 485dd5c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/clenshaw.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ function copyto!(dest::AbstractVector, V::SubArray{<:Any,1,<:OrthogonalPolynomia
5151
dest
5252
end
5353

54-
getindex(P::OrthogonalPolynomial, x::Number, n::AbstractVector) = layout_getindex(P, x, n)
55-
getindex(P::OrthogonalPolynomial, x::AbstractVector, n::AbstractVector) = layout_getindex(P, x, n)
56-
getindex(P::SubArray{<:Any,1,<:OrthogonalPolynomial}, x::AbstractVector) = layout_getindex(P, x)
57-
Base.@propagate_inbounds function getindex(P::OrthogonalPolynomial, x::Number, n::Number)
54+
_getindex(::Type{Tuple{IND1,IND2}}, P::OrthogonalPolynomial, (x,n)::Tuple{IND1,AbstractVector{IND2}}) where {IND1,IND2} = layout_getindex(P, x, n)
55+
_getindex(::Type{Tuple{IND1,IND2}}, P::OrthogonalPolynomial, (x,n)::Tuple{AbstractVector{IND1},AbstractVector{IND2}}) where {IND1,IND2} = layout_getindex(P, x, n)
56+
_getindex(::Type{Tuple{IND1}}, P::SubArray{<:Any,1,<:OrthogonalPolynomial}, x::AbstractVector{IND1}) where {IND1} = layout_getindex(P, x)
57+
Base.@propagate_inbounds function _getindex(::Type{IND}, P::OrthogonalPolynomial, (x,n)::IND) where IND
5858
@boundscheck checkbounds(P, x, n)
5959
Base.unsafe_getindex(P, x, n)
6060
end

0 commit comments

Comments
 (0)