You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
julia> using NumericalIntegration
julia> x = range(-π, π, length=50)
-3.141592653589793:0.1282282715750936:3.141592653589793
julia> typeof(x)
StepRangeLen{Float64,Base.TwicePrecision{Float64},Base.TwicePrecision{Float64}}
julia> y = sin.(x);
julia> ω = [xᵢ * yᵢ for xᵢ in x, yᵢ in y];
julia> res = integrate((x, y), ω)
julia> typeof(res)
Nothing
The current code also treats StepRangeLen in a different way than Array, although it seems not to be working as well (but for a different reason?):
julia> x = collect(range(-π, π, length=50));
julia> typeof(x)
Array{Float64,1}
julia> y = sin.(x);
julia> ω = [xᵢ * yᵢ for xᵢ in x, yᵢ in y];
julia> res = integrate((x, y), ω)
ERROR: knot-vectors must be sorted in increasing order
Stacktrace:
[1] error(::String) at ./error.jl:33
[2] check_gridded at /home/schneider/.julia/packages/Interpolations/qHlUr/src/gridded/gridded.jl:51 [inlined]
[3] check_gridded at /home/schneider/.julia/packages/Interpolations/qHlUr/src/gridded/gridded.jl:52 [inlined]
[4] Interpolations.GriddedInterpolation(::Type{Float64}, ::Tuple{Array{Float64,1},Array{Float64,1}}, ::Array{Float64,2}, ::Interpolations.Gridded{Interpolations.Linear}) at /home/schneider/.julia/packages/Interpolations/qHlUr/src/gridded/gridded.jl:32
[5] interpolate(::Type{Float64}, ::Type{Float64}, ::Tuple{Array{Float64,1},Array{Float64,1}}, ::Array{Float64,2}, ::Interpolations.Gridded{Interpolations.Linear}) at /home/schneider/.julia/packages/Interpolations/qHlUr/src/gridded/gridded.jl:66
[6] interpolate at /home/schneider/.julia/packages/Interpolations/qHlUr/src/gridded/gridded.jl:83 [inlined]
[7] #LinearInterpolation#52 at /home/schneider/.julia/packages/Interpolations/qHlUr/src/convenience-constructors.jl:16 [inlined]
[8] LinearInterpolation at /home/schneider/.julia/packages/Interpolations/qHlUr/src/convenience-constructors.jl:16 [inlined]
[9] integrate(::Tuple{Array{Float64,1},Array{Float64,1}}, ::Array{Float64,2}, ::TrapezoidalFast) at /home/schneider/.julia/packages/NumericalIntegration/JrtZK/src/NumericalIntegration.jl:210
[10] integrate at /home/schneider/.julia/packages/NumericalIntegration/JrtZK/src/NumericalIntegration.jl:203 [inlined]
[11] integrate(::Tuple{Array{Float64,1},Array{Float64,1}}, ::Array{Float64,2}) at /home/schneider/.julia/packages/NumericalIntegration/JrtZK/src/NumericalIntegration.jl:339
[12] top-level scope at REPL[41]:1
I'm using the latest version of the package:
julia> versioninfo()
Julia Version 1.4.1
Platform Info:
OS: Linux (x86_64-linux-gnu)
CPU: AMD Ryzen 5 1600 Six-Core Processor
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-8.0.1 (ORCJIT, znver1)
Environment:
JULIA_NUM_THREADS = 12
(@v1.4) pkg> st NumericalIntegration
Status `~/.julia/environments/v1.4/Project.toml`
[e7bfaba1] NumericalIntegration v0.3.2
The text was updated successfully, but these errors were encountered:
There is a typo in the README. For the multidimensional example x needs to be redefined to go from -π/2 to π/2 (so that sin(x) is in increasing order from -1 to 1). This fixes the second issue but I will need to look into the first issue. It is mostly likely due to a dispatch error.
Hi,
The following example (from the README file) is not working:
The current code also treats
StepRangeLen
in a different way thanArray
, although it seems not to be working as well (but for a different reason?):I'm using the latest version of the package:
The text was updated successfully, but these errors were encountered: