Fermat
|
An implementation of the small linear feedback shift registers (LFSR) for use in a Markov chain quasi-Monte Carlo context, as described in S. Chen, M. Matsumoto, T. Nishimura, and A. Owen: "New inputs and methods for Markov chain quasi-Monte Carlo", and S. Chen: "Consistence and convergence rate of Markov chain quasi-Monte Carlo with examples". Apart from the matrix that describes the recurrence, this class is stateless, and can therefore be easily shared in a multi-threaded context.
https://en.wikipedia.org/wiki/Linear-feedback_shift_register
#include <lfsr.h>
Public Methods | |
CUGAR_HOST_DEVICE CUGAR_FORCEINLINE | LFSRRandomStream (LFSRGeneratorMatrix *matrix, const uint32 state, const uint32 scramble=1361u) |
CUGAR_HOST_DEVICE CUGAR_FORCEINLINE float | next () |
Public Members | |
LFSRGeneratorMatrix * | m_matrix |
uint32 | m_state |
uint32 | m_scramble |