@@ -102,10 +102,12 @@ function weightedindexes(parts::Vararg{Union{Int,GradParts},N}) where N
102102 slot_substitute (parts, map (positions, parts), map (valuecoefs, parts), map (gradcoefs, parts))
103103end
104104
105- # Skip over NoInterp dimensions
106- slot_substitute (kind:: Tuple{Int,Vararg{Any}} , p, v, g) = slot_substitute (Base. tail (kind), p, v, g)
107105# Substitute the dth dimension's gradient coefs for the remaining coefs
108- slot_substitute (kind, p, v, g) = (map (maybe_weightedindex, p, substitute_ruled (v, kind, g)), slot_substitute (Base. tail (kind), p, v, g)... )
106+ function slot_substitute (kind, p, v, g)
107+ rest = slot_substitute (Base. tail (kind), p, v, g)
108+ kind[1 ] isa Int && return rest # Skip over NoInterp dimensions
109+ (map (maybe_weightedindex, p, substitute_ruled (v, kind, g)), rest... )
110+ end
109111# Termination
110112slot_substitute (kind:: Tuple{} , p, v, g) = ()
111113
@@ -132,15 +134,14 @@ function _column(kind1::K, kind2::K, p, v, g, h) where {K<:Tuple}
132134 ss = substitute_ruled (v, kind1, h)
133135 (map (maybe_weightedindex, p, ss), _column (Base. tail (kind1), kind2, p, v, g, h)... )
134136end
137+ _column (kind1:: K , kind2:: K , p, v, g, h) where {K<: Tuple{Int,Vararg} } = () # Skip over NoInterp dimensions
135138function _column (kind1:: Tuple , kind2:: Tuple , p, v, g, h)
139+ rest = _column (Base. tail (kind1), kind2, p, v, g, h)
140+ kind1[1 ] isa Int && return rest # Skip over NoInterp dimensions
136141 ss = substitute_ruled (substitute_ruled (v, kind1, g), kind2, g)
137- (map (maybe_weightedindex, p, ss), _column (Base . tail (kind1), kind2, p, v, g, h) ... )
142+ (map (maybe_weightedindex, p, ss), rest ... )
138143end
139144_column (:: Tuple{} , :: Tuple , p, v, g, h) = ()
140- # Skip over NoInterp dimensions
141- slot_substitute (kind:: Tuple{Int,Vararg{Any}} , p, v, g, h) = slot_substitute (Base. tail (kind), p, v, g, h)
142- _column (kind1:: Tuple{Int,Vararg{Any}} , kind2:: Tuple , p, v, g, h) =
143- _column (Base. tail (kind1), kind2, p, v, g, h)
144145
145146weightedindex_parts (fs:: F , itpflag:: BSpline , ax, x) where F =
146147 weightedindex_parts (fs, degree (itpflag), ax, x)
0 commit comments