Skip to content

Commit a08c90a

Browse files
mul! -> lmul!
1 parent 87530a6 commit a08c90a

File tree

1 file changed

+9
-21
lines changed

1 file changed

+9
-21
lines changed

src/libfasttransforms.jl

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -324,42 +324,30 @@ function plan_fmm_leg2cheb(::Type{Float64}, n::Integer)
324324
M = 18
325325
BOTH = 2
326326
lagrange = 0
327-
verbose = 2
327+
verbose = 0
328328
plan = ccall((:ft_create_fmm, libfasttransforms), Ptr{ft_plan_struct}, (Cint, Cint, Cint, Cint, Cint, Cint), n, maxs, M, BOTH, lagrange, verbose)
329329
return FTPlan{Float64, 1, FMMLEG2CHEB}(plan, n)
330330
end
331331

332-
function mul!(y::StridedVector{Float64}, p::FTPlan{Float64, 1, FMMLEG2CHEB}, x::StridedVector{Float64})
332+
function lmul!(p::FTPlan{Float64, 1, FMMLEG2CHEB}, x::StridedVector{Float64})
333333
checksize(p, x)
334-
checksize(p, y)
335334
checkstride(p, x)
336-
checkstride(p, y)
335+
y = zero(x)
337336
L2C = 0
338337
flops = ccall((:ft_execute, libfasttransforms), Cint, (Ptr{Float64}, Ptr{Float64}, Ptr{ft_plan_struct}, Cint, Cint), x, y, p, L2C, 1)
339-
return y
338+
x .= y
339+
return x
340340
end
341-
function div!(y::StridedVector{Float64}, p::FTPlan{Float64, 1, FMMLEG2CHEB}, x::StridedVector{Float64})
341+
function ldiv!(p::FTPlan{Float64, 1, FMMLEG2CHEB}, x::StridedVector{Float64})
342342
checksize(p, x)
343-
checksize(p, y)
344343
checkstride(p, x)
345-
checkstride(p, y)
344+
y = zero(x)
346345
C2L = 1
347346
flops = ccall((:ft_execute, libfasttransforms), Cint, (Ptr{Float64}, Ptr{Float64}, Ptr{ft_plan_struct}, Cint, Cint), x, y, p, C2L, 1)
348-
return y
349-
end
350-
351-
function *(p::FTPlan{T, 1, FMMLEG2CHEB}, x::AbstractArray{T}) where T
352-
Ax = Array(x)
353-
y = zero(Ax)
354-
mul!(y, p, Ax)
355-
end
356-
function \(p::FTPlan{T, 1, FMMLEG2CHEB}, x::AbstractArray{T}) where T
357-
Ax = Array(x)
358-
y = zero(Ax)
359-
div!(y, p, Ax)
347+
x .= y
348+
return x
360349
end
361350

362-
363351
struct AdjointFTPlan{T, S, R}
364352
parent::S
365353
adjoint::R

0 commit comments

Comments
 (0)