![]() |
NumCpp
2.16.0
A Templatized Header Only C++ Implementation of the Python NumPy Library
|
Namespaces | |
| namespace | detail |
Data Structures | |
| class | RNG |
Variables | |
| std::mt19937_64 | generator_ |
| generator function | |
Create an array of the given shape and populate it with random samples from the "bernoulli" distribution.
| inShape | |
| inP | (probability of success [0, 1]). Default 0.5 |
Single random value sampled from the "bernoulli" distribution.
| inP | (probability of success [0, 1]). Default 0.5 |
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
| inShape | |
| inAlpha | |
| 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
| inAlpha | |
| inBeta |
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
| inShape | |
| inN | (number of trials) |
| inP | (probablity of success [0, 1]) |
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
| inN | (number of trials) |
| inP | (probablity of success [0, 1]) |
Create an array of the given shape and populate it with random samples from a "cauchy" distrubution.
| inShape | |
| inMean | Mean value of the underlying normal distribution. Default is 0. |
| inSigma | Standard deviation of the underlying normal distribution. Should be greater than zero. Default is 1. |
Single random value sampled from the from the "cauchy" distrubution.
| inMean | Mean value of the underlying normal distribution. Default is 0. |
| inSigma | Standard deviation of the underlying normal distribution. Should be greater than zero. Default is 1. |
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
| inShape | |
| inDof | (independent random variables) |
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
| inDof | (independent random variables) |
| NdArray< dtype > nc::random::choice | ( | const NdArray< dtype > & | inArray, |
| uint32 | inNum, | ||
| Replace | replace = Replace::YES |
||
| ) |
Chooses inNum random samples from an input array.
| inArray | |
| inNum | |
| replace | Whether the sample is with or without replacement |
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.
| inWeights |
| NdArray< dtype > nc::random::discrete | ( | 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.
| inShape | |
| inWeights |
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
| inShape | |
| inScaleValue | (default 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
| inScaleValue | (default 1) |
Create an array of the given shape and populate it with random samples from a "extreme value" distrubution.
| inShape | |
| inA | (default 1) |
| inB | (default 1) |
Single random value sampled from the "extreme value" distrubution.
| inA | (default 1) |
| inB | (default 1) |
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
| inShape | |
| inDofN | Degrees of freedom in numerator. Should be greater than zero. |
| inDofD | Degrees of freedom in denominator. Should be greater than zero. |
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
| inDofN | Degrees of freedom in numerator. Should be greater than zero. |
| inDofD | Degrees of freedom in denominator. Should be greater than zero. |
| NdArray< dtype > nc::random::gamma | ( | 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
| inShape | |
| inGammaShape | |
| inScaleValue | (default 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
| inGammaShape | |
| inScaleValue | (default 1) |
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
| inShape | |
| inP | (probablity of success [0, 1]) |
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
| inP | (probablity of success [0, 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
| inShape | |
| inLoc | (The position, mu, of the distribution peak. Default is 0) |
| inScale | (float optional the exponential decay. Default is 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
| inLoc | (The position, mu, of the distribution peak. Default is 0) |
| inScale | (float optional the exponential decay. Default is 1) |
| NdArray< dtype > nc::random::lognormal | ( | 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
| inShape | |
| inMean | Mean value of the underlying normal distribution. Default is 0. |
| inSigma | Standard deviation of the underlying normal distribution. Should be greater than zero. Default is 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
| inMean | Mean value of the underlying normal distribution. Default is 0. |
| inSigma | Standard deviation of the underlying normal distribution. Should be greater than zero. Default is 1. |
| NdArray< dtype > nc::random::negativeBinomial | ( | 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
| inShape | |
| inN | number of trials |
| inP | probablity of success [0, 1] |
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
| inN | number of trials |
| inP | probablity of success [0, 1] |
| NdArray< dtype > nc::random::nonCentralChiSquared | ( | 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
| inShape | |
| inK | (default 1) |
| inLambda | (default 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
| inK | (default 1) |
| inLambda | (default 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
| inShape | |
| inMean | Mean value of the underlying normal distribution. Default is 0. |
| inSigma | Standard deviation of the underlying normal distribution. Should be greater than zero. Default is 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
| inMean | Mean value of the underlying normal distribution. Default is 0. |
| inSigma | Standard deviation of the underlying normal distribution. Should be greater than zero. Default is 1. |
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.
| 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.
| inValue |
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
| inShape | |
| inMean | (default 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
| inMean | (default 1) |
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
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
| inShape |
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
| inShape | |
| inLow | |
| inHigh | default 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
| inLow | |
| inHigh | default 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
| inShape | |
| inLow | |
| inHigh | default 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
| inLow | |
| inHigh | default 0. |
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
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
| inShape |
Seeds the random number generator
NumPy Reference: https://docs.scipy.org/doc/numpy/reference/generated/numpy.random.seed.html#numpy.random.seed
| inSeed |
Modify a sequence in-place by shuffling its contents.
| inArray |
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
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
| inShape |
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
| inShape | |
| inDof | independent random variables |
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
| inDof | independent random variables |
| NdArray< dtype > nc::random::triangle | ( | 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
| inShape | |
| inA | |
| inB | |
| inC |
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
| inA | |
| inB | |
| inC |
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
| inShape | |
| inLow | |
| 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
| inLow | |
| inHigh |
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.
| inNumPoints | |
| inDims | dimension of the sphere (default 2) |
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
| inShape | |
| inA | (default 1) |
| inB | (default 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
| inA | (default 1) |
| inB | (default 1) |
|
inline |
generator function