diff --git a/CHANGELOG.md b/CHANGELOG.md index 8cb021507..73d6495a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,6 +42,8 @@ [#146](https://github.com/fortran-lang/stdlib/pull/146) - new procedures `gauss_legendre`, `gauss_legendre_lobatto` [#313](https://github.com/fortran-lang/stdlib/pull/313) +- new module `stdlib_random` + [#271](https://github.com/fortran-lang/stdlib/pull/271) - new module `stdlib_sorting` - new procedures `sort`, `ord_sort` and `sort_index` [#408](https://github.com/fortran-lang/stdlib/pull/408) @@ -61,8 +63,6 @@ [#191](https://github.com/fortran-lang/stdlib/pull/191) - new procedure `median` [#426](https://github.com/fortran-lang/stdlib/pull/426) -- new module `stdlib_stats_distribution_PRNG` - [#271](https://github.com/fortran-lang/stdlib/pull/271) - new module `stdlib_string_type` - new derived types `string_type` [#320](https://github.com/fortran-lang/stdlib/pull/320) diff --git a/doc/specs/index.md b/doc/specs/index.md index 01ad4be26..e4a5d8d76 100644 --- a/doc/specs/index.md +++ b/doc/specs/index.md @@ -21,9 +21,9 @@ This is and index/directory of the specifications (specs) for each new module/fe - [math](./stdlib_math.html) - General purpose mathematical functions - [optval](./stdlib_optval.html) - Fallback value for optional arguments - [quadrature](./stdlib_quadrature.html) - Numerical integration + - [random](./stdlib_random.html) - Probability Distributions random number generator - [sorting](./stdlib_sorting.html) - Sorting of rank one arrays - [stats](./stdlib_stats.html) - Descriptive Statistics - - [stats_distribution_PRNG](./stdlib_stats_distribution_PRNG.html) - Probability Distributions random number generator - [string\_type](./stdlib_string_type.html) - Basic string support - [strings](./stdlib_strings.html) - String handling and manipulation routines - [stringlist_type](./stdlib_stringlist_type.html) - 1-Dimensional list of strings diff --git a/doc/specs/stdlib_stats_distribution_PRNG.md b/doc/specs/stdlib_random.md similarity index 85% rename from doc/specs/stdlib_stats_distribution_PRNG.md rename to doc/specs/stdlib_random.md index 60067bde6..a31e5143f 100644 --- a/doc/specs/stdlib_stats_distribution_PRNG.md +++ b/doc/specs/stdlib_random.md @@ -1,5 +1,5 @@ --- -title: stats_distribution +title: stats_random --- # Statistical Distributions -- Pseudorandom Number Generator Module @@ -18,7 +18,7 @@ Set or get the seed value before calling the probability distribution pseudorand ### Syntax -`call [[stdlib_stats_distribution_PRNG(module):random_seed(interface)]](put, get)` +`call [[stdlib_random(module):random_seed(interface)]](put, get)` ### Arguments @@ -34,7 +34,7 @@ Return a scalar of type `integer`. ```fortran program demo_random_seed - use stdlib_stats_distribution_PRNG, only : random_seed + use stdlib_random, only : random_seed implicit none integer :: seed_put, seed_get @@ -55,7 +55,7 @@ Generate an integer pseudorandom number in a specific range [-2^k, 2^k - 1] acco ### Syntax -`result = [[stdlib_stats_distribution_PRNG(module):dist_rand(interface)]](n)` +`result = [[stdlib_random(module):dist_rand(interface)]](n)` ### Arguments @@ -69,7 +69,7 @@ Return a scalar of type `integer`. ```fortran program demo_dist_rand - use stdlib_stats_distribution_PRNG, only : dist_rand, random_seed + use stdlib_random, only : dist_rand, random_seed implicit none integer :: put, get diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 8639308cc..520e105f6 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -28,7 +28,7 @@ set(fppFiles stdlib_quadrature.fypp stdlib_quadrature_trapz.fypp stdlib_quadrature_simps.fypp - stdlib_stats_distribution_PRNG.fypp + stdlib_random.fypp stdlib_math.fypp stdlib_math_linspace.fypp stdlib_math_logspace.fypp diff --git a/src/Makefile.manual b/src/Makefile.manual index 7576cf3d8..0bf5ef02d 100644 --- a/src/Makefile.manual +++ b/src/Makefile.manual @@ -12,6 +12,7 @@ SRCFYPP = \ stdlib_quadrature.fypp \ stdlib_quadrature_trapz.fypp \ stdlib_quadrature_simps.fypp \ + stdlib_random.fypp \ stdlib_sorting.fypp \ stdlib_sorting_ord_sort.fypp \ stdlib_sorting_sort.fypp \ @@ -29,7 +30,6 @@ SRCFYPP = \ stdlib_math.fypp \ stdlib_math_linspace.fypp \ stdlib_math_logspace.fypp \ - stdlib_stats_distribution_PRNG.fypp \ stdlib_string_type.fypp \ stdlib_string_type_constructor.fypp \ stdlib_strings.fypp \ @@ -145,7 +145,7 @@ stdlib_stats_var.o: \ stdlib_optval.o \ stdlib_kinds.o \ stdlib_stats.o -stdlib_stats_distribution_PRNG.o: \ +stdlib_random.o: \ stdlib_kinds.o \ stdlib_error.o stdlib_string_type.o: stdlib_ascii.o \ diff --git a/src/stdlib_stats_distribution_PRNG.fypp b/src/stdlib_random.fypp similarity index 93% rename from src/stdlib_stats_distribution_PRNG.fypp rename to src/stdlib_random.fypp index 94a696640..9a587c86b 100644 --- a/src/stdlib_stats_distribution_PRNG.fypp +++ b/src/stdlib_random.fypp @@ -1,5 +1,5 @@ #:include "common.fypp" -module stdlib_stats_distribution_PRNG +module stdlib_random use stdlib_kinds, only: int8, int16, int32, int64 use stdlib_optval, only: optval use stdlib_error, only: error_stop @@ -18,8 +18,8 @@ module stdlib_stats_distribution_PRNG !! Version experimental !! !! Generation of random integers with different kinds - !! ([Specification](../page/specs/stdlib_stats_distribution_PRNG.html# - !! description)) + !! ([Specification](../page/specs/stdlib_random.html# + !! dist_rand-get-a-random-integer-with-specified-kind)) #:for k1, t1 in INT_KINDS_TYPES module procedure dist_rand_${t1[0]}$${k1}$ #:endfor @@ -29,8 +29,8 @@ module stdlib_stats_distribution_PRNG !! Version experimental !! !! Set seed value for random number generator - !! ([Specification](../page/specs/stdlib_stats_distribution_PRNG.html# - !! description)) + !! ([Specification](../page/specs/stdlib_random.html# + !! random_seed-set-or-get-a-value-of-seed-to-the-probability-distribution-pseudorandom-number-generator)) !! #:for k1, t1 in INT_KINDS_TYPES module procedure random_distribution_seed_${t1[0]}$${k1}$ @@ -148,4 +148,4 @@ module stdlib_stats_distribution_PRNG end subroutine random_distribution_seed_${t1[0]}$${k1}$ #:endfor -end module stdlib_stats_distribution_PRNG +end module stdlib_random diff --git a/src/tests/stats/test_distribution_PRNG.f90 b/src/tests/stats/test_distribution_PRNG.f90 index 923091dd3..d132ff4ab 100644 --- a/src/tests/stats/test_distribution_PRNG.f90 +++ b/src/tests/stats/test_distribution_PRNG.f90 @@ -1,7 +1,7 @@ program test_distribution_PRNG use stdlib_error, only : check use stdlib_kinds, only: int8, int16, int32, int64 - use stdlib_stats_distribution_PRNG, only : random_seed, dist_rand + use stdlib_random, only : random_seed, dist_rand implicit none logical :: warn = .true.