prrng 1.12.1
Loading...
Searching...
No Matches
prrng::GeneratorBase_array< Derived, M > Class Template Reference

Base class of an array of pseudorandom number generators. More...

#include <prrng.h>

Inheritance diagram for prrng::GeneratorBase_array< Derived, M >:
prrng::pcg32_arrayBase< pcg32, std::vector< size_t > > prrng::pcg32_arrayBase< pcg32_index, std::vector< size_t > > prrng::pcg32_arrayBase< pcg32_index, std::array< size_t, N > > prrng::pcg32_arrayBase< pcg32, std::array< size_t, N > > prrng::pcg32_array prrng::pcg32_index_array prrng::pcg32_index_tensor< N > prrng::pcg32_tensor< N >

Public Types

using shape_type = M
 Type of the shape and strides lists.
 
using size_type = typename M::value_type
 Type of sizes.
 

Public Member Functions

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.
 
template<class T >
auto shape (T axis) const
 Return the shape of the array of generators along a specific axis.
 
template<class T >
auto flat_index (const T &index) const
 Return a flat index based on an array index specified as a list.
 
template<class T >
bool inbounds (const T &index) const
 Check if an index is in bounds (and of the correct rank).
 
template<class S >
auto random (const S &ishape) -> typename detail::composite_return_type< double, M, S >::type
 Per generator, generate an nd-array of random numbers \( 0 \leq r \leq 1 \).
 
template<class R , class S >
random (const S &ishape)
 Per generator, generate an nd-array of random numbers \( 0 \leq r \leq 1 \).
 
template<class I , std::size_t L>
auto random (const I(&ishape)[L]) -> typename detail::composite_return_type< double, M, std::array< size_t, L > >::type
 Per generator, generate an nd-array of random numbers \( 0 \leq r \leq 1 \).
 
template<class R , class I , std::size_t L>
random (const I(&ishape)[L])
 Per generator, generate an nd-array of random numbers \( 0 \leq r \leq 1 \).
 
template<class S , typename T >
auto randint (const S &ishape, T high) -> typename detail::composite_return_type< T, M, S >::type
 Per generator, generate an nd-array of random integers \( 0 \leq r \leq bound \).
 
template<class R , class S , typename T >
randint (const S &ishape, T high)
 Per generator, generate an nd-array of random integers \( 0 \leq r \leq bound \).
 
template<class I , std::size_t L, typename T >
auto randint (const I(&ishape)[L], T high) -> typename detail::composite_return_type< T, M, std::array< size_t, L > >::type
 Per generator, generate an nd-array of random integers \( 0 \leq r \leq bound \).
 
template<class R , class I , std::size_t L, typename T >
randint (const I(&ishape)[L], T high)
 Per generator, generate an nd-array of random integers \( 0 \leq r \leq bound \).
 
template<class S , typename T , typename U >
auto randint (const S &ishape, T low, U high) -> typename detail::composite_return_type< T, M, S >::type
 Per generator, generate an nd-array of random integers \( 0 \leq r \leq bound \).
 
template<class R , class S , typename T , typename U >
randint (const S &ishape, T low, U high)
 Per generator, generate an nd-array of random integers \( 0 \leq r \leq bound \).
 
template<class I , std::size_t L, typename T , typename U >
auto randint (const I(&ishape)[L], T low, U high) -> typename detail::composite_return_type< T, M, std::array< size_t, L > >::type
 Per generator, generate an nd-array of random integers \( 0 \leq r \leq bound \).
 
template<class R , class I , std::size_t L, typename T , typename U >
randint (const I(&ishape)[L], T low, U high)
 Per generator, generate an nd-array of random integers \( 0 \leq r \leq bound \).
 
template<class S >
auto delta (const S &ishape, double scale=1) -> typename detail::composite_return_type< double, M, S >::type
 Per generator, generate an nd-array of numbers that are delta distribution.
 
template<class R , class S >
delta (const S &ishape, double scale=1)
 Per generator, generate an nd-array of numbers that are delta distribution.
 
template<class I , std::size_t L>
auto delta (const I(&ishape)[L], double scale=1) -> typename detail::composite_return_type< double, M, std::array< size_t, L > >::type
 Per generator, generate an nd-array of numbers that are delta distribution.
 
template<class R , class I , std::size_t L>
delta (const I(&ishape)[L], double scale=1)
 Per generator, generate an nd-array of numbers that are delta distribution.
 
template<class S >
auto exponential (const S &ishape, double scale=1) -> typename detail::composite_return_type< double, M, S >::type
 Per generator, generate an nd-array of random numbers distributed according to an exponential distribution.
 
template<class R , class S >
exponential (const S &ishape, double scale=1)
 Per generator, generate an nd-array of random numbers distributed according to an exponential distribution.
 
template<class I , std::size_t L>
auto exponential (const I(&ishape)[L], double scale=1) -> typename detail::composite_return_type< double, M, std::array< size_t, L > >::type
 Per generator, generate an nd-array of random numbers distributed according to an exponential distribution.
 
template<class R , class I , std::size_t L>
exponential (const I(&ishape)[L], double scale=1)
 Per generator, generate an nd-array of random numbers distributed according to an exponential distribution.
 
template<class S >
auto power (const S &ishape, double k=1) -> typename detail::composite_return_type< double, M, S >::type
 Per generator, generate an nd-array of random numbers distributed according to an power distribution.
 
template<class R , class S >
power (const S &ishape, double k=1)
 Per generator, generate an nd-array of random numbers distributed according to an power distribution.
 
template<class I , std::size_t L>
auto power (const I(&ishape)[L], double k=1) -> typename detail::composite_return_type< double, M, std::array< size_t, L > >::type
 Per generator, generate an nd-array of random numbers distributed according to an power distribution.
 
template<class R , class I , std::size_t L>
power (const I(&ishape)[L], double k=1)
 Per generator, generate an nd-array of random numbers distributed according to an power distribution.
 
template<class S >
auto gamma (const S &ishape, double k=1, double scale=1) -> typename detail::composite_return_type< double, M, S >::type
 Per generator, generate an nd-array of random numbers distributed according to a Gamma distribution.
 
template<class R , class S >
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.
 
template<class I , std::size_t L>
auto gamma (const I(&ishape)[L], double k=1, double scale=1) -> typename detail::composite_return_type< double, M, std::array< size_t, L > >::type
 Per generator, generate an nd-array of random numbers distributed according to a Gamma distribution.
 
template<class R , class I , std::size_t L>
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.
 
template<class S >
auto pareto (const S &ishape, double k=1, double scale=1) -> typename detail::composite_return_type< double, M, S >::type
 Per generator, generate an nd-array of random numbers distributed according to a Pareto distribution.
 
template<class R , class S >
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.
 
template<class I , std::size_t L>
auto pareto (const I(&ishape)[L], double k=1, double scale=1) -> typename detail::composite_return_type< double, M, std::array< size_t, L > >::type
 Per generator, generate an nd-array of random numbers distributed according to a Pareto distribution.
 
template<class R , class I , std::size_t L>
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.
 
template<class S >
auto weibull (const S &ishape, double k=1, double scale=1) -> typename detail::composite_return_type< double, M, S >::type
 Per generator, generate an nd-array of random numbers distributed according to a Weibull distribution.
 
template<class R , class S >
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.
 
template<class I , std::size_t L>
auto weibull (const I(&ishape)[L], double k=1, double scale=1) -> typename detail::composite_return_type< double, M, std::array< size_t, L > >::type
 Per generator, generate an nd-array of random numbers distributed according to a Weibull distribution.
 
template<class R , class I , std::size_t L>
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.
 
template<class S >
auto normal (const S &ishape, double mu=0, double sigma=1) -> typename detail::composite_return_type< double, M, S >::type
 Per generator, generate an nd-array of random numbers distributed according to a normal distribution.
 
template<class R , class S >
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.
 
template<class I , std::size_t L>
auto normal (const I(&ishape)[L], double mu=0, double sigma=1) -> typename detail::composite_return_type< double, M, std::array< size_t, L > >::type
 Per generator, generate an nd-array of random numbers distributed according to a normal distribution.
 
template<class R , class I , std::size_t L>
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.
 
template<class T >
auto cumsum_random (const T &n) -> typename detail::return_type< double, M >::type
 Per generator, return the result of the cumulative sum of n random numbers.
 
template<class R , class T >
cumsum_random (const T &n)
 Per generator, return the result of the cumulative sum of n random numbers.
 
template<class T >
auto cumsum_delta (const T &n, double scale=1) -> typename detail::return_type< double, M >::type
 Per generator, return the result of the cumulative sum of n random numbers, distributed according to a delta distribution,.
 
template<class R , class T >
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,.
 
template<class T >
auto cumsum_exponential (const T &n, double scale=1) -> typename detail::return_type< double, M >::type
 Per generator, return the result of the cumulative sum of n random numbers, distributed according to an exponential distribution, see exponential_distribution(),.
 
template<class R , class T >
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(),.
 
template<class T >
auto cumsum_power (const T &n, double k=1) -> typename detail::return_type< double, M >::type
 Per generator, return the result of the cumulative sum of n random numbers, distributed according to an power distribution, see power_distribution(),.
 
template<class R , class T >
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(),.
 
template<class T >
auto cumsum_gamma (const T &n, double k=1, double scale=1) -> typename detail::return_type< double, M >::type
 Per generator, return the result of the cumulative sum of n random numbers, distributed according to a gamma distribution, see gamma_distribution(),.
 
template<class R , class T >
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(),.
 
template<class T >
auto cumsum_pareto (const T &n, double k=1, double scale=1) -> typename detail::return_type< double, M >::type
 Per generator, return the result of the cumulative sum of n random numbers, distributed according to a pareto distribution, see pareto_distribution(),.
 
template<class R , class T >
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(),.
 
template<class T >
auto cumsum_weibull (const T &n, double k=1, double scale=1) -> typename detail::return_type< double, M >::type
 Per generator, return the result of the cumulative sum of n random numbers, distributed according to a weibull distribution, see weibull_distribution(),.
 
template<class R , class T >
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(),.
 
template<class T >
auto cumsum_normal (const T &n, double mu=0, double sigma=1) -> typename detail::return_type< double, M >::type
 Per generator, return the result of the cumulative sum of n random numbers, distributed according to a normal distribution, see normal_distribution(),.
 
template<class R , class T >
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(),.
 
template<class P >
auto decide (const P &p) -> typename detail::return_type< bool, P >::type
 Decide based on probability per generator.
 
template<class P , class R >
decide (const P &p)
 Decide based on probability per generator.
 
template<class P , class R >
void decide (const P &p, R &ret)
 Decide based on probability per generator.
 
template<class P , class T >
auto decide_masked (const P &p, const T &mask) -> typename detail::return_type< bool, P >::type
 Decide based on probability per generator.
 
template<class P , class T , class R >
decide_masked (const P &p, const T &mask)
 Decide based on probability per generator.
 
template<class P , class T , class R >
void decide_masked (const P &p, const T &mask, R &ret)
 Decide based on probability per generator.
 

Protected Attributes

size_type m_size = 0
 See size().
 
shape_type m_shape
 See shape().
 
shape_type m_strides
 The strides of the array of generators.
 

Detailed Description

template<class Derived, class M>
class prrng::GeneratorBase_array< Derived, M >

Base class of an array of pseudorandom number generators.

This class provides common methods, but itself does not really do much. See the description of derived classed for information.

Template Parameters
MType to use storage of the shape and array vectors. E.g. std::vector or std::array

Definition at line 3967 of file prrng.h.

Member Typedef Documentation

◆ shape_type

template<class Derived , class M >
using prrng::GeneratorBase_array< Derived, M >::shape_type = M

Type of the shape and strides lists.

Definition at line 3969 of file prrng.h.

◆ size_type

template<class Derived , class M >
using prrng::GeneratorBase_array< Derived, M >::size_type = typename M::value_type

Type of sizes.

Definition at line 3970 of file prrng.h.

Member Function Documentation

◆ cumsum_delta() [1/2]

template<class Derived , class M >
template<class R , class T >
R prrng::GeneratorBase_array< Derived, M >::cumsum_delta ( const T &  n,
double  scale = 1 
)
inline

Per generator, return the result of the cumulative sum of n random numbers, distributed according to a delta distribution,.

Parameters
nNumber of steps.
scaleScale.
Returns
Cumulative sum.

Definition at line 4589 of file prrng.h.

◆ cumsum_delta() [2/2]

template<class Derived , class M >
template<class T >
auto prrng::GeneratorBase_array< Derived, M >::cumsum_delta ( const T &  n,
double  scale = 1 
) -> typename detail::return_type<double, M>::type
inline

Per generator, return the result of the cumulative sum of n random numbers, distributed according to a delta distribution,.

Parameters
nNumber of steps.
scaleScale.
Returns
Cumulative sum.

Definition at line 4571 of file prrng.h.

◆ cumsum_exponential() [1/2]

template<class Derived , class M >
template<class R , class T >
R prrng::GeneratorBase_array< Derived, M >::cumsum_exponential ( const T &  n,
double  scale = 1 
)
inline

Per generator, return the result of the cumulative sum of n random numbers, distributed according to an exponential distribution, see exponential_distribution(),.

Parameters
nNumber of steps.
scaleScale.
Returns
Cumulative sum.

Definition at line 4623 of file prrng.h.

◆ cumsum_exponential() [2/2]

template<class Derived , class M >
template<class T >
auto prrng::GeneratorBase_array< Derived, M >::cumsum_exponential ( const T &  n,
double  scale = 1 
) -> typename detail::return_type<double, M>::type
inline

Per generator, return the result of the cumulative sum of n random numbers, distributed according to an exponential distribution, see exponential_distribution(),.

Parameters
nNumber of steps.
scaleScale.
Returns
Cumulative sum.

Definition at line 4606 of file prrng.h.

◆ cumsum_gamma() [1/2]

template<class Derived , class M >
template<class R , class T >
R prrng::GeneratorBase_array< Derived, M >::cumsum_gamma ( const T &  n,
double  k = 1,
double  scale = 1 
)
inline

Per generator, return the result of the cumulative sum of n random numbers, distributed according to a gamma distribution, see gamma_distribution(),.

Parameters
nNumber of steps.
kShape parameter.
scaleScale parameter.
Returns
Cumulative sum.

Definition at line 4688 of file prrng.h.

◆ cumsum_gamma() [2/2]

template<class Derived , class M >
template<class T >
auto prrng::GeneratorBase_array< Derived, M >::cumsum_gamma ( const T &  n,
double  k = 1,
double  scale = 1 
) -> typename detail::return_type<double, M>::type
inline

Per generator, return the result of the cumulative sum of n random numbers, distributed according to a gamma distribution, see gamma_distribution(),.

Parameters
nNumber of steps.
kShape parameter.
scaleScale parameter.
Returns
Cumulative sum.

Definition at line 4670 of file prrng.h.

◆ cumsum_normal() [1/2]

template<class Derived , class M >
template<class R , class T >
R prrng::GeneratorBase_array< Derived, M >::cumsum_normal ( const T &  n,
double  mu = 0,
double  sigma = 1 
)
inline

Per generator, return the result of the cumulative sum of n random numbers, distributed according to a normal distribution, see normal_distribution(),.

Parameters
nNumber of steps.
muMean.
sigmaStandard deviation.
Returns
Cumulative sum.

Definition at line 4790 of file prrng.h.

◆ cumsum_normal() [2/2]

template<class Derived , class M >
template<class T >
auto prrng::GeneratorBase_array< Derived, M >::cumsum_normal ( const T &  n,
double  mu = 0,
double  sigma = 1 
) -> typename detail::return_type<double, M>::type
inline

Per generator, return the result of the cumulative sum of n random numbers, distributed according to a normal distribution, see normal_distribution(),.

Parameters
nNumber of steps.
muMean.
sigmaStandard deviation.
Returns
Cumulative sum.

Definition at line 4772 of file prrng.h.

◆ cumsum_pareto() [1/2]

template<class Derived , class M >
template<class R , class T >
R prrng::GeneratorBase_array< Derived, M >::cumsum_pareto ( const T &  n,
double  k = 1,
double  scale = 1 
)
inline

Per generator, return the result of the cumulative sum of n random numbers, distributed according to a pareto distribution, see pareto_distribution(),.

Parameters
nNumber of steps.
kShape parameter.
scaleScale parameter.
Returns
Cumulative sum.

Definition at line 4722 of file prrng.h.

◆ cumsum_pareto() [2/2]

template<class Derived , class M >
template<class T >
auto prrng::GeneratorBase_array< Derived, M >::cumsum_pareto ( const T &  n,
double  k = 1,
double  scale = 1 
) -> typename detail::return_type<double, M>::type
inline

Per generator, return the result of the cumulative sum of n random numbers, distributed according to a pareto distribution, see pareto_distribution(),.

Parameters
nNumber of steps.
kShape.
scaleScale.
Returns
Cumulative sum.

Definition at line 4704 of file prrng.h.

◆ cumsum_power() [1/2]

template<class Derived , class M >
template<class R , class T >
R prrng::GeneratorBase_array< Derived, M >::cumsum_power ( const T &  n,
double  k = 1 
)
inline

Per generator, return the result of the cumulative sum of n random numbers, distributed according to an power distribution, see power_distribution(),.

Parameters
nNumber of steps.
kScale.
Returns
Cumulative sum.

Definition at line 4654 of file prrng.h.

◆ cumsum_power() [2/2]

template<class Derived , class M >
template<class T >
auto prrng::GeneratorBase_array< Derived, M >::cumsum_power ( const T &  n,
double  k = 1 
) -> typename detail::return_type<double, M>::type
inline

Per generator, return the result of the cumulative sum of n random numbers, distributed according to an power distribution, see power_distribution(),.

Parameters
nNumber of steps.
kScale.
Returns
Cumulative sum.

Definition at line 4638 of file prrng.h.

◆ cumsum_random() [1/2]

template<class Derived , class M >
template<class R , class T >
R prrng::GeneratorBase_array< Derived, M >::cumsum_random ( const T &  n)
inline

Per generator, return the result of the cumulative sum of n random numbers.

Parameters
nNumber of steps.
Returns
Cumulative sum.

Definition at line 4556 of file prrng.h.

◆ cumsum_random() [2/2]

template<class Derived , class M >
template<class T >
auto prrng::GeneratorBase_array< Derived, M >::cumsum_random ( const T &  n) -> typename detail::return_type<double, M>::type
inline

Per generator, return the result of the cumulative sum of n random numbers.

Parameters
nNumber of steps.
Returns
Cumulative sum.

Definition at line 4542 of file prrng.h.

◆ cumsum_weibull() [1/2]

template<class Derived , class M >
template<class R , class T >
R prrng::GeneratorBase_array< Derived, M >::cumsum_weibull ( const T &  n,
double  k = 1,
double  scale = 1 
)
inline

Per generator, return the result of the cumulative sum of n random numbers, distributed according to a weibull distribution, see weibull_distribution(),.

Parameters
nNumber of steps.
kShape parameter.
scaleScale parameter.
Returns
Cumulative sum.

Definition at line 4756 of file prrng.h.

◆ cumsum_weibull() [2/2]

template<class Derived , class M >
template<class T >
auto prrng::GeneratorBase_array< Derived, M >::cumsum_weibull ( const T &  n,
double  k = 1,
double  scale = 1 
) -> typename detail::return_type<double, M>::type
inline

Per generator, return the result of the cumulative sum of n random numbers, distributed according to a weibull distribution, see weibull_distribution(),.

Parameters
nNumber of steps.
kShape.
scaleScale.
Returns
Cumulative sum.

Definition at line 4738 of file prrng.h.

◆ decide() [1/3]

template<class Derived , class M >
template<class P , class R >
R prrng::GeneratorBase_array< Derived, M >::decide ( const P &  p)
inline

Decide based on probability per generator.

This is fully equivalent to generators.random({}) <= p, but avoids the memory allocation of random`.

Parameters
pProbability per generator [0, 1).
Returns
Decision for each p.

Definition at line 4819 of file prrng.h.

◆ decide() [2/3]

template<class Derived , class M >
template<class P >
auto prrng::GeneratorBase_array< Derived, M >::decide ( const P &  p) -> typename detail::return_type<bool, P>::type
inline

Decide based on probability per generator.

This is fully equivalent to generators.random({}) <= p, but avoids the memory allocation of random`.

Parameters
pProbability per generator [0, 1).
Returns
Decision for each p.

Definition at line 4806 of file prrng.h.

◆ decide() [3/3]

template<class Derived , class M >
template<class P , class R >
void prrng::GeneratorBase_array< Derived, M >::decide ( const P &  p,
R &  ret 
)
inline

Decide based on probability per generator.

This is fully equivalent to generators.random({}) <= p, but avoids the memory allocation of random`.

Parameters
pProbability per generator [0, 1).
retDecision for each p.

Definition at line 4836 of file prrng.h.

◆ decide_masked() [1/3]

template<class Derived , class M >
template<class P , class T , class R >
R prrng::GeneratorBase_array< Derived, M >::decide_masked ( const P &  p,
const T &  mask 
)
inline

Decide based on probability per generator.

This is fully equivalent to generators.random({}) <= p, but avoids the memory allocation of random.

Parameters
pProbability per generator [0, 1).
maskWhere true the decision is false (no random number is drawn there).
Returns
Decision for each p.

Definition at line 4871 of file prrng.h.

◆ decide_masked() [2/3]

template<class Derived , class M >
template<class P , class T >
auto prrng::GeneratorBase_array< Derived, M >::decide_masked ( const P &  p,
const T &  mask 
) -> typename detail::return_type<bool, P>::type
inline

Decide based on probability per generator.

This is fully equivalent to generators.random({}) <= p, but avoids the memory allocation of random.

Parameters
pProbability per generator [0, 1).
maskWhere true the decision is false (no random number is drawn there).
Returns
Decision for each p.

Definition at line 4857 of file prrng.h.

◆ decide_masked() [3/3]

template<class Derived , class M >
template<class P , class T , class R >
void prrng::GeneratorBase_array< Derived, M >::decide_masked ( const P &  p,
const T &  mask,
R &  ret 
)
inline

Decide based on probability per generator.

This is fully equivalent to generators.random({}) <= p, but avoids the memory allocation of random.

Parameters
pProbability per generator [0, 1).
maskWhere true the decision is false (no random number is drawn there).
retDecision for each p.

Definition at line 4890 of file prrng.h.

◆ delta() [1/4]

template<class Derived , class M >
template<class R , class I , std::size_t L>
R prrng::GeneratorBase_array< Derived, M >::delta ( const I(&)  ishape[L],
double  scale = 1 
)
inline

Per generator, generate an nd-array of numbers that are delta distribution.

These numbers are not random; calling this function does not change the state of the generators.

Parameters
ishapeThe shape of the nd-array drawn per generator.
scaleThe value of the 'peak' of the delta distribution.
Returns
The array of arrays of samples: [shape, ishape]
Template Parameters
Rreturn type, e.g. xt::xtensor<double, 1>

Definition at line 4227 of file prrng.h.

◆ delta() [2/4]

template<class Derived , class M >
template<class I , std::size_t L>
auto prrng::GeneratorBase_array< Derived, M >::delta ( const I(&)  ishape[L],
double  scale = 1 
) -> typename detail::composite_return_type<double, M, std::array<size_t, L>>::type
inline

Per generator, generate an nd-array of numbers that are delta distribution.

These numbers are not random; calling this function does not change the state of the generators.

Parameters
ishapeThe shape of the nd-array drawn per generator.
scaleThe value of the 'peak' of the delta distribution.
Returns
The array of arrays of samples: [shape, ishape]

Definition at line 4215 of file prrng.h.

◆ delta() [3/4]

template<class Derived , class M >
template<class R , class S >
R prrng::GeneratorBase_array< Derived, M >::delta ( const S &  ishape,
double  scale = 1 
)
inline

Per generator, generate an nd-array of numbers that are delta distribution.

These numbers are not random; calling this function does not change the state of the generators.

Parameters
ishapeThe shape of the nd-array drawn per generator.
scaleThe value of the 'peak' of the delta distribution.
Returns
The array of arrays of samples: [shape, ishape]
Template Parameters
Rreturn type, e.g. xt::xtensor<double, 1>

Definition at line 4206 of file prrng.h.

◆ delta() [4/4]

template<class Derived , class M >
template<class S >
auto prrng::GeneratorBase_array< Derived, M >::delta ( const S &  ishape,
double  scale = 1 
) -> typename detail::composite_return_type<double, M, S>::type
inline

Per generator, generate an nd-array of numbers that are delta distribution.

These numbers are not random; calling this function does not change the state of the generators.

Parameters
ishapeThe shape of the nd-array drawn per generator.
scaleThe value of the 'peak' of the delta distribution.
Returns
The array of arrays of samples: [shape, ishape]

Definition at line 4194 of file prrng.h.

◆ exponential() [1/4]

template<class Derived , class M >
template<class R , class I , std::size_t L>
R prrng::GeneratorBase_array< Derived, M >::exponential ( const I(&)  ishape[L],
double  scale = 1 
)
inline

Per generator, generate an nd-array of random numbers distributed according to an exponential distribution.

Parameters
ishapeThe shape of the nd-array drawn per generator.
scaleScale.
Returns
The array of arrays of samples: [shape, ishape]
Template Parameters
Rreturn type, e.g. xt::xtensor<double, 1>

Definition at line 4274 of file prrng.h.

◆ exponential() [2/4]

template<class Derived , class M >
template<class I , std::size_t L>
auto prrng::GeneratorBase_array< Derived, M >::exponential ( const I(&)  ishape[L],
double  scale = 1 
) -> typename detail::composite_return_type<double, M, std::array<size_t, L>>::type
inline

Per generator, generate an nd-array of random numbers distributed according to an exponential distribution.

Parameters
ishapeThe shape of the nd-array drawn per generator.
scaleScale.
Returns
The array of arrays of samples: [shape, ishape]

Definition at line 4262 of file prrng.h.

◆ exponential() [3/4]

template<class Derived , class M >
template<class R , class S >
R prrng::GeneratorBase_array< Derived, M >::exponential ( const S &  ishape,
double  scale = 1 
)
inline

Per generator, generate an nd-array of random numbers distributed according to an exponential distribution.

Parameters
ishapeThe shape of the nd-array drawn per generator.
scaleScale.
Returns
The array of arrays of samples: [shape, ishape]
Template Parameters
Rreturn type, e.g. xt::xtensor<double, 1>

Definition at line 4253 of file prrng.h.

◆ exponential() [4/4]

template<class Derived , class M >
template<class S >
auto prrng::GeneratorBase_array< Derived, M >::exponential ( const S &  ishape,
double  scale = 1 
) -> typename detail::composite_return_type<double, M, S>::type
inline

Per generator, generate an nd-array of random numbers distributed according to an exponential distribution.

Parameters
ishapeThe shape of the nd-array drawn per generator.
scaleScale.
Returns
The array of arrays of samples: [shape, ishape]

Definition at line 4241 of file prrng.h.

◆ flat_index()

template<class Derived , class M >
template<class T >
auto prrng::GeneratorBase_array< Derived, M >::flat_index ( const T &  index) const
inline

Return a flat index based on an array index specified as a list.

Parameters
indexArray index, e.g. as std::vector.
Returns
Flat index.

Definition at line 4021 of file prrng.h.

◆ gamma() [1/4]

template<class Derived , class M >
template<class R , class I , std::size_t L>
R prrng::GeneratorBase_array< Derived, M >::gamma ( const I(&)  ishape[L],
double  k = 1,
double  scale = 1 
)
inline

Per generator, generate an nd-array of random numbers distributed according to a Gamma distribution.

Only available when compiled with PRRNG_USE_BOOST (e.g. using the CMake target prrng::use_boost).

Parameters
ishapeThe shape of the nd-array drawn per generator.
kShape parameter.
scaleScale parameter.
Returns
The array of arrays of samples: [shape, ishape]
Template Parameters
Rreturn type, e.g. xt::xtensor<double, 1>

Definition at line 4371 of file prrng.h.

◆ gamma() [2/4]

template<class Derived , class M >
template<class I , std::size_t L>
auto prrng::GeneratorBase_array< Derived, M >::gamma ( const I(&)  ishape[L],
double  k = 1,
double  scale = 1 
) -> typename detail::composite_return_type<double, M, std::array<size_t, L>>::type
inline

Per generator, generate an nd-array of random numbers distributed according to a Gamma distribution.

Only available when compiled with PRRNG_USE_BOOST (e.g. using the CMake target prrng::use_boost).

Parameters
ishapeThe shape of the nd-array drawn per generator.
kShape parameter.
scaleScale parameter.
Returns
The array of arrays of samples: [shape, ishape]

Definition at line 4359 of file prrng.h.

◆ gamma() [3/4]

template<class Derived , class M >
template<class R , class S >
R prrng::GeneratorBase_array< Derived, M >::gamma ( const S &  ishape,
double  k = 1,
double  scale = 1 
)
inline

Per generator, generate an nd-array of random numbers distributed according to a Gamma distribution.

Only available when compiled with PRRNG_USE_BOOST (e.g. using the CMake target prrng::use_boost).

Parameters
ishapeThe shape of the nd-array drawn per generator.
kShape parameter.
scaleScale parameter.
Returns
The array of arrays of samples: [shape, ishape]
Template Parameters
Rreturn type, e.g. xt::xtensor<double, 1>

Definition at line 4350 of file prrng.h.

◆ gamma() [4/4]

template<class Derived , class M >
template<class S >
auto prrng::GeneratorBase_array< Derived, M >::gamma ( const S &  ishape,
double  k = 1,
double  scale = 1 
) -> typename detail::composite_return_type<double, M, S>::type
inline

Per generator, generate an nd-array of random numbers distributed according to a Gamma distribution.

Only available when compiled with PRRNG_USE_BOOST (e.g. using the CMake target prrng::use_boost).

Parameters
ishapeThe shape of the nd-array drawn per generator.
kShape parameter.
scaleScale parameter.
Returns
The array of arrays of samples: [shape, ishape]

Definition at line 4338 of file prrng.h.

◆ inbounds()

template<class Derived , class M >
template<class T >
bool prrng::GeneratorBase_array< Derived, M >::inbounds ( const T &  index) const
inline

Check if an index is in bounds (and of the correct rank).

Returns
false if out-of-bounds, true otherwise.

Definition at line 4033 of file prrng.h.

◆ normal() [1/4]

template<class Derived , class M >
template<class R , class I , std::size_t L>
R prrng::GeneratorBase_array< Derived, M >::normal ( const I(&)  ishape[L],
double  mu = 0,
double  sigma = 1 
)
inline

Per generator, generate an nd-array of random numbers distributed according to a normal distribution.

Internally, the output of random() is converted using the cumulative density

\( \Phi(x) = \frac{1}{2} \left[ 1 + \mathrm{erf}\left( \frac{x - \mu}{\sigma \sqrt{2}} \right) \right]\)

such that the output r from random() leads to

\( x = \mu + \sigma \sqrt{2} \mathrm{erf}^{-1} (2r - 1) \)

Parameters
ishapeThe shape of the nd-array drawn per generator.
muThe average.
sigmaThe standard deviation.
Returns
The array of arrays of samples: [shape, ishape]
Template Parameters
Rreturn type, e.g. xt::xtensor<double, 1>

Definition at line 4531 of file prrng.h.

◆ normal() [2/4]

template<class Derived , class M >
template<class I , std::size_t L>
auto prrng::GeneratorBase_array< Derived, M >::normal ( const I(&)  ishape[L],
double  mu = 0,
double  sigma = 1 
) -> typename detail::composite_return_type<double, M, std::array<size_t, L>>::type
inline

Per generator, generate an nd-array of random numbers distributed according to a normal distribution.

Internally, the output of random() is converted using the cumulative density

\( \Phi(x) = \frac{1}{2} \left[ 1 + \mathrm{erf}\left( \frac{x - \mu}{\sigma \sqrt{2}} \right) \right]\)

such that the output r from random() leads to

\( x = \mu + \sigma \sqrt{2} \mathrm{erf}^{-1} (2r - 1) \)

Parameters
ishapeThe shape of the nd-array drawn per generator.
muThe average.
sigmaThe standard deviation.
Returns
The array of arrays of samples: [shape, ishape]

Definition at line 4519 of file prrng.h.

◆ normal() [3/4]

template<class Derived , class M >
template<class R , class S >
R prrng::GeneratorBase_array< Derived, M >::normal ( const S &  ishape,
double  mu = 0,
double  sigma = 1 
)
inline

Per generator, generate an nd-array of random numbers distributed according to a normal distribution.

Internally, the output of random() is converted using the cumulative density

\( \Phi(x) = \frac{1}{2} \left[ 1 + \mathrm{erf}\left( \frac{x - \mu}{\sigma \sqrt{2}} \right) \right]\)

such that the output r from random() leads to

\( x = \mu + \sigma \sqrt{2} \mathrm{erf}^{-1} (2r - 1) \)

Parameters
ishapeThe shape of the nd-array drawn per generator.
muThe average.
sigmaThe standard deviation.
Returns
The array of arrays of samples: [shape, ishape]
Template Parameters
Rreturn type, e.g. xt::xtensor<double, 1>

Definition at line 4510 of file prrng.h.

◆ normal() [4/4]

template<class Derived , class M >
template<class S >
auto prrng::GeneratorBase_array< Derived, M >::normal ( const S &  ishape,
double  mu = 0,
double  sigma = 1 
) -> typename detail::composite_return_type<double, M, S>::type
inline

Per generator, generate an nd-array of random numbers distributed according to a normal distribution.

Internally, the output of random() is converted using the cumulative density

\( \Phi(x) = \frac{1}{2} \left[ 1 + \mathrm{erf}\left( \frac{x - \mu}{\sigma \sqrt{2}} \right) \right]\)

such that the output r from random() leads to

\( x = \mu + \sigma \sqrt{2} \mathrm{erf}^{-1} (2r - 1) \)

Parameters
ishapeThe shape of the nd-array drawn per generator.
muThe average.
sigmaThe standard deviation.
Returns
The array of arrays of samples: [shape, ishape]

Definition at line 4498 of file prrng.h.

◆ pareto() [1/4]

template<class Derived , class M >
template<class R , class I , std::size_t L>
R prrng::GeneratorBase_array< Derived, M >::pareto ( const I(&)  ishape[L],
double  k = 1,
double  scale = 1 
)
inline

Per generator, generate an nd-array of random numbers distributed according to a Pareto distribution.

Parameters
ishapeThe shape of the nd-array drawn per generator.
kThe "shape" parameter \( k \).
scaleThe "scale" parameter \( \lambda \).
Returns
The array of arrays of samples: [shape, ishape]
Template Parameters
Rreturn type, e.g. xt::xtensor<double, 1>

Definition at line 4419 of file prrng.h.

◆ pareto() [2/4]

template<class Derived , class M >
template<class I , std::size_t L>
auto prrng::GeneratorBase_array< Derived, M >::pareto ( const I(&)  ishape[L],
double  k = 1,
double  scale = 1 
) -> typename detail::composite_return_type<double, M, std::array<size_t, L>>::type
inline

Per generator, generate an nd-array of random numbers distributed according to a Pareto distribution.

Parameters
ishapeThe shape of the nd-array drawn per generator.
kThe "shape" parameter \( k \).
scaleThe "scale" parameter \( \lambda \).
Returns
The array of arrays of samples: [shape, ishape]

Definition at line 4407 of file prrng.h.

◆ pareto() [3/4]

template<class Derived , class M >
template<class R , class S >
R prrng::GeneratorBase_array< Derived, M >::pareto ( const S &  ishape,
double  k = 1,
double  scale = 1 
)
inline

Per generator, generate an nd-array of random numbers distributed according to a Pareto distribution.

Parameters
ishapeThe shape of the nd-array drawn per generator.
kThe "shape" parameter \( k \).
scaleThe "scale" parameter \( \lambda \).
Returns
The array of arrays of samples: [shape, ishape]
Template Parameters
Rreturn type, e.g. xt::xtensor<double, 1>

Definition at line 4398 of file prrng.h.

◆ pareto() [4/4]

template<class Derived , class M >
template<class S >
auto prrng::GeneratorBase_array< Derived, M >::pareto ( const S &  ishape,
double  k = 1,
double  scale = 1 
) -> typename detail::composite_return_type<double, M, S>::type
inline

Per generator, generate an nd-array of random numbers distributed according to a Pareto distribution.

Parameters
ishapeThe shape of the nd-array drawn per generator.
kThe "shape" parameter \( k \).
scaleThe "scale" parameter \( \lambda \).
Returns
The array of arrays of samples: [shape, ishape]

Definition at line 4386 of file prrng.h.

◆ power() [1/4]

template<class Derived , class M >
template<class R , class I , std::size_t L>
R prrng::GeneratorBase_array< Derived, M >::power ( const I(&)  ishape[L],
double  k = 1 
)
inline

Per generator, generate an nd-array of random numbers distributed according to an power distribution.

Parameters
ishapeThe shape of the nd-array drawn per generator.
kScale.
Returns
The array of arrays of samples: [shape, ishape]
Template Parameters
Rreturn type, e.g. xt::xtensor<double, 1>

Definition at line 4321 of file prrng.h.

◆ power() [2/4]

template<class Derived , class M >
template<class I , std::size_t L>
auto prrng::GeneratorBase_array< Derived, M >::power ( const I(&)  ishape[L],
double  k = 1 
) -> typename detail::composite_return_type<double, M, std::array<size_t, L>>::type
inline

Per generator, generate an nd-array of random numbers distributed according to an power distribution.

Parameters
ishapeThe shape of the nd-array drawn per generator.
kScale.
Returns
The array of arrays of samples: [shape, ishape]

Definition at line 4309 of file prrng.h.

◆ power() [3/4]

template<class Derived , class M >
template<class R , class S >
R prrng::GeneratorBase_array< Derived, M >::power ( const S &  ishape,
double  k = 1 
)
inline

Per generator, generate an nd-array of random numbers distributed according to an power distribution.

Parameters
ishapeThe shape of the nd-array drawn per generator.
kScale.
Returns
The array of arrays of samples: [shape, ishape]
Template Parameters
Rreturn type, e.g. xt::xtensor<double, 1>

Definition at line 4300 of file prrng.h.

◆ power() [4/4]

template<class Derived , class M >
template<class S >
auto prrng::GeneratorBase_array< Derived, M >::power ( const S &  ishape,
double  k = 1 
) -> typename detail::composite_return_type<double, M, S>::type
inline

Per generator, generate an nd-array of random numbers distributed according to an power distribution.

Parameters
ishapeThe shape of the nd-array drawn per generator.
kScale.
Returns
The array of arrays of samples: [shape, ishape]

Definition at line 4288 of file prrng.h.

◆ randint() [1/8]

template<class Derived , class M >
template<class R , class I , std::size_t L, typename T >
R prrng::GeneratorBase_array< Derived, M >::randint ( const I(&)  ishape[L],
high 
)
inline

Per generator, generate an nd-array of random integers \( 0 \leq r \leq bound \).

Parameters
ishapeThe shape of the nd-array drawn per generator.
highThe upper bound of the interval.
Returns
The array of arrays of samples: [shape, ishape]
Template Parameters
Rreturn type, e.g. xt::xtensor<double, 1>

Definition at line 4132 of file prrng.h.

◆ randint() [2/8]

template<class Derived , class M >
template<class I , std::size_t L, typename T >
auto prrng::GeneratorBase_array< Derived, M >::randint ( const I(&)  ishape[L],
high 
) -> typename detail::composite_return_type<T, M, std::array<size_t, L>>::type
inline

Per generator, generate an nd-array of random integers \( 0 \leq r \leq bound \).

Parameters
ishapeThe shape of the nd-array drawn per generator.
highThe upper bound of the interval.
Returns
The array of arrays of samples: [shape, ishape]

Definition at line 4120 of file prrng.h.

◆ randint() [3/8]

template<class Derived , class M >
template<class R , class I , std::size_t L, typename T , typename U >
R prrng::GeneratorBase_array< Derived, M >::randint ( const I(&)  ishape[L],
low,
high 
)
inline

Per generator, generate an nd-array of random integers \( 0 \leq r \leq bound \).

Parameters
ishapeThe shape of the nd-array drawn per generator.
lowThe lower bound of the interval.
highThe upper bound of the interval.
Returns
The array of arrays of samples: [shape, ishape]
Template Parameters
Rreturn type, e.g. xt::xtensor<double, 1>

Definition at line 4179 of file prrng.h.

◆ randint() [4/8]

template<class Derived , class M >
template<class I , std::size_t L, typename T , typename U >
auto prrng::GeneratorBase_array< Derived, M >::randint ( const I(&)  ishape[L],
low,
high 
) -> typename detail::composite_return_type<T, M, std::array<size_t, L>>::type
inline

Per generator, generate an nd-array of random integers \( 0 \leq r \leq bound \).

Parameters
ishapeThe shape of the nd-array drawn per generator.
lowThe lower bound of the interval.
highThe upper bound of the interval.
Returns
The array of arrays of samples: [shape, ishape]

Definition at line 4167 of file prrng.h.

◆ randint() [5/8]

template<class Derived , class M >
template<class R , class S , typename T >
R prrng::GeneratorBase_array< Derived, M >::randint ( const S &  ishape,
high 
)
inline

Per generator, generate an nd-array of random integers \( 0 \leq r \leq bound \).

Parameters
ishapeThe shape of the nd-array drawn per generator.
highThe upper bound of the interval.
Returns
The array of arrays of samples: [shape, ishape]
Template Parameters
Rreturn type, e.g. xt::xtensor<double, 1>

Definition at line 4111 of file prrng.h.

◆ randint() [6/8]

template<class Derived , class M >
template<class S , typename T >
auto prrng::GeneratorBase_array< Derived, M >::randint ( const S &  ishape,
high 
) -> typename detail::composite_return_type<T, M, S>::type
inline

Per generator, generate an nd-array of random integers \( 0 \leq r \leq bound \).

Parameters
ishapeThe shape of the nd-array drawn per generator.
highThe upper bound of the interval.
Returns
The array of arrays of samples: [shape, ishape]

Definition at line 4100 of file prrng.h.

◆ randint() [7/8]

template<class Derived , class M >
template<class R , class S , typename T , typename U >
R prrng::GeneratorBase_array< Derived, M >::randint ( const S &  ishape,
low,
high 
)
inline

Per generator, generate an nd-array of random integers \( 0 \leq r \leq bound \).

Parameters
ishapeThe shape of the nd-array drawn per generator.
lowThe lower bound of the interval.
highThe upper bound of the interval.
Returns
The array of arrays of samples: [shape, ishape]
Template Parameters
Rreturn type, e.g. xt::xtensor<double, 1>

Definition at line 4158 of file prrng.h.

◆ randint() [8/8]

template<class Derived , class M >
template<class S , typename T , typename U >
auto prrng::GeneratorBase_array< Derived, M >::randint ( const S &  ishape,
low,
high 
) -> typename detail::composite_return_type<T, M, S>::type
inline

Per generator, generate an nd-array of random integers \( 0 \leq r \leq bound \).

Parameters
ishapeThe shape of the nd-array drawn per generator.
lowThe lower bound of the interval.
highThe upper bound of the interval.
Returns
The array of arrays of samples: [shape, ishape]

Definition at line 4146 of file prrng.h.

◆ random() [1/4]

template<class Derived , class M >
template<class R , class I , std::size_t L>
R prrng::GeneratorBase_array< Derived, M >::random ( const I(&)  ishape[L])
inline

Per generator, generate an nd-array of random numbers \( 0 \leq r \leq 1 \).

Parameters
ishapeThe shape of the nd-array drawn per generator.
Returns
The array of arrays of samples: [shape, ishape]
Template Parameters
Rreturn type, e.g. xt::xtensor<double, 1>

Definition at line 4087 of file prrng.h.

◆ random() [2/4]

template<class Derived , class M >
template<class I , std::size_t L>
auto prrng::GeneratorBase_array< Derived, M >::random ( const I(&)  ishape[L]) -> typename detail::composite_return_type<double, M, std::array<size_t, L>>::type
inline

Per generator, generate an nd-array of random numbers \( 0 \leq r \leq 1 \).

Parameters
ishapeThe shape of the nd-array drawn per generator.
Returns
The array of arrays of samples: [shape, ishape]

Definition at line 4075 of file prrng.h.

◆ random() [3/4]

template<class Derived , class M >
template<class R , class S >
R prrng::GeneratorBase_array< Derived, M >::random ( const S &  ishape)
inline

Per generator, generate an nd-array of random numbers \( 0 \leq r \leq 1 \).

Parameters
ishapeThe shape of the nd-array drawn per generator.
Returns
The array of arrays of samples: [shape, ishape]
Template Parameters
Rreturn type, e.g. xt::xtensor<double, 1>

Definition at line 4066 of file prrng.h.

◆ random() [4/4]

template<class Derived , class M >
template<class S >
auto prrng::GeneratorBase_array< Derived, M >::random ( const S &  ishape) -> typename detail::composite_return_type<double, M, S>::type
inline

Per generator, generate an nd-array of random numbers \( 0 \leq r \leq 1 \).

Parameters
ishapeThe shape of the nd-array drawn per generator.
Returns
The array of arrays of samples: [shape, ishape]

Definition at line 4055 of file prrng.h.

◆ shape() [1/2]

template<class Derived , class M >
const shape_type & prrng::GeneratorBase_array< Derived, M >::shape ( ) const
inline

Return the shape of the array of generators.

Returns
vector of unsigned ints

Definition at line 3997 of file prrng.h.

◆ shape() [2/2]

template<class Derived , class M >
template<class T >
auto prrng::GeneratorBase_array< Derived, M >::shape ( axis) const
inline

Return the shape of the array of generators along a specific axis.

Parameters
axisThe axis.
Returns
vector of unsigned ints

Definition at line 4009 of file prrng.h.

◆ size()

template<class Derived , class M >
size_type prrng::GeneratorBase_array< Derived, M >::size ( ) const
inline

Return the size of the array of generators.

Returns
unsigned int

Definition at line 3977 of file prrng.h.

◆ strides()

template<class Derived , class M >
const shape_type & prrng::GeneratorBase_array< Derived, M >::strides ( ) const
inline

Return the strides of the array of generators.

Returns
vector of unsigned ints

Definition at line 3987 of file prrng.h.

◆ weibull() [1/4]

template<class Derived , class M >
template<class R , class I , std::size_t L>
R prrng::GeneratorBase_array< Derived, M >::weibull ( const I(&)  ishape[L],
double  k = 1,
double  scale = 1 
)
inline

Per generator, generate an nd-array of random numbers distributed according to a Weibull distribution.

Internally, the output of random() is converted using the cumulative density

\( \Phi(x) = 1 - e^{-(x / \lambda)^k} \)

such that the output r from random() leads to

\( x = \lambda (- \ln (1 - r))^{1 / k}) \)

Parameters
ishapeThe shape of the nd-array drawn per generator.
kThe "shape" parameter \( k \).
scaleThe "scale" parameter \( \lambda \).
Returns
The array of arrays of samples: [shape, ishape]
Template Parameters
Rreturn type, e.g. xt::xtensor<double, 1>

Definition at line 4474 of file prrng.h.

◆ weibull() [2/4]

template<class Derived , class M >
template<class I , std::size_t L>
auto prrng::GeneratorBase_array< Derived, M >::weibull ( const I(&)  ishape[L],
double  k = 1,
double  scale = 1 
) -> typename detail::composite_return_type<double, M, std::array<size_t, L>>::type
inline

Per generator, generate an nd-array of random numbers distributed according to a Weibull distribution.

Internally, the output of random() is converted using the cumulative density

\( \Phi(x) = 1 - e^{-(x / \lambda)^k} \)

such that the output r from random() leads to

\( x = \lambda (- \ln (1 - r))^{1 / k}) \)

Parameters
ishapeThe shape of the nd-array drawn per generator.
kThe "shape" parameter \( k \).
scaleThe "scale" parameter \( \lambda \).
Returns
The array of arrays of samples: [shape, ishape]

Definition at line 4462 of file prrng.h.

◆ weibull() [3/4]

template<class Derived , class M >
template<class R , class S >
R prrng::GeneratorBase_array< Derived, M >::weibull ( const S &  ishape,
double  k = 1,
double  scale = 1 
)
inline

Per generator, generate an nd-array of random numbers distributed according to a Weibull distribution.

Internally, the output of random() is converted using the cumulative density

\( \Phi(x) = 1 - e^{-(x / \lambda)^k} \)

such that the output r from random() leads to

\( x = \lambda (- \ln (1 - r))^{1 / k}) \)

Parameters
ishapeThe shape of the nd-array drawn per generator.
kThe "shape" parameter \( k \).
scaleThe "scale" parameter \( \lambda \).
Returns
The array of arrays of samples: [shape, ishape]
Template Parameters
Rreturn type, e.g. xt::xtensor<double, 1>

Definition at line 4453 of file prrng.h.

◆ weibull() [4/4]

template<class Derived , class M >
template<class S >
auto prrng::GeneratorBase_array< Derived, M >::weibull ( const S &  ishape,
double  k = 1,
double  scale = 1 
) -> typename detail::composite_return_type<double, M, S>::type
inline

Per generator, generate an nd-array of random numbers distributed according to a Weibull distribution.

Internally, the output of random() is converted using the cumulative density

\( \Phi(x) = 1 - e^{-(x / \lambda)^k} \)

such that the output r from random() leads to

\( x = \lambda (- \ln (1 - r))^{1 / k}) \)

Parameters
ishapeThe shape of the nd-array drawn per generator.
kThe "shape" parameter \( k \).
scaleThe "scale" parameter \( \lambda \).
Returns
The array of arrays of samples: [shape, ishape]

Definition at line 4441 of file prrng.h.

Member Data Documentation

◆ m_shape

template<class Derived , class M >
shape_type prrng::GeneratorBase_array< Derived, M >::m_shape
protected

See shape().

Definition at line 5040 of file prrng.h.

◆ m_size

template<class Derived , class M >
size_type prrng::GeneratorBase_array< Derived, M >::m_size = 0
protected

See size().

Definition at line 5039 of file prrng.h.

◆ m_strides

template<class Derived , class M >
shape_type prrng::GeneratorBase_array< Derived, M >::m_strides
protected

The strides of the array of generators.

Definition at line 5041 of file prrng.h.


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