uniformpointsamplertraits.hh 3.1 KB
Newer Older
1
2
3
4
5
6
7
// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
// vi: set et ts=4 sw=4 sts=4:
/*****************************************************************************
 *   See the file COPYING for full copying permissions.                      *
 *                                                                           *
 *   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    *
Dennis Gläser's avatar
Dennis Gläser committed
8
 *   the Free Software Foundation, either version 3 of the License, or       *
9
10
11
12
13
14
15
16
17
18
19
20
 *   (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 <http://www.gnu.org/licenses/>.   *
 *****************************************************************************/
/*!
 * \file
21
 * \ingroup Sampling
22
23
24
25
26
27
28
29
30
31
 * \brief Traits classes to be used for uniform point samplers.
 */
#ifndef FRACKIT_UNIFORM_POINT_SAMPLER_TRAITS_HH
#define FRACKIT_UNIFORM_POINT_SAMPLER_TRAITS_HH

#include <random>

namespace Frackit {

/*!
32
 * \ingroup Sampling
33
34
35
36
37
38
39
40
41
 * \brief Traits class to be used for sampling on
 *        uniform distributions in all coordinate directions.
 * \tparam ctype The type used for coordinates
 * \tparam worldDim The dimension of the coordinate space.
 */
template<class ctype, int worldDim>
struct UniformPointSamplerTraits;

/*!
42
 * \ingroup Sampling
43
44
45
46
47
48
49
50
51
52
53
 * \brief Traits class to be used for uniform sampling
 *         of points on 1-dimensional geometries.
 * \tparam ctype The type used for coordinates
 */
template<class ctype>
struct UniformPointSamplerTraits<ctype, 1>
{
    using DistributionBase1 = std::uniform_real_distribution<ctype>;
};

/*!
54
 * \ingroup Sampling
55
56
57
58
59
60
61
62
63
64
65
66
 * \brief Traits class to be used for uniform sampling
 *         of points on 2-dimensional geometries.
 * \tparam ctype The type used for coordinates
 */
template<class ctype>
struct UniformPointSamplerTraits<ctype, 2>
{
    using DistributionBase1 = std::uniform_real_distribution<ctype>;
    using DistributionBase2 = std::uniform_real_distribution<ctype>;
};

/*!
67
 * \ingroup Sampling
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
 * \brief Traits class to be used for uniform sampling
 *         of points on 3-dimensional geometries.
 * \tparam ctype The type used for coordinates
 */
template<class ctype>
struct UniformPointSamplerTraits<ctype, 3>
{
    using DistributionBase1 = std::uniform_real_distribution<ctype>;
    using DistributionBase2 = std::uniform_real_distribution<ctype>;
    using DistributionBase3 = std::uniform_real_distribution<ctype>;
};

} // end namespace Frackit

#endif // FRACKIT_UNIFORM_POINT_SAMPLER_TRAITS_HH