#include <cstdint>
#include <math.h>
#include <cassert>
#include <iostream>
#include <stdlib.h>
#include <random>
Go to the source code of this file.
- Author
- T. Schmoderer (iathe.nosp@m.na@m.nosp@m.ailo..nosp@m.com)
- Version
- 0.1.0
- Date
- 2022-10-13
- Copyright
- Copyright (c) 2022. All rights reserved. This project is released under the GNU GENERAL PUBLIC LICENSE.
◆ normal_distribution()
double normal_distribution |
( |
double |
m = 0. , |
|
|
double |
s = 1. |
|
) |
| |
Generate a random umber using the Gaussian distribution.
- Parameters
-
m | Mean value of the distribution, default \(m=0\). |
s | Standart deviation of the distribution, default \(s=1\). |
- Returns
- double A random number picked following the Gaussian distribution \(\mathcal{N}(m,s)\).
◆ triangular()
uint32_t triangular |
( |
uint16_t |
n | ) |
|
|
inline |
Compute \(n\)-th triangular number \(T_n\) defined by.
\[ T_n = \frac{n(n+1)}{2}. \]
- Parameters
-
- Returns
- uint32_t \(T_n\), \(n\)-th triangular number.
◆ uniform_distribution()
double uniform_distribution |
( |
double |
a = 0. , |
|
|
double |
b = 1. |
|
) |
| |
Generate a random number using the uniform distribution.
- Parameters
-
a | Lower bound of the interval, default \(a=0\) |
b | Upper bound of the interval ( \(b > a\)), default \(b=1\). |
- Returns
- double A random number picked uniformaly between \([a,b)\),