JDFTx  1.2.0
Random.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------
2 Copyright 2011 Ravishankar Sundararaman
3 
4 This file is part of JDFTx.
5 
6 JDFTx is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10 
11 JDFTx is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15 
16 You should have received a copy of the GNU General Public License
17 along with JDFTx. If not, see <http://www.gnu.org/licenses/>.
18 -------------------------------------------------------------------*/
19 
20 #ifndef JDFTX_CORE_RANDOM_H
21 #define JDFTX_CORE_RANDOM_H
22 
23 #include <core/scalar.h>
24 
26 
27 namespace Random
28 {
29  void seed(int i); //seed random number generator
30  double uniform(double start=0.0, double end=1.0);
31  double normal(double mean=0.0, double sigma=1.0, double cap=0.0);
32  complex normalComplex(double sigma=1.0);
33 }
34 
35 #endif //JDFTX_CORE_RANDOM_H
complex normalComplex(double sigma=1.0)
normal complex number with mean 0 and deviation sigma
Definition: Random.h:27
double normal(double mean=0.0, double sigma=1.0, double cap=0.0)
normal random numbers with mean, sigma and an optional cap if non-zero
double uniform(double start=0.0, double end=1.0)
uniform random numbers between 0 and 1
Complex number (need to define our own because we need operators for gpu code as well) ...
Definition: scalar.h:49