Skip to content

Commit 6d7f3a1

Browse files
committed
fixed fornberg for order 0
1 parent ec0a26d commit 6d7f3a1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/discretization/fornberg.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ function calculate_weights(order::Int, x0::T, x::AbstractVector) where T<:Real
5555
http://epubs.siam.org/doi/pdf/10.1137/S0036144596322507 - Modified Fornberg Algorithm
5656
=#
5757
_C = C[:,end]
58-
_C[div(N,2)+1] -= sum(_C)
58+
if order != 0
59+
_C[div(N,2)+1] -= sum(_C)
60+
end
5961
return _C
6062
end

0 commit comments

Comments
 (0)