A Weyl equidistributed sequence sampler class optimized for a given number of dimensions (see http://extremelearning.com.au/unreasonable-effectiveness-of-quasirandom-sequences)
Weyl's equidistribution theorem says that the sequence of all multiples of an irrational number r is equidistributed modulo 1. This sampler uses such a generator for each dimension of a multi-dimensional sequence, where r is varied for each dimension.
#include <weyl.h>
|
CUGAR_HOST_DEVICE CUGAR_FORCEINLINE | Weyl_sampler_opt (unsigned int n_dims=1, unsigned int instance=0, float seed=0.0f) |
|
CUGAR_HOST_DEVICE CUGAR_FORCEINLINE float | sample () |
|
CUGAR_HOST_DEVICE CUGAR_FORCEINLINE float | next () |
|
CUGAR_HOST_DEVICE CUGAR_FORCEINLINE unsigned int | next_instance () |
|
CUGAR_HOST_DEVICE CUGAR_FORCEINLINE unsigned int | next_dim () |
|
CUGAR_HOST_DEVICE CUGAR_FORCEINLINE void | set_instance (unsigned int i) |
|
CUGAR_HOST_DEVICE CUGAR_FORCEINLINE void | set_dim (unsigned int d) |
|
◆ Weyl_sampler_opt()
CUGAR_HOST_DEVICE CUGAR_FORCEINLINE cugar::Weyl_sampler_opt::Weyl_sampler_opt |
( |
unsigned int |
n_dims = 1 , |
|
|
unsigned int |
instance = 0 , |
|
|
float |
seed = 0.0f |
|
) |
| |
|
inline |
constructor
- Parameters
-
n_dims | total number of dimensions |
instance | instance number |
seed | randomization seed |
◆ next()
CUGAR_HOST_DEVICE CUGAR_FORCEINLINE float cugar::Weyl_sampler_opt::next |
( |
| ) |
|
|
inline |
return next sample (iterating over dimensions)
◆ next_dim()
CUGAR_HOST_DEVICE CUGAR_FORCEINLINE unsigned int cugar::Weyl_sampler_opt::next_dim |
( |
| ) |
|
|
inline |
advance to the next dimension
◆ next_instance()
CUGAR_HOST_DEVICE CUGAR_FORCEINLINE unsigned int cugar::Weyl_sampler_opt::next_instance |
( |
| ) |
|
|
inline |
advance to the next instance
◆ sample()
CUGAR_HOST_DEVICE CUGAR_FORCEINLINE float cugar::Weyl_sampler_opt::sample |
( |
| ) |
|
|
inline |
return next sample (iterating over dimensions)
◆ set_dim()
CUGAR_HOST_DEVICE CUGAR_FORCEINLINE void cugar::Weyl_sampler_opt::set_dim |
( |
unsigned int |
d | ) |
|
|
inline |
◆ set_instance()
CUGAR_HOST_DEVICE CUGAR_FORCEINLINE void cugar::Weyl_sampler_opt::set_instance |
( |
unsigned int |
i | ) |
|
|
inline |
The documentation for this class was generated from the following file:
- C:/p4research/research/jpantaleoni/Fermat-Public/contrib/cugar/sampling/weyl.h