Sparse Grid Interpolation Toolbox Previous page

spdim

Computes the number of sparse grid points.

Syntax

P = spdim(N,D)
P = spdim(N,D,OPTIONS)

Description

P = spdim(N,D) Computes the number of points of the sparse grid of dimension D and level N.

P = spdim(N,D,OPTIONS) Computes the number of points as above, but with the default grid type replaced by the grid type specified in OPTIONS/, an argument created with spset. See spset for details.

Examples

Compute the number of support nodes of the 10-dimensional sparse grid of level 7 for the Clenshaw-Curtis (default) grid with the following command:

spdim(7,10)
ans =
      652065

For comparison, compute the number of nodes of the maximum-norm-based sparse grid:

options = spset('GridType','Maximum');
spdim(7,10,options)
ans =
   1.8317e+09