This example shows how to generate random numbers extracted from a normal distribution
try {
int seed = 1231;
double xmin = 0.;
double xmax = 10.;
double mean = 5.;
double sigma = 2.;
std::vector<double> numbers(1000);
for (auto && num : numbers) num = ran();
std::vector<double> xx, fx, error;
for (size_t i=0; i<xx.size(); ++i)
std::cout << std::setprecision(1) << std::fixed << xx[i] << " " << std::string(fx[i]*100./numbers.size(), '*') << std::endl;
}
return 0;
}
int main()
main function to create the logo of the CosmoBolognaLib
const char * what() const noexcept override
the error description
The class NormalRandomNumbers.
void distribution(std::vector< double > &xx, std::vector< double > &fx, std::vector< double > &err, const std::vector< double > FF, const std::vector< double > WW, const int nbin, const bool linear=true, const std::string file_out=par::defaultString, const double fact=1., const double V1=par::defaultDouble, const double V2=par::defaultDouble, const std::string bin_type="Linear", const bool conv=false, const double sigma=0.)
derive and store the number distribution of a given std::vector