From 4dab6c10af6907c3b48912d1ec85a0ac2a42eca7 Mon Sep 17 00:00:00 2001 From: Christopher Schwan Date: Mon, 17 Jun 2013 16:06:14 +0200 Subject: [PATCH] Apply some cosmetic changes --- examples/mpi_vegas.cpp | 8 ++++++++ include/hep/mc/mpi_vegas.hpp | 20 +++++++++++++++++++- include/hep/mc/plain.hpp | 13 ++++++++++--- include/hep/mc/vegas.hpp | 6 +++--- 4 files changed, 40 insertions(+), 7 deletions(-) diff --git a/examples/mpi_vegas.cpp b/examples/mpi_vegas.cpp index c3e55bb..b20ca18 100644 --- a/examples/mpi_vegas.cpp +++ b/examples/mpi_vegas.cpp @@ -5,6 +5,8 @@ #include #include +#include + double gauss(hep::mc_point const& sample) { double result = 1.0; @@ -45,6 +47,12 @@ int main(int argc, char* argv[]) iterations, gauss ); +// std::vector> results = { hep::mpi_plain( +// MPI_COMM_WORLD, +// dimension, +// 5 * 10000000, +// gauss +// )}; // print numbers in scientific format std::cout.setf(std::ios_base::scientific); diff --git a/include/hep/mc/mpi_vegas.hpp b/include/hep/mc/mpi_vegas.hpp index f8386e0..bd22c09 100644 --- a/include/hep/mc/mpi_vegas.hpp +++ b/include/hep/mc/mpi_vegas.hpp @@ -1,6 +1,24 @@ #ifndef HEP_MC_MPI_VEGAS_HPP #define HEP_MC_MPI_VEGAS_HPP +/* + * hep-mc - A Template Library for Monte Carlo Integration + * Copyright (C) 2013 Christopher Schwan + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #include #include @@ -36,7 +54,7 @@ namespace hep * \param alpha The \f$ \alpha \f$ parameter of VEGAS. This parameter should be * between `1` and `2`. * \param generator The random number generator that will be used to generate - * random points from the hypercube. This generator is not seeded. + * random points from the hypercube. This generator is properly seeded. */ template std::vector> mpi_vegas( diff --git a/include/hep/mc/plain.hpp b/include/hep/mc/plain.hpp index 80bcee8..efd93b4 100644 --- a/include/hep/mc/plain.hpp +++ b/include/hep/mc/plain.hpp @@ -19,13 +19,13 @@ * along with this program. If not, see . */ +#include +#include + #include #include #include -#include -#include - namespace hep { @@ -36,6 +36,13 @@ namespace hep * unit-hypercube with the specified `dimensions` using `calls` function * evaluations with randomly chosen points determined by `generator`. The * generator is not seeded. + * + * \param dimensions The number of parameters `function` accepts. + * \param calls The number of function calls that are used to obtain the result. + * \param function The function that will be integrated over the hypercube. See + * \ref integrands for further explanation. + * \param generator The random number generator that will be used to generate + * random points from the hypercube. This generator is not seeded. */ template mc_result plain( diff --git a/include/hep/mc/vegas.hpp b/include/hep/mc/vegas.hpp index b48af37..18c8d00 100644 --- a/include/hep/mc/vegas.hpp +++ b/include/hep/mc/vegas.hpp @@ -19,13 +19,13 @@ * along with this program. If not, see . */ +#include +#include + #include #include #include -#include -#include - namespace hep {