robertdj / sparsegrids.jl Goto Github PK
View Code? Open in Web Editor NEWSparse grid quadrature in Julia
License: MIT License
Sparse grid quadrature in Julia
License: MIT License
@JuliaRegistrator register
Hi,
I've just installed the package in a new 1.9 environment and tried using the function tensorgrid
but it returns a MethodError
. A minimal working example is
using SparseGrids, FastGaussQuadrature
Nt, Wt = tensorgrid(2, 4, gausslegendre)
which produces the following error
ERROR: MethodError: objects of type Vector{Vector{Float64}} are not callable
Use square brackets [] for indexing an Array.
If I instead use the sparsegrid
method with the same syntax, everything's fine:
n,w = sparsegrid(2,4,gausslegendre)
produces the correct output.
I've dived a bit into the code and discovered that the code line where tensorW
is defined raises the Error. I don't know what the correct output should be, so I couldn't discover much at the moment.
This issue also arises if using julia 1.7 or 1.5 in new environments. Note that I haven't tested every Julia version, I just chose those two.
Best regards,
pmc4
Ps.: Could you please add the bug label to the issue? The option is disabled for me.
Something seems buggy with the internal package management "using" and "include" (at least on my El Capitan Mac with Julia 0.4.6)
SparseGrids does not seem to locate the "kpn" function when called. For example:
sparsegrid(3,5,f=kpn). However, when kpn is copied explicitly from your source code and defined in the Julia kernel, the example works.
Additionally, SparseGrids does not recognize gausshermite unless an explicit statement "using FastGuassQuadrature" is run in advance of "using SparseGrids".
This issue is used to trigger TagBot; feel free to unsubscribe.
If you haven't already, you should update your TagBot.yml
to include issue comment triggers.
Please see this post on Discourse for instructions and more details.
If you'd like for me to do this for you, comment TagBot fix
on this issue.
I'll open a PR within a few hours, please be patient!
@JuliaRegistrator register
@JuliaRegistrator register
The code below produces
1 7 (7, 7)
1 11 (11, 11)
2 7 (49, 137)
2 11 (121, 501)
3 7 (343, 681)
3 11 (1331, 5297)
I had expected the number of sparse nodes to be less than the number of tensor nodes. What am I doing wrong?
using SparseGrids, FastGaussQuadrature
function hmmm( d, o )
nt, wt = tensorgrid( d, o )
ns, ws = sparsegrid( d, o )
length( wt ), length( ws )
end
for d ∈ 1:3, o ∈ [ 7, 11 ]
println( "$d $o ", hmmm( d,o) )
end
I'd be interested to see if this package could compose with the QuadGK.jl package for Gauss-Kronrod points. This type of points has Gauss points mixed in with Kronrod points, together with weights. The Kronrod points work to augment the accuracy of the overall scheme as well as to provide an estimate of the error.
julia> FastGaussQuadrature.gausslegendre(2)
([-0.5773502691896258, 0.5773502691896258], [1.0, 1.0])
julia> QuadGK.kronrod(2)
([-0.9258200997725514, -0.5773502691896257, 0.0], [0.19797979797979798, 0.4909090909090911, 0.6222222222222223], [1.0000000000000002])
How easy would it be to accommodate this functionality?
@JuliaRegistrator register
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.