prrng 1.12.1
Loading...
Searching...
No Matches
prrng::pcg32_arrayBase< Generator, Shape > Class Template Reference

Base class, see pcg32_array for description. More...

#include <prrng.h>

Inheritance diagram for prrng::pcg32_arrayBase< Generator, Shape >:
prrng::GeneratorBase_array< pcg32_arrayBase< Generator, Shape >, Shape >

Public Types

using size_type = typename Shape::value_type
 Size type.
 
using shape_type = Shape
 Shape type.
 
- Public Types inherited from prrng::GeneratorBase_array< pcg32_arrayBase< Generator, Shape >, Shape >
using shape_type = Shape
 Type of the shape and strides lists.
 
using size_type = typename M::value_type
 Type of sizes.
 

Public Member Functions

template<class... Args>
Generator & operator() (Args... args)
 Return a reference to one generator, using an array index.
 
template<class... Args>
const Generator & operator() (Args... args) const
 Return a constant reference to one generator, using an array index.
 
Generator & operator[] (size_t i)
 Return a reference to one generator, using a flat index.
 
const Generator & operator[] (size_t i) const
 Return a constant reference to one generator, using a flat index.
 
Generator & flat (size_t i)
 Return a reference to one generator, using a flat index.
 
const Generator & flat (size_t i) const
 Return a constant reference to one generator, using a flat index.
 
auto state () -> typename detail::return_type< uint64_t, Shape >::type
 Return the state of all generators.
 
template<class R >
state ()
 Return the state of all generators.
 
auto initstate () -> typename detail::return_type< uint64_t, Shape >::type
 Return the state initiator of all generators.
 
template<class R >
initstate ()
 Return the state initiator of all generators.
 
auto initseq () -> typename detail::return_type< uint64_t, Shape >::type
 Return the sequence initiator of all generators.
 
template<class R >
initseq ()
 Return the sequence initiator of all generators.
 
template<class T >
auto distance (const T &arg) -> typename detail::return_type< int64_t, Shape >::type
 Distance between two states.
 
template<class R , class T >
distance (const T &arg)
 Distance between two states.
 
template<class T >
void advance (const T &arg)
 Advance generators.
 
template<class T >
void restore (const T &arg)
 Restore generators from a state.
 
- Public Member Functions inherited from prrng::GeneratorBase_array< pcg32_arrayBase< Generator, Shape >, Shape >
size_type size () const
 Return the size of the array of generators.
 
const shape_typestrides () const
 Return the strides of the array of generators.
 
const shape_typeshape () const
 Return the shape of the array of generators.
 
auto shape (T axis) const
 Return the shape of the array of generators along a specific axis.
 
auto flat_index (const T &index) const
 Return a flat index based on an array index specified as a list.
 
bool inbounds (const T &index) const
 Check if an index is in bounds (and of the correct rank).
 
auto random (const S &ishape) -> typename detail::composite_return_type< double, Shape, S >::type
 Per generator, generate an nd-array of random numbers \( 0 \leq r \leq 1 \).
 
random (const S &ishape)
 Per generator, generate an nd-array of random numbers \( 0 \leq r \leq 1 \).
 
auto random (const I(&ishape)[L]) -> typename detail::composite_return_type< double, Shape, std::array< size_t, L > >::type
 Per generator, generate an nd-array of random numbers \( 0 \leq r \leq 1 \).
 
random (const I(&ishape)[L])
 Per generator, generate an nd-array of random numbers \( 0 \leq r \leq 1 \).
 
auto randint (const S &ishape, T high) -> typename detail::composite_return_type< T, Shape, S >::type
 Per generator, generate an nd-array of random integers \( 0 \leq r \leq bound \).
 
randint (const S &ishape, T high)
 Per generator, generate an nd-array of random integers \( 0 \leq r \leq bound \).
 
auto randint (const I(&ishape)[L], T high) -> typename detail::composite_return_type< T, Shape, std::array< size_t, L > >::type
 Per generator, generate an nd-array of random integers \( 0 \leq r \leq bound \).
 
randint (const I(&ishape)[L], T high)
 Per generator, generate an nd-array of random integers \( 0 \leq r \leq bound \).
 
auto randint (const S &ishape, T low, U high) -> typename detail::composite_return_type< T, Shape, S >::type
 Per generator, generate an nd-array of random integers \( 0 \leq r \leq bound \).
 
randint (const S &ishape, T low, U high)
 Per generator, generate an nd-array of random integers \( 0 \leq r \leq bound \).
 
auto randint (const I(&ishape)[L], T low, U high) -> typename detail::composite_return_type< T, Shape, std::array< size_t, L > >::type
 Per generator, generate an nd-array of random integers \( 0 \leq r \leq bound \).
 
randint (const I(&ishape)[L], T low, U high)
 Per generator, generate an nd-array of random integers \( 0 \leq r \leq bound \).
 
auto delta (const S &ishape, double scale=1) -> typename detail::composite_return_type< double, Shape, S >::type
 Per generator, generate an nd-array of numbers that are delta distribution.
 
delta (const S &ishape, double scale=1)
 Per generator, generate an nd-array of numbers that are delta distribution.
 
auto delta (const I(&ishape)[L], double scale=1) -> typename detail::composite_return_type< double, Shape, std::array< size_t, L > >::type
 Per generator, generate an nd-array of numbers that are delta distribution.
 
delta (const I(&ishape)[L], double scale=1)
 Per generator, generate an nd-array of numbers that are delta distribution.
 
auto exponential (const S &ishape, double scale=1) -> typename detail::composite_return_type< double, Shape, S >::type
 Per generator, generate an nd-array of random numbers distributed according to an exponential distribution.
 
exponential (const S &ishape, double scale=1)
 Per generator, generate an nd-array of random numbers distributed according to an exponential distribution.
 
auto exponential (const I(&ishape)[L], double scale=1) -> typename detail::composite_return_type< double, Shape, std::array< size_t, L > >::type
 Per generator, generate an nd-array of random numbers distributed according to an exponential distribution.
 
exponential (const I(&ishape)[L], double scale=1)
 Per generator, generate an nd-array of random numbers distributed according to an exponential distribution.
 
auto power (const S &ishape, double k=1) -> typename detail::composite_return_type< double, Shape, S >::type
 Per generator, generate an nd-array of random numbers distributed according to an power distribution.
 
power (const S &ishape, double k=1)
 Per generator, generate an nd-array of random numbers distributed according to an power distribution.
 
auto power (const I(&ishape)[L], double k=1) -> typename detail::composite_return_type< double, Shape, std::array< size_t, L > >::type
 Per generator, generate an nd-array of random numbers distributed according to an power distribution.
 
power (const I(&ishape)[L], double k=1)
 Per generator, generate an nd-array of random numbers distributed according to an power distribution.
 
auto gamma (const S &ishape, double k=1, double scale=1) -> typename detail::composite_return_type< double, Shape, S >::type
 Per generator, generate an nd-array of random numbers distributed according to a Gamma distribution.
 
gamma (const S &ishape, double k=1, double scale=1)
 Per generator, generate an nd-array of random numbers distributed according to a Gamma distribution.
 
auto gamma (const I(&ishape)[L], double k=1, double scale=1) -> typename detail::composite_return_type< double, Shape, std::array< size_t, L > >::type
 Per generator, generate an nd-array of random numbers distributed according to a Gamma distribution.
 
gamma (const I(&ishape)[L], double k=1, double scale=1)
 Per generator, generate an nd-array of random numbers distributed according to a Gamma distribution.
 
auto pareto (const S &ishape, double k=1, double scale=1) -> typename detail::composite_return_type< double, Shape, S >::type
 Per generator, generate an nd-array of random numbers distributed according to a Pareto distribution.
 
pareto (const S &ishape, double k=1, double scale=1)
 Per generator, generate an nd-array of random numbers distributed according to a Pareto distribution.
 
auto pareto (const I(&ishape)[L], double k=1, double scale=1) -> typename detail::composite_return_type< double, Shape, std::array< size_t, L > >::type
 Per generator, generate an nd-array of random numbers distributed according to a Pareto distribution.
 
pareto (const I(&ishape)[L], double k=1, double scale=1)
 Per generator, generate an nd-array of random numbers distributed according to a Pareto distribution.
 
auto weibull (const S &ishape, double k=1, double scale=1) -> typename detail::composite_return_type< double, Shape, S >::type
 Per generator, generate an nd-array of random numbers distributed according to a Weibull distribution.
 
weibull (const S &ishape, double k=1, double scale=1)
 Per generator, generate an nd-array of random numbers distributed according to a Weibull distribution.
 
auto weibull (const I(&ishape)[L], double k=1, double scale=1) -> typename detail::composite_return_type< double, Shape, std::array< size_t, L > >::type
 Per generator, generate an nd-array of random numbers distributed according to a Weibull distribution.
 
weibull (const I(&ishape)[L], double k=1, double scale=1)
 Per generator, generate an nd-array of random numbers distributed according to a Weibull distribution.
 
auto normal (const S &ishape, double mu=0, double sigma=1) -> typename detail::composite_return_type< double, Shape, S >::type
 Per generator, generate an nd-array of random numbers distributed according to a normal distribution.
 
normal (const S &ishape, double mu=0, double sigma=1)
 Per generator, generate an nd-array of random numbers distributed according to a normal distribution.
 
auto normal (const I(&ishape)[L], double mu=0, double sigma=1) -> typename detail::composite_return_type< double, Shape, std::array< size_t, L > >::type
 Per generator, generate an nd-array of random numbers distributed according to a normal distribution.
 
normal (const I(&ishape)[L], double mu=0, double sigma=1)
 Per generator, generate an nd-array of random numbers distributed according to a normal distribution.
 
auto cumsum_random (const T &n) -> typename detail::return_type< double, Shape >::type
 Per generator, return the result of the cumulative sum of n random numbers.
 
cumsum_random (const T &n)
 Per generator, return the result of the cumulative sum of n random numbers.
 
auto cumsum_delta (const T &n, double scale=1) -> typename detail::return_type< double, Shape >::type
 Per generator, return the result of the cumulative sum of n random numbers, distributed according to a delta distribution,.
 
cumsum_delta (const T &n, double scale=1)
 Per generator, return the result of the cumulative sum of n random numbers, distributed according to a delta distribution,.
 
auto cumsum_exponential (const T &n, double scale=1) -> typename detail::return_type< double, Shape >::type
 Per generator, return the result of the cumulative sum of n random numbers, distributed according to an exponential distribution, see exponential_distribution(),.
 
cumsum_exponential (const T &n, double scale=1)
 Per generator, return the result of the cumulative sum of n random numbers, distributed according to an exponential distribution, see exponential_distribution(),.
 
auto cumsum_power (const T &n, double k=1) -> typename detail::return_type< double, Shape >::type
 Per generator, return the result of the cumulative sum of n random numbers, distributed according to an power distribution, see power_distribution(),.
 
cumsum_power (const T &n, double k=1)
 Per generator, return the result of the cumulative sum of n random numbers, distributed according to an power distribution, see power_distribution(),.
 
auto cumsum_gamma (const T &n, double k=1, double scale=1) -> typename detail::return_type< double, Shape >::type
 Per generator, return the result of the cumulative sum of n random numbers, distributed according to a gamma distribution, see gamma_distribution(),.
 
cumsum_gamma (const T &n, double k=1, double scale=1)
 Per generator, return the result of the cumulative sum of n random numbers, distributed according to a gamma distribution, see gamma_distribution(),.
 
auto cumsum_pareto (const T &n, double k=1, double scale=1) -> typename detail::return_type< double, Shape >::type
 Per generator, return the result of the cumulative sum of n random numbers, distributed according to a pareto distribution, see pareto_distribution(),.
 
cumsum_pareto (const T &n, double k=1, double scale=1)
 Per generator, return the result of the cumulative sum of n random numbers, distributed according to a pareto distribution, see pareto_distribution(),.
 
auto cumsum_weibull (const T &n, double k=1, double scale=1) -> typename detail::return_type< double, Shape >::type
 Per generator, return the result of the cumulative sum of n random numbers, distributed according to a weibull distribution, see weibull_distribution(),.
 
cumsum_weibull (const T &n, double k=1, double scale=1)
 Per generator, return the result of the cumulative sum of n random numbers, distributed according to a weibull distribution, see weibull_distribution(),.
 
auto cumsum_normal (const T &n, double mu=0, double sigma=1) -> typename detail::return_type< double, Shape >::type
 Per generator, return the result of the cumulative sum of n random numbers, distributed according to a normal distribution, see normal_distribution(),.
 
cumsum_normal (const T &n, double mu=0, double sigma=1)
 Per generator, return the result of the cumulative sum of n random numbers, distributed according to a normal distribution, see normal_distribution(),.
 
auto decide (const P &p) -> typename detail::return_type< bool, P >::type
 Decide based on probability per generator.
 
decide (const P &p)
 Decide based on probability per generator.
 
void decide (const P &p, R &ret)
 Decide based on probability per generator.
 
auto decide_masked (const P &p, const T &mask) -> typename detail::return_type< bool, P >::type
 Decide based on probability per generator.
 
decide_masked (const P &p, const T &mask)
 Decide based on probability per generator.
 
void decide_masked (const P &p, const T &mask, R &ret)
 Decide based on probability per generator.
 

Protected Member Functions

template<class T >
void init (const T &initstate)
 Constructor alias.
 
template<class T , class U >
void init (const T &initstate, const U &initseq)
 Constructor alias.
 
void decide_impl (const double *p, bool *ret)
 For each p take a decision.
 
void decide_masked_impl (const double *p, const bool *mask, bool *ret)
 For each p take a decision.
 
void cumsum_random_impl (double *ret, const size_t *n)
 Return the result of the cumulative sum of n random numbers.
 
void cumsum_exponential_impl (double *ret, const size_t *n, double scale)
 Return the result of the cumulative sum of n random numbers.
 
void cumsum_power_impl (double *ret, const size_t *n, double k)
 Return the result of the cumulative sum of n random numbers.
 
void cumsum_gamma_impl (double *ret, const size_t *n, double k, double scale)
 Return the result of the cumulative sum of n random numbers.
 
void cumsum_pareto_impl (double *ret, const size_t *n, double k, double scale)
 Return the result of the cumulative sum of n random numbers.
 
void cumsum_weibull_impl (double *ret, const size_t *n, double k, double scale)
 Return the result of the cumulative sum of n random numbers.
 
void cumsum_normal_impl (double *ret, const size_t *n, double mu, double sigma)
 Return the result of the cumulative sum of n random numbers.
 
void draw_list_double (double *data, size_t n)
 Draw n random numbers per array item, and write them to the correct position in data (assuming row-major storage!).
 
void draw_list_positive_double (double *data, size_t n)
 Draw n random numbers per array item, and write them to the correct position in data (assuming row-major storage!).
 
void draw_list_uint32 (uint32_t *data, uint32_t bound, size_t n)
 Draw n random numbers per array item, and write them to the correct position in data (assuming row-major storage!).
 

Protected Attributes

std::vector< Generator > m_gen
 Underlying storage: one generator per array item.
 
- Protected Attributes inherited from prrng::GeneratorBase_array< pcg32_arrayBase< Generator, Shape >, Shape >
size_type m_size
 See size().
 
shape_type m_shape
 See shape().
 
shape_type m_strides
 The strides of the array of generators.
 

Detailed Description

template<class Generator, class Shape>
class prrng::pcg32_arrayBase< Generator, Shape >

Base class, see pcg32_array for description.

Definition at line 5048 of file prrng.h.

Member Typedef Documentation

◆ shape_type

template<class Generator , class Shape >
using prrng::pcg32_arrayBase< Generator, Shape >::shape_type = Shape

Shape type.

Definition at line 5056 of file prrng.h.

◆ size_type

template<class Generator , class Shape >
using prrng::pcg32_arrayBase< Generator, Shape >::size_type = typename Shape::value_type

Size type.

Definition at line 5055 of file prrng.h.

Member Function Documentation

◆ advance()

template<class Generator , class Shape >
template<class T >
void prrng::pcg32_arrayBase< Generator, Shape >::advance ( const T &  arg)
inline

Advance generators.

See pcg32::advance().

Template Parameters
TThe type of the input array, e.g. xt::array<int64_t> or xt::xtensor<int64_t, N>
Parameters
argThe distance (positive or negative) by which to advance each generator.

Definition at line 5311 of file prrng.h.

◆ cumsum_exponential_impl()

template<class Generator , class Shape >
void prrng::pcg32_arrayBase< Generator, Shape >::cumsum_exponential_impl ( double *  ret,
const size_t *  n,
double  scale 
)
inlineprotected

Return the result of the cumulative sum of n random numbers.

Parameters
retOutput, per generator.
nNumber to draw, per generator.
scaleScale.

Definition at line 5384 of file prrng.h.

◆ cumsum_gamma_impl()

template<class Generator , class Shape >
void prrng::pcg32_arrayBase< Generator, Shape >::cumsum_gamma_impl ( double *  ret,
const size_t *  n,
double  k,
double  scale 
)
inlineprotected

Return the result of the cumulative sum of n random numbers.

Parameters
retOutput, per generator.
nNumber to draw, per generator.
kShape parameter.
scaleScale parameter.

Definition at line 5411 of file prrng.h.

◆ cumsum_normal_impl()

template<class Generator , class Shape >
void prrng::pcg32_arrayBase< Generator, Shape >::cumsum_normal_impl ( double *  ret,
const size_t *  n,
double  mu,
double  sigma 
)
inlineprotected

Return the result of the cumulative sum of n random numbers.

Parameters
retOutput, per generator.
nNumber to draw, per generator.
muMean.
sigmaStandard deviation.

Definition at line 5453 of file prrng.h.

◆ cumsum_pareto_impl()

template<class Generator , class Shape >
void prrng::pcg32_arrayBase< Generator, Shape >::cumsum_pareto_impl ( double *  ret,
const size_t *  n,
double  k,
double  scale 
)
inlineprotected

Return the result of the cumulative sum of n random numbers.

Parameters
retOutput, per generator.
nNumber to draw, per generator.
kShape parameter.
scaleScale parameter.

Definition at line 5425 of file prrng.h.

◆ cumsum_power_impl()

template<class Generator , class Shape >
void prrng::pcg32_arrayBase< Generator, Shape >::cumsum_power_impl ( double *  ret,
const size_t *  n,
double  k 
)
inlineprotected

Return the result of the cumulative sum of n random numbers.

Parameters
retOutput, per generator.
nNumber to draw, per generator.
kScale.

Definition at line 5397 of file prrng.h.

◆ cumsum_random_impl()

template<class Generator , class Shape >
void prrng::pcg32_arrayBase< Generator, Shape >::cumsum_random_impl ( double *  ret,
const size_t *  n 
)
inlineprotected

Return the result of the cumulative sum of n random numbers.

Parameters
retOutput, per generator.
nNumber to draw, per generator.

Definition at line 5371 of file prrng.h.

◆ cumsum_weibull_impl()

template<class Generator , class Shape >
void prrng::pcg32_arrayBase< Generator, Shape >::cumsum_weibull_impl ( double *  ret,
const size_t *  n,
double  k,
double  scale 
)
inlineprotected

Return the result of the cumulative sum of n random numbers.

Parameters
retOutput, per generator.
nNumber to draw, per generator.
kShape parameter.
scaleScale parameter.

Definition at line 5439 of file prrng.h.

◆ decide_impl()

template<class Generator , class Shape >
void prrng::pcg32_arrayBase< Generator, Shape >::decide_impl ( const double *  p,
bool *  ret 
)
inlineprotected

For each p take a decision.

Parameters
pArray of probabilities.
retOutcome, same shape as p.

Definition at line 5341 of file prrng.h.

◆ decide_masked_impl()

template<class Generator , class Shape >
void prrng::pcg32_arrayBase< Generator, Shape >::decide_masked_impl ( const double *  p,
const bool *  mask,
bool *  ret 
)
inlineprotected

For each p take a decision.

Parameters
pArray of probabilities.
maskMask entries of p.
retOutcome, same shape as p.

Definition at line 5354 of file prrng.h.

◆ distance() [1/2]

template<class Generator , class Shape >
template<class R , class T >
R prrng::pcg32_arrayBase< Generator, Shape >::distance ( const T &  arg)
inline

Distance between two states.

See pcg32::distance().

Template Parameters
RArray, e.g. xt::array<int64_t> or xt::xtensor<int64_t, N>.
TArray, e.g. xt::array<int64_t> or xt::xtensor<int64_t, N>.
Parameters
argThe state to which to compare.

Definition at line 5290 of file prrng.h.

◆ distance() [2/2]

template<class Generator , class Shape >
template<class T >
auto prrng::pcg32_arrayBase< Generator, Shape >::distance ( const T &  arg) -> typename detail::return_type<int64_t, Shape>::type
inline

Distance between two states.

See pcg32::distance().

Template Parameters
TArray, e.g. xt::array<int64_t> or xt::xtensor<int64_t, N>.
Parameters
argThe state to which to compare.

Definition at line 5275 of file prrng.h.

◆ draw_list_double()

template<class Generator , class Shape >
void prrng::pcg32_arrayBase< Generator, Shape >::draw_list_double ( double *  data,
size_t  n 
)
inlineprotected

Draw n random numbers per array item, and write them to the correct position in data (assuming row-major storage!).

Parameters
dataPointer to the data (no bounds-check).
nThe number of random numbers per generator.

Definition at line 5467 of file prrng.h.

◆ draw_list_positive_double()

template<class Generator , class Shape >
void prrng::pcg32_arrayBase< Generator, Shape >::draw_list_positive_double ( double *  data,
size_t  n 
)
inlineprotected

Draw n random numbers per array item, and write them to the correct position in data (assuming row-major storage!).

Parameters
dataPointer to the data (no bounds-check).
nThe number of random numbers per generator.

Definition at line 5483 of file prrng.h.

◆ draw_list_uint32()

template<class Generator , class Shape >
void prrng::pcg32_arrayBase< Generator, Shape >::draw_list_uint32 ( uint32_t *  data,
uint32_t  bound,
size_t  n 
)
inlineprotected

Draw n random numbers per array item, and write them to the correct position in data (assuming row-major storage!).

Parameters
dataPointer to the data (no bounds-check).
boundThe upper bound of the random numbers.
nThe number of random numbers per generator.

Definition at line 5500 of file prrng.h.

◆ flat() [1/2]

template<class Generator , class Shape >
Generator & prrng::pcg32_arrayBase< Generator, Shape >::flat ( size_t  i)
inline

Return a reference to one generator, using a flat index.

Parameters
iFlat index.
Returns
Reference to underlying generator.

Definition at line 5157 of file prrng.h.

◆ flat() [2/2]

template<class Generator , class Shape >
const Generator & prrng::pcg32_arrayBase< Generator, Shape >::flat ( size_t  i) const
inline

Return a constant reference to one generator, using a flat index.

Parameters
iFlat index.
Returns
Reference to underlying generator.

Definition at line 5169 of file prrng.h.

◆ init() [1/2]

template<class Generator , class Shape >
template<class T >
void prrng::pcg32_arrayBase< Generator, Shape >::init ( const T &  initstate)
inlineprotected

Constructor alias.

Parameters
initstateState initiator for every item (accept default sequence initiator). The shape of the argument determines the shape of the generator array.

Definition at line 5066 of file prrng.h.

◆ init() [2/2]

template<class Generator , class Shape >
template<class T , class U >
void prrng::pcg32_arrayBase< Generator, Shape >::init ( const T &  initstate,
const U &  initseq 
)
inlineprotected

Constructor alias.

Parameters
initstateState initiator for every item (accept default sequence initiator).
initseqSequence initiator for every item. The shape of the argument determines the shape of the generator array.

Definition at line 5086 of file prrng.h.

◆ initseq() [1/2]

template<class Generator , class Shape >
template<class R >
R prrng::pcg32_arrayBase< Generator, Shape >::initseq ( )
inline

Return the sequence initiator of all generators.

See pcg32::initseq().

Returns
The sequence initiator of each generator.
Template Parameters
RThe type of the return array, e.g. xt::array<uint64_t> or xt::xtensor<uint64_t, N>

Definition at line 5255 of file prrng.h.

◆ initseq() [2/2]

template<class Generator , class Shape >
auto prrng::pcg32_arrayBase< Generator, Shape >::initseq ( ) -> typename detail::return_type<uint64_t, Shape>::type
inline

Return the sequence initiator of all generators.

See pcg32::initseq().

Returns
The sequence initiator of each generator.

Definition at line 5242 of file prrng.h.

◆ initstate() [1/2]

template<class Generator , class Shape >
template<class R >
R prrng::pcg32_arrayBase< Generator, Shape >::initstate ( )
inline

Return the state initiator of all generators.

See pcg32::initstate().

Returns
The state initiator of each generator.
The state initiator of each generator.

Definition at line 5224 of file prrng.h.

◆ initstate() [2/2]

template<class Generator , class Shape >
auto prrng::pcg32_arrayBase< Generator, Shape >::initstate ( ) -> typename detail::return_type<uint64_t, Shape>::type
inline

Return the state initiator of all generators.

See pcg32::initstate().

Returns
The state initiator of each generator.

Definition at line 5212 of file prrng.h.

◆ operator()() [1/2]

template<class Generator , class Shape >
template<class... Args>
Generator & prrng::pcg32_arrayBase< Generator, Shape >::operator() ( Args...  args)
inline

Return a reference to one generator, using an array index.

Parameters
argsArray index (number of arguments should correspond to the rank of the array).
Returns
Reference to underlying generator.

Definition at line 5110 of file prrng.h.

◆ operator()() [2/2]

template<class Generator , class Shape >
template<class... Args>
const Generator & prrng::pcg32_arrayBase< Generator, Shape >::operator() ( Args...  args) const
inline

Return a constant reference to one generator, using an array index.

Parameters
argsArray index (number of arguments should correspond to the rank of the array).
Returns
Reference to underlying generator.

Definition at line 5122 of file prrng.h.

◆ operator[]() [1/2]

template<class Generator , class Shape >
Generator & prrng::pcg32_arrayBase< Generator, Shape >::operator[] ( size_t  i)
inline

Return a reference to one generator, using a flat index.

Parameters
iFlat index.
Returns
Reference to underlying generator.

Definition at line 5133 of file prrng.h.

◆ operator[]() [2/2]

template<class Generator , class Shape >
const Generator & prrng::pcg32_arrayBase< Generator, Shape >::operator[] ( size_t  i) const
inline

Return a constant reference to one generator, using a flat index.

Parameters
iFlat index.
Returns
Reference to underlying generator.

Definition at line 5145 of file prrng.h.

◆ restore()

template<class Generator , class Shape >
template<class T >
void prrng::pcg32_arrayBase< Generator, Shape >::restore ( const T &  arg)
inline

Restore generators from a state.

See pcg32::restore().

Template Parameters
TThe type of the input array, e.g. xt::array<uint64_t> or xt::xtensor<uint64_t, N>
Parameters
argThe state of each generator.

Definition at line 5328 of file prrng.h.

◆ state() [1/2]

template<class Generator , class Shape >
template<class R >
R prrng::pcg32_arrayBase< Generator, Shape >::state ( )
inline

Return the state of all generators.

See pcg32::state().

Returns
The state of each generator.
Template Parameters
RThe type of the return array, e.g. xt::array<uint64_t> or xt::xtensor<uint64_t, N>

Definition at line 5194 of file prrng.h.

◆ state() [2/2]

template<class Generator , class Shape >
auto prrng::pcg32_arrayBase< Generator, Shape >::state ( ) -> typename detail::return_type<uint64_t, Shape>::type
inline

Return the state of all generators.

See pcg32::state().

Returns
The state of each generator.

Definition at line 5181 of file prrng.h.

Member Data Documentation

◆ m_gen

template<class Generator , class Shape >
std::vector<Generator> prrng::pcg32_arrayBase< Generator, Shape >::m_gen
protected

Underlying storage: one generator per array item.

Definition at line 5531 of file prrng.h.


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