Skip to content

Commit 230d7af

Browse files
chore: replace XORSHIFT with Xorshift32 and remove related section from README
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: passed - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent 41768f5 commit 230d7af

File tree

6 files changed

+24
-52
lines changed

6 files changed

+24
-52
lines changed

lib/node_modules/@stdlib/random/base/xorshift/README.md

Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ limitations under the License.
1818
1919
-->
2020

21-
# XORSHIFT
21+
# Xorshift32
2222

23-
> A 32-bit xorshift pseudorandom number generator ([XORSHIFT][xorshift]) based on George Marsaglia.
23+
> A 32-bit [xorshift][] pseudorandom number generator based on George Marsaglia.
2424
2525
<section class="usage">
2626

@@ -50,7 +50,7 @@ var r = xorshift.normalized();
5050

5151
#### xorshift.factory( \[options] )
5252

53-
Returns a 32-bit xorshift pseudorandom number generator ([XORSHIFT][xorshift]).
53+
Returns a 32-bit [xorshift][] pseudorandom number generator.
5454

5555
```javascript
5656
var rand = xorshift.factory();
@@ -296,19 +296,6 @@ for ( i = 0; i < 100; i++ ) {
296296

297297
<section class="related">
298298

299-
* * *
300-
301-
## See Also
302-
303-
<!--
304-
- <span class="package-name">[`@stdlib/random/array/xorshift`][@stdlib/random/array/xorshift]</span><span class="delimiter">: </span><span class="description">create an array containing pseudorandom numbers generated using a 32-bit xorshift pseudorandom number generator based on George Marsaglia.</span>
305-
- <span class="package-name">[`@stdlib/random/iter/xorshift`][@stdlib/random/iter/xorshift]</span><span class="delimiter">: </span><span class="description">create an iterator for a 32-bit xorshift pseudorandom number generator based on George Marsaglia.</span>
306-
- <span class="package-name">[`@stdlib/random/streams/xorshift`][@stdlib/random/streams/xorshift]</span><span class="delimiter">: </span><span class="description">create a readable stream for a 32-bit xorshift pseudorandom number generator based on George Marsaglia.</span>
307-
-->
308-
309-
- <span class="package-name">[`@stdlib/random/base/mt19937`][@stdlib/random/base/mt19937]</span><span class="delimiter">: </span><span class="description">A 32-bit Mersenne Twister pseudorandom number generator.</span>
310-
- <span class="package-name">[`@stdlib/random/base/randi`][@stdlib/random/base/randi]</span><span class="delimiter">: </span><span class="description">pseudorandom numbers having integer values.</span>
311-
312299
</section>
313300

314301
<!-- /.related -->
@@ -325,21 +312,6 @@ for ( i = 0; i < 100; i++ ) {
325312

326313
[@stdlib/array/uint32]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/uint32
327314

328-
<!-- <related-links> -->
329-
330-
<!--
331-
[@stdlib/random/array/xorshift]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/random/array/xorshift
332-
333-
[@stdlib/random/iter/xorshift]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/random/iter/xorshift
334-
335-
[@stdlib/random/streams/xorshift]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/random/streams/xorshift
336-
-->
337-
338-
[@stdlib/random/base/mt19937]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/random/base/mt19937
339-
340-
[@stdlib/random/base/randi]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/random/base/randi
341-
342-
<!-- </related-links> -->
343315

344316
</section>
345317

lib/node_modules/@stdlib/random/base/xorshift/docs/types/index.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ interface Options {
2929
/**
3030
* Pseudorandom number generator seed.
3131
*/
32-
seed?: random.PRNGSeedXORSHIFT;
32+
seed?: random.PRNGSeedXorshift32;
3333

3434
/**
3535
* Pseudorandom number generator state.
3636
*/
37-
state?: random.PRNGStateXORSHIFT;
37+
state?: random.PRNGStateXorshift32;
3838

3939
/**
4040
* Specifies whether to copy a provided pseudorandom number generator state.
@@ -64,7 +64,7 @@ interface PRNG {
6464
/**
6565
* PRNG seed.
6666
*/
67-
readonly seed: random.PRNGSeedXORSHIFT;
67+
readonly seed: random.PRNGSeedXorshift32;
6868

6969
/**
7070
* PRNG seed length.
@@ -74,7 +74,7 @@ interface PRNG {
7474
/**
7575
* PRNG state.
7676
*/
77-
state: random.PRNGStateXORSHIFT;
77+
state: random.PRNGStateXorshift32;
7878

7979
/**
8080
* PRNG state length.

lib/node_modules/@stdlib/random/base/xorshift/lib/factory.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ function verifyState( state, FLG ) {
107107
* Returns a 32-bit xorshift pseudorandom number generator based on George Marsaglia.
108108
*
109109
* @param {Options} [options] - options
110-
* @param {PRNGSeedXORSHIFT} [options.seed] - pseudorandom number generator seed
111-
* @param {PRNGStateXORSHIFT} [options.state] - pseudorandom number generator state
110+
* @param {PRNGSeedXorshift32} [options.seed] - pseudorandom number generator seed
111+
* @param {PRNGStateXorshift32} [options.state] - pseudorandom number generator state
112112
* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state
113113
* @throws {TypeError} options argument must be an object
114114
* @throws {TypeError} a seed must be either a positive integer less than or equal to the maximum unsigned 32-bit integer or an array-like object containing such integers
@@ -261,7 +261,7 @@ function factory( options ) {
261261
* Returns the PRNG seed.
262262
*
263263
* @private
264-
* @returns {PRNGSeedXORSHIFT} seed
264+
* @returns {PRNGSeedXorshift32} seed
265265
*/
266266
function getSeed() {
267267
var len = STATE[ SEED_SECTION_OFFSET ];
@@ -316,7 +316,7 @@ function factory( options ) {
316316
* - The first element of each section following the preamble specifies the section length. The remaining section elements comprise the section contents.
317317
*
318318
* @private
319-
* @returns {PRNGStateXORSHIFT} current state
319+
* @returns {PRNGStateXorshift32} current state
320320
*/
321321
function getState() {
322322
var len = STATE.length;
@@ -332,7 +332,7 @@ function factory( options ) {
332332
* - If PRNG state is "shared" and one sets the generator state to a state array of the same length, the PRNG state is updated (along with the state of all other PRNGs sharing the PRNG's state array).
333333
*
334334
* @private
335-
* @param {PRNGStateXORSHIFT} s - generator state
335+
* @param {PRNGStateXorshift32} s - generator state
336336
* @throws {TypeError} must provide an `Uint32Array`
337337
* @throws {Error} must provide a valid state
338338
*/

lib/node_modules/@stdlib/random/base/xorshift/src/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ static const uint32_t MAX_UINT32 = 0xffffffff;
3434
static const double NORMALIZATION_CONSTANT = (double)MAX_UINT32;
3535

3636
/**
37-
* XORSHIFT PRNG.
37+
* Xorshift32 PRNG.
3838
*
3939
*/
4040
static const struct BasePRNG xorshift_prng = {
@@ -278,7 +278,7 @@ int8_t stdlib_base_random_xorshift_seed( const struct BasePRNGObject *obj, uint3
278278
if ( obj == NULL || obj->prng != &xorshift_prng ) {
279279
return -1;
280280
}
281-
// Retrieve the XORSHIFT state object:
281+
// Retrieve the Xorshift32 state object:
282282
const stdlib_base_random_xorshift_state_t *state = (stdlib_base_random_xorshift_state_t *)( obj->state );
283283

284284
// Set the output value:

lib/node_modules/@stdlib/types/index.d.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4276,23 +4276,23 @@ declare module '@stdlib/types/random' {
42764276
type PRNGStateMINSTD = Int32Array;
42774277

42784278
/**
4279-
* A pseudorandom number generator (PRNG) seed for the 32-bit XORSHIFT PRNG.
4279+
* A pseudorandom number generator (PRNG) seed for the 32-bit Xorshift32 PRNG.
42804280
*
42814281
* @example
4282-
* const s: PRNGSeedXORSHIFT = 12345;
4282+
* const s: PRNGSeedXorshift32 = 12345;
42834283
*
42844284
* @example
4285-
* const s: PRNGSeedXORSHIFT = [ 12345, 67891 ];
4285+
* const s: PRNGSeedXorshift32 = [ 12345, 67891 ];
42864286
*/
4287-
type PRNGSeedXORSHIFT = number | ArrayLike<number>;
4287+
type PRNGSeedXorshift32 = number | ArrayLike<number>;
42884288

42894289
/**
4290-
* A pseudorandom number generator (PRNG) state for the 32-bit XORSHIFT PRNG.
4290+
* A pseudorandom number generator (PRNG) state for the 32-bit Xorshift32 PRNG.
42914291
*
42924292
* @example
4293-
* const s: PRNGStateXORSHIFT = new Uint32Array( 6 );
4293+
* const s: PRNGStateXorshift32 = new Uint32Array( 6 );
42944294
*/
4295-
type PRNGStateXORSHIFT = Uint32Array;
4295+
type PRNGStateXorshift32 = Uint32Array;
42964296

42974297
}
42984298

lib/node_modules/@stdlib/types/test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -667,17 +667,17 @@ function cmplx128Array(): array.Complex128Array {
667667
throw new Error( 'something went wrong' );
668668
}
669669

670-
const s7: random.PRNGSeedXORSHIFT = 12345;
670+
const s7: random.PRNGSeedXorshift32 = 12345;
671671
if ( s7 !== 12345 ) {
672672
throw new Error( 'something went wrong' );
673673
}
674674

675-
const s8: random.PRNGSeedXORSHIFT = new Uint32Array( 10 );
675+
const s8: random.PRNGSeedXorshift32 = new Uint32Array( 10 );
676676
if ( s8[ 0 ] !== 0 ) {
677677
throw new Error( 'something went wrong' );
678678
}
679679

680-
const s9: random.PRNGStateXORSHIFT = new Uint32Array( 10 );
680+
const s9: random.PRNGStateXorshift32 = new Uint32Array( 10 );
681681
if ( s9[ 0 ] !== 0 ) {
682682
throw new Error( 'something went wrong' );
683683
}

0 commit comments

Comments
 (0)