Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing promotion in gaussjacobi for integer α, β #117

Closed
stevengj opened this issue Mar 24, 2023 · 2 comments · Fixed by #119
Closed

missing promotion in gaussjacobi for integer α, β #117

stevengj opened this issue Mar 24, 2023 · 2 comments · Fixed by #119

Comments

@stevengj
Copy link
Contributor

This works:

julia> gaussjacobi(500, 0.0, -1/2);

but changing 0.0 to an Int gives an error, probably indicating a missing call to float(α) or similar:

julia> gaussjacobi(500, 0, -1/2)
ERROR: MethodError: no method matching asy1(::Int64, ::Int64, ::Float64, ::Int64)
Closest candidates are:
  asy1(::Integer, ::Float64, ::Float64, ::Integer) at ~/.julia/packages/FastGaussQuadrature/BRLTf/src/gaussjacobi.jl:200
Stacktrace:
 [1] jacobi_asy(n::Int64, α::Int64, β::Float64)
   @ FastGaussQuadrature ~/.julia/packages/FastGaussQuadrature/BRLTf/src/gaussjacobi.jl:183
 [2] gaussjacobi(n::Int64, α::Int64, β::Float64)
   @ FastGaussQuadrature ~/.julia/packages/FastGaussQuadrature/BRLTf/src/gaussjacobi.jl:45
 [3] top-level scope
   @ REPL[98]:1
@dlfivefifty
Copy link
Member

jacobi_asy should be restricted to Float64 as the choice of boundary terms is precision dependent:

function jacobi_asy(n, α, β)

It would be easy to add a promote for the case of differing types of course.

@stevengj
Copy link
Contributor Author

Maybe promote(float(α), float(β))... since passing integers should be allowed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants