Fermat
Public Methods | List of all members
cugar::Weyl_sampler_opt Class Reference

Detailed description

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>

Public Methods

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)
 

Constructor & Destructor Documentation

◆ 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_dimstotal number of dimensions
instanceinstance number
seedrandomization seed

Member Function Documentation

◆ 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 the dimension index

◆ set_instance()

CUGAR_HOST_DEVICE CUGAR_FORCEINLINE void cugar::Weyl_sampler_opt::set_instance ( unsigned int  i)
inline

set the instance number


The documentation for this class was generated from the following file: