# `viltrum` - Integration range definition Defining integration ranges in `viltrum` for numerical integration methods is relatively simple, with several options making it more flexible. However, their definition affects the whole integration because they not only define the range but the data type (float or double) that will be used to explored the integrand as well as the dimensionality of the problem. An integration range is defined as follows:their integration with any numerical method is simple. An integration range is represented by the class `viltrum::Range` that can be constructed as follows: ```cpp viltrum::Range integration_range(const std::array& a, const std::array& b) ``` where: - `N` is the number of dimensions explored by the integration method, and should be the same number of dimensions than the [function that defines the integrand](integrands.md). It should be the same number than the dimensions of the integration range that is defined when integrating. - `F` is a floating point value that explores the function (commonly `float` or `double`), and again must match the [integrand's parameter](integrands.md). - `a` and `b` mark, respectively, the lower and upper bound of the integration range per dimension. For simplicity reasons, several helper functions have been defined to construct the integration range. The following examples will be using the following integrand: ```cpp class Gaussian { public: template real operator()(const std::array& x) const { real sum(0); for (real xi : x) sum += xi*xi; return std::exp(-0.5*sum)/std::sqrt(2.0*M_PI); } }; ``` Note that the integrand above is defined for any number of dimensions `NDIM` as well as for any floating point data type `real` per dimension, so the integration range will define how this function is explored. The simplest helper function `viltrum::range` requires two `std::arrays` as parameters, from which the dimensionality and the real type for `viltrum::Range` are deduced. The following example uses this formulation for integration ranges of 1, 2 and 3 dimensions: ```cpp int main(int argc, char** argv) { unsigned long samples = 1024; auto method = viltrum::integrator_monte_carlo_uniform(samples); std::array min1d{0.0}; std::array max1d{1.0}; std::cout<<"1D = "< min2d{0.0,0.0}; std::array max2d{1.0,1.0}; std::cout<<"2D = "< min3d{0.0,0.0,0.0}; std::array max3d{1.0,1.0,1.0}; std::cout<<"3D = "<