Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@stdlib/random-base-mt19937

Package Overview
Dependencies
Maintainers
4
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stdlib/random-base-mt19937 - npm Package Compare versions

Comparing version
0.2.1
to
0.2.2
+1
-1
dist/index.js

@@ -1,2 +0,2 @@

"use strict";var O=function(r,e){return function(){return e||r((e={exports:{}}).exports,e),e.exports}};var S=O(function(Ne,B){"use strict";var re=require("@stdlib/constants-uint32-max"),ne=require("@stdlib/math-base-special-floor"),te=re-1;function ie(){var r=ne(1+te*Math.random());return r>>>0}B.exports=ie});var x=O(function(qe,Z){"use strict";var T=require("@stdlib/utils-define-nonenumerable-read-only-property"),d=require("@stdlib/utils-define-nonenumerable-read-only-accessor"),j=require("@stdlib/utils-define-nonenumerable-read-write-accessor"),w=require("@stdlib/assert-has-own-property"),ae=require("@stdlib/assert-is-plain-object"),oe=require("@stdlib/assert-is-collection"),G=require("@stdlib/assert-is-uint32array"),ue=require("@stdlib/assert-is-boolean").isPrimitive,k=require("@stdlib/assert-is-positive-integer").isPrimitive,J=require("@stdlib/constants-float64-max-safe-integer"),K=require("@stdlib/constants-uint32-max"),v=require("@stdlib/array-uint32"),fe=require("@stdlib/math-base-special-max"),L=require("@stdlib/math-base-ops-umul"),y=require("@stdlib/blas-base-gcopy"),ve=require("@stdlib/array-to-json"),s=require("@stdlib/string-format"),D=S(),u=624,M=397,W=K>>>0,Ee=19650218,R=2147483648,N=2147483647,se=1812433253,le=1664525,ge=1566083941,ce=2636928640,he=4022730752,Te=2567483615,q=[0,Te>>>0],V=1/(J+1),de=67108864,me=2147483648,I=1,_e=J*V,A=1,b=3,m=2,_=u+3,E=u+5,p=u+6;function z(r,e){var n;return e?n="option":n="argument",r.length<p+1?new RangeError(s("invalid %s. `state` array has insufficient length.",n)):r[0]!==A?new RangeError(s("invalid %s. `state` array has an incompatible schema version. Expected: `%s`. Actual: `%s.`",n,A,r[0])):r[1]!==b?new RangeError(s("invalid %s. `state` array has an incompatible number of sections. Expected: `%s`. Actual: `%s`.",n,b,r[1])):r[m]!==u?new RangeError(s("invalid %s. `state` array has an incompatible state length. Expected: `%u`. Actual: `%u`.",n,u,r[m])):r[_]!==1?new RangeError(s("invalid %s. `state` array has an incompatible section length. Expected: `%u`. Actual: `%u`.",n,1,r[_])):r[E]!==r.length-p?new RangeError(s("invalid %s. `state` array length is incompatible with seed section length. Expected: `%u`. Actual: `%u`.",n,r.length-p,r[E])):null}function H(r,e,n){var a;for(r[0]=n>>>0,a=1;a<e;a++)n=r[a-1]>>>0,n=(n^n>>>30)>>>0,r[a]=L(n,se)+a>>>0;return r}function ye(r,e,n,a){var t,o,g,h;for(o=1,g=0,h=fe(e,a);h>0;h--)t=r[o-1]>>>0,t=(t^t>>>30)>>>0,t=L(t,le)>>>0,r[o]=(r[o]>>>0^t)+n[g]+g>>>0,o+=1,g+=1,o>=e&&(r[0]=r[e-1],o=1),g>=a&&(g=0);for(h=e-1;h>0;h--)t=r[o-1]>>>0,t=(t^t>>>30)>>>0,t=L(t,ge)>>>0,r[o]=(r[o]>>>0^t)-o>>>0,o+=1,o>=e&&(r[0]=r[e-1],o=1);return r[0]=me,r}function pe(r){var e,n,a,t;for(t=u-M,n=0;n<t;n++)e=r[n]&R|r[n+1]&N,r[n]=r[n+M]^e>>>1^q[e&I];for(a=u-1;n<a;n++)e=r[n]&R|r[n+1]&N,r[n]=r[n-t]^e>>>1^q[e&I];return e=r[a]&R|r[0]&N,r[a]=r[M-1]^e>>>1^q[e&I],r}function Ae(r){var e,n,a,t,o,g;if(a={},arguments.length){if(!ae(r))throw new TypeError(s("invalid argument. Options argument must be an object. Value: `%s`.",r));if(w(r,"copy")&&(a.copy=r.copy,!ue(r.copy)))throw new TypeError(s("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",r.copy));if(w(r,"state")){if(n=r.state,a.state=!0,!G(n))throw new TypeError(s("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",n));if(g=z(n,!0),g)throw g;a.copy===!1?e=n:(e=new v(n.length),y(n.length,n,1,e,1)),n=new v(e.buffer,e.byteOffset+(m+1)*e.BYTES_PER_ELEMENT,u),t=new v(e.buffer,e.byteOffset+(E+1)*e.BYTES_PER_ELEMENT,n[E])}if(t===void 0)if(w(r,"seed"))if(t=r.seed,a.seed=!0,k(t)){if(t>W)throw new RangeError(s("invalid option. `%s` option must be a positive integer less than or equal to the maximum unsigned 32-bit integer. Option: `%u`.","seed",t));t>>>=0}else{if(oe(t)===!1||t.length<1)throw new TypeError(s("invalid option. `%s` option must be either a positive integer less than or equal to the maximum unsigned 32-bit integer or an array-like object containing integer values less than or equal to the maximum unsigned 32-bit integer. Option: `%s`.","seed",t));if(t.length===1){if(t=t[0],!k(t))throw new TypeError(s("invalid option. `%s` option must be either a positive integer less than or equal to the maximum unsigned 32-bit integer or an array-like object containing integer values less than or equal to the maximum unsigned 32-bit integer. Option: `%s`.","seed",t));if(t>W)throw new RangeError(s("invalid option. `%s` option must be either a positive integer less than or equal to the maximum unsigned 32-bit integer or an array-like object containing integer values less than or equal to the maximum unsigned 32-bit integer. Option: `%u`.","seed",t));t>>>=0}else o=t.length,e=new v(p+o),e[0]=A,e[1]=b,e[m]=u,e[_]=1,e[_+1]=u,e[E]=o,y.ndarray(o,t,1,0,e,1,E+1),n=new v(e.buffer,e.byteOffset+(m+1)*e.BYTES_PER_ELEMENT,u),t=new v(e.buffer,e.byteOffset+(E+1)*e.BYTES_PER_ELEMENT,o),n=H(n,u,Ee),n=ye(n,u,t,o)}else t=D()>>>0}else t=D()>>>0;return n===void 0&&(e=new v(p+1),e[0]=A,e[1]=b,e[m]=u,e[_]=1,e[_+1]=u,e[E]=1,e[E+1]=t,n=new v(e.buffer,e.byteOffset+(m+1)*e.BYTES_PER_ELEMENT,u),t=new v(e.buffer,e.byteOffset+(E+1)*e.BYTES_PER_ELEMENT,1),n=H(n,u,t)),T(f,"NAME","mt19937"),d(f,"seed",h),d(f,"seedLength",P),j(f,"state",U,X),d(f,"stateLength",F),d(f,"byteLength",C),T(f,"toJSON",Y),T(f,"MIN",0),T(f,"MAX",K),T(f,"normalized",c),T(c,"NAME",f.NAME),d(c,"seed",h),d(c,"seedLength",P),j(c,"state",U,X),d(c,"stateLength",F),d(c,"byteLength",C),T(c,"toJSON",Y),T(c,"MIN",0),T(c,"MAX",_e),f;function h(){var i=e[E];return y(i,t,1,new v(i),1)}function P(){return e[E]}function F(){return e.length}function C(){return e.byteLength}function U(){var i=e.length;return y(i,e,1,new v(i),1)}function X(i){var l;if(!G(i))throw new TypeError(s("invalid argument. Must provide a Uint32Array. Value: `%s`.",i));if(l=z(i,!1),l)throw l;a.copy===!1?a.state&&i.length===e.length?y(i.length,i,1,e,1):(e=i,a.state=!0):(i.length!==e.length&&(e=new v(i.length)),y(i.length,i,1,e,1)),n=new v(e.buffer,e.byteOffset+(m+1)*e.BYTES_PER_ELEMENT,u),t=new v(e.buffer,e.byteOffset+(E+1)*e.BYTES_PER_ELEMENT,e[E])}function Y(){var i={};return i.type="PRNG",i.name=f.NAME,i.state=ve(e),i.params=[],i}function f(){var i,l;return l=e[_+1],l>=u&&(n=pe(n),l=0),i=n[l],e[_+1]=l+1,i^=i>>>11,i^=i<<7&ce,i^=i<<15&he,i^=i>>>18,i>>>0}function c(){var i=f()>>>5,l=f()>>>6;return(i*de+l)*V}}Z.exports=Ae});var $=O(function(Ie,Q){"use strict";var be=x(),Oe=S(),Se=be({seed:Oe()});Q.exports=Se});var we=require("@stdlib/utils-define-nonenumerable-read-only-property"),ee=$(),Me=x();we(ee,"factory",Me);module.exports=ee;
"use strict";var O=function(r,e){return function(){return e||r((e={exports:{}}).exports,e),e.exports}};var S=O(function(Ne,B){"use strict";var re=require("@stdlib/constants-uint32-max"),ne=require("@stdlib/math-base-special-floor"),te=re-1;function ie(){var r=ne(1+te*Math.random());return r>>>0}B.exports=ie});var x=O(function(qe,Z){"use strict";var T=require("@stdlib/utils-define-nonenumerable-read-only-property"),d=require("@stdlib/utils-define-nonenumerable-read-only-accessor"),j=require("@stdlib/utils-define-nonenumerable-read-write-accessor"),w=require("@stdlib/assert-has-own-property"),ae=require("@stdlib/assert-is-plain-object"),oe=require("@stdlib/assert-is-collection"),G=require("@stdlib/assert-is-uint32array"),ue=require("@stdlib/assert-is-boolean").isPrimitive,k=require("@stdlib/assert-is-positive-integer").isPrimitive,J=require("@stdlib/constants-float64-max-safe-integer"),K=require("@stdlib/constants-uint32-max"),v=require("@stdlib/array-uint32"),fe=require("@stdlib/math-base-special-max"),L=require("@stdlib/number-uint32-base-mul"),y=require("@stdlib/blas-base-gcopy"),ve=require("@stdlib/array-to-json"),s=require("@stdlib/string-format"),D=S(),u=624,M=397,W=K>>>0,Ee=19650218,R=2147483648,N=2147483647,se=1812433253,le=1664525,ge=1566083941,ce=2636928640,he=4022730752,Te=2567483615,q=[0,Te>>>0],V=1/(J+1),de=67108864,me=2147483648,I=1,_e=J*V,A=1,b=3,m=2,_=u+3,E=u+5,p=u+6;function z(r,e){var n;return e?n="option":n="argument",r.length<p+1?new RangeError(s("invalid %s. `state` array has insufficient length.",n)):r[0]!==A?new RangeError(s("invalid %s. `state` array has an incompatible schema version. Expected: `%s`. Actual: `%s.`",n,A,r[0])):r[1]!==b?new RangeError(s("invalid %s. `state` array has an incompatible number of sections. Expected: `%s`. Actual: `%s`.",n,b,r[1])):r[m]!==u?new RangeError(s("invalid %s. `state` array has an incompatible state length. Expected: `%u`. Actual: `%u`.",n,u,r[m])):r[_]!==1?new RangeError(s("invalid %s. `state` array has an incompatible section length. Expected: `%u`. Actual: `%u`.",n,1,r[_])):r[E]!==r.length-p?new RangeError(s("invalid %s. `state` array length is incompatible with seed section length. Expected: `%u`. Actual: `%u`.",n,r.length-p,r[E])):null}function H(r,e,n){var a;for(r[0]=n>>>0,a=1;a<e;a++)n=r[a-1]>>>0,n=(n^n>>>30)>>>0,r[a]=L(n,se)+a>>>0;return r}function ye(r,e,n,a){var t,o,g,h;for(o=1,g=0,h=fe(e,a);h>0;h--)t=r[o-1]>>>0,t=(t^t>>>30)>>>0,t=L(t,le)>>>0,r[o]=(r[o]>>>0^t)+n[g]+g>>>0,o+=1,g+=1,o>=e&&(r[0]=r[e-1],o=1),g>=a&&(g=0);for(h=e-1;h>0;h--)t=r[o-1]>>>0,t=(t^t>>>30)>>>0,t=L(t,ge)>>>0,r[o]=(r[o]>>>0^t)-o>>>0,o+=1,o>=e&&(r[0]=r[e-1],o=1);return r[0]=me,r}function pe(r){var e,n,a,t;for(t=u-M,n=0;n<t;n++)e=r[n]&R|r[n+1]&N,r[n]=r[n+M]^e>>>1^q[e&I];for(a=u-1;n<a;n++)e=r[n]&R|r[n+1]&N,r[n]=r[n-t]^e>>>1^q[e&I];return e=r[a]&R|r[0]&N,r[a]=r[M-1]^e>>>1^q[e&I],r}function Ae(r){var e,n,a,t,o,g;if(a={},arguments.length){if(!ae(r))throw new TypeError(s("invalid argument. Options argument must be an object. Value: `%s`.",r));if(w(r,"copy")&&(a.copy=r.copy,!ue(r.copy)))throw new TypeError(s("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",r.copy));if(w(r,"state")){if(n=r.state,a.state=!0,!G(n))throw new TypeError(s("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",n));if(g=z(n,!0),g)throw g;a.copy===!1?e=n:(e=new v(n.length),y(n.length,n,1,e,1)),n=new v(e.buffer,e.byteOffset+(m+1)*e.BYTES_PER_ELEMENT,u),t=new v(e.buffer,e.byteOffset+(E+1)*e.BYTES_PER_ELEMENT,n[E])}if(t===void 0)if(w(r,"seed"))if(t=r.seed,a.seed=!0,k(t)){if(t>W)throw new RangeError(s("invalid option. `%s` option must be a positive integer less than or equal to the maximum unsigned 32-bit integer. Option: `%u`.","seed",t));t>>>=0}else{if(oe(t)===!1||t.length<1)throw new TypeError(s("invalid option. `%s` option must be either a positive integer less than or equal to the maximum unsigned 32-bit integer or an array-like object containing integer values less than or equal to the maximum unsigned 32-bit integer. Option: `%s`.","seed",t));if(t.length===1){if(t=t[0],!k(t))throw new TypeError(s("invalid option. `%s` option must be either a positive integer less than or equal to the maximum unsigned 32-bit integer or an array-like object containing integer values less than or equal to the maximum unsigned 32-bit integer. Option: `%s`.","seed",t));if(t>W)throw new RangeError(s("invalid option. `%s` option must be either a positive integer less than or equal to the maximum unsigned 32-bit integer or an array-like object containing integer values less than or equal to the maximum unsigned 32-bit integer. Option: `%u`.","seed",t));t>>>=0}else o=t.length,e=new v(p+o),e[0]=A,e[1]=b,e[m]=u,e[_]=1,e[_+1]=u,e[E]=o,y.ndarray(o,t,1,0,e,1,E+1),n=new v(e.buffer,e.byteOffset+(m+1)*e.BYTES_PER_ELEMENT,u),t=new v(e.buffer,e.byteOffset+(E+1)*e.BYTES_PER_ELEMENT,o),n=H(n,u,Ee),n=ye(n,u,t,o)}else t=D()>>>0}else t=D()>>>0;return n===void 0&&(e=new v(p+1),e[0]=A,e[1]=b,e[m]=u,e[_]=1,e[_+1]=u,e[E]=1,e[E+1]=t,n=new v(e.buffer,e.byteOffset+(m+1)*e.BYTES_PER_ELEMENT,u),t=new v(e.buffer,e.byteOffset+(E+1)*e.BYTES_PER_ELEMENT,1),n=H(n,u,t)),T(f,"NAME","mt19937"),d(f,"seed",h),d(f,"seedLength",P),j(f,"state",U,X),d(f,"stateLength",F),d(f,"byteLength",C),T(f,"toJSON",Y),T(f,"MIN",0),T(f,"MAX",K),T(f,"normalized",c),T(c,"NAME",f.NAME),d(c,"seed",h),d(c,"seedLength",P),j(c,"state",U,X),d(c,"stateLength",F),d(c,"byteLength",C),T(c,"toJSON",Y),T(c,"MIN",0),T(c,"MAX",_e),f;function h(){var i=e[E];return y(i,t,1,new v(i),1)}function P(){return e[E]}function F(){return e.length}function C(){return e.byteLength}function U(){var i=e.length;return y(i,e,1,new v(i),1)}function X(i){var l;if(!G(i))throw new TypeError(s("invalid argument. Must provide a Uint32Array. Value: `%s`.",i));if(l=z(i,!1),l)throw l;a.copy===!1?a.state&&i.length===e.length?y(i.length,i,1,e,1):(e=i,a.state=!0):(i.length!==e.length&&(e=new v(i.length)),y(i.length,i,1,e,1)),n=new v(e.buffer,e.byteOffset+(m+1)*e.BYTES_PER_ELEMENT,u),t=new v(e.buffer,e.byteOffset+(E+1)*e.BYTES_PER_ELEMENT,e[E])}function Y(){var i={};return i.type="PRNG",i.name=f.NAME,i.state=ve(e),i.params=[],i}function f(){var i,l;return l=e[_+1],l>=u&&(n=pe(n),l=0),i=n[l],e[_+1]=l+1,i^=i>>>11,i^=i<<7&ce,i^=i<<15&he,i^=i>>>18,i>>>0}function c(){var i=f()>>>5,l=f()>>>6;return(i*de+l)*V}}Z.exports=Ae});var $=O(function(Ie,Q){"use strict";var be=x(),Oe=S(),Se=be({seed:Oe()});Q.exports=Se});var we=require("@stdlib/utils-define-nonenumerable-read-only-property"),ee=$(),Me=x();we(ee,"factory",Me);module.exports=ee;
/**

@@ -3,0 +3,0 @@ * @license Apache-2.0

{
"version": 3,
"sources": ["../lib/rand_uint32.js", "../lib/factory.js", "../lib/main.js", "../lib/index.js"],
"sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar UINT32_MAX = require( '@stdlib/constants-uint32-max' );\nvar floor = require( '@stdlib/math-base-special-floor' );\n\n\n// VARIABLES //\n\nvar MAX = UINT32_MAX - 1;\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom integer on the interval \\\\( [1, 2^{32}-1) \\\\).\n*\n* @private\n* @returns {PositiveInteger} pseudorandom integer\n*\n* @example\n* var v = randuint32();\n* // returns <number>\n*/\nfunction randuint32() {\n\tvar v = floor( 1.0 + (MAX*Math.random()) ); // eslint-disable-line stdlib/no-builtin-math\n\treturn v >>> 0; // asm type annotation\n}\n\n\n// EXPORTS //\n\nmodule.exports = randuint32;\n", "/* eslint-disable max-lines, max-len */\n\n/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*\n*\n* ## Notice\n*\n* The original C code and copyright notice are from the [source implementation][mt19937]. The implementation has been modified for JavaScript.\n*\n* ```text\n* Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,\n* All rights reserved.\n*\n* Redistribution and use in source and binary forms, with or without\n* modification, are permitted provided that the following conditions\n* are met:\n*\n* 1. Redistributions of source code must retain the above copyright\n* notice, this list of conditions and the following disclaimer.\n*\n* 2. Redistributions in binary form must reproduce the above copyright\n* notice, this list of conditions and the following disclaimer in the\n* documentation and/or other materials provided with the distribution.\n*\n* 3. The names of its contributors may not be used to endorse or promote\n* products derived from this software without specific prior written\n* permission.\n*\n* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n* \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n* ```\n*\n* [mt19937]: http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/CODES/mt19937ar.c\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils-define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils-define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils-define-nonenumerable-read-write-accessor' );\nvar hasOwnProp = require( '@stdlib/assert-has-own-property' );\nvar isObject = require( '@stdlib/assert-is-plain-object' );\nvar isCollection = require( '@stdlib/assert-is-collection' );\nvar isUint32Array = require( '@stdlib/assert-is-uint32array' );\nvar isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert-is-positive-integer' ).isPrimitive;\nvar FLOAT64_MAX_SAFE_INTEGER = require( '@stdlib/constants-float64-max-safe-integer' );\nvar UINT32_MAX = require( '@stdlib/constants-uint32-max' );\nvar Uint32Array = require( '@stdlib/array-uint32' );\nvar max = require( '@stdlib/math-base-special-max' );\nvar umul = require( '@stdlib/math-base-ops-umul' );\nvar gcopy = require( '@stdlib/blas-base-gcopy' );\nvar typedarray2json = require( '@stdlib/array-to-json' );\nvar format = require( '@stdlib/string-format' );\nvar randuint32 = require( './rand_uint32.js' );\n\n\n// VARIABLES //\n\n// Define the size of the state array (see refs):\nvar N = 624;\n\n// Define a (magic) constant used for indexing into the state array:\nvar M = 397;\n\n// Define the maximum seed: 11111111111111111111111111111111\nvar MAX_SEED = UINT32_MAX >>> 0; // asm type annotation\n\n// For seed arrays, define an initial state (magic) constant: 19650218 => 00000001001010111101011010101010\nvar SEED_ARRAY_INIT_STATE = 19650218 >>> 0; // asm type annotation\n\n// Define a mask for the most significant `w-r` bits, where `w` is the word size (32 bits) and `r` is the separation point of one word (see refs): 2147483648 => 0x80000000 => 10000000000000000000000000000000\nvar UPPER_MASK = 0x80000000 >>> 0; // asm type annotation\n\n// Define a mask for the least significant `r` bits (see refs): 2147483647 => 0x7fffffff => 01111111111111111111111111111111\nvar LOWER_MASK = 0x7fffffff >>> 0; // asm type annotation\n\n// Define a multiplier (see Knuth TAOCP Vol2. 3rd Ed. P.106): 1812433253 => 01101100000001111000100101100101\nvar KNUTH_MULTIPLIER = 1812433253 >>> 0; // asm type annotation\n\n// Define a (magic) multiplier: 1664525 => 00000000000110010110011000001101\nvar MAGIC_MULTIPLIER_1 = 1664525 >>> 0; // asm type annotation\n\n// Define a (magic) multiplier: 1566083941 => 01011101010110001000101101100101\nvar MAGIC_MULTIPLIER_2 = 1566083941 >>> 0; // asm type annotation\n\n// Define a tempering coefficient: 2636928640 => 0x9d2c5680 => 10011101001011000101011010000000\nvar TEMPERING_COEFFICIENT_1 = 0x9d2c5680 >>> 0; // asm type annotation\n\n// Define a tempering coefficient: 4022730752 => 0xefc60000 => 11101111110001100000000000000000\nvar TEMPERING_COEFFICIENT_2 = 0xefc60000 >>> 0; // asm type annotation\n\n// Define a constant vector `a` (see refs): 2567483615 => 0x9908b0df => 10011001000010001011000011011111\nvar MATRIX_A = 0x9908b0df >>> 0; // asm type annotation\n\n// MAG01[x] = x * MATRIX_A; for x = {0,1}\nvar MAG01 = [ 0x0 >>> 0, MATRIX_A >>> 0 ]; // asm type annotation\n\n// Define a normalization constant when generating double-precision floating-point numbers: 2^53 => 9007199254740992\nvar FLOAT64_NORMALIZATION_CONSTANT = 1.0 / ( FLOAT64_MAX_SAFE_INTEGER+1.0 ); // eslint-disable-line id-length\n\n// 2^26: 67108864\nvar TWO_26 = 67108864 >>> 0; // asm type annotation\n\n// 2^32: 2147483648 => 0x80000000 => 10000000000000000000000000000000\nvar TWO_32 = 0x80000000 >>> 0; // asm type annotation\n\n// 1 (as a 32-bit unsigned integer): 1 => 0x1 => 00000000000000000000000000000001\nvar ONE = 0x1 >>> 0; // asm type annotation\n\n// Define the maximum normalized pseudorandom double-precision floating-point number: ( (((2^32-1)>>>5)*2^26)+( (2^32-1)>>>6) ) / 2^53\nvar MAX_NORMALIZED = FLOAT64_MAX_SAFE_INTEGER * FLOAT64_NORMALIZATION_CONSTANT;\n\n// Define the state array schema version:\nvar STATE_ARRAY_VERSION = 1; // NOTE: anytime the state array schema changes, this value should be incremented!!!\n\n// Define the number of sections in the state array:\nvar NUM_STATE_SECTIONS = 3; // state, other, seed\n\n// Define the index offset of the \"state\" section in the state array:\nvar STATE_SECTION_OFFSET = 2; // | version | num_sections | state_length | ...state | other_length | state_index | seed_length | ...seed |\n\n// Define the index offset of the \"other\" section in the state array:\nvar OTHER_SECTION_OFFSET = N + 3; // | version | num_sections | state_length | ...state | other_length | state_index | seed_length | ...seed |\n\n// Define the index offset of the seed section in the state array:\nvar SEED_SECTION_OFFSET = N + 5; // | version | num_sections | state_length | ...state | other_length | state_index | seed_length | ...seed |\n\n// Define the length of the \"fixed\" length portion of the state array:\nvar STATE_FIXED_LENGTH = N + 6; // 1 (version) + 1 (num_sections) + 1 (state_length) + N (state) + 1 (other_length) + 1 (state_index) + 1 (seed_length)\n\n\n// FUNCTIONS //\n\n/**\n* Verifies state array integrity.\n*\n* @private\n* @param {Uint32Array} state - state array\n* @param {boolean} FLG - flag indicating whether the state array was provided as an option (true) or an argument (false)\n* @returns {(Error|null)} an error or `null`\n*/\nfunction verifyState( state, FLG ) {\n\tvar s1;\n\tif ( FLG ) {\n\t\ts1 = 'option';\n\t} else {\n\t\ts1 = 'argument';\n\t}\n\t// The state array must have a minimum length...\n\tif ( state.length < STATE_FIXED_LENGTH+1 ) {\n\t\treturn new RangeError( format( 'invalid %s. `state` array has insufficient length.', s1 ) );\n\t}\n\t// The first element of the state array must equal the supported state array schema version...\n\tif ( state[ 0 ] !== STATE_ARRAY_VERSION ) {\n\t\treturn new RangeError( format( 'invalid %s. `state` array has an incompatible schema version. Expected: `%s`. Actual: `%s.`', s1, STATE_ARRAY_VERSION, state[ 0 ] ) );\n\t}\n\t// The second element of the state array must contain the number of sections...\n\tif ( state[ 1 ] !== NUM_STATE_SECTIONS ) {\n\t\treturn new RangeError( format( 'invalid %s. `state` array has an incompatible number of sections. Expected: `%s`. Actual: `%s`.', s1, NUM_STATE_SECTIONS, state[ 1 ] ) );\n\t}\n\t// The length of the \"state\" section must equal `N`...\n\tif ( state[ STATE_SECTION_OFFSET ] !== N ) {\n\t\treturn new RangeError( format( 'invalid %s. `state` array has an incompatible state length. Expected: `%u`. Actual: `%u`.', s1, N, state[ STATE_SECTION_OFFSET ] ) );\n\t}\n\t// The length of the \"other\" section must equal `1`...\n\tif ( state[ OTHER_SECTION_OFFSET ] !== 1 ) {\n\t\treturn new RangeError( format( 'invalid %s. `state` array has an incompatible section length. Expected: `%u`. Actual: `%u`.', s1, 1, state[ OTHER_SECTION_OFFSET ] ) );\n\t}\n\t// The length of the \"seed\" section much match the empirical length...\n\tif ( state[ SEED_SECTION_OFFSET ] !== state.length-STATE_FIXED_LENGTH ) {\n\t\treturn new RangeError( format( 'invalid %s. `state` array length is incompatible with seed section length. Expected: `%u`. Actual: `%u`.', s1, state.length-STATE_FIXED_LENGTH, state[ SEED_SECTION_OFFSET ] ) );\n\t}\n\treturn null;\n}\n\n/**\n* Returns an initial PRNG state.\n*\n* @private\n* @param {Uint32Array} state - state array\n* @param {PositiveInteger} N - state size\n* @param {uinteger32} s - seed\n* @returns {Uint32Array} state array\n*/\nfunction createState( state, N, s ) {\n\tvar i;\n\n\t// Set the first element of the state array to the provided seed:\n\tstate[ 0 ] = s >>> 0; // equivalent to `s & 0xffffffffUL` in original C implementation\n\n\t// Initialize the remaining state array elements:\n\tfor ( i = 1; i < N; i++ ) {\n\t\t/*\n\t\t* In the original C implementation (see `init_genrand()`),\n\t\t*\n\t\t* ```c\n\t\t* mt[i] = (KNUTH_MULTIPLIER * (mt[i-1] ^ (mt[i-1] >> 30)) + i)\n\t\t* ```\n\t\t*\n\t\t* In order to replicate this in JavaScript, we must emulate C-like multiplication of unsigned 32-bit integers.\n\t\t*/\n\t\ts = state[ i-1 ]>>>0; // asm type annotation\n\t\ts = ( s^(s>>>30) )>>>0; // asm type annotation\n\t\tstate[ i ] = ( umul( s, KNUTH_MULTIPLIER ) + i )>>>0; // asm type annotation\n\t}\n\treturn state;\n}\n\n/**\n* Initializes a PRNG state array according to a seed array.\n*\n* @private\n* @param {Uint32Array} state - state array\n* @param {NonNegativeInteger} N - state array length\n* @param {Collection} seed - seed array\n* @param {NonNegativeInteger} M - seed array length\n* @returns {Uint32Array} state array\n*/\nfunction initState( state, N, seed, M ) {\n\tvar s;\n\tvar i;\n\tvar j;\n\tvar k;\n\n\ti = 1;\n\tj = 0;\n\tfor ( k = max( N, M ); k > 0; k-- ) {\n\t\t/*\n\t\t* In the original C implementation (see `init_by_array()`),\n\t\t*\n\t\t* ```c\n\t\t* mt[i] = (mt[i]^((mt[i-1]^(mt[i-1]>>30))*1664525UL)) + seed[j] + j;\n\t\t* ```\n\t\t*\n\t\t* In order to replicate this in JavaScript, we must emulate C-like multiplication of unsigned 32-bit integers.\n\t\t*/\n\t\ts = state[ i-1 ]>>>0; // asm type annotation\n\t\ts = ( s^(s>>>30) )>>>0; // asm type annotation\n\t\ts = ( umul( s, MAGIC_MULTIPLIER_1 ) )>>>0; // asm type annotation\n\t\tstate[ i ] = ( ((state[i]>>>0)^s) + seed[j] + j )>>>0; /* non-linear */ // asm type annotation\n\n\t\ti += 1;\n\t\tj += 1;\n\t\tif ( i >= N ) {\n\t\t\tstate[ 0 ] = state[ N-1 ];\n\t\t\ti = 1;\n\t\t}\n\t\tif ( j >= M ) {\n\t\t\tj = 0;\n\t\t}\n\t}\n\tfor ( k = N-1; k > 0; k-- ) {\n\t\t/*\n\t\t* In the original C implementation (see `init_by_array()`),\n\t\t*\n\t\t* ```c\n\t\t* mt[i] = (mt[i]^((mt[i-1]^(mt[i-1]>>30))*1566083941UL)) - i;\n\t\t* ```\n\t\t*\n\t\t* In order to replicate this in JavaScript, we must emulate C-like multiplication of unsigned 32-bit integers.\n\t\t*/\n\t\ts = state[ i-1 ]>>>0; // asm type annotation\n\t\ts = ( s^(s>>>30) )>>>0; // asm type annotation\n\t\ts = ( umul( s, MAGIC_MULTIPLIER_2 ) )>>>0; // asm type annotation\n\t\tstate[ i ] = ( ((state[i]>>>0)^s) - i )>>>0; /* non-linear */ // asm type annotation\n\n\t\ti += 1;\n\t\tif ( i >= N ) {\n\t\t\tstate[ 0 ] = state[ N-1 ];\n\t\t\ti = 1;\n\t\t}\n\t}\n\t// Ensure a non-zero initial state array:\n\tstate[ 0 ] = TWO_32; // MSB (most significant bit) is 1\n\n\treturn state;\n}\n\n/**\n* Updates a PRNG's internal state by generating the next `N` words.\n*\n* @private\n* @param {Uint32Array} state - state array\n* @returns {Uint32Array} state array\n*/\nfunction twist( state ) {\n\tvar w;\n\tvar i;\n\tvar j;\n\tvar k;\n\n\tk = N - M;\n\tfor ( i = 0; i < k; i++ ) {\n\t\tw = ( state[i]&UPPER_MASK ) | ( state[i+1]&LOWER_MASK );\n\t\tstate[ i ] = state[ i+M ] ^ ( w>>>1 ) ^ MAG01[ w&ONE ];\n\t}\n\tj = N - 1;\n\tfor ( ; i < j; i++ ) {\n\t\tw = ( state[i]&UPPER_MASK ) | ( state[i+1]&LOWER_MASK );\n\t\tstate[ i ] = state[ i-k ] ^ ( w>>>1 ) ^ MAG01[ w&ONE ];\n\t}\n\tw = ( state[j]&UPPER_MASK ) | ( state[0]&LOWER_MASK );\n\tstate[ j ] = state[ M-1 ] ^ ( w>>>1 ) ^ MAG01[ w&ONE ];\n\treturn state;\n}\n\n\n// MAIN //\n\n/**\n* Returns a 32-bit Mersenne Twister pseudorandom number generator.\n*\n* ## Notes\n*\n* - In contrast to the original C implementation, array seeds of length `1` are considered integer seeds. This ensures that the seed `[ 1234 ]` generates the same output as the seed `1234`. In the original C implementation, the two seeds would yield different output, which is **not** obvious from a user perspective.\n*\n* @param {Options} [options] - options\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} options argument must be an object\n* @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 integers less than or equal to the maximum unsigned 32-bit integer\n* @throws {RangeError} a numeric seed must be a positive integer less than or equal to the maximum unsigned 32-bit integer\n* @throws {TypeError} state must be a `Uint32Array`\n* @throws {Error} must provide a valid state\n* @throws {TypeError} `copy` option must be a boolean\n* @returns {PRNG} Mersenne Twister PRNG\n*\n* @example\n* var mt19937 = factory();\n*\n* var v = mt19937();\n* // returns <number>\n*\n* @example\n* // Return a seeded Mersenne Twister PRNG:\n* var mt19937 = factory({\n* 'seed': 1234\n* });\n*\n* var v = mt19937();\n* // returns 822569775\n*/\nfunction factory( options ) {\n\tvar STATE;\n\tvar state;\n\tvar opts;\n\tvar seed;\n\tvar slen;\n\tvar err;\n\n\topts = {};\n\tif ( arguments.length ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\t\topts.copy = options.copy;\n\t\t\tif ( !isBoolean( options.copy ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', options.copy ) );\n\t\t\t}\n\t\t}\n\t\tif ( hasOwnProp( options, 'state' ) ) {\n\t\t\tstate = options.state;\n\t\t\topts.state = true;\n\t\t\tif ( !isUint32Array( state ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a Uint32Array. Option: `%s`.', 'state', state ) );\n\t\t\t}\n\t\t\terr = verifyState( state, true );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t\tif ( opts.copy === false ) {\n\t\t\t\tSTATE = state;\n\t\t\t} else {\n\t\t\t\tSTATE = new Uint32Array( state.length );\n\t\t\t\tgcopy( state.length, state, 1, STATE, 1 );\n\t\t\t}\n\t\t\t// Create a state \"view\":\n\t\t\tstate = new Uint32Array( STATE.buffer, STATE.byteOffset+((STATE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), N );\n\n\t\t\t// Create a seed \"view\":\n\t\t\tseed = new Uint32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), state[ SEED_SECTION_OFFSET ] );\n\t\t}\n\t\t// If provided a PRNG state, we ignore the `seed` option...\n\t\tif ( seed === void 0 ) {\n\t\t\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\t\t\tseed = options.seed;\n\t\t\t\topts.seed = true;\n\t\t\t\tif ( isPositiveInteger( seed ) ) {\n\t\t\t\t\tif ( seed > MAX_SEED ) {\n\t\t\t\t\t\tthrow new RangeError( format( 'invalid option. `%s` option must be a positive integer less than or equal to the maximum unsigned 32-bit integer. Option: `%u`.', 'seed', seed ) );\n\t\t\t\t\t}\n\t\t\t\t\tseed >>>= 0; // asm type annotation\n\t\t\t\t} else if ( isCollection( seed ) === false || seed.length < 1 ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be either a positive integer less than or equal to the maximum unsigned 32-bit integer or an array-like object containing integer values less than or equal to the maximum unsigned 32-bit integer. Option: `%s`.', 'seed', seed ) );\n\t\t\t\t} else if ( seed.length === 1 ) {\n\t\t\t\t\tseed = seed[ 0 ];\n\t\t\t\t\tif ( !isPositiveInteger( seed ) ) {\n\t\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be either a positive integer less than or equal to the maximum unsigned 32-bit integer or an array-like object containing integer values less than or equal to the maximum unsigned 32-bit integer. Option: `%s`.', 'seed', seed ) );\n\t\t\t\t\t}\n\t\t\t\t\tif ( seed > MAX_SEED ) {\n\t\t\t\t\t\tthrow new RangeError( format( 'invalid option. `%s` option must be either a positive integer less than or equal to the maximum unsigned 32-bit integer or an array-like object containing integer values less than or equal to the maximum unsigned 32-bit integer. Option: `%u`.', 'seed', seed ) );\n\t\t\t\t\t}\n\t\t\t\t\tseed >>>= 0; // asm type annotation\n\t\t\t\t} else {\n\t\t\t\t\tslen = seed.length;\n\t\t\t\t\tSTATE = new Uint32Array( STATE_FIXED_LENGTH+slen );\n\n\t\t\t\t\t// Initialize sections:\n\t\t\t\t\tSTATE[ 0 ] = STATE_ARRAY_VERSION;\n\t\t\t\t\tSTATE[ 1 ] = NUM_STATE_SECTIONS;\n\t\t\t\t\tSTATE[ STATE_SECTION_OFFSET ] = N;\n\t\t\t\t\tSTATE[ OTHER_SECTION_OFFSET ] = 1;\n\t\t\t\t\tSTATE[ OTHER_SECTION_OFFSET+1 ] = N; // state index\n\t\t\t\t\tSTATE[ SEED_SECTION_OFFSET ] = slen;\n\n\t\t\t\t\t// Copy the provided seed array to prevent external mutation, as mutation would lead to an inability to reproduce PRNG values according to the PRNG's stated seed:\n\t\t\t\t\tgcopy.ndarray( slen, seed, 1, 0, STATE, 1, SEED_SECTION_OFFSET+1 );\n\n\t\t\t\t\t// Create a state \"view\":\n\t\t\t\t\tstate = new Uint32Array( STATE.buffer, STATE.byteOffset+((STATE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), N );\n\n\t\t\t\t\t// Create a seed \"view\":\n\t\t\t\t\tseed = new Uint32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), slen );\n\n\t\t\t\t\t// Initialize the internal PRNG state:\n\t\t\t\t\tstate = createState( state, N, SEED_ARRAY_INIT_STATE );\n\t\t\t\t\tstate = initState( state, N, seed, slen );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tseed = randuint32() >>> 0; // asm type annotation\n\t\t\t}\n\t\t}\n\t} else {\n\t\tseed = randuint32() >>> 0; // asm type annotation\n\t}\n\tif ( state === void 0 ) {\n\t\tSTATE = new Uint32Array( STATE_FIXED_LENGTH+1 );\n\n\t\t// Initialize sections:\n\t\tSTATE[ 0 ] = STATE_ARRAY_VERSION;\n\t\tSTATE[ 1 ] = NUM_STATE_SECTIONS;\n\t\tSTATE[ STATE_SECTION_OFFSET ] = N;\n\t\tSTATE[ OTHER_SECTION_OFFSET ] = 1;\n\t\tSTATE[ OTHER_SECTION_OFFSET+1 ] = N; // state index\n\t\tSTATE[ SEED_SECTION_OFFSET ] = 1;\n\t\tSTATE[ SEED_SECTION_OFFSET+1 ] = seed;\n\n\t\t// Create a state \"view\":\n\t\tstate = new Uint32Array( STATE.buffer, STATE.byteOffset+((STATE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), N );\n\n\t\t// Create a seed \"view\":\n\t\tseed = new Uint32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), 1 );\n\n\t\t// Initialize the internal PRNG state:\n\t\tstate = createState( state, N, seed );\n\t}\n\t// Note: property order matters in order to maintain consistency of PRNG \"shape\" (hidden classes).\n\tsetReadOnly( mt19937, 'NAME', 'mt19937' );\n\tsetReadOnlyAccessor( mt19937, 'seed', getSeed );\n\tsetReadOnlyAccessor( mt19937, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( mt19937, 'state', getState, setState );\n\tsetReadOnlyAccessor( mt19937, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( mt19937, 'byteLength', getStateSize );\n\tsetReadOnly( mt19937, 'toJSON', toJSON );\n\tsetReadOnly( mt19937, 'MIN', 0 );\n\tsetReadOnly( mt19937, 'MAX', UINT32_MAX );\n\tsetReadOnly( mt19937, 'normalized', normalized );\n\n\tsetReadOnly( normalized, 'NAME', mt19937.NAME );\n\tsetReadOnlyAccessor( normalized, 'seed', getSeed );\n\tsetReadOnlyAccessor( normalized, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( normalized, 'state', getState, setState );\n\tsetReadOnlyAccessor( normalized, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( normalized, 'byteLength', getStateSize );\n\tsetReadOnly( normalized, 'toJSON', toJSON );\n\tsetReadOnly( normalized, 'MIN', 0.0 );\n\tsetReadOnly( normalized, 'MAX', MAX_NORMALIZED );\n\n\treturn mt19937;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\tvar len = STATE[ SEED_SECTION_OFFSET ];\n\t\treturn gcopy( len, seed, 1, new Uint32Array( len ), 1 );\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn STATE[ SEED_SECTION_OFFSET ];\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn STATE.length;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn STATE.byteLength;\n\t}\n\n\t/**\n\t* Returns the current PRNG state.\n\t*\n\t* ## Notes\n\t*\n\t* - The PRNG state array is comprised of a preamble followed by `3` sections:\n\t*\n\t* 0. preamble (version + number of sections)\n\t* 1. internal PRNG state\n\t* 2. auxiliary state information\n\t* 3. PRNG seed\n\t*\n\t* - The first element of the PRNG state array preamble is the state array schema version.\n\t*\n\t* - The second element of the PRNG state array preamble is the number of state array sections (i.e., `3`).\n\t*\n\t* - The first element of each section following the preamble specifies the section length. The remaining section elements comprise the section contents.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\tvar len = STATE.length;\n\t\treturn gcopy( len, STATE, 1, new Uint32Array( len ), 1 );\n\t}\n\n\t/**\n\t* Sets the PRNG state.\n\t*\n\t* ## Notes\n\t*\n\t* - If PRNG state is \"shared\" (meaning a state array was provided during PRNG creation and **not** copied) and one sets the generator state to a state array having a different length, the PRNG does **not** update the existing shared state and, instead, points to the newly provided state array. In order to synchronize PRNG output according to the new shared state array, the state array for **each** relevant PRNG must be **explicitly** set.\n\t* - 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).\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {TypeError} must provide a `Uint32Array`\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\tvar err;\n\t\tif ( !isUint32Array( s ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a Uint32Array. Value: `%s`.', s ) );\n\t\t}\n\t\terr = verifyState( s, false );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( opts.copy === false ) {\n\t\t\tif ( opts.state && s.length === STATE.length ) {\n\t\t\t\tgcopy( s.length, s, 1, STATE, 1 ); // update current shared state\n\t\t\t} else {\n\t\t\t\tSTATE = s; // point to new shared state\n\t\t\t\topts.state = true; // setting this flag allows updating a shared state even if a state array was not provided at PRNG creation\n\t\t\t}\n\t\t} else {\n\t\t\t// Check if we can reuse allocated memory...\n\t\t\tif ( s.length !== STATE.length ) {\n\t\t\t\tSTATE = new Uint32Array( s.length ); // reallocate\n\t\t\t}\n\t\t\tgcopy( s.length, s, 1, STATE, 1 );\n\t\t}\n\t\t// Create a new state \"view\":\n\t\tstate = new Uint32Array( STATE.buffer, STATE.byteOffset+((STATE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), N );\n\n\t\t// Create a new seed \"view\":\n\t\tseed = new Uint32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), STATE[ SEED_SECTION_OFFSET ] );\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = mt19937.NAME;\n\t\tout.state = typedarray2json( STATE );\n\t\tout.params = [];\n\t\treturn out;\n\t}\n\n\t/**\n\t* Generates a pseudorandom integer on the interval \\\\( [0, 2^{32}) \\\\).\n\t*\n\t* @private\n\t* @returns {uinteger32} pseudorandom integer\n\t*\n\t* @example\n\t* var r = mt19937();\n\t* // returns <number>\n\t*/\n\tfunction mt19937() {\n\t\tvar r;\n\t\tvar i;\n\n\t\t// Retrieve the current state index:\n\t\ti = STATE[ OTHER_SECTION_OFFSET+1 ];\n\n\t\t// Determine whether we need to update the PRNG state:\n\t\tif ( i >= N ) {\n\t\t\tstate = twist( state );\n\t\t\ti = 0;\n\t\t}\n\t\t// Get the next word of \"raw\"/untempered state:\n\t\tr = state[ i ];\n\n\t\t// Update the state index:\n\t\tSTATE[ OTHER_SECTION_OFFSET+1 ] = i + 1;\n\n\t\t// Tempering transform to compensate for the reduced dimensionality of equidistribution:\n\t\tr ^= r >>> 11;\n\t\tr ^= ( r << 7 ) & TEMPERING_COEFFICIENT_1;\n\t\tr ^= ( r << 15 ) & TEMPERING_COEFFICIENT_2;\n\t\tr ^= r >>> 18;\n\n\t\treturn r >>> 0;\n\t}\n\n\t/**\n\t* Generates a pseudorandom number on the interval \\\\( [0, 1) \\\\).\n\t*\n\t* ## Notes\n\t*\n\t* - The original C implementation credits Isaku Wada for this algorithm (2002/01/09).\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var r = normalized();\n\t* // returns <number>\n\t*/\n\tfunction normalized() {\n\t\tvar x = mt19937() >>> 5;\n\t\tvar y = mt19937() >>> 6;\n\t\treturn ( (x*TWO_26)+y ) * FLOAT64_NORMALIZATION_CONSTANT;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\nvar randuint32 = require( './rand_uint32.js' );\n\n\n// MAIN //\n\n/**\n* Generates a pseudorandom integer on the interval \\\\( [0, 2^{32}) \\\\).\n*\n* ## Method\n*\n* - When generating normalized double-precision floating-point numbers, we first generate two pseudorandom integers \\\\( x \\\\) and \\\\( y \\\\) on the interval \\\\( [0, 2^{32}) \\\\) for a combined \\\\( 64 \\\\) random bits.\n*\n* - We would like \\\\( 53 \\\\) random bits to generate a 53-bit precision integer and, thus, want to discard \\\\( 11 \\\\) of the generated bits.\n*\n* - We do so by discarding \\\\( 5 \\\\) bits from \\\\( x \\\\) and \\\\( 6 \\\\) bits from \\\\( y \\\\).\n*\n* - Accordingly, \\\\( x \\\\) contains \\\\( 27 \\\\) random bits, which are subsequently shifted left \\\\( 26 \\\\) bits (multiplied by \\\\( 2^{26} \\\\), and \\\\( y \\\\) contains \\\\( 26 \\\\) random bits to fill in the lower \\\\( 26 \\\\) bits. When summed, they combine to comprise \\\\( 53 \\\\) random bits of a double-precision floating-point integer.\n*\n* - As an example, suppose, for the sake of argument, the 32-bit PRNG generates the maximum unsigned 32-bit integer \\\\( 2^{32}-1 \\\\) twice in a row. Then,\n*\n* ```javascript\n* x = 4294967295 >>> 5; // 00000111111111111111111111111111\n* y = 4294967295 >>> 6; // 00000011111111111111111111111111\n* ```\n*\n* Multiplying \\\\( x \\\\) by \\\\( 2^{26} \\\\) returns \\\\( 9007199187632128 \\\\), which, in binary, is\n*\n* ```binarystring\n* 0 10000110011 11111111111111111111 11111100000000000000000000000000\n* ```\n*\n* Adding \\\\( y \\\\) yields \\\\( 9007199254740991 \\\\) (the maximum \"safe\" double-precision floating-point integer value), which, in binary, is\n*\n* ```binarystring\n* 0 10000110011 11111111111111111111 11111111111111111111111111111111\n* ```\n*\n* - Similarly, suppose the 32-bit PRNG generates the following values\n*\n* ```javascript\n* x = 1 >>> 5; // 0 => 00000000000000000000000000000000\n* y = 64 >>> 6; // 1 => 00000000000000000000000000000001\n* ```\n*\n* Multiplying \\\\( x \\\\) by \\\\( 2^{26} \\\\) returns \\\\( 0 \\\\), which, in binary, is\n*\n* ```binarystring\n* 0 00000000000 00000000000000000000 00000000000000000000000000000000\n* ```\n*\n* Adding \\\\( y \\\\) yields \\\\( 1 \\\\), which, in binary, is\n*\n* ```binarystring\n* 0 01111111111 00000000000000000000 00000000000000000000000000000000\n* ```\n*\n* - As different combinations of \\\\( x \\\\) and \\\\( y \\\\) are generated, different combinations of double-precision floating-point exponent and significand bits will be toggled, thus generating pseudorandom double-precision floating-point numbers.\n*\n* ## References\n*\n* - Matsumoto, Makoto, and Takuji Nishimura. 1998. \"Mersenne Twister: A 623-dimensionally Equidistributed Uniform Pseudo-random Number Generator.\" _ACM Transactions on Modeling and Computer Simulation_ 8 (1). New York, NY, USA: ACM: 3\u201330. doi:[10.1145/272991.272995][@matsumoto:1998a].\n* - Harase, Shin. 2017. \"Conversion of Mersenne Twister to double-precision floating-point numbers.\" _ArXiv_ abs/1708.06018 (September). <https://arxiv.org/abs/1708.06018>.\n*\n* [@matsumoto:1998a]: https://doi.org/10.1145/272991.272995\n*\n* @function mt19937\n* @type {PRNG}\n* @returns {PositiveInteger} pseudorandom integer\n*\n* @example\n* var v = mt19937();\n* // returns <number>\n*/\nvar mt19937 = factory({\n\t'seed': randuint32()\n});\n\n\n// EXPORTS //\n\nmodule.exports = mt19937;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* A 32-bit Mersenne Twister pseudorandom number generator.\n*\n* @module @stdlib/random-base-mt19937\n*\n* @example\n* var mt19937 = require( '@stdlib/random-base-mt19937' );\n*\n* var v = mt19937();\n* // returns <number>\n*\n* @example\n* var factory = require( '@stdlib/random-base-mt19937' ).factory;\n*\n* var mt19937 = factory({\n* 'seed': 1234\n* });\n*\n* var v = mt19937();\n* // returns 822569775\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils-define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"],
"mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,GAAAC,EAAA,cAsBA,IAAIC,GAAa,QAAS,8BAA+B,EACrDC,GAAQ,QAAS,iCAAkC,EAKnDC,GAAMF,GAAa,EAevB,SAASG,IAAa,CACrB,IAAIC,EAAIH,GAAO,EAAOC,GA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I9B,EAAOK,CAAE,EAGbU,EAAOnB,EAAqB,CAAE,EAAIS,EAAI,EAGtCyB,GAAKA,IAAM,GACXA,GAAOA,GAAK,EAAM9C,GAClB8C,GAAOA,GAAK,GAAO7C,GACnB6C,GAAKA,IAAM,GAEJA,IAAM,CACd,CAgBA,SAASH,GAAa,CACrB,IAAII,EAAIZ,EAAQ,IAAM,EAClBa,EAAIb,EAAQ,IAAM,EACtB,OAAUY,EAAE1C,GAAQ2C,GAAM5C,CAC3B,CACD,CAKA/B,EAAO,QAAUwD,KC3rBjB,IAAAoB,EAAAC,EAAA,SAAAC,GAAAC,EAAA,cAsBA,IAAIC,GAAU,IACVC,GAAa,IAyEbC,GAAUF,GAAQ,CACrB,KAAQC,GAAW,CACpB,CAAC,EAKDF,EAAO,QAAUG,KC3DjB,IAAIC,GAAc,QAAS,uDAAwD,EAC/EC,GAAO,IACPC,GAAU,IAKdF,GAAaC,GAAM,UAAWC,EAAQ,EAKtC,OAAO,QAAUD",
"sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar UINT32_MAX = require( '@stdlib/constants-uint32-max' );\nvar floor = require( '@stdlib/math-base-special-floor' );\n\n\n// VARIABLES //\n\nvar MAX = UINT32_MAX - 1;\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom integer on the interval \\\\( [1, 2^{32}-1) \\\\).\n*\n* @private\n* @returns {PositiveInteger} pseudorandom integer\n*\n* @example\n* var v = randuint32();\n* // returns <number>\n*/\nfunction randuint32() {\n\tvar v = floor( 1.0 + (MAX*Math.random()) ); // eslint-disable-line stdlib/no-builtin-math\n\treturn v >>> 0; // asm type annotation\n}\n\n\n// EXPORTS //\n\nmodule.exports = randuint32;\n", "/* eslint-disable max-lines, max-len */\n\n/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*\n*\n* ## Notice\n*\n* The original C code and copyright notice are from the [source implementation][mt19937]. The implementation has been modified for JavaScript.\n*\n* ```text\n* Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,\n* All rights reserved.\n*\n* Redistribution and use in source and binary forms, with or without\n* modification, are permitted provided that the following conditions\n* are met:\n*\n* 1. Redistributions of source code must retain the above copyright\n* notice, this list of conditions and the following disclaimer.\n*\n* 2. Redistributions in binary form must reproduce the above copyright\n* notice, this list of conditions and the following disclaimer in the\n* documentation and/or other materials provided with the distribution.\n*\n* 3. The names of its contributors may not be used to endorse or promote\n* products derived from this software without specific prior written\n* permission.\n*\n* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n* \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n* ```\n*\n* [mt19937]: http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/CODES/mt19937ar.c\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils-define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils-define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils-define-nonenumerable-read-write-accessor' );\nvar hasOwnProp = require( '@stdlib/assert-has-own-property' );\nvar isObject = require( '@stdlib/assert-is-plain-object' );\nvar isCollection = require( '@stdlib/assert-is-collection' );\nvar isUint32Array = require( '@stdlib/assert-is-uint32array' );\nvar isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert-is-positive-integer' ).isPrimitive;\nvar FLOAT64_MAX_SAFE_INTEGER = require( '@stdlib/constants-float64-max-safe-integer' );\nvar UINT32_MAX = require( '@stdlib/constants-uint32-max' );\nvar Uint32Array = require( '@stdlib/array-uint32' );\nvar max = require( '@stdlib/math-base-special-max' );\nvar umul = require( '@stdlib/number-uint32-base-mul' );\nvar gcopy = require( '@stdlib/blas-base-gcopy' );\nvar typedarray2json = require( '@stdlib/array-to-json' );\nvar format = require( '@stdlib/string-format' );\nvar randuint32 = require( './rand_uint32.js' );\n\n\n// VARIABLES //\n\n// Define the size of the state array (see refs):\nvar N = 624;\n\n// Define a (magic) constant used for indexing into the state array:\nvar M = 397;\n\n// Define the maximum seed: 11111111111111111111111111111111\nvar MAX_SEED = UINT32_MAX >>> 0; // asm type annotation\n\n// For seed arrays, define an initial state (magic) constant: 19650218 => 00000001001010111101011010101010\nvar SEED_ARRAY_INIT_STATE = 19650218 >>> 0; // asm type annotation\n\n// Define a mask for the most significant `w-r` bits, where `w` is the word size (32 bits) and `r` is the separation point of one word (see refs): 2147483648 => 0x80000000 => 10000000000000000000000000000000\nvar UPPER_MASK = 0x80000000 >>> 0; // asm type annotation\n\n// Define a mask for the least significant `r` bits (see refs): 2147483647 => 0x7fffffff => 01111111111111111111111111111111\nvar LOWER_MASK = 0x7fffffff >>> 0; // asm type annotation\n\n// Define a multiplier (see Knuth TAOCP Vol2. 3rd Ed. P.106): 1812433253 => 01101100000001111000100101100101\nvar KNUTH_MULTIPLIER = 1812433253 >>> 0; // asm type annotation\n\n// Define a (magic) multiplier: 1664525 => 00000000000110010110011000001101\nvar MAGIC_MULTIPLIER_1 = 1664525 >>> 0; // asm type annotation\n\n// Define a (magic) multiplier: 1566083941 => 01011101010110001000101101100101\nvar MAGIC_MULTIPLIER_2 = 1566083941 >>> 0; // asm type annotation\n\n// Define a tempering coefficient: 2636928640 => 0x9d2c5680 => 10011101001011000101011010000000\nvar TEMPERING_COEFFICIENT_1 = 0x9d2c5680 >>> 0; // asm type annotation\n\n// Define a tempering coefficient: 4022730752 => 0xefc60000 => 11101111110001100000000000000000\nvar TEMPERING_COEFFICIENT_2 = 0xefc60000 >>> 0; // asm type annotation\n\n// Define a constant vector `a` (see refs): 2567483615 => 0x9908b0df => 10011001000010001011000011011111\nvar MATRIX_A = 0x9908b0df >>> 0; // asm type annotation\n\n// MAG01[x] = x * MATRIX_A; for x = {0,1}\nvar MAG01 = [ 0x0 >>> 0, MATRIX_A >>> 0 ]; // asm type annotation\n\n// Define a normalization constant when generating double-precision floating-point numbers: 2^53 => 9007199254740992\nvar FLOAT64_NORMALIZATION_CONSTANT = 1.0 / ( FLOAT64_MAX_SAFE_INTEGER+1.0 ); // eslint-disable-line id-length\n\n// 2^26: 67108864\nvar TWO_26 = 67108864 >>> 0; // asm type annotation\n\n// 2^32: 2147483648 => 0x80000000 => 10000000000000000000000000000000\nvar TWO_32 = 0x80000000 >>> 0; // asm type annotation\n\n// 1 (as a 32-bit unsigned integer): 1 => 0x1 => 00000000000000000000000000000001\nvar ONE = 0x1 >>> 0; // asm type annotation\n\n// Define the maximum normalized pseudorandom double-precision floating-point number: ( (((2^32-1)>>>5)*2^26)+( (2^32-1)>>>6) ) / 2^53\nvar MAX_NORMALIZED = FLOAT64_MAX_SAFE_INTEGER * FLOAT64_NORMALIZATION_CONSTANT;\n\n// Define the state array schema version:\nvar STATE_ARRAY_VERSION = 1; // NOTE: anytime the state array schema changes, this value should be incremented!!!\n\n// Define the number of sections in the state array:\nvar NUM_STATE_SECTIONS = 3; // state, other, seed\n\n// Define the index offset of the \"state\" section in the state array:\nvar STATE_SECTION_OFFSET = 2; // | version | num_sections | state_length | ...state | other_length | state_index | seed_length | ...seed |\n\n// Define the index offset of the \"other\" section in the state array:\nvar OTHER_SECTION_OFFSET = N + 3; // | version | num_sections | state_length | ...state | other_length | state_index | seed_length | ...seed |\n\n// Define the index offset of the seed section in the state array:\nvar SEED_SECTION_OFFSET = N + 5; // | version | num_sections | state_length | ...state | other_length | state_index | seed_length | ...seed |\n\n// Define the length of the \"fixed\" length portion of the state array:\nvar STATE_FIXED_LENGTH = N + 6; // 1 (version) + 1 (num_sections) + 1 (state_length) + N (state) + 1 (other_length) + 1 (state_index) + 1 (seed_length)\n\n\n// FUNCTIONS //\n\n/**\n* Verifies state array integrity.\n*\n* @private\n* @param {Uint32Array} state - state array\n* @param {boolean} FLG - flag indicating whether the state array was provided as an option (true) or an argument (false)\n* @returns {(Error|null)} an error or `null`\n*/\nfunction verifyState( state, FLG ) {\n\tvar s1;\n\tif ( FLG ) {\n\t\ts1 = 'option';\n\t} else {\n\t\ts1 = 'argument';\n\t}\n\t// The state array must have a minimum length...\n\tif ( state.length < STATE_FIXED_LENGTH+1 ) {\n\t\treturn new RangeError( format( 'invalid %s. `state` array has insufficient length.', s1 ) );\n\t}\n\t// The first element of the state array must equal the supported state array schema version...\n\tif ( state[ 0 ] !== STATE_ARRAY_VERSION ) {\n\t\treturn new RangeError( format( 'invalid %s. `state` array has an incompatible schema version. Expected: `%s`. Actual: `%s.`', s1, STATE_ARRAY_VERSION, state[ 0 ] ) );\n\t}\n\t// The second element of the state array must contain the number of sections...\n\tif ( state[ 1 ] !== NUM_STATE_SECTIONS ) {\n\t\treturn new RangeError( format( 'invalid %s. `state` array has an incompatible number of sections. Expected: `%s`. Actual: `%s`.', s1, NUM_STATE_SECTIONS, state[ 1 ] ) );\n\t}\n\t// The length of the \"state\" section must equal `N`...\n\tif ( state[ STATE_SECTION_OFFSET ] !== N ) {\n\t\treturn new RangeError( format( 'invalid %s. `state` array has an incompatible state length. Expected: `%u`. Actual: `%u`.', s1, N, state[ STATE_SECTION_OFFSET ] ) );\n\t}\n\t// The length of the \"other\" section must equal `1`...\n\tif ( state[ OTHER_SECTION_OFFSET ] !== 1 ) {\n\t\treturn new RangeError( format( 'invalid %s. `state` array has an incompatible section length. Expected: `%u`. Actual: `%u`.', s1, 1, state[ OTHER_SECTION_OFFSET ] ) );\n\t}\n\t// The length of the \"seed\" section much match the empirical length...\n\tif ( state[ SEED_SECTION_OFFSET ] !== state.length-STATE_FIXED_LENGTH ) {\n\t\treturn new RangeError( format( 'invalid %s. `state` array length is incompatible with seed section length. Expected: `%u`. Actual: `%u`.', s1, state.length-STATE_FIXED_LENGTH, state[ SEED_SECTION_OFFSET ] ) );\n\t}\n\treturn null;\n}\n\n/**\n* Returns an initial PRNG state.\n*\n* @private\n* @param {Uint32Array} state - state array\n* @param {PositiveInteger} N - state size\n* @param {uinteger32} s - seed\n* @returns {Uint32Array} state array\n*/\nfunction createState( state, N, s ) {\n\tvar i;\n\n\t// Set the first element of the state array to the provided seed:\n\tstate[ 0 ] = s >>> 0; // equivalent to `s & 0xffffffffUL` in original C implementation\n\n\t// Initialize the remaining state array elements:\n\tfor ( i = 1; i < N; i++ ) {\n\t\t/*\n\t\t* In the original C implementation (see `init_genrand()`),\n\t\t*\n\t\t* ```c\n\t\t* mt[i] = (KNUTH_MULTIPLIER * (mt[i-1] ^ (mt[i-1] >> 30)) + i)\n\t\t* ```\n\t\t*\n\t\t* In order to replicate this in JavaScript, we must emulate C-like multiplication of unsigned 32-bit integers.\n\t\t*/\n\t\ts = state[ i-1 ]>>>0; // asm type annotation\n\t\ts = ( s^(s>>>30) )>>>0; // asm type annotation\n\t\tstate[ i ] = ( umul( s, KNUTH_MULTIPLIER ) + i )>>>0; // asm type annotation\n\t}\n\treturn state;\n}\n\n/**\n* Initializes a PRNG state array according to a seed array.\n*\n* @private\n* @param {Uint32Array} state - state array\n* @param {NonNegativeInteger} N - state array length\n* @param {Collection} seed - seed array\n* @param {NonNegativeInteger} M - seed array length\n* @returns {Uint32Array} state array\n*/\nfunction initState( state, N, seed, M ) {\n\tvar s;\n\tvar i;\n\tvar j;\n\tvar k;\n\n\ti = 1;\n\tj = 0;\n\tfor ( k = max( N, M ); k > 0; k-- ) {\n\t\t/*\n\t\t* In the original C implementation (see `init_by_array()`),\n\t\t*\n\t\t* ```c\n\t\t* mt[i] = (mt[i]^((mt[i-1]^(mt[i-1]>>30))*1664525UL)) + seed[j] + j;\n\t\t* ```\n\t\t*\n\t\t* In order to replicate this in JavaScript, we must emulate C-like multiplication of unsigned 32-bit integers.\n\t\t*/\n\t\ts = state[ i-1 ]>>>0; // asm type annotation\n\t\ts = ( s^(s>>>30) )>>>0; // asm type annotation\n\t\ts = ( umul( s, MAGIC_MULTIPLIER_1 ) )>>>0; // asm type annotation\n\t\tstate[ i ] = ( ((state[i]>>>0)^s) + seed[j] + j )>>>0; /* non-linear */ // asm type annotation\n\n\t\ti += 1;\n\t\tj += 1;\n\t\tif ( i >= N ) {\n\t\t\tstate[ 0 ] = state[ N-1 ];\n\t\t\ti = 1;\n\t\t}\n\t\tif ( j >= M ) {\n\t\t\tj = 0;\n\t\t}\n\t}\n\tfor ( k = N-1; k > 0; k-- ) {\n\t\t/*\n\t\t* In the original C implementation (see `init_by_array()`),\n\t\t*\n\t\t* ```c\n\t\t* mt[i] = (mt[i]^((mt[i-1]^(mt[i-1]>>30))*1566083941UL)) - i;\n\t\t* ```\n\t\t*\n\t\t* In order to replicate this in JavaScript, we must emulate C-like multiplication of unsigned 32-bit integers.\n\t\t*/\n\t\ts = state[ i-1 ]>>>0; // asm type annotation\n\t\ts = ( s^(s>>>30) )>>>0; // asm type annotation\n\t\ts = ( umul( s, MAGIC_MULTIPLIER_2 ) )>>>0; // asm type annotation\n\t\tstate[ i ] = ( ((state[i]>>>0)^s) - i )>>>0; /* non-linear */ // asm type annotation\n\n\t\ti += 1;\n\t\tif ( i >= N ) {\n\t\t\tstate[ 0 ] = state[ N-1 ];\n\t\t\ti = 1;\n\t\t}\n\t}\n\t// Ensure a non-zero initial state array:\n\tstate[ 0 ] = TWO_32; // MSB (most significant bit) is 1\n\n\treturn state;\n}\n\n/**\n* Updates a PRNG's internal state by generating the next `N` words.\n*\n* @private\n* @param {Uint32Array} state - state array\n* @returns {Uint32Array} state array\n*/\nfunction twist( state ) {\n\tvar w;\n\tvar i;\n\tvar j;\n\tvar k;\n\n\tk = N - M;\n\tfor ( i = 0; i < k; i++ ) {\n\t\tw = ( state[i]&UPPER_MASK ) | ( state[i+1]&LOWER_MASK );\n\t\tstate[ i ] = state[ i+M ] ^ ( w>>>1 ) ^ MAG01[ w&ONE ];\n\t}\n\tj = N - 1;\n\tfor ( ; i < j; i++ ) {\n\t\tw = ( state[i]&UPPER_MASK ) | ( state[i+1]&LOWER_MASK );\n\t\tstate[ i ] = state[ i-k ] ^ ( w>>>1 ) ^ MAG01[ w&ONE ];\n\t}\n\tw = ( state[j]&UPPER_MASK ) | ( state[0]&LOWER_MASK );\n\tstate[ j ] = state[ M-1 ] ^ ( w>>>1 ) ^ MAG01[ w&ONE ];\n\treturn state;\n}\n\n\n// MAIN //\n\n/**\n* Returns a 32-bit Mersenne Twister pseudorandom number generator.\n*\n* ## Notes\n*\n* - In contrast to the original C implementation, array seeds of length `1` are considered integer seeds. This ensures that the seed `[ 1234 ]` generates the same output as the seed `1234`. In the original C implementation, the two seeds would yield different output, which is **not** obvious from a user perspective.\n*\n* @param {Options} [options] - options\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} options argument must be an object\n* @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 integers less than or equal to the maximum unsigned 32-bit integer\n* @throws {RangeError} a numeric seed must be a positive integer less than or equal to the maximum unsigned 32-bit integer\n* @throws {TypeError} state must be a `Uint32Array`\n* @throws {Error} must provide a valid state\n* @throws {TypeError} `copy` option must be a boolean\n* @returns {PRNG} Mersenne Twister PRNG\n*\n* @example\n* var mt19937 = factory();\n*\n* var v = mt19937();\n* // returns <number>\n*\n* @example\n* // Return a seeded Mersenne Twister PRNG:\n* var mt19937 = factory({\n* 'seed': 1234\n* });\n*\n* var v = mt19937();\n* // returns 822569775\n*/\nfunction factory( options ) {\n\tvar STATE;\n\tvar state;\n\tvar opts;\n\tvar seed;\n\tvar slen;\n\tvar err;\n\n\topts = {};\n\tif ( arguments.length ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\t\topts.copy = options.copy;\n\t\t\tif ( !isBoolean( options.copy ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', options.copy ) );\n\t\t\t}\n\t\t}\n\t\tif ( hasOwnProp( options, 'state' ) ) {\n\t\t\tstate = options.state;\n\t\t\topts.state = true;\n\t\t\tif ( !isUint32Array( state ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a Uint32Array. Option: `%s`.', 'state', state ) );\n\t\t\t}\n\t\t\terr = verifyState( state, true );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t\tif ( opts.copy === false ) {\n\t\t\t\tSTATE = state;\n\t\t\t} else {\n\t\t\t\tSTATE = new Uint32Array( state.length );\n\t\t\t\tgcopy( state.length, state, 1, STATE, 1 );\n\t\t\t}\n\t\t\t// Create a state \"view\":\n\t\t\tstate = new Uint32Array( STATE.buffer, STATE.byteOffset+((STATE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), N );\n\n\t\t\t// Create a seed \"view\":\n\t\t\tseed = new Uint32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), state[ SEED_SECTION_OFFSET ] );\n\t\t}\n\t\t// If provided a PRNG state, we ignore the `seed` option...\n\t\tif ( seed === void 0 ) {\n\t\t\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\t\t\tseed = options.seed;\n\t\t\t\topts.seed = true;\n\t\t\t\tif ( isPositiveInteger( seed ) ) {\n\t\t\t\t\tif ( seed > MAX_SEED ) {\n\t\t\t\t\t\tthrow new RangeError( format( 'invalid option. `%s` option must be a positive integer less than or equal to the maximum unsigned 32-bit integer. Option: `%u`.', 'seed', seed ) );\n\t\t\t\t\t}\n\t\t\t\t\tseed >>>= 0; // asm type annotation\n\t\t\t\t} else if ( isCollection( seed ) === false || seed.length < 1 ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be either a positive integer less than or equal to the maximum unsigned 32-bit integer or an array-like object containing integer values less than or equal to the maximum unsigned 32-bit integer. Option: `%s`.', 'seed', seed ) );\n\t\t\t\t} else if ( seed.length === 1 ) {\n\t\t\t\t\tseed = seed[ 0 ];\n\t\t\t\t\tif ( !isPositiveInteger( seed ) ) {\n\t\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be either a positive integer less than or equal to the maximum unsigned 32-bit integer or an array-like object containing integer values less than or equal to the maximum unsigned 32-bit integer. Option: `%s`.', 'seed', seed ) );\n\t\t\t\t\t}\n\t\t\t\t\tif ( seed > MAX_SEED ) {\n\t\t\t\t\t\tthrow new RangeError( format( 'invalid option. `%s` option must be either a positive integer less than or equal to the maximum unsigned 32-bit integer or an array-like object containing integer values less than or equal to the maximum unsigned 32-bit integer. Option: `%u`.', 'seed', seed ) );\n\t\t\t\t\t}\n\t\t\t\t\tseed >>>= 0; // asm type annotation\n\t\t\t\t} else {\n\t\t\t\t\tslen = seed.length;\n\t\t\t\t\tSTATE = new Uint32Array( STATE_FIXED_LENGTH+slen );\n\n\t\t\t\t\t// Initialize sections:\n\t\t\t\t\tSTATE[ 0 ] = STATE_ARRAY_VERSION;\n\t\t\t\t\tSTATE[ 1 ] = NUM_STATE_SECTIONS;\n\t\t\t\t\tSTATE[ STATE_SECTION_OFFSET ] = N;\n\t\t\t\t\tSTATE[ OTHER_SECTION_OFFSET ] = 1;\n\t\t\t\t\tSTATE[ OTHER_SECTION_OFFSET+1 ] = N; // state index\n\t\t\t\t\tSTATE[ SEED_SECTION_OFFSET ] = slen;\n\n\t\t\t\t\t// Copy the provided seed array to prevent external mutation, as mutation would lead to an inability to reproduce PRNG values according to the PRNG's stated seed:\n\t\t\t\t\tgcopy.ndarray( slen, seed, 1, 0, STATE, 1, SEED_SECTION_OFFSET+1 );\n\n\t\t\t\t\t// Create a state \"view\":\n\t\t\t\t\tstate = new Uint32Array( STATE.buffer, STATE.byteOffset+((STATE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), N );\n\n\t\t\t\t\t// Create a seed \"view\":\n\t\t\t\t\tseed = new Uint32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), slen );\n\n\t\t\t\t\t// Initialize the internal PRNG state:\n\t\t\t\t\tstate = createState( state, N, SEED_ARRAY_INIT_STATE );\n\t\t\t\t\tstate = initState( state, N, seed, slen );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tseed = randuint32() >>> 0; // asm type annotation\n\t\t\t}\n\t\t}\n\t} else {\n\t\tseed = randuint32() >>> 0; // asm type annotation\n\t}\n\tif ( state === void 0 ) {\n\t\tSTATE = new Uint32Array( STATE_FIXED_LENGTH+1 );\n\n\t\t// Initialize sections:\n\t\tSTATE[ 0 ] = STATE_ARRAY_VERSION;\n\t\tSTATE[ 1 ] = NUM_STATE_SECTIONS;\n\t\tSTATE[ STATE_SECTION_OFFSET ] = N;\n\t\tSTATE[ OTHER_SECTION_OFFSET ] = 1;\n\t\tSTATE[ OTHER_SECTION_OFFSET+1 ] = N; // state index\n\t\tSTATE[ SEED_SECTION_OFFSET ] = 1;\n\t\tSTATE[ SEED_SECTION_OFFSET+1 ] = seed;\n\n\t\t// Create a state \"view\":\n\t\tstate = new Uint32Array( STATE.buffer, STATE.byteOffset+((STATE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), N );\n\n\t\t// Create a seed \"view\":\n\t\tseed = new Uint32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), 1 );\n\n\t\t// Initialize the internal PRNG state:\n\t\tstate = createState( state, N, seed );\n\t}\n\t// Note: property order matters in order to maintain consistency of PRNG \"shape\" (hidden classes).\n\tsetReadOnly( mt19937, 'NAME', 'mt19937' );\n\tsetReadOnlyAccessor( mt19937, 'seed', getSeed );\n\tsetReadOnlyAccessor( mt19937, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( mt19937, 'state', getState, setState );\n\tsetReadOnlyAccessor( mt19937, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( mt19937, 'byteLength', getStateSize );\n\tsetReadOnly( mt19937, 'toJSON', toJSON );\n\tsetReadOnly( mt19937, 'MIN', 0 );\n\tsetReadOnly( mt19937, 'MAX', UINT32_MAX );\n\tsetReadOnly( mt19937, 'normalized', normalized );\n\n\tsetReadOnly( normalized, 'NAME', mt19937.NAME );\n\tsetReadOnlyAccessor( normalized, 'seed', getSeed );\n\tsetReadOnlyAccessor( normalized, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( normalized, 'state', getState, setState );\n\tsetReadOnlyAccessor( normalized, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( normalized, 'byteLength', getStateSize );\n\tsetReadOnly( normalized, 'toJSON', toJSON );\n\tsetReadOnly( normalized, 'MIN', 0.0 );\n\tsetReadOnly( normalized, 'MAX', MAX_NORMALIZED );\n\n\treturn mt19937;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\tvar len = STATE[ SEED_SECTION_OFFSET ];\n\t\treturn gcopy( len, seed, 1, new Uint32Array( len ), 1 );\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn STATE[ SEED_SECTION_OFFSET ];\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn STATE.length;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn STATE.byteLength;\n\t}\n\n\t/**\n\t* Returns the current PRNG state.\n\t*\n\t* ## Notes\n\t*\n\t* - The PRNG state array is comprised of a preamble followed by `3` sections:\n\t*\n\t* 0. preamble (version + number of sections)\n\t* 1. internal PRNG state\n\t* 2. auxiliary state information\n\t* 3. PRNG seed\n\t*\n\t* - The first element of the PRNG state array preamble is the state array schema version.\n\t*\n\t* - The second element of the PRNG state array preamble is the number of state array sections (i.e., `3`).\n\t*\n\t* - The first element of each section following the preamble specifies the section length. The remaining section elements comprise the section contents.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\tvar len = STATE.length;\n\t\treturn gcopy( len, STATE, 1, new Uint32Array( len ), 1 );\n\t}\n\n\t/**\n\t* Sets the PRNG state.\n\t*\n\t* ## Notes\n\t*\n\t* - If PRNG state is \"shared\" (meaning a state array was provided during PRNG creation and **not** copied) and one sets the generator state to a state array having a different length, the PRNG does **not** update the existing shared state and, instead, points to the newly provided state array. In order to synchronize PRNG output according to the new shared state array, the state array for **each** relevant PRNG must be **explicitly** set.\n\t* - 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).\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {TypeError} must provide a `Uint32Array`\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\tvar err;\n\t\tif ( !isUint32Array( s ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a Uint32Array. Value: `%s`.', s ) );\n\t\t}\n\t\terr = verifyState( s, false );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( opts.copy === false ) {\n\t\t\tif ( opts.state && s.length === STATE.length ) {\n\t\t\t\tgcopy( s.length, s, 1, STATE, 1 ); // update current shared state\n\t\t\t} else {\n\t\t\t\tSTATE = s; // point to new shared state\n\t\t\t\topts.state = true; // setting this flag allows updating a shared state even if a state array was not provided at PRNG creation\n\t\t\t}\n\t\t} else {\n\t\t\t// Check if we can reuse allocated memory...\n\t\t\tif ( s.length !== STATE.length ) {\n\t\t\t\tSTATE = new Uint32Array( s.length ); // reallocate\n\t\t\t}\n\t\t\tgcopy( s.length, s, 1, STATE, 1 );\n\t\t}\n\t\t// Create a new state \"view\":\n\t\tstate = new Uint32Array( STATE.buffer, STATE.byteOffset+((STATE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), N );\n\n\t\t// Create a new seed \"view\":\n\t\tseed = new Uint32Array( STATE.buffer, STATE.byteOffset+((SEED_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), STATE[ SEED_SECTION_OFFSET ] );\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = mt19937.NAME;\n\t\tout.state = typedarray2json( STATE );\n\t\tout.params = [];\n\t\treturn out;\n\t}\n\n\t/**\n\t* Generates a pseudorandom integer on the interval \\\\( [0, 2^{32}) \\\\).\n\t*\n\t* @private\n\t* @returns {uinteger32} pseudorandom integer\n\t*\n\t* @example\n\t* var r = mt19937();\n\t* // returns <number>\n\t*/\n\tfunction mt19937() {\n\t\tvar r;\n\t\tvar i;\n\n\t\t// Retrieve the current state index:\n\t\ti = STATE[ OTHER_SECTION_OFFSET+1 ];\n\n\t\t// Determine whether we need to update the PRNG state:\n\t\tif ( i >= N ) {\n\t\t\tstate = twist( state );\n\t\t\ti = 0;\n\t\t}\n\t\t// Get the next word of \"raw\"/untempered state:\n\t\tr = state[ i ];\n\n\t\t// Update the state index:\n\t\tSTATE[ OTHER_SECTION_OFFSET+1 ] = i + 1;\n\n\t\t// Tempering transform to compensate for the reduced dimensionality of equidistribution:\n\t\tr ^= r >>> 11;\n\t\tr ^= ( r << 7 ) & TEMPERING_COEFFICIENT_1;\n\t\tr ^= ( r << 15 ) & TEMPERING_COEFFICIENT_2;\n\t\tr ^= r >>> 18;\n\n\t\treturn r >>> 0;\n\t}\n\n\t/**\n\t* Generates a pseudorandom number on the interval \\\\( [0, 1) \\\\).\n\t*\n\t* ## Notes\n\t*\n\t* - The original C implementation credits Isaku Wada for this algorithm (2002/01/09).\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var r = normalized();\n\t* // returns <number>\n\t*/\n\tfunction normalized() {\n\t\tvar x = mt19937() >>> 5;\n\t\tvar y = mt19937() >>> 6;\n\t\treturn ( (x*TWO_26)+y ) * FLOAT64_NORMALIZATION_CONSTANT;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\nvar randuint32 = require( './rand_uint32.js' );\n\n\n// MAIN //\n\n/**\n* Generates a pseudorandom integer on the interval \\\\( [0, 2^{32}) \\\\).\n*\n* ## Method\n*\n* - When generating normalized double-precision floating-point numbers, we first generate two pseudorandom integers \\\\( x \\\\) and \\\\( y \\\\) on the interval \\\\( [0, 2^{32}) \\\\) for a combined \\\\( 64 \\\\) random bits.\n*\n* - We would like \\\\( 53 \\\\) random bits to generate a 53-bit precision integer and, thus, want to discard \\\\( 11 \\\\) of the generated bits.\n*\n* - We do so by discarding \\\\( 5 \\\\) bits from \\\\( x \\\\) and \\\\( 6 \\\\) bits from \\\\( y \\\\).\n*\n* - Accordingly, \\\\( x \\\\) contains \\\\( 27 \\\\) random bits, which are subsequently shifted left \\\\( 26 \\\\) bits (multiplied by \\\\( 2^{26} \\\\), and \\\\( y \\\\) contains \\\\( 26 \\\\) random bits to fill in the lower \\\\( 26 \\\\) bits. When summed, they combine to comprise \\\\( 53 \\\\) random bits of a double-precision floating-point integer.\n*\n* - As an example, suppose, for the sake of argument, the 32-bit PRNG generates the maximum unsigned 32-bit integer \\\\( 2^{32}-1 \\\\) twice in a row. Then,\n*\n* ```javascript\n* x = 4294967295 >>> 5; // 00000111111111111111111111111111\n* y = 4294967295 >>> 6; // 00000011111111111111111111111111\n* ```\n*\n* Multiplying \\\\( x \\\\) by \\\\( 2^{26} \\\\) returns \\\\( 9007199187632128 \\\\), which, in binary, is\n*\n* ```binarystring\n* 0 10000110011 11111111111111111111 11111100000000000000000000000000\n* ```\n*\n* Adding \\\\( y \\\\) yields \\\\( 9007199254740991 \\\\) (the maximum \"safe\" double-precision floating-point integer value), which, in binary, is\n*\n* ```binarystring\n* 0 10000110011 11111111111111111111 11111111111111111111111111111111\n* ```\n*\n* - Similarly, suppose the 32-bit PRNG generates the following values\n*\n* ```javascript\n* x = 1 >>> 5; // 0 => 00000000000000000000000000000000\n* y = 64 >>> 6; // 1 => 00000000000000000000000000000001\n* ```\n*\n* Multiplying \\\\( x \\\\) by \\\\( 2^{26} \\\\) returns \\\\( 0 \\\\), which, in binary, is\n*\n* ```binarystring\n* 0 00000000000 00000000000000000000 00000000000000000000000000000000\n* ```\n*\n* Adding \\\\( y \\\\) yields \\\\( 1 \\\\), which, in binary, is\n*\n* ```binarystring\n* 0 01111111111 00000000000000000000 00000000000000000000000000000000\n* ```\n*\n* - As different combinations of \\\\( x \\\\) and \\\\( y \\\\) are generated, different combinations of double-precision floating-point exponent and significand bits will be toggled, thus generating pseudorandom double-precision floating-point numbers.\n*\n* ## References\n*\n* - Matsumoto, Makoto, and Takuji Nishimura. 1998. \"Mersenne Twister: A 623-dimensionally Equidistributed Uniform Pseudo-random Number Generator.\" _ACM Transactions on Modeling and Computer Simulation_ 8 (1). New York, NY, USA: ACM: 3\u201330. doi:[10.1145/272991.272995][@matsumoto:1998a].\n* - Harase, Shin. 2017. \"Conversion of Mersenne Twister to double-precision floating-point numbers.\" _ArXiv_ abs/1708.06018 (September). <https://arxiv.org/abs/1708.06018>.\n*\n* [@matsumoto:1998a]: https://doi.org/10.1145/272991.272995\n*\n* @function mt19937\n* @type {PRNG}\n* @returns {PositiveInteger} pseudorandom integer\n*\n* @example\n* var v = mt19937();\n* // returns <number>\n*/\nvar mt19937 = factory({\n\t'seed': randuint32()\n});\n\n\n// EXPORTS //\n\nmodule.exports = mt19937;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* A 32-bit Mersenne Twister pseudorandom number generator.\n*\n* @module @stdlib/random-base-mt19937\n*\n* @example\n* var mt19937 = require( '@stdlib/random-base-mt19937' );\n*\n* var v = mt19937();\n* // returns <number>\n*\n* @example\n* var factory = require( '@stdlib/random-base-mt19937' ).factory;\n*\n* var mt19937 = factory({\n* 'seed': 1234\n* });\n*\n* var v = mt19937();\n* // returns 822569775\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils-define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"],
"mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,GAAAC,EAAA,cAsBA,IAAIC,GAAa,QAAS,8BAA+B,EACrDC,GAAQ,QAAS,iCAAkC,EAKnDC,GAAMF,GAAa,EAevB,SAASG,IAAa,CACrB,IAAIC,EAAIH,GAAO,EAAOC,GAAI,KAAK,OAAO,CAAG,EACzC,OAAOE,IAAM,CACd,CAKAL,EAAO,QAAUI,KCnDjB,IAAAE,EAAAC,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AAOA,GAAK,EAAM9C,GAClB8C,GAAOA,GAAK,GAAO7C,GACnB6C,GAAKA,IAAM,GAEJA,IAAM,CACd,CAgBA,SAASH,GAAa,CACrB,IAAII,EAAIZ,EAAQ,IAAM,EAClBa,EAAIb,EAAQ,IAAM,EACtB,OAAUY,EAAE1C,GAAQ2C,GAAM5C,CAC3B,CACD,CAKA/B,EAAO,QAAUwD,KC3rBjB,IAAAoB,EAAAC,EAAA,SAAAC,GAAAC,EAAA,cAsBA,IAAIC,GAAU,IACVC,GAAa,IAyEbC,GAAUF,GAAQ,CACrB,KAAQC,GAAW,CACpB,CAAC,EAKDF,EAAO,QAAUG,KC3DjB,IAAIC,GAAc,QAAS,uDAAwD,EAC/EC,GAAO,IACPC,GAAU,IAKdF,GAAaC,GAAM,UAAWC,EAAQ,EAKtC,OAAO,QAAUD",
"names": ["require_rand_uint32", "__commonJSMin", "exports", "module", "UINT32_MAX", "floor", "MAX", "randuint32", "v", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "hasOwnProp", "isObject", "isCollection", "isUint32Array", "isBoolean", "isPositiveInteger", "FLOAT64_MAX_SAFE_INTEGER", "UINT32_MAX", "Uint32Array", "max", "umul", "gcopy", "typedarray2json", "format", "randuint32", "N", "MAX_SEED", "SEED_ARRAY_INIT_STATE", "UPPER_MASK", "LOWER_MASK", "KNUTH_MULTIPLIER", "MAGIC_MULTIPLIER_1", "MAGIC_MULTIPLIER_2", "TEMPERING_COEFFICIENT_1", "TEMPERING_COEFFICIENT_2", "MATRIX_A", "MAG01", "FLOAT64_NORMALIZATION_CONSTANT", "TWO_26", "TWO_32", "ONE", "MAX_NORMALIZED", "STATE_ARRAY_VERSION", "NUM_STATE_SECTIONS", "STATE_SECTION_OFFSET", "OTHER_SECTION_OFFSET", "SEED_SECTION_OFFSET", "STATE_FIXED_LENGTH", "verifyState", "state", "FLG", "s1", "createState", "s", "i", "initState", "seed", "M", "j", "k", "twist", "w", "factory", "options", "STATE", "opts", "slen", "err", "mt19937", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "normalized", "len", "out", "r", "x", "y", "require_main", "__commonJSMin", "exports", "module", "factory", "randuint32", "mt19937", "setReadOnly", "main", "factory"]
}

@@ -98,7 +98,7 @@ /*

/**
* Interface for generating pseudorandom integers on the interval `[1, 4294967295]`.
* Interface for generating pseudorandom integers on the interval `[0, 4294967295]`.
*/
interface NullaryFunction extends PRNG {
/**
* Returns a pseudorandom integer on the interval `[1, 4294967295]`.
* Returns a pseudorandom integer on the interval `[0, 4294967295]`.
*

@@ -105,0 +105,0 @@ * @returns pseudorandom number

@@ -22,5 +22,4 @@ /**

// Note: keep project includes in alphabetical order...
#include "stdlib/random/base/shared.h"
#include <stdint.h>
#include "stdlib/random/base.h"

@@ -27,0 +26,0 @@ /*

@@ -77,3 +77,3 @@ /* eslint-disable max-lines, max-len */

var max = require( '@stdlib/math-base-special-max' );
var umul = require( '@stdlib/math-base-ops-umul' );
var umul = require( '@stdlib/number-uint32-base-mul' );
var gcopy = require( '@stdlib/blas-base-gcopy' );

@@ -80,0 +80,0 @@ var typedarray2json = require( '@stdlib/array-to-json' );

{
"options": {},
"fields": [
{
"field": "src",
"resolve": true,
"relative": true
},
{
"field": "include",
"resolve": true,
"relative": true
},
{
"field": "libraries",
"resolve": false,
"relative": false
},
{
"field": "libpath",
"resolve": true,
"relative": false
}
],
"confs": [
{
"src": [
"./src/main.c"
],
"include": [
"./include"
],
"libraries": [],
"libpath": [],
"dependencies": [
"@stdlib/random-base-shared"
]
}
]
"options": {},
"fields": [
{
"field": "src",
"resolve": true,
"relative": true
},
{
"field": "include",
"resolve": true,
"relative": true
},
{
"field": "libraries",
"resolve": false,
"relative": false
},
{
"field": "libpath",
"resolve": true,
"relative": false
}
],
"confs": [
{
"src": [
"./src/main.c"
],
"include": [
"./include"
],
"libraries": [],
"libpath": [],
"dependencies": [
"@stdlib/random-base-shared"
]
}
]
}
+1
-1

@@ -1,1 +0,1 @@

Copyright (c) 2016-2024 The Stdlib Authors.
Copyright (c) 2016-2026 The Stdlib Authors.
{
"name": "@stdlib/random-base-mt19937",
"version": "0.2.1",
"version": "0.2.2",
"description": "A 32-bit Mersenne Twister pseudorandom number generator.",

@@ -35,22 +35,22 @@ "license": "Apache-2.0",

"dependencies": {
"@stdlib/array-to-json": "^0.2.1",
"@stdlib/array-uint32": "^0.2.1",
"@stdlib/assert-has-own-property": "^0.2.1",
"@stdlib/assert-is-boolean": "^0.2.1",
"@stdlib/assert-is-collection": "^0.2.1",
"@stdlib/assert-is-plain-object": "^0.2.1",
"@stdlib/assert-is-positive-integer": "^0.2.1",
"@stdlib/assert-is-uint32array": "^0.2.1",
"@stdlib/blas-base-gcopy": "^0.2.0",
"@stdlib/constants-float64-max-safe-integer": "^0.2.1",
"@stdlib/constants-uint32-max": "^0.2.1",
"@stdlib/math-base-ops-umul": "^0.2.1",
"@stdlib/math-base-special-floor": "^0.2.1",
"@stdlib/math-base-special-max": "^0.2.1",
"@stdlib/random-base-shared": "^0.1.0",
"@stdlib/string-format": "^0.2.1",
"@stdlib/utils-define-nonenumerable-read-only-accessor": "^0.2.2",
"@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.1",
"@stdlib/utils-define-nonenumerable-read-write-accessor": "^0.2.1",
"@stdlib/error-tools-fmtprodmsg": "^0.2.1"
"@stdlib/array-to-json": "^0.3.0",
"@stdlib/array-uint32": "^0.2.2",
"@stdlib/assert-has-own-property": "^0.2.2",
"@stdlib/assert-is-boolean": "^0.2.2",
"@stdlib/assert-is-collection": "^0.2.2",
"@stdlib/assert-is-plain-object": "^0.2.2",
"@stdlib/assert-is-positive-integer": "^0.2.2",
"@stdlib/assert-is-uint32array": "^0.2.2",
"@stdlib/blas-base-gcopy": "^0.2.1",
"@stdlib/constants-float64-max-safe-integer": "^0.2.2",
"@stdlib/constants-uint32-max": "^0.2.2",
"@stdlib/math-base-special-floor": "^0.2.3",
"@stdlib/math-base-special-max": "^0.3.0",
"@stdlib/number-uint32-base-mul": "^0.1.0",
"@stdlib/random-base-shared": "^0.1.1",
"@stdlib/string-format": "^0.2.2",
"@stdlib/utils-define-nonenumerable-read-only-accessor": "^0.2.3",
"@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.2",
"@stdlib/utils-define-nonenumerable-read-write-accessor": "^0.2.2",
"@stdlib/error-tools-fmtprodmsg": "^0.2.2"
},

@@ -57,0 +57,0 @@ "devDependencies": {},

+16
-24

@@ -86,5 +86,5 @@ <!--

- **state**: a [`Uint32Array`][@stdlib/array/uint32] containing pseudorandom number generator state. If provided, the function ignores the `seed` option.
- **copy**: `boolean` indicating whether to copy a provided pseudorandom number generator state. Setting this option to `false` allows sharing state between two or more pseudorandom number generators. Setting this option to `true` ensures that a returned generator has exclusive control over its internal state. Default: `true`.
- **copy**: boolean indicating whether to copy a provided pseudorandom number generator state. Setting this option to `false` allows sharing state between two or more pseudorandom number generators. Setting this option to `true` ensures that a returned generator has exclusive control over its internal state. Default: `true`.
By default, a random integer is used to seed the returned generator. To seed the generator, provide either an `integer` on the interval `[0, 4294967295]`
By default, a random integer is used to seed the returned generator. To seed the generator, provide either a nonzero integer on the interval `[1, 4294967295]`

@@ -100,3 +100,3 @@ ```javascript

or, for arbitrary length seeds, an array-like `object` containing unsigned 32-bit integers
or, for arbitrary length seeds, an array-like object containing unsigned 32-bit integers

@@ -117,8 +117,5 @@ ```javascript

```javascript
var rand;
var bool;
// Generate pseudorandom numbers, thus progressing the generator state:
var r;
var i;
// Generate pseudorandom numbers, thus progressing the generator state:
for ( i = 0; i < 1000; i++ ) {

@@ -129,3 +126,3 @@ r = mt19937();

// Create a new MT19937 PRNG initialized to the current state of `mt19937`:
rand = mt19937.factory({
var rand = mt19937.factory({
'state': mt19937.state

@@ -135,3 +132,3 @@ });

// Test that the generated pseudorandom numbers are the same:
bool = ( rand() === mt19937() );
var bool = ( rand() === mt19937() );
// returns true

@@ -172,7 +169,5 @@ ```

```javascript
var rand;
// Generate pseudorandom values...
var r;
var i;
// Generate pseudorandom values...
for ( i = 0; i < 100; i++ ) {

@@ -183,3 +178,3 @@ r = mt19937();

// Generate the same pseudorandom values...
rand = mt19937.factory({
var rand = mt19937.factory({
'seed': mt19937.seed

@@ -292,7 +287,4 @@ });

var seed;
var rand;
// Generate pseudorandom numbers...
var i;
// Generate pseudorandom numbers...
for ( i = 0; i < 100; i++ ) {

@@ -303,4 +295,4 @@ console.log( mt19937() );

// Create a new pseudorandom number generator...
seed = 1234;
rand = mt19937.factory({
var seed = 1234;
var rand = mt19937.factory({
'seed': seed

@@ -377,3 +369,3 @@ });

Copyright &copy; 2016-2024. The Stdlib [Authors][stdlib-authors].
Copyright &copy; 2016-2026. The Stdlib [Authors][stdlib-authors].

@@ -391,4 +383,4 @@ </section>

[test-image]: https://github.com/stdlib-js/random-base-mt19937/actions/workflows/test.yml/badge.svg?branch=v0.2.1
[test-url]: https://github.com/stdlib-js/random-base-mt19937/actions/workflows/test.yml?query=branch:v0.2.1
[test-image]: https://github.com/stdlib-js/random-base-mt19937/actions/workflows/test.yml/badge.svg?branch=v0.2.2
[test-url]: https://github.com/stdlib-js/random-base-mt19937/actions/workflows/test.yml?query=branch:v0.2.2

@@ -405,4 +397,4 @@ [coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/random-base-mt19937/main.svg

[chat-image]: https://img.shields.io/gitter/room/stdlib-js/stdlib.svg
[chat-url]: https://app.gitter.im/#/room/#stdlib-js_stdlib:gitter.im
[chat-image]: https://img.shields.io/badge/zulip-join_chat-brightgreen.svg
[chat-url]: https://stdlib.zulipchat.com

@@ -409,0 +401,0 @@ [stdlib]: https://github.com/stdlib-js/stdlib

@@ -58,8 +58,7 @@ /**

// Note: keep project includes in alphabetical order...
#include "stdlib/random/base/mt19937.h"
#include "stdlib/random/base/shared.h"
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include "stdlib/random/base.h"
#include "stdlib/random/base/mt19937.h"

@@ -135,3 +134,2 @@ // Forward declarations:

*
* @private
*/

@@ -161,3 +159,2 @@ static const struct BasePRNG mt19937_prng = {

*
* @private
* @param obj PRNG object

@@ -266,3 +263,2 @@ * @param out output address

*
* @private
* @param obj PRNG object

@@ -293,3 +289,2 @@ * @param out output address

*
* @private
* @param obj PRNG object

@@ -310,3 +305,2 @@ */

*
* @private
* @param state pointer to state array

@@ -331,3 +325,2 @@ * @param N state array length

*
* @private
* @param state pointer to state array

@@ -373,3 +366,2 @@ * @param N state array length

*
* @private
* @param state pointer to a PRNG's internal state array

@@ -410,7 +402,7 @@ * @param N state array length

* @example
* #include "stdlib/random/base/mt19937.h"
* #include "stdlib/random/base/shared.h"
* #include <stdlib.h>
* #include <stdio.h>
* #include <stdint.h>
* #include "stdlib/random/base.h"
* #include "stdlib/random/base/mt19937.h"
*

@@ -491,7 +483,7 @@ * // Define a PRNG seed:

* @example
* #include "stdlib/random/base/mt19937.h"
* #include "stdlib/random/base/shared.h"
* #include <stdlib.h>
* #include <stdio.h>
* #include <stdint.h>
* #include "stdlib/random/base.h"
* #include "stdlib/random/base/mt19937.h"
*

@@ -547,7 +539,7 @@ * // Define a PRNG seed:

* @example
* #include "stdlib/random/base/mt19937.h"
* #include "stdlib/random/base/shared.h"
* #include <stdlib.h>
* #include <stdio.h>
* #include <stdint.h>
* #include "stdlib/random/base.h"
* #include "stdlib/random/base/mt19937.h"
*

@@ -617,7 +609,7 @@ * // Define a PRNG seed:

* @example
* #include "stdlib/random/base/mt19937.h"
* #include "stdlib/random/base/shared.h"
* #include <stdlib.h>
* #include <stdio.h>
* #include <stdint.h>
* #include "stdlib/random/base.h"
* #include "stdlib/random/base/mt19937.h"
*

@@ -686,7 +678,7 @@ * // Define a PRNG seed:

* @example
* #include "stdlib/random/base/mt19937.h"
* #include "stdlib/random/base/shared.h"
* #include <stdlib.h>
* #include <stdio.h>
* #include <stdint.h>
* #include "stdlib/random/base.h"
* #include "stdlib/random/base/mt19937.h"
*

@@ -718,4 +710,4 @@ * // Define a PRNG seed:

void * stdlib_base_random_mt19937_state( const struct BasePRNGObject *obj ) {
const stdlib_base_random_mt19937_state_t *so;
stdlib_base_random_mt19937_state_t *state;
stdlib_base_random_mt19937_state_t *so;
uint64_t nbytes;

@@ -759,7 +751,7 @@ uint32_t *seed;

* @example
* #include "stdlib/random/base/mt19937.h"
* #include "stdlib/random/base/shared.h"
* #include <stdlib.h>
* #include <stdio.h>
* #include <stdint.h>
* #include "stdlib/random/base.h"
* #include "stdlib/random/base/mt19937.h"
*

@@ -766,0 +758,0 @@ * // Define a PRNG seed: