Skip to content

Commit 8193865

Browse files
authored
Merge pull request #194 from rdeits/broadcast
replace map_repeat with regular broadcasting
2 parents 839c1d3 + 42c0e27 commit 8193865

File tree

1 file changed

+1
-23
lines changed

1 file changed

+1
-23
lines changed

src/b-splines/b-splines.jl

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ function size(itp::BSplineInterpolation{T,N,TCoefs,IT,GT,pad}, d) where {T,N,TCo
6363
end
6464

6565
@inline indices(itp::BSplineInterpolation{T,N,TCoefs,IT,GT,pad}) where {T,N,TCoefs,IT,GT,pad} =
66-
map_repeat(indices_removepad, indices(itp.coefs), pad)
66+
indices_removepad.(indices(itp.coefs), pad)
6767

6868
function indices(itp::BSplineInterpolation{T,N,TCoefs,IT,GT,pad}, d) where {T,N,TCoefs,IT,GT,pad}
6969
d <= N ? indices_removepad(indices(itp.coefs, d), padextract(pad, d)) : indices(itp.coefs, d)
@@ -106,28 +106,6 @@ offsetsym(off, d) = off == -1 ? Symbol("ixm_", d) :
106106
@inline indices_addpad(inds, pad) = oftype(inds, first(inds):last(inds) + 2*pad)
107107
@inline indices_interior(inds, pad) = first(inds)+pad:last(inds)-pad
108108

109-
"""
110-
map_repeat(f, a, b)
111-
112-
Equivalent to `(f(a[1], b[1]), f(a[2], b[2]), ...)` if `a` and `b` are
113-
tuples of the same lengths, or `(f(a[1], b), f(a[2], b), ...)` if `b`
114-
is a scalar.
115-
"""
116-
@generated function map_repeat(f, a::NTuple{N,Any}, b::NTuple{N,Any}) where N
117-
ex = [:(f(a[$i], b[$i])) for i = 1:N]
118-
quote
119-
$(Expr(:meta, :inline))
120-
($(ex...),)
121-
end
122-
end
123-
@generated function map_repeat(f, a::NTuple{N,Any}, b) where N
124-
ex = [:(f(a[$i], b)) for i = 1:N]
125-
quote
126-
$(Expr(:meta, :inline))
127-
($(ex...),)
128-
end
129-
end
130-
131109
include("constant.jl")
132110
include("linear.jl")
133111
include("quadratic.jl")

0 commit comments

Comments
 (0)