23 const long n_quad_pts = tmp.weights.size();
25 quad.
points = Eigen::MatrixXd(n_quad_pts * n_quad_pts * n_quad_pts, 3);
26 quad.
weights = Eigen::MatrixXd(n_quad_pts * n_quad_pts * n_quad_pts, 1);
28 for (
long i = 0; i < n_quad_pts; ++i)
30 for (
long j = 0; j < n_quad_pts; ++j)
32 for (
long k = 0; k < n_quad_pts; ++k)
34 const long index = (i * n_quad_pts + j) * n_quad_pts + k;
35 quad.
points.row(index) = Eigen::Vector3d(tmp.points(k), tmp.points(j), tmp.points(i));
36 quad.
weights(index) = tmp.weights(i) * tmp.weights(j) * tmp.weights(k);
41 assert(fabs(quad.
weights.sum() - 1) < 1e-14);
42 assert(quad.
points.minCoeff() >= 0 && quad.
points.maxCoeff() <= 1);