clProbDist
An OpenCL library for probability distributions
Typedefs | Functions
exponential.clh File Reference

Device-side API for the exponential distribution. More...

#include "clProbDist.clh"
#include "continuous.clh"
#include "private/exponential.c.h"

Typedefs

typedef struct _clprobdistExponential clprobdistExponential
 Exponential distribution object [device]. More...
 

Functions

clprobdistStatus clprobdistExponentialCopyOverFromGlobal (_CLPROBDIST_EXPONENTIAL_OBJ_MEM clprobdistExponential *destDist, __global const clprobdistExponential *srcDist)
 Copy a distribution object into already allocated memory [device-only]. More...
 
Functions for use with a distribution object
double clprobdistExponentialDensityWithObject (_CLPROBDIST_EXPONENTIAL_OBJ_MEM const clprobdistExponential *dist, double x, clprobdistStatus *err)
 Probability density function [device]. More...
 
double clprobdistExponentialCDFWithObject (_CLPROBDIST_EXPONENTIAL_OBJ_MEM const clprobdistExponential *dist, double x, clprobdistStatus *err)
 Cumulative density function [device]. More...
 
double clprobdistExponentialComplCDFWithObject (_CLPROBDIST_EXPONENTIAL_OBJ_MEM const clprobdistExponential *dist, double x, clprobdistStatus *err)
 Complementary CDF or reliability function [device]. More...
 
double clprobdistExponentialInverseCDFWithObject (_CLPROBDIST_EXPONENTIAL_OBJ_MEM const clprobdistExponential *dist, double u, clprobdistStatus *err)
 Inverse cumulative density function [device]. More...
 
double clprobdistExponentialMeanWithObject (_CLPROBDIST_EXPONENTIAL_OBJ_MEM const clprobdistExponential *dist, clprobdistStatus *err)
 Mean of the distribution [device]. More...
 
double clprobdistExponentialVarianceWithObject (_CLPROBDIST_EXPONENTIAL_OBJ_MEM const clprobdistExponential *dist, clprobdistStatus *err)
 Variance of the distribution [device]. More...
 
double clprobdistExponentialStdDeviationWithObject (_CLPROBDIST_EXPONENTIAL_OBJ_MEM const clprobdistExponential *dist, clprobdistStatus *err)
 Standard deviation of the distribution [device]. More...
 
double clprobdistExponentialGetLambda (_CLPROBDIST_EXPONENTIAL_OBJ_MEM const clprobdistExponential *dist, clprobdistStatus *err)
 Return the value of the inverse mean \(\lambda\) [device].
 
clprobdistStatus clprobdistExponentialSetLambda (_CLPROBDIST_EXPONENTIAL_OBJ_MEM clprobdistExponential *dist, double newlambda)
 Change the value of the inverse mean \(\lambda\) [device].
 
Functions for use with explicit distribution parameters
double clprobdistExponentialDensity (double lambda, double x, clprobdistStatus *err)
 Probability density function [device]. More...
 
double clprobdistExponentialCDF (double lambda, double x, clprobdistStatus *err)
 Cumulative density function [device]. More...
 
double clprobdistExponentialComplCDF (double lambda, double x, clprobdistStatus *err)
 Complementary CDF or reliability function [device]. More...
 
double clprobdistExponentialInverseCDF (double lambda, double u, clprobdistStatus *err)
 Inverse cumulative density function [device]. More...
 
double clprobdistExponentialMean (double lambda, clprobdistStatus *err)
 Mean of the distribution [device]. More...
 
double clprobdistExponentialVariance (double lambda, clprobdistStatus *err)
 Variance of the distribution [device]. More...
 
double clprobdistExponentialStdDeviation (double lambda, clprobdistStatus *err)
 Standard deviation of the distribution [device]. More...
 

Detailed Description

Device-side API for the exponential distribution.

In the function declarations of this file, the preprocessor symbol _CLPROBDIST_EXPONENTIAL_OBJ_MEM expands to the selected memory type for this distribution type.

Typedef Documentation

typedef struct _clprobdistExponential clprobdistExponential

Exponential distribution object [device].

A structure that represents an exponential distribution object.

Function Documentation

double clprobdistExponentialDensityWithObject ( _CLPROBDIST_EXPONENTIAL_OBJ_MEM const clprobdistExponential 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).

Parameters
[in]distDistribution object.
[in]xValue of \(x\).
[out]errError status variable, or NULL.
Returns
Value of \(f(x)\).
double clprobdistExponentialCDFWithObject ( _CLPROBDIST_EXPONENTIAL_OBJ_MEM const clprobdistExponential 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.

Parameters
[in]distDistribution object.
[in]xValue of \(x\).
[out]errError status variable, or NULL.
Returns
Value of \(F(x)\).
double clprobdistExponentialComplCDFWithObject ( _CLPROBDIST_EXPONENTIAL_OBJ_MEM const clprobdistExponential 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.

Parameters
[in]distDistribution object.
[in]xValue of \(x\).
[out]errError status variable, or NULL.
Returns
Value of \(\bar F(x)\).
double clprobdistExponentialInverseCDFWithObject ( _CLPROBDIST_EXPONENTIAL_OBJ_MEM const clprobdistExponential 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.

Parameters
[in]distDistribution object.
[in]uValue of \(u \in [0,1]\).
[out]errError status variable, or NULL.
Returns
Value of \(F^{-1}(u)\).
double clprobdistExponentialMeanWithObject ( _CLPROBDIST_EXPONENTIAL_OBJ_MEM const clprobdistExponential dist,
clprobdistStatus err 
)

Mean of the distribution [device].

Return the mean of the distribution associated with the distribution object dist.

Parameters
[in]distDistribution object.
[out]errError status variable, or NULL.
Returns
Mean of the distribution.
double clprobdistExponentialVarianceWithObject ( _CLPROBDIST_EXPONENTIAL_OBJ_MEM const clprobdistExponential dist,
clprobdistStatus err 
)

Variance of the distribution [device].

Return the variance of the distribution associated with the distribution object dist.

Parameters
[in]distDistribution object.
[out]errError status variable, or NULL.
Returns
Variance of the distribution.
double clprobdistExponentialStdDeviationWithObject ( _CLPROBDIST_EXPONENTIAL_OBJ_MEM const clprobdistExponential dist,
clprobdistStatus err 
)

Standard deviation of the distribution [device].

Return the standard deviation of the distribution associated with the distribution object dist.

Parameters
[in]distDistribution object.
[out]errError status variable, or NULL.
Returns
Standard deviation of the distribution.
double clprobdistExponentialDensity ( double  lambda,
double  x,
clprobdistStatus err 
)

Probability density function [device].

See also
clprobdistExponentialDensityWithObject()
Parameters
[in]lambdaValue of the inverse mean \(\lambda\).
[in]xValue of \(x\).
[out]errError status variable, or NULL.
Returns
Value of \(f(x)\).
double clprobdistExponentialCDF ( double  lambda,
double  x,
clprobdistStatus err 
)

Cumulative density function [device].

See also
clprobdistExponentialCDFWithObject()
Parameters
[in]lambdaValue of the inverse mean \(\lambda\).
[in]xValue of \(x\).
[out]errError status variable, or NULL.
Returns
Value of \(F(x)\).
double clprobdistExponentialComplCDF ( double  lambda,
double  x,
clprobdistStatus err 
)

Complementary CDF or reliability function [device].

See also
clprobdistExponentialComplCDFWithObject()
Parameters
[in]lambdaValue of the inverse mean \(\lambda\).
[in]xValue of \(x\).
[out]errError status variable, or NULL.
Returns
Value of \(\bar F(x)\).
double clprobdistExponentialInverseCDF ( double  lambda,
double  u,
clprobdistStatus err 
)

Inverse cumulative density function [device].

See also
clprobdistExponentialInverseCDFWithObject()
Parameters
[in]lambdaValue of the inverse mean \(\lambda\).
[in]uValue of \(u \in [0,1]\).
[out]errError status variable, or NULL.
Returns
Value of \(F^{-1}(u)\).
double clprobdistExponentialMean ( double  lambda,
clprobdistStatus err 
)

Mean of the distribution [device].

See also
clprobdistExponentialMeanWithObject()
Parameters
[in]lambdaValue of the inverse mean \(\lambda\).
[out]errError status variable, or NULL.
Returns
Mean of the distribution.
double clprobdistExponentialVariance ( double  lambda,
clprobdistStatus err 
)

Variance of the distribution [device].

See also
clprobdistExponentialVarianceWithObject()
Parameters
[in]lambdaValue of the inverse mean \(\lambda\).
[out]errError status variable, or NULL.
Returns
Variance of the distribution.
double clprobdistExponentialStdDeviation ( double  lambda,
clprobdistStatus err 
)

Standard deviation of the distribution [device].

See also
clprobdistExponentialStdDeviationWithObject()
Parameters
[in]lambdaValue of the inverse mean \(\lambda\).
[out]errError status variable, or NULL.
Returns
Standard deviation of the distribution.
clprobdistStatus clprobdistExponentialCopyOverFromGlobal ( _CLPROBDIST_EXPONENTIAL_OBJ_MEM clprobdistExponential destDist,
__global const clprobdistExponential 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.

Parameters
[out]destDistDestination 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]srcDistDistribution object to be copied.
Returns
Error status
Warning
This function is available only on the device.
This function is available only when CLPROBDIST_EXPONENTIAL_OBJ_MEM is set to CLPROBDIST_MEM_TYPE_LOCAL or to CLPROBDIST_MEM_TYPE_PRIVATE.