Skip to content

Commit 6d5b44f

Browse files
committed
Change clenshaw!/horner! to mutate first argument
1 parent 368dcb9 commit 6d5b44f

File tree

3 files changed

+13
-18
lines changed

3 files changed

+13
-18
lines changed

Project.toml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "FastTransforms"
22
uuid = "057dd010-8810-581a-b7be-e3fc3b93f78c"
3-
version = "0.16.6"
3+
version = "0.17"
44

55
[deps]
66
AbstractFFTs = "621f4979-c628-5d54-868e-fcf4e3e8185c"
@@ -15,7 +15,6 @@ LazyArrays = "5078a376-72f3-5289-bfd5-ec5146d43c02"
1515
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
1616
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1717
RecurrenceRelationships = "807425ed-42ea-44d6-a357-6771516d7b2c"
18-
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
1918
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
2019
ToeplitzMatrices = "c751599d-da0a-543b-9d20-d0a503d91d24"
2120

@@ -29,8 +28,7 @@ FastTransforms_jll = "0.6.2"
2928
FillArrays = "0.9, 0.10, 0.11, 0.12, 0.13, 1"
3029
GenericFFT = "0.1"
3130
LazyArrays = "2.2"
32-
RecurrenceRelationships = "0.1"
33-
Reexport = "0.2, 1.0"
31+
RecurrenceRelationships = "0.2"
3432
SpecialFunctions = "0.10, 1, 2"
3533
ToeplitzMatrices = "0.7.1, 0.8"
3634
julia = "1.7"

src/FastTransforms.jl

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
module FastTransforms
22

33
using ArrayLayouts, BandedMatrices, FastGaussQuadrature, FillArrays, LazyArrays, LinearAlgebra,
4-
Reexport, SpecialFunctions, ToeplitzMatrices, RecurrenceRelationships
4+
SpecialFunctions, ToeplitzMatrices, RecurrenceRelationships
55

6-
@reexport using AbstractFFTs
7-
@reexport using FFTW
8-
@reexport using GenericFFT
6+
using AbstractFFTs
7+
using FFTW
8+
using GenericFFT
99

1010
import Base: convert, unsafe_convert, eltype, ndims, adjoint, transpose, show,
1111
*, \, inv, length, size, view, getindex, tail, OneTo
@@ -34,11 +34,8 @@ import LinearAlgebra: cholesky, issymmetric, isposdef, mul!, lmul!, ldiv!
3434

3535
import GenericFFT: interlace # imported in downstream packages
3636

37-
import RecurrenceRelationships: clenshaw!, check_clenshaw_recurrences
37+
import RecurrenceRelationships: check_clenshaw_recurrences
3838

39-
const _forwardrecurrence! = RecurrenceRelationships.forwardrecurrence!
40-
const _clenshaw_next = RecurrenceRelationships.clenshaw_next
41-
const _forwardrecurrence_next = RecurrenceRelationships.forwardrecurrence_next
4239

4340
export leg2cheb, cheb2leg, ultra2ultra, jac2jac,
4441
lag2lag, jac2ultra, ultra2jac, jac2cheb,

src/libfasttransforms.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ function renew!(x::AbstractArray{BigFloat})
4949
return x
5050
end
5151

52-
function horner!(c::StridedVector{Float64}, x::Vector{Float64}, f::Vector{Float64})
52+
function horner!(f::Vector{Float64}, c::StridedVector{Float64}, x::Vector{Float64})
5353
@assert length(x) == length(f)
5454
ccall((:ft_horner, libfasttransforms), Cvoid, (Cint, Ptr{Float64}, Cint, Cint, Ptr{Float64}, Ptr{Float64}), length(c), c, stride(c, 1), length(x), x, f)
5555
f
5656
end
5757

58-
function horner!(c::StridedVector{Float32}, x::Vector{Float32}, f::Vector{Float32})
58+
function horner!(f::Vector{Float32}, c::StridedVector{Float32}, x::Vector{Float32})
5959
@assert length(x) == length(f)
6060
ccall((:ft_hornerf, libfasttransforms), Cvoid, (Cint, Ptr{Float32}, Cint, Cint, Ptr{Float32}, Ptr{Float32}), length(c), c, stride(c, 1), length(x), x, f)
6161
f
@@ -69,27 +69,27 @@ function check_clenshaw_points(x, f)
6969
length(x) == length(f) || throw(ArgumentError("Dimensions must match"))
7070
end
7171

72-
function clenshaw!(c::StridedVector{Float64}, x::Vector{Float64}, f::Vector{Float64})
72+
function clenshaw!(f::Vector{Float64}, c::StridedVector{Float64}, x::Vector{Float64})
7373
@boundscheck check_clenshaw_points(x, f)
7474
ccall((:ft_clenshaw, libfasttransforms), Cvoid, (Cint, Ptr{Float64}, Cint, Cint, Ptr{Float64}, Ptr{Float64}), length(c), c, stride(c, 1), length(x), x, f)
7575
f
7676
end
7777

78-
function clenshaw!(c::StridedVector{Float32}, x::Vector{Float32}, f::Vector{Float32})
78+
function clenshaw!(f::Vector{Float32}, c::StridedVector{Float32}, x::Vector{Float32})
7979
@boundscheck check_clenshaw_points(x, f)
8080
ccall((:ft_clenshawf, libfasttransforms), Cvoid, (Cint, Ptr{Float32}, Cint, Cint, Ptr{Float32}, Ptr{Float32}), length(c), c, stride(c, 1), length(x), x, f)
8181
f
8282
end
8383

84-
function clenshaw!(c::StridedVector{Float64}, A::Vector{Float64}, B::Vector{Float64}, C::Vector{Float64}, x::Vector{Float64}, ϕ₀::Vector{Float64}, f::Vector{Float64})
84+
function clenshaw!(f::Vector{Float64}, c::StridedVector{Float64}, A::Vector{Float64}, B::Vector{Float64}, C::Vector{Float64}, x::Vector{Float64}, ϕ₀::Vector{Float64})
8585
N = length(c)
8686
@boundscheck check_clenshaw_recurrences(N, A, B, C)
8787
@boundscheck check_clenshaw_points(x, ϕ₀, f)
8888
ccall((:ft_orthogonal_polynomial_clenshaw, libfasttransforms), Cvoid, (Cint, Ptr{Float64}, Cint, Ptr{Float64}, Ptr{Float64}, Ptr{Float64}, Cint, Ptr{Float64}, Ptr{Float64}, Ptr{Float64}), N, c, stride(c, 1), A, B, C, length(x), x, ϕ₀, f)
8989
f
9090
end
9191

92-
function clenshaw!(c::StridedVector{Float32}, A::Vector{Float32}, B::Vector{Float32}, C::Vector{Float32}, x::Vector{Float32}, ϕ₀::Vector{Float32}, f::Vector{Float32})
92+
function clenshaw!(f::Vector{Float32}, c::StridedVector{Float32}, A::Vector{Float32}, B::Vector{Float32}, C::Vector{Float32}, x::Vector{Float32}, ϕ₀::Vector{Float32})
9393
N = length(c)
9494
@boundscheck check_clenshaw_recurrences(N, A, B, C)
9595
@boundscheck check_clenshaw_points(x, ϕ₀, f)

0 commit comments

Comments
 (0)