6 #ifndef THEORETICA_QUASIRANDOM_H
7 #define THEORETICA_QUASIRANDOM_H
9 #include "../core/real_analysis.h"
10 #include "../algebra/algebra_types.h"
25 return fract(n * alpha);
45 return fract(prev + alpha);
54 template<
unsigned int N>
58 for (
unsigned int i = 0; i < N; ++i)
A statically allocated N-dimensional vector with elements of the given type.
Definition: vec.h:88
Main namespace of the library which contains all functions and objects.
Definition: algebra.h:27
double real
A real number, defined as a floating point type.
Definition: constants.h:188
vec< real, N > qrand_weyl_multi(unsigned int n, real alpha)
Weyl quasi-random sequence in N dimensions.
Definition: quasirandom.h:55
constexpr real INVPHI
The inverse of the Golden Section mathematical constant.
Definition: constants.h:203
real qrand_weyl_recurr(real prev=0, real alpha=INVPHI)
Weyl quasi-random sequence (computed with recurrence relation)
Definition: quasirandom.h:38
real fract(real x)
Compute the fractional part of a real number.
Definition: real_analysis.h:288
real qrand_weyl(unsigned int n, real alpha=INVPHI)
Weyl quasi-random sequence.
Definition: quasirandom.h:24
vec2 qrand_weyl2(unsigned int n, real alpha=0.7548776662466927)
Weyl quasi-random sequence in 2 dimensions.
Definition: quasirandom.h:70
dual2 square(dual2 x)
Return the square of a second order dual number.
Definition: dual2_functions.h:23
dual2 pow(dual2 x, int n)
Compute the n-th power of a second order dual number.
Definition: dual2_functions.h:41