clProbDist
An OpenCL library for probability distributions
|
Device-side API for the gamma distribution. More...
#include "clProbDist.clh"
#include "exponential.clh"
#include "normal.clh"
#include "private/gamma.c.h"
Typedefs | |
typedef struct _clprobdistGamma | clprobdistGamma |
Gamma distribution object [device]. More... | |
Functions | |
clprobdistStatus | clprobdistGammaCopyOverFromGlobal (_CLPROBDIST_GAMMA_OBJ_MEM clprobdistGamma *destDist, __global const clprobdistGamma *srcDist) |
Copy a distribution object into already allocated memory [device-only]. More... | |
Functions for use with explicit distribution parameters | |
double | clprobdistGammaDensityWithObject (_CLPROBDIST_GAMMA_OBJ_MEM const clprobdistGamma *dist, double x, clprobdistStatus *err) |
Probability density function [device]. More... | |
double | clprobdistGammaCDFWithObject (_CLPROBDIST_GAMMA_OBJ_MEM const clprobdistGamma *dist, double x, clprobdistStatus *err) |
Cumulative density function [device]. More... | |
double | clprobdistGammaComplCDFWithObject (_CLPROBDIST_GAMMA_OBJ_MEM const clprobdistGamma *dist, double x, clprobdistStatus *err) |
Complementary CDF or reliability function [device]. More... | |
double | clprobdistGammaInverseCDFWithObject (_CLPROBDIST_GAMMA_OBJ_MEM const clprobdistGamma *dist, double u, clprobdistStatus *err) |
Inverse cumulative density function [device]. More... | |
double | clprobdistGammaMeanWithObject (_CLPROBDIST_GAMMA_OBJ_MEM const clprobdistGamma *dist, clprobdistStatus *err) |
Mean of the distribution [device]. More... | |
double | clprobdistGammaVarianceWithObject (_CLPROBDIST_GAMMA_OBJ_MEM const clprobdistGamma *dist, clprobdistStatus *err) |
Variance of the distribution [device]. More... | |
double | clprobdistGammaStdDeviationWithObject (_CLPROBDIST_GAMMA_OBJ_MEM const clprobdistGamma *dist, clprobdistStatus *err) |
Standard deviation of the distribution [device]. More... | |
double | clprobdistGammaGetAlpha (_CLPROBDIST_GAMMA_OBJ_MEM const clprobdistGamma *dist, clprobdistStatus *err) |
Return the shape parameter of the distribution [device]. More... | |
double | clprobdistGammaGetLambda (_CLPROBDIST_GAMMA_OBJ_MEM const clprobdistGamma *dist, clprobdistStatus *err) |
Return the scale parameter of the distribution [device]. More... | |
double | clprobdistGammaDensity (double alpha, double lambda, int decprec, double x, clprobdistStatus *err) |
Probability density function [device]. More... | |
double | clprobdistGammaCDF (double alpha, double lambda, int decprec, double x, clprobdistStatus *err) |
Cumulative density function [device]. More... | |
double | clprobdistGammaComplCDF (double alpha, double lambda, int decprec, double x, clprobdistStatus *err) |
Complementary CDF or reliability function [device]. More... | |
double | clprobdistGammaInverseCDF (double alpha, double lambda, int decprec, double u, clprobdistStatus *err) |
Inverse cumulative density function [device]. More... | |
double | clprobdistGammaMean (double alpha, double lambda, int decprec, clprobdistStatus *err) |
Mean of the distribution [device]. More... | |
double | clprobdistGammaVariance (double alpha, double lambda, int decprec, clprobdistStatus *err) |
Variance of the distribution [device]. More... | |
double | clprobdistGammaStdDeviation (double alpha, double lambda, int decprec, clprobdistStatus *err) |
Standard deviation of the distribution [device]. More... | |
Device-side API for the gamma distribution.
In the function declarations of this file, the preprocessor symbol _CLPROBDIST_GAMMA_OBJ_MEM expands to the selected memory type for this distribution type.
typedef struct _clprobdistGamma clprobdistGamma |
Gamma distribution object [device].
A structure that represents a gamma distribution object.
double clprobdistGammaDensityWithObject | ( | _CLPROBDIST_GAMMA_OBJ_MEM const clprobdistGamma * | 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 clprobdistGammaCDFWithObject | ( | _CLPROBDIST_GAMMA_OBJ_MEM const clprobdistGamma * | 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 clprobdistGammaComplCDFWithObject | ( | _CLPROBDIST_GAMMA_OBJ_MEM const clprobdistGamma * | 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 clprobdistGammaInverseCDFWithObject | ( | _CLPROBDIST_GAMMA_OBJ_MEM const clprobdistGamma * | 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 clprobdistGammaMeanWithObject | ( | _CLPROBDIST_GAMMA_OBJ_MEM const clprobdistGamma * | 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 clprobdistGammaVarianceWithObject | ( | _CLPROBDIST_GAMMA_OBJ_MEM const clprobdistGamma * | 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 clprobdistGammaStdDeviationWithObject | ( | _CLPROBDIST_GAMMA_OBJ_MEM const clprobdistGamma * | 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 clprobdistGammaGetAlpha | ( | _CLPROBDIST_GAMMA_OBJ_MEM const clprobdistGamma * | dist, |
clprobdistStatus * | err | ||
) |
Return the shape parameter of the distribution [device].
[in] | dist | Distribution object. |
[out] | err | Error status variable, or NULL . |
double clprobdistGammaGetLambda | ( | _CLPROBDIST_GAMMA_OBJ_MEM const clprobdistGamma * | dist, |
clprobdistStatus * | err | ||
) |
Return the scale parameter of the distribution [device].
[in] | dist | Distribution object. |
[out] | err | Error status variable, or NULL . |
double clprobdistGammaDensity | ( | double | alpha, |
double | lambda, | ||
int | decprec, | ||
double | x, | ||
clprobdistStatus * | err | ||
) |
Probability density function [device].
[in] | alpha | Value of the shape parameter \(\alpha\). |
[in] | lambda | Value of the scale parameter \(\lambda\). |
[in] | decprec | This parameter is unused but present for uniformity. |
[in] | x | Value of \(x\). |
[out] | err | Error status variable, or NULL . |
double clprobdistGammaCDF | ( | double | alpha, |
double | lambda, | ||
int | decprec, | ||
double | x, | ||
clprobdistStatus * | err | ||
) |
Cumulative density function [device].
[in] | alpha | Value of the shape parameter \(\alpha\). |
[in] | lambda | Value of the scale parameter \(\lambda\). |
[in] | decprec | Value of \(d\). |
[in] | x | Value of \(x\). |
[out] | err | Error status variable, or NULL . |
double clprobdistGammaComplCDF | ( | double | alpha, |
double | lambda, | ||
int | decprec, | ||
double | x, | ||
clprobdistStatus * | err | ||
) |
Complementary CDF or reliability function [device].
[in] | alpha | Value of the shape parameter \(\alpha\). |
[in] | lambda | Value of the scale parameter \(\lambda\). |
[in] | decprec | Value of \(d\). |
[in] | x | Value of \(x\). |
[out] | err | Error status variable, or NULL . |
double clprobdistGammaInverseCDF | ( | double | alpha, |
double | lambda, | ||
int | decprec, | ||
double | u, | ||
clprobdistStatus * | err | ||
) |
Inverse cumulative density function [device].
[in] | alpha | Value of the shape parameter \(\alpha\). |
[in] | lambda | Value of the scale parameter \(\lambda\). |
[in] | decprec | Value of \(d\). |
[in] | u | Value of \(u \in [0,1]\). |
[out] | err | Error status variable, or NULL . |
double clprobdistGammaMean | ( | double | alpha, |
double | lambda, | ||
int | decprec, | ||
clprobdistStatus * | err | ||
) |
Mean of the distribution [device].
[in] | alpha | Value of the shape parameter \(\alpha\). |
[in] | lambda | Value of the scale parameter \(\lambda\). |
[in] | decprec | This parameter is unused but present for uniformity. |
[out] | err | Error status variable, or NULL . |
double clprobdistGammaVariance | ( | double | alpha, |
double | lambda, | ||
int | decprec, | ||
clprobdistStatus * | err | ||
) |
Variance of the distribution [device].
[in] | alpha | Value of the shape parameter \(\alpha\). |
[in] | lambda | Value of the scale parameter \(\lambda\). |
[in] | decprec | This parameter is unused but present for uniformity. |
[out] | err | Error status variable, or NULL . |
double clprobdistGammaStdDeviation | ( | double | alpha, |
double | lambda, | ||
int | decprec, | ||
clprobdistStatus * | err | ||
) |
Standard deviation of the distribution [device].
[in] | alpha | Value of the shape parameter \(\alpha\). |
[in] | lambda | Value of the scale parameter \(\lambda\). |
[in] | decprec | This parameter is unused but present for uniformity. |
[out] | err | Error status variable, or NULL . |
clprobdistStatus clprobdistGammaCopyOverFromGlobal | ( | _CLPROBDIST_GAMMA_OBJ_MEM clprobdistGamma * | destDist, |
__global const clprobdistGamma * | 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. |