Skip to content

Commit fd5d065

Browse files
committed
Update jacobi.jl
1 parent 36a346a commit fd5d065

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/classical/jacobi.jl

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,9 @@ end
292292
# the type specification is also because LazyArrays.jl is slow otherwise
293293
# getindex and print could be very slow. This needs to be fixed by LazyArrays.jl
294294
function _jacobi_convert_a(a, b, k, T) # Jacobi(a+k, b) \ Jacobi(a, b)
295+
j = round(k)
296+
@assert j k
297+
k = Integer(j)
295298
if iszero(k)
296299
Eye{T}(∞)
297300
elseif isone(k)
@@ -302,6 +305,9 @@ function _jacobi_convert_a(a, b, k, T) # Jacobi(a+k, b) \ Jacobi(a, b)
302305
end
303306
end
304307
function _jacobi_convert_b(a, b, k, T) # Jacobi(a, b+k) \ Jacobi(a, b)
308+
j = round(k)
309+
@assert j k
310+
k = Integer(j)
305311
if iszero(k)
306312
Eye{T}(∞)
307313
elseif isone(k)
@@ -329,8 +335,8 @@ function \(A::Jacobi, B::Jacobi)
329335
T = promote_type(eltype(A), eltype(B))
330336
aa, ab = A.a, A.b
331337
ba, bb = B.a, B.b
332-
ka = _approx_integer(aa-ba)
333-
kb = _approx_integer(ab-bb)
338+
ka = aa - ba
339+
kb = ab - bb
334340
if ka >= 0
335341
C1 = _jacobi_convert_a(ba, ab, ka, T)
336342
if kb >= 0
@@ -345,6 +351,7 @@ function \(A::Jacobi, B::Jacobi)
345351
else
346352
list = (C1, C2)
347353
ApplyArray{T,2,typeof(*),typeof(list)}(*, list)
354+
C1 * C2
348355
end
349356
else
350357
inv(B \ A)

0 commit comments

Comments
 (0)