Closed AshtonSBradley closed 5 years ago
to get the readme examples going I replaced interpolationmatrix
with (only differs in lines 3,6):
function interpolationmatrix(w::BarycentricWeights{N, T}, x::AbstractVector{T}) where {N, T}
# Eq. (4.2)
xdiff = Matrix{T}(undef,length(x), N)
xdiff .= x .- w.x'
M = w.w' ./ xdiff
Msum = sum(M, dims=2)
for i ∈ 1:size(M, 2)
for j ∈ 1:size(M, 1)
if Msum[j] == 0
M[j, i] = 0
elseif xdiff[j, i] == 0
M[j, i] = 1
else
M[j, i] /= Msum[j]
end
end
end
return M
end
also note in the first readme example there is minor misprint, last line should read
interpolationmatrix(w, x)*y₀ ≈ sin.(pi*x)
Thanks for your comments. I was actually in the process of a complete overhaul for Julia v1.0 - try it out now and hopefully you'll find it significantly faster.
thanks for the cool package. I found that if I update line 112 of
/src/Barycentric.jl
tothat is, adding spaces around
./
, thenusing Barycentric
works.