Skip to content

Commit ada3e7d

Browse files
committed
Improve error message
1 parent 52b8556 commit ada3e7d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/gaussjacobi.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ gaussjacobi(n::Number, a::Number, b::Number) =
44

55
function gaussjacobi(n::Int, a::Float64, b::Float64)
66
#GAUSS-JACOBI QUADRATURE NODES AND WEIGHTS
7-
if a == 0. && b == 0.
7+
if n < 0
8+
error("gaussjacobi($n,$a,$b) not defined: n must be positive.")
9+
elseif a == 0. && b == 0.
810
gausslegendre(n)
911
elseif a == -0.5 && b == -0.5
1012
gausschebyshev(n, 1)
@@ -27,7 +29,7 @@ function gaussjacobi(n::Int, a::Float64, b::Float64)
2729
elseif n <= 4000 && max(a,b)>=5.
2830
JacobiGW(n, a, b)
2931
else
30-
error("1st argument must be a positive integer.")
32+
error("gaussjacobi($n,$a,$b) is not implemented: n must be ≤ 4000 for max(a,b)≥5.")
3133
end
3234
end
3335

0 commit comments

Comments
 (0)