2
0
mirror of https://github.com/boostorg/math.git synced 2026-01-19 04:22:09 +00:00

Add GPU markers to supported dists docs

This commit is contained in:
Matt Borland
2024-08-30 15:46:47 -04:00
parent 82adb328e7
commit a3adb94aca
14 changed files with 110 additions and 82 deletions

View File

@@ -21,11 +21,11 @@
typedef Policy policy_type;
// Constructor from two range parameters, x_min and x_max:
arcsine_distribution(RealType x_min = 0, RealType x_max = 1);
BOOST_MATH_GPU_ENABLED arcsine_distribution(RealType x_min = 0, RealType x_max = 1);
// Range Parameter accessors:
RealType x_min() const;
RealType x_max() const;
BOOST_MATH_GPU_ENABLED RealType x_min() const;
BOOST_MATH_GPU_ENABLED RealType x_max() const;
};
}} // namespaces
@@ -103,8 +103,8 @@ constructs a 'Standard 01' arcsine distribution.
[h5 Parameter Accessors]
RealType x_min() const;
RealType x_max() const;
BOOST_MATH_GPU_ENABLED RealType x_min() const;
BOOST_MATH_GPU_ENABLED RealType x_max() const;
Return the parameter ['x_min] or ['x_max] from which this distribution was constructed.
@@ -116,6 +116,8 @@ So, for example:
All the [link math_toolkit.dist_ref.nmp usual non-member accessor functions]
that are generic to all distributions are supported: __usual_accessors.
For this distribution all non-member accessor functions are marked with `BOOST_MATH_GPU_ENABLED` and can
be run on both host and device.
The formulae for calculating these are shown in the table below, and at
[@http://mathworld.wolfram.com/arcsineDistribution.html Wolfram Mathworld].

View File

@@ -16,9 +16,9 @@
typedef RealType value_type;
typedef Policy policy_type;
bernoulli_distribution(RealType p); // Constructor.
BOOST_MATH_GPU_ENABLED bernoulli_distribution(RealType p); // Constructor.
// Accessor function.
RealType success_fraction() const
BOOST_MATH_GPU_ENABLED RealType success_fraction() const
// Probability of success (as a fraction).
};
}} // namespaces
@@ -51,12 +51,12 @@ and the [@http://en.wikipedia.org/wiki/Cumulative_Distribution_Function Cumulati
[h4 Member Functions]
bernoulli_distribution(RealType p);
BOOST_MATH_GPU_ENABLED bernoulli_distribution(RealType p);
Constructs a [@http://en.wikipedia.org/wiki/bernoulli_distribution
bernoulli distribution] with success_fraction /p/.
RealType success_fraction() const
BOOST_MATH_GPU_ENABLED RealType success_fraction() const
Returns the /success_fraction/ parameter of this distribution.
@@ -64,6 +64,8 @@ Returns the /success_fraction/ parameter of this distribution.
All the [link math_toolkit.dist_ref.nmp usual non-member accessor functions]
that are generic to all distributions are supported: __usual_accessors.
For this distribution all non-member accessor functions are marked with `BOOST_MATH_GPU_ENABLED` and can
be run on both host and device.
The domain of the random variable is 0 and 1,
and the useful supported range is only 0 or 1.

View File

@@ -19,30 +19,30 @@
typedef RealType value_type;
typedef Policy policy_type;
// Constructor from two shape parameters, alpha & beta:
beta_distribution(RealType a, RealType b);
BOOST_MATH_GPU_ENABLED beta_distribution(RealType a, RealType b);
// Parameter accessors:
RealType alpha() const;
RealType beta() const;
BOOST_MATH_GPU_ENABLED RealType alpha() const;
BOOST_MATH_GPU_ENABLED RealType beta() const;
// Parameter estimators of alpha or beta from mean and variance.
static RealType find_alpha(
BOOST_MATH_GPU_ENABLED static RealType find_alpha(
RealType mean, // Expected value of mean.
RealType variance); // Expected value of variance.
static RealType find_beta(
BOOST_MATH_GPU_ENABLED static RealType find_beta(
RealType mean, // Expected value of mean.
RealType variance); // Expected value of variance.
// Parameter estimators from
// either alpha or beta, and x and probability.
static RealType find_alpha(
BOOST_MATH_GPU_ENABLED static RealType find_alpha(
RealType beta, // from beta.
RealType x, // x.
RealType probability); // cdf
static RealType find_beta(
BOOST_MATH_GPU_ENABLED static RealType find_beta(
RealType alpha, // alpha.
RealType x, // probability x.
RealType probability); // probability cdf.
@@ -98,7 +98,7 @@ whose apex is away from the centre (where x = half).
[h5 Constructor]
beta_distribution(RealType alpha, RealType beta);
BOOST_MATH_GPU_ENABLED beta_distribution(RealType alpha, RealType beta);
Constructs a beta distribution with shape parameters /alpha/ and /beta/.
@@ -117,11 +117,11 @@ in the graph above).
[h5 Parameter Accessors]
RealType alpha() const;
BOOST_MATH_GPU_ENABLED RealType alpha() const;
Returns the parameter /alpha/ from which this distribution was constructed.
RealType beta() const;
BOOST_MATH_GPU_ENABLED RealType beta() const;
Returns the parameter /beta/ from which this distribution was constructed.
@@ -182,6 +182,8 @@ Returns the value of [beta] that gives:
All the [link math_toolkit.dist_ref.nmp usual non-member accessor functions]
that are generic to all distributions are supported: __usual_accessors.
For this distribution all non-member accessor functions are marked with `BOOST_MATH_GPU_ENABLED` and can
be run on both host and device.
The formulae for calculating these are shown in the table below, and at
[@http://mathworld.wolfram.com/BetaDistribution.html Wolfram Mathworld].

View File

@@ -15,10 +15,10 @@
typedef RealType value_type;
typedef Policy policy_type;
cauchy_distribution(RealType location = 0, RealType scale = 1);
BOOST_MATH_GPU_ENABLED cauchy_distribution(RealType location = 0, RealType scale = 1);
RealType location()const;
RealType scale()const;
BOOST_MATH_GPU_ENABLED RealType location()const;
BOOST_MATH_GPU_ENABLED RealType scale()const;
};
The [@http://en.wikipedia.org/wiki/Cauchy_distribution Cauchy-Lorentz distribution]
@@ -53,7 +53,7 @@ the distribution:
[h4 Member Functions]
cauchy_distribution(RealType location = 0, RealType scale = 1);
BOOST_MATH_GPU_ENABLED cauchy_distribution(RealType location = 0, RealType scale = 1);
Constructs a Cauchy distribution, with location parameter /location/
and scale parameter /scale/. When these parameters take their default
@@ -62,11 +62,11 @@ then the result is a Standard Cauchy Distribution.
Requires scale > 0, otherwise calls __domain_error.
RealType location()const;
BOOST_MATH_GPU_ENABLED RealType location()const;
Returns the location parameter of the distribution.
RealType scale()const;
BOOST_MATH_GPU_ENABLED RealType scale()const;
Returns the scale parameter of the distribution.
@@ -74,6 +74,8 @@ Returns the scale parameter of the distribution.
All the [link math_toolkit.dist_ref.nmp usual non-member accessor functions]
that are generic to all distributions are supported: __usual_accessors.
For this distribution all non-member accessor functions are marked with `BOOST_MATH_GPU_ENABLED` and can
be run on both host and device.
Note however that the Cauchy distribution does not have a mean,
standard deviation, etc. See __math_undefined

View File

@@ -18,13 +18,13 @@
typedef Policy policy_type;
// Constructor:
chi_squared_distribution(RealType i);
BOOST_MATH_GPU_ENABLED chi_squared_distribution(RealType i);
// Accessor to parameter:
RealType degrees_of_freedom()const;
BOOST_MATH_GPU_ENABLED RealType degrees_of_freedom()const;
// Parameter estimation:
static RealType find_degrees_of_freedom(
BOOST_MATH_GPU_ENABLED static RealType find_degrees_of_freedom(
RealType difference_from_mean,
RealType alpha,
RealType beta,
@@ -104,6 +104,8 @@ See also section on Sample sizes required in
All the [link math_toolkit.dist_ref.nmp usual non-member accessor functions]
that are generic to all distributions are supported: __usual_accessors.
For this distribution all non-member accessor functions are marked with `BOOST_MATH_GPU_ENABLED` and can
be run on both host and device.
(We have followed the usual restriction of the mode to degrees of freedom >= 2,
but note that the maximum of the pdf is actually zero for degrees of freedom from 2 down to 0,

View File

@@ -15,9 +15,9 @@
typedef RealType value_type;
typedef Policy policy_type;
exponential_distribution(RealType lambda = 1);
BOOST_MATH_GPU_ENABLED exponential_distribution(RealType lambda = 1);
RealType lambda()const;
BOOST_MATH_GPU_ENABLED RealType lambda()const;
};
@@ -37,7 +37,7 @@ values of the rate parameter lambda:
[h4 Member Functions]
exponential_distribution(RealType lambda = 1);
BOOST_MATH_GPU_ENABLED exponential_distribution(RealType lambda = 1);
Constructs an
[@http://en.wikipedia.org/wiki/Exponential_distribution Exponential distribution]
@@ -46,7 +46,7 @@ Lambda is defined as the reciprocal of the scale parameter.
Requires lambda > 0, otherwise calls __domain_error.
RealType lambda()const;
BOOST_MATH_GPU_ENABLED RealType lambda()const;
Accessor function returns the lambda parameter of the distribution.
@@ -54,6 +54,8 @@ Accessor function returns the lambda parameter of the distribution.
All the [link math_toolkit.dist_ref.nmp usual non-member accessor functions]
that are generic to all distributions are supported: __usual_accessors.
For this distribution all non-member accessor functions are marked with `BOOST_MATH_GPU_ENABLED` and can
be run on both host and device.
The domain of the random variable is \[0, +[infin]\].

View File

@@ -14,10 +14,10 @@
public:
typedef RealType value_type;
extreme_value_distribution(RealType location = 0, RealType scale = 1);
BOOST_MATH_GPU_ENABLED extreme_value_distribution(RealType location = 0, RealType scale = 1);
RealType scale()const;
RealType location()const;
BOOST_MATH_GPU_ENABLED RealType scale()const;
BOOST_MATH_GPU_ENABLED RealType location()const;
};
There are various
@@ -59,18 +59,18 @@ And this graph illustrates how the PDF varies with the shape parameter:
[h4 Member Functions]
extreme_value_distribution(RealType location = 0, RealType scale = 1);
BOOST_MATH_GPU_ENABLED extreme_value_distribution(RealType location = 0, RealType scale = 1);
Constructs an Extreme Value distribution with the specified location and scale
parameters.
Requires `scale > 0`, otherwise calls __domain_error.
RealType location()const;
BOOST_MATH_GPU_ENABLED RealType location()const;
Returns the location parameter of the distribution.
RealType scale()const;
BOOST_MATH_GPU_ENABLED RealType scale()const;
Returns the scale parameter of the distribution.
@@ -78,6 +78,8 @@ Returns the scale parameter of the distribution.
All the [link math_toolkit.dist_ref.nmp usual non-member accessor functions]
that are generic to all distributions are supported: __usual_accessors.
For this distribution all non-member accessor functions are marked with `BOOST_MATH_GPU_ENABLED` and can
be run on both host and device.
The domain of the random parameter is \[-[infin], +[infin]\].

View File

@@ -15,10 +15,10 @@
typedef RealType value_type;
typedef Policy policy_type;
holtsmark_distribution(RealType location = 0, RealType scale = 1);
BOOST_MATH_GPU_ENABLED holtsmark_distribution(RealType location = 0, RealType scale = 1);
RealType location()const;
RealType scale()const;
BOOST_MATH_GPU_ENABLED RealType location()const;
BOOST_MATH_GPU_ENABLED RealType scale()const;
};
The [@http://en.wikipedia.org/wiki/holtsmark_distribution Holtsmark distribution]
@@ -51,7 +51,7 @@ the distribution:
[h4 Member Functions]
holtsmark_distribution(RealType location = 0, RealType scale = 1);
BOOST_MATH_GPU_ENABLED holtsmark_distribution(RealType location = 0, RealType scale = 1);
Constructs a holtsmark distribution, with location parameter /location/
and scale parameter /scale/. When these parameters take their default
@@ -60,11 +60,11 @@ then the result is a Standard holtsmark Distribution.
Requires scale > 0, otherwise calls __domain_error.
RealType location()const;
BOOST_MATH_GPU_ENABLED RealType location()const;
Returns the location parameter of the distribution.
RealType scale()const;
BOOST_MATH_GPU_ENABLED RealType scale()const;
Returns the scale parameter of the distribution.
@@ -72,6 +72,8 @@ Returns the scale parameter of the distribution.
All the [link math_toolkit.dist_ref.nmp usual non-member accessor functions]
that are generic to all distributions are supported: __usual_accessors.
For this distribution all non-member accessor functions are marked with `BOOST_MATH_GPU_ENABLED` and can
be run on both host and device.
Note however that the holtsmark distribution does not have a skewness,
kurtosis, etc. See __math_undefined

View File

@@ -15,11 +15,11 @@
typedef RealType value_type;
typedef Policy policy_type;
landau_distribution(RealType location = 0, RealType scale = 1);
BOOST_MATH_GPU_ENABLED landau_distribution(RealType location = 0, RealType scale = 1);
RealType location()const;
RealType scale()const;
RealType bias()const;
BOOST_MATH_GPU_ENABLED RealType location()const;
BOOST_MATH_GPU_ENABLED RealType scale()const;
BOOST_MATH_GPU_ENABLED RealType bias()const;
};
The [@http://en.wikipedia.org/wiki/landau_distribution Landau distribution]
@@ -54,7 +54,7 @@ the distribution:
[h4 Member Functions]
landau_distribution(RealType location = 0, RealType scale = 1);
BOOST_MATH_GPU_ENABLED landau_distribution(RealType location = 0, RealType scale = 1);
Constructs a landau distribution, with location parameter /location/
and scale parameter /scale/. When these parameters take their default
@@ -63,15 +63,15 @@ then the result is a Standard landau Distribution.
Requires scale > 0, otherwise calls __domain_error.
RealType location()const;
BOOST_MATH_GPU_ENABLED RealType location()const;
Returns the location parameter of the distribution.
RealType scale()const;
BOOST_MATH_GPU_ENABLED RealType scale()const;
Returns the scale parameter of the distribution.
RealType bias()const;
BOOST_MATH_GPU_ENABLED RealType bias()const;
Returns the amount of translation by the scale parameter.
[expression bias = - 2 / [pi] log(c)]
@@ -80,6 +80,8 @@ Returns the amount of translation by the scale parameter.
All the [link math_toolkit.dist_ref.nmp usual non-member accessor functions]
that are generic to all distributions are supported: __usual_accessors.
For this distribution all non-member accessor functions are marked with `BOOST_MATH_GPU_ENABLED` and can
be run on both host and device.
Note however that the landau distribution does not have a mean,
standard deviation, etc. See __math_undefined

View File

@@ -17,10 +17,10 @@
typedef RealType value_type;
typedef Policy policy_type;
// Construct:
laplace_distribution(RealType location = 0, RealType scale = 1);
BOOST_MATH_GPU_ENABLED laplace_distribution(RealType location = 0, RealType scale = 1);
// Accessors:
RealType location()const;
RealType scale()const;
BOOST_MATH_GPU_ENABLED RealType location()const;
BOOST_MATH_GPU_ENABLED RealType scale()const;
};
}} // namespaces
@@ -49,7 +49,7 @@ Note that the domain of the random variable remains
[h4 Member Functions]
laplace_distribution(RealType location = 0, RealType scale = 1);
BOOST_MATH_GPU_ENABLED laplace_distribution(RealType location = 0, RealType scale = 1);
Constructs a laplace distribution with location /location/ and
scale /scale/.
@@ -61,11 +61,11 @@ The scale parameter is proportional to the standard deviation of the random vari
Requires that the scale parameter is greater than zero, otherwise calls
__domain_error.
RealType location()const;
BOOST_MATH_GPU_ENABLED RealType location()const;
Returns the /location/ parameter of this distribution.
RealType scale()const;
BOOST_MATH_GPU_ENABLED RealType scale()const;
Returns the /scale/ parameter of this distribution.
@@ -73,6 +73,8 @@ Returns the /scale/ parameter of this distribution.
All the [link math_toolkit.dist_ref.nmp usual non-member accessor functions] that are generic to all
distributions are supported: __usual_accessors.
For this distribution all non-member accessor functions are marked with `BOOST_MATH_GPU_ENABLED` and can
be run on both host and device.
The domain of the random variable is \[-[infin],+[infin]\].

View File

@@ -15,10 +15,10 @@
typedef RealType value_type;
typedef Policy policy_type;
// Construct:
logistic_distribution(RealType location = 0, RealType scale = 1);
BOOST_MATH_GPU_ENABLED logistic_distribution(RealType location = 0, RealType scale = 1);
// Accessors:
RealType location()const; // location.
RealType scale()const; // scale.
BOOST_MATH_GPU_ENABLED RealType location()const; // location.
BOOST_MATH_GPU_ENABLED RealType scale()const; // scale.
};
@@ -39,17 +39,17 @@ parameters change:
[h4 Member Functions]
logistic_distribution(RealType u = 0, RealType s = 1);
BOOST_MATH_GPU_ENABLED logistic_distribution(RealType u = 0, RealType s = 1);
Constructs a logistic distribution with location /u/ and scale /s/.
Requires `scale > 0`, otherwise a __domain_error is raised.
RealType location()const;
BOOST_MATH_GPU_ENABLED RealType location()const;
Returns the location of this distribution.
RealType scale()const;
BOOST_MATH_GPU_ENABLED RealType scale()const;
Returns the scale of this distribution.
@@ -57,6 +57,8 @@ Returns the scale of this distribution.
All the [link math_toolkit.dist_ref.nmp usual non-member accessor functions]
that are generic to all distributions are supported: __usual_accessors.
For this distribution all non-member accessor functions are marked with `BOOST_MATH_GPU_ENABLED` and can
be run on both host and device.
The domain of the random variable is \[-\[max_value\], +\[min_value\]\].
However, the pdf and cdf support inputs of +[infin] and -[infin]

View File

@@ -15,10 +15,10 @@
typedef RealType value_type;
typedef Policy policy_type;
mapairy_distribution(RealType location = 0, RealType scale = 1);
BOOST_MATH_GPU_ENABLED mapairy_distribution(RealType location = 0, RealType scale = 1);
RealType location()const;
RealType scale()const;
BOOST_MATH_GPU_ENABLED RealType location()const;
BOOST_MATH_GPU_ENABLED RealType scale()const;
};
It is special case of a [@http://en.wikipedia.org/wiki/Stable_distribution stable distribution]
@@ -50,7 +50,7 @@ the distribution:
[h4 Member Functions]
mapairy_distribution(RealType location = 0, RealType scale = 1);
BOOST_MATH_GPU_ENABLED mapairy_distribution(RealType location = 0, RealType scale = 1);
Constructs a mapairy distribution, with location parameter /location/
and scale parameter /scale/. When these parameters take their default
@@ -59,11 +59,11 @@ then the result is a Standard map-airy Distribution.
Requires scale > 0, otherwise calls __domain_error.
RealType location()const;
BOOST_MATH_GPU_ENABLED RealType location()const;
Returns the location parameter of the distribution.
RealType scale()const;
BOOST_MATH_GPU_ENABLED RealType scale()const;
Returns the scale parameter of the distribution.
@@ -71,6 +71,8 @@ Returns the scale parameter of the distribution.
All the [link math_toolkit.dist_ref.nmp usual non-member accessor functions]
that are generic to all distributions are supported: __usual_accessors.
For this distribution all non-member accessor functions are marked with `BOOST_MATH_GPU_ENABLED` and can
be run on both host and device.
Note however that the map-airy distribution does not have a skewness,
kurtosis, etc. See __math_undefined

View File

@@ -15,10 +15,10 @@
typedef RealType value_type;
typedef Policy policy_type;
saspoint5_distribution(RealType location = 0, RealType scale = 1);
BOOST_MATH_GPU_ENABLED saspoint5_distribution(RealType location = 0, RealType scale = 1);
RealType location()const;
RealType scale()const;
BOOST_MATH_GPU_ENABLED RealType location()const;
BOOST_MATH_GPU_ENABLED RealType scale()const;
};
It is special case of a [@http://en.wikipedia.org/wiki/Stable_distribution stable distribution]
@@ -49,7 +49,7 @@ the distribution:
[h4 Member Functions]
saspoint5_distribution(RealType location = 0, RealType scale = 1);
BOOST_MATH_GPU_ENABLED saspoint5_distribution(RealType location = 0, RealType scale = 1);
Constructs a S[alpha]S Point5 distribution, with location parameter /location/
and scale parameter /scale/. When these parameters take their default
@@ -58,11 +58,11 @@ then the result is a Standard S[alpha]S Point5 Distribution.
Requires scale > 0, otherwise calls __domain_error.
RealType location()const;
BOOST_MATH_GPU_ENABLED RealType location()const;
Returns the location parameter of the distribution.
RealType scale()const;
BOOST_MATH_GPU_ENABLED RealType scale()const;
Returns the scale parameter of the distribution.
@@ -70,6 +70,8 @@ Returns the scale parameter of the distribution.
All the [link math_toolkit.dist_ref.nmp usual non-member accessor functions]
that are generic to all distributions are supported: __usual_accessors.
For this distribution all non-member accessor functions are marked with `BOOST_MATH_GPU_ENABLED` and can
be run on both host and device.
Note however that the S[alpha]S Point5 distribution does not have a mean,
standard deviation, etc. See __math_undefined

View File

@@ -17,10 +17,10 @@
typedef RealType value_type;
typedef Policy policy_type;
// Construct:
weibull_distribution(RealType shape, RealType scale = 1)
BOOST_MATH_GPU_ENABLED weibull_distribution(RealType shape, RealType scale = 1)
// Accessors:
RealType shape()const;
RealType scale()const;
BOOST_MATH_GPU_ENABLED RealType shape()const;
BOOST_MATH_GPU_ENABLED RealType scale()const;
};
}} // namespaces
@@ -65,7 +65,7 @@ Samuel Kotz & Saralees Nadarajah].
[h4 Member Functions]
weibull_distribution(RealType shape, RealType scale = 1);
BOOST_MATH_GPU_ENABLED weibull_distribution(RealType shape, RealType scale = 1);
Constructs a [@http://en.wikipedia.org/wiki/Weibull_distribution
Weibull distribution] with shape /shape/ and scale /scale/.
@@ -73,11 +73,11 @@ Weibull distribution] with shape /shape/ and scale /scale/.
Requires that the /shape/ and /scale/ parameters are both greater than zero,
otherwise calls __domain_error.
RealType shape()const;
BOOST_MATH_GPU_ENABLED RealType shape()const;
Returns the /shape/ parameter of this distribution.
RealType scale()const;
BOOST_MATH_GPU_ENABLED RealType scale()const;
Returns the /scale/ parameter of this distribution.
@@ -85,6 +85,8 @@ Returns the /scale/ parameter of this distribution.
All the [link math_toolkit.dist_ref.nmp usual non-member accessor functions] that are generic to all
distributions are supported: __usual_accessors.
For this distribution all non-member accessor functions are marked with `BOOST_MATH_GPU_ENABLED` and can
be run on both host and device.
The domain of the random variable is \[0, [infin]\].