From d3ed5bf7503b07a7fad3de4b69a5badff9ffe175 Mon Sep 17 00:00:00 2001 From: Ian Giestas Pauli Date: Mon, 27 Jun 2022 15:05:04 -0300 Subject: [PATCH 1/3] Fixes issue with `rvs_normal` where it lacks the elemental property as noted in [https://github.com/fortran-lang/stdlib/pull/662#discussion_r907615242] --- src/stdlib_stats_distribution_normal.fypp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/stdlib_stats_distribution_normal.fypp b/src/stdlib_stats_distribution_normal.fypp index e21b7af14..de4f4b275 100644 --- a/src/stdlib_stats_distribution_normal.fypp +++ b/src/stdlib_stats_distribution_normal.fypp @@ -160,6 +160,7 @@ contains #:for k1, t1 in REAL_KINDS_TYPES + impure elemental & function rvs_norm_${t1[0]}$${k1}$(loc, scale) result(res) ! ! Normal random variate (loc, scale) @@ -178,6 +179,7 @@ contains #:for k1, t1 in CMPLX_KINDS_TYPES + impure elemental & function rvs_norm_${t1[0]}$${k1}$(loc, scale) result(res) ! ! Normally distributed complex. The real part and imaginary part are & From b32a260af4f8c5cb33dc430c1603a5a0d769473a Mon Sep 17 00:00:00 2001 From: Ian Giestas Pauli Date: Fri, 1 Jul 2022 13:48:14 -0300 Subject: [PATCH 2/3] Update specs to reflect the change --- doc/specs/stdlib_stats_distribution_normal.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/specs/stdlib_stats_distribution_normal.md b/doc/specs/stdlib_stats_distribution_normal.md index 860aec2dd..e023edc79 100644 --- a/doc/specs/stdlib_stats_distribution_normal.md +++ b/doc/specs/stdlib_stats_distribution_normal.md @@ -30,16 +30,16 @@ Note: the algorithm used for generating normal random variates is fundamentally ### Class -Function +Elemental function (passing both loc and scale). ### Arguments -`array_size`: optional argument has `intent(in)` and is a scalar of type `integer`. - `loc`: optional argument has `intent(in)` and is a scalar of type `real` or `complex`. `scale`: optional argument has `intent(in)` and is a scalar of type `real` or `complex`. +`array_size`: optional argument has `intent(in)` and is a scalar of type `integer`. + `loc` and `scale` arguments must be of the same type. ### Return value From d4c72ee9c2a46e0a08ab72a6ad3a2a18b9a65709 Mon Sep 17 00:00:00 2001 From: Ian Giestas Pauli Date: Fri, 1 Jul 2022 13:49:48 -0300 Subject: [PATCH 3/3] Add `quotes` around `loc` and `scale` --- doc/specs/stdlib_stats_distribution_normal.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/specs/stdlib_stats_distribution_normal.md b/doc/specs/stdlib_stats_distribution_normal.md index e023edc79..88e692ccc 100644 --- a/doc/specs/stdlib_stats_distribution_normal.md +++ b/doc/specs/stdlib_stats_distribution_normal.md @@ -30,7 +30,7 @@ Note: the algorithm used for generating normal random variates is fundamentally ### Class -Elemental function (passing both loc and scale). +Elemental function (passing both `loc` and `scale`). ### Arguments