NumCpp  2.12.1
A Templatized Header Only C++ Implementation of the Python NumPy Library
nc::random::detail Namespace Reference

Functions

template<typename GeneratorType = std::mt19937>
NdArray< bool > bernoulli (GeneratorType &generator, const Shape &inShape, double inP=0.5)
 
template<typename GeneratorType = std::mt19937>
bool bernoulli (GeneratorType &generator, double inP=0.5)
 
template<typename dtype , typename GeneratorType = std::mt19937>
NdArray< dtype > beta (GeneratorType &generator, const Shape &inShape, dtype inAlpha, dtype inBeta)
 
template<typename dtype , typename GeneratorType = std::mt19937>
dtype beta (GeneratorType &generator, dtype inAlpha, dtype inBeta)
 
template<typename dtype , typename GeneratorType = std::mt19937>
NdArray< dtype > binomial (GeneratorType &generator, const Shape &inShape, dtype inN, double inP=0.5)
 
template<typename dtype , typename GeneratorType = std::mt19937>
dtype binomial (GeneratorType &generator, dtype inN, double inP=0.5)
 
template<typename dtype , typename GeneratorType = std::mt19937>
NdArray< dtype > cauchy (GeneratorType &generator, const Shape &inShape, dtype inMean=0, dtype inSigma=1)
 
template<typename dtype , typename GeneratorType = std::mt19937>
dtype cauchy (GeneratorType &generator, dtype inMean=0, dtype inSigma=1)
 
template<typename dtype , typename GeneratorType = std::mt19937>
NdArray< dtype > chiSquare (GeneratorType &generator, const Shape &inShape, dtype inDof)
 
template<typename dtype , typename GeneratorType = std::mt19937>
dtype chiSquare (GeneratorType &generator, dtype inDof)
 
template<typename dtype , typename GeneratorType = std::mt19937>
dtype choice (GeneratorType &generator, const NdArray< dtype > &inArray)
 
template<typename dtype , typename GeneratorType = std::mt19937>
NdArray< dtype > choice (GeneratorType &generator, const NdArray< dtype > &inArray, uint32 inNum, Replace replace=Replace::YES)
 
template<typename dtype , typename GeneratorType = std::mt19937>
dtype discrete (GeneratorType &generator, const NdArray< double > &inWeights)
 
template<typename dtype , typename GeneratorType = std::mt19937>
NdArray< dtype > discrete (GeneratorType &generator, const Shape &inShape, const NdArray< double > &inWeights)
 
template<typename dtype , typename GeneratorType = std::mt19937>
NdArray< dtype > exponential (GeneratorType &generator, const Shape &inShape, dtype inScaleValue=1)
 
template<typename dtype , typename GeneratorType = std::mt19937>
dtype exponential (GeneratorType &generator, dtype inScaleValue=1)
 
template<typename dtype , typename GeneratorType = std::mt19937>
NdArray< dtype > extremeValue (GeneratorType &generator, const Shape &inShape, dtype inA=1, dtype inB=1)
 
template<typename dtype , typename GeneratorType = std::mt19937>
dtype extremeValue (GeneratorType &generator, dtype inA=1, dtype inB=1)
 
template<typename dtype , typename GeneratorType = std::mt19937>
NdArray< dtype > f (GeneratorType &generator, const Shape &inShape, dtype inDofN, dtype inDofD)
 
template<typename dtype , typename GeneratorType = std::mt19937>
dtype f (GeneratorType &generator, dtype inDofN, dtype inDofD)
 
template<typename dtype , typename GeneratorType = std::mt19937>
NdArray< dtype > gamma (GeneratorType &generator, const Shape &inShape, dtype inGammaShape, dtype inScaleValue=1)
 
template<typename dtype , typename GeneratorType = std::mt19937>
dtype gamma (GeneratorType &generator, dtype inGammaShape, dtype inScaleValue=1)
 
template<typename dtype , typename GeneratorType = std::mt19937>
NdArray< dtype > geometric (GeneratorType &generator, const Shape &inShape, double inP=0.5)
 
template<typename dtype , typename GeneratorType = std::mt19937>
dtype geometric (GeneratorType &generator, double inP=0.5)
 
template<typename dtype , typename GeneratorType = std::mt19937>
NdArray< dtype > laplace (GeneratorType &generator, const Shape &inShape, dtype inLoc=0, dtype inScale=1)
 
template<typename dtype , typename GeneratorType = std::mt19937>
dtype laplace (GeneratorType &generator, dtype inLoc=0, dtype inScale=1)
 
template<typename dtype , typename GeneratorType = std::mt19937>
NdArray< dtype > lognormal (GeneratorType &generator, const Shape &inShape, dtype inMean=0, dtype inSigma=1)
 
template<typename dtype , typename GeneratorType = std::mt19937>
dtype lognormal (GeneratorType &generator, dtype inMean=0, dtype inSigma=1)
 
template<typename dtype , typename GeneratorType = std::mt19937>
NdArray< dtype > negativeBinomial (GeneratorType &generator, const Shape &inShape, dtype inN, double inP=0.5)
 
template<typename dtype , typename GeneratorType = std::mt19937>
dtype negativeBinomial (GeneratorType &generator, dtype inN, double inP=0.5)
 
template<typename dtype , typename GeneratorType = std::mt19937>
NdArray< dtype > nonCentralChiSquared (GeneratorType &generator, const Shape &inShape, dtype inK=1, dtype inLambda=1)
 
template<typename dtype , typename GeneratorType = std::mt19937>
dtype nonCentralChiSquared (GeneratorType &generator, dtype inK=1, dtype inLambda=1)
 
template<typename dtype , typename GeneratorType = std::mt19937>
NdArray< dtype > normal (GeneratorType &generator, const Shape &inShape, dtype inMean=0, dtype inSigma=1)
 
template<typename dtype , typename GeneratorType = std::mt19937>
dtype normal (GeneratorType &generator, dtype inMean=0, dtype inSigma=1)
 
template<typename dtype , typename GeneratorType = std::mt19937>
NdArray< dtype > permutation (GeneratorType &generator, const NdArray< dtype > &inArray)
 
template<typename dtype , typename GeneratorType = std::mt19937>
NdArray< dtype > permutation (GeneratorType &generator, dtype inValue)
 
template<typename dtype , typename GeneratorType = std::mt19937>
NdArray< dtype > poisson (GeneratorType &generator, const Shape &inShape, double inMean=1)
 
template<typename dtype , typename GeneratorType = std::mt19937>
dtype poisson (GeneratorType &generator, double inMean=1)
 
template<typename dtype , typename GeneratorType = std::mt19937>
dtype rand (GeneratorType &generator)
 
template<typename dtype , typename GeneratorType = std::mt19937>
NdArray< dtype > rand (GeneratorType &generator, const Shape &inShape)
 
template<typename dtype , typename GeneratorType = std::mt19937>
NdArray< dtype > randFloat (GeneratorType &generator, const Shape &inShape, dtype inLow, dtype inHigh=0.)
 
template<typename dtype , typename GeneratorType = std::mt19937>
dtype randFloat (GeneratorType &generator, dtype inLow, dtype inHigh=0.)
 
template<typename dtype , typename GeneratorType = std::mt19937>
NdArray< dtype > randInt (GeneratorType &generator, const Shape &inShape, dtype inLow, dtype inHigh=0)
 
template<typename dtype , typename GeneratorType = std::mt19937>
dtype randInt (GeneratorType &generator, dtype inLow, dtype inHigh=0)
 
template<typename dtype , typename GeneratorType = std::mt19937>
dtype randN (GeneratorType &generator)
 
template<typename dtype , typename GeneratorType = std::mt19937>
NdArray< dtype > randN (GeneratorType &generator, const Shape &inShape)
 
template<typename dtype , typename GeneratorType = std::mt19937>
void shuffle (GeneratorType &generator, NdArray< dtype > &inArray)
 
template<typename dtype , typename GeneratorType = std::mt19937>
dtype standardNormal (GeneratorType &generator)
 
template<typename dtype , typename GeneratorType = std::mt19937>
NdArray< dtype > standardNormal (GeneratorType &generator, const Shape &inShape)
 
template<typename dtype , typename GeneratorType = std::mt19937>
NdArray< dtype > studentT (GeneratorType &generator, const Shape &inShape, dtype inDof)
 
template<typename dtype , typename GeneratorType = std::mt19937>
dtype studentT (GeneratorType &generator, dtype inDof)
 
template<typename dtype , typename GeneratorType = std::mt19937>
NdArray< dtype > triangle (GeneratorType &generator, const Shape &inShape, dtype inA=0, dtype inB=0.5, dtype inC=1)
 
template<typename dtype , typename GeneratorType = std::mt19937>
dtype triangle (GeneratorType &generator, dtype inA=0, dtype inB=0.5, dtype inC=1)
 
template<typename dtype , typename GeneratorType = std::mt19937>
NdArray< dtype > uniform (GeneratorType &generator, const Shape &inShape, dtype inLow, dtype inHigh)
 
template<typename dtype , typename GeneratorType = std::mt19937>
dtype uniform (GeneratorType &generator, dtype inLow, dtype inHigh)
 
template<typename dtype , typename GeneratorType = std::mt19937>
NdArray< dtype > uniformOnSphere (GeneratorType &generator, uint32 inNumPoints, uint32 inDims=2)
 
template<typename dtype , typename GeneratorType = std::mt19937>
NdArray< dtype > weibull (GeneratorType &generator, const Shape &inShape, dtype inA=1, dtype inB=1)
 
template<typename dtype , typename GeneratorType = std::mt19937>
dtype weibull (GeneratorType &generator, dtype inA=1, dtype inB=1)
 

Function Documentation

◆ bernoulli() [1/2]

template<typename GeneratorType = std::mt19937>
NdArray< bool > nc::random::detail::bernoulli ( GeneratorType &  generator,
const Shape inShape,
double  inP = 0.5 
)

Create an array of the given shape and populate it with random samples from the "bernoulli" distribution.

Parameters
generatorinstance of a random number generator
inShape
inP(probability of success [0, 1]). Default 0.5
Returns
NdArray

◆ bernoulli() [2/2]

template<typename GeneratorType = std::mt19937>
bool nc::random::detail::bernoulli ( GeneratorType &  generator,
double  inP = 0.5 
)

Single random value sampled from the "bernoulli" distribution.

Parameters
generatorinstance of a random number generator
inP(probability of success [0, 1]). Default 0.5
Returns
NdArray

◆ beta() [1/2]

template<typename dtype , typename GeneratorType = std::mt19937>
NdArray< dtype > nc::random::detail::beta ( GeneratorType &  generator,
const Shape inShape,
dtype  inAlpha,
dtype  inBeta 
)

Create an array of the given shape and populate it with random samples from the "beta" distribution. NOTE: Use of this function requires using the Boost includes.

NumPy Reference: https://docs.scipy.org/doc/numpy/reference/generated/numpy.random.beta.html#numpy.random.beta

Parameters
generatorinstance of a random number generator
inShape
inAlpha
inBeta
Returns
NdArray

◆ beta() [2/2]

template<typename dtype , typename GeneratorType = std::mt19937>
dtype nc::random::detail::beta ( GeneratorType &  generator,
dtype  inAlpha,
dtype  inBeta 
)

Single random value sampled from the from the "beta" distribution. NOTE: Use of this function requires using the Boost includes.

NumPy Reference: https://docs.scipy.org/doc/numpy/reference/generated/numpy.random.beta.html#numpy.random.beta

Parameters
generatorinstance of a random number generator
inAlpha
inBeta
Returns
NdArray

◆ binomial() [1/2]

template<typename dtype , typename GeneratorType = std::mt19937>
NdArray< dtype > nc::random::detail::binomial ( GeneratorType &  generator,
const Shape inShape,
dtype  inN,
double  inP = 0.5 
)

Create an array of the given shape and populate it with random samples from the "binomial" distribution.

NumPy Reference: https://docs.scipy.org/doc/numpy/reference/generated/numpy.random.binomial.html#numpy.random.binomial

Parameters
generatorinstance of a random number generator
inShape
inN(number of trials)
inP(probablity of success [0, 1])
Returns
NdArray

◆ binomial() [2/2]

template<typename dtype , typename GeneratorType = std::mt19937>
dtype nc::random::detail::binomial ( GeneratorType &  generator,
dtype  inN,
double  inP = 0.5 
)

Single random value sampled from the from the "binomial" distribution.

NumPy Reference: https://docs.scipy.org/doc/numpy/reference/generated/numpy.random.binomial.html#numpy.random.binomial

Parameters
generatorinstance of a random number generator
inN(number of trials)
inP(probablity of success [0, 1])
Returns
NdArray

◆ cauchy() [1/2]

template<typename dtype , typename GeneratorType = std::mt19937>
NdArray< dtype > nc::random::detail::cauchy ( GeneratorType &  generator,
const Shape inShape,
dtype  inMean = 0,
dtype  inSigma = 1 
)

Create an array of the given shape and populate it with random samples from a "cauchy" distrubution.

Parameters
generatorinstance of a random number generator
inShape
inMeanMean value of the underlying normal distribution. Default is 0.
inSigmaStandard deviation of the underlying normal distribution. Should be greater than zero. Default is 1.
Returns
NdArray

◆ cauchy() [2/2]

template<typename dtype , typename GeneratorType = std::mt19937>
dtype nc::random::detail::cauchy ( GeneratorType &  generator,
dtype  inMean = 0,
dtype  inSigma = 1 
)

Single random value sampled from the from the "cauchy" distrubution.

Parameters
generatorinstance of a random number generator
inMeanMean value of the underlying normal distribution. Default is 0.
inSigmaStandard deviation of the underlying normal distribution. Should be greater than zero. Default is 1.
Returns
NdArray

◆ chiSquare() [1/2]

template<typename dtype , typename GeneratorType = std::mt19937>
NdArray< dtype > nc::random::detail::chiSquare ( GeneratorType &  generator,
const Shape inShape,
dtype  inDof 
)

Create an array of the given shape and populate it with random samples from the "chi square" distribution.

NumPy Reference: https://docs.scipy.org/doc/numpy/reference/generated/numpy.random.chisquare.html#numpy.random.chisquare

Parameters
generatorinstance of a random number generator
inShape
inDof(independent random variables)
Returns
NdArray

◆ chiSquare() [2/2]

template<typename dtype , typename GeneratorType = std::mt19937>
dtype nc::random::detail::chiSquare ( GeneratorType &  generator,
dtype  inDof 
)

Single random value sampled from the from the "chi square" distribution.

NumPy Reference: https://docs.scipy.org/doc/numpy/reference/generated/numpy.random.chisquare.html#numpy.random.chisquare

Parameters
generatorinstance of a random number generator
inDof(independent random variables)
Returns
NdArray

◆ choice() [1/2]

template<typename dtype , typename GeneratorType = std::mt19937>
dtype nc::random::detail::choice ( GeneratorType &  generator,
const NdArray< dtype > &  inArray 
)

Chooses a random sample from an input array.

Parameters
generatorinstance of a random number generator
inArray
Returns
NdArray

◆ choice() [2/2]

template<typename dtype , typename GeneratorType = std::mt19937>
NdArray< dtype > nc::random::detail::choice ( GeneratorType &  generator,
const NdArray< dtype > &  inArray,
uint32  inNum,
Replace  replace = Replace::YES 
)

Chooses inNum random samples from an input array.

Parameters
generatorinstance of a random number generator
inArray
inNum
replaceWhether the sample is with or without replacement
Returns
NdArray

◆ discrete() [1/2]

template<typename dtype , typename GeneratorType = std::mt19937>
dtype nc::random::detail::discrete ( GeneratorType &  generator,
const NdArray< double > &  inWeights 
)

Single random value sampled from the from the "discrete" distrubution. It produces integers in the range [0, n) with the probability of producing each value is specified by the parameters of the distribution.

Parameters
generatorinstance of a random number generator
inWeights
Returns
NdArray

◆ discrete() [2/2]

template<typename dtype , typename GeneratorType = std::mt19937>
NdArray< dtype > nc::random::detail::discrete ( GeneratorType &  generator,
const Shape inShape,
const NdArray< double > &  inWeights 
)

Create an array of the given shape and populate it with random samples from a "discrete" distrubution. It produces integers in the range [0, n) with the probability of producing each value is specified by the parameters of the distribution.

Parameters
generatorinstance of a random number generator
inShape
inWeights
Returns
NdArray

◆ exponential() [1/2]

template<typename dtype , typename GeneratorType = std::mt19937>
NdArray< dtype > nc::random::detail::exponential ( GeneratorType &  generator,
const Shape inShape,
dtype  inScaleValue = 1 
)

Create an array of the given shape and populate it with random samples from a "exponential" distrubution.

NumPy Reference: https://docs.scipy.org/doc/numpy/reference/generated/numpy.random.exponential.html#numpy.random.exponential

Parameters
generatorinstance of a random number generator
inShape
inScaleValue(default 1)
Returns
NdArray

◆ exponential() [2/2]

template<typename dtype , typename GeneratorType = std::mt19937>
dtype nc::random::detail::exponential ( GeneratorType &  generator,
dtype  inScaleValue = 1 
)

Single random value sampled from the "exponential" distrubution.

NumPy Reference: https://docs.scipy.org/doc/numpy/reference/generated/numpy.random.exponential.html#numpy.random.exponential

Parameters
generatorinstance of a random number generator
inScaleValue(default 1)
Returns
NdArray

◆ extremeValue() [1/2]

template<typename dtype , typename GeneratorType = std::mt19937>
NdArray< dtype > nc::random::detail::extremeValue ( GeneratorType &  generator,
const Shape inShape,
dtype  inA = 1,
dtype  inB = 1 
)

Create an array of the given shape and populate it with random samples from a "extreme value" distrubution.

Parameters
generatorinstance of a random number generator
inShape
inA(default 1)
inB(default 1)
Returns
NdArray

◆ extremeValue() [2/2]

template<typename dtype , typename GeneratorType = std::mt19937>
dtype nc::random::detail::extremeValue ( GeneratorType &  generator,
dtype  inA = 1,
dtype  inB = 1 
)

Single random value sampled from the "extreme value" distrubution.

Parameters
generatorinstance of a random number generator
inA(default 1)
inB(default 1)
Returns
NdArray

◆ f() [1/2]

template<typename dtype , typename GeneratorType = std::mt19937>
NdArray< dtype > nc::random::detail::f ( GeneratorType &  generator,
const Shape inShape,
dtype  inDofN,
dtype  inDofD 
)

Create an array of the given shape and populate it with random samples from a "F" distrubution.

NumPy Reference: https://docs.scipy.org/doc/numpy/reference/generated/numpy.random.f.html#numpy.random.f

Parameters
generatorinstance of a random number generator
inShape
inDofNDegrees of freedom in numerator. Should be greater than zero.
inDofDDegrees of freedom in denominator. Should be greater than zero.
Returns
NdArray

◆ f() [2/2]

template<typename dtype , typename GeneratorType = std::mt19937>
dtype nc::random::detail::f ( GeneratorType &  generator,
dtype  inDofN,
dtype  inDofD 
)

Single random value sampled from the "F" distrubution.

NumPy Reference: https://docs.scipy.org/doc/numpy/reference/generated/numpy.random.f.html#numpy.random.f

Parameters
generatorinstance of a random number generator
inDofNDegrees of freedom in numerator. Should be greater than zero.
inDofDDegrees of freedom in denominator. Should be greater than zero.
Returns
NdArray
Examples
ReadMe.cpp.

◆ gamma() [1/2]

template<typename dtype , typename GeneratorType = std::mt19937>
NdArray< dtype > nc::random::detail::gamma ( GeneratorType &  generator,
const Shape inShape,
dtype  inGammaShape,
dtype  inScaleValue = 1 
)

Create an array of the given shape and populate it with random samples from a "gamma" distrubution.

NumPy Reference: https://docs.scipy.org/doc/numpy/reference/generated/numpy.random.gamma.html#numpy.random.gamma

Parameters
generatorinstance of a random number generator
inShape
inGammaShape
inScaleValue(default 1)
Returns
NdArray

◆ gamma() [2/2]

template<typename dtype , typename GeneratorType = std::mt19937>
dtype nc::random::detail::gamma ( GeneratorType &  generator,
dtype  inGammaShape,
dtype  inScaleValue = 1 
)

Single random value sampled from the "gamma" distrubution.

NumPy Reference: https://docs.scipy.org/doc/numpy/reference/generated/numpy.random.gamma.html#numpy.random.gamma

Parameters
generatorinstance of a random number generator
inGammaShape
inScaleValue(default 1)
Returns
NdArray

◆ geometric() [1/2]

template<typename dtype , typename GeneratorType = std::mt19937>
NdArray< dtype > nc::random::detail::geometric ( GeneratorType &  generator,
const Shape inShape,
double  inP = 0.5 
)

Create an array of the given shape and populate it with random samples from a "geometric" distrubution.

NumPy Reference: https://docs.scipy.org/doc/numpy/reference/generated/numpy.random.geometric.html#numpy.random.geometric

Parameters
generatorinstance of a random number generator
inShape
inP(probablity of success [0, 1])
Returns
NdArray

◆ geometric() [2/2]

template<typename dtype , typename GeneratorType = std::mt19937>
dtype nc::random::detail::geometric ( GeneratorType &  generator,
double  inP = 0.5 
)

Single random value sampled from the "geometric" distrubution.

NumPy Reference: https://docs.scipy.org/doc/numpy/reference/generated/numpy.random.geometric.html#numpy.random.geometric

Parameters
generatorinstance of a random number generator
inP(probablity of success [0, 1])
Returns
NdArray

◆ laplace() [1/2]

template<typename dtype , typename GeneratorType = std::mt19937>
NdArray< dtype > nc::random::detail::laplace ( GeneratorType &  generator,
const Shape inShape,
dtype  inLoc = 0,
dtype  inScale = 1 
)

Create an array of the given shape and populate it with random samples from a "laplace" distrubution. NOTE: Use of this function requires using the Boost includes.

NumPy Reference: https://docs.scipy.org/doc/numpy/reference/generated/numpy.random.laplace.html#numpy.random.laplace

Parameters
generatorinstance of a random number generator
inShape
inLoc(The position, mu, of the distribution peak. Default is 0)
inScale(float optional the exponential decay. Default is 1)
Returns
NdArray

◆ laplace() [2/2]

template<typename dtype , typename GeneratorType = std::mt19937>
dtype nc::random::detail::laplace ( GeneratorType &  generator,
dtype  inLoc = 0,
dtype  inScale = 1 
)

Single random value sampled from the "laplace" distrubution. NOTE: Use of this function requires using the Boost includes.

NumPy Reference: https://docs.scipy.org/doc/numpy/reference/generated/numpy.random.laplace.html#numpy.random.laplace

Parameters
generatorinstance of a random number generator
inLoc(The position, mu, of the distribution peak. Default is 0)
inScale(float optional the exponential decay. Default is 1)
Returns
NdArray

◆ lognormal() [1/2]

template<typename dtype , typename GeneratorType = std::mt19937>
NdArray< dtype > nc::random::detail::lognormal ( GeneratorType &  generator,
const Shape inShape,
dtype  inMean = 0,
dtype  inSigma = 1 
)

Create an array of the given shape and populate it with random samples from a "lognormal" distrubution.

NumPy Reference: https://docs.scipy.org/doc/numpy/reference/generated/numpy.random.lognormal.html#numpy.random.lognormal

Parameters
generatorinstance of a random number generator
inShape
inMeanMean value of the underlying normal distribution. Default is 0.
inSigmaStandard deviation of the underlying normal distribution. Should be greater than zero. Default is 1.
Returns
NdArray

◆ lognormal() [2/2]

template<typename dtype , typename GeneratorType = std::mt19937>
dtype nc::random::detail::lognormal ( GeneratorType &  generator,
dtype  inMean = 0,
dtype  inSigma = 1 
)

Single random value sampled from the "lognormal" distrubution.

NumPy Reference: https://docs.scipy.org/doc/numpy/reference/generated/numpy.random.lognormal.html#numpy.random.lognormal

Parameters
generatorinstance of a random number generator
inMeanMean value of the underlying normal distribution. Default is 0.
inSigmaStandard deviation of the underlying normal distribution. Should be greater than zero. Default is 1.
Returns
NdArray

◆ negativeBinomial() [1/2]

template<typename dtype , typename GeneratorType = std::mt19937>
NdArray< dtype > nc::random::detail::negativeBinomial ( GeneratorType &  generator,
const Shape inShape,
dtype  inN,
double  inP = 0.5 
)

Create an array of the given shape and populate it with random samples from the "negative Binomial" distribution.

NumPy Reference: https://docs.scipy.org/doc/numpy/reference/generated/numpy.random.negative_binomial.html#numpy.random.negative_binomial

Parameters
generatorinstance of a random number generator
inShape
inNnumber of trials
inPprobablity of success [0, 1]
Returns
NdArray

◆ negativeBinomial() [2/2]

template<typename dtype , typename GeneratorType = std::mt19937>
dtype nc::random::detail::negativeBinomial ( GeneratorType &  generator,
dtype  inN,
double  inP = 0.5 
)

Single random value sampled from the "negative Binomial" distribution.

NumPy Reference: https://docs.scipy.org/doc/numpy/reference/generated/numpy.random.negative_binomial.html#numpy.random.negative_binomial

Parameters
generatorinstance of a random number generator
inNnumber of trials
inPprobablity of success [0, 1]
Returns
NdArray

◆ nonCentralChiSquared() [1/2]

template<typename dtype , typename GeneratorType = std::mt19937>
NdArray< dtype > nc::random::detail::nonCentralChiSquared ( GeneratorType &  generator,
const Shape inShape,
dtype  inK = 1,
dtype  inLambda = 1 
)

Create an array of the given shape and populate it with random samples from a "non central chi squared" distrubution. NOTE: Use of this function requires using the Boost includes.

NumPy Reference: https://docs.scipy.org/doc/numpy/reference/generated/numpy.random.noncentral_chisquare.html#numpy.random.noncentral_chisquare

Parameters
generatorinstance of a random number generator
inShape
inK(default 1)
inLambda(default 1)
Returns
NdArray

◆ nonCentralChiSquared() [2/2]

template<typename dtype , typename GeneratorType = std::mt19937>
dtype nc::random::detail::nonCentralChiSquared ( GeneratorType &  generator,
dtype  inK = 1,
dtype  inLambda = 1 
)

Single random value sampled from the "non central chi squared" distrubution. NOTE: Use of this function requires using the Boost includes.

NumPy Reference: https://docs.scipy.org/doc/numpy/reference/generated/numpy.random.noncentral_chisquare.html#numpy.random.noncentral_chisquare

Parameters
generatorinstance of a random number generator
inK(default 1)
inLambda(default 1)
Returns
NdArray

◆ normal() [1/2]

template<typename dtype , typename GeneratorType = std::mt19937>
NdArray< dtype > nc::random::detail::normal ( GeneratorType &  generator,
const Shape inShape,
dtype  inMean = 0,
dtype  inSigma = 1 
)

Create an array of the given shape and populate it with random samples from a "normal" distrubution.

NumPy Reference: https://docs.scipy.org/doc/numpy/reference/generated/numpy.random.normal.html#numpy.random.normal

Parameters
generatorinstance of a random number generator
inShape
inMeanMean value of the underlying normal distribution. Default is 0.
inSigmaStandard deviation of the underlying normal distribution. Should be greater than zero. Default is 1.
Returns
NdArray

◆ normal() [2/2]

template<typename dtype , typename GeneratorType = std::mt19937>
dtype nc::random::detail::normal ( GeneratorType &  generator,
dtype  inMean = 0,
dtype  inSigma = 1 
)

Single random value sampled from the "normal" distrubution.

NumPy Reference: https://docs.scipy.org/doc/numpy/reference/generated/numpy.random.normal.html#numpy.random.normal

Parameters
generatorinstance of a random number generator
inMeanMean value of the underlying normal distribution. Default is 0.
inSigmaStandard deviation of the underlying normal distribution. Should be greater than zero. Default is 1.
Returns
NdArray

◆ permutation() [1/2]

template<typename dtype , typename GeneratorType = std::mt19937>
NdArray< dtype > nc::random::detail::permutation ( GeneratorType &  generator,
const NdArray< dtype > &  inArray 
)

Randomly permute a sequence, or return a permuted range. If x is an integer, randomly permute np.arange(x). If x is an array, make a copy and shuffle the elements randomly.

Parameters
generatorinstance of a random number generator
inArray
Returns
NdArray

◆ permutation() [2/2]

template<typename dtype , typename GeneratorType = std::mt19937>
NdArray< dtype > nc::random::detail::permutation ( GeneratorType &  generator,
dtype  inValue 
)

Randomly permute a sequence, or return a permuted range. If x is an integer, randomly permute np.arange(x). If x is an array, make a copy and shuffle the elements randomly.

Parameters
generatorinstance of a random number generator
inValue
Returns
NdArray

◆ poisson() [1/2]

template<typename dtype , typename GeneratorType = std::mt19937>
NdArray< dtype > nc::random::detail::poisson ( GeneratorType &  generator,
const Shape inShape,
double  inMean = 1 
)

Create an array of the given shape and populate it with random samples from the "poisson" distribution.

NumPy Reference: https://docs.scipy.org/doc/numpy/reference/generated/numpy.random.poisson.html#numpy.random.poisson

Parameters
generatorinstance of a random number generator
inShape
inMean(default 1)
Returns
NdArray

◆ poisson() [2/2]

template<typename dtype , typename GeneratorType = std::mt19937>
dtype nc::random::detail::poisson ( GeneratorType &  generator,
double  inMean = 1 
)

Single random value sampled from the "poisson" distribution.

NumPy Reference: https://docs.scipy.org/doc/numpy/reference/generated/numpy.random.poisson.html#numpy.random.poisson

Parameters
generatorinstance of a random number generator
inMean(default 1)
Returns
NdArray

◆ rand() [1/2]

template<typename dtype , typename GeneratorType = std::mt19937>
dtype nc::random::detail::rand ( GeneratorType &  generator)

Single random value sampled from the uniform distribution over [0, 1).

NumPy Reference: https://docs.scipy.org/doc/numpy/reference/generated/numpy.random.rand.html#numpy.random.rand

Parameters
generatorinstance of a random number generator
Returns
NdArray

◆ rand() [2/2]

template<typename dtype , typename GeneratorType = std::mt19937>
NdArray< dtype > nc::random::detail::rand ( GeneratorType &  generator,
const Shape inShape 
)

Create an array of the given shape and populate it with random samples from a uniform distribution over [0, 1).

NumPy Reference: https://docs.scipy.org/doc/numpy/reference/generated/numpy.random.rand.html#numpy.random.rand

Parameters
generatorinstance of a random number generator
inShape
Returns
NdArray

◆ randFloat() [1/2]

template<typename dtype , typename GeneratorType = std::mt19937>
NdArray< dtype > nc::random::detail::randFloat ( GeneratorType &  generator,
const Shape inShape,
dtype  inLow,
dtype  inHigh = 0. 
)

Return random floats from low (inclusive) to high (exclusive), with the given shape. If no high value is input then the range will go from [0, low).

NumPy Reference: https://docs.scipy.org/doc/numpy/reference/generated/numpy.random.ranf.html#numpy.random.ranf

Parameters
generatorinstance of a random number generator
inShape
inLow
inHighdefault 0.
Returns
NdArray

◆ randFloat() [2/2]

template<typename dtype , typename GeneratorType = std::mt19937>
dtype nc::random::detail::randFloat ( GeneratorType &  generator,
dtype  inLow,
dtype  inHigh = 0. 
)

Return a single random float from low (inclusive) to high (exclusive), with the given shape. If no high value is input then the range will go from [0, low).

NumPy Reference: https://docs.scipy.org/doc/numpy/reference/generated/numpy.random.ranf.html#numpy.random.ranf

Parameters
generatorinstance of a random number generator
inLow
inHighdefault 0.
Returns
NdArray

◆ randInt() [1/2]

template<typename dtype , typename GeneratorType = std::mt19937>
NdArray< dtype > nc::random::detail::randInt ( GeneratorType &  generator,
const Shape inShape,
dtype  inLow,
dtype  inHigh = 0 
)

Return random integers from low (inclusive) to high (exclusive), with the given shape. If no high value is input then the range will go from [0, low).

NumPy Reference: https://docs.scipy.org/doc/numpy/reference/generated/numpy.random.randint.html#numpy.random.randint

Parameters
generatorinstance of a random number generator
inShape
inLow
inHighdefault 0.
Returns
NdArray

◆ randInt() [2/2]

template<typename dtype , typename GeneratorType = std::mt19937>
dtype nc::random::detail::randInt ( GeneratorType &  generator,
dtype  inLow,
dtype  inHigh = 0 
)

Return random integer from low (inclusive) to high (exclusive), with the given shape. If no high value is input then the range will go from [0, low).

NumPy Reference: https://docs.scipy.org/doc/numpy/reference/generated/numpy.random.randint.html#numpy.random.randint

Parameters
generatorinstance of a random number generator
inLow
inHighdefault 0.
Returns
NdArray

◆ randN() [1/2]

template<typename dtype , typename GeneratorType = std::mt19937>
dtype nc::random::detail::randN ( GeneratorType &  generator)

Returns a single random value sampled from the "standard normal" distribution.

NumPy Reference: https://docs.scipy.org/doc/numpy/reference/generated/numpy.random.randn.html#numpy.random.randn

Parameters
generatorinstance of a random number generator
Returns
dtype

◆ randN() [2/2]

template<typename dtype , typename GeneratorType = std::mt19937>
NdArray< dtype > nc::random::detail::randN ( GeneratorType &  generator,
const Shape inShape 
)

Create an array of the given shape and populate it with random samples from the "standard normal" distribution.

NumPy Reference: https://docs.scipy.org/doc/numpy/reference/generated/numpy.random.randn.html#numpy.random.randn

Parameters
generatorinstance of a random number generator
inShape
Returns
NdArray

◆ shuffle()

template<typename dtype , typename GeneratorType = std::mt19937>
void nc::random::detail::shuffle ( GeneratorType &  generator,
NdArray< dtype > &  inArray 
)

Modify a sequence in-place by shuffling its contents.

Parameters
generatorinstance of a random number generator
inArray

◆ standardNormal() [1/2]

template<typename dtype , typename GeneratorType = std::mt19937>
dtype nc::random::detail::standardNormal ( GeneratorType &  generator)

Single random value sampled from the "standard normal" distrubution with mean = 0 and std = 1

NumPy Reference: https://docs.scipy.org/doc/numpy/reference/generated/numpy.random.standard_normal.html#numpy.random.standard_normal

Parameters
generatorinstance of a random number generator
Returns
NdArray

◆ standardNormal() [2/2]

template<typename dtype , typename GeneratorType = std::mt19937>
NdArray< dtype > nc::random::detail::standardNormal ( GeneratorType &  generator,
const Shape inShape 
)

Create an array of the given shape and populate it with random samples from a "standard normal" distrubution with mean = 0 and std = 1

NumPy Reference: https://docs.scipy.org/doc/numpy/reference/generated/numpy.random.standard_normal.html#numpy.random.standard_normal

Parameters
generatorinstance of a random number generator
inShape
Returns
NdArray

◆ studentT() [1/2]

template<typename dtype , typename GeneratorType = std::mt19937>
NdArray< dtype > nc::random::detail::studentT ( GeneratorType &  generator,
const Shape inShape,
dtype  inDof 
)

Create an array of the given shape and populate it with random samples from the "student-T" distribution.

NumPy Reference: https://docs.scipy.org/doc/numpy/reference/generated/numpy.random.standard_t.html#numpy.random.standard_t

Parameters
generatorinstance of a random number generator
inShape
inDofindependent random variables
Returns
NdArray

◆ studentT() [2/2]

template<typename dtype , typename GeneratorType = std::mt19937>
dtype nc::random::detail::studentT ( GeneratorType &  generator,
dtype  inDof 
)

Single random value sampled from the "student-T" distribution.

NumPy Reference: https://docs.scipy.org/doc/numpy/reference/generated/numpy.random.standard_t.html#numpy.random.standard_t

Parameters
generatorinstance of a random number generator
inDofindependent random variables
Returns
NdArray

◆ triangle() [1/2]

template<typename dtype , typename GeneratorType = std::mt19937>
NdArray< dtype > nc::random::detail::triangle ( GeneratorType &  generator,
const Shape inShape,
dtype  inA = 0,
dtype  inB = 0.5,
dtype  inC = 1 
)

Create an array of the given shape and populate it with random samples from the "triangle" distribution. NOTE: Use of this function requires using the Boost includes.

NumPy Reference: https://docs.scipy.org/doc/numpy/reference/generated/numpy.random.triangular.html#numpy.random.triangular

Parameters
generatorinstance of a random number generator
inShape
inA
inB
inC
Returns
NdArray

◆ triangle() [2/2]

template<typename dtype , typename GeneratorType = std::mt19937>
dtype nc::random::detail::triangle ( GeneratorType &  generator,
dtype  inA = 0,
dtype  inB = 0.5,
dtype  inC = 1 
)

Single random value sampled from the "triangle" distribution. NOTE: Use of this function requires using the Boost includes.

NumPy Reference: https://docs.scipy.org/doc/numpy/reference/generated/numpy.random.triangular.html#numpy.random.triangular

Parameters
generatorinstance of a random number generator
inA
inB
inC
Returns
NdArray

◆ uniform() [1/2]

template<typename dtype , typename GeneratorType = std::mt19937>
NdArray< dtype > nc::random::detail::uniform ( GeneratorType &  generator,
const Shape inShape,
dtype  inLow,
dtype  inHigh 
)

Draw samples from a uniform distribution.

Samples are uniformly distributed over the half - open interval[low, high) (includes low, but excludes high)

NumPy Reference: https://docs.scipy.org/doc/numpy/reference/generated/numpy.random.uniform.html#numpy.random.uniform

Parameters
generatorinstance of a random number generator
inShape
inLow
inHigh
Returns
NdArray

◆ uniform() [2/2]

template<typename dtype , typename GeneratorType = std::mt19937>
dtype nc::random::detail::uniform ( GeneratorType &  generator,
dtype  inLow,
dtype  inHigh 
)

Draw sample from a uniform distribution.

Samples are uniformly distributed over the half - open interval[low, high) (includes low, but excludes high)

NumPy Reference: https://docs.scipy.org/doc/numpy/reference/generated/numpy.random.uniform.html#numpy.random.uniform

Parameters
generatorinstance of a random number generator
inLow
inHigh
Returns
NdArray

◆ uniformOnSphere()

template<typename dtype , typename GeneratorType = std::mt19937>
NdArray< dtype > nc::random::detail::uniformOnSphere ( GeneratorType &  generator,
uint32  inNumPoints,
uint32  inDims = 2 
)

Such a distribution produces random numbers uniformly distributed on the unit sphere of arbitrary dimension dim. NOTE: Use of this function requires using the Boost includes.

Parameters
generatorinstance of a random number generator
inNumPoints
inDimsdimension of the sphere (default 2)
Returns
NdArray

◆ weibull() [1/2]

template<typename dtype , typename GeneratorType = std::mt19937>
NdArray< dtype > nc::random::detail::weibull ( GeneratorType &  generator,
const Shape inShape,
dtype  inA = 1,
dtype  inB = 1 
)

Create an array of the given shape and populate it with random samples from the "weibull" distribution.

NumPy Reference: https://docs.scipy.org/doc/numpy/reference/generated/numpy.random.weibull.html#numpy.random.weibull

Parameters
generatorinstance of a random number generator
inShape
inA(default 1)
inB(default 1)
Returns
NdArray

◆ weibull() [2/2]

template<typename dtype , typename GeneratorType = std::mt19937>
dtype nc::random::detail::weibull ( GeneratorType &  generator,
dtype  inA = 1,
dtype  inB = 1 
)

Single random value sampled from the "weibull" distribution.

NumPy Reference: https://docs.scipy.org/doc/numpy/reference/generated/numpy.random.weibull.html#numpy.random.weibull

Parameters
generatorinstance of a random number generator
inA(default 1)
inB(default 1)
Returns
NdArray