26 February 2022 01:30:54 PM SPARSE_GRID_HW_TEST(): C version Test the SPARSE_GRID_HW library. CCL_TEST: CCL_ORDER + CC Clenshaw Curtis Linear (CCL) 1D quadrature: Level Nodes Estimate Error 1 1 0.193334 0.00977527 2 3 0.191473 5.68167e-05 3 5 0.191462 3.95965e-08 4 7 0.191462 1.17826e-11 5 9 0.191462 6.52348e-15 CCL_SPARSE_TEST: CCL_ORDER + CC Sparse Clenshaw Curtis Linear sparse grid. D Level Nodes SG error MC error 10 2 21 0.0039099 0.025878 10 3 221 6.4537e-05 0.0078998 10 4 1581 1.2382e-07 0.0028176 10 5 8761 1.0077e-08 0.0012298 10 6 40425 8.842e-11 0.00056807 10 7 162385 2.9064e-12 0.00029386 CCS_TEST: CCS_ORDER + CC Clenshaw Curtis Slow 1D quadrature: Level Nodes Estimate Error 1 1 0.193334 0.00977527 2 3 0.191473 5.68167e-05 3 5 0.191462 3.95965e-08 4 9 0.191462 6.52348e-15 5 9 0.191462 6.52348e-15 CCS_SPARSE_TEST: CCS_ORDER + CC Sparse Clenshaw Curtis Slow sparse grid. D Level Nodes SG error MC error 10 2 21 0.0039099 0.025878 10 3 221 6.4537e-05 0.0078998 10 4 1581 1.2369e-07 0.0028176 10 5 8721 1.0089e-08 0.0012552 10 6 39665 8.8645e-11 0.00057553 10 7 155105 1.1094e-12 0.00029732 CCE_TEST: CCE_ORDER + CC Clenshaw Curtis Exponential 1D quadrature: Level Nodes Estimate Error 1 1 0.193334 0.00977527 2 3 0.191473 5.68167e-05 3 5 0.191462 3.95965e-08 4 9 0.191462 6.52348e-15 5 17 0.191462 2.89932e-16 CCE_SPARSE_TEST: CCE_ORDER + CC Sparse Clenshaw Curtis Exponential sparse grid. D Level Nodes SG error MC error 10 2 21 0.0039099 0.025878 10 3 221 6.4537e-05 0.0078998 10 4 1581 1.2369e-07 0.0028176 10 5 8801 1.0089e-08 0.0012216 10 6 41265 8.872e-11 0.00056375 10 7 171425 2.8646e-12 0.00027978 GET_SEQ_TEST GET_SEQ returns all D-dimensional vectors that sum to NORM. D = 3 NORM = 6 The compositions Col: 0 1 2 Row 0: 4 1 1 1: 3 2 1 2: 3 1 2 3: 2 3 1 4: 2 2 2 5: 2 1 3 6: 1 4 1 7: 1 3 2 8: 1 2 3 9: 1 1 4 GQN_TEST: Gauss-Hermite quadrature over (-oo,+oo): Level Nodes Estimate Error 1 1 0 1 2 2 1 0.933333 3 3 9 0.4 4 4 15 3.55271e-16 5 5 15 2.36848e-16 GQN_SPARSE_TEST: GQN sparse grid: Sparse Gaussian quadrature with Hermite weight over (-oo,+oo). D Level Nodes SG error MC error 10 2 21 0.93333 1.2367 10 3 221 0.4 0.49856 10 4 1581 5.8028e-14 0.16722 10 5 8761 1.4448e-13 0.075489 10 6 40405 2.3917e-12 0.034419 10 7 162025 1.6078e-11 0.016991 GQN2_SPARSE_TEST: GQN sparse grid: Gauss-Hermite sparse grids over (-oo,+oo). Use GQN2_ORDER, the growth rule N = 2 * L - 1. J W X Y 0 0.166667 -1.73205 0 1 0.166667 0 -1.73205 2 0.333333 0 0 3 0.166667 0 1.73205 4 0.166667 1.73205 0 J W X Y 0 0.0112574 -2.85697 0 1 0.0277778 -1.73205 -1.73205 2 -0.0555556 -1.73205 0 3 0.0277778 -1.73205 1.73205 4 0.222076 -1.35563 0 5 0.0112574 0 -2.85697 6 -0.0555556 0 -1.73205 7 0.222076 0 -1.35563 8 0.177778 0 0 9 0.222076 0 1.35563 10 -0.0555556 0 1.73205 11 0.0112574 0 2.85697 12 0.222076 1.35563 0 13 0.0277778 1.73205 -1.73205 14 -0.0555556 1.73205 0 15 0.0277778 1.73205 1.73205 16 0.0112574 2.85697 0 J W X Y 0 0.000548269 -3.75044 0 1 0.00187624 -2.85697 -1.73205 2 -0.00375247 -2.85697 0 3 0.00187624 -2.85697 1.73205 4 0.0307571 -2.36676 0 5 0.00187624 -1.73205 -2.85697 6 -0.0277778 -1.73205 -1.73205 7 0.0370127 -1.73205 -1.35563 8 -0.0222222 -1.73205 0 9 0.0370127 -1.73205 1.35563 10 -0.0277778 -1.73205 1.73205 11 0.00187624 -1.73205 2.85697 12 0.0370127 -1.35563 -1.73205 13 -0.0740253 -1.35563 0 14 0.0370127 -1.35563 1.73205 15 0.240123 -1.15441 0 16 0.000548269 0 -3.75044 17 -0.00375247 0 -2.85697 18 0.0307571 0 -2.36676 19 -0.0222222 0 -1.73205 20 -0.0740253 0 -1.35563 21 0.240123 0 -1.15441 22 0.114286 0 0 23 0.240123 0 1.15441 24 -0.0740253 0 1.35563 25 -0.0222222 0 1.73205 26 0.0307571 0 2.36676 27 -0.00375247 0 2.85697 28 0.000548269 0 3.75044 29 0.240123 1.15441 0 30 0.0370127 1.35563 -1.73205 31 -0.0740253 1.35563 0 32 0.0370127 1.35563 1.73205 33 0.00187624 1.73205 -2.85697 34 -0.0277778 1.73205 -1.73205 35 0.0370127 1.73205 -1.35563 36 -0.0222222 1.73205 0 37 0.0370127 1.73205 1.35563 38 -0.0277778 1.73205 1.73205 39 0.00187624 1.73205 2.85697 40 0.0307571 2.36676 0 41 0.00187624 2.85697 -1.73205 42 -0.00375247 2.85697 0 43 0.00187624 2.85697 1.73205 44 0.000548269 3.75044 0 GQU_TEST: Gauss-Legendre quadrature over [0,1]: Level Nodes Estimate Error 1 1 0.193334 0.00977527 2 2 0.191455 3.7965e-05 3 3 0.191462 9.46584e-08 4 4 0.191462 1.74249e-10 5 5 0.191462 2.54416e-13 GQU_SPARSE_TEST: GQU sparse grid: Sparse Gaussian unweighted quadrature over [0,1]. D Level Nodes SG error MC error 10 2 21 0.0049444 0.025878 10 3 221 0.00015519 0.0078998 10 4 1581 3.5752e-06 0.0028176 10 5 8761 6.4664e-08 0.0012298 10 6 40405 9.5702e-10 0.0005817 10 7 162025 1.759e-11 0.00028711 KPN_TEST: Kronrod-Patterson-Hermite quadrature over (-oo,+oo): Level Nodes Estimate Error 1 1 0 1 2 3 9 0.4 3 3 9 0.4 4 7 15 4.73695e-16 5 9 15 1.18424e-16 KPN_SPARSE_TEST: KPN sparse grid: Sparse Kronrod-Patterson quadrature with Hermite weight over (-oo,+oo). D Level Nodes SG error MC error 10 2 21 0.4 1.2367 10 3 201 0.4 0.5371 10 4 1201 2.9606e-15 0.20018 10 5 5301 7.0735e-13 0.096658 10 6 19485 7.2288e-12 0.050696 10 7 63405 8.712e-11 0.026963 KPU_TEST: Kronrod-Patterson quadrature over [0,1]: Level Nodes Estimate Error 1 1 0.193334 0.00977527 2 3 0.191462 9.46584e-08 3 3 0.191462 9.46584e-08 4 7 0.191462 4.34898e-16 5 7 0.191462 4.34898e-16 KPU_SPARSE_TEST: KPU sparse grid: Sparse Kronrod-Patterson unweighted quadrature over [0,1]. D Level Nodes SG error MC error 10 2 21 0.004529 0.025878 10 3 201 0.00011892 0.0084054 10 4 1201 2.0959e-06 0.0032769 10 5 5281 2.6831e-08 0.0016055 10 6 19105 2.6775e-10 0.00082166 10 7 60225 6.425e-12 0.00047571 NWSPGR_SIZE_TEST: NWSPGR_SIZE returns the size of a sparse grid, based on either: one of the built-in 1D rules, or a family of 1D rules supplied by the user. Kronrod-Patterson, [0,1], Dim 2, Level 3, Symmetric Full 21 Kronrod-Patterson, (-oo,+oo), Dim 2, Level 3, Symmetric Full 21 Gauss-Legendre, [0,1], Dim 2, Level 3, Symmetric Full 14 Gauss Hermite, (-oo,+oo), [0,1], Dim 2, Level 3, Symmetric Full 14 Clenshaw Curtis Exponential, [-1,+1], [0,1], Dim 2, Level 3, Unsymmetric Full 25 Dimension / Level table for Clenshaw Curtis Exponential Dim: 1 2 3 4 5 6 7 8 9 10 Level 1 1 1 1 1 1 1 1 1 1 1 2 3 7 10 13 16 19 22 25 28 31 3 5 25 52 87 131 184 246 317 397 486 4 9 67 195 411 746 1228 1884 2741 3826 5166 5 17 161 609 1573 3376 6430 11222 18319 28369 42101 This function measures the time in seconds required by NWSPGR to compute a sparse grid, based on either: one of the built-in 1D rules, or a family of 1D rules supplied by the user. Kronrod-Patterson, [0,1], Dim 20, Level 5, Symmetric Full 2.1963 Kronrod-Patterson, (-oo,+oo), Dim 20, Level 5, Symmetric Full 2.16827 Gauss-Legendre, [0,1], Dim 20, Level 5, Symmetric Full 0.417732 Gauss Hermite, (-oo,+oo), [0,1], Dim 20, Level 5, Symmetric Full 0.432925 Clenshaw Curtis Exponential, [-1,+1], [0,1], Dim 20, Level 5, Unsymmetric Full 2.42825 Dimension / Level table for Clenshaw Curtis Exponential Dim: 1 2 3 4 5 6 7 8 9 10 Level 1 4e-06 2e-06 1e-06 1e-06 2e-06 2e-06 1e-06 2e-06 2e-06 2e-06 2 4e-06 4e-06 6e-06 9e-06 1.3e-05 1.6e-05 2e-05 2.4e-05 2.9e-05 3.4e-05 3 4e-06 1.2e-05 2.9e-05 5.4e-05 9.1e-05 0.000144 0.000215 0.000329 0.00051 0.000571 4 7e-06 3e-05 0.000105 0.000293 0.000602 0.0011 0.00185 0.00327 0.00485 0.00736 5 1.8e-05 7.7e-05 0.000344 0.00115 0.00293 0.00647 0.0131 0.0239 0.0414 0.0686 Dim: 11 12 13 14 15 16 17 18 19 20 Level 1 5e-06 3e-06 2e-06 2e-06 3e-06 3e-06 3e-06 3e-06 3e-06 3e-06 2 4.5e-05 4.8e-05 5.5e-05 6.2e-05 7.1e-05 7.9e-05 8.8e-05 9.8e-05 0.000108 0.000119 3 0.000736 0.000947 0.00119 0.00145 0.0018 0.00217 0.00258 0.00309 0.0036 0.00416 4 0.0101 0.0142 0.0195 0.0265 0.0347 0.0436 0.0564 0.0707 0.0897 0.111 5 0.118 0.178 0.268 0.384 0.568 0.818 1.11 1.53 1.93 2.4 NWSPGR_TEST: NWSPGR generates a sparse grid, based on either: one of the built-in 1D rules, or a family of 1D rules supplied by the user. Kronrod-Patterson, [0,1], Dim 2, Level 3 0 0.077160 * f ( 0.112702, 0.112702 ) 1 0.123457 * f ( 0.112702, 0.500000 ) 2 0.077160 * f ( 0.112702, 0.887298 ) 3 0.123457 * f ( 0.500000, 0.112702 ) 4 0.197531 * f ( 0.500000, 0.500000 ) 5 0.123457 * f ( 0.500000, 0.887298 ) 6 0.077160 * f ( 0.887298, 0.112702 ) 7 0.123457 * f ( 0.887298, 0.500000 ) 8 0.077160 * f ( 0.887298, 0.887298 ) Kronrod-Patterson, (-oo,+oo), Dim 2, Level 3 0 0.027778 * f ( -1.732051, -1.732051 ) 1 0.111111 * f ( -1.732051, 0.000000 ) 2 0.027778 * f ( -1.732051, 1.732051 ) 3 0.111111 * f ( 0.000000, -1.732051 ) 4 0.444444 * f ( 0.000000, 0.000000 ) 5 0.111111 * f ( 0.000000, 1.732051 ) 6 0.027778 * f ( 1.732051, -1.732051 ) 7 0.111111 * f ( 1.732051, 0.000000 ) 8 0.027778 * f ( 1.732051, 1.732051 ) Gauss-Legendre, [0,1], Dim 2, Level 3 0 0.277778 * f ( 0.112702, 0.500000 ) 1 0.250000 * f ( 0.211325, 0.211325 ) 2 -0.500000 * f ( 0.211325, 0.500000 ) 3 0.250000 * f ( 0.211325, 0.788675 ) 4 0.277778 * f ( 0.500000, 0.112702 ) 5 -0.500000 * f ( 0.500000, 0.211325 ) 6 0.888889 * f ( 0.500000, 0.500000 ) 7 -0.500000 * f ( 0.500000, 0.788675 ) 8 0.277778 * f ( 0.500000, 0.887298 ) 9 0.250000 * f ( 0.788675, 0.211325 ) 10 -0.500000 * f ( 0.788675, 0.500000 ) 11 0.250000 * f ( 0.788675, 0.788675 ) 12 0.277778 * f ( 0.887298, 0.500000 ) Gauss Hermite, (-oo,+oo), Dim 2, Level 3 0 0.166667 * f ( -1.732051, 0.000000 ) 1 0.250000 * f ( -1.000000, -1.000000 ) 2 -0.500000 * f ( -1.000000, 0.000000 ) 3 0.250000 * f ( -1.000000, 1.000000 ) 4 0.166667 * f ( 0.000000, -1.732051 ) 5 -0.500000 * f ( 0.000000, -1.000000 ) 6 1.333333 * f ( 0.000000, 0.000000 ) 7 -0.500000 * f ( 0.000000, 1.000000 ) 8 0.166667 * f ( 0.000000, 1.732051 ) 9 0.250000 * f ( 1.000000, -1.000000 ) 10 -0.500000 * f ( 1.000000, 0.000000 ) 11 0.250000 * f ( 1.000000, 1.000000 ) 12 0.166667 * f ( 1.732051, 0.000000 ) Clenshaw Curtis Exponential, [-1,+1], Dim 2, Level 3 0 0.027778 * f ( 0.000000, 0.000000 ) 1 -0.022222 * f ( 0.000000, 0.500000 ) 2 0.027778 * f ( 0.000000, 1.000000 ) 3 0.266667 * f ( 0.146447, 0.500000 ) 4 -0.022222 * f ( 0.500000, 0.000000 ) 5 0.266667 * f ( 0.500000, 0.146447 ) 6 -0.088889 * f ( 0.500000, 0.500000 ) 7 0.266667 * f ( 0.500000, 0.853553 ) 8 -0.022222 * f ( 0.500000, 1.000000 ) 9 0.266667 * f ( 0.853553, 0.500000 ) 10 0.027778 * f ( 1.000000, 0.000000 ) 11 -0.022222 * f ( 1.000000, 0.500000 ) 12 0.027778 * f ( 1.000000, 1.000000 ) ORDER_REPORT For each family of rules, report: L, the level index, RP, the required polynomial precision, AP, the actual polynomial precision, O, the rule order (number of points). GQN family Gauss quadrature, exponential weight, (-oo,+oo) L RP AP O 1 1 1 1 2 3 3 2 3 5 5 3 4 7 7 4 5 9 9 5 6 11 11 6 7 13 13 7 8 15 15 8 9 17 17 9 10 19 19 10 11 21 21 11 12 23 23 12 13 25 25 13 14 27 27 14 15 29 29 15 16 31 31 16 17 33 33 17 18 35 35 18 19 37 37 19 20 39 39 20 21 41 41 21 22 43 43 22 23 45 45 23 24 47 47 24 25 49 49 25 GQU family Gauss quadrature, unit weight, [0,1] L RP AP O 1 1 1 1 2 3 3 2 3 5 5 3 4 7 7 4 5 9 9 5 6 11 11 6 7 13 13 7 8 15 15 8 9 17 17 9 10 19 19 10 11 21 21 11 12 23 23 12 13 25 25 13 14 27 27 14 15 29 29 15 16 31 31 16 17 33 33 17 18 35 35 18 19 37 37 19 20 39 39 20 21 41 41 21 22 43 43 22 23 45 45 23 24 47 47 24 25 49 49 25 KPN family Gauss-Kronrod-Patterson quadrature, exponential weight, (-oo,+oo) L RP AP O 1 1 1 1 2 3 5 3 3 5 5 3 4 7 7 7 5 9 15 9 6 11 15 9 7 13 15 9 8 15 15 9 9 17 17 17 10 19 29 19 11 21 29 19 12 23 29 19 13 25 29 19 14 27 29 19 15 29 29 19 16 31 31 31 17 33 33 33 18 35 51 35 19 37 51 35 20 39 51 35 21 41 51 35 22 43 51 35 23 45 51 35 24 47 51 35 25 49 51 35 KPU family Gauss-Kronrod-Patterson quadrature, unit weight, [0,1] L RP AP O 1 1 1 1 2 3 5 3 3 5 5 3 4 7 11 7 5 9 11 7 6 11 11 7 7 13 23 15 8 15 23 15 9 17 23 15 10 19 23 15 11 21 23 15 12 23 23 15 13 25 47 31 14 27 47 31 15 29 47 31 16 31 47 31 17 33 47 31 18 35 47 31 19 37 47 31 20 39 47 31 21 41 47 31 22 43 47 31 23 45 47 31 24 47 47 31 25 49 95 63 SYMMETRIC_SPARSE_SIZE_TEST Given a symmetric sparse grid rule represented only by the points with positive values, determine the total number of points in the grid. For dimension DIM, we report R, the number of points in the positive orthant, and R2, the total number of points. DIM R R2 5 6 11 5 21 61 3 23 69 TENSOR_PRODUCT_TEST: Given a sequence of 1D quadrature rules, construct the tensor product rule. A 1D rule over [-1,+1]: 0 1.000000 * f ( -1.000000 ) 1 1.000000 * f ( 1.000000 ) A 2D rule over [-1,+1] x [2.0,3.0]: 0 0.250000 * f ( -1.000000, 2.000000 ) 1 0.250000 * f ( 1.000000, 2.000000 ) 2 0.500000 * f ( -1.000000, 2.500000 ) 3 0.500000 * f ( 1.000000, 2.500000 ) 4 0.250000 * f ( -1.000000, 3.000000 ) 5 0.250000 * f ( 1.000000, 3.000000 ) A 3D rule over [-1,+1] x [2.0,3.0] x [10.0,15.0]: 0 0.625000 * f ( -1.000000, 2.000000, 10.000000 ) 1 0.625000 * f ( 1.000000, 2.000000, 10.000000 ) 2 1.250000 * f ( -1.000000, 2.500000, 10.000000 ) 3 1.250000 * f ( 1.000000, 2.500000, 10.000000 ) 4 0.625000 * f ( -1.000000, 3.000000, 10.000000 ) 5 0.625000 * f ( 1.000000, 3.000000, 10.000000 ) 6 0.625000 * f ( -1.000000, 2.000000, 15.000000 ) 7 0.625000 * f ( 1.000000, 2.000000, 15.000000 ) 8 1.250000 * f ( -1.000000, 2.500000, 15.000000 ) 9 1.250000 * f ( 1.000000, 2.500000, 15.000000 ) 10 0.625000 * f ( -1.000000, 3.000000, 15.000000 ) 11 0.625000 * f ( 1.000000, 3.000000, 15.000000 ) TENSOR_PRODUCT_TEST_CELL: Given a set of 1D quadrature rules stored in a cell array, construct the tensor product rule. A 1D rule over [-1,+1]: 0 1.000000 * f ( -1.000000 ) 1 1.000000 * f ( 1.000000 ) A 1D rule over [-1,+1]: 0 0.250000 * f ( -1.000000, 2.000000 ) 1 0.250000 * f ( 1.000000, 2.000000 ) 2 0.500000 * f ( -1.000000, 2.500000 ) 3 0.500000 * f ( 1.000000, 2.500000 ) 4 0.250000 * f ( -1.000000, 3.000000 ) 5 0.250000 * f ( 1.000000, 3.000000 ) A 1D rule over [-1,+1]: 0 0.625000 * f ( -1.000000, 2.000000, 10.000000 ) 1 0.625000 * f ( 1.000000, 2.000000, 10.000000 ) 2 1.250000 * f ( -1.000000, 2.500000, 10.000000 ) 3 1.250000 * f ( 1.000000, 2.500000, 10.000000 ) 4 0.625000 * f ( -1.000000, 3.000000, 10.000000 ) 5 0.625000 * f ( 1.000000, 3.000000, 10.000000 ) 6 0.625000 * f ( -1.000000, 2.000000, 15.000000 ) 7 0.625000 * f ( 1.000000, 2.000000, 15.000000 ) 8 1.250000 * f ( -1.000000, 2.500000, 15.000000 ) 9 1.250000 * f ( 1.000000, 2.500000, 15.000000 ) 10 0.625000 * f ( -1.000000, 3.000000, 15.000000 ) 11 0.625000 * f ( 1.000000, 3.000000, 15.000000 ) SPARSE_GRID_HW_PRB Normal end of execution. 26 February 2022 01:39:39 PM