robertdj/SparseGrids.jl

sparse grid produces more nodes than tensorgrid

Closed this issue · 4 comments

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 would have to dig deeper to be certain, but as far as I remember the number of sparse nodes is less than the number of tensor nodes in high dimensions, but not necessarily in low dimensions. Can you check this?
Also/otherwise check some of the papers linked in the README.

Did you reach a conclusion?

Thank you Robert. I believe you're right. You can close this.