Skip to content

Commit

Permalink
Fix Gauss Chebyshev Deprecation Error (#329)
Browse files Browse the repository at this point in the history
  • Loading branch information
pulsipher authored Oct 31, 2023
1 parent 1ffe332 commit 372d62f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
10 changes: 9 additions & 1 deletion src/MeasureToolbox/integrals.jl
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,15 @@ end

# Gauss-Chebyshev
function _make_nodes_weights(method::GaussChebyshev, num_nodes::Int)
return FastGaussQuadrature.gausschebyshev(num_nodes, method.order)
if method.order == 1
return FastGaussQuadrature.gausschebyshevt(num_nodes)
elseif method.order == 2
return FastGaussQuadrature.gausschebyshevu(num_nodes)
elseif method.order == 3
return FastGaussQuadrature.gausschebyshevv(num_nodes)
else
return FastGaussQuadrature.gausschebyshevw(num_nodes)
end
end

# Gauss-Jacobi
Expand Down
5 changes: 4 additions & 1 deletion test/MeasureToolbox/integrals.jl
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@
# test generate_integral_data (Gauss-Chebyshev)
@testset "generate_integral_data (Gauss-Chebyshev)" begin
@test generate_integral_data(t, 0, 1, GaussChebyshev(3)) isa DiscreteMeasureData
@test generate_integral_data(t, 0, 1, GaussChebyshev(3)).coefficients == FastGaussQuadrature.gausschebyshev(3, 3)[2] * 1/2
@test generate_integral_data(t, 0, 1, GaussChebyshev(3)).coefficients == FastGaussQuadrature.gausschebyshevv(3)[2] * 1/2
@test generate_integral_data(t, 0, 1, GaussChebyshev(1)).coefficients == FastGaussQuadrature.gausschebyshevt(3)[2] * 1/2
@test generate_integral_data(t, 0, 1, GaussChebyshev(2)).coefficients == FastGaussQuadrature.gausschebyshevu(3)[2] * 1/2
@test generate_integral_data(t, 0, 1, GaussChebyshev(4)).coefficients == FastGaussQuadrature.gausschebyshevw(3)[2] * 1/2
@test_throws ErrorException GaussChebyshev(5)
end
# test generate_integral_data (Gauss-Laguerre)
Expand Down

0 comments on commit 372d62f

Please sign in to comment.