Numerical integration over n-dimensional cubes using generalized gaussian quadrature