Skip to content

Commit

Permalink
tweak mu to fix #30 (#31)
Browse files Browse the repository at this point in the history
* tweak mu to fix #30

* unit test for memory
  • Loading branch information
jamiecjx authored Sep 9, 2023
1 parent dbc28d2 commit 8640647
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/recurrence.jl
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ function backwardrecurrence!(K, A, B, C, z, nN::AbstractUnitRange, j...)
μ = min(abs(data[k,j...]/data[k-1,j...]), abs(data[k-1,j...]/data[k-2,j...]))
# data[k] * μ^M ≤ ε
# M ≥ log(ε/data[k])/log(μ)
N = ceil(Int, max(2N, min(maxiterations, log(eps(real(T))/100)/log(μ))))
N = ceil(Int, max(2N, min(maxiterations, log(eps(real(T))/100)/log+eps(real(T))))))
_growdata!(K, N, j...)
resize!(u, N)
data = K.data
Expand Down
6 changes: 6 additions & 0 deletions test/test_recurrence.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ using ClassicalOrthogonalPolynomials: recurrencecoefficients
@test r[1:1000] ξ.^(1:1000)
@test r[10_000] ξ.^(10_000) atol=3E-10
end

for z in (0.2567881003580743 - 0.33437737333561895im)
ξ = π * (z - (z-1) * (z+1))
r = RecurrenceArray(z, recurrencecoefficients(U), [ξ,2z*ξ-π])
@test sizeof(r.data) < 1000_000
end
end

@testset "RecurrenceMatrix" begin
Expand Down

0 comments on commit 8640647

Please sign in to comment.