Skip to content

Commit 4e23613

Browse files
committed
Fix tests
1 parent a7f6b9e commit 4e23613

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

src/MultivariateSingularIntegrals.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,10 @@ function rec_rhs_1!(F::AbstractMatrix{T}, z) where T
7474
πT = convert(T, π)
7575
if x < -1 && -1 < y < 1
7676
C_y = Ultraspherical{T}(-1/2)[y,2:n+1]
77-
F[1,:] .-= (4im*πT * x) .* C_y
77+
F[1,:] .= (-4im*πT * x) .* C_y
7878
elseif x < 1 && -1 < y < 1
7979
C_y = Ultraspherical{T}(-1/2)[y,2:n+1]
80-
F[1,:] .-= (2im*πT * (x-1)) .* C_y
80+
F[1,:] .= (-2im*πT * (x-1)) .* C_y
8181
end
8282

8383
F[1,1] += zlog(z-1-im) + zlogm(z-1+im) + zlog(z+1-im) + zlogm(z+1+im)
@@ -103,16 +103,16 @@ function rec_rhs_2!(F::AbstractMatrix{T}, z) where T
103103
if -1 < x < 1 && -1 y < 1
104104
C_x = Ultraspherical{T}(-3/2)[x,3:m+2]
105105
C_y = Ultraspherical{T}(-1/2)[y,2:n+1]
106-
F = (2im*πT) .* (C_x .* C_y') ./ 3
106+
F .= (2im*πT) .* (C_x .* C_y') ./ 3
107107
F[1,:] .-= (2im*πT) .* x .* C_y
108108
F[2,:] .+= (2im*πT/3) .* C_y
109109
elseif x -1 && -1 y < 1
110-
F = zeros(T,m,n)
110+
fill!(F, zero(T))
111111
C_y = Ultraspherical{T}(-1/2)[y,2:n+1]
112112
F[1,:] .= (-4im*πT) .* x .* C_y
113113
F[2,:] .= (4im*πT/3) .* C_y
114114
else
115-
F = zeros(T,m,n)
115+
fill!(F, zero(T))
116116
end
117117

118118
L₋ = complexlogkernel(Legendre{T}(), z-im)[1:m+1]
@@ -167,8 +167,8 @@ function logkernelsquare!(A::AbstractMatrix{T}, z, F_1, F_2) where T
167167
logkernelsquare_populatefirstcolumn!(A, z, F_1, F_2)
168168
logkernelsquare_populatefirstrow!(A, z, F_1, F_2)
169169

170-
F = F_1 # reuse the memory
171-
F .= F_2 .- F_1
170+
# F = F_1 # reuse the memory
171+
F = F_2 .- F_1
172172

173173
# 2nd row/column
174174

test/runtests.jl

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ using MultivariateSingularIntegrals, QuadGK, ClassicalOrthogonalPolynomials, Tes
66
for z in Z
77
L = logkernelsquare(z,n)
88
for j = 0:n-1, k=0:n-j-1
9-
@show k,j
109
q = quadgk(s -> quadgk(t -> iszero(s+im*t) ? 0.0+0.0im : log(z-(s+im*t)) * legendrep(k,s) * legendrep(j,t), -1, 1, atol=1E-12)[1], -1, 1, atol=1E-12)[1]
1110
@test q L[k+1,j+1] atol=1E-10
1211
end
@@ -24,8 +23,8 @@ end
2423
end
2524
end
2625

27-
n = 4000
28-
z = 2.0
29-
@profview logkernelsquare(z, n)
26+
# n = 4000
27+
# z = 2.0
28+
# @profview logkernelsquare(z, n)
3029

31-
x = range(-1,1,n); @time log.(abs.(x .+ im .* x'));
30+
# x = range(-1,1,n); @time log.(abs.(x .+ im .* x'));

0 commit comments

Comments
 (0)