libcrn  3.9.5
A document image processing library
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CRNUnivariateRandomTools.h
Go to the documentation of this file.
1 /* Copyright 2008-2014 INSA Lyon
2  *
3  * This file is part of libcrn.
4  *
5  * libcrn is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU Lesser General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * libcrn is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with libcrn. If not, see <http://www.gnu.org/licenses/>.
17  *
18  * file: CRNUnivariateRandomTools.h
19  * \author Jean DUONG, Yann LEYDIER
20  */
21 
22 #ifndef CRNUNIVARIATERANDOMTOOLS_HEADER
23 #define CRNUNIVARIATERANDOMTOOLS_HEADER
24 
25 #include <vector>
26 
27 #include <CRN.h>
29 
30 namespace crn
31 {
32  class UnivariateGaussianMixture;
33  /****************************************************************************/
43  namespace UnivariateRandomTools
44  {
46  std::vector<double> NewUniformSample(size_t n = 1, bool reseed = true);
48  std::vector<double> NewGaussianSample(double mu = 0.0, double sigma = 1.0, size_t n = 1, size_t m = 100, bool reseed = true);
50  std::vector<double> NewGaussianMixtureSample(const UnivariateGaussianMixture& Mx, size_t n = 1, size_t m = 100, bool reseed = true);
51  };
52 }
53 #endif
std::vector< double > NewGaussianSample(double mu=0.0, double sigma=1.0, size_t n=1, size_t m=100, bool reseed=true)
Creates a data sample following a Gaussian probability law.
std::vector< double > NewUniformSample(size_t n=1, bool reseed=true)
Creates a data sample following an uniform probability law.
std::vector< double > NewGaussianMixtureSample(const UnivariateGaussianMixture &Mx, size_t n=1, size_t m=100, bool reseed=true)
Creates a data sample following a Gaussian probability law.