Skip to content

Commit bebae94

Browse files
authored
Comment out @debug statements (#150)
Profiling reveals that there is a lot of overhead from them even at the default logging level. Hopefully that will improve over time. For now, users would have to uncomment these lines before debugging.
1 parent 55a38e6 commit bebae94

File tree

3 files changed

+28
-28
lines changed

3 files changed

+28
-28
lines changed

src/eigenGeneral.jl

+7-7
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ function _schur!(
104104

105105
@inbounds while true
106106
i += 1
107-
@debug "iteration" i
107+
# @debug "iteration" i
108108
if i > maxiter
109109
throw(ArgumentError("iteration limit $maxiter reached"))
110110
end
@@ -118,7 +118,7 @@ function _schur!(
118118
# Set istart to the beginning of the second block
119119
istart = _istart + 1
120120

121-
@debug "Split!" HH[istart, istart-1] istart
121+
# @debug "Split!" HH[istart, istart-1] istart
122122

123123
# Set the subdiagonal element to zero to signal that a split has taken place
124124
HH[istart, istart-1] = 0
@@ -131,12 +131,12 @@ function _schur!(
131131

132132
# if block size is one we deflate
133133
if istart >= iend
134-
@debug "Bottom deflation! Block size is one. New iend is" iend - 1
134+
# @debug "Bottom deflation! Block size is one. New iend is" iend - 1
135135
iend -= 1
136136

137137
# and the same for a 2x2 block
138138
elseif istart + 1 == iend
139-
@debug "Bottom deflation! Block size is two. New iend is" iend - 2
139+
# @debug "Bottom deflation! Block size is two. New iend is" iend - 2
140140
iend -= 2
141141

142142
# run a QR iteration
@@ -153,14 +153,14 @@ function _schur!(
153153
d = Hm1m1 * Hmm - HH[iend, iend-1] * HH[iend-1, iend]
154154
t = Hm1m1 + Hmm
155155
end
156-
@debug "block start is, block end, d, and t" istart iend d t
156+
# @debug "block start is, block end, d, and t" istart iend d t
157157

158158
if shiftmethod == :Francis
159-
@debug "Francis double shift!" HH[iend, iend-1] HH[iend-1, iend-2]
159+
# @debug "Francis double shift!" HH[iend, iend-1] HH[iend-1, iend-2]
160160

161161
doubleShiftQR!(HH, τ, t, d, istart, iend)
162162
elseif shiftmethod == :Rayleigh
163-
@debug "Single shift with Rayleigh shift!" HH[iend, iend-1]
163+
# @debug "Single shift with Rayleigh shift!" HH[iend, iend-1]
164164

165165
# Run a bulge chase
166166
singleShiftQR!(HH, τ, Hmm, istart, iend)

src/eigenSelfAdjoint.jl

+18-18
Original file line numberDiff line numberDiff line change
@@ -183,33 +183,33 @@ function eigvalsPWK!(S::SymTridiagonal{T}; tol = eps(T), sortby::Union{Function,
183183
blockend = n
184184
end
185185

186-
@debug "submatrix" blockstart blockend
186+
# @debug "submatrix" blockstart blockend
187187

188188
# Deflate?
189189
if blockstart == blockend
190-
@debug "Deflate? Yes!"
190+
# @debug "Deflate? Yes!"
191191
blockstart += 1
192192
elseif blockstart + 1 == blockend
193-
@debug "Defalte? Yes, but after solving 2x2 block!"
193+
# @debug "Defalte? Yes, but after solving 2x2 block!"
194194
d[blockstart], d[blockend] =
195195
eigvals2x2(d[blockstart], d[blockend], sqrt(e[blockstart]))
196196
e[blockstart] = zero(T)
197197
blockstart += 1
198198
else
199-
@debug "Deflate? No!"
199+
# @debug "Deflate? No!"
200200
# Calculate shift
201201
sqrte = sqrt(e[blockstart])
202202
μ = (d[blockstart+1] - d[blockstart]) / (2 * sqrte)
203203
r = hypot(μ, one(T))
204204
μ = d[blockstart] - sqrte /+ copysign(r, μ))
205205

206206
# QL bulk chase
207-
@debug "Values before PWK QL bulge chase" e[blockstart] e[blockend-1] μ
207+
# @debug "Values before PWK QL bulge chase" e[blockstart] e[blockend-1] μ
208208
singleShiftQLPWK!(S, μ, blockstart, blockend)
209209

210210
rotations = blockend - blockstart
211211
iter += rotations
212-
@debug "Values after PWK QL bulge chase" e[blockstart] e[blockend-1] rotations
212+
# @debug "Values after PWK QL bulge chase" e[blockstart] e[blockend-1] rotations
213213
end
214214
if blockstart >= n
215215
break
@@ -259,27 +259,27 @@ function eigQL!(
259259
blockend = n
260260
end
261261

262-
@debug "submatrix" blockstart blockend
262+
# @debug "submatrix" blockstart blockend
263263

264264
# Deflate?
265265
if blockstart == blockend
266-
@debug "Deflate? Yes!"
266+
# @debug "Deflate? Yes!"
267267
blockstart += 1
268268
elseif blockstart + 1 == blockend
269-
@debug "Deflate? Yes, but after solving 2x2 block"
269+
# @debug "Deflate? Yes, but after solving 2x2 block"
270270
eig2x2!(d, e, blockstart, vectors)
271271
blockstart += 2
272272
else
273-
@debug "Deflate? No!"
273+
# @debug "Deflate? No!"
274274
# Calculate shift
275275
μ = (d[blockstart + 1] - d[blockstart]) / (2 * e[blockstart])
276276
r = hypot(μ, one(T))
277277
μ = d[blockstart] - (e[blockstart] /+ copysign(r, μ)))
278278

279279
# QL bulk chase
280-
@debug "Values before bulge chase" e[blockstart] e[blockend - 1] d[blockstart] μ
280+
# @debug "Values before bulge chase" e[blockstart] e[blockend - 1] d[blockstart] μ
281281
singleShiftQL!(S, μ, blockstart, blockend, vectors)
282-
@debug "Values after bulge chase" e[blockstart] e[blockend - 1] d[blockstart]
282+
# @debug "Values after bulge chase" e[blockstart] e[blockend - 1] d[blockstart]
283283
end
284284

285285
if blockstart >= n
@@ -312,27 +312,27 @@ function eigQR!(
312312
blockend = n
313313
end
314314

315-
@debug "submatrix" blockstart blockend
315+
# @debug "submatrix" blockstart blockend
316316

317317
# Deflate?
318318
if blockstart == blockend
319-
@debug "Deflate? Yes!"
319+
# @debug "Deflate? Yes!"
320320
blockstart += 1
321321
elseif blockstart + 1 == blockend
322-
@debug "Deflate? Yes, but after solving 2x2 block!"
322+
# @debug "Deflate? Yes, but after solving 2x2 block!"
323323
eig2x2!(d, e, blockstart, vectors)
324324
blockstart += 2
325325
else
326-
@debug "Deflate? No!"
326+
# @debug "Deflate? No!"
327327
# Calculate shift
328328
μ = (d[blockend - 1] - d[blockend]) / (2 * e[blockend - 1])
329329
r = hypot(μ, one(T))
330330
μ = d[blockend] - (e[blockend - 1] /+ copysign(r, μ)))
331331

332332
# QR bulk chase
333-
@debug "Values before QR bulge chase" e[blockstart] e[blockend - 1] d[blockend] μ
333+
# @debug "Values before QR bulge chase" e[blockstart] e[blockend - 1] d[blockend] μ
334334
singleShiftQR!(S, μ, blockstart, blockend, vectors)
335-
@debug "Values after QR bulge chase" e[blockstart] e[blockend - 1] d[blockend]
335+
# @debug "Values after QR bulge chase" e[blockstart] e[blockend - 1] d[blockend]
336336
end
337337
if blockstart >= n
338338
break

src/svd.jl

+3-3
Original file line numberDiff line numberDiff line change
@@ -200,14 +200,14 @@ function __svd!(
200200
break
201201
end
202202
end
203-
@debug "Active submatrix" iteration n1 n2 d[n1] d[n2] e[n1] e[n2 - 1]
203+
# @debug "Active submatrix" iteration n1 n2 d[n1] d[n2] e[n1] e[n2 - 1]
204204

205205
# Deflation check. See LAWN3 p21
206206
# The Demmel-Kahan iteration moves the zero to the end and produces a
207207
# zero super diagonal element as well
208208
for i = n1:n2
209209
if d[i] == 0
210-
@debug "Deflation! Exact zero in diagonal element" i
210+
# @debug "Deflation! Exact zero in diagonal element" i
211211
svdDemmelKahan!(B, n1, n2, U, Vᴴ)
212212

213213
# We have now moved a zero to the end so the problem is one smaller
@@ -230,7 +230,7 @@ function __svd!(
230230
fudge = n2 - n1 + 1
231231
thresh = tol * σ⁻
232232

233-
@debug "estimated quantities" σ⁻ σ⁺ fudge thresh
233+
# @debug "estimated quantities" σ⁻ σ⁺ fudge thresh
234234

235235
if fudge * tol * σ⁻ <= eps(σ⁺)
236236
svdDemmelKahan!(B, n1, n2, U, Vᴴ)

0 commit comments

Comments
 (0)