55
55
* [mt19937]: http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/CODES/mt19937ar.c
56
56
*/
57
57
58
- // Note: keep project includes in alphabetical order...
58
+ #include "stdlib/random/base/mt19937.h"
59
+ #include "stdlib/random/base/shared.h"
59
60
#include <stdlib.h>
60
61
#include <stdint.h>
61
62
#include <string.h>
62
- #include "stdlib/random/base.h"
63
- #include "stdlib/random/base/mt19937.h"
64
63
65
64
// Forward declarations:
66
65
static inline int8_t next ( struct BasePRNGObject * obj , uint64_t * out );
@@ -392,11 +391,11 @@ static inline void twist( uint32_t *state, const int32_t N ) {
392
391
* @return pointer to a dynamically allocated PRNG or, if unable to allocate memory, a null pointer
393
392
*
394
393
* @example
394
+ * #include "stdlib/random/base/mt19937.h"
395
+ * #include "stdlib/random/base/shared.h"
395
396
* #include <stdlib.h>
396
397
* #include <stdio.h>
397
398
* #include <stdint.h>
398
- * #include "stdlib/random/base.h"
399
- * #include "stdlib/random/base/mt19937.h"
400
399
*
401
400
* // Define a PRNG seed:
402
401
* uint32_t seed[] = { 12345 };
@@ -472,11 +471,11 @@ struct BasePRNGObject * stdlib_base_random_mt19937_allocate( const uint32_t *see
472
471
* @param obj PRNG object
473
472
*
474
473
* @example
474
+ * #include "stdlib/random/base/mt19937.h"
475
+ * #include "stdlib/random/base/shared.h"
475
476
* #include <stdlib.h>
476
477
* #include <stdio.h>
477
478
* #include <stdint.h>
478
- * #include "stdlib/random/base.h"
479
- * #include "stdlib/random/base/mt19937.h"
480
479
*
481
480
* // Define a PRNG seed:
482
481
* uint32_t seed[] = { 12345 };
@@ -527,11 +526,11 @@ void stdlib_base_random_mt19937_free( struct BasePRNGObject *obj ) {
527
526
* @return status code
528
527
*
529
528
* @example
529
+ * #include "stdlib/random/base/mt19937.h"
530
+ * #include "stdlib/random/base/shared.h"
530
531
* #include <stdlib.h>
531
532
* #include <stdio.h>
532
533
* #include <stdint.h>
533
- * #include "stdlib/random/base.h"
534
- * #include "stdlib/random/base/mt19937.h"
535
534
*
536
535
* // Define a PRNG seed:
537
536
* uint32_t seed1[] = { 12345 };
@@ -596,11 +595,11 @@ int8_t stdlib_base_random_mt19937_seed_length( const struct BasePRNGObject *obj,
596
595
* @return status code
597
596
*
598
597
* @example
598
+ * #include "stdlib/random/base/mt19937.h"
599
+ * #include "stdlib/random/base/shared.h"
599
600
* #include <stdlib.h>
600
601
* #include <stdio.h>
601
602
* #include <stdint.h>
602
- * #include "stdlib/random/base.h"
603
- * #include "stdlib/random/base/mt19937.h"
604
603
*
605
604
* // Define a PRNG seed:
606
605
* uint32_t seed1[] = { 12345 };
@@ -664,11 +663,11 @@ int8_t stdlib_base_random_mt19937_seed( const struct BasePRNGObject *obj, uint32
664
663
* @return pointer to a copy of the PRNG's internal state or, if unable to allocate memory, a null pointer
665
664
*
666
665
* @example
666
+ * #include "stdlib/random/base/mt19937.h"
667
+ * #include "stdlib/random/base/shared.h"
667
668
* #include <stdlib.h>
668
669
* #include <stdio.h>
669
670
* #include <stdint.h>
670
- * #include "stdlib/random/base.h"
671
- * #include "stdlib/random/base/mt19937.h"
672
671
*
673
672
* // Define a PRNG seed:
674
673
* uint32_t seed[] = { 12345 };
@@ -695,8 +694,8 @@ int8_t stdlib_base_random_mt19937_seed( const struct BasePRNGObject *obj, uint32
695
694
* free( state );
696
695
*/
697
696
void * stdlib_base_random_mt19937_state ( const struct BasePRNGObject * obj ) {
697
+ const stdlib_base_random_mt19937_state_t * so ;
698
698
stdlib_base_random_mt19937_state_t * state ;
699
- stdlib_base_random_mt19937_state_t * so ;
700
699
uint64_t nbytes ;
701
700
uint32_t * seed ;
702
701
if ( obj == NULL || obj -> prng != & mt19937_prng ) {
@@ -735,11 +734,11 @@ void * stdlib_base_random_mt19937_state( const struct BasePRNGObject *obj ) {
735
734
* @return status code
736
735
*
737
736
* @example
737
+ * #include "stdlib/random/base/mt19937.h"
738
+ * #include "stdlib/random/base/shared.h"
738
739
* #include <stdlib.h>
739
740
* #include <stdio.h>
740
741
* #include <stdint.h>
741
- * #include "stdlib/random/base.h"
742
- * #include "stdlib/random/base/mt19937.h"
743
742
*
744
743
* // Define a PRNG seed:
745
744
* uint32_t seed[] = { 12345 };
0 commit comments