clProbDist
An OpenCL library for probability distributions
|
Device-side API for the normal distribution. More...
Typedefs | |
typedef struct _clprobdistNormal | clprobdistNormal |
Normal distribution object [device]. More... | |
Functions | |
clprobdistStatus | clprobdistNormalCopyOverFromGlobal (_CLPROBDIST_NORMAL_OBJ_MEM clprobdistNormal *destDist, __global const clprobdistNormal *srcDist) |
Copy a distribution object into already allocated memory [device-only]. More... | |
Functions for standard normal distribution | |
These functions are for the normal distribution with \(\mu = 0\) and \(\sigma = 1\), and they take neither a distribution object nor a list of distribution parameters. | |
double | clprobdistStdNormalDensity (double x, clprobdistStatus *err) |
Probability density function [device]. More... | |
double | clprobdistStdNormalCDF (double x, clprobdistStatus *err) |
Cumulative density function [device]. More... | |
double | clprobdistStdNormalComplCDF (double x, clprobdistStatus *err) |
Complementary CDF or reliability function [device]. More... | |
double | clprobdistStdNormalInverseCDF (double u, clprobdistStatus *err) |
Inverse cumulative density function [device]. More... | |
Functions for use with a distribution object | |
double | clprobdistNormalDensityWithObject (_CLPROBDIST_NORMAL_OBJ_MEM const clprobdistNormal *dist, double x, clprobdistStatus *err) |
Probability density function [device]. More... | |
double | clprobdistNormalCDFWithObject (_CLPROBDIST_NORMAL_OBJ_MEM const clprobdistNormal *dist, double x, clprobdistStatus *err) |
Cumulative density function [device]. More... | |
double | clprobdistNormalComplCDFWithObject (_CLPROBDIST_NORMAL_OBJ_MEM const clprobdistNormal *dist, double x, clprobdistStatus *err) |
Complementary CDF or reliability function [device]. More... | |
double | clprobdistNormalInverseCDFWithObject (_CLPROBDIST_NORMAL_OBJ_MEM const clprobdistNormal *dist, double u, clprobdistStatus *err) |
Inverse cumulative density function [device]. More... | |
double | clprobdistNormalMeanWithObject (_CLPROBDIST_NORMAL_OBJ_MEM const clprobdistNormal *dist, clprobdistStatus *err) |
Mean of the distribution [device]. More... | |
double | clprobdistNormalVarianceWithObject (_CLPROBDIST_NORMAL_OBJ_MEM const clprobdistNormal *dist, clprobdistStatus *err) |
Variance of the distribution [device]. More... | |
double | clprobdistNormalStdDeviationWithObject (_CLPROBDIST_NORMAL_OBJ_MEM const clprobdistNormal *dist, clprobdistStatus *err) |
Standard deviation of the distribution [device]. More... | |
double | clprobdistNormalGetMu (_CLPROBDIST_NORMAL_OBJ_MEM const clprobdistNormal *dist, clprobdistStatus *err) |
Return the mean. More... | |
double | clprobdistNormalGetSigma (_CLPROBDIST_NORMAL_OBJ_MEM const clprobdistNormal *dist, clprobdistStatus *err) |
Return the standard deviation. More... | |
Functions for use with explicit distribution parameters | |
double | clprobdistNormalDensity (double mu, double sigma, double x, clprobdistStatus *err) |
Probability density function [device]. More... | |
double | clprobdistNormalCDF (double mu, double sigma, double x, clprobdistStatus *err) |
Cumulative density function [device]. More... | |
double | clprobdistNormalComplCDF (double mu, double sigma, double x, clprobdistStatus *err) |
Complementary CDF or reliability function [device]. More... | |
double | clprobdistNormalInverseCDF (double mu, double sigma, double u, clprobdistStatus *err) |
Inverse cumulative density function [device]. More... | |
double | clprobdistNormalMean (double mu, double sigma, clprobdistStatus *err) |
Mean of the distribution [device]. More... | |
double | clprobdistNormalVariance (double mu, double sigma, clprobdistStatus *err) |
Variance of the distribution [device]. More... | |
double | clprobdistNormalStdDeviation (double mu, double sigma, clprobdistStatus *err) |
Standard deviation of the distribution [device]. More... | |
Device-side API for the normal distribution.
In the function declarations of this file, the preprocessor symbol _CLPROBDIST_NORMAL_OBJ_MEM expands to the selected memory type for this distribution type.
typedef struct _clprobdistNormal clprobdistNormal |
Normal distribution object [device].
A structure that represents a normal distribution object.
double clprobdistStdNormalDensity | ( | double | x, |
clprobdistStatus * | err | ||
) |
Probability density function [device].
Same as clprobdistDensityWithObject(), but with explicit distribution parameters instead of distribution object.
This function is defined only for continuous distributions (see Implemented distributions).
See Implemented distributions for the expansion of DIST_PARAMS.
[in] | x | Value of \(x\). |
[out] | err | Error status variable, or NULL . |
double clprobdistStdNormalCDF | ( | double | x, |
clprobdistStatus * | err | ||
) |
Cumulative density function [device].
Same as clprobdistCDFWithObject(), but with explicit distribution parameters instead of distribution object.
See Implemented distributions for the expansion of DIST_PARAMS.
[in] | x | Value of \(x\). |
[out] | err | Error status variable, or NULL . |
double clprobdistStdNormalComplCDF | ( | double | x, |
clprobdistStatus * | err | ||
) |
Complementary CDF or reliability function [device].
Same as clprobdistComplCDFWithObject(), but with explicit distribution parameters instead of distribution object.
See Implemented distributions for the expansion of DIST_PARAMS.
[in] | x | Value of \(x\). |
[out] | err | Error status variable, or NULL . |
double clprobdistStdNormalInverseCDF | ( | double | u, |
clprobdistStatus * | err | ||
) |
Inverse cumulative density function [device].
Same as clprobdistInverseCDFWithObject(), but with explicit distribution parameters instead of distribution object.
See Implemented distributions for the expansion of DIST_PARAMS.
[in] | u | Value of \(u \in [0,1]\). |
[out] | err | Error status variable, or NULL . |
double clprobdistNormalDensityWithObject | ( | _CLPROBDIST_NORMAL_OBJ_MEM const clprobdistNormal * | dist, |
double | x, | ||
clprobdistStatus * | err | ||
) |
Probability density function [device].
Return \(f(x)\), the value at \(x=\)x
of the probability density function associated with the distribution object dist
.
This function is defined only for continuous distributions (see Implemented distributions).
[in] | dist | Distribution object. |
[in] | x | Value of \(x\). |
[out] | err | Error status variable, or NULL . |
double clprobdistNormalCDFWithObject | ( | _CLPROBDIST_NORMAL_OBJ_MEM const clprobdistNormal * | dist, |
double | x, | ||
clprobdistStatus * | err | ||
) |
Cumulative density function [device].
Return \(F(x)\), the value at \(x=\)x
of the distribution function associated with the distribution object dist
.
[in] | dist | Distribution object. |
[in] | x | Value of \(x\). |
[out] | err | Error status variable, or NULL . |
double clprobdistNormalComplCDFWithObject | ( | _CLPROBDIST_NORMAL_OBJ_MEM const clprobdistNormal * | dist, |
double | x, | ||
clprobdistStatus * | err | ||
) |
Complementary CDF or reliability function [device].
Return \(\bar F(x)\), the value of the complementary distribution function associated with the distribution object dist
.
[in] | dist | Distribution object. |
[in] | x | Value of \(x\). |
[out] | err | Error status variable, or NULL . |
double clprobdistNormalInverseCDFWithObject | ( | _CLPROBDIST_NORMAL_OBJ_MEM const clprobdistNormal * | dist, |
double | u, | ||
clprobdistStatus * | err | ||
) |
Inverse cumulative density function [device].
Return \(F^{-1}(u)\), the value at \(u=\)u
of the inverse distribution function associated with the distribution object dist
. The type of the return value is cl_int
for a discrete distribution of cl_double
for a continuous distribution.
[in] | dist | Distribution object. |
[in] | u | Value of \(u \in [0,1]\). |
[out] | err | Error status variable, or NULL . |
double clprobdistNormalMeanWithObject | ( | _CLPROBDIST_NORMAL_OBJ_MEM const clprobdistNormal * | dist, |
clprobdistStatus * | err | ||
) |
Mean of the distribution [device].
Return the mean of the distribution associated with the distribution object dist
.
[in] | dist | Distribution object. |
[out] | err | Error status variable, or NULL . |
double clprobdistNormalVarianceWithObject | ( | _CLPROBDIST_NORMAL_OBJ_MEM const clprobdistNormal * | dist, |
clprobdistStatus * | err | ||
) |
Variance of the distribution [device].
Return the variance of the distribution associated with the distribution object dist
.
[in] | dist | Distribution object. |
[out] | err | Error status variable, or NULL . |
double clprobdistNormalStdDeviationWithObject | ( | _CLPROBDIST_NORMAL_OBJ_MEM const clprobdistNormal * | dist, |
clprobdistStatus * | err | ||
) |
Standard deviation of the distribution [device].
Return the standard deviation of the distribution associated with the distribution object dist
.
[in] | dist | Distribution object. |
[out] | err | Error status variable, or NULL . |
double clprobdistNormalGetMu | ( | _CLPROBDIST_NORMAL_OBJ_MEM const clprobdistNormal * | dist, |
clprobdistStatus * | err | ||
) |
Return the mean.
[in] | dist | Distribution object. |
[out] | err | Error status variable, or NULL . |
double clprobdistNormalGetSigma | ( | _CLPROBDIST_NORMAL_OBJ_MEM const clprobdistNormal * | dist, |
clprobdistStatus * | err | ||
) |
Return the standard deviation.
[in] | dist | Distribution object. |
[out] | err | Error status variable, or NULL . |
double clprobdistNormalDensity | ( | double | mu, |
double | sigma, | ||
double | x, | ||
clprobdistStatus * | err | ||
) |
Probability density function [device].
[in] | mu | Value of the mean \(\mu\). |
[in] | sigma | Value of the standard deviation \(\sigma\). |
[in] | x | Value of \(x\). |
[out] | err | Error status variable, or NULL . |
double clprobdistNormalCDF | ( | double | mu, |
double | sigma, | ||
double | x, | ||
clprobdistStatus * | err | ||
) |
Cumulative density function [device].
[in] | mu | Value of the mean \(\mu\). |
[in] | sigma | Value of the standard deviation \(\sigma\). |
[in] | x | Value of \(x\). |
[out] | err | Error status variable, or NULL . |
double clprobdistNormalComplCDF | ( | double | mu, |
double | sigma, | ||
double | x, | ||
clprobdistStatus * | err | ||
) |
Complementary CDF or reliability function [device].
[in] | mu | Value of the mean \(\mu\). |
[in] | sigma | Value of the standard deviation \(\sigma\). |
[in] | x | Value of \(x\). |
[out] | err | Error status variable, or NULL . |
double clprobdistNormalInverseCDF | ( | double | mu, |
double | sigma, | ||
double | u, | ||
clprobdistStatus * | err | ||
) |
Inverse cumulative density function [device].
[in] | mu | Value of the mean \(\mu\). |
[in] | sigma | Value of the standard deviation \(\sigma\). |
[in] | u | Value of \(u \in [0,1]\). |
[out] | err | Error status variable, or NULL . |
double clprobdistNormalMean | ( | double | mu, |
double | sigma, | ||
clprobdistStatus * | err | ||
) |
Mean of the distribution [device].
[in] | mu | Value of the mean \(\mu\). |
[in] | sigma | Value of the standard deviation \(\sigma\). |
[out] | err | Error status variable, or NULL . |
double clprobdistNormalVariance | ( | double | mu, |
double | sigma, | ||
clprobdistStatus * | err | ||
) |
Variance of the distribution [device].
[in] | mu | Value of the mean \(\mu\). |
[in] | sigma | Value of the standard deviation \(\sigma\). |
[out] | err | Error status variable, or NULL . |
double clprobdistNormalStdDeviation | ( | double | mu, |
double | sigma, | ||
clprobdistStatus * | err | ||
) |
Standard deviation of the distribution [device].
[in] | mu | Value of the mean \(\mu\). |
[in] | sigma | Value of the standard deviation \(\sigma\). |
[out] | err | Error status variable, or NULL . |
clprobdistStatus clprobdistNormalCopyOverFromGlobal | ( | _CLPROBDIST_NORMAL_OBJ_MEM clprobdistNormal * | destDist, |
__global const clprobdistNormal * | srcDist | ||
) |
Copy a distribution object into already allocated memory [device-only].
Copy the distribution object srcDist
located in global memory into the buffer destDist
located in local or private memory. This function does not allocate memory for the distribution object, it assumes that this has already been done.
When the distribution API is configured to use distribution objects stored in global memory (the default), there is no need to copy distribution objects across memory types, since the kernel already receives them in global memory (see Device memory types). The same applies to constant memory. In such cases, this function is not defined.
[out] | destDist | Destination buffer into which to copy (its content will be overwritten). The qualifier _CLPROBDIST_<DIST>_OBJ_MEM , where <DIST> is the uppercase distribution name, is replaced with the OpenCL keywords __private or __local , respectively. |
[in] | srcDist | Distribution object to be copied. |