diff --git a/dist/index.js b/dist/index.js index 1f8f884f..235ac2ba 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,4 +1,4 @@ -"use strict";var s=function(r,e){return function(){return e||r((e={exports:{}}).exports,e),e.exports}};var $h=s(function(C5e,Qh){"use strict";var V$=require("@stdlib/assert/is-plain-object"),F$=require("@stdlib/assert/has-own-property"),W$=require("@stdlib/array/base/assert/contains"),Zh=require("@stdlib/string/format");function I$(r,e,t){return V$(t)?F$(t,"dtype")&&(r.dtype=t.dtype,!W$(e,r.dtype))?new TypeError(Zh('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",e.join('", "'),r.dtype)):null:new TypeError(Zh("invalid argument. Options argument must be an object. Value: `%s`.",t))}Qh.exports=I$});var tp=s(function(B5e,rp){"use strict";var Kh=require("@stdlib/utils/define-nonenumerable-read-only-property"),k$=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,z$=require("@stdlib/assert/is-function"),J$=require("@stdlib/assert/is-string-array").primitives,U$=require("@stdlib/assert/is-collection"),C$=require("@stdlib/array/base/assert/contains"),B$=require("@stdlib/array/base/filled-by"),ep=require("@stdlib/strided/base/binary"),D$=require("@stdlib/array/ctors"),Is=require("@stdlib/string/format"),X$=$h();function ks(r,e,t){if(!(this instanceof ks))return new ks(r,e,t);if(!z$(r))throw new TypeError(Is("invalid argument. First argument must be a function. Value: `%s`.",r));if(!J$(e))throw new TypeError(Is("invalid argument. Second argument must be an array of strings. Value: `%s`.",e));if(!C$(e,t))throw new TypeError(Is("invalid argument. Third argument must be a supported data type. Value: `%s`.",t));return this._prng=r,this._dtypes=e,this._dtype=t,this}Kh(ks.prototype,"generate",function(e,t,i,n){var a,u,o,v,g,c;if(!k$(e))throw new TypeError(Is("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",e));if(u={},arguments.length>3&&(g=X$(u,this._dtypes,n),g))throw g;if(o=this._prng,c=u.dtype||this._dtype,c==="generic")return B$(e,l);return a=D$(c),v=new a(e),ep([[t],[i],v],[e],[0,0,1],o),v;function l(){return o(t,i)}});Kh(ks.prototype,"assign",function(e,t,i){if(!U$(i))throw new TypeError(Is("invalid argument. Third argument must be an array-like object. Value: `%s`.",i));return ep([[e],[t],i],[i.length],[0,0,1],this._prng),i});rp.exports=ks});var np=s(function(D5e,ip){"use strict";var Y$=tp();ip.exports=Y$});var up=s(function(X5e,sp){"use strict";var H$=require("@stdlib/assert/is-plain-object"),Z$=require("@stdlib/assert/has-own-property"),Q$=require("@stdlib/array/base/assert/contains"),ap=require("@stdlib/string/format");function $$(r,e,t){return H$(t)?Z$(t,"dtype")&&(r.dtype=t.dtype,!Q$(e,r.dtype))?new TypeError(ap('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",e.join('", "'),r.dtype)):null:new TypeError(ap("invalid argument. Options argument must be an object. Value: `%s`.",t))}sp.exports=$$});var fp=s(function(Y5e,gp){"use strict";var op=require("@stdlib/utils/define-nonenumerable-read-only-property"),K$=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,eK=require("@stdlib/assert/is-function"),rK=require("@stdlib/assert/is-string-array").primitives,tK=require("@stdlib/assert/is-collection"),iK=require("@stdlib/array/base/assert/contains"),nK=require("@stdlib/array/base/filled-by"),vp=require("@stdlib/strided/base/nullary"),aK=require("@stdlib/array/ctors"),zs=require("@stdlib/string/format"),sK=up();function Js(r,e,t){if(!(this instanceof Js))return new Js(r,e,t);if(!eK(r))throw new TypeError(zs("invalid argument. First argument must be a function. Value: `%s`.",r));if(!rK(e))throw new TypeError(zs("invalid argument. Second argument must be an array of strings. Value: `%s`.",e));if(!iK(e,t))throw new TypeError(zs("invalid argument. Third argument must be a supported data type. Value: `%s`.",t));return this._prng=r,this._dtypes=e,this._dtype=t,this}op(Js.prototype,"generate",function(e,t){var i,n,a,u,o;if(!K$(e))throw new TypeError(zs("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",e));if(n={},arguments.length>1&&(u=sK(n,this._dtypes,t),u))throw u;return o=n.dtype||this._dtype,o==="generic"?nK(e,this._prng):(i=aK(o),a=new i(e),vp([a],[e],[1],this._prng),a)});op(Js.prototype,"assign",function(e){if(!tK(e))throw new TypeError(zs("invalid argument. First argument must be an array-like object. Value: `%s`.",e));return vp([e],[e.length],[1],this._prng),e});gp.exports=Js});var Nu=s(function(H5e,dp){"use strict";var uK=fp();dp.exports=uK});var hp=s(function(Z5e,mp){"use strict";var lp=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Lu=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),va=require("@stdlib/utils/define-nonenumerable-read-only-property"),oK=require("@stdlib/assert/is-string-array").primitives,vK=require("@stdlib/assert/is-function"),gK=require("@stdlib/assert/is-method-in"),fK=require("@stdlib/assert/has-own-property"),cp=require("@stdlib/array/base/assert/contains").factory,dK=require("@stdlib/utils/constant-function"),lK=require("@stdlib/utils/noop"),cK=np(),mK=Nu(),Us=require("@stdlib/string/format");function hK(r,e,t){var i;if(!vK(r))throw new TypeError(Us("invalid argument. First argument must be a function. Value: `%s`.",r));if(!gK(r,"factory"))throw new TypeError(Us("invalid argument. First argument must have a `%s` method.","factory"));if(!oK(e))throw new TypeError(Us("invalid argument. Second argument must an array of strings. Value: `%s`.",e));if(!cp(e,t))throw new TypeError(Us("invalid argument. Third argument must be a supported data type. Value: `%s`.",t));return i=cp(e),n;function n(){var a,u,o,v,g,c,l,m,h,p;if(c=arguments.length,c<1?(m={},l=r,h=d):c===1?(m=arguments[0],l=r.factory(m),h=d):c===2?(o=arguments[0],v=arguments[1],m={},l=r.factory(o,v),h=f):(o=arguments[0],v=arguments[1],m=arguments[2],l=r.factory(o,v,m),h=f),fK(m,"dtype")){if(p=m.dtype,!i(p))throw new TypeError(Us('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",e.join('", "'),p))}else p=t;return h===d?(g=y,a=cK):(g=q,a=mK),u=new a(l,e,p),m&&m.prng?(va(h,"seed",null),va(h,"seedLength",null),lp(h,"state",dK(null),lK),va(h,"stateLength",null),va(h,"byteLength",null)):(Lu(h,"seed",b),Lu(h,"seedLength",w),lp(h,"state",J,x),Lu(h,"stateLength",S),Lu(h,"byteLength",W)),va(h,"PRNG",l.PRNG),va(h,"assign",g),h;function d(V,A,G,Ue){return arguments.length<4?u.generate(V,A,G):u.generate(V,A,G,Ue)}function f(V,A){return arguments.length<2?u.generate(V):u.generate(V,A)}function y(V,A,G){return u.assign(V,A,G)}function q(V){return u.assign(V)}function b(){return h.PRNG.seed}function w(){return h.PRNG.seedLength}function S(){return h.PRNG.stateLength}function W(){return h.PRNG.byteLength}function J(){return h.PRNG.state}function x(V){h.PRNG.state=V}}}mp.exports=hK});var F=s(function(Q5e,pp){"use strict";var pK=hp();pp.exports=pK});var xd=s(function($5e,yp){"use strict";var yK=require("@stdlib/constants/uint32/max"),qK=require("@stdlib/math/base/special/floor"),bK=yK-1;function wK(){var r=qK(1+bK*Math.random());return r>>>0}yp.exports=wK});var zd=s(function(K5e,Pp){"use strict";var Gr=require("@stdlib/utils/define-nonenumerable-read-only-property"),ft=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),qp=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Ad=require("@stdlib/assert/has-own-property"),SK=require("@stdlib/assert/is-plain-object"),OK=require("@stdlib/assert/is-collection"),bp=require("@stdlib/assert/is-uint32array"),EK=require("@stdlib/assert/is-boolean").isPrimitive,wp=require("@stdlib/assert/is-positive-integer").isPrimitive,Np=require("@stdlib/constants/float64/max-safe-integer"),Lp=require("@stdlib/constants/uint32/max"),U=require("@stdlib/array/uint32"),_K=require("@stdlib/math/base/special/max"),kd=require("@stdlib/math/base/ops/umul"),ga=require("@stdlib/blas/base/gcopy"),NK=require("@stdlib/array/to-json"),B=require("@stdlib/string/format"),Sp=xd(),z=624,Gd=397,Op=Lp>>>0,LK=19650218,Vd=2147483648,Fd=2147483647,RK=1812433253,PK=1664525,TK=1566083941,jK=2636928640,MK=4022730752,xK=2567483615,Wd=[0,xK>>>0],Rp=1/(Np+1),AK=67108864,GK=2147483648,Id=1,VK=Np*Rp,Ru=1,Pu=3,dt=2,lt=z+3,C=z+5,Cs=z+6;function Ep(r,e){var t;return e?t="option":t="argument",r.length>>0,i=1;i>>0,t=(t^t>>>30)>>>0,r[i]=kd(t,RK)+i>>>0;return r}function FK(r,e,t,i){var n,a,u,o;for(a=1,u=0,o=_K(e,i);o>0;o--)n=r[a-1]>>>0,n=(n^n>>>30)>>>0,n=kd(n,PK)>>>0,r[a]=(r[a]>>>0^n)+t[u]+u>>>0,a+=1,u+=1,a>=e&&(r[0]=r[e-1],a=1),u>=i&&(u=0);for(o=e-1;o>0;o--)n=r[a-1]>>>0,n=(n^n>>>30)>>>0,n=kd(n,TK)>>>0,r[a]=(r[a]>>>0^n)-a>>>0,a+=1,a>=e&&(r[0]=r[e-1],a=1);return r[0]=GK,r}function WK(r){var e,t,i,n;for(n=z-Gd,t=0;t>>1^Wd[e&Id];for(i=z-1;t>>1^Wd[e&Id];return e=r[i]&Vd|r[0]&Fd,r[i]=r[Gd-1]^e>>>1^Wd[e&Id],r}function IK(r){var e,t,i,n,a,u;if(i={},arguments.length){if(!SK(r))throw new TypeError(B("invalid argument. Options argument must be an object. Value: `%s`.",r));if(Ad(r,"copy")&&(i.copy=r.copy,!EK(r.copy)))throw new TypeError(B("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",r.copy));if(Ad(r,"state")){if(t=r.state,i.state=!0,!bp(t))throw new TypeError(B("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",t));if(u=Ep(t,!0),u)throw u;i.copy===!1?e=t:(e=new U(t.length),ga(t.length,t,1,e,1)),t=new U(e.buffer,e.byteOffset+(dt+1)*e.BYTES_PER_ELEMENT,z),n=new U(e.buffer,e.byteOffset+(C+1)*e.BYTES_PER_ELEMENT,t[C])}if(n===void 0)if(Ad(r,"seed"))if(n=r.seed,i.seed=!0,wp(n)){if(n>Op)throw new RangeError(B("invalid option. `%s` option must be a positive integer less than or equal to the maximum unsigned 32-bit integer. Option: `%u`.","seed",n));n>>>=0}else{if(OK(n)===!1||n.length<1)throw new TypeError(B("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",n));if(n.length===1){if(n=n[0],!wp(n))throw new TypeError(B("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",n));if(n>Op)throw new RangeError(B("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",n));n>>>=0}else a=n.length,e=new U(Cs+a),e[0]=Ru,e[1]=Pu,e[dt]=z,e[lt]=1,e[lt+1]=z,e[C]=a,ga.ndarray(a,n,1,0,e,1,C+1),t=new U(e.buffer,e.byteOffset+(dt+1)*e.BYTES_PER_ELEMENT,z),n=new U(e.buffer,e.byteOffset+(C+1)*e.BYTES_PER_ELEMENT,a),t=_p(t,z,LK),t=FK(t,z,n,a)}else n=Sp()>>>0}else n=Sp()>>>0;return t===void 0&&(e=new U(Cs+1),e[0]=Ru,e[1]=Pu,e[dt]=z,e[lt]=1,e[lt+1]=z,e[C]=1,e[C+1]=n,t=new U(e.buffer,e.byteOffset+(dt+1)*e.BYTES_PER_ELEMENT,z),n=new U(e.buffer,e.byteOffset+(C+1)*e.BYTES_PER_ELEMENT,1),t=_p(t,z,n)),Gr(p,"NAME","mt19937"),ft(p,"seed",o),ft(p,"seedLength",v),qp(p,"state",l,m),ft(p,"stateLength",g),ft(p,"byteLength",c),Gr(p,"toJSON",h),Gr(p,"MIN",0),Gr(p,"MAX",Lp),Gr(p,"normalized",d),Gr(d,"NAME",p.NAME),ft(d,"seed",o),ft(d,"seedLength",v),qp(d,"state",l,m),ft(d,"stateLength",g),ft(d,"byteLength",c),Gr(d,"toJSON",h),Gr(d,"MIN",0),Gr(d,"MAX",VK),p;function o(){var f=e[C];return ga(f,n,1,new U(f),1)}function v(){return e[C]}function g(){return e.length}function c(){return e.byteLength}function l(){var f=e.length;return ga(f,e,1,new U(f),1)}function m(f){var y;if(!bp(f))throw new TypeError(B("invalid argument. Must provide a Uint32Array. Value: `%s`.",f));if(y=Ep(f,!1),y)throw y;i.copy===!1?i.state&&f.length===e.length?ga(f.length,f,1,e,1):(e=f,i.state=!0):(f.length!==e.length&&(e=new U(f.length)),ga(f.length,f,1,e,1)),t=new U(e.buffer,e.byteOffset+(dt+1)*e.BYTES_PER_ELEMENT,z),n=new U(e.buffer,e.byteOffset+(C+1)*e.BYTES_PER_ELEMENT,e[C])}function h(){var f={};return f.type="PRNG",f.name=p.NAME,f.state=NK(e),f.params=[],f}function p(){var f,y;return y=e[lt+1],y>=z&&(t=WK(t),y=0),f=t[y],e[lt+1]=y+1,f^=f>>>11,f^=f<<7&jK,f^=f<<15&MK,f^=f>>>18,f>>>0}function d(){var f=p()>>>5,y=p()>>>6;return(f*AK+y)*Rp}}Pp.exports=IK});var jp=s(function(eYe,Tp){"use strict";var kK=zd(),zK=xd(),JK=kK({seed:zK()});Tp.exports=JK});var T=s(function(rYe,xp){"use strict";var UK=require("@stdlib/utils/define-nonenumerable-read-only-property"),Mp=jp(),CK=zd();UK(Mp,"factory",CK);xp.exports=Mp});var Fp=s(function(tYe,Vp){"use strict";var Ap=require("@stdlib/assert/is-number").isPrimitive,Jd=require("@stdlib/string/format"),Gp=require("@stdlib/assert/is-nan");function BK(r,e){return!Ap(r)||Gp(r)?new TypeError(Jd("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):!Ap(e)||Gp(e)?new TypeError(Jd("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e)):r>=e?new RangeError(Jd("invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.",r,e)):null}Vp.exports=BK});var Ip=s(function(iYe,Wp){"use strict";var DK=require("@stdlib/math/base/special/pow"),XK=require("@stdlib/math/base/special/sin"),YK=require("@stdlib/constants/float64/half-pi");function HK(r,e,t){return e+DK(XK(YK*r()),2)*(t-e)}Wp.exports=HK});var Ud=s(function(nYe,Xp){"use strict";var Vr=require("@stdlib/utils/define-nonenumerable-read-only-property"),Tu=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),kp=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),zp=require("@stdlib/assert/is-plain-object"),Jp=require("@stdlib/assert/is-function"),Up=require("@stdlib/assert/has-own-property"),Cp=require("@stdlib/utils/constant-function"),ZK=require("@stdlib/utils/noop"),ju=T().factory,Bp=require("@stdlib/math/base/assert/is-nan"),QK=require("@stdlib/array/to-json"),Mu=require("@stdlib/string/format"),$K=Fp(),Dp=Ip();function KK(){var r,e,t,i,n,a;if(arguments.length===0)e=ju();else if(arguments.length===1){if(r=arguments[0],!zp(r))throw new TypeError(Mu("invalid argument. Options argument must be an object. Value: `%s`.",r));if(Up(r,"prng")){if(!Jp(r.prng))throw new TypeError(Mu("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=ju(r)}else{if(n=arguments[0],a=arguments[1],i=$K(n,a),i)throw i;if(arguments.length>2){if(r=arguments[2],!zp(r))throw new TypeError(Mu("invalid argument. Options argument must be an object. Value: `%s`.",r));if(Up(r,"prng")){if(!Jp(r.prng))throw new TypeError(Mu("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=ju(r)}else e=ju()}return n===void 0?t=p:t=h,Vr(t,"NAME","arcsine"),r&&r.prng?(Vr(t,"seed",null),Vr(t,"seedLength",null),kp(t,"state",Cp(null),ZK),Vr(t,"stateLength",null),Vr(t,"byteLength",null),Vr(t,"toJSON",Cp(null)),Vr(t,"PRNG",e)):(Tu(t,"seed",u),Tu(t,"seedLength",o),kp(t,"state",c,l),Tu(t,"stateLength",v),Tu(t,"byteLength",g),Vr(t,"toJSON",m),Vr(t,"PRNG",e),e=e.normalized),t;function u(){return e.seed}function o(){return e.seedLength}function v(){return e.stateLength}function g(){return e.byteLength}function c(){return e.state}function l(d){e.state=d}function m(){var d={};return d.type="PRNG",d.name=t.NAME,d.state=QK(e.state),n===void 0?d.params=[]:d.params=[n,a],d}function h(){return Dp(e,n,a)}function p(d,f){return Bp(d)||Bp(f)||d>=f?NaN:Dp(e,d,f)}}Xp.exports=KK});var Hp=s(function(aYe,Yp){"use strict";var eee=Ud(),ree=eee();Yp.exports=ree});var nn=s(function(sYe,Qp){"use strict";var tee=require("@stdlib/utils/define-nonenumerable-read-only-property"),Zp=Hp(),iee=Ud();tee(Zp,"factory",iee);Qp.exports=Zp});var Cd=s(function(uYe,$p){"use strict";var nee=F(),aee=require("@stdlib/array/dtypes"),see=require("@stdlib/array/defaults"),uee=nn(),oee=aee("real_floating_point_and_generic"),vee=nee(uee,oee,see.get("dtypes.real_floating_point"));$p.exports=vee});var ey=s(function(oYe,Kp){"use strict";var gee=Cd(),fee=gee();Kp.exports=fee});var iy=s(function(vYe,ty){"use strict";var dee=require("@stdlib/utils/define-nonenumerable-read-only-property"),ry=ey(),lee=Cd();dee(ry,"factory",lee);ty.exports=ry});var sy=s(function(gYe,ay){"use strict";var cee=require("@stdlib/assert/is-plain-object"),mee=require("@stdlib/assert/has-own-property"),hee=require("@stdlib/array/base/assert/contains"),ny=require("@stdlib/string/format");function pee(r,e,t){return cee(t)?mee(t,"dtype")&&(r.dtype=t.dtype,!hee(e,r.dtype))?new TypeError(ny('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",e.join('", "'),r.dtype)):null:new TypeError(ny("invalid argument. Options argument must be an object. Value: `%s`.",t))}ay.exports=pee});var gy=s(function(fYe,vy){"use strict";var uy=require("@stdlib/utils/define-nonenumerable-read-only-property"),yee=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,qee=require("@stdlib/assert/is-function"),bee=require("@stdlib/assert/is-string-array").primitives,wee=require("@stdlib/assert/is-collection"),See=require("@stdlib/array/base/assert/contains"),Oee=require("@stdlib/array/base/filled-by"),oy=require("@stdlib/strided/base/unary"),Eee=require("@stdlib/array/ctors"),Bs=require("@stdlib/string/format"),_ee=sy();function Ds(r,e,t){if(!(this instanceof Ds))return new Ds(r,e,t);if(!qee(r))throw new TypeError(Bs("invalid argument. First argument must be a function. Value: `%s`.",r));if(!bee(e))throw new TypeError(Bs("invalid argument. Second argument must be an array of strings. Value: `%s`.",e));if(!See(e,t))throw new TypeError(Bs("invalid argument. Third argument must be a supported data type. Value: `%s`.",t));return this._prng=r,this._dtypes=e,this._dtype=t,this}uy(Ds.prototype,"generate",function(e,t,i){var n,a,u,o,v,g;if(!yee(e))throw new TypeError(Bs("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",e));if(a={},arguments.length>2&&(v=_ee(a,this._dtypes,i),v))throw v;if(u=this._prng,g=a.dtype||this._dtype,g==="generic")return Oee(e,c);return n=Eee(g),o=new n(e),oy([[t],o],[e],[0,1],u),o;function c(){return u(t)}});uy(Ds.prototype,"assign",function(e,t){if(!wee(t))throw new TypeError(Bs("invalid argument. Second argument must be an array-like object. Value: `%s`.",t));return oy([[e],t],[t.length],[0,1],this._prng),t});vy.exports=Ds});var dy=s(function(dYe,fy){"use strict";var Nee=gy();fy.exports=Nee});var hy=s(function(lYe,my){"use strict";var ly=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),xu=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),fa=require("@stdlib/utils/define-nonenumerable-read-only-property"),Lee=require("@stdlib/assert/is-string-array").primitives,Ree=require("@stdlib/assert/is-function"),Pee=require("@stdlib/assert/is-method-in"),Tee=require("@stdlib/assert/is-plain-object"),jee=require("@stdlib/assert/has-own-property"),cy=require("@stdlib/array/base/assert/contains").factory,Mee=require("@stdlib/utils/constant-function"),xee=require("@stdlib/utils/noop"),Aee=dy(),Gee=Nu(),Xs=require("@stdlib/string/format");function Vee(r,e,t){var i;if(!Ree(r))throw new TypeError(Xs("invalid argument. First argument must be a function. Value: `%s`.",r));if(!Pee(r,"factory"))throw new TypeError(Xs("invalid argument. First argument must have a `%s` method.","factory"));if(!Lee(e))throw new TypeError(Xs("invalid argument. Second argument must an array of strings. Value: `%s`.",e));if(!cy(e,t))throw new TypeError(Xs("invalid argument. Third argument must be a supported data type. Value: `%s`.",t));return i=cy(e),n;function n(){var a,u,o,v,g,c,l,m,h;if(g=arguments.length,g<1?(l={},c=r,m=p):g>1?(o=arguments[0],l=arguments[1],c=r.factory(o,l),m=d):Tee(arguments[0])?(l=arguments[0],c=r.factory(l),m=p):(o=arguments[0],l={},c=r.factory(o),m=d),jee(l,"dtype")){if(h=l.dtype,!i(h))throw new TypeError(Xs('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",e.join('", "'),h))}else h=t;return m===p?(v=f,a=Aee):(v=y,a=Gee),u=new a(c,e,h),l&&l.prng?(fa(m,"seed",null),fa(m,"seedLength",null),ly(m,"state",Mee(null),xee),fa(m,"stateLength",null),fa(m,"byteLength",null)):(xu(m,"seed",q),xu(m,"seedLength",b),ly(m,"state",W,J),xu(m,"stateLength",w),xu(m,"byteLength",S)),fa(m,"PRNG",c.PRNG),fa(m,"assign",v),m;function p(x,V,A){return arguments.length<3?u.generate(x,V):u.generate(x,V,A)}function d(x,V){return arguments.length<2?u.generate(x):u.generate(x,V)}function f(x,V){return u.assign(x,V)}function y(x){return u.assign(x)}function q(){return m.PRNG.seed}function b(){return m.PRNG.seedLength}function w(){return m.PRNG.stateLength}function S(){return m.PRNG.byteLength}function W(){return m.PRNG.state}function J(x){m.PRNG.state=x}}}my.exports=Vee});var Fr=s(function(cYe,py){"use strict";var Fee=hy();py.exports=Fee});var Bd=s(function(mYe,Oy){"use strict";var Wr=require("@stdlib/utils/define-nonenumerable-read-only-property"),Au=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),yy=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),qy=require("@stdlib/assert/is-plain-object"),Wee=require("@stdlib/assert/is-probability").isPrimitive,by=require("@stdlib/assert/is-function"),wy=require("@stdlib/assert/has-own-property"),Sy=require("@stdlib/utils/constant-function"),Iee=require("@stdlib/utils/noop"),Gu=T().factory,kee=require("@stdlib/math/base/assert/is-nan"),zee=require("@stdlib/array/to-json"),Vu=require("@stdlib/string/format");function Jee(){var r,e,t,i;if(arguments.length===0)e=Gu();else if(arguments.length===1&&qy(arguments[0]))if(r=arguments[0],wy(r,"prng")){if(!by(r.prng))throw new TypeError(Vu("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Gu(r);else{if(i=arguments[0],!Wee(i))throw new TypeError(Vu("invalid argument. First argument must be a probability. Value: `%s`.",i));if(arguments.length>1){if(r=arguments[1],!qy(r))throw new TypeError(Vu("invalid argument. Options argument must be an object. Value: `%s`.",r));if(wy(r,"prng")){if(!by(r.prng))throw new TypeError(Vu("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Gu(r)}else e=Gu()}return i===void 0?t=m:t=l,Wr(t,"NAME","bernoulli"),r&&r.prng?(Wr(t,"seed",null),Wr(t,"seedLength",null),yy(t,"state",Sy(null),Iee),Wr(t,"stateLength",null),Wr(t,"byteLength",null),Wr(t,"toJSON",Sy(null)),Wr(t,"PRNG",e)):(Au(t,"seed",n),Au(t,"seedLength",a),yy(t,"state",v,g),Au(t,"stateLength",u),Au(t,"byteLength",o),Wr(t,"toJSON",c),Wr(t,"PRNG",e),e=e.normalized),t;function n(){return e.seed}function a(){return e.seedLength}function u(){return e.stateLength}function o(){return e.byteLength}function v(){return e.state}function g(h){e.state=h}function c(){var h={};return h.type="PRNG",h.name=t.NAME,h.state=zee(e.state),i===void 0?h.params=[]:h.params=[i],h}function l(){return e()<=i?1:0}function m(h){return kee(h)||h<0||h>1?NaN:e()<=h?1:0}}Oy.exports=Jee});var _y=s(function(hYe,Ey){"use strict";var Uee=Bd(),Cee=Uee();Ey.exports=Cee});var an=s(function(pYe,Ly){"use strict";var Bee=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ny=_y(),Dee=Bd();Bee(Ny,"factory",Dee);Ly.exports=Ny});var Dd=s(function(yYe,Ry){"use strict";var Xee=Fr(),Yee=require("@stdlib/array/dtypes"),Hee=require("@stdlib/array/defaults"),Zee=an(),Qee=Yee("real_and_generic"),$ee=Xee(Zee,Qee,Hee.get("dtypes.real"));Ry.exports=$ee});var Ty=s(function(qYe,Py){"use strict";var Kee=Dd(),ere=Kee();Py.exports=ere});var xy=s(function(bYe,My){"use strict";var rre=require("@stdlib/utils/define-nonenumerable-read-only-property"),jy=Ty(),tre=Dd();rre(jy,"factory",tre);My.exports=jy});var Fy=s(function(wYe,Vy){"use strict";var ire=require("@stdlib/math/base/special/sqrt"),Ay=require("@stdlib/math/base/special/exp"),nre=require("@stdlib/math/base/special/ln"),Gy=.00991256303526217;function are(r,e){var t,i,n;for(i=Ay(-.5*e*e),t=[],t.push(Gy/i),t.push(e),n=2;n=0&&g<=1&&(v=r(),n=Hd(u,4),c=8*t-12,c=1-n/c,v<=c?i=!1:(c+=.5*Hd(n/(8*t-8),2),v=vq(v)&&(i=!1))));return g}gq.exports=xre});var lq=s(function(jYe,dq){"use strict";var Are=require("@stdlib/math/base/special/pow"),Iu=require("@stdlib/math/base/special/ln");function Gre(r,e,t,i){var n,a,u,o,v,g,c,l,m,h,p;for(o=t-1,v=i-1,g=o+v,c=g*Iu(g),u=o/g,n=.5/Are(g,.5),a=!0;a===!0;)l=e(),h=u+l*n,h>=0&&h<=1&&(m=r(),p=o*Iu(h/o),p+=v*Iu((1-h)/v),p+=c+.5*l*l,p>=Iu(m)&&(a=!1));return h}dq.exports=Gre});var hq=s(function(MYe,mq){"use strict";var Zd=require("@stdlib/math/base/special/exp"),cq=require("@stdlib/math/base/special/pow"),Qd=require("@stdlib/math/base/special/ln");function Vre(r,e,t){for(var i,n,a,u,o,v,g;;)if(u=r(),o=r(),v=cq(u,1/e),g=cq(o,1/t),a=v+g,a<=1)return a>0?v/a:(i=Qd(u)/e,n=Qd(o)/t,i>n?(n-=i,i=0):(i-=n,n=0),Zd(i-Qd(Zd(i)+Zd(n))))}mq.exports=Vre});var qq=s(function(xYe,yq){"use strict";var pq=oq(),Fre=fq(),Wre=lq(),Ire=hq();function kre(r,e,t,i){var n,a;return t===i&&t>1.5?Fre(r,e,t):t>1&&i>1?Wre(r,e,t,i):t<1&&i<1?Ire(r,t,i):(n=pq(r,e,t),a=pq(r,e,i),n/(n+a))}yq.exports=kre});var rl=s(function(AYe,Pq){"use strict";var Ir=require("@stdlib/utils/define-nonenumerable-read-only-property"),ku=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),bq=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),wq=require("@stdlib/assert/is-plain-object"),Sq=require("@stdlib/assert/is-boolean").isPrimitive,Oq=require("@stdlib/assert/is-function"),da=require("@stdlib/assert/has-own-property"),Eq=require("@stdlib/utils/constant-function"),zre=require("@stdlib/utils/noop"),_q=Q().factory,zu=T().factory,Nq=require("@stdlib/math/base/assert/is-nan"),$d=require("@stdlib/blas/base/gcopy"),Kd=require("@stdlib/array/uint32"),el=require("@stdlib/assert/is-uint32array"),Lq=require("@stdlib/object/assign"),Jre=require("@stdlib/array/to-json"),kr=require("@stdlib/string/format"),Ure=iq(),Rq=qq();function Cre(){var r,e,t,i,n,a,u,o,v;if(o=!0,arguments.length===0)n={copy:!1},a=zu(n);else if(arguments.length===1){if(n=arguments[0],!wq(n))throw new TypeError(kr("invalid argument. Options argument must be an object. Value: `%s`.",n));if(da(n,"copy")&&!Sq(n.copy))throw new TypeError(kr("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",n.copy));if(da(n,"prng")){if(!Oq(n.prng))throw new TypeError(kr("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",n.prng));a=n.prng}else{if(da(n,"state")&&!el(n.state))throw new TypeError(kr("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",n.state));n=Lq({},n),n.copy===!1?o=!1:n.state&&(n.state=$d(n.state.length,n.state,1,new Kd(n.state.length),1)),n.copy=!1,a=zu(n)}}else{if(t=arguments[0],i=arguments[1],v=Ure(t,i),v)throw v;if(arguments.length>2){if(n=arguments[2],!wq(n))throw new TypeError(kr("invalid argument. Options argument must be an object. Value: `%s`.",n));if(da(n,"copy")&&!Sq(n.copy))throw new TypeError(kr("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",n.copy));if(da(n,"prng")){if(!Oq(n.prng))throw new TypeError(kr("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",n.prng));a=n.prng}else{if(da(n,"state")&&!el(n.state))throw new TypeError(kr("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",n.state));n=Lq({},n),n.copy===!1?o=!1:n.state&&(n.state=$d(n.state.length,n.state,1,new Kd(n.state.length),1)),n.copy=!1,a=zu(n)}}else n={copy:!1},a=zu(n)}return n&&n.prng?e=_q({prng:n.prng}):(n.state?r=n.state:(r=a.state,a.state=r),e=_q({state:r,copy:!1})),t===void 0?u=y:u=f,Ir(u,"NAME","beta"),n&&n.prng?(Ir(u,"seed",null),Ir(u,"seedLength",null),bq(u,"state",Eq(null),zre),Ir(u,"stateLength",null),Ir(u,"byteLength",null),Ir(u,"toJSON",Eq(null)),Ir(u,"PRNG",a)):(ku(u,"seed",g),ku(u,"seedLength",c),bq(u,"state",h,p),ku(u,"stateLength",l),ku(u,"byteLength",m),Ir(u,"toJSON",d),Ir(u,"PRNG",a),a=a.normalized),u;function g(){return a.seed}function c(){return a.seedLength}function l(){return a.stateLength}function m(){return a.byteLength}function h(){return a.state}function p(q){if(!el(q))throw new TypeError(kr("invalid argument. Must provide a Uint32Array. Value: `%s`.",q));o&&(q=$d(q.length,q,1,new Kd(q.length),1)),a.state=q}function d(){var q={};return q.type="PRNG",q.name=u.NAME,q.state=Jre(a.state),t===void 0?q.params=[]:q.params=[t,i],q}function f(){return Rq(a,e,t,i)}function y(q,b){return Nq(q)||Nq(b)||q<=0||b<=0?NaN:Rq(a,e,q,b)}}Pq.exports=Cre});var jq=s(function(GYe,Tq){"use strict";var Bre=rl(),Dre=Bre();Tq.exports=Dre});var un=s(function(VYe,xq){"use strict";var Xre=require("@stdlib/utils/define-nonenumerable-read-only-property"),Mq=jq(),Yre=rl();Xre(Mq,"factory",Yre);xq.exports=Mq});var tl=s(function(FYe,Aq){"use strict";var Hre=F(),Zre=require("@stdlib/array/dtypes"),Qre=require("@stdlib/array/defaults"),$re=un(),Kre=Zre("real_floating_point_and_generic"),ete=Hre($re,Kre,Qre.get("dtypes.real_floating_point"));Aq.exports=ete});var Vq=s(function(WYe,Gq){"use strict";var rte=tl(),tte=rte();Gq.exports=tte});var Iq=s(function(IYe,Wq){"use strict";var ite=require("@stdlib/utils/define-nonenumerable-read-only-property"),Fq=Vq(),nte=tl();ite(Fq,"factory",nte);Wq.exports=Fq});var Uq=s(function(kYe,Jq){"use strict";var kq=require("@stdlib/assert/is-positive-number").isPrimitive,zq=require("@stdlib/string/format");function ate(r,e){return kq(r)?kq(e)?null:new TypeError(zq("invalid argument. Second argument must be a positive number. Value: `%s`.",e)):new TypeError(zq("invalid argument. First argument must be a positive number. Value: `%s`.",r))}Jq.exports=ate});var Dq=s(function(zYe,Bq){"use strict";var Cq=require("@stdlib/math/base/special/ln");function ste(r,e,t,i,n){var a,u,o,v,g,c,l;for(a=!0;a;){do g=e(),l=1+n*g;while(l<=0);l*=l*l,u=g*g,o=1-.331*u*u,v=.5*u+i*(1-l+Cq(l)),c=r(),(c2){if(n=arguments[2],!Yq(n))throw new TypeError(Jr("invalid argument. Options argument must be an object. Value: `%s`.",n));if(la(n,"copy")&&!Hq(n.copy))throw new TypeError(Jr("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",n.copy));if(la(n,"prng")){if(!Zq(n.prng))throw new TypeError(Jr("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",n.prng));a=n.prng}else{if(la(n,"state")&&!il(n.state))throw new TypeError(Jr("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",n.state));n=rb({},n),n.copy===!1?o=!1:n.state&&(n.state=al(n.state.length,n.state,1,new sl(n.state.length),1)),n.copy=!1,a=Uu(n)}}else n={copy:!1},a=Uu(n)}return n&&n.prng?t=$q({prng:n.prng}):(n.state?r=n.state:(r=a.state,a.state=r),t=$q({state:r,copy:!1})),e===void 0?u=w:(e>=1?(u=q,c=e-Bu):(u=b,c=e+1-Bu),g=1/nl(9*c)),zr(u,"NAME","gamma"),n&&n.prng?(zr(u,"seed",null),zr(u,"seedLength",null),Xq(u,"state",Qq(null),ute),zr(u,"stateLength",null),zr(u,"byteLength",null),zr(u,"toJSON",Qq(null)),zr(u,"PRNG",a)):(Ju(u,"seed",l),Ju(u,"seedLength",m),Xq(u,"state",d,f),Ju(u,"stateLength",h),Ju(u,"byteLength",p),zr(u,"toJSON",y),zr(u,"PRNG",a),a=a.normalized),u;function l(){return a.seed}function m(){return a.seedLength}function h(){return a.stateLength}function p(){return a.byteLength}function d(){return a.state}function f(S){if(!il(S))throw new TypeError(Jr("invalid argument. Must provide a Uint32Array. Value: `%s`.",S));o&&(S=al(S.length,S,1,new sl(S.length),1)),a.state=S}function y(){var S={};return S.type="PRNG",S.name=u.NAME,S.state=ote(a.state),e===void 0?S.params=[]:S.params=[e,i],S}function q(){return Cu(a,t,i,c,g)}function b(){return Cu(a,t,i,c,g)*eb(a(),1/e)}function w(S,W){var J,x;return Kq(S)||Kq(W)||S<=0||W<=0?NaN:S<1?(x=S+1-Bu,J=1/nl(9*x),Cu(a,t,W,x,J)*eb(a(),1/S)):(x=S-Bu,J=1/nl(9*x),Cu(a,t,W,x,J))}}tb.exports=gte});var nb=s(function(UYe,ib){"use strict";var fte=ul(),dte=fte();ib.exports=dte});var Ce=s(function(CYe,sb){"use strict";var lte=require("@stdlib/utils/define-nonenumerable-read-only-property"),ab=nb(),cte=ul();lte(ab,"factory",cte);sb.exports=ab});var gb=s(function(BYe,vb){"use strict";var ub=require("@stdlib/assert/is-positive-number").isPrimitive,ob=require("@stdlib/string/format");function mte(r,e){return ub(r)?ub(e)?null:new TypeError(ob("invalid argument. Second argument must be a positive number. Value: `%s`.",e)):new TypeError(ob("invalid argument. First argument must be a positive number. Value: `%s`.",r))}vb.exports=mte});var db=s(function(DYe,fb){"use strict";function hte(r,e,t){return r(e,1)/r(t,1)}fb.exports=hte});var ol=s(function(XYe,qb){"use strict";var mt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Du=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),lb=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),cb=require("@stdlib/assert/is-plain-object"),mb=require("@stdlib/utils/constant-function"),pte=require("@stdlib/utils/noop"),Xu=Ce().factory,hb=require("@stdlib/math/base/assert/is-nan"),yte=require("@stdlib/array/to-json"),pb=require("@stdlib/string/format"),qte=gb(),yb=db();function bte(){var r,e,t,i,n,a,u;if(arguments.length===0)r=Xu();else if(arguments.length===1){if(i=arguments[0],!cb(i))throw new TypeError(pb("invalid argument. Options argument must be an object. Value: `%s`.",i));r=Xu(i)}else{if(e=arguments[0],t=arguments[1],u=qte(e,t),u)throw u;if(arguments.length>2){if(i=arguments[2],!cb(i))throw new TypeError(pb("invalid argument. Options argument must be an object. Value: `%s`.",i));r=Xu(i)}else r=Xu()}return e===void 0?a=d:a=p,n=r.PRNG,mt(a,"NAME","betaprime"),i&&i.prng?(mt(a,"seed",null),mt(a,"seedLength",null),lb(a,"state",mb(null),pte),mt(a,"stateLength",null),mt(a,"byteLength",null),mt(a,"toJSON",mb(null))):(Du(a,"seed",o),Du(a,"seedLength",v),lb(a,"state",l,m),Du(a,"stateLength",g),Du(a,"byteLength",c),mt(a,"toJSON",h)),mt(a,"PRNG",n),a;function o(){return n.seed}function v(){return n.seedLength}function g(){return n.stateLength}function c(){return n.byteLength}function l(){return n.state}function m(f){n.state=f}function h(){var f={};return f.type="PRNG",f.name=a.NAME,f.state=yte(n.state),e===void 0?f.params=[]:f.params=[e,t],f}function p(){return yb(r,e,t)}function d(f,y){return hb(f)||hb(y)||f<=0||y<=0?NaN:yb(r,f,y)}}qb.exports=bte});var wb=s(function(YYe,bb){"use strict";var wte=ol(),Ste=wte();bb.exports=Ste});var on=s(function(HYe,Ob){"use strict";var Ote=require("@stdlib/utils/define-nonenumerable-read-only-property"),Sb=wb(),Ete=ol();Ote(Sb,"factory",Ete);Ob.exports=Sb});var vl=s(function(ZYe,Eb){"use strict";var _te=F(),Nte=require("@stdlib/array/dtypes"),Lte=require("@stdlib/array/defaults"),Rte=on(),Pte=Nte("real_floating_point_and_generic"),Tte=_te(Rte,Pte,Lte.get("dtypes.real_floating_point"));Eb.exports=Tte});var Nb=s(function(QYe,_b){"use strict";var jte=vl(),Mte=jte();_b.exports=Mte});var Pb=s(function($Ye,Rb){"use strict";var xte=require("@stdlib/utils/define-nonenumerable-read-only-property"),Lb=Nb(),Ate=vl();xte(Lb,"factory",Ate);Rb.exports=Lb});var Mb=s(function(KYe,jb){"use strict";var Gte=require("@stdlib/assert/is-positive-integer").isPrimitive,Vte=require("@stdlib/assert/is-probability").isPrimitive,Tb=require("@stdlib/string/format");function Fte(r,e){return Gte(r)?Vte(e)?null:new TypeError(Tb("invalid argument. Second argument must be a probability. Value: `%s`.",e)):new TypeError(Tb("invalid argument. First argument must be a positive integer. Value: `%s`.",e))}jb.exports=Fte});var Ab=s(function(e6e,xb){"use strict";function Wte(r,e,t){var i=0,n;for(n=0;n=p?A=r()-.5:(A=G/p-.93,A=Cte(A)*.5-A,G=p*r()),l=.5-fl(A),S=gl(A*(2*d/l+f)+y),!(S<0||S>e))if(G=G*i/(d/(l*l)+f),m=fl(S-W),m>15){if(G=Yu(G),o=m/u,v=(m/3+.625)*m,v+=Dte,v/=u,o*=v+.5,V=-(m*m)/(2*u),GS)for(w=S;w<=W;w++)G*=c/w-x;if(G<=q)return S}}}Fb.exports=Xte});var zb=s(function(i6e,kb){"use strict";var Yte=Ab(),Hte=Wb();function Ib(r,e,t){return t>.5?e-Ib(r,e,1-t):e*t<10?Yte(r,e,t):Hte(r,e,t)}kb.exports=Ib});var dl=s(function(n6e,Hb){"use strict";var Ur=require("@stdlib/utils/define-nonenumerable-read-only-property"),Zu=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Jb=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Ub=require("@stdlib/assert/is-plain-object"),Cb=require("@stdlib/assert/is-function"),Bb=require("@stdlib/assert/has-own-property"),Db=require("@stdlib/utils/constant-function"),Zte=require("@stdlib/utils/noop"),Xb=require("@stdlib/math/base/assert/is-nan"),Qte=require("@stdlib/math/base/assert/is-positive-integer"),$te=require("@stdlib/math/base/assert/is-probability"),Qu=T().factory,Kte=require("@stdlib/array/to-json"),$u=require("@stdlib/string/format"),eie=Mb(),Yb=zb();function rie(){var r,e,t,i,n,a;if(arguments.length===0)e=Qu();else if(arguments.length===1){if(r=arguments[0],!Ub(r))throw new TypeError($u("invalid argument. Options argument must be an object. Value: `%s`.",r));if(Bb(r,"prng")){if(!Cb(r.prng))throw new TypeError($u("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Qu(r)}else{if(n=arguments[0],a=arguments[1],i=eie(n,a),i)throw i;if(arguments.length>2){if(r=arguments[2],!Ub(r))throw new TypeError($u("invalid argument. Options argument must be an object. Value: `%s`.",r));if(Bb(r,"prng")){if(!Cb(r.prng))throw new TypeError($u("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Qu(r)}else e=Qu()}return n===void 0?t=p:t=h,Ur(t,"NAME","binomial"),r&&r.prng?(Ur(t,"seed",null),Ur(t,"seedLength",null),Jb(t,"state",Db(null),Zte),Ur(t,"stateLength",null),Ur(t,"byteLength",null),Ur(t,"toJSON",Db(null)),Ur(t,"PRNG",e)):(Zu(t,"seed",u),Zu(t,"seedLength",o),Jb(t,"state",c,l),Zu(t,"stateLength",v),Zu(t,"byteLength",g),Ur(t,"toJSON",m),Ur(t,"PRNG",e),e=e.normalized),t;function u(){return e.seed}function o(){return e.seedLength}function v(){return e.stateLength}function g(){return e.byteLength}function c(){return e.state}function l(d){e.state=d}function m(){var d={};return d.type="PRNG",d.name=t.NAME,d.state=Kte(e.state),n===void 0?d.params=[]:d.params=[n,a],d}function h(){return Yb(e,n,a)}function p(d,f){return Xb(d)||Xb(f)||!Qte(d)||!$te(f)?NaN:Yb(e,d,f)}}Hb.exports=rie});var Qb=s(function(a6e,Zb){"use strict";var tie=dl(),iie=tie();Zb.exports=iie});var ca=s(function(s6e,Kb){"use strict";var nie=require("@stdlib/utils/define-nonenumerable-read-only-property"),$b=Qb(),aie=dl();nie($b,"factory",aie);Kb.exports=$b});var ll=s(function(u6e,ew){"use strict";var sie=F(),uie=require("@stdlib/array/dtypes"),oie=require("@stdlib/array/defaults"),vie=ca(),gie=uie("real_and_generic"),fie=sie(vie,gie,oie.get("dtypes.real"));ew.exports=fie});var tw=s(function(o6e,rw){"use strict";var die=ll(),lie=die();rw.exports=lie});var aw=s(function(v6e,nw){"use strict";var cie=require("@stdlib/utils/define-nonenumerable-read-only-property"),iw=tw(),mie=ll();cie(iw,"factory",mie);nw.exports=iw});var ow=s(function(g6e,uw){"use strict";var hie=require("@stdlib/assert/is-number").isPrimitive,pie=require("@stdlib/assert/is-positive-number").isPrimitive,sw=require("@stdlib/string/format"),yie=require("@stdlib/assert/is-nan");function qie(r,e){return!hie(r)||yie(r)?new TypeError(sw("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):pie(e)?null:new TypeError(sw("invalid argument. Second argument must be a positive number. Value: `%s`.",e))}uw.exports=qie});var gw=s(function(f6e,vw){"use strict";var bie=require("@stdlib/math/base/special/tan"),wie=require("@stdlib/constants/float64/pi");function Sie(r,e,t){return e+t*bie(wie*(r()-.5))}vw.exports=Sie});var cl=s(function(d6e,yw){"use strict";var ht=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ku=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),fw=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),dw=require("@stdlib/assert/is-plain-object"),lw=require("@stdlib/assert/is-function"),cw=require("@stdlib/assert/has-own-property"),mw=require("@stdlib/utils/constant-function"),Oie=require("@stdlib/utils/noop"),hw=require("@stdlib/math/base/assert/is-nan"),ma=Q().factory,Eie=require("@stdlib/array/to-json"),eo=require("@stdlib/string/format"),_ie=ow(),pw=gw();function Nie(){var r,e,t,i,n,a,u;if(arguments.length===0)e=ma();else if(arguments.length===1){if(t=arguments[0],!dw(t))throw new TypeError(eo("invalid argument. Options argument must be an object. Value: `%s`.",t));if(cw(t,"prng")){if(!lw(t.prng))throw new TypeError(eo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",t.prng));e=ma({prng:t.prng})}else e=ma(t)}else{if(u=arguments[0],r=arguments[1],a=_ie(u,r),a)throw a;if(arguments.length>2){if(t=arguments[2],!dw(t))throw new TypeError(eo("invalid argument. Options argument must be an object. Value: `%s`.",t));if(cw(t,"prng")){if(!lw(t.prng))throw new TypeError(eo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",t.prng));e=ma({prng:t.prng})}else e=ma(t)}else e=ma()}return u===void 0?n=d:n=p,i=e.PRNG,ht(n,"NAME","cauchy"),t&&t.prng?(ht(n,"seed",null),ht(n,"seedLength",null),fw(n,"state",mw(null),Oie),ht(n,"stateLength",null),ht(n,"byteLength",null),ht(n,"toJSON",mw(null))):(Ku(n,"seed",o),Ku(n,"seedLength",v),fw(n,"state",l,m),Ku(n,"stateLength",g),Ku(n,"byteLength",c),ht(n,"toJSON",h)),ht(n,"PRNG",i),n;function o(){return i.seed}function v(){return i.seedLength}function g(){return i.stateLength}function c(){return i.byteLength}function l(){return i.state}function m(f){i.state=f}function h(){var f={};return f.type="PRNG",f.name=n.NAME,f.state=Eie(i.state),u===void 0?f.params=[]:f.params=[u,r],f}function p(){return pw(e,u,r)}function d(f,y){return hw(f)||hw(y)||y<=0?NaN:pw(e,f,y)}}yw.exports=Nie});var bw=s(function(l6e,qw){"use strict";var Lie=cl(),Rie=Lie();qw.exports=Rie});var ha=s(function(c6e,Sw){"use strict";var Pie=require("@stdlib/utils/define-nonenumerable-read-only-property"),ww=bw(),Tie=cl();Pie(ww,"factory",Tie);Sw.exports=ww});var ml=s(function(m6e,Ow){"use strict";var jie=F(),Mie=require("@stdlib/array/dtypes"),xie=require("@stdlib/array/defaults"),Aie=ha(),Gie=Mie("real_floating_point_and_generic"),Vie=jie(Aie,Gie,xie.get("dtypes.real_floating_point"));Ow.exports=Vie});var _w=s(function(h6e,Ew){"use strict";var Fie=ml(),Wie=Fie();Ew.exports=Wie});var Rw=s(function(p6e,Lw){"use strict";var Iie=require("@stdlib/utils/define-nonenumerable-read-only-property"),Nw=_w(),kie=ml();Iie(Nw,"factory",kie);Lw.exports=Nw});var hl=s(function(y6e,Aw){"use strict";var pt=require("@stdlib/utils/define-nonenumerable-read-only-property"),ro=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Pw=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),zie=require("@stdlib/assert/is-positive-number").isPrimitive,Tw=require("@stdlib/assert/is-plain-object"),jw=require("@stdlib/assert/is-function"),Mw=require("@stdlib/assert/has-own-property"),xw=require("@stdlib/utils/constant-function"),Jie=require("@stdlib/utils/noop"),Uie=require("@stdlib/math/base/assert/is-nan"),pa=Ce().factory,Cie=require("@stdlib/array/to-json"),to=require("@stdlib/string/format");function Bie(){var r,e,t,i,n;if(arguments.length===0)r=pa();else if(arguments.length===1&&Tw(arguments[0]))if(t=arguments[0],Mw(t,"prng")){if(!jw(t.prng))throw new TypeError(to("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",t.prng));r=pa({prng:t.prng})}else r=pa(t);else{if(n=arguments[0],!zie(n))throw new TypeError(to("invalid argument. First argument must be a positive number. Value: `%s`.",n));if(arguments.length>1){if(t=arguments[1],!Tw(t))throw new TypeError(to("invalid argument. Options argument must be an object. Value: `%s`.",t));if(Mw(t,"prng")){if(!jw(t.prng))throw new TypeError(to("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",t.prng));r=pa(n/2,.5,{prng:t.prng})}else r=pa(n/2,.5,t)}else r=pa(n/2,.5)}return n===void 0?i=h:i=m,e=r.PRNG,pt(i,"NAME","chisquare"),t&&t.prng?(pt(i,"seed",null),pt(i,"seedLength",null),Pw(i,"state",xw(null),Jie),pt(i,"stateLength",null),pt(i,"byteLength",null),pt(i,"toJSON",xw(null))):(ro(i,"seed",a),ro(i,"seedLength",u),Pw(i,"state",g,c),ro(i,"stateLength",o),ro(i,"byteLength",v),pt(i,"toJSON",l)),pt(i,"PRNG",e),i;function a(){return e.seed}function u(){return e.seedLength}function o(){return e.stateLength}function v(){return e.byteLength}function g(){return e.state}function c(p){e.state=p}function l(){var p={};return p.type="PRNG",p.name=i.NAME,p.state=Cie(e.state),n===void 0?p.params=[]:p.params=[n],p}function m(){return r()}function h(p){return Uie(p)||p<=0?NaN:r(p/2,.5)}}Aw.exports=Bie});var Vw=s(function(q6e,Gw){"use strict";var Die=hl(),Xie=Die();Gw.exports=Xie});var Xe=s(function(b6e,Ww){"use strict";var Yie=require("@stdlib/utils/define-nonenumerable-read-only-property"),Fw=Vw(),Hie=hl();Yie(Fw,"factory",Hie);Ww.exports=Fw});var pl=s(function(w6e,Bw){"use strict";var yt=require("@stdlib/utils/define-nonenumerable-read-only-property"),io=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Iw=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Zie=require("@stdlib/assert/is-positive-number").isPrimitive,kw=require("@stdlib/assert/is-plain-object"),zw=require("@stdlib/assert/is-function"),Jw=require("@stdlib/assert/has-own-property"),Uw=require("@stdlib/utils/constant-function"),Qie=require("@stdlib/utils/noop"),$ie=require("@stdlib/math/base/assert/is-nan"),ya=Xe().factory,Kie=require("@stdlib/array/to-json"),Cw=require("@stdlib/math/base/special/sqrt"),no=require("@stdlib/string/format");function ene(){var r,e,t,i,n;if(arguments.length===0)r=ya();else if(arguments.length===1&&kw(arguments[0]))if(t=arguments[0],Jw(t,"prng")){if(!zw(t.prng))throw new TypeError(no("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",t.prng));r=ya({prng:t.prng})}else r=ya(t);else{if(n=arguments[0],!Zie(n))throw new TypeError(no("invalid argument. First argument must be a positive number. Value: `%s`.",n));if(arguments.length>1){if(t=arguments[1],!kw(t))throw new TypeError(no("invalid argument. Options argument must be an object. Value: `%s`.",t));if(Jw(t,"prng")){if(!zw(t.prng))throw new TypeError(no("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",t.prng));r=ya(n,{prng:t.prng})}else r=ya(n,t)}else r=ya(n)}return n===void 0?i=h:i=m,e=r.PRNG,yt(i,"NAME","chi"),t&&t.prng?(yt(i,"seed",null),yt(i,"seedLength",null),Iw(i,"state",Uw(null),Qie),yt(i,"stateLength",null),yt(i,"byteLength",null),yt(i,"toJSON",Uw(null))):(io(i,"seed",a),io(i,"seedLength",u),Iw(i,"state",g,c),io(i,"stateLength",o),io(i,"byteLength",v),yt(i,"toJSON",l)),yt(i,"PRNG",e),i;function a(){return e.seed}function u(){return e.seedLength}function o(){return e.stateLength}function v(){return e.byteLength}function g(){return e.state}function c(p){e.state=p}function l(){var p={};return p.type="PRNG",p.name=i.NAME,p.state=Kie(e.state),n===void 0?p.params=[]:p.params=[n],p}function m(){return Cw(r())}function h(p){return $ie(p)||p<=0?NaN:Cw(r(p))}}Bw.exports=ene});var Xw=s(function(S6e,Dw){"use strict";var rne=pl(),tne=rne();Dw.exports=tne});var vn=s(function(O6e,Hw){"use strict";var ine=require("@stdlib/utils/define-nonenumerable-read-only-property"),Yw=Xw(),nne=pl();ine(Yw,"factory",nne);Hw.exports=Yw});var yl=s(function(E6e,Zw){"use strict";var ane=Fr(),sne=require("@stdlib/array/dtypes"),une=require("@stdlib/array/defaults"),one=vn(),vne=sne("real_floating_point_and_generic"),gne=ane(one,vne,une.get("dtypes.real_floating_point"));Zw.exports=gne});var $w=s(function(_6e,Qw){"use strict";var fne=yl(),dne=fne();Qw.exports=dne});var rS=s(function(N6e,eS){"use strict";var lne=require("@stdlib/utils/define-nonenumerable-read-only-property"),Kw=$w(),cne=yl();lne(Kw,"factory",cne);eS.exports=Kw});var ql=s(function(L6e,tS){"use strict";var mne=Fr(),hne=require("@stdlib/array/dtypes"),pne=require("@stdlib/array/defaults"),yne=Xe(),qne=hne("real_floating_point_and_generic"),bne=mne(yne,qne,pne.get("dtypes.real_floating_point"));tS.exports=bne});var nS=s(function(R6e,iS){"use strict";var wne=ql(),Sne=wne();iS.exports=Sne});var uS=s(function(P6e,sS){"use strict";var One=require("@stdlib/utils/define-nonenumerable-read-only-property"),aS=nS(),Ene=ql();One(aS,"factory",Ene);sS.exports=aS});var gS=s(function(T6e,vS){"use strict";var _ne=require("@stdlib/assert/is-number").isPrimitive,Nne=require("@stdlib/assert/is-positive-number").isPrimitive,oS=require("@stdlib/string/format"),Lne=require("@stdlib/assert/is-nan");function Rne(r,e){return!_ne(r)||Lne(r)?new TypeError(oS("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):Nne(e)?null:new TypeError(oS("invalid argument. Second argument must be a positive number. Value: `%s`.",e))}vS.exports=Rne});var dS=s(function(j6e,fS){"use strict";var Pne=require("@stdlib/stats/base/dists/cosine/quantile");function Tne(r,e,t){return Pne(r(),e,t)}fS.exports=Tne});var bl=s(function(M6e,bS){"use strict";var Cr=require("@stdlib/utils/define-nonenumerable-read-only-property"),ao=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),lS=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),cS=require("@stdlib/assert/is-plain-object"),mS=require("@stdlib/assert/is-function"),hS=require("@stdlib/assert/has-own-property"),pS=require("@stdlib/utils/constant-function"),jne=require("@stdlib/utils/noop"),so=T().factory,yS=require("@stdlib/math/base/assert/is-nan"),Mne=require("@stdlib/array/to-json"),uo=require("@stdlib/string/format"),xne=gS(),qS=dS();function Ane(){var r,e,t,i,n,a;if(arguments.length===0)e=so();else if(arguments.length===1){if(r=arguments[0],!cS(r))throw new TypeError(uo("invalid argument. Options argument must be an object. Value: `%s`.",r));if(hS(r,"prng")){if(!mS(r.prng))throw new TypeError(uo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=so(r)}else{if(n=arguments[0],a=arguments[1],i=xne(n,a),i)throw i;if(arguments.length>2){if(r=arguments[2],!cS(r))throw new TypeError(uo("invalid argument. Options argument must be an object. Value: `%s`.",r));if(hS(r,"prng")){if(!mS(r.prng))throw new TypeError(uo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=so(r)}else e=so()}return n===void 0?t=p:t=h,Cr(t,"NAME","cosine"),r&&r.prng?(Cr(t,"seed",null),Cr(t,"seedLength",null),lS(t,"state",pS(null),jne),Cr(t,"stateLength",null),Cr(t,"byteLength",null),Cr(t,"toJSON",pS(null)),Cr(t,"PRNG",e)):(ao(t,"seed",u),ao(t,"seedLength",o),lS(t,"state",c,l),ao(t,"stateLength",v),ao(t,"byteLength",g),Cr(t,"toJSON",m),Cr(t,"PRNG",e),e=e.normalized),t;function u(){return e.seed}function o(){return e.seedLength}function v(){return e.stateLength}function g(){return e.byteLength}function c(){return e.state}function l(d){e.state=d}function m(){var d={};return d.type="PRNG",d.name=t.NAME,d.state=Mne(e.state),n===void 0?d.params=[]:d.params=[n,a],d}function h(){return qS(e,n,a)}function p(d,f){return yS(d)||yS(f)||f<=0?NaN:qS(e,d,f)}}bS.exports=Ane});var SS=s(function(x6e,wS){"use strict";var Gne=bl(),Vne=Gne();wS.exports=Vne});var gn=s(function(A6e,ES){"use strict";var Fne=require("@stdlib/utils/define-nonenumerable-read-only-property"),OS=SS(),Wne=bl();Fne(OS,"factory",Wne);ES.exports=OS});var wl=s(function(G6e,_S){"use strict";var Ine=F(),kne=require("@stdlib/array/dtypes"),zne=require("@stdlib/array/defaults"),Jne=gn(),Une=kne("real_floating_point_and_generic"),Cne=Ine(Jne,Une,zne.get("dtypes.real_floating_point"));_S.exports=Cne});var LS=s(function(V6e,NS){"use strict";var Bne=wl(),Dne=Bne();NS.exports=Dne});var TS=s(function(F6e,PS){"use strict";var Xne=require("@stdlib/utils/define-nonenumerable-read-only-property"),RS=LS(),Yne=wl();Xne(RS,"factory",Yne);PS.exports=RS});var AS=s(function(W6e,xS){"use strict";var jS=require("@stdlib/assert/is-integer").isPrimitive,Sl=require("@stdlib/string/format"),MS=require("@stdlib/assert/is-nan");function Hne(r,e){return!jS(r)||MS(r)?new TypeError(Sl("invalid argument. First argument must be an integer and not NaN. Value: `%s`.",r)):!jS(e)||MS(e)?new TypeError(Sl("invalid argument. Second argument must be an integer and not NaN. Value: `%s`.",e)):r>e?new RangeError(Sl("invalid argument. Minimum support must be less than or equal to maximum support. Value: `[%d, %d]`.",r,e)):null}xS.exports=Hne});var FS=s(function(I6e,VS){"use strict";var Ol=require("@stdlib/constants/float64/max-safe-integer"),qa=require("@stdlib/math/base/special/floor");function GS(r,e,t){var i,n,a,u,o,v,g,c,l;if(a=t-e,a===0)return e;if(g=r.MIN,c=r.MAX,n=c-g,n===a)return r()-g+e;if(nOl/v)&&(l*=v,i+=l,!(i>a)))return i+e}for(n===Ol?(o=qa(n/(a+1)),n%(a+1)===a&&(o+=1)):o=qa((n+1)/(a+1));;)if(i=r()-g,i=qa(i/o),i<=a)return i+e}VS.exports=GS});var El=s(function(k6e,BS){"use strict";var Br=require("@stdlib/utils/define-nonenumerable-read-only-property"),oo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),WS=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),IS=require("@stdlib/assert/is-plain-object"),kS=require("@stdlib/assert/is-function"),zS=require("@stdlib/assert/has-own-property"),JS=require("@stdlib/utils/constant-function"),Zne=require("@stdlib/utils/noop"),vo=T().factory,US=require("@stdlib/math/base/assert/is-nan"),ba=require("@stdlib/math/base/assert/is-integer"),Qne=require("@stdlib/array/to-json"),qt=require("@stdlib/string/format"),$ne=AS(),CS=FS();function Kne(){var r,e,t,i,n,a;if(arguments.length===0)e=vo();else if(arguments.length===1){if(r=arguments[0],!IS(r))throw new TypeError(qt("invalid argument. Options argument must be an object. Value: `%s`.",r));if(zS(r,"prng")){if(!kS(r.prng))throw new TypeError(qt("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));if(e=r.prng,!ba(e.MIN))throw new TypeError(qt("invalid option. `%s` option must have a `MIN` property specifying the minimum possible pseudorandom integer value.","prng"));if(!ba(e.MAX))throw new TypeError(qt("invalid option. `%s` option must have a `MAX` property specifying the maximum possible pseudorandom integer value.","prng"))}else e=vo(r)}else{if(n=arguments[0],a=arguments[1],i=$ne(n,a),i)throw i;if(arguments.length>2){if(r=arguments[2],!IS(r))throw new TypeError(qt("invalid argument. Options argument must be an object. Value: `%s`.",r));if(zS(r,"prng")){if(!kS(r.prng))throw new TypeError(qt("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));if(e=r.prng,!ba(e.MIN))throw new TypeError(qt("invalid option. `%s` option must have a `MIN` property specifying the minimum possible pseudorandom integer value.","prng"));if(!ba(e.MAX))throw new TypeError(qt("invalid option. `%s` option must have a `MAX` property specifying the maximum possible pseudorandom integer value.","prng"))}else e=vo(r)}else e=vo()}return n===void 0?t=p:t=h,Br(t,"NAME","discrete-uniform"),r&&r.prng?(Br(t,"seed",null),Br(t,"seedLength",null),WS(t,"state",JS(null),Zne),Br(t,"stateLength",null),Br(t,"byteLength",null),Br(t,"toJSON",JS(null)),Br(t,"PRNG",e)):(oo(t,"seed",u),oo(t,"seedLength",o),WS(t,"state",c,l),oo(t,"stateLength",v),oo(t,"byteLength",g),Br(t,"toJSON",m),Br(t,"PRNG",e)),t;function u(){return e.seed}function o(){return e.seedLength}function v(){return e.stateLength}function g(){return e.byteLength}function c(){return e.state}function l(d){e.state=d}function m(){var d={};return d.type="PRNG",d.name=t.NAME,d.state=Qne(e.state),n===void 0?d.params=[]:d.params=[n,a],d}function h(){return CS(e,n,a)}function p(d,f){return US(d)||US(f)||!ba(d)||!ba(f)||d>f?NaN:CS(e,d,f)}}BS.exports=Kne});var XS=s(function(z6e,DS){"use strict";var eae=El(),rae=eae();DS.exports=rae});var fn=s(function(J6e,HS){"use strict";var tae=require("@stdlib/utils/define-nonenumerable-read-only-property"),YS=XS(),iae=El();tae(YS,"factory",iae);HS.exports=YS});var _l=s(function(U6e,ZS){"use strict";var nae=F(),aae=require("@stdlib/array/dtypes"),sae=require("@stdlib/array/defaults"),uae=fn(),oae=aae("real_and_generic"),vae=nae(uae,oae,sae.get("dtypes.real"));ZS.exports=vae});var $S=s(function(C6e,QS){"use strict";var gae=_l(),fae=gae();QS.exports=fae});var rO=s(function(B6e,eO){"use strict";var dae=require("@stdlib/utils/define-nonenumerable-read-only-property"),KS=$S(),lae=_l();dae(KS,"factory",lae);eO.exports=KS});var nO=s(function(D6e,iO){"use strict";var cae=require("@stdlib/assert/is-positive-number").isPrimitive,mae=require("@stdlib/assert/is-positive-integer").isPrimitive,tO=require("@stdlib/string/format");function hae(r,e){return mae(r)?cae(e)?null:new TypeError(tO("invalid argument. Second argument must be a positive number. Value: `%s`.",e)):new TypeError(tO("invalid argument. First argument must be a positive integer. Value: `%s`.",r))}iO.exports=hae});var sO=s(function(X6e,aO){"use strict";var pae=require("@stdlib/math/base/special/ln");function yae(r,e,t){var i,n;for(i=1,n=0;n2){if(t=arguments[2],!oO(t))throw new TypeError(lo("invalid argument. Options argument must be an object. Value: `%s`.",t));if(gO(t,"prng")){if(!vO(t.prng))throw new TypeError(lo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",t.prng));e=t.prng}else e=fo(t)}else e=fo()}return a===void 0?i=p:i=h,Dr(i,"NAME","erlang"),t&&t.prng?(Dr(i,"seed",null),Dr(i,"seedLength",null),uO(i,"state",fO(null),qae),Dr(i,"stateLength",null),Dr(i,"byteLength",null),Dr(i,"toJSON",fO(null)),Dr(i,"PRNG",e)):(go(i,"seed",u),go(i,"seedLength",o),uO(i,"state",c,l),go(i,"stateLength",v),go(i,"byteLength",g),Dr(i,"toJSON",m),Dr(i,"PRNG",e),e=e.normalized),i;function u(){return e.seed}function o(){return e.seedLength}function v(){return e.stateLength}function g(){return e.byteLength}function c(){return e.state}function l(d){e.state=d}function m(){var d={};return d.type="PRNG",d.name=i.NAME,d.state=wae(e.state),a===void 0?d.params=[]:d.params=[a,r],d}function h(){return lO(e,a,r)}function p(d,f){return dO(d)||dO(f)||!bae(d)||f<=0?NaN:lO(e,d,f)}}cO.exports=Oae});var hO=s(function(H6e,mO){"use strict";var Eae=Nl(),_ae=Eae();mO.exports=_ae});var wa=s(function(Z6e,yO){"use strict";var Nae=require("@stdlib/utils/define-nonenumerable-read-only-property"),pO=hO(),Lae=Nl();Nae(pO,"factory",Lae);yO.exports=pO});var Ll=s(function(Q6e,qO){"use strict";var Rae=F(),Pae=require("@stdlib/array/dtypes"),Tae=require("@stdlib/array/defaults"),jae=wa(),Mae=Pae("real_floating_point_and_generic"),xae=Rae(jae,Mae,Tae.get("dtypes.real_floating_point"));qO.exports=xae});var wO=s(function($6e,bO){"use strict";var Aae=Ll(),Gae=Aae();bO.exports=Gae});var EO=s(function(K6e,OO){"use strict";var Vae=require("@stdlib/utils/define-nonenumerable-read-only-property"),SO=wO(),Fae=Ll();Vae(SO,"factory",Fae);OO.exports=SO});var NO=s(function(e4e,_O){"use strict";var Wae=require("@stdlib/math/base/special/ln");function Iae(r,e){return-Wae(1-r())/e}_O.exports=Iae});var Rl=s(function(r4e,xO){"use strict";var Xr=require("@stdlib/utils/define-nonenumerable-read-only-property"),co=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),LO=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),kae=require("@stdlib/assert/is-positive-number").isPrimitive,RO=require("@stdlib/assert/is-plain-object"),PO=require("@stdlib/assert/is-function"),TO=require("@stdlib/assert/has-own-property"),jO=require("@stdlib/utils/constant-function"),zae=require("@stdlib/utils/noop"),mo=T().factory,Jae=require("@stdlib/math/base/assert/is-nan"),Uae=require("@stdlib/array/to-json"),ho=require("@stdlib/string/format"),MO=NO();function Cae(){var r,e,t,i;if(arguments.length===0)t=mo();else if(arguments.length===1&&RO(arguments[0]))if(e=arguments[0],TO(e,"prng")){if(!PO(e.prng))throw new TypeError(ho("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));t=e.prng}else t=mo(e);else{if(r=arguments[0],!kae(r))throw new TypeError(ho("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(arguments.length>1){if(e=arguments[1],!RO(e))throw new TypeError(ho("invalid argument. Options argument must be an object. Value: `%s`.",e));if(TO(e,"prng")){if(!PO(e.prng))throw new TypeError(ho("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));t=e.prng}else t=mo(e)}else t=mo()}return r===void 0?i=m:i=l,Xr(i,"NAME","exponential"),e&&e.prng?(Xr(i,"seed",null),Xr(i,"seedLength",null),LO(i,"state",jO(null),zae),Xr(i,"stateLength",null),Xr(i,"byteLength",null),Xr(i,"toJSON",jO(null)),Xr(i,"PRNG",t)):(co(i,"seed",n),co(i,"seedLength",a),LO(i,"state",v,g),co(i,"stateLength",u),co(i,"byteLength",o),Xr(i,"toJSON",c),Xr(i,"PRNG",t),t=t.normalized),i;function n(){return t.seed}function a(){return t.seedLength}function u(){return t.stateLength}function o(){return t.byteLength}function v(){return t.state}function g(h){t.state=h}function c(){var h={};return h.type="PRNG",h.name=i.NAME,h.state=Uae(t.state),r===void 0?h.params=[]:h.params=[r],h}function l(){return MO(t,r)}function m(h){return Jae(h)||h<=0?NaN:MO(t,h)}}xO.exports=Cae});var GO=s(function(t4e,AO){"use strict";var Bae=Rl(),Dae=Bae();AO.exports=Dae});var dn=s(function(i4e,FO){"use strict";var Xae=require("@stdlib/utils/define-nonenumerable-read-only-property"),VO=GO(),Yae=Rl();Xae(VO,"factory",Yae);FO.exports=VO});var Pl=s(function(n4e,WO){"use strict";var Hae=Fr(),Zae=require("@stdlib/array/dtypes"),Qae=require("@stdlib/array/defaults"),$ae=dn(),Kae=Zae("real_floating_point_and_generic"),ese=Hae($ae,Kae,Qae.get("dtypes.real_floating_point"));WO.exports=ese});var kO=s(function(a4e,IO){"use strict";var rse=Pl(),tse=rse();IO.exports=tse});var UO=s(function(s4e,JO){"use strict";var ise=require("@stdlib/utils/define-nonenumerable-read-only-property"),zO=kO(),nse=Pl();ise(zO,"factory",nse);JO.exports=zO});var XO=s(function(u4e,DO){"use strict";var CO=require("@stdlib/assert/is-positive-number").isPrimitive,BO=require("@stdlib/string/format");function ase(r,e){return CO(r)?CO(e)?null:new TypeError(BO("invalid argument. Second argument must be a positive number. Value: `%s`.",e)):new TypeError(BO("invalid argument. First argument must be a positive number. Value: `%s`.",r))}DO.exports=ase});var HO=s(function(o4e,YO){"use strict";function sse(r,e,t){var i=r(e)/e,n=r(t)/t;return i/n}YO.exports=sse});var Tl=s(function(v4e,iE){"use strict";var bt=require("@stdlib/utils/define-nonenumerable-read-only-property"),po=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),ZO=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),QO=require("@stdlib/assert/is-plain-object"),$O=require("@stdlib/assert/is-function"),KO=require("@stdlib/assert/has-own-property"),eE=require("@stdlib/utils/constant-function"),use=require("@stdlib/utils/noop"),Sa=Xe().factory,rE=require("@stdlib/math/base/assert/is-nan"),ose=require("@stdlib/array/to-json"),yo=require("@stdlib/string/format"),vse=XO(),tE=HO();function gse(){var r,e,t,i,n,a,u;if(arguments.length===0)r=Sa();else if(arguments.length===1){if(e=arguments[0],!QO(e))throw new TypeError(yo("invalid argument. Options argument must be an object. Value: `%s`.",e));if(KO(e,"prng")){if(!$O(e.prng))throw new TypeError(yo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));r=Sa({prng:e.prng})}else r=Sa(e)}else{if(a=arguments[0],u=arguments[1],n=vse(a,u),n)throw n;if(arguments.length>2){if(e=arguments[2],!QO(e))throw new TypeError(yo("invalid argument. Options argument must be an object. Value: `%s`.",e));if(KO(e,"prng")){if(!$O(e.prng))throw new TypeError(yo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));r=Sa({prng:e.prng})}else r=Sa(e)}else r=Sa()}return a===void 0?i=d:i=p,t=r.PRNG,bt(i,"NAME","f"),e&&e.prng?(bt(i,"seed",null),bt(i,"seedLength",null),ZO(i,"state",eE(null),use),bt(i,"stateLength",null),bt(i,"byteLength",null),bt(i,"toJSON",eE(null))):(po(i,"seed",o),po(i,"seedLength",v),ZO(i,"state",l,m),po(i,"stateLength",g),po(i,"byteLength",c),bt(i,"toJSON",h)),bt(i,"PRNG",t),i;function o(){return t.seed}function v(){return t.seedLength}function g(){return t.stateLength}function c(){return t.byteLength}function l(){return t.state}function m(f){t.state=f}function h(){var f={};return f.type="PRNG",f.name=i.NAME,f.state=ose(t.state),a===void 0?f.params=[]:f.params=[a,u],f}function p(){return tE(r,a,u)}function d(f,y){return rE(f)||rE(y)||f<=0||y<=0?NaN:tE(r,f,y)}}iE.exports=gse});var aE=s(function(g4e,nE){"use strict";var fse=Tl(),dse=fse();nE.exports=dse});var Oa=s(function(f4e,uE){"use strict";var lse=require("@stdlib/utils/define-nonenumerable-read-only-property"),sE=aE(),cse=Tl();lse(sE,"factory",cse);uE.exports=sE});var jl=s(function(d4e,oE){"use strict";var mse=F(),hse=require("@stdlib/array/dtypes"),pse=require("@stdlib/array/defaults"),yse=Oa(),qse=hse("real_floating_point_and_generic"),bse=mse(yse,qse,pse.get("dtypes.real_floating_point"));oE.exports=bse});var gE=s(function(l4e,vE){"use strict";var wse=jl(),Sse=wse();vE.exports=Sse});var lE=s(function(c4e,dE){"use strict";var Ose=require("@stdlib/utils/define-nonenumerable-read-only-property"),fE=gE(),Ese=jl();Ose(fE,"factory",Ese);dE.exports=fE});var hE=s(function(m4e,mE){"use strict";var _se=require("@stdlib/assert/is-plain-object"),Nse=require("@stdlib/assert/has-own-property"),Lse=require("@stdlib/array/base/assert/contains"),cE=require("@stdlib/string/format");function Rse(r,e,t){return _se(t)?Nse(t,"dtype")&&(r.dtype=t.dtype,!Lse(e,r.dtype))?new TypeError(cE('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",e.join('", "'),r.dtype)):null:new TypeError(cE("invalid argument. Options argument must be an object. Value: `%s`.",t))}mE.exports=Rse});var bE=s(function(h4e,qE){"use strict";var pE=require("@stdlib/utils/define-nonenumerable-read-only-property"),Pse=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Tse=require("@stdlib/assert/is-function"),jse=require("@stdlib/assert/is-string-array").primitives,Mse=require("@stdlib/assert/is-collection"),xse=require("@stdlib/array/base/assert/contains"),Ase=require("@stdlib/array/base/filled-by"),yE=require("@stdlib/strided/base/ternary"),Gse=require("@stdlib/array/ctors"),Hs=require("@stdlib/string/format"),Vse=hE();function Zs(r,e,t){if(!(this instanceof Zs))return new Zs(r,e,t);if(!Tse(r))throw new TypeError(Hs("invalid argument. First argument must be a function. Value: `%s`.",r));if(!jse(e))throw new TypeError(Hs("invalid argument. Second argument must be an array of strings. Value: `%s`.",e));if(!xse(e,t))throw new TypeError(Hs("invalid argument. Third argument must be a supported data type. Value: `%s`.",t));return this._prng=r,this._dtypes=e,this._dtype=t,this}pE(Zs.prototype,"generate",function(e,t,i,n,a){var u,o,v,g,c,l;if(!Pse(e))throw new TypeError(Hs("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",e));if(o={},arguments.length>4&&(c=Vse(o,this._dtypes,a),c))throw c;if(v=this._prng,l=o.dtype||this._dtype,l==="generic")return Ase(e,m);return u=Gse(l),g=new u(e),yE([[t],[i],[n],g],[e],[0,0,0,1],v),g;function m(){return v(t,i,n)}});pE(Zs.prototype,"assign",function(e,t,i,n){if(!Mse(n))throw new TypeError(Hs("invalid argument. Third argument must be an array-like object. Value: `%s`.",n));return yE([[e],[t],[i],n],[n.length],[0,0,0,1],this._prng),n});qE.exports=Zs});var SE=s(function(p4e,wE){"use strict";var Fse=bE();wE.exports=Fse});var NE=s(function(y4e,_E){"use strict";var OE=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),qo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Ea=require("@stdlib/utils/define-nonenumerable-read-only-property"),Wse=require("@stdlib/assert/is-string-array").primitives,Ise=require("@stdlib/assert/is-function"),kse=require("@stdlib/assert/is-method-in"),zse=require("@stdlib/assert/has-own-property"),EE=require("@stdlib/array/base/assert/contains").factory,Jse=require("@stdlib/utils/constant-function"),Use=require("@stdlib/utils/noop"),Cse=SE(),Bse=Nu(),Qs=require("@stdlib/string/format");function Dse(r,e,t){var i;if(!Ise(r))throw new TypeError(Qs("invalid argument. First argument must be a function. Value: `%s`.",r));if(!kse(r,"factory"))throw new TypeError(Qs("invalid argument. First argument must have a `%s` method.","factory"));if(!Wse(e))throw new TypeError(Qs("invalid argument. Second argument must an array of strings. Value: `%s`.",e));if(!EE(e,t))throw new TypeError(Qs("invalid argument. Third argument must be a supported data type. Value: `%s`.",t));return i=EE(e),n;function n(){var a,u,o,v,g,c,l,m,h,p,d;if(l=arguments.length,l<1?(h={},m=r,p=f):l===1?(h=arguments[0],m=r.factory(h),p=f):l===3?(o=arguments[0],v=arguments[1],g=arguments[2],h={},m=r.factory(o,v,g),p=y):(o=arguments[0],v=arguments[1],g=arguments[2],h=arguments[3],m=r.factory(o,v,g,h),p=y),zse(h,"dtype")){if(d=h.dtype,!i(d))throw new TypeError(Qs('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",e.join('", "'),d))}else d=t;return p===f?(c=q,a=Cse):(c=b,a=Bse),u=new a(m,e,d),h&&h.prng?(Ea(p,"seed",null),Ea(p,"seedLength",null),OE(p,"state",Jse(null),Use),Ea(p,"stateLength",null),Ea(p,"byteLength",null)):(qo(p,"seed",w),qo(p,"seedLength",S),OE(p,"state",x,V),qo(p,"stateLength",W),qo(p,"byteLength",J)),Ea(p,"PRNG",m.PRNG),Ea(p,"assign",c),p;function f(A,G,Ue,_u,G$){return arguments.length<5?u.generate(A,G,Ue,_u):u.generate(A,G,Ue,_u,G$)}function y(A,G){return arguments.length<2?u.generate(A):u.generate(A,G)}function q(A,G,Ue,_u){return u.assign(A,G,Ue,_u)}function b(A){return u.assign(A)}function w(){return p.PRNG.seed}function S(){return p.PRNG.seedLength}function W(){return p.PRNG.stateLength}function J(){return p.PRNG.byteLength}function x(){return p.PRNG.state}function V(A){p.PRNG.state=A}}}_E.exports=Dse});var bo=s(function(q4e,LE){"use strict";var Xse=NE();LE.exports=Xse});var TE=s(function(b4e,PE){"use strict";var RE=require("@stdlib/assert/is-positive-number").isPrimitive,Yse=require("@stdlib/assert/is-number").isPrimitive,Ml=require("@stdlib/assert/is-nan"),xl=require("@stdlib/string/format");function Hse(r,e,t){return!RE(r)||Ml(r)?new TypeError(xl("invalid argument. First argument must be a positive number and not NaN. Value: `%s`.",r)):!RE(e)||Ml(e)?new TypeError(xl("invalid argument. Second argument must be a positive number and not NaN. Value: `%s`.",e)):!Yse(t)||Ml(t)?new TypeError(xl("invalid argument. Third argument must be a number and not NaN. Value: `%s`.",t)):null}PE.exports=Hse});var ME=s(function(w4e,jE){"use strict";var Zse=require("@stdlib/math/base/special/pow"),Qse=require("@stdlib/math/base/special/ln");function $se(r,e,t,i){return i+t*Zse(-Qse(r()),-1/e)}jE.exports=$se});var Gl=s(function(S4e,IE){"use strict";var Yr=require("@stdlib/utils/define-nonenumerable-read-only-property"),wo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),xE=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),AE=require("@stdlib/assert/is-plain-object"),GE=require("@stdlib/assert/is-function"),VE=require("@stdlib/assert/has-own-property"),FE=require("@stdlib/utils/constant-function"),Kse=require("@stdlib/utils/noop"),So=T().factory,Al=require("@stdlib/math/base/assert/is-nan"),eue=require("@stdlib/array/to-json"),Oo=require("@stdlib/string/format"),rue=TE(),WE=ME();function tue(){var r,e,t,i,n,a,u;if(arguments.length===0)t=So();else if(arguments.length===1){if(e=arguments[0],!AE(e))throw new TypeError(Oo("invalid argument. Options argument must be an object. Value: `%s`.",e));if(VE(e,"prng")){if(!GE(e.prng))throw new TypeError(Oo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));t=e.prng}else t=So(e)}else{if(r=arguments[0],a=arguments[1],u=arguments[2],n=rue(r,a,u),n)throw n;if(arguments.length>3){if(e=arguments[3],!AE(e))throw new TypeError(Oo("invalid argument. Options argument must be an object. Value: `%s`.",e));if(VE(e,"prng")){if(!GE(e.prng))throw new TypeError(Oo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));t=e.prng}else t=So(e)}else t=So()}return r===void 0?i=d:i=p,Yr(i,"NAME","frechet"),e&&e.prng?(Yr(i,"seed",null),Yr(i,"seedLength",null),xE(i,"state",FE(null),Kse),Yr(i,"stateLength",null),Yr(i,"byteLength",null),Yr(i,"toJSON",FE(null)),Yr(i,"PRNG",t)):(wo(i,"seed",o),wo(i,"seedLength",v),xE(i,"state",l,m),wo(i,"stateLength",g),wo(i,"byteLength",c),Yr(i,"toJSON",h),Yr(i,"PRNG",t),t=t.normalized),i;function o(){return t.seed}function v(){return t.seedLength}function g(){return t.stateLength}function c(){return t.byteLength}function l(){return t.state}function m(f){t.state=f}function h(){var f={};return f.type="PRNG",f.name=i.NAME,f.state=eue(t.state),r===void 0?f.params=[]:f.params=[r,a,u],f}function p(){return WE(t,r,a,u)}function d(f,y,q){return Al(f)||Al(y)||Al(q)||f<=0||y<=0?NaN:WE(t,f,y,q)}}IE.exports=tue});var zE=s(function(O4e,kE){"use strict";var iue=Gl(),nue=iue();kE.exports=nue});var _a=s(function(E4e,UE){"use strict";var aue=require("@stdlib/utils/define-nonenumerable-read-only-property"),JE=zE(),sue=Gl();aue(JE,"factory",sue);UE.exports=JE});var Vl=s(function(_4e,CE){"use strict";var uue=bo(),oue=require("@stdlib/array/dtypes"),vue=require("@stdlib/array/defaults"),gue=_a(),fue=oue("real_floating_point_and_generic"),due=uue(gue,fue,vue.get("dtypes.real_floating_point"));CE.exports=due});var DE=s(function(N4e,BE){"use strict";var lue=Vl(),cue=lue();BE.exports=cue});var HE=s(function(L4e,YE){"use strict";var mue=require("@stdlib/utils/define-nonenumerable-read-only-property"),XE=DE(),hue=Vl();mue(XE,"factory",hue);YE.exports=XE});var Fl=s(function(R4e,ZE){"use strict";var pue=F(),yue=require("@stdlib/array/dtypes"),que=require("@stdlib/array/defaults"),bue=Ce(),wue=yue("real_floating_point_and_generic"),Sue=pue(bue,wue,que.get("dtypes.real_floating_point"));ZE.exports=Sue});var $E=s(function(P4e,QE){"use strict";var Oue=Fl(),Eue=Oue();QE.exports=Eue});var r_=s(function(T4e,e_){"use strict";var _ue=require("@stdlib/utils/define-nonenumerable-read-only-property"),KE=$E(),Nue=Fl();_ue(KE,"factory",Nue);e_.exports=KE});var n_=s(function(j4e,i_){"use strict";var Lue=require("@stdlib/math/base/special/floor"),t_=require("@stdlib/math/base/special/ln");function Rue(r,e){var t=r();return t===0&&(t=r()),Lue(t_(t)/t_(1-e))}i_.exports=Rue});var Wl=s(function(M4e,f_){"use strict";var Hr=require("@stdlib/utils/define-nonenumerable-read-only-property"),Eo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),a_=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),s_=require("@stdlib/assert/is-plain-object"),Pue=require("@stdlib/assert/is-probability").isPrimitive,u_=require("@stdlib/assert/is-function"),o_=require("@stdlib/assert/has-own-property"),v_=require("@stdlib/utils/constant-function"),Tue=require("@stdlib/utils/noop"),_o=T().factory,jue=require("@stdlib/math/base/assert/is-nan"),Mue=require("@stdlib/array/to-json"),No=require("@stdlib/string/format"),g_=n_();function xue(){var r,e,t,i;if(arguments.length===0)e=_o();else if(arguments.length===1&&s_(arguments[0]))if(r=arguments[0],o_(r,"prng")){if(!u_(r.prng))throw new TypeError(No("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=_o(r);else{if(i=arguments[0],!Pue(i))throw new TypeError(No("invalid argument. First argument must be a probability. Value: `%s`.",i));if(arguments.length>1){if(r=arguments[1],!s_(r))throw new TypeError(No("invalid argument. Options argument must be an object. Value: `%s`.",r));if(o_(r,"prng")){if(!u_(r.prng))throw new TypeError(No("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=_o(r)}else e=_o()}return i===void 0?t=m:t=l,Hr(t,"NAME","geometric"),r&&r.prng?(Hr(t,"seed",null),Hr(t,"seedLength",null),a_(t,"state",v_(null),Tue),Hr(t,"stateLength",null),Hr(t,"byteLength",null),Hr(t,"toJSON",v_(null)),Hr(t,"PRNG",e)):(Eo(t,"seed",n),Eo(t,"seedLength",a),a_(t,"state",v,g),Eo(t,"stateLength",u),Eo(t,"byteLength",o),Hr(t,"toJSON",c),Hr(t,"PRNG",e),e=e.normalized),t;function n(){return e.seed}function a(){return e.seedLength}function u(){return e.stateLength}function o(){return e.byteLength}function v(){return e.state}function g(h){e.state=h}function c(){var h={};return h.type="PRNG",h.name=t.NAME,h.state=Mue(e.state),i===void 0?h.params=[]:h.params=[i],h}function l(){return g_(e,i)}function m(h){return jue(h)||h<0||h>1?NaN:g_(e,h)}}f_.exports=xue});var l_=s(function(x4e,d_){"use strict";var Aue=Wl(),Gue=Aue();d_.exports=Gue});var ln=s(function(A4e,m_){"use strict";var Vue=require("@stdlib/utils/define-nonenumerable-read-only-property"),c_=l_(),Fue=Wl();Vue(c_,"factory",Fue);m_.exports=c_});var Il=s(function(G4e,h_){"use strict";var Wue=Fr(),Iue=require("@stdlib/array/dtypes"),kue=require("@stdlib/array/defaults"),zue=ln(),Jue=Iue("real_and_generic"),Uue=Wue(zue,Jue,kue.get("dtypes.real"));h_.exports=Uue});var y_=s(function(V4e,p_){"use strict";var Cue=Il(),Bue=Cue();p_.exports=Bue});var w_=s(function(F4e,b_){"use strict";var Due=require("@stdlib/utils/define-nonenumerable-read-only-property"),q_=y_(),Xue=Il();Due(q_,"factory",Xue);b_.exports=q_});var E_=s(function(W4e,O_){"use strict";var Yue=require("@stdlib/assert/is-number").isPrimitive,Hue=require("@stdlib/assert/is-positive-number").isPrimitive,S_=require("@stdlib/string/format"),Zue=require("@stdlib/assert/is-nan");function Que(r,e){return!Yue(r)||Zue(r)?new TypeError(S_("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):Hue(e)?null:new TypeError(S_("invalid argument. Second argument must be a positive number. Value: `%s`.",e))}O_.exports=Que});var L_=s(function(I4e,N_){"use strict";var __=require("@stdlib/math/base/special/ln");function $ue(r,e,t){return e-t*__(-__(r()))}N_.exports=$ue});var kl=s(function(k4e,G_){"use strict";var Zr=require("@stdlib/utils/define-nonenumerable-read-only-property"),Lo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),R_=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),P_=require("@stdlib/assert/is-plain-object"),T_=require("@stdlib/assert/is-function"),j_=require("@stdlib/assert/has-own-property"),M_=require("@stdlib/utils/constant-function"),Kue=require("@stdlib/utils/noop"),Ro=T().factory,x_=require("@stdlib/math/base/assert/is-nan"),eoe=require("@stdlib/array/to-json"),Po=require("@stdlib/string/format"),roe=E_(),A_=L_();function toe(){var r,e,t,i,n,a;if(arguments.length===0)t=Ro();else if(arguments.length===1){if(e=arguments[0],!P_(e))throw new TypeError(Po("invalid argument. Options argument must be an object. Value: `%s`.",e));if(j_(e,"prng")){if(!T_(e.prng))throw new TypeError(Po("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));t=e.prng}else t=Ro(e)}else{if(a=arguments[0],r=arguments[1],n=roe(a,r),n)throw n;if(arguments.length>2){if(e=arguments[2],!P_(e))throw new TypeError(Po("invalid argument. Options argument must be an object. Value: `%s`.",e));if(j_(e,"prng")){if(!T_(e.prng))throw new TypeError(Po("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));t=e.prng}else t=Ro(e)}else t=Ro()}return a===void 0?i=p:i=h,Zr(i,"NAME","gumbel"),e&&e.prng?(Zr(i,"seed",null),Zr(i,"seedLength",null),R_(i,"state",M_(null),Kue),Zr(i,"stateLength",null),Zr(i,"byteLength",null),Zr(i,"toJSON",M_(null)),Zr(i,"PRNG",t)):(Lo(i,"seed",u),Lo(i,"seedLength",o),R_(i,"state",c,l),Lo(i,"stateLength",v),Lo(i,"byteLength",g),Zr(i,"toJSON",m),Zr(i,"PRNG",t),t=t.normalized),i;function u(){return t.seed}function o(){return t.seedLength}function v(){return t.stateLength}function g(){return t.byteLength}function c(){return t.state}function l(d){t.state=d}function m(){var d={};return d.type="PRNG",d.name=i.NAME,d.state=eoe(t.state),a===void 0?d.params=[]:d.params=[a,r],d}function h(){return A_(t,a,r)}function p(d,f){return x_(d)||x_(f)||f<=0?NaN:A_(t,d,f)}}G_.exports=toe});var F_=s(function(z4e,V_){"use strict";var ioe=kl(),noe=ioe();V_.exports=noe});var Na=s(function(J4e,I_){"use strict";var aoe=require("@stdlib/utils/define-nonenumerable-read-only-property"),W_=F_(),soe=kl();aoe(W_,"factory",soe);I_.exports=W_});var zl=s(function(U4e,k_){"use strict";var uoe=F(),ooe=require("@stdlib/array/dtypes"),voe=require("@stdlib/array/defaults"),goe=Na(),foe=ooe("real_floating_point_and_generic"),doe=uoe(goe,foe,voe.get("dtypes.real_floating_point"));k_.exports=doe});var J_=s(function(C4e,z_){"use strict";var loe=zl(),coe=loe();z_.exports=coe});var B_=s(function(B4e,C_){"use strict";var moe=require("@stdlib/utils/define-nonenumerable-read-only-property"),U_=J_(),hoe=zl();moe(U_,"factory",hoe);C_.exports=U_});var X_=s(function(D4e,D_){"use strict";var Jl=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,$s=require("@stdlib/string/format");function poe(r,e,t){return Jl(r)?Jl(e)?Jl(t)?t>r?new RangeError($s("invalid argument. Third argument must be less than or equal to the first argument. Value: `%u`.",t)):e>r?new RangeError($s("invalid argument. Second argument must be less than or equal to the first argument. Value: `%u`.",e)):null:new TypeError($s("invalid argument. Third argument must be a nonnegative integer. Value: `%s`.",t)):new TypeError($s("invalid argument. Second argument must be a nonnegative integer. Value: `%s`.",e)):new TypeError($s("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",r))}D_.exports=poe});var H_=s(function(X4e,Y_){"use strict";var wt=require("@stdlib/math/base/special/factorial");function yoe(r,e,t,i){var n,a,u;for(in;)a-=n,n*=(e-u)*(i-u)/((u+1)*(t-i+1+u)),u+=1;return u}Y_.exports=yoe});var Q_=s(function(Y4e,Z_){"use strict";var To=H_();function qoe(r,e,t,i){var n,a,u,o;return i>e/2?(u=e-i,2*t<=e?(n=t,a=e-t,o=To(r,n,a,u),t-o):(a=t,n=e-t,o=To(r,n,a,u),i-e+t+o)):(u=i,2*t<=e?(n=t,a=e-t,o=To(r,n,a,u),o):(n=e-t,a=t,o=To(r,n,a,u),i-o))}Z_.exports=qoe});var Cl=s(function(H4e,aN){"use strict";var Qr=require("@stdlib/utils/define-nonenumerable-read-only-property"),jo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),$_=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),K_=require("@stdlib/assert/is-plain-object"),eN=require("@stdlib/assert/is-function"),rN=require("@stdlib/assert/has-own-property"),tN=require("@stdlib/utils/constant-function"),boe=require("@stdlib/utils/noop"),Mo=T().factory,Ul=require("@stdlib/math/base/assert/is-nonnegative-integer"),iN=require("@stdlib/constants/float64/pinf"),woe=require("@stdlib/array/to-json"),xo=require("@stdlib/string/format"),Soe=X_(),nN=Q_();function Ooe(){var r,e,t,i,n,a,u;if(arguments.length===0)e=Mo();else if(arguments.length===1){if(r=arguments[0],!K_(r))throw new TypeError(xo("invalid argument. Options argument must be an object. Value: `%s`.",r));if(rN(r,"prng")){if(!eN(r.prng))throw new TypeError(xo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Mo(r)}else{if(n=arguments[0],a=arguments[1],u=arguments[2],i=Soe(n,a,u),i)throw i;if(arguments.length>3){if(r=arguments[3],!K_(r))throw new TypeError(xo("invalid argument. Options argument must be an object. Value: `%s`.",r));if(rN(r,"prng")){if(!eN(r.prng))throw new TypeError(xo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Mo(r)}else e=Mo()}return n===void 0?t=d:t=p,Qr(t,"NAME","hypergeometric"),r&&r.prng?(Qr(t,"seed",null),Qr(t,"seedLength",null),$_(t,"state",tN(null),boe),Qr(t,"stateLength",null),Qr(t,"byteLength",null),Qr(t,"toJSON",tN(null)),Qr(t,"PRNG",e)):(jo(t,"seed",o),jo(t,"seedLength",v),$_(t,"state",l,m),jo(t,"stateLength",g),jo(t,"byteLength",c),Qr(t,"toJSON",h),Qr(t,"PRNG",e),e=e.normalized),t;function o(){return e.seed}function v(){return e.seedLength}function g(){return e.stateLength}function c(){return e.byteLength}function l(){return e.state}function m(f){e.state=f}function h(){var f={};return f.type="PRNG",f.name=t.NAME,f.state=woe(e.state),n===void 0?f.params=[]:f.params=[n,a,u],f}function p(){return nN(e,n,a,u)}function d(f,y,q){return f===iN||y===iN||!Ul(f)||!Ul(y)||!Ul(q)||q>f?NaN:nN(e,f,y,q)}}aN.exports=Ooe});var uN=s(function(Z4e,sN){"use strict";var Eoe=Cl(),_oe=Eoe();sN.exports=_oe});var La=s(function(Q4e,vN){"use strict";var Noe=require("@stdlib/utils/define-nonenumerable-read-only-property"),oN=uN(),Loe=Cl();Noe(oN,"factory",Loe);vN.exports=oN});var Bl=s(function($4e,gN){"use strict";var Roe=bo(),Poe=require("@stdlib/array/dtypes"),Toe=require("@stdlib/array/defaults"),joe=La(),Moe=Poe("real_and_generic"),xoe=Roe(joe,Moe,Toe.get("dtypes.real"));gN.exports=xoe});var dN=s(function(K4e,fN){"use strict";var Aoe=Bl(),Goe=Aoe();fN.exports=Goe});var mN=s(function(eHe,cN){"use strict";var Voe=require("@stdlib/utils/define-nonenumerable-read-only-property"),lN=dN(),Foe=Bl();Voe(lN,"factory",Foe);cN.exports=lN});var qN=s(function(rHe,yN){"use strict";var hN=require("@stdlib/assert/is-positive-number").isPrimitive,pN=require("@stdlib/string/format");function Woe(r,e){return hN(r)?hN(e)?null:new TypeError(pN("invalid argument. Second argument must be a positive number. Value: `%s`.",e)):new TypeError(pN("invalid argument. First argument must be a positive number. Value: `%s`.",r))}yN.exports=Woe});var Dl=s(function(tHe,NN){"use strict";var St=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ao=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),bN=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),wN=require("@stdlib/assert/is-plain-object"),SN=require("@stdlib/assert/is-function"),ON=require("@stdlib/assert/has-own-property"),EN=require("@stdlib/utils/constant-function"),Ioe=require("@stdlib/utils/noop"),Ra=Ce().factory,_N=require("@stdlib/math/base/assert/is-nan"),koe=require("@stdlib/array/to-json"),Go=require("@stdlib/string/format"),zoe=qN();function Joe(){var r,e,t,i,n,a,u;if(arguments.length===0)r=Ra();else if(arguments.length===1){if(i=arguments[0],!wN(i))throw new TypeError(Go("invalid argument. Options argument must be an object. Value: `%s`.",i));if(ON(i,"prng")){if(!SN(i.prng))throw new TypeError(Go("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",i.prng));r=Ra({prng:i.prng})}else r=Ra(i)}else{if(e=arguments[0],t=arguments[1],u=zoe(e,t),u)throw u;if(arguments.length>2){if(i=arguments[2],!wN(i))throw new TypeError(Go("invalid argument. Options argument must be an object. Value: `%s`.",i));if(ON(i,"prng")){if(!SN(i.prng))throw new TypeError(Go("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",i.prng));r=Ra(e,t,{prng:i.prng})}else r=Ra(e,t,i)}else r=Ra(e,t)}return e===void 0?a=d:a=p,n=r.PRNG,St(a,"NAME","invgamma"),i&&i.prng?(St(a,"seed",null),St(a,"seedLength",null),bN(a,"state",EN(null),Ioe),St(a,"stateLength",null),St(a,"byteLength",null),St(a,"toJSON",EN(null))):(Ao(a,"seed",o),Ao(a,"seedLength",v),bN(a,"state",l,m),Ao(a,"stateLength",g),Ao(a,"byteLength",c),St(a,"toJSON",h)),St(a,"PRNG",n),a;function o(){return n.seed}function v(){return n.seedLength}function g(){return n.stateLength}function c(){return n.byteLength}function l(){return n.state}function m(f){n.state=f}function h(){var f={};return f.type="PRNG",f.name=a.NAME,f.state=koe(n.state),e===void 0?f.params=[]:f.params=[e,t],f}function p(){return 1/r()}function d(f,y){return _N(f)||_N(y)||f<=0||y<=0?NaN:1/r(f,y)}}NN.exports=Joe});var RN=s(function(iHe,LN){"use strict";var Uoe=Dl(),Coe=Uoe();LN.exports=Coe});var cn=s(function(nHe,TN){"use strict";var Boe=require("@stdlib/utils/define-nonenumerable-read-only-property"),PN=RN(),Doe=Dl();Boe(PN,"factory",Doe);TN.exports=PN});var Xl=s(function(aHe,jN){"use strict";var Xoe=F(),Yoe=require("@stdlib/array/dtypes"),Hoe=require("@stdlib/array/defaults"),Zoe=cn(),Qoe=Yoe("real_floating_point_and_generic"),$oe=Xoe(Zoe,Qoe,Hoe.get("dtypes.real_floating_point"));jN.exports=$oe});var xN=s(function(sHe,MN){"use strict";var Koe=Xl(),eve=Koe();MN.exports=eve});var VN=s(function(uHe,GN){"use strict";var rve=require("@stdlib/utils/define-nonenumerable-read-only-property"),AN=xN(),tve=Xl();rve(AN,"factory",tve);GN.exports=AN});var kN=s(function(oHe,IN){"use strict";var FN=require("@stdlib/assert/is-positive-number").isPrimitive,WN=require("@stdlib/string/format");function ive(r,e){return FN(r)?FN(e)?null:new TypeError(WN("invalid argument. Second argument must be a positive number. Value: `%s`.",e)):new TypeError(WN("invalid argument. First argument must be a positive number. Value: `%s`.",r))}IN.exports=ive});var UN=s(function(vHe,JN){"use strict";var zN=require("@stdlib/math/base/special/pow");function nve(r,e,t){var i=r();return zN(1-zN(1-i,1/t),1/e)}JN.exports=nve});var Yl=s(function(gHe,QN){"use strict";var $r=require("@stdlib/utils/define-nonenumerable-read-only-property"),Vo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),CN=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),BN=require("@stdlib/assert/is-plain-object"),DN=require("@stdlib/assert/is-function"),XN=require("@stdlib/assert/has-own-property"),YN=require("@stdlib/utils/constant-function"),ave=require("@stdlib/utils/noop"),Fo=T().factory,HN=require("@stdlib/math/base/assert/is-nan"),sve=require("@stdlib/array/to-json"),Wo=require("@stdlib/string/format"),uve=kN(),ZN=UN();function ove(){var r,e,t,i,n,a;if(arguments.length===0)e=Fo();else if(arguments.length===1){if(r=arguments[0],!BN(r))throw new TypeError(Wo("invalid argument. Options argument must be an object. Value: `%s`.",r));if(XN(r,"prng")){if(!DN(r.prng))throw new TypeError(Wo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Fo(r)}else{if(n=arguments[0],a=arguments[1],i=uve(n,a),i)throw i;if(arguments.length>2){if(r=arguments[2],!BN(r))throw new TypeError(Wo("invalid argument. Options argument must be an object. Value: `%s`.",r));if(XN(r,"prng")){if(!DN(r.prng))throw new TypeError(Wo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Fo(r)}else e=Fo()}return n===void 0?t=p:t=h,$r(t,"NAME","kumaraswamy"),r&&r.prng?($r(t,"seed",null),$r(t,"seedLength",null),CN(t,"state",YN(null),ave),$r(t,"stateLength",null),$r(t,"byteLength",null),$r(t,"toJSON",YN(null)),$r(t,"PRNG",e)):(Vo(t,"seed",u),Vo(t,"seedLength",o),CN(t,"state",c,l),Vo(t,"stateLength",v),Vo(t,"byteLength",g),$r(t,"toJSON",m),$r(t,"PRNG",e),e=e.normalized),t;function u(){return e.seed}function o(){return e.seedLength}function v(){return e.stateLength}function g(){return e.byteLength}function c(){return e.state}function l(d){e.state=d}function m(){var d={};return d.type="PRNG",d.name=t.NAME,d.state=sve(e.state),n===void 0?d.params=[]:d.params=[n,a],d}function h(){return ZN(e,n,a)}function p(d,f){return HN(d)||HN(f)||d<=0||f<=0?NaN:ZN(e,d,f)}}QN.exports=ove});var KN=s(function(fHe,$N){"use strict";var vve=Yl(),gve=vve();$N.exports=gve});var Pa=s(function(dHe,rL){"use strict";var fve=require("@stdlib/utils/define-nonenumerable-read-only-property"),eL=KN(),dve=Yl();fve(eL,"factory",dve);rL.exports=eL});var Hl=s(function(lHe,tL){"use strict";var lve=F(),cve=require("@stdlib/array/dtypes"),mve=require("@stdlib/array/defaults"),hve=Pa(),pve=cve("real_floating_point_and_generic"),yve=lve(hve,pve,mve.get("dtypes.real_floating_point"));tL.exports=yve});var nL=s(function(cHe,iL){"use strict";var qve=Hl(),bve=qve();iL.exports=bve});var uL=s(function(mHe,sL){"use strict";var wve=require("@stdlib/utils/define-nonenumerable-read-only-property"),aL=nL(),Sve=Hl();wve(aL,"factory",Sve);sL.exports=aL});var gL=s(function(hHe,vL){"use strict";var Ove=require("@stdlib/assert/is-number").isPrimitive,Eve=require("@stdlib/assert/is-positive-number").isPrimitive,oL=require("@stdlib/string/format"),_ve=require("@stdlib/assert/is-nan");function Nve(r,e){return!Ove(r)||_ve(r)?new TypeError(oL("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):Eve(e)?null:new TypeError(oL("invalid argument. Second argument must be a positive number. Value: `%s`.",e))}vL.exports=Nve});var dL=s(function(pHe,fL){"use strict";var Lve=require("@stdlib/math/base/special/signum"),Rve=require("@stdlib/math/base/special/abs"),Pve=require("@stdlib/math/base/special/ln");function Tve(r,e,t){var i=r()-.5;return e-t*Lve(i)*Pve(1-2*Rve(i))}fL.exports=Tve});var Zl=s(function(yHe,bL){"use strict";var Kr=require("@stdlib/utils/define-nonenumerable-read-only-property"),Io=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),lL=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),cL=require("@stdlib/assert/is-plain-object"),mL=require("@stdlib/assert/is-function"),hL=require("@stdlib/assert/has-own-property"),pL=require("@stdlib/utils/constant-function"),jve=require("@stdlib/utils/noop"),ko=T().factory,yL=require("@stdlib/math/base/assert/is-nan"),Mve=require("@stdlib/array/to-json"),zo=require("@stdlib/string/format"),xve=gL(),qL=dL();function Ave(){var r,e,t,i,n,a;if(arguments.length===0)e=ko();else if(arguments.length===1){if(r=arguments[0],!cL(r))throw new TypeError(zo("invalid argument. Options argument must be an object. Value: `%s`.",r));if(hL(r,"prng")){if(!mL(r.prng))throw new TypeError(zo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=ko(r)}else{if(n=arguments[0],a=arguments[1],i=xve(n,a),i)throw i;if(arguments.length>2){if(r=arguments[2],!cL(r))throw new TypeError(zo("invalid argument. Options argument must be an object. Value: `%s`.",r));if(hL(r,"prng")){if(!mL(r.prng))throw new TypeError(zo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=ko(r)}else e=ko()}return n===void 0?t=p:t=h,Kr(t,"NAME","laplace"),r&&r.prng?(Kr(t,"seed",null),Kr(t,"seedLength",null),lL(t,"state",pL(null),jve),Kr(t,"stateLength",null),Kr(t,"byteLength",null),Kr(t,"toJSON",pL(null)),Kr(t,"PRNG",e)):(Io(t,"seed",u),Io(t,"seedLength",o),lL(t,"state",c,l),Io(t,"stateLength",v),Io(t,"byteLength",g),Kr(t,"toJSON",m),Kr(t,"PRNG",e),e=e.normalized),t;function u(){return e.seed}function o(){return e.seedLength}function v(){return e.stateLength}function g(){return e.byteLength}function c(){return e.state}function l(d){e.state=d}function m(){var d={};return d.type="PRNG",d.name=t.NAME,d.state=Mve(e.state),n===void 0?d.params=[]:d.params=[n,a],d}function h(){return qL(e,n,a)}function p(d,f){return yL(d)||yL(f)||f<=0?NaN:qL(e,d,f)}}bL.exports=Ave});var SL=s(function(qHe,wL){"use strict";var Gve=Zl(),Vve=Gve();wL.exports=Vve});var Ta=s(function(bHe,EL){"use strict";var Fve=require("@stdlib/utils/define-nonenumerable-read-only-property"),OL=SL(),Wve=Zl();Fve(OL,"factory",Wve);EL.exports=OL});var Ql=s(function(wHe,_L){"use strict";var Ive=F(),kve=require("@stdlib/array/dtypes"),zve=require("@stdlib/array/defaults"),Jve=Ta(),Uve=kve("real_floating_point_and_generic"),Cve=Ive(Jve,Uve,zve.get("dtypes.real_floating_point"));_L.exports=Cve});var LL=s(function(SHe,NL){"use strict";var Bve=Ql(),Dve=Bve();NL.exports=Dve});var TL=s(function(OHe,PL){"use strict";var Xve=require("@stdlib/utils/define-nonenumerable-read-only-property"),RL=LL(),Yve=Ql();Xve(RL,"factory",Yve);PL.exports=RL});var xL=s(function(EHe,ML){"use strict";var Hve=require("@stdlib/assert/is-number").isPrimitive,Zve=require("@stdlib/assert/is-positive-number").isPrimitive,jL=require("@stdlib/string/format"),Qve=require("@stdlib/assert/is-nan");function $ve(r,e){return!Hve(r)||Qve(r)?new TypeError(jL("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):Zve(e)?null:new TypeError(jL("invalid argument. Second argument must be a positive number. Value: `%s`.",e))}ML.exports=$ve});var GL=s(function(_He,AL){"use strict";var Kve=require("@stdlib/stats/base/dists/normal/quantile");function ege(r,e,t){var i=Kve(1-r()/2,0,1);return e+t/(i*i)}AL.exports=ege});var $l=s(function(NHe,UL){"use strict";var et=require("@stdlib/utils/define-nonenumerable-read-only-property"),Jo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),VL=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),FL=require("@stdlib/assert/is-plain-object"),WL=require("@stdlib/assert/is-function"),IL=require("@stdlib/assert/has-own-property"),kL=require("@stdlib/utils/constant-function"),rge=require("@stdlib/utils/noop"),Uo=T().factory,zL=require("@stdlib/math/base/assert/is-nan"),tge=require("@stdlib/array/to-json"),Co=require("@stdlib/string/format"),ige=xL(),JL=GL();function nge(){var r,e,t,i,n,a;if(arguments.length===0)e=Uo();else if(arguments.length===1){if(r=arguments[0],!FL(r))throw new TypeError(Co("invalid argument. Options argument must be an object. Value: `%s`.",r));if(IL(r,"prng")){if(!WL(r.prng))throw new TypeError(Co("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Uo(r)}else{if(n=arguments[0],a=arguments[1],i=ige(n,a),i)throw i;if(arguments.length>2){if(r=arguments[2],!FL(r))throw new TypeError(Co("invalid argument. Options argument must be an object. Value: `%s`.",r));if(IL(r,"prng")){if(!WL(r.prng))throw new TypeError(Co("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Uo(r)}else e=Uo()}return n===void 0?t=p:t=h,et(t,"NAME","levy"),r&&r.prng?(et(t,"seed",null),et(t,"seedLength",null),VL(t,"state",kL(null),rge),et(t,"stateLength",null),et(t,"byteLength",null),et(t,"toJSON",kL(null)),et(t,"PRNG",e)):(Jo(t,"seed",u),Jo(t,"seedLength",o),VL(t,"state",c,l),Jo(t,"stateLength",v),Jo(t,"byteLength",g),et(t,"toJSON",m),et(t,"PRNG",e),e=e.normalized),t;function u(){return e.seed}function o(){return e.seedLength}function v(){return e.stateLength}function g(){return e.byteLength}function c(){return e.state}function l(d){e.state=d}function m(){var d={};return d.type="PRNG",d.name=t.NAME,d.state=tge(e.state),n===void 0?d.params=[]:d.params=[n,a],d}function h(){return JL(e,n,a)}function p(d,f){return zL(d)||zL(f)||f<=0?NaN:JL(e,d,f)}}UL.exports=nge});var BL=s(function(LHe,CL){"use strict";var age=$l(),sge=age();CL.exports=sge});var ja=s(function(RHe,XL){"use strict";var uge=require("@stdlib/utils/define-nonenumerable-read-only-property"),DL=BL(),oge=$l();uge(DL,"factory",oge);XL.exports=DL});var Kl=s(function(PHe,YL){"use strict";var vge=F(),gge=require("@stdlib/array/dtypes"),fge=require("@stdlib/array/defaults"),dge=ja(),lge=gge("real_floating_point_and_generic"),cge=vge(dge,lge,fge.get("dtypes.real_floating_point"));YL.exports=cge});var ZL=s(function(THe,HL){"use strict";var mge=Kl(),hge=mge();HL.exports=hge});var KL=s(function(jHe,$L){"use strict";var pge=require("@stdlib/utils/define-nonenumerable-read-only-property"),QL=ZL(),yge=Kl();pge(QL,"factory",yge);$L.exports=QL});var tR=s(function(MHe,rR){"use strict";var qge=require("@stdlib/assert/is-number").isPrimitive,bge=require("@stdlib/assert/is-positive-number").isPrimitive,wge=require("@stdlib/assert/is-nan"),eR=require("@stdlib/string/format");function Sge(r,e){return!qge(r)||wge(r)?new TypeError(eR("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):bge(e)?null:new TypeError(eR("invalid argument. Second argument must be a positive number. Value: `%s`.",e))}rR.exports=Sge});var nR=s(function(xHe,iR){"use strict";var Oge=require("@stdlib/math/base/special/ln");function Ege(r,e,t){var i=r();return e+t*Oge(i/(1-i))}iR.exports=Ege});var ec=s(function(AHe,dR){"use strict";var rt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Bo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),aR=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),sR=require("@stdlib/assert/is-plain-object"),uR=require("@stdlib/assert/is-function"),oR=require("@stdlib/assert/has-own-property"),vR=require("@stdlib/utils/constant-function"),_ge=require("@stdlib/utils/noop"),Do=T().factory,gR=require("@stdlib/math/base/assert/is-nan"),Nge=require("@stdlib/array/to-json"),Xo=require("@stdlib/string/format"),Lge=tR(),fR=nR();function Rge(){var r,e,t,i,n,a;if(arguments.length===0)e=Do();else if(arguments.length===1){if(r=arguments[0],!sR(r))throw new TypeError(Xo("invalid argument. Options argument must be an object. Value: `%s`.",r));if(oR(r,"prng")){if(!uR(r.prng))throw new TypeError(Xo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Do(r)}else{if(n=arguments[0],a=arguments[1],i=Lge(n,a),i)throw i;if(arguments.length>2){if(r=arguments[2],!sR(r))throw new TypeError(Xo("invalid argument. Options argument must be an object. Value: `%s`.",r));if(oR(r,"prng")){if(!uR(r.prng))throw new TypeError(Xo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Do(r)}else e=Do()}return n===void 0?t=p:t=h,rt(t,"NAME","logistic"),r&&r.prng?(rt(t,"seed",null),rt(t,"seedLength",null),aR(t,"state",vR(null),_ge),rt(t,"stateLength",null),rt(t,"byteLength",null),rt(t,"toJSON",vR(null)),rt(t,"PRNG",e)):(Bo(t,"seed",u),Bo(t,"seedLength",o),aR(t,"state",c,l),Bo(t,"stateLength",v),Bo(t,"byteLength",g),rt(t,"toJSON",m),rt(t,"PRNG",e),e=e.normalized),t;function u(){return e.seed}function o(){return e.seedLength}function v(){return e.stateLength}function g(){return e.byteLength}function c(){return e.state}function l(d){e.state=d}function m(){var d={};return d.type="PRNG",d.name=t.NAME,d.state=Nge(e.state),n===void 0?d.params=[]:d.params=[n,a],d}function h(){return fR(e,n,a)}function p(d,f){return gR(d)||gR(f)||f<=0?NaN:fR(e,d,f)}}dR.exports=Rge});var cR=s(function(GHe,lR){"use strict";var Pge=ec(),Tge=Pge();lR.exports=Tge});var Ma=s(function(VHe,hR){"use strict";var jge=require("@stdlib/utils/define-nonenumerable-read-only-property"),mR=cR(),Mge=ec();jge(mR,"factory",Mge);hR.exports=mR});var rc=s(function(FHe,pR){"use strict";var xge=F(),Age=require("@stdlib/array/dtypes"),Gge=require("@stdlib/array/defaults"),Vge=Ma(),Fge=Age("real_floating_point_and_generic"),Wge=xge(Vge,Fge,Gge.get("dtypes.real_floating_point"));pR.exports=Wge});var qR=s(function(WHe,yR){"use strict";var Ige=rc(),kge=Ige();yR.exports=kge});var SR=s(function(IHe,wR){"use strict";var zge=require("@stdlib/utils/define-nonenumerable-read-only-property"),bR=qR(),Jge=rc();zge(bR,"factory",Jge);wR.exports=bR});var _R=s(function(kHe,ER){"use strict";var Uge=require("@stdlib/assert/is-number").isPrimitive,Cge=require("@stdlib/assert/is-positive-number").isPrimitive,OR=require("@stdlib/string/format"),Bge=require("@stdlib/assert/is-nan");function Dge(r,e){return!Uge(r)||Bge(r)?new TypeError(OR("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):Cge(e)?null:new TypeError(OR("invalid argument. Second argument must be a positive number. Value: `%s`.",e))}ER.exports=Dge});var LR=s(function(zHe,NR){"use strict";var Xge=require("@stdlib/math/base/special/exp");function Yge(r,e,t){return Xge(e+t*r())}NR.exports=Yge});var tc=s(function(JHe,GR){"use strict";var Ot=require("@stdlib/utils/define-nonenumerable-read-only-property"),Yo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),RR=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),PR=require("@stdlib/assert/is-plain-object"),TR=require("@stdlib/assert/is-function"),jR=require("@stdlib/assert/has-own-property"),MR=require("@stdlib/utils/constant-function"),Hge=require("@stdlib/utils/noop"),xa=Q().factory,xR=require("@stdlib/math/base/assert/is-nan"),Zge=require("@stdlib/array/to-json"),Ho=require("@stdlib/string/format"),Qge=_R(),AR=LR();function $ge(){var r,e,t,i,n,a,u;if(arguments.length===0)e=xa();else if(arguments.length===1){if(t=arguments[0],!PR(t))throw new TypeError(Ho("invalid argument. Options argument must be an object. Value: `%s`.",t));if(jR(t,"prng")){if(!TR(t.prng))throw new TypeError(Ho("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",t.prng));e=xa({prng:t.prng})}else e=xa(t)}else{if(u=arguments[0],r=arguments[1],a=Qge(u,r),a)throw a;if(arguments.length>2){if(t=arguments[2],!PR(t))throw new TypeError(Ho("invalid argument. Options argument must be an object. Value: `%s`.",t));if(jR(t,"prng")){if(!TR(t.prng))throw new TypeError(Ho("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",t.prng));e=xa({prng:t.prng})}else e=xa(t)}else e=xa()}return u===void 0?n=d:n=p,i=e.PRNG,Ot(n,"NAME","lognormal"),t&&t.prng?(Ot(n,"seed",null),Ot(n,"seedLength",null),RR(n,"state",MR(null),Hge),Ot(n,"stateLength",null),Ot(n,"byteLength",null),Ot(n,"toJSON",MR(null))):(Yo(n,"seed",o),Yo(n,"seedLength",v),RR(n,"state",l,m),Yo(n,"stateLength",g),Yo(n,"byteLength",c),Ot(n,"toJSON",h)),Ot(n,"PRNG",i),n;function o(){return i.seed}function v(){return i.seedLength}function g(){return i.stateLength}function c(){return i.byteLength}function l(){return i.state}function m(f){i.state=f}function h(){var f={};return f.type="PRNG",f.name=n.NAME,f.state=Zge(i.state),u===void 0?f.params=[]:f.params=[u,r],f}function p(){return AR(e,u,r)}function d(f,y){return xR(f)||xR(y)||y<=0?NaN:AR(e,f,y)}}GR.exports=$ge});var FR=s(function(UHe,VR){"use strict";var Kge=tc(),efe=Kge();VR.exports=efe});var mn=s(function(CHe,IR){"use strict";var rfe=require("@stdlib/utils/define-nonenumerable-read-only-property"),WR=FR(),tfe=tc();rfe(WR,"factory",tfe);IR.exports=WR});var ic=s(function(BHe,kR){"use strict";var ife=F(),nfe=require("@stdlib/array/dtypes"),afe=require("@stdlib/array/defaults"),sfe=mn(),ufe=nfe("real_floating_point_and_generic"),ofe=ife(sfe,ufe,afe.get("dtypes.real_floating_point"));kR.exports=ofe});var JR=s(function(DHe,zR){"use strict";var vfe=ic(),gfe=vfe();zR.exports=gfe});var BR=s(function(XHe,CR){"use strict";var ffe=require("@stdlib/utils/define-nonenumerable-read-only-property"),UR=JR(),dfe=ic();ffe(UR,"factory",dfe);CR.exports=UR});var nc=s(function(YHe,DR){"use strict";var lfe=require("@stdlib/constants/int32/max"),cfe=require("@stdlib/math/base/special/floor"),mfe=lfe-1;function hfe(){var r=cfe(1+mfe*Math.random());return r|0}DR.exports=hfe});var uc=s(function(HHe,QR){"use strict";var tt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Et=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),XR=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),ac=require("@stdlib/assert/has-own-property"),pfe=require("@stdlib/assert/is-plain-object"),yfe=require("@stdlib/assert/is-boolean").isPrimitive,qfe=require("@stdlib/assert/is-collection"),bfe=require("@stdlib/assert/is-positive-integer").isPrimitive,YR=require("@stdlib/assert/is-int32array"),Be=require("@stdlib/string/format"),Zo=require("@stdlib/constants/int32/max"),D=require("@stdlib/array/int32"),Aa=require("@stdlib/blas/base/gcopy"),wfe=require("@stdlib/array/to-json"),HR=nc(),sc=Zo-1|0,Sfe=Zo-1|0,Ofe=16807,Qo=1,$o=2,_t=2,X=4,Ks=5;function ZR(r,e){var t;return e?t="option":t="argument",r.lengthSfe)throw new RangeError(Be("invalid option. `%s` option must be a positive integer less than the maximum signed 32-bit integer. Option: `%u`.","seed",n));n|=0}else if(qfe(n)&&n.length>0)a=n.length,e=new D(Ks+a),e[0]=Qo,e[1]=$o,e[_t]=1,e[X]=a,Aa.ndarray(a,n,1,0,e,1,X+1),t=new D(e.buffer,e.byteOffset+(_t+1)*e.BYTES_PER_ELEMENT,1),n=new D(e.buffer,e.byteOffset+(X+1)*e.BYTES_PER_ELEMENT,a),t[0]=n[0];else throw new TypeError(Be("invalid option. `%s` option must be either a positive integer less than the maximum signed 32-bit integer or an array-like object containing integer values less than the maximum signed 32-bit integer. Option: `%s`.","seed",n));else n=HR()|0}else n=HR()|0;return t===void 0&&(e=new D(Ks+1),e[0]=Qo,e[1]=$o,e[_t]=1,e[X]=1,e[X+1]=n,t=new D(e.buffer,e.byteOffset+(_t+1)*e.BYTES_PER_ELEMENT,1),n=new D(e.buffer,e.byteOffset+(X+1)*e.BYTES_PER_ELEMENT,1),t[0]=n[0]),tt(p,"NAME","minstd"),Et(p,"seed",o),Et(p,"seedLength",v),XR(p,"state",l,m),Et(p,"stateLength",g),Et(p,"byteLength",c),tt(p,"toJSON",h),tt(p,"MIN",1),tt(p,"MAX",Zo-1),tt(p,"normalized",d),tt(d,"NAME",p.NAME),Et(d,"seed",o),Et(d,"seedLength",v),XR(d,"state",l,m),Et(d,"stateLength",g),Et(d,"byteLength",c),tt(d,"toJSON",h),tt(d,"MIN",(p.MIN-1)/sc),tt(d,"MAX",(p.MAX-1)/sc),p;function o(){var f=e[X];return Aa(f,n,1,new D(f),1)}function v(){return e[X]}function g(){return e.length}function c(){return e.byteLength}function l(){var f=e.length;return Aa(f,e,1,new D(f),1)}function m(f){var y;if(!YR(f))throw new TypeError(Be("invalid argument. Must provide an Int32Array. Value: `%s`.",f));if(y=ZR(f,!1),y)throw y;i.copy===!1?i.state&&f.length===e.length?Aa(f.length,f,1,e,1):(e=f,i.state=!0):(f.length!==e.length&&(e=new D(f.length)),Aa(f.length,f,1,e,1)),t=new D(e.buffer,e.byteOffset+(_t+1)*e.BYTES_PER_ELEMENT,1),n=new D(e.buffer,e.byteOffset+(X+1)*e.BYTES_PER_ELEMENT,e[X])}function h(){var f={};return f.type="PRNG",f.name=p.NAME,f.state=wfe(e),f.params=[],f}function p(){var f=t[0]|0;return f=Ofe*f%Zo|0,t[0]=f,f|0}function d(){return(p()-1)/sc}}QR.exports=Efe});var KR=s(function(ZHe,$R){"use strict";var _fe=uc(),Nfe=nc(),Lfe=_fe({seed:Nfe()});$R.exports=Lfe});var $=s(function(QHe,rP){"use strict";var Rfe=require("@stdlib/utils/define-nonenumerable-read-only-property"),eP=KR(),Pfe=uc();Rfe(eP,"factory",Pfe);rP.exports=eP});var tP=s(function($He,Tfe){Tfe.exports={idtype:"float64",ndtype:"float64"}});var nP=s(function(KHe,iP){"use strict";var jfe=require("@stdlib/array/typed-real-float-dtypes"),Mfe=require("@stdlib/array/typed-real-dtypes"),xfe=require("@stdlib/assert/is-plain-object"),Ko=require("@stdlib/assert/has-own-property"),eu=require("@stdlib/string/format"),ru=Mfe(),tu=jfe();ru.push("generic");tu.push("generic");function Afe(r,e,t){if(!xfe(e))return new TypeError(eu("invalid argument. Options argument must be an object. Value: `%s`.",e));if(t===0){if(Ko(e,"idtype")&&(r.idtype=e.idtype,ru.indexOf(r.idtype)<0))return new TypeError(eu('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"idtype",ru.join('", "'),r.idtype));if(Ko(e,"ndtype")&&(r.ndtype=e.ndtype,tu.indexOf(r.ndtype)<0))return new TypeError(eu('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"ndtype",tu.join('", "'),r.ndtype))}else if(t===1&&Ko(e,"dtype")){if(r.dtype=e.dtype,ru.indexOf(r.dtype)<0)return new TypeError(eu('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",ru.join('", "'),r.dtype))}else if(Ko(e,"dtype")&&(r.dtype=e.dtype,tu.indexOf(r.dtype)<0))return new TypeError(eu('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",tu.join('", "'),r.dtype));return null}iP.exports=Afe});var vc=s(function(eZe,lP){"use strict";var aP=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,sP=require("@stdlib/utils/define-nonenumerable-read-only-property"),ev=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Gfe=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),uP=$(),oP=require("@stdlib/array/typed-real-ctors"),vP=require("@stdlib/array/base/filled-by"),gP=require("@stdlib/strided/base/nullary"),fP=require("@stdlib/string/format"),dP=tP(),oc=nP();function Vfe(){var r,e,t,i,n,a;if(t={idtype:dP.idtype,ndtype:dP.ndtype},e=arguments.length,i=u,e===0)n=uP;else if(e===1&&(r=arguments[0],n=uP.factory(r),a=oc(t,r,0),a))throw a;return ev(i,"seed",v),ev(i,"seedLength",g),Gfe(i,"state",m,h),ev(i,"stateLength",c),ev(i,"byteLength",l),sP(i,"PRNG",n),sP(i,"normalized",o),i;function u(p,d){var f,y,q,b,w;if(!aP(p))throw new TypeError(fP("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",p));if(w={},arguments.length>1&&(q=oc(w,d,1),q))throw q;return b=w.dtype||t.idtype,b==="generic"?vP(p,n):(f=oP(b),y=new f(p),gP([y],[p],[1],n),y)}function o(p,d){var f,y,q,b,w;if(!aP(p))throw new TypeError(fP("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",p));if(w={},arguments.length>1&&(q=oc(w,d,2),q))throw q;return b=w.dtype||t.ndtype,b==="generic"?vP(p,n.normalized):(f=oP(b),y=new f(p),gP([y],[p],[1],n.normalized),y)}function v(){return i.PRNG.seed}function g(){return i.PRNG.seedLength}function c(){return i.PRNG.stateLength}function l(){return i.PRNG.byteLength}function m(){return i.PRNG.state}function h(p){i.PRNG.state=p}}lP.exports=Vfe});var mP=s(function(rZe,cP){"use strict";var Ffe=vc(),Wfe=Ffe();cP.exports=Wfe});var yP=s(function(tZe,pP){"use strict";var Ife=require("@stdlib/utils/define-nonenumerable-read-only-property"),hP=mP(),kfe=vc();Ife(hP,"factory",kfe);pP.exports=hP});var bP=s(function(iZe,qP){"use strict";var zfe=require("@stdlib/math/base/assert/is-nan"),Jfe=8;function Ufe(r,e,t){var i,n;for(n=0;n=0;n--)e[n]=r();return e}qP.exports=Ufe});var gc=s(function(nZe,wP){"use strict";var Cfe=require("@stdlib/constants/int32/max"),Bfe=require("@stdlib/math/base/special/floor"),Dfe=Cfe-1;function Xfe(){var r=Bfe(1+Dfe*Math.random());return r|0}wP.exports=Xfe});var lc=s(function(aZe,LP){"use strict";var it=require("@stdlib/utils/define-nonenumerable-read-only-property"),Nt=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),SP=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),fc=require("@stdlib/assert/has-own-property"),Yfe=require("@stdlib/assert/is-plain-object"),Hfe=require("@stdlib/assert/is-boolean").isPrimitive,Zfe=require("@stdlib/assert/is-collection"),Qfe=require("@stdlib/assert/is-positive-integer").isPrimitive,OP=require("@stdlib/assert/is-int32array"),Ga=require("@stdlib/blas/base/gcopy"),$fe=require("@stdlib/math/base/special/floor"),Y=require("@stdlib/array/int32"),iu=require("@stdlib/constants/int32/max"),Kfe=require("@stdlib/array/to-json"),K=require("@stdlib/string/format"),EP=bP(),_P=gc(),dc=iu-1|0,ede=iu-1|0,rde=16807,Z=32,iv=1,nv=3,Lt=2,Va=Z+3,H=Z+6,nu=Z+7,rv=Va+1,tv=Va+2;function NP(r,e){var t;return e?t="option":t="argument",r.lengthede)throw new RangeError(K("invalid option. `%s` option must be a positive integer less than the maximum signed 32-bit integer. Option: `%u`.","seed",n));n|=0}else if(Zfe(n)&&n.length>0)a=n.length,e=new Y(nu+a),e[0]=iv,e[1]=nv,e[Lt]=Z,e[Va]=2,e[tv]=n[0],e[H]=a,Ga.ndarray(a,n,1,0,e,1,H+1),t=new Y(e.buffer,e.byteOffset+(Lt+1)*e.BYTES_PER_ELEMENT,Z),n=new Y(e.buffer,e.byteOffset+(H+1)*e.BYTES_PER_ELEMENT,a),t=EP(p,t,Z),e[rv]=t[0];else throw new TypeError(K("invalid option. `%s` option must be either a positive integer less than the maximum signed 32-bit integer or an array-like object containing integer values less than the maximum signed 32-bit integer. Option: `%s`.","seed",n));else n=_P()|0}else n=_P()|0;return t===void 0&&(e=new Y(nu+1),e[0]=iv,e[1]=nv,e[Lt]=Z,e[Va]=2,e[tv]=n,e[H]=1,e[H+1]=n,t=new Y(e.buffer,e.byteOffset+(Lt+1)*e.BYTES_PER_ELEMENT,Z),n=new Y(e.buffer,e.byteOffset+(H+1)*e.BYTES_PER_ELEMENT,1),t=EP(p,t,Z),e[rv]=t[0]),it(d,"NAME","minstd-shuffle"),Nt(d,"seed",o),Nt(d,"seedLength",v),SP(d,"state",l,m),Nt(d,"stateLength",g),Nt(d,"byteLength",c),it(d,"toJSON",h),it(d,"MIN",1),it(d,"MAX",iu-1),it(d,"normalized",f),it(f,"NAME",d.NAME),Nt(f,"seed",o),Nt(f,"seedLength",v),SP(f,"state",l,m),Nt(f,"stateLength",g),Nt(f,"byteLength",c),it(f,"toJSON",h),it(f,"MIN",(d.MIN-1)/dc),it(f,"MAX",(d.MAX-1)/dc),d;function o(){var y=e[H];return Ga(y,n,1,new Y(y),1)}function v(){return e[H]}function g(){return e.length}function c(){return e.byteLength}function l(){var y=e.length;return Ga(y,e,1,new Y(y),1)}function m(y){var q;if(!OP(y))throw new TypeError(K("invalid argument. Must provide an Int32Array. Value: `%s`.",y));if(q=NP(y,!1),q)throw q;i.copy===!1?i.state&&y.length===e.length?Ga(y.length,y,1,e,1):(e=y,i.state=!0):(y.length!==e.length&&(e=new Y(y.length)),Ga(y.length,y,1,e,1)),t=new Y(e.buffer,e.byteOffset+(Lt+1)*e.BYTES_PER_ELEMENT,Z),n=new Y(e.buffer,e.byteOffset+(H+1)*e.BYTES_PER_ELEMENT,e[H])}function h(){var y={};return y.type="PRNG",y.name=d.NAME,y.state=Kfe(e),y.params=[],y}function p(){var y=e[tv]|0;return y=rde*y%iu|0,e[tv]=y,y|0}function d(){var y,q;return y=e[rv],q=$fe(Z*(y/iu)),y=t[q],e[rv]=y,t[q]=p(),y}function f(){return(d()-1)/dc}}LP.exports=tde});var PP=s(function(sZe,RP){"use strict";var ide=lc(),nde=gc(),ade=ide({seed:nde()});RP.exports=ade});var ee=s(function(uZe,jP){"use strict";var sde=require("@stdlib/utils/define-nonenumerable-read-only-property"),TP=PP(),ude=lc();sde(TP,"factory",ude);jP.exports=TP});var MP=s(function(oZe,ode){ode.exports={idtype:"float64",ndtype:"float64"}});var AP=s(function(vZe,xP){"use strict";var vde=require("@stdlib/array/typed-real-float-dtypes"),gde=require("@stdlib/array/typed-real-dtypes"),fde=require("@stdlib/assert/is-plain-object"),av=require("@stdlib/assert/has-own-property"),au=require("@stdlib/string/format"),su=gde(),uu=vde();su.push("generic");uu.push("generic");function dde(r,e,t){if(!fde(e))return new TypeError(au("invalid argument. Options argument must be an object. Value: `%s`.",e));if(t===0){if(av(e,"idtype")&&(r.idtype=e.idtype,su.indexOf(r.idtype)<0))return new TypeError(au('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"idtype",su.join('", "'),r.idtype));if(av(e,"ndtype")&&(r.ndtype=e.ndtype,uu.indexOf(r.ndtype)<0))return new TypeError(au('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"ndtype",uu.join('", "'),r.ndtype))}else if(t===1&&av(e,"dtype")){if(r.dtype=e.dtype,su.indexOf(r.dtype)<0)return new TypeError(au('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",su.join('", "'),r.dtype))}else if(av(e,"dtype")&&(r.dtype=e.dtype,uu.indexOf(r.dtype)<0))return new TypeError(au('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",uu.join('", "'),r.dtype));return null}xP.exports=dde});var mc=s(function(gZe,UP){"use strict";var GP=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,VP=require("@stdlib/utils/define-nonenumerable-read-only-property"),sv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),lde=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),FP=ee(),WP=require("@stdlib/array/typed-real-ctors"),IP=require("@stdlib/array/base/filled-by"),kP=require("@stdlib/strided/base/nullary"),zP=require("@stdlib/string/format"),JP=MP(),cc=AP();function cde(){var r,e,t,i,n,a;if(t={idtype:JP.idtype,ndtype:JP.ndtype},e=arguments.length,i=u,e===0)n=FP;else if(e===1&&(r=arguments[0],n=FP.factory(r),a=cc(t,r,0),a))throw a;return sv(i,"seed",v),sv(i,"seedLength",g),lde(i,"state",m,h),sv(i,"stateLength",c),sv(i,"byteLength",l),VP(i,"PRNG",n),VP(i,"normalized",o),i;function u(p,d){var f,y,q,b,w;if(!GP(p))throw new TypeError(zP("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",p));if(w={},arguments.length>1&&(q=cc(w,d,1),q))throw q;return b=w.dtype||t.idtype,b==="generic"?IP(p,n):(f=WP(b),y=new f(p),kP([y],[p],[1],n),y)}function o(p,d){var f,y,q,b,w;if(!GP(p))throw new TypeError(zP("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",p));if(w={},arguments.length>1&&(q=cc(w,d,2),q))throw q;return b=w.dtype||t.ndtype,b==="generic"?IP(p,n.normalized):(f=WP(b),y=new f(p),kP([y],[p],[1],n.normalized),y)}function v(){return i.PRNG.seed}function g(){return i.PRNG.seedLength}function c(){return i.PRNG.stateLength}function l(){return i.PRNG.byteLength}function m(){return i.PRNG.state}function h(p){i.PRNG.state=p}}UP.exports=cde});var BP=s(function(fZe,CP){"use strict";var mde=mc(),hde=mde();CP.exports=hde});var YP=s(function(dZe,XP){"use strict";var pde=require("@stdlib/utils/define-nonenumerable-read-only-property"),DP=BP(),yde=mc();pde(DP,"factory",yde);XP.exports=DP});var HP=s(function(lZe,qde){qde.exports={idtype:"float64",ndtype:"float64"}});var QP=s(function(cZe,ZP){"use strict";var bde=require("@stdlib/array/typed-real-float-dtypes"),wde=require("@stdlib/array/typed-real-dtypes"),Sde=require("@stdlib/assert/is-plain-object"),uv=require("@stdlib/assert/has-own-property"),ou=require("@stdlib/string/format"),vu=wde(),gu=bde();vu.push("generic");gu.push("generic");function Ode(r,e,t){if(!Sde(e))return new TypeError(ou("invalid argument. Options argument must be an object. Value: `%s`.",e));if(t===0){if(uv(e,"idtype")&&(r.idtype=e.idtype,vu.indexOf(r.idtype)<0))return new TypeError(ou('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"idtype",vu.join('", "'),r.idtype));if(uv(e,"ndtype")&&(r.ndtype=e.ndtype,gu.indexOf(r.ndtype)<0))return new TypeError(ou('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"ndtype",gu.join('", "'),r.ndtype))}else if(t===1&&uv(e,"dtype")){if(r.dtype=e.dtype,vu.indexOf(r.dtype)<0)return new TypeError(ou('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",vu.join('", "'),r.dtype))}else if(uv(e,"dtype")&&(r.dtype=e.dtype,gu.indexOf(r.dtype)<0))return new TypeError(ou('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",gu.join('", "'),r.dtype));return null}ZP.exports=Ode});var pc=s(function(mZe,sT){"use strict";var $P=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,KP=require("@stdlib/utils/define-nonenumerable-read-only-property"),ov=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Ede=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),eT=T(),rT=require("@stdlib/array/typed-real-ctors"),tT=require("@stdlib/array/base/filled-by"),iT=require("@stdlib/strided/base/nullary"),nT=require("@stdlib/string/format"),aT=HP(),hc=QP();function _de(){var r,e,t,i,n,a;if(t={idtype:aT.idtype,ndtype:aT.ndtype},e=arguments.length,i=u,e===0)n=eT;else if(e===1&&(r=arguments[0],n=eT.factory(r),a=hc(t,r,0),a))throw a;return ov(i,"seed",v),ov(i,"seedLength",g),Ede(i,"state",m,h),ov(i,"stateLength",c),ov(i,"byteLength",l),KP(i,"PRNG",n),KP(i,"normalized",o),i;function u(p,d){var f,y,q,b,w;if(!$P(p))throw new TypeError(nT("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",p));if(w={},arguments.length>1&&(q=hc(w,d,1),q))throw q;return b=w.dtype||t.idtype,b==="generic"?tT(p,n):(f=rT(b),y=new f(p),iT([y],[p],[1],n),y)}function o(p,d){var f,y,q,b,w;if(!$P(p))throw new TypeError(nT("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",p));if(w={},arguments.length>1&&(q=hc(w,d,2),q))throw q;return b=w.dtype||t.ndtype,b==="generic"?tT(p,n.normalized):(f=rT(b),y=new f(p),iT([y],[p],[1],n.normalized),y)}function v(){return i.PRNG.seed}function g(){return i.PRNG.seedLength}function c(){return i.PRNG.stateLength}function l(){return i.PRNG.byteLength}function m(){return i.PRNG.state}function h(p){i.PRNG.state=p}}sT.exports=_de});var oT=s(function(hZe,uT){"use strict";var Nde=pc(),Lde=Nde();uT.exports=Lde});var fT=s(function(pZe,gT){"use strict";var Rde=require("@stdlib/utils/define-nonenumerable-read-only-property"),vT=oT(),Pde=pc();Rde(vT,"factory",Pde);gT.exports=vT});var lT=s(function(yZe,dT){"use strict";var Tde=require("@stdlib/math/base/special/exp");function jde(r,e){for(var t=r(),i=1;t>Tde(-e);)i+=1,t*=r();return i-1}dT.exports=jde});var pT=s(function(qZe,hT){"use strict";var Mde=require("@stdlib/math/base/special/factorialln"),cT=require("@stdlib/math/base/special/floor"),xde=require("@stdlib/math/base/special/signum"),Ade=require("@stdlib/math/base/special/sqrt"),mT=require("@stdlib/math/base/special/abs"),vv=require("@stdlib/math/base/special/ln"),Gde=require("@stdlib/constants/float64/ln-sqrt-two-pi"),Vde=1/12,Fde=1/360;function Wde(r,e){var t,i,n,a,u,o,v,g,c,l;for(t=Ade(e),v=2.53*t+.931,o=.02483*v-.059,i=1.1328/(v-3.4)+1.1239,u=-3.6224/(v-2)+.9277,n=.86*u;;){if(l=r(),l<=n)return c=l/u-.43,c*=2*o/(.5-mT(c))+v,c+=e+.445,cT(c);if(l>=u?c=r()-.5:(c=l/u-.93,c=xde(c)*.5-c,l=u*r()),a=.5-mT(c),(a>=.013||a>=l)&&(g=cT((2*o/a+v)*c+e+.445),l*=i/(o/(a*a)+v),c=(g+.5)*vv(e/g),c+=-e-Gde+g,c-=(Vde-Fde/(g*g))/g,g>=10&&c>=vv(l*t)||(c=g*vv(e)-e-Mde(g),g>=0&&g<=9&&c>=vv(l))))return g}}hT.exports=Wde});var qT=s(function(bZe,yT){"use strict";var Ide=lT(),kde=pT();function zde(r,e){return e<30?Ide(r,e):kde(r,e)}yT.exports=zde});var yc=s(function(wZe,NT){"use strict";var nt=require("@stdlib/utils/define-nonenumerable-read-only-property"),gv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),bT=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Jde=require("@stdlib/assert/is-positive-number").isPrimitive,wT=require("@stdlib/assert/is-plain-object"),ST=require("@stdlib/assert/is-function"),OT=require("@stdlib/assert/has-own-property"),ET=require("@stdlib/utils/constant-function"),Ude=require("@stdlib/utils/noop"),fv=T().factory,Cde=require("@stdlib/math/base/assert/is-nan"),Bde=require("@stdlib/array/to-json"),dv=require("@stdlib/string/format"),_T=qT();function Dde(){var r,e,t,i;if(arguments.length===0)t=fv();else if(arguments.length===1&&wT(arguments[0]))if(e=arguments[0],OT(e,"prng")){if(!ST(e.prng))throw new TypeError(dv("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));t=e.prng}else t=fv(e);else{if(r=arguments[0],!Jde(r))throw new TypeError(dv("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(arguments.length>1){if(e=arguments[1],!wT(e))throw new TypeError(dv("invalid argument. Options argument must be an object. Value: `%s`.",e));if(OT(e,"prng")){if(!ST(e.prng))throw new TypeError(dv("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));t=e.prng}else t=fv(e)}else t=fv()}return r===void 0?i=m:i=l,nt(i,"NAME","poisson"),e&&e.prng?(nt(i,"seed",null),nt(i,"seedLength",null),bT(i,"state",ET(null),Ude),nt(i,"stateLength",null),nt(i,"byteLength",null),nt(i,"toJSON",ET(null)),nt(i,"PRNG",t)):(gv(i,"seed",n),gv(i,"seedLength",a),bT(i,"state",v,g),gv(i,"stateLength",u),gv(i,"byteLength",o),nt(i,"toJSON",c),nt(i,"PRNG",t),t=t.normalized),i;function n(){return t.seed}function a(){return t.seedLength}function u(){return t.stateLength}function o(){return t.byteLength}function v(){return t.state}function g(h){t.state=h}function c(){var h={};return h.type="PRNG",h.name=i.NAME,h.state=Bde(t.state),r===void 0?h.params=[]:h.params=[r],h}function l(){return _T(t,r)}function m(h){return Cde(h)||h<=0?NaN:_T(t,h)}}NT.exports=Dde});var RT=s(function(SZe,LT){"use strict";var Xde=yc(),Yde=Xde();LT.exports=Yde});var hn=s(function(OZe,TT){"use strict";var Hde=require("@stdlib/utils/define-nonenumerable-read-only-property"),PT=RT(),Zde=yc();Hde(PT,"factory",Zde);TT.exports=PT});var MT=s(function(EZe,jT){"use strict";var Qde=require("@stdlib/assert/is-positive-number").isPrimitive,$de=require("@stdlib/assert/is-number").isPrimitive,qc=require("@stdlib/string/format"),Kde=require("@stdlib/assert/is-nan");function ele(r,e){return Qde(r)?!$de(e)||Kde(e)?new TypeError(qc("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e)):e<=0||e>=1?new RangeError(qc("invalid argument. Second argument must be on the interval: (0, 1). Value: `%f`.",e)):null:new TypeError(qc("invalid argument. First argument must be a positive number. Value: `%s`.",r))}jT.exports=ele});var Oc=s(function(_Ze,kT){"use strict";var Rt=require("@stdlib/utils/define-nonenumerable-read-only-property"),lv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),xT=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Fa=require("@stdlib/assert/has-own-property"),AT=require("@stdlib/assert/is-plain-object"),bc=require("@stdlib/assert/is-uint32array"),GT=require("@stdlib/assert/is-boolean").isPrimitive,VT=require("@stdlib/assert/is-function"),FT=require("@stdlib/utils/constant-function"),rle=require("@stdlib/utils/noop"),WT=require("@stdlib/math/base/assert/is-nan"),Wa=hn().factory,cv=Ce().factory,wc=require("@stdlib/blas/base/gcopy"),Sc=require("@stdlib/array/uint32"),IT=require("@stdlib/object/assign"),tle=require("@stdlib/array/to-json"),at=require("@stdlib/string/format"),ile=MT();function nle(){var r,e,t,i,n,a,u,o,v,g;if(u=!0,arguments.length===0)i={copy:!1},t=Wa(i);else if(arguments.length===1){if(i=arguments[0],!AT(i))throw new TypeError(at("invalid argument. Options argument must be an object. Value: `%s`.",i));if(Fa(i,"copy")&&!GT(i.copy))throw new TypeError(at("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",i.copy));if(Fa(i,"prng")){if(!VT(i.prng))throw new TypeError(at("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",i.prng));t=Wa({prng:i.prng})}else{if(Fa(i,"state")&&!bc(i.state))throw new TypeError(at("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",i.state));i=IT({},i),i.copy===!1?u=!1:i.state&&(i.state=wc(i.state.length,i.state,1,new Sc(i.state.length),1)),i.copy=!1,t=Wa(i)}}else{if(g=arguments[0],v=arguments[1],o=ile(g,v),o)throw o;if(arguments.length>2){if(i=arguments[2],!AT(i))throw new TypeError(at("invalid argument. Options argument must be an object. Value: `%s`.",i));if(Fa(i,"copy")&&!GT(i.copy))throw new TypeError(at("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",i.copy));if(Fa(i,"prng")){if(!VT(i.prng))throw new TypeError(at("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",i.prng));t=Wa({prng:i.prng})}else{if(Fa(i,"state")&&!bc(i.state))throw new TypeError(at("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",i.state));i=IT({},i),i.copy===!1?u=!1:i.state&&(i.state=wc(i.state.length,i.state,1,new Sc(i.state.length),1)),i.copy=!1,t=Wa(i)}}else i={copy:!1},t=Wa(i)}return i&&i.prng?g===void 0?r=cv({prng:i.prng}):r=cv(g,v/(1-v),{prng:i.prng}):(i.state?e=i.state:(e=t.state,t.state=e),g===void 0?r=cv({state:e,copy:!1}):r=cv(g,v/(1-v),{state:e,copy:!1})),g===void 0?n=q:n=y,a=t.PRNG,Rt(n,"NAME","negative-binomial"),i&&i.prng?(Rt(n,"seed",null),Rt(n,"seedLength",null),xT(n,"state",FT(null),rle),Rt(n,"stateLength",null),Rt(n,"byteLength",null),Rt(n,"toJSON",FT(null))):(lv(n,"seed",c),lv(n,"seedLength",l),xT(n,"state",p,d),lv(n,"stateLength",m),lv(n,"byteLength",h),Rt(n,"toJSON",f)),Rt(n,"PRNG",a),n;function c(){return a.seed}function l(){return a.seedLength}function m(){return a.stateLength}function h(){return a.byteLength}function p(){return a.state}function d(b){if(!bc(b))throw new TypeError(at("invalid argument. Must provide a Uint32Array. Value: `%s`.",b));u&&(b=wc(b.length,b,1,new Sc(b.length),1)),a.state=b}function f(){var b={};return b.type="PRNG",b.name=n.NAME,b.state=tle(a.state),g===void 0?b.params=[]:b.params=[g,v],b}function y(){return t(r())}function q(b,w){return WT(b)||WT(w)||w<=0||w>=1?NaN:t(r(b,w/(1-w)))}}kT.exports=nle});var JT=s(function(NZe,zT){"use strict";var ale=Oc(),sle=ale();zT.exports=sle});var Ia=s(function(LZe,CT){"use strict";var ule=require("@stdlib/utils/define-nonenumerable-read-only-property"),UT=JT(),ole=Oc();ule(UT,"factory",ole);CT.exports=UT});var Ec=s(function(RZe,BT){"use strict";var vle=F(),gle=require("@stdlib/array/dtypes"),fle=require("@stdlib/array/defaults"),dle=Ia(),lle=gle("real_and_generic"),cle=vle(dle,lle,fle.get("dtypes.real"));BT.exports=cle});var XT=s(function(PZe,DT){"use strict";var mle=Ec(),hle=mle();DT.exports=hle});var ZT=s(function(TZe,HT){"use strict";var ple=require("@stdlib/utils/define-nonenumerable-read-only-property"),YT=XT(),yle=Ec();ple(YT,"factory",yle);HT.exports=YT});var KT=s(function(jZe,$T){"use strict";var qle=require("@stdlib/assert/is-number").isPrimitive,ble=require("@stdlib/assert/is-positive-number").isPrimitive,QT=require("@stdlib/string/format"),wle=require("@stdlib/assert/is-nan");function Sle(r,e){return!qle(r)||wle(r)?new TypeError(QT("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):ble(e)?null:new TypeError(QT("invalid argument. Second argument must be a positive number. Value: `%s`.",e))}$T.exports=Sle});var rj=s(function(MZe,ej){"use strict";function Ole(r,e,t){return e+t*r()}ej.exports=Ole});var _c=s(function(xZe,vj){"use strict";var Pt=require("@stdlib/utils/define-nonenumerable-read-only-property"),mv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),tj=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),ij=require("@stdlib/assert/is-plain-object"),nj=require("@stdlib/assert/is-function"),aj=require("@stdlib/assert/has-own-property"),sj=require("@stdlib/utils/constant-function"),Ele=require("@stdlib/utils/noop"),ka=Q().factory,uj=require("@stdlib/math/base/assert/is-nan"),_le=require("@stdlib/array/to-json"),hv=require("@stdlib/string/format"),Nle=KT(),oj=rj();function Lle(){var r,e,t,i,n,a,u;if(arguments.length===0)e=ka();else if(arguments.length===1){if(t=arguments[0],!ij(t))throw new TypeError(hv("invalid argument. Options argument must be an object. Value: `%s`.",t));if(aj(t,"prng")){if(!nj(t.prng))throw new TypeError(hv("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",t.prng));e=ka({prng:t.prng})}else e=ka(t)}else{if(u=arguments[0],r=arguments[1],a=Nle(u,r),a)throw a;if(arguments.length>2){if(t=arguments[2],!ij(t))throw new TypeError(hv("invalid argument. Options argument must be an object. Value: `%s`.",t));if(aj(t,"prng")){if(!nj(t.prng))throw new TypeError(hv("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",t.prng));e=ka({prng:t.prng})}else e=ka(t)}else e=ka()}return u===void 0?n=d:n=p,i=e.PRNG,Pt(n,"NAME","normal"),t&&t.prng?(Pt(n,"seed",null),Pt(n,"seedLength",null),tj(n,"state",sj(null),Ele),Pt(n,"stateLength",null),Pt(n,"byteLength",null),Pt(n,"toJSON",sj(null))):(mv(n,"seed",o),mv(n,"seedLength",v),tj(n,"state",l,m),mv(n,"stateLength",g),mv(n,"byteLength",c),Pt(n,"toJSON",h)),Pt(n,"PRNG",i),n;function o(){return i.seed}function v(){return i.seedLength}function g(){return i.stateLength}function c(){return i.byteLength}function l(){return i.state}function m(f){i.state=f}function h(){var f={};return f.type="PRNG",f.name=n.NAME,f.state=_le(i.state),u===void 0?f.params=[]:f.params=[u,r],f}function p(){return oj(e,u,r)}function d(f,y){return uj(f)||uj(y)||y<=0?NaN:oj(e,f,y)}}vj.exports=Lle});var fj=s(function(AZe,gj){"use strict";var Rle=_c(),Ple=Rle();gj.exports=Ple});var pn=s(function(GZe,lj){"use strict";var Tle=require("@stdlib/utils/define-nonenumerable-read-only-property"),dj=fj(),jle=_c();Tle(dj,"factory",jle);lj.exports=dj});var Nc=s(function(VZe,cj){"use strict";var Mle=F(),xle=require("@stdlib/array/dtypes"),Ale=require("@stdlib/array/defaults"),Gle=pn(),Vle=xle("real_floating_point_and_generic"),Fle=Mle(Gle,Vle,Ale.get("dtypes.real_floating_point"));cj.exports=Fle});var hj=s(function(FZe,mj){"use strict";var Wle=Nc(),Ile=Wle();mj.exports=Ile});var qj=s(function(WZe,yj){"use strict";var kle=require("@stdlib/utils/define-nonenumerable-read-only-property"),pj=hj(),zle=Nc();kle(pj,"factory",zle);yj.exports=pj});var Oj=s(function(IZe,Sj){"use strict";var bj=require("@stdlib/assert/is-positive-number").isPrimitive,wj=require("@stdlib/string/format");function Jle(r,e){return bj(r)?bj(e)?null:new TypeError(wj("invalid argument. Second argument must be a positive number. Value: `%s`.",e)):new TypeError(wj("invalid argument. First argument must be a positive number. Value: `%s`.",r))}Sj.exports=Jle});var _j=s(function(kZe,Ej){"use strict";var Ule=require("@stdlib/math/base/special/pow");function Cle(r,e,t){return t/Ule(r(),1/e)}Ej.exports=Cle});var Lc=s(function(zZe,xj){"use strict";var st=require("@stdlib/utils/define-nonenumerable-read-only-property"),pv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Nj=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Lj=require("@stdlib/assert/is-plain-object"),Rj=require("@stdlib/assert/is-function"),Pj=require("@stdlib/assert/has-own-property"),Tj=require("@stdlib/utils/constant-function"),Ble=require("@stdlib/utils/noop"),yv=T().factory,jj=require("@stdlib/math/base/assert/is-nan"),Dle=require("@stdlib/array/to-json"),qv=require("@stdlib/string/format"),Xle=Oj(),Mj=_j();function Yle(){var r,e,t,i,n,a;if(arguments.length===0)i=yv();else if(arguments.length===1){if(t=arguments[0],!Lj(t))throw new TypeError(qv("invalid argument. Options argument must be an object. Value: `%s`.",t));if(Pj(t,"prng")){if(!Rj(t.prng))throw new TypeError(qv("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",t.prng));i=t.prng}else i=yv(t)}else{if(r=arguments[0],e=arguments[1],a=Xle(r,e),a)throw a;if(arguments.length>2){if(t=arguments[2],!Lj(t))throw new TypeError(qv("invalid argument. Options argument must be an object. Value: `%s`.",t));if(Pj(t,"prng")){if(!Rj(t.prng))throw new TypeError(qv("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",t.prng));i=t.prng}else i=yv(t)}else i=yv()}return r===void 0?n=p:n=h,st(n,"NAME","pareto-type1"),t&&t.prng?(st(n,"seed",null),st(n,"seedLength",null),Nj(n,"state",Tj(null),Ble),st(n,"stateLength",null),st(n,"byteLength",null),st(n,"toJSON",Tj(null)),st(n,"PRNG",i)):(pv(n,"seed",u),pv(n,"seedLength",o),Nj(n,"state",c,l),pv(n,"stateLength",v),pv(n,"byteLength",g),st(n,"toJSON",m),st(n,"PRNG",i),i=i.normalized),n;function u(){return i.seed}function o(){return i.seedLength}function v(){return i.stateLength}function g(){return i.byteLength}function c(){return i.state}function l(d){i.state=d}function m(){var d={};return d.type="PRNG",d.name=n.NAME,d.state=Dle(i.state),r===void 0?d.params=[]:d.params=[r,e],d}function h(){return Mj(i,r,e)}function p(d,f){return jj(d)||jj(f)||d<=0||f<=0?NaN:Mj(i,d,f)}}xj.exports=Yle});var Gj=s(function(JZe,Aj){"use strict";var Hle=Lc(),Zle=Hle();Aj.exports=Zle});var za=s(function(UZe,Fj){"use strict";var Qle=require("@stdlib/utils/define-nonenumerable-read-only-property"),Vj=Gj(),$le=Lc();Qle(Vj,"factory",$le);Fj.exports=Vj});var Rc=s(function(CZe,Wj){"use strict";var Kle=F(),ece=require("@stdlib/array/dtypes"),rce=require("@stdlib/array/defaults"),tce=za(),ice=ece("real_floating_point_and_generic"),nce=Kle(tce,ice,rce.get("dtypes.real_floating_point"));Wj.exports=nce});var kj=s(function(BZe,Ij){"use strict";var ace=Rc(),sce=ace();Ij.exports=sce});var Uj=s(function(DZe,Jj){"use strict";var uce=require("@stdlib/utils/define-nonenumerable-read-only-property"),zj=kj(),oce=Rc();uce(zj,"factory",oce);Jj.exports=zj});var Pc=s(function(XZe,Cj){"use strict";var vce=Fr(),gce=require("@stdlib/array/dtypes"),fce=require("@stdlib/array/defaults"),dce=hn(),lce=gce("real_and_generic"),cce=vce(dce,lce,fce.get("dtypes.real"));Cj.exports=cce});var Dj=s(function(YZe,Bj){"use strict";var mce=Pc(),hce=mce();Bj.exports=hce});var Hj=s(function(HZe,Yj){"use strict";var pce=require("@stdlib/utils/define-nonenumerable-read-only-property"),Xj=Dj(),yce=Pc();pce(Xj,"factory",yce);Yj.exports=Xj});var Zj=s(function(ZZe,qce){qce.exports={name:"mt19937",copy:!0}});var $j=s(function(QZe,Qj){"use strict";var bce=$(),wce=ee(),Sce=T(),bv={};bv.minstd=bce;bv["minstd-shuffle"]=wce;bv.mt19937=Sce;Qj.exports=bv});var Tc=s(function($Ze,e0){"use strict";var fu=require("@stdlib/utils/define-nonenumerable-read-only-property"),wv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Oce=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Ece=require("@stdlib/assert/is-plain-object"),_ce=require("@stdlib/assert/is-boolean").isPrimitive,Sv=require("@stdlib/assert/has-own-property"),Nce=require("@stdlib/array/to-json"),du=require("@stdlib/string/format"),Kj=Zj(),Lce=$j();function Rce(r){var e,t,i;if(e={name:Kj.name,copy:Kj.copy},arguments.length){if(!Ece(r))throw new TypeError(du("invalid argument. Must provide an object. Value: `%s`.",r));if(Sv(r,"name")&&(e.name=r.name),Sv(r,"state")){if(e.state=r.state,e.state===void 0)throw new TypeError(du("invalid option. `%s` option cannot be undefined. Option: `%s`.","state",e.state))}else if(Sv(r,"seed")&&(e.seed=r.seed,e.seed===void 0))throw new TypeError(du("invalid option. `%s` option cannot be undefined. Option: `%s`.","seed",e.seed));if(Sv(r,"copy")&&(e.copy=r.copy,!_ce(e.copy)))throw new TypeError(du("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",e.copy))}if(i=Lce[e.name],i===void 0)throw new Error(du("invalid option. Unrecognized/unsupported PRNG. Option: `%s`.",e.name));return e.state===void 0?e.seed===void 0?t=i.factory():t=i.factory({seed:e.seed}):t=i.factory({state:e.state,copy:e.copy}),fu(l,"NAME","randu"),wv(l,"seed",n),wv(l,"seedLength",a),Oce(l,"state",v,g),wv(l,"stateLength",u),wv(l,"byteLength",o),fu(l,"toJSON",c),fu(l,"PRNG",t),fu(l,"MIN",t.normalized.MIN),fu(l,"MAX",t.normalized.MAX),l;function n(){return t.seed}function a(){return t.seedLength}function u(){return t.stateLength}function o(){return t.byteLength}function v(){return t.state}function g(m){t.state=m}function c(){var m={};return m.type="PRNG",m.name=l.NAME+"-"+t.NAME,m.state=Nce(t.state),m.params=[],m}function l(){return t.normalized()}}e0.exports=Rce});var t0=s(function(KZe,r0){"use strict";var Pce=Tc(),Tce=Pce();r0.exports=Tce});var Tt=s(function(eQe,n0){"use strict";var jce=require("@stdlib/utils/define-nonenumerable-read-only-property"),i0=t0(),Mce=Tc();jce(i0,"factory",Mce);n0.exports=i0});var a0=s(function(rQe,xce){xce.exports={dtype:"float64"}});var o0=s(function(tQe,u0){"use strict";var Ace=require("@stdlib/array/typed-real-float-dtypes"),Gce=require("@stdlib/assert/is-plain-object"),Vce=require("@stdlib/assert/has-own-property"),s0=require("@stdlib/string/format"),jc=Ace();jc.push("generic");function Fce(r,e){return Gce(e)?Vce(e,"dtype")&&(r.dtype=e.dtype,jc.indexOf(r.dtype)<0)?new TypeError(s0('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",jc.join('", "'),r.dtype)):null:new TypeError(s0("invalid argument. Options argument must be an object. Value: `%s`.",e))}u0.exports=Fce});var Mc=s(function(iQe,f0){"use strict";var Wce=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Ice=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ov=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),kce=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),v0=Tt(),zce=require("@stdlib/array/typed-real-float-ctors"),Jce=require("@stdlib/array/base/filled-by"),Uce=require("@stdlib/strided/base/nullary"),Cce=require("@stdlib/string/format"),Bce=a0(),g0=o0();function Dce(){var r,e,t,i,n,a;if(t={dtype:Bce.dtype},e=arguments.length,i=u,e===0)n=v0;else if(e===1&&(r=arguments[0],n=v0.factory(r),a=g0(t,r),a))throw a;return Ov(i,"seed",o),Ov(i,"seedLength",v),kce(i,"state",l,m),Ov(i,"stateLength",g),Ov(i,"byteLength",c),Ice(i,"PRNG",n.PRNG),i;function u(h,p){var d,f,y,q,b;if(!Wce(h))throw new TypeError(Cce("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",h));if(b={},arguments.length>1&&(y=g0(b,p),y))throw y;return q=b.dtype||t.dtype,q==="generic"?Jce(h,n):(d=zce(q),f=new d(h),Uce([f],[h],[1],n),f)}function o(){return i.PRNG.seed}function v(){return i.PRNG.seedLength}function g(){return i.PRNG.stateLength}function c(){return i.PRNG.byteLength}function l(){return i.PRNG.state}function m(h){i.PRNG.state=h}}f0.exports=Dce});var l0=s(function(nQe,d0){"use strict";var Xce=Mc(),Yce=Xce();d0.exports=Yce});var h0=s(function(aQe,m0){"use strict";var Hce=require("@stdlib/utils/define-nonenumerable-read-only-property"),c0=l0(),Zce=Mc();Hce(c0,"factory",Zce);m0.exports=c0});var y0=s(function(sQe,p0){"use strict";var Qce=require("@stdlib/math/base/special/sqrt"),$ce=require("@stdlib/math/base/special/ln");function Kce(r,e){return e*Qce(-2*$ce(r()))}p0.exports=Kce});var xc=s(function(uQe,_0){"use strict";var ut=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ev=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),q0=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),eme=require("@stdlib/assert/is-positive-number").isPrimitive,b0=require("@stdlib/assert/is-plain-object"),w0=require("@stdlib/assert/is-function"),S0=require("@stdlib/assert/has-own-property"),O0=require("@stdlib/utils/constant-function"),rme=require("@stdlib/utils/noop"),_v=T().factory,tme=require("@stdlib/math/base/assert/is-nan"),ime=require("@stdlib/array/to-json"),Nv=require("@stdlib/string/format"),E0=y0();function nme(){var r,e,t,i;if(arguments.length===0)t=_v();else if(arguments.length===1&&b0(arguments[0]))if(e=arguments[0],S0(e,"prng")){if(!w0(e.prng))throw new TypeError(Nv("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));t=e.prng}else t=_v(e);else{if(r=arguments[0],!eme(r))throw new TypeError(Nv("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(arguments.length>1){if(e=arguments[1],!b0(e))throw new TypeError(Nv("invalid argument. Options argument must be an object. Value: `%s`.",e));if(S0(e,"prng")){if(!w0(e.prng))throw new TypeError(Nv("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));t=e.prng}else t=_v(e)}else t=_v()}return r===void 0?i=m:i=l,ut(i,"NAME","rayleigh"),e&&e.prng?(ut(i,"seed",null),ut(i,"seedLength",null),q0(i,"state",O0(null),rme),ut(i,"stateLength",null),ut(i,"byteLength",null),ut(i,"toJSON",O0(null)),ut(i,"PRNG",t)):(Ev(i,"seed",n),Ev(i,"seedLength",a),q0(i,"state",v,g),Ev(i,"stateLength",u),Ev(i,"byteLength",o),ut(i,"toJSON",c),ut(i,"PRNG",t),t=t.normalized),i;function n(){return t.seed}function a(){return t.seedLength}function u(){return t.stateLength}function o(){return t.byteLength}function v(){return t.state}function g(h){t.state=h}function c(){var h={};return h.type="PRNG",h.name=i.NAME,h.state=ime(t.state),r===void 0?h.params=[]:h.params=[r],h}function l(){return E0(t,r)}function m(h){return tme(h)||h<=0?NaN:E0(t,h)}}_0.exports=nme});var L0=s(function(oQe,N0){"use strict";var ame=xc(),sme=ame();N0.exports=sme});var Ja=s(function(vQe,P0){"use strict";var ume=require("@stdlib/utils/define-nonenumerable-read-only-property"),R0=L0(),ome=xc();ume(R0,"factory",ome);P0.exports=R0});var Ac=s(function(gQe,T0){"use strict";var vme=Fr(),gme=require("@stdlib/array/dtypes"),fme=require("@stdlib/array/defaults"),dme=Ja(),lme=gme("real_floating_point_and_generic"),cme=vme(dme,lme,fme.get("dtypes.real_floating_point"));T0.exports=cme});var M0=s(function(fQe,j0){"use strict";var mme=Ac(),hme=mme();j0.exports=hme});var G0=s(function(dQe,A0){"use strict";var pme=require("@stdlib/utils/define-nonenumerable-read-only-property"),x0=M0(),yme=Ac();pme(x0,"factory",yme);A0.exports=x0});var Wc=s(function(lQe,C0){"use strict";var jt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Lv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),V0=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Ua=require("@stdlib/assert/has-own-property"),F0=require("@stdlib/assert/is-positive-number").isPrimitive,W0=require("@stdlib/assert/is-plain-object"),Gc=require("@stdlib/assert/is-uint32array"),I0=require("@stdlib/assert/is-boolean").isPrimitive,qme=require("@stdlib/math/base/assert/is-nan"),k0=require("@stdlib/assert/is-function"),z0=require("@stdlib/utils/constant-function"),bme=require("@stdlib/utils/noop"),Rv=Xe().factory,Ca=Q().factory,Vc=require("@stdlib/blas/base/gcopy"),Fc=require("@stdlib/array/uint32"),J0=require("@stdlib/object/assign"),wme=require("@stdlib/array/to-json"),Ye=require("@stdlib/string/format"),U0=require("@stdlib/math/base/special/sqrt");function Sme(){var r,e,t,i,n,a,u,o;if(u=!0,arguments.length===0)n={copy:!1},t=Ca(n);else if(arguments.length===1)if(W0(arguments[0])){if(n=arguments[0],Ua(n,"copy")&&!I0(n.copy))throw new TypeError(Ye("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",n.copy));if(Ua(n,"prng")){if(!k0(n.prng))throw new TypeError(Ye("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",n.prng));t=Ca({prng:n.prng})}else{if(Ua(n,"state")&&!Gc(n.state))throw new TypeError(Ye("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",n.state));n=J0({},n),n.copy===!1?u=!1:n.state&&(n.state=Vc(n.state.length,n.state,1,new Fc(n.state.length),1)),n.copy=!1,t=Ca(n)}}else{if(o=arguments[0],!F0(o))throw new TypeError(Ye("invalid argument. First argument must be a positive number or an options object. Value: `%s`.",o));n={copy:!1},t=Ca(n)}else{if(o=arguments[0],!F0(o))throw new TypeError(Ye("invalid argument. First argument must be a positive number. Value: `%s`.",o));if(n=arguments[1],!W0(n))throw new TypeError(Ye("invalid argument. Options argument must be an object. Value: `%s`.",n));if(Ua(n,"copy")&&!I0(n.copy))throw new TypeError(Ye("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",n.copy));if(Ua(n,"prng")){if(!k0(n.prng))throw new TypeError(Ye("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",n.prng));t=Ca({prng:n.prng})}else{if(Ua(n,"state")&&!Gc(n.state))throw new TypeError(Ye("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",n.state));n=J0({},n),n.copy===!1?u=!1:n.state&&(n.state=Vc(n.state.length,n.state,1,new Fc(n.state.length),1)),n.copy=!1,t=Ca(n)}}return n&&n.prng?o===void 0?r=Rv({prng:n.prng}):r=Rv(o,{prng:n.prng}):(n.state?e=n.state:(e=t.state,t.state=e),o===void 0?r=Rv({state:e,copy:!1}):r=Rv(o,{state:e,copy:!1})),o===void 0?a=f:a=d,i=t.PRNG,jt(a,"NAME","t"),n&&n.prng?(jt(a,"seed",null),jt(a,"seedLength",null),V0(a,"state",z0(null),bme),jt(a,"stateLength",null),jt(a,"byteLength",null),jt(a,"toJSON",z0(null))):(Lv(a,"seed",v),Lv(a,"seedLength",g),V0(a,"state",m,h),Lv(a,"stateLength",c),Lv(a,"byteLength",l),jt(a,"toJSON",p)),jt(a,"PRNG",i),a;function v(){return i.seed}function g(){return i.seedLength}function c(){return i.stateLength}function l(){return i.byteLength}function m(){return i.state}function h(y){if(!Gc(y))throw new TypeError(Ye("invalid argument. Must provide a Uint32Array. Value: `%s`.",y));u&&(y=Vc(y.length,y,1,new Fc(y.length),1)),i.state=y}function p(){var y={};return y.type="PRNG",y.name=a.NAME,y.state=wme(i.state),o===void 0?y.params=[]:y.params=[o],y}function d(){return t()/U0(r()/o)}function f(y){return qme(y)||y<=0?NaN:t()/U0(r(y)/y)}}C0.exports=Sme});var D0=s(function(cQe,B0){"use strict";var Ome=Wc(),Eme=Ome();B0.exports=Eme});var Ba=s(function(mQe,Y0){"use strict";var _me=require("@stdlib/utils/define-nonenumerable-read-only-property"),X0=D0(),Nme=Wc();_me(X0,"factory",Nme);Y0.exports=X0});var Ic=s(function(hQe,H0){"use strict";var Lme=Fr(),Rme=require("@stdlib/array/dtypes"),Pme=require("@stdlib/array/defaults"),Tme=Ba(),jme=Rme("real_floating_point_and_generic"),Mme=Lme(Tme,jme,Pme.get("dtypes.real_floating_point"));H0.exports=Mme});var Q0=s(function(pQe,Z0){"use strict";var xme=Ic(),Ame=xme();Z0.exports=Ame});var eM=s(function(yQe,K0){"use strict";var Gme=require("@stdlib/utils/define-nonenumerable-read-only-property"),$0=Q0(),Vme=Ic();Gme($0,"factory",Vme);K0.exports=$0});var tM=s(function(qQe,rM){"use strict";var kc=require("@stdlib/assert/is-number").isPrimitive,Pv=require("@stdlib/string/format"),zc=require("@stdlib/assert/is-nan");function Fme(r,e,t){return!kc(r)||zc(r)?new TypeError(Pv("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):!kc(e)||zc(e)?new TypeError(Pv("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e)):!kc(t)||zc(t)?new TypeError(Pv("invalid argument. Third argument must be a number and not NaN. Value: `%s`.",t)):r<=t&&t<=e?null:new RangeError(Pv("invalid arguments. Parameters must satisfy the following condition: %s. a: `%f`. b: `%f`. c: `%f`.","a <= c <= b",r,e,t))}rM.exports=Fme});var aM=s(function(bQe,nM){"use strict";var iM=require("@stdlib/math/base/special/sqrt");function Wme(r,e,t,i){var n,a,u;return n=(i-e)/(t-e),u=r(),u3){if(r=arguments[3],!uM(r))throw new TypeError(Mv("invalid argument. Options argument must be an object. Value: `%s`.",r));if(vM(r,"prng")){if(!oM(r.prng))throw new TypeError(Mv("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=jv(r)}else e=jv()}return n===void 0?t=d:t=p,ot(t,"NAME","triangular"),r&&r.prng?(ot(t,"seed",null),ot(t,"seedLength",null),sM(t,"state",gM(null),Ime),ot(t,"stateLength",null),ot(t,"byteLength",null),ot(t,"toJSON",gM(null)),ot(t,"PRNG",e)):(Tv(t,"seed",o),Tv(t,"seedLength",v),sM(t,"state",l,m),Tv(t,"stateLength",g),Tv(t,"byteLength",c),ot(t,"toJSON",h),ot(t,"PRNG",e),e=e.normalized),t;function o(){return e.seed}function v(){return e.seedLength}function g(){return e.stateLength}function c(){return e.byteLength}function l(){return e.state}function m(f){e.state=f}function h(){var f={};return f.type="PRNG",f.name=t.NAME,f.state=kme(e.state),n===void 0?f.params=[]:f.params=[n,a,u],f}function p(){return fM(e,n,a,u)}function d(f,y,q){return Jc(f)||Jc(y)||Jc(q)||!(f<=q&&q<=y)?NaN:fM(e,f,y,q)}}dM.exports=Jme});var cM=s(function(SQe,lM){"use strict";var Ume=Uc(),Cme=Ume();lM.exports=Cme});var Da=s(function(OQe,hM){"use strict";var Bme=require("@stdlib/utils/define-nonenumerable-read-only-property"),mM=cM(),Dme=Uc();Bme(mM,"factory",Dme);hM.exports=mM});var Cc=s(function(EQe,pM){"use strict";var Xme=bo(),Yme=require("@stdlib/array/dtypes"),Hme=require("@stdlib/array/defaults"),Zme=Da(),Qme=Yme("real_floating_point_and_generic"),$me=Xme(Zme,Qme,Hme.get("dtypes.real_floating_point"));pM.exports=$me});var qM=s(function(_Qe,yM){"use strict";var Kme=Cc(),ehe=Kme();yM.exports=ehe});var SM=s(function(NQe,wM){"use strict";var rhe=require("@stdlib/utils/define-nonenumerable-read-only-property"),bM=qM(),the=Cc();rhe(bM,"factory",the);wM.exports=bM});var NM=s(function(LQe,_M){"use strict";var OM=require("@stdlib/assert/is-number").isPrimitive,Bc=require("@stdlib/string/format"),EM=require("@stdlib/assert/is-nan");function ihe(r,e){return!OM(r)||EM(r)?new TypeError(Bc("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):!OM(e)||EM(e)?new TypeError(Bc("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e)):r>=e?new RangeError(Bc("invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.",r,e)):null}_M.exports=ihe});var RM=s(function(RQe,LM){"use strict";function nhe(r,e,t){var i=r();return t*i+(1-i)*e}LM.exports=nhe});var Dc=s(function(PQe,VM){"use strict";var vt=require("@stdlib/utils/define-nonenumerable-read-only-property"),xv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),PM=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),TM=require("@stdlib/assert/is-plain-object"),jM=require("@stdlib/assert/is-function"),MM=require("@stdlib/assert/has-own-property"),xM=require("@stdlib/utils/constant-function"),ahe=require("@stdlib/utils/noop"),Av=T().factory,AM=require("@stdlib/math/base/assert/is-nan"),she=require("@stdlib/array/to-json"),Gv=require("@stdlib/string/format"),uhe=NM(),GM=RM();function ohe(){var r,e,t,i,n,a;if(arguments.length===0)e=Av();else if(arguments.length===1){if(r=arguments[0],!TM(r))throw new TypeError(Gv("invalid argument. Options argument must be an object. Value: `%s`.",r));if(MM(r,"prng")){if(!jM(r.prng))throw new TypeError(Gv("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Av(r)}else{if(n=arguments[0],a=arguments[1],i=uhe(n,a),i)throw i;if(arguments.length>2){if(r=arguments[2],!TM(r))throw new TypeError(Gv("invalid argument. Options argument must be an object. Value: `%s`.",r));if(MM(r,"prng")){if(!jM(r.prng))throw new TypeError(Gv("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Av(r)}else e=Av()}return n===void 0?t=p:t=h,vt(t,"NAME","uniform"),r&&r.prng?(vt(t,"seed",null),vt(t,"seedLength",null),PM(t,"state",xM(null),ahe),vt(t,"stateLength",null),vt(t,"byteLength",null),vt(t,"toJSON",xM(null)),vt(t,"PRNG",e)):(xv(t,"seed",u),xv(t,"seedLength",o),PM(t,"state",c,l),xv(t,"stateLength",v),xv(t,"byteLength",g),vt(t,"toJSON",m),vt(t,"PRNG",e),e=e.normalized),t;function u(){return e.seed}function o(){return e.seedLength}function v(){return e.stateLength}function g(){return e.byteLength}function c(){return e.state}function l(d){e.state=d}function m(){var d={};return d.type="PRNG",d.name=t.NAME,d.state=she(e.state),n===void 0?d.params=[]:d.params=[n,a],d}function h(){return GM(e,n,a)}function p(d,f){return AM(d)||AM(f)||d>=f?NaN:GM(e,d,f)}}VM.exports=ohe});var WM=s(function(TQe,FM){"use strict";var vhe=Dc(),ghe=vhe();FM.exports=ghe});var yn=s(function(jQe,kM){"use strict";var fhe=require("@stdlib/utils/define-nonenumerable-read-only-property"),IM=WM(),dhe=Dc();fhe(IM,"factory",dhe);kM.exports=IM});var Xc=s(function(MQe,zM){"use strict";var lhe=F(),che=require("@stdlib/array/dtypes"),mhe=require("@stdlib/array/defaults"),hhe=yn(),phe=che("real_floating_point_and_generic"),yhe=lhe(hhe,phe,mhe.get("dtypes.real_floating_point"));zM.exports=yhe});var UM=s(function(xQe,JM){"use strict";var qhe=Xc(),bhe=qhe();JM.exports=bhe});var DM=s(function(AQe,BM){"use strict";var whe=require("@stdlib/utils/define-nonenumerable-read-only-property"),CM=UM(),She=Xc();whe(CM,"factory",She);BM.exports=CM});var ZM=s(function(GQe,HM){"use strict";var XM=require("@stdlib/assert/is-positive-number").isPrimitive,YM=require("@stdlib/string/format");function Ohe(r,e){return XM(r)?XM(e)?null:new TypeError(YM("invalid argument. Shape parameter must be a positive number. Value: `%s`.",e)):new TypeError(YM("invalid argument. Scale parameter must be a positive number. Value: `%s`.",r))}HM.exports=Ohe});var $M=s(function(VQe,QM){"use strict";var Ehe=require("@stdlib/math/base/special/pow"),_he=require("@stdlib/math/base/special/ln");function Nhe(r,e,t){return t*Ehe(-_he(1-r()),1/e)}QM.exports=Nhe});var Yc=s(function(FQe,sx){"use strict";var gt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Vv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),KM=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),ex=require("@stdlib/assert/is-plain-object"),rx=require("@stdlib/assert/is-function"),tx=require("@stdlib/assert/has-own-property"),ix=require("@stdlib/utils/constant-function"),Lhe=require("@stdlib/utils/noop"),Fv=T().factory,nx=require("@stdlib/math/base/assert/is-nan"),Rhe=require("@stdlib/array/to-json"),Wv=require("@stdlib/string/format"),Phe=ZM(),ax=$M();function The(){var r,e,t,i,n,a;if(arguments.length===0)t=Fv();else if(arguments.length===1){if(e=arguments[0],!ex(e))throw new TypeError(Wv("invalid argument. Options argument must be an object. Value: `%s`.",e));if(tx(e,"prng")){if(!rx(e.prng))throw new TypeError(Wv("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));t=e.prng}else t=Fv(e)}else{if(a=arguments[0],r=arguments[1],n=Phe(r,a),n)throw n;if(arguments.length>2){if(e=arguments[2],!ex(e))throw new TypeError(Wv("invalid argument. Options argument must be an object. Value: `%s`.",e));if(tx(e,"prng")){if(!rx(e.prng))throw new TypeError(Wv("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));t=e.prng}else t=Fv(e)}else t=Fv()}return r===void 0?i=p:i=h,gt(i,"NAME","weibull"),e&&e.prng?(gt(i,"seed",null),gt(i,"seedLength",null),KM(i,"state",ix(null),Lhe),gt(i,"stateLength",null),gt(i,"byteLength",null),gt(i,"toJSON",ix(null)),gt(i,"PRNG",t)):(Vv(i,"seed",u),Vv(i,"seedLength",o),KM(i,"state",c,l),Vv(i,"stateLength",v),Vv(i,"byteLength",g),gt(i,"toJSON",m),gt(i,"PRNG",t),t=t.normalized),i;function u(){return t.seed}function o(){return t.seedLength}function v(){return t.stateLength}function g(){return t.byteLength}function c(){return t.state}function l(d){t.state=d}function m(){var d={};return d.type="PRNG",d.name=i.NAME,d.state=Rhe(t.state),a===void 0?d.params=[]:d.params=[a,r],d}function h(){return ax(t,a,r)}function p(d,f){return nx(d)||nx(f)||d<=0||f<=0?NaN:ax(t,d,f)}}sx.exports=The});var ox=s(function(WQe,ux){"use strict";var jhe=Yc(),Mhe=jhe();ux.exports=Mhe});var qn=s(function(IQe,gx){"use strict";var xhe=require("@stdlib/utils/define-nonenumerable-read-only-property"),vx=ox(),Ahe=Yc();xhe(vx,"factory",Ahe);gx.exports=vx});var Hc=s(function(kQe,fx){"use strict";var Ghe=F(),Vhe=require("@stdlib/array/dtypes"),Fhe=require("@stdlib/array/defaults"),Whe=qn(),Ihe=Vhe("real_floating_point_and_generic"),khe=Ghe(Whe,Ihe,Fhe.get("dtypes.real_floating_point"));fx.exports=khe});var lx=s(function(zQe,dx){"use strict";var zhe=Hc(),Jhe=zhe();dx.exports=Jhe});var hx=s(function(JQe,mx){"use strict";var Uhe=require("@stdlib/utils/define-nonenumerable-read-only-property"),cx=lx(),Che=Hc();Uhe(cx,"factory",Che);mx.exports=cx});var yx=s(function(UQe,px){"use strict";var M=require("@stdlib/utils/define-read-only-property"),j={};M(j,"arcsine",iy());M(j,"bernoulli",xy());M(j,"beta",Iq());M(j,"betaprime",Pb());M(j,"binomial",aw());M(j,"cauchy",Rw());M(j,"chi",rS());M(j,"chisquare",uS());M(j,"cosine",TS());M(j,"discreteUniform",rO());M(j,"erlang",EO());M(j,"exponential",UO());M(j,"f",lE());M(j,"frechet",HE());M(j,"gamma",r_());M(j,"geometric",w_());M(j,"gumbel",B_());M(j,"hypergeometric",mN());M(j,"invgamma",VN());M(j,"kumaraswamy",uL());M(j,"laplace",TL());M(j,"levy",KL());M(j,"logistic",SR());M(j,"lognormal",BR());M(j,"minstd",yP());M(j,"minstdShuffle",YP());M(j,"mt19937",fT());M(j,"negativeBinomial",ZT());M(j,"normal",qj());M(j,"pareto1",Uj());M(j,"poisson",Hj());M(j,"randu",h0());M(j,"rayleigh",G0());M(j,"t",eM());M(j,"triangular",SM());M(j,"uniform",DM());M(j,"weibull",hx());px.exports=j});var bx=s(function(CQe,qx){"use strict";var Bhe=require("@stdlib/math/base/special/sqrt"),Dhe=require("@stdlib/math/base/special/ln"),Xhe=require("@stdlib/math/base/special/sin"),Yhe=require("@stdlib/math/base/special/cos"),Hhe=require("@stdlib/constants/float64/two-pi");function Zhe(r){var e,t;return e=!0,i;function i(){var n,a,u,o;if(e){do n=r(),a=r();while(n===0);return u=Bhe(-2*Dhe(n)),o=Hhe*a,t=u*Yhe(o),e=!1,u*Xhe(o)}return e=!0,t}}qx.exports=Zhe});var Sx=s(function(BQe,wx){"use strict";var Qhe=require("@stdlib/math/base/special/sqrt"),$he=require("@stdlib/math/base/special/ln"),Khe=require("@stdlib/math/base/special/cos"),epe=require("@stdlib/constants/float64/pi"),rpe=Khe(epe);function tpe(r){var e=Qhe(-2*$he(r));return e*rpe}wx.exports=tpe});var Ex=s(function(DQe,Ox){"use strict";var ipe=require("@stdlib/math/base/special/sqrt"),npe=require("@stdlib/math/base/special/ln"),ape=require("@stdlib/math/base/special/cos"),spe=require("@stdlib/constants/float64/two-pi");function upe(r){var e=ipe(-2*npe(r)),t=spe*r;return e*ape(t)}Ox.exports=upe});var Zc=s(function(XQe,Rx){"use strict";var re=require("@stdlib/utils/define-nonenumerable-read-only-property"),Iv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),_x=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),ope=require("@stdlib/assert/is-plain-object"),vpe=require("@stdlib/assert/is-function"),gpe=require("@stdlib/assert/is-boolean").isPrimitive,lu=require("@stdlib/assert/has-own-property"),fpe=require("@stdlib/assert/is-uint32array"),Nx=T().factory,Lx=require("@stdlib/utils/constant-function"),dpe=require("@stdlib/utils/noop"),lpe=require("@stdlib/array/to-json"),cu=require("@stdlib/string/format"),cpe=bx(),mpe=Sx(),hpe=Ex();function ppe(r){var e,t,i,n;if(n={copy:!0},arguments.length){if(!ope(r))throw new TypeError(cu("invalid argument. Must provide an object. Value: `%s`.",r));if(lu(r,"copy")&&(n.copy=r.copy,!gpe(r.copy)))throw new TypeError(cu("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",r.copy));if(lu(r,"prng")){if(!vpe(r.prng))throw new TypeError(cu("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else if(lu(r,"state")){if(n.state=r.state,!fpe(r.state))throw new TypeError(cu("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",r.state))}else if(lu(r,"seed")&&(n.seed=r.seed,r.seed===void 0))throw new TypeError(cu("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",r.seed))}return n.state===void 0?e===void 0?(i=Nx(n),e=i.normalized):n.seed=null:(i=Nx(n),e=i.normalized),t=cpe(e),re(t,"NAME","box-muller"),n.seed===null?(re(t,"seed",null),re(t,"seedLength",null)):(Iv(t,"seed",a),Iv(t,"seedLength",u)),r&&r.prng?(_x(t,"state",Lx(null),dpe),re(t,"stateLength",null),re(t,"byteLength",null),re(t,"toJSON",Lx(null))):(_x(t,"state",g,c),Iv(t,"stateLength",o),Iv(t,"byteLength",v),re(t,"toJSON",l)),re(t,"PRNG",e),lu(e,"MIN")?(re(t,"MIN",mpe(e.MIN)),re(t,"MAX",hpe(e.MIN))):(re(t,"MIN",null),re(t,"MAX",null)),t;function a(){return i.seed}function u(){return i.seedLength}function o(){return i.stateLength}function v(){return i.byteLength}function g(){return i.state}function c(m){i.state=m}function l(){var m={};return m.type="PRNG",m.name=t.NAME,m.state=lpe(i.state),m.params=[],m}}Rx.exports=ppe});var Tx=s(function(YQe,Px){"use strict";var ype=Zc(),qpe=ype();Px.exports=qpe});var Xa=s(function(HQe,Mx){"use strict";var bpe=require("@stdlib/utils/define-nonenumerable-read-only-property"),jx=Tx(),wpe=Zc();bpe(jx,"factory",wpe);Mx.exports=jx});var xx=s(function(ZQe,Spe){Spe.exports={name:"mt19937",copy:!0}});var Gx=s(function(QQe,Ax){"use strict";var Ope=$(),Epe=ee(),_pe=T(),kv={};kv.minstd=Ope;kv["minstd-shuffle"]=Epe;kv.mt19937=_pe;Ax.exports=kv});var Qc=s(function($Qe,Fx){"use strict";var mu=require("@stdlib/utils/define-nonenumerable-read-only-property"),zv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Npe=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Lpe=require("@stdlib/assert/is-plain-object"),Rpe=require("@stdlib/assert/is-boolean").isPrimitive,Jv=require("@stdlib/assert/has-own-property"),Ppe=require("@stdlib/array/to-json"),hu=require("@stdlib/string/format"),Vx=xx(),Tpe=Gx();function jpe(r){var e,t,i;if(e={name:Vx.name,copy:Vx.copy},arguments.length){if(!Lpe(r))throw new TypeError(hu("invalid argument. Must provide an object. Value: `%s`.",r));if(Jv(r,"name")&&(e.name=r.name),Jv(r,"state")){if(e.state=r.state,e.state===void 0)throw new TypeError(hu("invalid option. `%s` option cannot be undefined. Option: `%s`.","state",e.state))}else if(Jv(r,"seed")&&(e.seed=r.seed,e.seed===void 0))throw new TypeError(hu("invalid option. `%s` option cannot be undefined. Option: `%s`.","seed",e.seed));if(Jv(r,"copy")&&(e.copy=r.copy,!Rpe(e.copy)))throw new TypeError(hu("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",e.copy))}if(i=Tpe[e.name],i===void 0)throw new Error(hu("invalid option. Unrecognized/unsupported PRNG. Option: `%s`.",e.name));return e.state===void 0?e.seed===void 0?t=i.factory():t=i.factory({seed:e.seed}):t=i.factory({state:e.state,copy:e.copy}),mu(l,"NAME","randi"),zv(l,"seed",n),zv(l,"seedLength",a),Npe(l,"state",v,g),zv(l,"stateLength",u),zv(l,"byteLength",o),mu(l,"toJSON",c),mu(l,"PRNG",t),mu(l,"MIN",t.MIN),mu(l,"MAX",t.MAX),l;function n(){return t.seed}function a(){return t.seedLength}function u(){return t.stateLength}function o(){return t.byteLength}function v(){return t.state}function g(m){t.state=m}function c(){var m={};return m.type="PRNG",m.name=l.NAME+"-"+t.NAME,m.state=Ppe(t.state),m.params=[],m}function l(){return t()}}Fx.exports=jpe});var Ix=s(function(KQe,Wx){"use strict";var Mpe=Qc(),xpe=Mpe();Wx.exports=xpe});var pu=s(function(e$e,zx){"use strict";var Ape=require("@stdlib/utils/define-nonenumerable-read-only-property"),kx=Ix(),Gpe=Qc();Ape(kx,"factory",Gpe);zx.exports=kx});var Jx=s(function(r$e,Vpe){Vpe.exports={name:"improved-ziggurat",copy:!0}});var Cx=s(function(t$e,Ux){"use strict";var Fpe=Xa(),Wpe=Q(),$c={};$c["box-muller"]=Fpe;$c["improved-ziggurat"]=Wpe;Ux.exports=$c});var Kc=s(function(i$e,Yx){"use strict";var Mt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Uv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Bx=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Ipe=require("@stdlib/assert/is-plain-object"),kpe=require("@stdlib/assert/is-boolean").isPrimitive,yu=require("@stdlib/assert/has-own-property"),Dx=require("@stdlib/utils/constant-function"),Ya=require("@stdlib/string/format"),zpe=require("@stdlib/utils/noop"),Jpe=require("@stdlib/array/to-json"),Xx=Jx(),Upe=Cx();function Cpe(r){var e,t,i;if(e={name:Xx.name,copy:Xx.copy},arguments.length){if(!Ipe(r))throw new TypeError(Ya("invalid argument. Must provide an object. Value: `%s`.",r));if(yu(r,"name")&&(e.name=r.name),yu(r,"prng")){if(e.prng=r.prng,e.prng===void 0)throw new TypeError(Ya("invalid option. `%s` option cannot be undefined. Option: `%s`.","prng",e.prng))}else if(yu(r,"state")){if(e.state=r.state,e.state===void 0)throw new TypeError(Ya("invalid option. `%s` option cannot be undefined. Option: `%s`.","state",e.state))}else if(yu(r,"seed")&&(e.seed=r.seed,e.seed===void 0))throw new TypeError(Ya("invalid option. `%s` option cannot be undefined. Option: `%s`.","seed",e.seed));if(yu(r,"copy")&&(e.copy=r.copy,!kpe(e.copy)))throw new TypeError(Ya("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",e.copy))}if(i=Upe[e.name],i===void 0)throw new Error(Ya("invalid option. Unrecognized/unsupported PRNG. Option: `%s`.",e.name));return e.prng===void 0?e.state===void 0?e.seed===void 0?t=i.factory():t=i.factory({seed:e.seed}):t=i.factory({state:e.state,copy:e.copy}):t=i.factory({prng:e.prng}),Mt(l,"NAME","randn"),e.prng?(Mt(l,"seed",null),Mt(l,"seedLength",null),Bx(l,"state",Dx(null),zpe),Mt(l,"stateLength",null),Mt(l,"byteLength",null),Mt(l,"toJSON",Dx(null))):(Uv(l,"seed",n),Uv(l,"seedLength",a),Bx(l,"state",v,g),Uv(l,"stateLength",u),Uv(l,"byteLength",o),Mt(l,"toJSON",c)),Mt(l,"PRNG",t.PRNG),l;function n(){return t.seed}function a(){return t.seedLength}function u(){return t.stateLength}function o(){return t.byteLength}function v(){return t.state}function g(m){t.state=m}function c(){var m={};return m.type="PRNG",m.name=l.NAME+"-"+t.NAME,m.state=Jpe(t.state),m.params=[],m}function l(){return t()}}Yx.exports=Cpe});var Zx=s(function(n$e,Hx){"use strict";var Bpe=Kc(),Dpe=Bpe();Hx.exports=Dpe});var qu=s(function(a$e,$x){"use strict";var Xpe=require("@stdlib/utils/define-nonenumerable-read-only-property"),Qx=Zx(),Ype=Kc();Xpe(Qx,"factory",Ype);$x.exports=Qx});var e1=s(function(s$e,Kx){"use strict";var Hpe=nn(),Zpe=an(),Qpe=un(),$pe=on(),Kpe=ca(),eye=Xa(),rye=ha(),tye=vn(),iye=Xe(),nye=gn(),aye=fn(),sye=wa(),uye=dn(),oye=Oa(),vye=_a(),gye=Ce(),fye=ln(),dye=Na(),lye=La(),cye=Q(),mye=cn(),hye=Pa(),pye=Ta(),yye=ja(),qye=Ma(),bye=mn(),wye=$(),Sye=ee(),Oye=T(),Eye=Ia(),_ye=pn(),Nye=za(),Lye=hn(),Rye=pu(),Pye=qu(),Tye=Tt(),jye=Ja(),Mye=Ba(),xye=Da(),Aye=yn(),Gye=qn(),E={};E.arcsine=Hpe.factory;E.bernoulli=Zpe.factory;E.beta=Qpe.factory;E.betaprime=$pe.factory;E.binomial=Kpe.factory;E["box-muller"]=eye.factory;E.cauchy=rye.factory;E.chi=tye.factory;E.chisquare=iye.factory;E.cosine=nye.factory;E["discrete-uniform"]=aye.factory;E.erlang=sye.factory;E.exponential=uye.factory;E.f=oye.factory;E.frechet=vye.factory;E.gamma=gye.factory;E.geometric=fye.factory;E.gumbel=dye.factory;E.hypergeometric=lye.factory;E["improved-ziggurat"]=cye.factory;E.invgamma=mye.factory;E.kumaraswamy=hye.factory;E.laplace=pye.factory;E.levy=yye.factory;E.logistic=qye.factory;E.lognormal=bye.factory;E.minstd=wye.factory;E["minstd-shuffle"]=Sye.factory;E.mt19937=Oye.factory;E["negative-binomial"]=Eye.factory;E.normal=_ye.factory;E["pareto-type1"]=Nye.factory;E.poisson=Lye.factory;E.randi=Rye.factory;E.randn=Pye.factory;E.randu=Tye.factory;E.rayleigh=jye.factory;E.t=Mye.factory;E.triangular=xye.factory;E.uniform=Aye.factory;E.weibull=Gye.factory;Kx.exports=E});var a1=s(function(u$e,n1){"use strict";var r1=require("@stdlib/assert/is-string").isPrimitive,Vye=require("@stdlib/assert/is-plain-object"),t1=require("@stdlib/assert/is-array"),Fye=require("@stdlib/assert/contains"),Wye=require("@stdlib/array/int32"),Iye=require("@stdlib/array/uint32"),i1=e1(),kye={Int32Array:Wye,Uint32Array:Iye},zye=["randi","randn","randu"];function Jye(r,e){var t,i,n,a,u;if(e&&e.type==="PRNG"&&r1(e.name)&&Vye(e.state)&&t1(e.params)&&r1(e.state.type)&&t1(e.state.data)&&(i={},t=i1[e.name],t===void 0&&(u=e.name.split("-"),Fye(zye,u[0])&&(t=i1[u[0]],i.name=u.slice(1).join("-"))),t&&(a=kye[e.state.type],a))){i.state=new a(e.state.data),n=e.params.slice(),n.push(i);try{return t.apply(null,n)}catch(o){}}return e}n1.exports=Jye});var u1=s(function(o$e,s1){"use strict";var Uye=a1();s1.exports=Uye});var v1=s(function(v$e,o1){"use strict";var _=require("@stdlib/utils/define-read-only-property"),O={};_(O,"arcsine",nn());_(O,"bernoulli",an());_(O,"beta",un());_(O,"betaprime",on());_(O,"binomial",ca());_(O,"boxMuller",Xa());_(O,"cauchy",ha());_(O,"chi",vn());_(O,"chisquare",Xe());_(O,"cosine",gn());_(O,"discreteUniform",fn());_(O,"erlang",wa());_(O,"exponential",dn());_(O,"f",Oa());_(O,"frechet",_a());_(O,"gamma",Ce());_(O,"geometric",ln());_(O,"gumbel",Na());_(O,"hypergeometric",La());_(O,"improvedZiggurat",Q());_(O,"invgamma",cn());_(O,"kumaraswamy",Pa());_(O,"laplace",Ta());_(O,"levy",ja());_(O,"logistic",Ma());_(O,"lognormal",mn());_(O,"minstd",$());_(O,"minstdShuffle",ee());_(O,"mt19937",T());_(O,"negativeBinomial",Ia());_(O,"normal",pn());_(O,"pareto1",za());_(O,"poisson",hn());_(O,"randi",pu());_(O,"randn",qu());_(O,"randu",Tt());_(O,"rayleigh",Ja());_(O,"reviveBasePRNG",u1());_(O,"t",Ba());_(O,"triangular",Da());_(O,"uniform",yn());_(O,"weibull",qn());o1.exports=O});var y1=s(function(g$e,p1){"use strict";var xt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Cv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),g1=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Cye=require("@stdlib/utils/constant-function"),Bye=require("@stdlib/utils/noop"),Dye=require("@stdlib/object/assign"),f1=require("@stdlib/assert/is-number").isPrimitive,d1=require("@stdlib/math/base/assert/is-nan"),Xye=require("@stdlib/assert/is-plain-object"),Yye=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Hye=require("@stdlib/assert/has-own-property"),l1=require("@stdlib/constants/float64/max"),c1=nn().factory,m1=require("@stdlib/symbol/iterator"),bu=require("@stdlib/string/format");function h1(r,e,t){var i,n,a,u,o;if(!f1(r)||d1(r))throw new TypeError(bu("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!f1(e)||d1(e))throw new TypeError(bu("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e));if(r>=e)throw new RangeError(bu("invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.",r,e));if(arguments.length>2){if(!Xye(t))throw new TypeError(bu("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=Dye({},t),Hye(i,"iter")){if(!Yye(i.iter))throw new TypeError(bu("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=l1;a=c1(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=c1(r,e),i={iter:l1,state:a.state};return o=0,n={},xt(n,"next",v),xt(n,"return",g),i&&i.prng?(xt(n,"seed",null),xt(n,"seedLength",null),g1(n,"state",Cye(null),Bye),xt(n,"stateLength",null),xt(n,"byteLength",null)):(Cv(n,"seed",l),Cv(n,"seedLength",m),g1(n,"state",d,f),Cv(n,"stateLength",h),Cv(n,"byteLength",p)),xt(n,"PRNG",a.PRNG),m1&&xt(n,m1,c),n;function v(){return o+=1,u||o>i.iter?{done:!0}:{value:a(),done:!1}}function g(y){return u=!0,arguments.length?{value:y,done:!0}:{done:!0}}function c(){return h1(r,e,i)}function l(){return a.PRNG.seed}function m(){return a.PRNG.seedLength}function h(){return a.PRNG.stateLength}function p(){return a.PRNG.byteLength}function d(){return a.PRNG.state}function f(y){a.PRNG.state=y}}p1.exports=h1});var b1=s(function(f$e,q1){"use strict";var Zye=y1();q1.exports=Zye});var L1=s(function(d$e,N1){"use strict";var At=require("@stdlib/utils/define-nonenumerable-read-only-property"),Bv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),w1=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Qye=require("@stdlib/utils/constant-function"),$ye=require("@stdlib/utils/noop"),Kye=require("@stdlib/object/assign"),eqe=require("@stdlib/assert/is-probability").isPrimitive,rqe=require("@stdlib/assert/is-plain-object"),tqe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,iqe=require("@stdlib/assert/has-own-property"),S1=require("@stdlib/constants/float64/max"),O1=an().factory,E1=require("@stdlib/symbol/iterator"),em=require("@stdlib/string/format");function _1(r,e){var t,i,n,a,u;if(!eqe(r))throw new TypeError(em("invalid argument. First argument must be a probability. Value: `%s`.",r));if(arguments.length>1){if(!rqe(e))throw new TypeError(em("invalid argument. Options argument must be an object. Value: `%s`.",e));if(t=Kye({},e),iqe(t,"iter")){if(!tqe(t.iter))throw new TypeError(em("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=S1;n=O1(r,t),t.prng===void 0&&t.copy!==!1&&(t.state=n.state)}else n=O1(r),t={iter:S1,state:n.state};return u=0,i={},At(i,"next",o),At(i,"return",v),t&&t.prng?(At(i,"seed",null),At(i,"seedLength",null),w1(i,"state",Qye(null),$ye),At(i,"stateLength",null),At(i,"byteLength",null)):(Bv(i,"seed",c),Bv(i,"seedLength",l),w1(i,"state",p,d),Bv(i,"stateLength",m),Bv(i,"byteLength",h)),At(i,"PRNG",n.PRNG),E1&&At(i,E1,g),i;function o(){return u+=1,a||u>t.iter?{done:!0}:{value:n(),done:!1}}function v(f){return a=!0,arguments.length?{value:f,done:!0}:{done:!0}}function g(){return _1(r,t)}function c(){return n.PRNG.seed}function l(){return n.PRNG.seedLength}function m(){return n.PRNG.stateLength}function h(){return n.PRNG.byteLength}function p(){return n.PRNG.state}function d(f){n.PRNG.state=f}}N1.exports=_1});var P1=s(function(l$e,R1){"use strict";var nqe=L1();R1.exports=nqe});var F1=s(function(c$e,V1){"use strict";var Gt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Dv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),T1=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),aqe=require("@stdlib/utils/constant-function"),sqe=require("@stdlib/utils/noop"),uqe=require("@stdlib/object/assign"),j1=require("@stdlib/assert/is-positive-number").isPrimitive,oqe=require("@stdlib/assert/is-plain-object"),vqe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,gqe=require("@stdlib/assert/has-own-property"),M1=require("@stdlib/constants/float64/max"),x1=un().factory,A1=require("@stdlib/symbol/iterator"),Xv=require("@stdlib/string/format");function G1(r,e,t){var i,n,a,u,o;if(!j1(r))throw new TypeError(Xv("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!j1(e))throw new TypeError(Xv("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!oqe(t))throw new TypeError(Xv("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=uqe({},t),gqe(i,"iter")){if(!vqe(i.iter))throw new TypeError(Xv("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=M1;a=x1(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=x1(r,e),i={iter:M1,state:a.state};return o=0,n={},Gt(n,"next",v),Gt(n,"return",g),i&&i.prng?(Gt(n,"seed",null),Gt(n,"seedLength",null),T1(n,"state",aqe(null),sqe),Gt(n,"stateLength",null),Gt(n,"byteLength",null)):(Dv(n,"seed",l),Dv(n,"seedLength",m),T1(n,"state",d,f),Dv(n,"stateLength",h),Dv(n,"byteLength",p)),Gt(n,"PRNG",a.PRNG),A1&&Gt(n,A1,c),n;function v(){return o+=1,u||o>i.iter?{done:!0}:{value:a(),done:!1}}function g(y){return u=!0,arguments.length?{value:y,done:!0}:{done:!0}}function c(){return G1(r,e,i)}function l(){return a.PRNG.seed}function m(){return a.PRNG.seedLength}function h(){return a.PRNG.stateLength}function p(){return a.PRNG.byteLength}function d(){return a.PRNG.state}function f(y){a.PRNG.state=y}}V1.exports=G1});var I1=s(function(m$e,W1){"use strict";var fqe=F1();W1.exports=fqe});var X1=s(function(h$e,D1){"use strict";var Vt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Yv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),k1=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),dqe=require("@stdlib/utils/constant-function"),lqe=require("@stdlib/utils/noop"),cqe=require("@stdlib/object/assign"),z1=require("@stdlib/assert/is-positive-number").isPrimitive,mqe=require("@stdlib/assert/is-plain-object"),hqe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,pqe=require("@stdlib/assert/has-own-property"),J1=require("@stdlib/constants/float64/max"),U1=on().factory,C1=require("@stdlib/symbol/iterator"),Hv=require("@stdlib/string/format");function B1(r,e,t){var i,n,a,u,o;if(!z1(r))throw new TypeError(Hv("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!z1(e))throw new TypeError(Hv("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!mqe(t))throw new TypeError(Hv("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=cqe({},t),pqe(i,"iter")){if(!hqe(i.iter))throw new TypeError(Hv("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=J1;a=U1(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=U1(r,e),i={iter:J1,state:a.state};return o=0,n={},Vt(n,"next",v),Vt(n,"return",g),i&&i.prng?(Vt(n,"seed",null),Vt(n,"seedLength",null),k1(n,"state",dqe(null),lqe),Vt(n,"stateLength",null),Vt(n,"byteLength",null)):(Yv(n,"seed",l),Yv(n,"seedLength",m),k1(n,"state",d,f),Yv(n,"stateLength",h),Yv(n,"byteLength",p)),Vt(n,"PRNG",a.PRNG),C1&&Vt(n,C1,c),n;function v(){return o+=1,u||o>i.iter?{done:!0}:{value:a(),done:!1}}function g(y){return u=!0,arguments.length?{value:y,done:!0}:{done:!0}}function c(){return B1(r,e,i)}function l(){return a.PRNG.seed}function m(){return a.PRNG.seedLength}function h(){return a.PRNG.stateLength}function p(){return a.PRNG.byteLength}function d(){return a.PRNG.state}function f(y){a.PRNG.state=y}}D1.exports=B1});var H1=s(function(p$e,Y1){"use strict";var yqe=X1();Y1.exports=yqe});var tA=s(function(y$e,rA){"use strict";var Ft=require("@stdlib/utils/define-nonenumerable-read-only-property"),Zv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Z1=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),qqe=require("@stdlib/utils/constant-function"),bqe=require("@stdlib/utils/noop"),wqe=require("@stdlib/object/assign"),Sqe=require("@stdlib/assert/is-probability").isPrimitive,Oqe=require("@stdlib/assert/is-plain-object"),Eqe=require("@stdlib/assert/is-positive-integer").isPrimitive,_qe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Nqe=require("@stdlib/assert/has-own-property"),Q1=require("@stdlib/constants/float64/max"),$1=ca().factory,K1=require("@stdlib/symbol/iterator"),Qv=require("@stdlib/string/format");function eA(r,e,t){var i,n,a,u,o;if(!Eqe(r))throw new TypeError(Qv("invalid argument. First argument must be a positive integer. Value: `%s`.",r));if(!Sqe(e))throw new TypeError(Qv("invalid argument. Second argument must be a probability. Value: `%s`.",e));if(arguments.length>2){if(!Oqe(t))throw new TypeError(Qv("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=wqe({},t),Nqe(i,"iter")){if(!_qe(i.iter))throw new TypeError(Qv("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=Q1;a=$1(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=$1(r,e),i={iter:Q1,state:a.state};return o=0,n={},Ft(n,"next",v),Ft(n,"return",g),i&&i.prng?(Ft(n,"seed",null),Ft(n,"seedLength",null),Z1(n,"state",qqe(null),bqe),Ft(n,"stateLength",null),Ft(n,"byteLength",null)):(Zv(n,"seed",l),Zv(n,"seedLength",m),Z1(n,"state",d,f),Zv(n,"stateLength",h),Zv(n,"byteLength",p)),Ft(n,"PRNG",a.PRNG),K1&&Ft(n,K1,c),n;function v(){return o+=1,u||o>i.iter?{done:!0}:{value:a(),done:!1}}function g(y){return u=!0,arguments.length?{value:y,done:!0}:{done:!0}}function c(){return eA(r,e,i)}function l(){return a.PRNG.seed}function m(){return a.PRNG.seedLength}function h(){return a.PRNG.stateLength}function p(){return a.PRNG.byteLength}function d(){return a.PRNG.state}function f(y){a.PRNG.state=y}}rA.exports=eA});var nA=s(function(q$e,iA){"use strict";var Lqe=tA();iA.exports=Lqe});var dA=s(function(b$e,fA){"use strict";var Wt=require("@stdlib/utils/define-nonenumerable-read-only-property"),$v=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),aA=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Rqe=require("@stdlib/utils/constant-function"),Pqe=require("@stdlib/utils/noop"),Tqe=require("@stdlib/object/assign"),jqe=require("@stdlib/assert/is-plain-object"),Mqe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,xqe=require("@stdlib/assert/has-own-property"),sA=require("@stdlib/constants/float64/max"),uA=Xa().factory,oA=require("@stdlib/symbol/iterator"),vA=require("@stdlib/string/format");function gA(r){var e,t,i,n,a;if(arguments.length>0){if(!jqe(r))throw new TypeError(vA("invalid argument. Options argument must be an object. Value: `%s`.",r));if(e=Tqe({},r),xqe(e,"iter")){if(!Mqe(e.iter))throw new TypeError(vA("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",e.iter))}else e.iter=sA;i=uA(e),e.prng===void 0&&e.copy!==!1&&(e.state=i.state)}else i=uA(),e={iter:sA,state:i.state};return a=0,t={},Wt(t,"next",u),Wt(t,"return",o),e&&e.prng?(Wt(t,"seed",null),Wt(t,"seedLength",null),aA(t,"state",Rqe(null),Pqe),Wt(t,"stateLength",null),Wt(t,"byteLength",null)):($v(t,"seed",g),$v(t,"seedLength",c),aA(t,"state",h,p),$v(t,"stateLength",l),$v(t,"byteLength",m)),Wt(t,"PRNG",i.PRNG),oA&&Wt(t,oA,v),t;function u(){return a+=1,n||a>e.iter?{done:!0}:{value:i(),done:!1}}function o(d){return n=!0,arguments.length?{value:d,done:!0}:{done:!0}}function v(){return gA(e)}function g(){return i.PRNG.seed}function c(){return i.PRNG.seedLength}function l(){return i.PRNG.stateLength}function m(){return i.PRNG.byteLength}function h(){return i.PRNG.state}function p(d){i.PRNG.state=d}}fA.exports=gA});var cA=s(function(w$e,lA){"use strict";var Aqe=dA();lA.exports=Aqe});var wA=s(function(S$e,bA){"use strict";var It=require("@stdlib/utils/define-nonenumerable-read-only-property"),Kv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),mA=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Gqe=require("@stdlib/utils/constant-function"),Vqe=require("@stdlib/utils/noop"),Fqe=require("@stdlib/object/assign"),Wqe=require("@stdlib/assert/is-number").isPrimitive,Iqe=require("@stdlib/math/base/assert/is-nan"),kqe=require("@stdlib/assert/is-plain-object"),zqe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Jqe=require("@stdlib/assert/is-positive-number").isPrimitive,Uqe=require("@stdlib/assert/has-own-property"),hA=require("@stdlib/constants/float64/max"),pA=ha().factory,yA=require("@stdlib/symbol/iterator"),eg=require("@stdlib/string/format");function qA(r,e,t){var i,n,a,u,o;if(!Wqe(r)||Iqe(r))throw new TypeError(eg("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!Jqe(e))throw new TypeError(eg("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!kqe(t))throw new TypeError(eg("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=Fqe({},t),Uqe(i,"iter")){if(!zqe(i.iter))throw new TypeError(eg("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=hA;a=pA(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=pA(r,e),i={iter:hA,state:a.state};return o=0,n={},It(n,"next",v),It(n,"return",g),i&&i.prng?(It(n,"seed",null),It(n,"seedLength",null),mA(n,"state",Gqe(null),Vqe),It(n,"stateLength",null),It(n,"byteLength",null)):(Kv(n,"seed",l),Kv(n,"seedLength",m),mA(n,"state",d,f),Kv(n,"stateLength",h),Kv(n,"byteLength",p)),It(n,"PRNG",a.PRNG),yA&&It(n,yA,c),n;function v(){return o+=1,u||o>i.iter?{done:!0}:{value:a(),done:!1}}function g(y){return u=!0,arguments.length?{value:y,done:!0}:{done:!0}}function c(){return qA(r,e,i)}function l(){return a.PRNG.seed}function m(){return a.PRNG.seedLength}function h(){return a.PRNG.stateLength}function p(){return a.PRNG.byteLength}function d(){return a.PRNG.state}function f(y){a.PRNG.state=y}}bA.exports=qA});var OA=s(function(O$e,SA){"use strict";var Cqe=wA();SA.exports=Cqe});var TA=s(function(E$e,PA){"use strict";var kt=require("@stdlib/utils/define-nonenumerable-read-only-property"),rg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),EA=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Bqe=require("@stdlib/utils/constant-function"),Dqe=require("@stdlib/utils/noop"),Xqe=require("@stdlib/object/assign"),Yqe=require("@stdlib/assert/is-positive-number").isPrimitive,Hqe=require("@stdlib/assert/is-plain-object"),Zqe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Qqe=require("@stdlib/assert/has-own-property"),_A=require("@stdlib/constants/float64/max"),NA=vn().factory,LA=require("@stdlib/symbol/iterator"),rm=require("@stdlib/string/format");function RA(r,e){var t,i,n,a,u;if(!Yqe(r))throw new TypeError(rm("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(arguments.length>1){if(!Hqe(e))throw new TypeError(rm("invalid argument. Options argument must be an object. Value: `%s`.",e));if(t=Xqe({},e),Qqe(t,"iter")){if(!Zqe(t.iter))throw new TypeError(rm("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=_A;n=NA(r,t),t.prng===void 0&&t.copy!==!1&&(t.state=n.state)}else n=NA(r),t={iter:_A,state:n.state};return u=0,i={},kt(i,"next",o),kt(i,"return",v),t&&t.prng?(kt(i,"seed",null),kt(i,"seedLength",null),EA(i,"state",Bqe(null),Dqe),kt(i,"stateLength",null),kt(i,"byteLength",null)):(rg(i,"seed",c),rg(i,"seedLength",l),EA(i,"state",p,d),rg(i,"stateLength",m),rg(i,"byteLength",h)),kt(i,"PRNG",n.PRNG),LA&&kt(i,LA,g),i;function o(){return u+=1,a||u>t.iter?{done:!0}:{value:n(),done:!1}}function v(f){return a=!0,arguments.length?{value:f,done:!0}:{done:!0}}function g(){return RA(r,t)}function c(){return n.PRNG.seed}function l(){return n.PRNG.seedLength}function m(){return n.PRNG.stateLength}function h(){return n.PRNG.byteLength}function p(){return n.PRNG.state}function d(f){n.PRNG.state=f}}PA.exports=RA});var MA=s(function(_$e,jA){"use strict";var $qe=TA();jA.exports=$qe});var IA=s(function(N$e,WA){"use strict";var zt=require("@stdlib/utils/define-nonenumerable-read-only-property"),tg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),xA=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Kqe=require("@stdlib/utils/constant-function"),ebe=require("@stdlib/utils/noop"),rbe=require("@stdlib/object/assign"),tbe=require("@stdlib/assert/is-positive-number").isPrimitive,ibe=require("@stdlib/assert/is-plain-object"),nbe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,abe=require("@stdlib/assert/has-own-property"),AA=require("@stdlib/constants/float64/max"),GA=Xe().factory,VA=require("@stdlib/symbol/iterator"),tm=require("@stdlib/string/format");function FA(r,e){var t,i,n,a,u;if(!tbe(r))throw new TypeError(tm("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(arguments.length>1){if(!ibe(e))throw new TypeError(tm("invalid argument. Options argument must be an object. Value: `%s`.",e));if(t=rbe({},e),abe(t,"iter")){if(!nbe(t.iter))throw new TypeError(tm("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=AA;n=GA(r,t),t.prng===void 0&&t.copy!==!1&&(t.state=n.state)}else n=GA(r),t={iter:AA,state:n.state};return u=0,i={},zt(i,"next",o),zt(i,"return",v),t&&t.prng?(zt(i,"seed",null),zt(i,"seedLength",null),xA(i,"state",Kqe(null),ebe),zt(i,"stateLength",null),zt(i,"byteLength",null)):(tg(i,"seed",c),tg(i,"seedLength",l),xA(i,"state",p,d),tg(i,"stateLength",m),tg(i,"byteLength",h)),zt(i,"PRNG",n.PRNG),VA&&zt(i,VA,g),i;function o(){return u+=1,a||u>t.iter?{done:!0}:{value:n(),done:!1}}function v(f){return a=!0,arguments.length?{value:f,done:!0}:{done:!0}}function g(){return FA(r,t)}function c(){return n.PRNG.seed}function l(){return n.PRNG.seedLength}function m(){return n.PRNG.stateLength}function h(){return n.PRNG.byteLength}function p(){return n.PRNG.state}function d(f){n.PRNG.state=f}}WA.exports=FA});var zA=s(function(L$e,kA){"use strict";var sbe=IA();kA.exports=sbe});var YA=s(function(R$e,XA){"use strict";var Jt=require("@stdlib/utils/define-nonenumerable-read-only-property"),ig=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),JA=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),ube=require("@stdlib/utils/constant-function"),obe=require("@stdlib/utils/noop"),vbe=require("@stdlib/object/assign"),gbe=require("@stdlib/assert/is-number").isPrimitive,fbe=require("@stdlib/math/base/assert/is-nan"),dbe=require("@stdlib/assert/is-plain-object"),lbe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,cbe=require("@stdlib/assert/is-positive-number").isPrimitive,mbe=require("@stdlib/assert/has-own-property"),UA=require("@stdlib/constants/float64/max"),CA=gn().factory,BA=require("@stdlib/symbol/iterator"),ng=require("@stdlib/string/format");function DA(r,e,t){var i,n,a,u,o;if(!gbe(r)||fbe(r))throw new TypeError(ng("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!cbe(e))throw new TypeError(ng("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!dbe(t))throw new TypeError(ng("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=vbe({},t),mbe(i,"iter")){if(!lbe(i.iter))throw new TypeError(ng("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=UA;a=CA(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=CA(r,e),i={iter:UA,state:a.state};return o=0,n={},Jt(n,"next",v),Jt(n,"return",g),i&&i.prng?(Jt(n,"seed",null),Jt(n,"seedLength",null),JA(n,"state",ube(null),obe),Jt(n,"stateLength",null),Jt(n,"byteLength",null)):(ig(n,"seed",l),ig(n,"seedLength",m),JA(n,"state",d,f),ig(n,"stateLength",h),ig(n,"byteLength",p)),Jt(n,"PRNG",a.PRNG),BA&&Jt(n,BA,c),n;function v(){return o+=1,u||o>i.iter?{done:!0}:{value:a(),done:!1}}function g(y){return u=!0,arguments.length?{value:y,done:!0}:{done:!0}}function c(){return DA(r,e,i)}function l(){return a.PRNG.seed}function m(){return a.PRNG.seedLength}function h(){return a.PRNG.stateLength}function p(){return a.PRNG.byteLength}function d(){return a.PRNG.state}function f(y){a.PRNG.state=y}}XA.exports=DA});var ZA=s(function(P$e,HA){"use strict";var hbe=YA();HA.exports=hbe});var nG=s(function(T$e,iG){"use strict";var Ut=require("@stdlib/utils/define-nonenumerable-read-only-property"),ag=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),QA=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),pbe=require("@stdlib/utils/constant-function"),ybe=require("@stdlib/utils/noop"),qbe=require("@stdlib/object/assign"),$A=require("@stdlib/assert/is-number").isPrimitive,bbe=require("@stdlib/assert/is-plain-object"),wbe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Sbe=require("@stdlib/assert/has-own-property"),KA=require("@stdlib/constants/float64/max"),eG=fn().factory,rG=require("@stdlib/symbol/iterator"),wu=require("@stdlib/string/format");function tG(r,e,t){var i,n,a,u,o;if(!$A(r))throw new TypeError(wu("invalid argument. First argument must be an integer. Value: `%s`.",r));if(!$A(e))throw new TypeError(wu("invalid argument. Second argument must be an integer. Value: `%s`.",e));if(r>e)throw new RangeError(wu("invalid argument. Minimum support must be less than or equal to maximum support. Value: `[%d,%d]`.",r,e));if(arguments.length>2){if(!bbe(t))throw new TypeError(wu("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=qbe({},t),Sbe(i,"iter")){if(!wbe(i.iter))throw new TypeError(wu("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=KA;a=eG(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=eG(r,e),i={iter:KA,state:a.state};return o=0,n={},Ut(n,"next",v),Ut(n,"return",g),i&&i.prng?(Ut(n,"seed",null),Ut(n,"seedLength",null),QA(n,"state",pbe(null),ybe),Ut(n,"stateLength",null),Ut(n,"byteLength",null)):(ag(n,"seed",l),ag(n,"seedLength",m),QA(n,"state",d,f),ag(n,"stateLength",h),ag(n,"byteLength",p)),Ut(n,"PRNG",a.PRNG),rG&&Ut(n,rG,c),n;function v(){return o+=1,u||o>i.iter?{done:!0}:{value:a(),done:!1}}function g(y){return u=!0,arguments.length?{value:y,done:!0}:{done:!0}}function c(){return tG(r,e,i)}function l(){return a.PRNG.seed}function m(){return a.PRNG.seedLength}function h(){return a.PRNG.stateLength}function p(){return a.PRNG.byteLength}function d(){return a.PRNG.state}function f(y){a.PRNG.state=y}}iG.exports=tG});var sG=s(function(j$e,aG){"use strict";var Obe=nG();aG.exports=Obe});var lG=s(function(M$e,dG){"use strict";var Ct=require("@stdlib/utils/define-nonenumerable-read-only-property"),sg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),uG=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Ebe=require("@stdlib/utils/constant-function"),_be=require("@stdlib/utils/noop"),Nbe=require("@stdlib/object/assign"),Lbe=require("@stdlib/assert/is-positive-number").isPrimitive,Rbe=require("@stdlib/assert/is-plain-object"),Pbe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Tbe=require("@stdlib/assert/is-positive-integer").isPrimitive,jbe=require("@stdlib/assert/has-own-property"),oG=require("@stdlib/constants/float64/max"),vG=wa().factory,gG=require("@stdlib/symbol/iterator"),ug=require("@stdlib/string/format");function fG(r,e,t){var i,n,a,u,o;if(!Tbe(r))throw new TypeError(ug("invalid argument. First argument must be a positive integer. Value: `%s`.",r));if(!Lbe(e))throw new TypeError(ug("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!Rbe(t))throw new TypeError(ug("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=Nbe({},t),jbe(i,"iter")){if(!Pbe(i.iter))throw new TypeError(ug("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=oG;a=vG(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=vG(r,e),i={iter:oG,state:a.state};return o=0,n={},Ct(n,"next",v),Ct(n,"return",g),i&&i.prng?(Ct(n,"seed",null),Ct(n,"seedLength",null),uG(n,"state",Ebe(null),_be),Ct(n,"stateLength",null),Ct(n,"byteLength",null)):(sg(n,"seed",l),sg(n,"seedLength",m),uG(n,"state",d,f),sg(n,"stateLength",h),sg(n,"byteLength",p)),Ct(n,"PRNG",a.PRNG),gG&&Ct(n,gG,c),n;function v(){return o+=1,u||o>i.iter?{done:!0}:{value:a(),done:!1}}function g(y){return u=!0,arguments.length?{value:y,done:!0}:{done:!0}}function c(){return fG(r,e,i)}function l(){return a.PRNG.seed}function m(){return a.PRNG.seedLength}function h(){return a.PRNG.stateLength}function p(){return a.PRNG.byteLength}function d(){return a.PRNG.state}function f(y){a.PRNG.state=y}}dG.exports=fG});var mG=s(function(x$e,cG){"use strict";var Mbe=lG();cG.exports=Mbe});var SG=s(function(A$e,wG){"use strict";var Bt=require("@stdlib/utils/define-nonenumerable-read-only-property"),og=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),hG=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),xbe=require("@stdlib/utils/constant-function"),Abe=require("@stdlib/utils/noop"),Gbe=require("@stdlib/object/assign"),Vbe=require("@stdlib/assert/is-positive-number").isPrimitive,Fbe=require("@stdlib/assert/is-plain-object"),Wbe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Ibe=require("@stdlib/assert/has-own-property"),pG=require("@stdlib/constants/float64/max"),yG=dn().factory,qG=require("@stdlib/symbol/iterator"),im=require("@stdlib/string/format");function bG(r,e){var t,i,n,a,u;if(!Vbe(r))throw new TypeError(im("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(arguments.length>1){if(!Fbe(e))throw new TypeError(im("invalid argument. Options argument must be an object. Value: `%s`.",e));if(t=Gbe({},e),Ibe(t,"iter")){if(!Wbe(t.iter))throw new TypeError(im("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=pG;n=yG(r,t),t.prng===void 0&&t.copy!==!1&&(t.state=n.state)}else n=yG(r),t={iter:pG,state:n.state};return u=0,i={},Bt(i,"next",o),Bt(i,"return",v),t&&t.prng?(Bt(i,"seed",null),Bt(i,"seedLength",null),hG(i,"state",xbe(null),Abe),Bt(i,"stateLength",null),Bt(i,"byteLength",null)):(og(i,"seed",c),og(i,"seedLength",l),hG(i,"state",p,d),og(i,"stateLength",m),og(i,"byteLength",h)),Bt(i,"PRNG",n.PRNG),qG&&Bt(i,qG,g),i;function o(){return u+=1,a||u>t.iter?{done:!0}:{value:n(),done:!1}}function v(f){return a=!0,arguments.length?{value:f,done:!0}:{done:!0}}function g(){return bG(r,t)}function c(){return n.PRNG.seed}function l(){return n.PRNG.seedLength}function m(){return n.PRNG.stateLength}function h(){return n.PRNG.byteLength}function p(){return n.PRNG.state}function d(f){n.PRNG.state=f}}wG.exports=bG});var EG=s(function(G$e,OG){"use strict";var kbe=SG();OG.exports=kbe});var MG=s(function(V$e,jG){"use strict";var Dt=require("@stdlib/utils/define-nonenumerable-read-only-property"),vg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),_G=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),zbe=require("@stdlib/utils/constant-function"),Jbe=require("@stdlib/utils/noop"),Ube=require("@stdlib/object/assign"),NG=require("@stdlib/assert/is-positive-number").isPrimitive,Cbe=require("@stdlib/assert/is-plain-object"),Bbe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Dbe=require("@stdlib/assert/has-own-property"),LG=require("@stdlib/constants/float64/max"),RG=Oa().factory,PG=require("@stdlib/symbol/iterator"),gg=require("@stdlib/string/format");function TG(r,e,t){var i,n,a,u,o;if(!NG(r))throw new TypeError(gg("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!NG(e))throw new TypeError(gg("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!Cbe(t))throw new TypeError(gg("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=Ube({},t),Dbe(i,"iter")){if(!Bbe(i.iter))throw new TypeError(gg("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=LG;a=RG(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=RG(r,e),i={iter:LG,state:a.state};return o=0,n={},Dt(n,"next",v),Dt(n,"return",g),i&&i.prng?(Dt(n,"seed",null),Dt(n,"seedLength",null),_G(n,"state",zbe(null),Jbe),Dt(n,"stateLength",null),Dt(n,"byteLength",null)):(vg(n,"seed",l),vg(n,"seedLength",m),_G(n,"state",d,f),vg(n,"stateLength",h),vg(n,"byteLength",p)),Dt(n,"PRNG",a.PRNG),PG&&Dt(n,PG,c),n;function v(){return o+=1,u||o>i.iter?{done:!0}:{value:a(),done:!1}}function g(y){return u=!0,arguments.length?{value:y,done:!0}:{done:!0}}function c(){return TG(r,e,i)}function l(){return a.PRNG.seed}function m(){return a.PRNG.seedLength}function h(){return a.PRNG.stateLength}function p(){return a.PRNG.byteLength}function d(){return a.PRNG.state}function f(y){a.PRNG.state=y}}jG.exports=TG});var AG=s(function(F$e,xG){"use strict";var Xbe=MG();xG.exports=Xbe});var JG=s(function(W$e,zG){"use strict";var Xt=require("@stdlib/utils/define-nonenumerable-read-only-property"),fg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),GG=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Ybe=require("@stdlib/utils/constant-function"),Hbe=require("@stdlib/utils/noop"),Zbe=require("@stdlib/object/assign"),VG=require("@stdlib/assert/is-positive-number").isPrimitive,Qbe=require("@stdlib/assert/is-plain-object"),$be=require("@stdlib/assert/is-number").isPrimitive,Kbe=require("@stdlib/math/base/assert/is-nan"),ewe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,rwe=require("@stdlib/assert/has-own-property"),FG=require("@stdlib/constants/float64/max"),WG=_a().factory,IG=require("@stdlib/symbol/iterator"),Su=require("@stdlib/string/format");function kG(r,e,t,i){var n,a,u,o,v;if(!VG(r))throw new TypeError(Su("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!VG(e))throw new TypeError(Su("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(!$be(t)||Kbe(t))throw new TypeError(Su("invalid argument. Third argument must be a number. Value: `%s`.",t));if(arguments.length>3){if(!Qbe(i))throw new TypeError(Su("invalid argument. Options argument must be an object. Value: `%s`.",i));if(n=Zbe({},i),rwe(n,"iter")){if(!ewe(n.iter))throw new TypeError(Su("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",n.iter))}else n.iter=FG;u=WG(r,e,t,n),n.prng===void 0&&n.copy!==!1&&(n.state=u.state)}else u=WG(r,e,t),n={iter:FG,state:u.state};return v=0,a={},Xt(a,"next",g),Xt(a,"return",c),n&&n.prng?(Xt(a,"seed",null),Xt(a,"seedLength",null),GG(a,"state",Ybe(null),Hbe),Xt(a,"stateLength",null),Xt(a,"byteLength",null)):(fg(a,"seed",m),fg(a,"seedLength",h),GG(a,"state",f,y),fg(a,"stateLength",p),fg(a,"byteLength",d)),Xt(a,"PRNG",u.PRNG),IG&&Xt(a,IG,l),a;function g(){return v+=1,o||v>n.iter?{done:!0}:{value:u(),done:!1}}function c(q){return o=!0,arguments.length?{value:q,done:!0}:{done:!0}}function l(){return kG(r,e,t,n)}function m(){return u.PRNG.seed}function h(){return u.PRNG.seedLength}function p(){return u.PRNG.stateLength}function d(){return u.PRNG.byteLength}function f(){return u.PRNG.state}function y(q){u.PRNG.state=q}}zG.exports=kG});var CG=s(function(I$e,UG){"use strict";var twe=JG();UG.exports=twe});var $G=s(function(k$e,QG){"use strict";var Yt=require("@stdlib/utils/define-nonenumerable-read-only-property"),dg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),BG=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),iwe=require("@stdlib/utils/constant-function"),nwe=require("@stdlib/utils/noop"),awe=require("@stdlib/object/assign"),DG=require("@stdlib/assert/is-positive-number").isPrimitive,swe=require("@stdlib/assert/is-plain-object"),uwe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,owe=require("@stdlib/assert/has-own-property"),XG=require("@stdlib/constants/float64/max"),YG=Ce().factory,HG=require("@stdlib/symbol/iterator"),lg=require("@stdlib/string/format");function ZG(r,e,t){var i,n,a,u,o;if(!DG(r))throw new TypeError(lg("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!DG(e))throw new TypeError(lg("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!swe(t))throw new TypeError(lg("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=awe({},t),owe(i,"iter")){if(!uwe(i.iter))throw new TypeError(lg("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=XG;a=YG(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=YG(r,e),i={iter:XG,state:a.state};return o=0,n={},Yt(n,"next",v),Yt(n,"return",g),i&&i.prng?(Yt(n,"seed",null),Yt(n,"seedLength",null),BG(n,"state",iwe(null),nwe),Yt(n,"stateLength",null),Yt(n,"byteLength",null)):(dg(n,"seed",l),dg(n,"seedLength",m),BG(n,"state",d,f),dg(n,"stateLength",h),dg(n,"byteLength",p)),Yt(n,"PRNG",a.PRNG),HG&&Yt(n,HG,c),n;function v(){return o+=1,u||o>i.iter?{done:!0}:{value:a(),done:!1}}function g(y){return u=!0,arguments.length?{value:y,done:!0}:{done:!0}}function c(){return ZG(r,e,i)}function l(){return a.PRNG.seed}function m(){return a.PRNG.seedLength}function h(){return a.PRNG.stateLength}function p(){return a.PRNG.byteLength}function d(){return a.PRNG.state}function f(y){a.PRNG.state=y}}QG.exports=ZG});var eV=s(function(z$e,KG){"use strict";var vwe=$G();KG.exports=vwe});var uV=s(function(J$e,sV){"use strict";var Ht=require("@stdlib/utils/define-nonenumerable-read-only-property"),cg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),rV=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),gwe=require("@stdlib/utils/constant-function"),fwe=require("@stdlib/utils/noop"),dwe=require("@stdlib/object/assign"),lwe=require("@stdlib/assert/is-probability").isPrimitive,cwe=require("@stdlib/assert/is-plain-object"),mwe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,hwe=require("@stdlib/assert/has-own-property"),tV=require("@stdlib/constants/float64/max"),iV=ln().factory,nV=require("@stdlib/symbol/iterator"),nm=require("@stdlib/string/format");function aV(r,e){var t,i,n,a,u;if(!lwe(r))throw new TypeError(nm("invalid argument. First argument must be a probability. Value: `%s`.",r));if(arguments.length>1){if(!cwe(e))throw new TypeError(nm("invalid argument. Options argument must be an object. Value: `%s`.",e));if(t=dwe({},e),hwe(t,"iter")){if(!mwe(t.iter))throw new TypeError(nm("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=tV;n=iV(r,t),t.prng===void 0&&t.copy!==!1&&(t.state=n.state)}else n=iV(r),t={iter:tV,state:n.state};return u=0,i={},Ht(i,"next",o),Ht(i,"return",v),t&&t.prng?(Ht(i,"seed",null),Ht(i,"seedLength",null),rV(i,"state",gwe(null),fwe),Ht(i,"stateLength",null),Ht(i,"byteLength",null)):(cg(i,"seed",c),cg(i,"seedLength",l),rV(i,"state",p,d),cg(i,"stateLength",m),cg(i,"byteLength",h)),Ht(i,"PRNG",n.PRNG),nV&&Ht(i,nV,g),i;function o(){return u+=1,a||u>t.iter?{done:!0}:{value:n(),done:!1}}function v(f){return a=!0,arguments.length?{value:f,done:!0}:{done:!0}}function g(){return aV(r,t)}function c(){return n.PRNG.seed}function l(){return n.PRNG.seedLength}function m(){return n.PRNG.stateLength}function h(){return n.PRNG.byteLength}function p(){return n.PRNG.state}function d(f){n.PRNG.state=f}}sV.exports=aV});var vV=s(function(U$e,oV){"use strict";var pwe=uV();oV.exports=pwe});var hV=s(function(C$e,mV){"use strict";var Zt=require("@stdlib/utils/define-nonenumerable-read-only-property"),mg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),gV=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),ywe=require("@stdlib/utils/constant-function"),qwe=require("@stdlib/utils/noop"),bwe=require("@stdlib/object/assign"),wwe=require("@stdlib/assert/is-number").isPrimitive,Swe=require("@stdlib/math/base/assert/is-nan"),Owe=require("@stdlib/assert/is-plain-object"),Ewe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,_we=require("@stdlib/assert/is-positive-number").isPrimitive,Nwe=require("@stdlib/assert/has-own-property"),fV=require("@stdlib/constants/float64/max"),dV=Na().factory,lV=require("@stdlib/symbol/iterator"),hg=require("@stdlib/string/format");function cV(r,e,t){var i,n,a,u,o;if(!wwe(r)||Swe(r))throw new TypeError(hg("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!_we(e))throw new TypeError(hg("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!Owe(t))throw new TypeError(hg("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=bwe({},t),Nwe(i,"iter")){if(!Ewe(i.iter))throw new TypeError(hg("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=fV;a=dV(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=dV(r,e),i={iter:fV,state:a.state};return o=0,n={},Zt(n,"next",v),Zt(n,"return",g),i&&i.prng?(Zt(n,"seed",null),Zt(n,"seedLength",null),gV(n,"state",ywe(null),qwe),Zt(n,"stateLength",null),Zt(n,"byteLength",null)):(mg(n,"seed",l),mg(n,"seedLength",m),gV(n,"state",d,f),mg(n,"stateLength",h),mg(n,"byteLength",p)),Zt(n,"PRNG",a.PRNG),lV&&Zt(n,lV,c),n;function v(){return o+=1,u||o>i.iter?{done:!0}:{value:a(),done:!1}}function g(y){return u=!0,arguments.length?{value:y,done:!0}:{done:!0}}function c(){return cV(r,e,i)}function l(){return a.PRNG.seed}function m(){return a.PRNG.seedLength}function h(){return a.PRNG.stateLength}function p(){return a.PRNG.byteLength}function d(){return a.PRNG.state}function f(y){a.PRNG.state=y}}mV.exports=cV});var yV=s(function(B$e,pV){"use strict";var Lwe=hV();pV.exports=Lwe});var _V=s(function(D$e,EV){"use strict";var Qt=require("@stdlib/utils/define-nonenumerable-read-only-property"),pg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),qV=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Rwe=require("@stdlib/utils/constant-function"),Pwe=require("@stdlib/utils/noop"),Twe=require("@stdlib/object/assign"),jwe=require("@stdlib/assert/is-plain-object"),yg=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Mwe=require("@stdlib/assert/has-own-property"),bV=require("@stdlib/constants/float64/max"),wV=La().factory,SV=require("@stdlib/symbol/iterator"),bn=require("@stdlib/string/format");function OV(r,e,t,i){var n,a,u,o,v;if(!yg(r))throw new TypeError(bn("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",r));if(!yg(e))throw new TypeError(bn("invalid argument. Second argument must be a nonnegative integer. Value: `%s`.",e));if(!yg(t))throw new TypeError(bn("invalid argument. Third argument must be a nonnegative integer. Value: `%s`.",t));if(t>r)throw new RangeError(bn("invalid argument. Number of draws must be less than or equal to the population size. Value: `%u`.",t));if(e>r)throw new RangeError(bn("invalid argument. Subpopulation size must be less than or equal to the population size. Value: `%u`.",e));if(arguments.length>3){if(!jwe(i))throw new TypeError(bn("invalid argument. Options argument must be an object. Value: `%s`.",i));if(n=Twe({},i),Mwe(n,"iter")){if(!yg(n.iter))throw new TypeError(bn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",n.iter))}else n.iter=bV;u=wV(r,e,t,n),n.prng===void 0&&n.copy!==!1&&(n.state=u.state)}else u=wV(r,e,t),n={iter:bV,state:u.state};return v=0,a={},Qt(a,"next",g),Qt(a,"return",c),n&&n.prng?(Qt(a,"seed",null),Qt(a,"seedLength",null),qV(a,"state",Rwe(null),Pwe),Qt(a,"stateLength",null),Qt(a,"byteLength",null)):(pg(a,"seed",m),pg(a,"seedLength",h),qV(a,"state",f,y),pg(a,"stateLength",p),pg(a,"byteLength",d)),Qt(a,"PRNG",u.PRNG),SV&&Qt(a,SV,l),a;function g(){return v+=1,o||v>n.iter?{done:!0}:{value:u(),done:!1}}function c(q){return o=!0,arguments.length?{value:q,done:!0}:{done:!0}}function l(){return OV(r,e,t,n)}function m(){return u.PRNG.seed}function h(){return u.PRNG.seedLength}function p(){return u.PRNG.stateLength}function d(){return u.PRNG.byteLength}function f(){return u.PRNG.state}function y(q){u.PRNG.state=q}}EV.exports=OV});var LV=s(function(X$e,NV){"use strict";var xwe=_V();NV.exports=xwe});var GV=s(function(Y$e,AV){"use strict";var $t=require("@stdlib/utils/define-nonenumerable-read-only-property"),qg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),RV=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Awe=require("@stdlib/utils/constant-function"),Gwe=require("@stdlib/utils/noop"),Vwe=require("@stdlib/object/assign"),Fwe=require("@stdlib/assert/is-plain-object"),Wwe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Iwe=require("@stdlib/assert/has-own-property"),PV=require("@stdlib/constants/float64/max"),TV=Q().factory,jV=require("@stdlib/symbol/iterator"),MV=require("@stdlib/string/format");function xV(r){var e,t,i,n,a;if(arguments.length>0){if(!Fwe(r))throw new TypeError(MV("invalid argument. Options argument must be an object. Value: `%s`.",r));if(e=Vwe({},r),Iwe(e,"iter")){if(!Wwe(e.iter))throw new TypeError(MV("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",e.iter))}else e.iter=PV;i=TV(e),e.prng===void 0&&e.copy!==!1&&(e.state=i.state)}else i=TV(),e={iter:PV,state:i.state};return a=0,t={},$t(t,"next",u),$t(t,"return",o),e&&e.prng?($t(t,"seed",null),$t(t,"seedLength",null),RV(t,"state",Awe(null),Gwe),$t(t,"stateLength",null),$t(t,"byteLength",null)):(qg(t,"seed",g),qg(t,"seedLength",c),RV(t,"state",h,p),qg(t,"stateLength",l),qg(t,"byteLength",m)),$t(t,"PRNG",i.PRNG),jV&&$t(t,jV,v),t;function u(){return a+=1,n||a>e.iter?{done:!0}:{value:i(),done:!1}}function o(d){return n=!0,arguments.length?{value:d,done:!0}:{done:!0}}function v(){return xV(e)}function g(){return i.PRNG.seed}function c(){return i.PRNG.seedLength}function l(){return i.PRNG.stateLength}function m(){return i.PRNG.byteLength}function h(){return i.PRNG.state}function p(d){i.PRNG.state=d}}AV.exports=xV});var FV=s(function(H$e,VV){"use strict";var kwe=GV();VV.exports=kwe});var BV=s(function(Z$e,CV){"use strict";var Kt=require("@stdlib/utils/define-nonenumerable-read-only-property"),bg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),WV=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),zwe=require("@stdlib/utils/constant-function"),Jwe=require("@stdlib/utils/noop"),Uwe=require("@stdlib/object/assign"),IV=require("@stdlib/assert/is-positive-number").isPrimitive,Cwe=require("@stdlib/assert/is-plain-object"),Bwe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Dwe=require("@stdlib/assert/has-own-property"),kV=require("@stdlib/constants/float64/max"),zV=cn().factory,JV=require("@stdlib/symbol/iterator"),wg=require("@stdlib/string/format");function UV(r,e,t){var i,n,a,u,o;if(!IV(r))throw new TypeError(wg("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!IV(e))throw new TypeError(wg("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!Cwe(t))throw new TypeError(wg("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=Uwe({},t),Dwe(i,"iter")){if(!Bwe(i.iter))throw new TypeError(wg("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=kV;a=zV(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=zV(r,e),i={iter:kV,state:a.state};return o=0,n={},Kt(n,"next",v),Kt(n,"return",g),i&&i.prng?(Kt(n,"seed",null),Kt(n,"seedLength",null),WV(n,"state",zwe(null),Jwe),Kt(n,"stateLength",null),Kt(n,"byteLength",null)):(bg(n,"seed",l),bg(n,"seedLength",m),WV(n,"state",d,f),bg(n,"stateLength",h),bg(n,"byteLength",p)),Kt(n,"PRNG",a.PRNG),JV&&Kt(n,JV,c),n;function v(){return o+=1,u||o>i.iter?{done:!0}:{value:a(),done:!1}}function g(y){return u=!0,arguments.length?{value:y,done:!0}:{done:!0}}function c(){return UV(r,e,i)}function l(){return a.PRNG.seed}function m(){return a.PRNG.seedLength}function h(){return a.PRNG.stateLength}function p(){return a.PRNG.byteLength}function d(){return a.PRNG.state}function f(y){a.PRNG.state=y}}CV.exports=UV});var XV=s(function(Q$e,DV){"use strict";var Xwe=BV();DV.exports=Xwe});var r2=s(function($$e,e2){"use strict";var ei=require("@stdlib/utils/define-nonenumerable-read-only-property"),Sg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),YV=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Ywe=require("@stdlib/utils/constant-function"),Hwe=require("@stdlib/utils/noop"),Zwe=require("@stdlib/object/assign"),HV=require("@stdlib/assert/is-positive-number").isPrimitive,Qwe=require("@stdlib/assert/is-plain-object"),$we=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Kwe=require("@stdlib/assert/has-own-property"),ZV=require("@stdlib/constants/float64/max"),QV=Pa().factory,$V=require("@stdlib/symbol/iterator"),Og=require("@stdlib/string/format");function KV(r,e,t){var i,n,a,u,o;if(!HV(r))throw new TypeError(Og("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!HV(e))throw new TypeError(Og("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!Qwe(t))throw new TypeError(Og("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=Zwe({},t),Kwe(i,"iter")){if(!$we(i.iter))throw new TypeError(Og("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=ZV;a=QV(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=QV(r,e),i={iter:ZV,state:a.state};return o=0,n={},ei(n,"next",v),ei(n,"return",g),i&&i.prng?(ei(n,"seed",null),ei(n,"seedLength",null),YV(n,"state",Ywe(null),Hwe),ei(n,"stateLength",null),ei(n,"byteLength",null)):(Sg(n,"seed",l),Sg(n,"seedLength",m),YV(n,"state",d,f),Sg(n,"stateLength",h),Sg(n,"byteLength",p)),ei(n,"PRNG",a.PRNG),$V&&ei(n,$V,c),n;function v(){return o+=1,u||o>i.iter?{done:!0}:{value:a(),done:!1}}function g(y){return u=!0,arguments.length?{value:y,done:!0}:{done:!0}}function c(){return KV(r,e,i)}function l(){return a.PRNG.seed}function m(){return a.PRNG.seedLength}function h(){return a.PRNG.stateLength}function p(){return a.PRNG.byteLength}function d(){return a.PRNG.state}function f(y){a.PRNG.state=y}}e2.exports=KV});var i2=s(function(K$e,t2){"use strict";var eSe=r2();t2.exports=eSe});var g2=s(function(eKe,v2){"use strict";var ri=require("@stdlib/utils/define-nonenumerable-read-only-property"),Eg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),n2=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),rSe=require("@stdlib/utils/constant-function"),tSe=require("@stdlib/utils/noop"),iSe=require("@stdlib/object/assign"),nSe=require("@stdlib/assert/is-number").isPrimitive,aSe=require("@stdlib/math/base/assert/is-nan"),sSe=require("@stdlib/assert/is-plain-object"),uSe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,oSe=require("@stdlib/assert/is-positive-number").isPrimitive,vSe=require("@stdlib/assert/has-own-property"),a2=require("@stdlib/constants/float64/max"),s2=Ta().factory,u2=require("@stdlib/symbol/iterator"),_g=require("@stdlib/string/format");function o2(r,e,t){var i,n,a,u,o;if(!nSe(r)||aSe(r))throw new TypeError(_g("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!oSe(e))throw new TypeError(_g("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!sSe(t))throw new TypeError(_g("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=iSe({},t),vSe(i,"iter")){if(!uSe(i.iter))throw new TypeError(_g("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=a2;a=s2(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=s2(r,e),i={iter:a2,state:a.state};return o=0,n={},ri(n,"next",v),ri(n,"return",g),i&&i.prng?(ri(n,"seed",null),ri(n,"seedLength",null),n2(n,"state",rSe(null),tSe),ri(n,"stateLength",null),ri(n,"byteLength",null)):(Eg(n,"seed",l),Eg(n,"seedLength",m),n2(n,"state",d,f),Eg(n,"stateLength",h),Eg(n,"byteLength",p)),ri(n,"PRNG",a.PRNG),u2&&ri(n,u2,c),n;function v(){return o+=1,u||o>i.iter?{done:!0}:{value:a(),done:!1}}function g(y){return u=!0,arguments.length?{value:y,done:!0}:{done:!0}}function c(){return o2(r,e,i)}function l(){return a.PRNG.seed}function m(){return a.PRNG.seedLength}function h(){return a.PRNG.stateLength}function p(){return a.PRNG.byteLength}function d(){return a.PRNG.state}function f(y){a.PRNG.state=y}}v2.exports=o2});var d2=s(function(rKe,f2){"use strict";var gSe=g2();f2.exports=gSe});var q2=s(function(tKe,y2){"use strict";var ti=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ng=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),l2=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),fSe=require("@stdlib/utils/constant-function"),dSe=require("@stdlib/utils/noop"),lSe=require("@stdlib/object/assign"),cSe=require("@stdlib/assert/is-number").isPrimitive,mSe=require("@stdlib/math/base/assert/is-nan"),hSe=require("@stdlib/assert/is-plain-object"),pSe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,ySe=require("@stdlib/assert/is-positive-number").isPrimitive,qSe=require("@stdlib/assert/has-own-property"),c2=require("@stdlib/constants/float64/max"),m2=ja().factory,h2=require("@stdlib/symbol/iterator"),Lg=require("@stdlib/string/format");function p2(r,e,t){var i,n,a,u,o;if(!cSe(r)||mSe(r))throw new TypeError(Lg("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!ySe(e))throw new TypeError(Lg("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!hSe(t))throw new TypeError(Lg("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=lSe({},t),qSe(i,"iter")){if(!pSe(i.iter))throw new TypeError(Lg("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=c2;a=m2(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=m2(r,e),i={iter:c2,state:a.state};return o=0,n={},ti(n,"next",v),ti(n,"return",g),i&&i.prng?(ti(n,"seed",null),ti(n,"seedLength",null),l2(n,"state",fSe(null),dSe),ti(n,"stateLength",null),ti(n,"byteLength",null)):(Ng(n,"seed",l),Ng(n,"seedLength",m),l2(n,"state",d,f),Ng(n,"stateLength",h),Ng(n,"byteLength",p)),ti(n,"PRNG",a.PRNG),h2&&ti(n,h2,c),n;function v(){return o+=1,u||o>i.iter?{done:!0}:{value:a(),done:!1}}function g(y){return u=!0,arguments.length?{value:y,done:!0}:{done:!0}}function c(){return p2(r,e,i)}function l(){return a.PRNG.seed}function m(){return a.PRNG.seedLength}function h(){return a.PRNG.stateLength}function p(){return a.PRNG.byteLength}function d(){return a.PRNG.state}function f(y){a.PRNG.state=y}}y2.exports=p2});var w2=s(function(iKe,b2){"use strict";var bSe=q2();b2.exports=bSe});var R2=s(function(nKe,L2){"use strict";var ii=require("@stdlib/utils/define-nonenumerable-read-only-property"),Rg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),S2=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),wSe=require("@stdlib/utils/constant-function"),SSe=require("@stdlib/utils/noop"),OSe=require("@stdlib/object/assign"),ESe=require("@stdlib/assert/is-number").isPrimitive,_Se=require("@stdlib/math/base/assert/is-nan"),NSe=require("@stdlib/assert/is-plain-object"),LSe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,RSe=require("@stdlib/assert/is-positive-number").isPrimitive,PSe=require("@stdlib/assert/has-own-property"),O2=require("@stdlib/constants/float64/max"),E2=Ma().factory,_2=require("@stdlib/symbol/iterator"),Pg=require("@stdlib/string/format");function N2(r,e,t){var i,n,a,u,o;if(!ESe(r)||_Se(r))throw new TypeError(Pg("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!RSe(e))throw new TypeError(Pg("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!NSe(t))throw new TypeError(Pg("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=OSe({},t),PSe(i,"iter")){if(!LSe(i.iter))throw new TypeError(Pg("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=O2;a=E2(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=E2(r,e),i={iter:O2,state:a.state};return o=0,n={},ii(n,"next",v),ii(n,"return",g),i&&i.prng?(ii(n,"seed",null),ii(n,"seedLength",null),S2(n,"state",wSe(null),SSe),ii(n,"stateLength",null),ii(n,"byteLength",null)):(Rg(n,"seed",l),Rg(n,"seedLength",m),S2(n,"state",d,f),Rg(n,"stateLength",h),Rg(n,"byteLength",p)),ii(n,"PRNG",a.PRNG),_2&&ii(n,_2,c),n;function v(){return o+=1,u||o>i.iter?{done:!0}:{value:a(),done:!1}}function g(y){return u=!0,arguments.length?{value:y,done:!0}:{done:!0}}function c(){return N2(r,e,i)}function l(){return a.PRNG.seed}function m(){return a.PRNG.seedLength}function h(){return a.PRNG.stateLength}function p(){return a.PRNG.byteLength}function d(){return a.PRNG.state}function f(y){a.PRNG.state=y}}L2.exports=N2});var T2=s(function(aKe,P2){"use strict";var TSe=R2();P2.exports=TSe});var F2=s(function(sKe,V2){"use strict";var ni=require("@stdlib/utils/define-nonenumerable-read-only-property"),Tg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),j2=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),jSe=require("@stdlib/utils/constant-function"),MSe=require("@stdlib/utils/noop"),xSe=require("@stdlib/object/assign"),ASe=require("@stdlib/assert/is-number").isPrimitive,GSe=require("@stdlib/math/base/assert/is-nan"),VSe=require("@stdlib/assert/is-plain-object"),FSe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,WSe=require("@stdlib/assert/is-positive-number").isPrimitive,ISe=require("@stdlib/assert/has-own-property"),M2=require("@stdlib/constants/float64/max"),x2=mn().factory,A2=require("@stdlib/symbol/iterator"),jg=require("@stdlib/string/format");function G2(r,e,t){var i,n,a,u,o;if(!ASe(r)||GSe(r))throw new TypeError(jg("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!WSe(e))throw new TypeError(jg("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!VSe(t))throw new TypeError(jg("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=xSe({},t),ISe(i,"iter")){if(!FSe(i.iter))throw new TypeError(jg("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=M2;a=x2(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=x2(r,e),i={iter:M2,state:a.state};return o=0,n={},ni(n,"next",v),ni(n,"return",g),i&&i.prng?(ni(n,"seed",null),ni(n,"seedLength",null),j2(n,"state",jSe(null),MSe),ni(n,"stateLength",null),ni(n,"byteLength",null)):(Tg(n,"seed",l),Tg(n,"seedLength",m),j2(n,"state",d,f),Tg(n,"stateLength",h),Tg(n,"byteLength",p)),ni(n,"PRNG",a.PRNG),A2&&ni(n,A2,c),n;function v(){return o+=1,u||o>i.iter?{done:!0}:{value:a(),done:!1}}function g(y){return u=!0,arguments.length?{value:y,done:!0}:{done:!0}}function c(){return G2(r,e,i)}function l(){return a.PRNG.seed}function m(){return a.PRNG.seedLength}function h(){return a.PRNG.stateLength}function p(){return a.PRNG.byteLength}function d(){return a.PRNG.state}function f(y){a.PRNG.state=y}}V2.exports=G2});var I2=s(function(uKe,W2){"use strict";var kSe=F2();W2.exports=kSe});var D2=s(function(oKe,B2){"use strict";var am=require("@stdlib/utils/define-nonenumerable-read-only-property"),Mg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),zSe=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),JSe=require("@stdlib/object/assign"),USe=require("@stdlib/assert/is-plain-object"),CSe=require("@stdlib/assert/is-boolean").isPrimitive,BSe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,k2=require("@stdlib/assert/has-own-property"),z2=require("@stdlib/constants/float64/max"),J2=$().factory,U2=require("@stdlib/symbol/iterator"),sm=require("@stdlib/string/format");function C2(r){var e,t,i,n,a;if(arguments.length>0){if(!USe(r))throw new TypeError(sm("invalid argument. Options argument must be an object. Value: `%s`.",r));if(e=JSe({},r),k2(e,"normalized")&&!CSe(e.normalized))throw new TypeError(sm("invalid option. `%s` option must be a boolean. Option: `%s`.","normalized",e.normalized));if(k2(e,"iter")){if(!BSe(e.iter))throw new TypeError(sm("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",e.iter))}else e.iter=z2;i=J2(e),e.copy!==!1&&(e.state=i.state)}else i=J2(),e={iter:z2,state:i.state};return e.normalized&&(i=i.normalized),a=0,t={},am(t,"next",u),am(t,"return",o),Mg(t,"seed",g),Mg(t,"seedLength",c),zSe(t,"state",h,p),Mg(t,"stateLength",l),Mg(t,"byteLength",m),U2&&am(t,U2,v),t;function u(){return a+=1,n||a>e.iter?{done:!0}:{value:i(),done:!1}}function o(d){return n=!0,arguments.length?{value:d,done:!0}:{done:!0}}function v(){return C2(e)}function g(){return i.seed}function c(){return i.seedLength}function l(){return i.stateLength}function m(){return i.byteLength}function h(){return i.state}function p(d){i.state=d}}B2.exports=C2});var Y2=s(function(vKe,X2){"use strict";var DSe=D2();X2.exports=DSe});var rF=s(function(gKe,eF){"use strict";var um=require("@stdlib/utils/define-nonenumerable-read-only-property"),xg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),XSe=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),YSe=require("@stdlib/object/assign"),HSe=require("@stdlib/assert/is-plain-object"),ZSe=require("@stdlib/assert/is-boolean").isPrimitive,QSe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,H2=require("@stdlib/assert/has-own-property"),Z2=require("@stdlib/constants/float64/max"),Q2=ee().factory,$2=require("@stdlib/symbol/iterator"),om=require("@stdlib/string/format");function K2(r){var e,t,i,n,a;if(arguments.length>0){if(!HSe(r))throw new TypeError(om("invalid argument. Options argument must be an object. Value: `%s`.",r));if(e=YSe({},r),H2(e,"normalized")&&!ZSe(e.normalized))throw new TypeError(om("invalid option. `%s` option must be a boolean. Option: `%s`.","normalized",e.normalized));if(H2(e,"iter")){if(!QSe(e.iter))throw new TypeError(om("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",e.iter))}else e.iter=Z2;i=Q2(e),e.copy!==!1&&(e.state=i.state)}else i=Q2(),e={iter:Z2,state:i.state};return e.normalized&&(i=i.normalized),a=0,t={},um(t,"next",u),um(t,"return",o),xg(t,"seed",g),xg(t,"seedLength",c),XSe(t,"state",h,p),xg(t,"stateLength",l),xg(t,"byteLength",m),$2&&um(t,$2,v),t;function u(){return a+=1,n||a>e.iter?{done:!0}:{value:i(),done:!1}}function o(d){return n=!0,arguments.length?{value:d,done:!0}:{done:!0}}function v(){return K2(e)}function g(){return i.seed}function c(){return i.seedLength}function l(){return i.stateLength}function m(){return i.byteLength}function h(){return i.state}function p(d){i.state=d}}eF.exports=K2});var iF=s(function(fKe,tF){"use strict";var $Se=rF();tF.exports=$Se});var gF=s(function(dKe,vF){"use strict";var vm=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ag=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),KSe=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),eOe=require("@stdlib/object/assign"),rOe=require("@stdlib/assert/is-plain-object"),tOe=require("@stdlib/assert/is-boolean").isPrimitive,iOe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,nF=require("@stdlib/assert/has-own-property"),aF=require("@stdlib/constants/float64/max"),sF=T().factory,uF=require("@stdlib/symbol/iterator"),gm=require("@stdlib/string/format");function oF(r){var e,t,i,n,a;if(arguments.length>0){if(!rOe(r))throw new TypeError(gm("invalid argument. Options argument must be an object. Value: `%s`.",r));if(e=eOe({},r),nF(e,"normalized")&&!tOe(e.normalized))throw new TypeError(gm("invalid option. `%s` option must be a boolean. Option: `%s`.","normalized",e.normalized));if(nF(e,"iter")){if(!iOe(e.iter))throw new TypeError(gm("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",e.iter))}else e.iter=aF;i=sF(e),e.copy!==!1&&(e.state=i.state)}else i=sF(),e={iter:aF,state:i.state};return e.normalized&&(i=i.normalized),a=0,t={},vm(t,"next",u),vm(t,"return",o),Ag(t,"seed",g),Ag(t,"seedLength",c),KSe(t,"state",h,p),Ag(t,"stateLength",l),Ag(t,"byteLength",m),uF&&vm(t,uF,v),t;function u(){return a+=1,n||a>e.iter?{done:!0}:{value:i(),done:!1}}function o(d){return n=!0,arguments.length?{value:d,done:!0}:{done:!0}}function v(){return oF(e)}function g(){return i.seed}function c(){return i.seedLength}function l(){return i.stateLength}function m(){return i.byteLength}function h(){return i.state}function p(d){i.state=d}}vF.exports=oF});var dF=s(function(lKe,fF){"use strict";var nOe=gF();fF.exports=nOe});var qF=s(function(cKe,yF){"use strict";var ai=require("@stdlib/utils/define-nonenumerable-read-only-property"),Gg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),lF=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),aOe=require("@stdlib/utils/constant-function"),sOe=require("@stdlib/utils/noop"),uOe=require("@stdlib/object/assign"),oOe=require("@stdlib/assert/is-probability").isPrimitive,vOe=require("@stdlib/assert/is-plain-object"),gOe=require("@stdlib/assert/is-positive-number").isPrimitive,fOe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,dOe=require("@stdlib/assert/has-own-property"),cF=require("@stdlib/constants/float64/max"),mF=Ia().factory,hF=require("@stdlib/symbol/iterator"),Vg=require("@stdlib/string/format");function pF(r,e,t){var i,n,a,u,o;if(!gOe(r))throw new TypeError(Vg("invalid argument. First argument must be a positive integer. Value: `%s`.",r));if(!oOe(e))throw new TypeError(Vg("invalid argument. Second argument must be a probability. Value: `%s`.",e));if(arguments.length>2){if(!vOe(t))throw new TypeError(Vg("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=uOe({},t),dOe(i,"iter")){if(!fOe(i.iter))throw new TypeError(Vg("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=cF;a=mF(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=mF(r,e),i={iter:cF,state:a.state};return o=0,n={},ai(n,"next",v),ai(n,"return",g),i&&i.prng?(ai(n,"seed",null),ai(n,"seedLength",null),lF(n,"state",aOe(null),sOe),ai(n,"stateLength",null),ai(n,"byteLength",null)):(Gg(n,"seed",l),Gg(n,"seedLength",m),lF(n,"state",d,f),Gg(n,"stateLength",h),Gg(n,"byteLength",p)),ai(n,"PRNG",a.PRNG),hF&&ai(n,hF,c),n;function v(){return o+=1,u||o>i.iter?{done:!0}:{value:a(),done:!1}}function g(y){return u=!0,arguments.length?{value:y,done:!0}:{done:!0}}function c(){return pF(r,e,i)}function l(){return a.PRNG.seed}function m(){return a.PRNG.seedLength}function h(){return a.PRNG.stateLength}function p(){return a.PRNG.byteLength}function d(){return a.PRNG.state}function f(y){a.PRNG.state=y}}yF.exports=pF});var wF=s(function(mKe,bF){"use strict";var lOe=qF();bF.exports=lOe});var RF=s(function(hKe,LF){"use strict";var si=require("@stdlib/utils/define-nonenumerable-read-only-property"),Fg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),SF=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),cOe=require("@stdlib/utils/constant-function"),mOe=require("@stdlib/utils/noop"),hOe=require("@stdlib/object/assign"),pOe=require("@stdlib/assert/is-number").isPrimitive,yOe=require("@stdlib/math/base/assert/is-nan"),qOe=require("@stdlib/assert/is-plain-object"),bOe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,wOe=require("@stdlib/assert/is-positive-number").isPrimitive,SOe=require("@stdlib/assert/has-own-property"),OF=require("@stdlib/constants/float64/max"),EF=pn().factory,_F=require("@stdlib/symbol/iterator"),Wg=require("@stdlib/string/format");function NF(r,e,t){var i,n,a,u,o;if(!pOe(r)||yOe(r))throw new TypeError(Wg("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!wOe(e))throw new TypeError(Wg("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!qOe(t))throw new TypeError(Wg("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=hOe({},t),SOe(i,"iter")){if(!bOe(i.iter))throw new TypeError(Wg("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=OF;a=EF(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=EF(r,e),i={iter:OF,state:a.state};return o=0,n={},si(n,"next",v),si(n,"return",g),i&&i.prng?(si(n,"seed",null),si(n,"seedLength",null),SF(n,"state",cOe(null),mOe),si(n,"stateLength",null),si(n,"byteLength",null)):(Fg(n,"seed",l),Fg(n,"seedLength",m),SF(n,"state",d,f),Fg(n,"stateLength",h),Fg(n,"byteLength",p)),si(n,"PRNG",a.PRNG),_F&&si(n,_F,c),n;function v(){return o+=1,u||o>i.iter?{done:!0}:{value:a(),done:!1}}function g(y){return u=!0,arguments.length?{value:y,done:!0}:{done:!0}}function c(){return NF(r,e,i)}function l(){return a.PRNG.seed}function m(){return a.PRNG.seedLength}function h(){return a.PRNG.stateLength}function p(){return a.PRNG.byteLength}function d(){return a.PRNG.state}function f(y){a.PRNG.state=y}}LF.exports=NF});var TF=s(function(pKe,PF){"use strict";var OOe=RF();PF.exports=OOe});var WF=s(function(yKe,FF){"use strict";var ui=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ig=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),jF=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),EOe=require("@stdlib/utils/constant-function"),_Oe=require("@stdlib/utils/noop"),NOe=require("@stdlib/object/assign"),MF=require("@stdlib/assert/is-positive-number").isPrimitive,LOe=require("@stdlib/assert/is-plain-object"),ROe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,POe=require("@stdlib/assert/has-own-property"),xF=require("@stdlib/constants/float64/max"),AF=za().factory,GF=require("@stdlib/symbol/iterator"),kg=require("@stdlib/string/format");function VF(r,e,t){var i,n,a,u,o;if(!MF(r))throw new TypeError(kg("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!MF(e))throw new TypeError(kg("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!LOe(t))throw new TypeError(kg("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=NOe({},t),POe(i,"iter")){if(!ROe(i.iter))throw new TypeError(kg("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=xF;a=AF(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=AF(r,e),i={iter:xF,state:a.state};return o=0,n={},ui(n,"next",v),ui(n,"return",g),i&&i.prng?(ui(n,"seed",null),ui(n,"seedLength",null),jF(n,"state",EOe(null),_Oe),ui(n,"stateLength",null),ui(n,"byteLength",null)):(Ig(n,"seed",l),Ig(n,"seedLength",m),jF(n,"state",d,f),Ig(n,"stateLength",h),Ig(n,"byteLength",p)),ui(n,"PRNG",a.PRNG),GF&&ui(n,GF,c),n;function v(){return o+=1,u||o>i.iter?{done:!0}:{value:a(),done:!1}}function g(y){return u=!0,arguments.length?{value:y,done:!0}:{done:!0}}function c(){return VF(r,e,i)}function l(){return a.PRNG.seed}function m(){return a.PRNG.seedLength}function h(){return a.PRNG.stateLength}function p(){return a.PRNG.byteLength}function d(){return a.PRNG.state}function f(y){a.PRNG.state=y}}FF.exports=VF});var kF=s(function(qKe,IF){"use strict";var TOe=WF();IF.exports=TOe});var XF=s(function(bKe,DF){"use strict";var oi=require("@stdlib/utils/define-nonenumerable-read-only-property"),zg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),zF=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),jOe=require("@stdlib/utils/constant-function"),MOe=require("@stdlib/utils/noop"),xOe=require("@stdlib/object/assign"),AOe=require("@stdlib/assert/is-positive-number").isPrimitive,GOe=require("@stdlib/assert/is-plain-object"),VOe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,FOe=require("@stdlib/assert/has-own-property"),JF=require("@stdlib/constants/float64/max"),UF=hn().factory,CF=require("@stdlib/symbol/iterator"),fm=require("@stdlib/string/format");function BF(r,e){var t,i,n,a,u;if(!AOe(r))throw new TypeError(fm("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(arguments.length>1){if(!GOe(e))throw new TypeError(fm("invalid argument. Options argument must be an object. Value: `%s`.",e));if(t=xOe({},e),FOe(t,"iter")){if(!VOe(t.iter))throw new TypeError(fm("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=JF;n=UF(r,t),t.prng===void 0&&t.copy!==!1&&(t.state=n.state)}else n=UF(r),t={iter:JF,state:n.state};return u=0,i={},oi(i,"next",o),oi(i,"return",v),t&&t.prng?(oi(i,"seed",null),oi(i,"seedLength",null),zF(i,"state",jOe(null),MOe),oi(i,"stateLength",null),oi(i,"byteLength",null)):(zg(i,"seed",c),zg(i,"seedLength",l),zF(i,"state",p,d),zg(i,"stateLength",m),zg(i,"byteLength",h)),oi(i,"PRNG",n.PRNG),CF&&oi(i,CF,g),i;function o(){return u+=1,a||u>t.iter?{done:!0}:{value:n(),done:!1}}function v(f){return a=!0,arguments.length?{value:f,done:!0}:{done:!0}}function g(){return BF(r,t)}function c(){return n.PRNG.seed}function l(){return n.PRNG.seedLength}function m(){return n.PRNG.stateLength}function h(){return n.PRNG.byteLength}function p(){return n.PRNG.state}function d(f){n.PRNG.state=f}}DF.exports=BF});var HF=s(function(wKe,YF){"use strict";var WOe=XF();YF.exports=WOe});var tW=s(function(SKe,rW){"use strict";var Jg=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ug=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),IOe=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),kOe=require("@stdlib/object/assign"),zOe=require("@stdlib/assert/is-plain-object"),JOe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,UOe=require("@stdlib/assert/has-own-property"),ZF=require("@stdlib/constants/float64/max"),QF=pu().factory,$F=require("@stdlib/symbol/iterator"),KF=require("@stdlib/string/format");function eW(r){var e,t,i,n,a;if(arguments.length>0){if(!zOe(r))throw new TypeError(KF("invalid argument. Options argument must be an object. Value: `%s`.",r));if(e=kOe({},r),UOe(e,"iter")){if(!JOe(e.iter))throw new TypeError(KF("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",e.iter))}else e.iter=ZF;i=QF(e),e.copy!==!1&&(e.state=i.state)}else i=QF(),e={iter:ZF,state:i.state};return a=0,t={},Jg(t,"next",u),Jg(t,"return",o),Ug(t,"seed",g),Ug(t,"seedLength",c),IOe(t,"state",h,p),Ug(t,"stateLength",l),Ug(t,"byteLength",m),Jg(t,"PRNG",i.PRNG),$F&&Jg(t,$F,v),t;function u(){return a+=1,n||a>e.iter?{done:!0}:{value:i(),done:!1}}function o(d){return n=!0,arguments.length?{value:d,done:!0}:{done:!0}}function v(){return eW(e)}function g(){return i.PRNG.seed}function c(){return i.PRNG.seedLength}function l(){return i.PRNG.stateLength}function m(){return i.PRNG.byteLength}function h(){return i.PRNG.state}function p(d){i.PRNG.state=d}}rW.exports=eW});var nW=s(function(OKe,iW){"use strict";var COe=tW();iW.exports=COe});var dW=s(function(EKe,fW){"use strict";var vi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Cg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),aW=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),BOe=require("@stdlib/utils/constant-function"),DOe=require("@stdlib/utils/noop"),XOe=require("@stdlib/object/assign"),YOe=require("@stdlib/assert/is-plain-object"),HOe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,ZOe=require("@stdlib/assert/has-own-property"),sW=require("@stdlib/constants/float64/max"),uW=qu().factory,oW=require("@stdlib/symbol/iterator"),vW=require("@stdlib/string/format");function gW(r){var e,t,i,n,a;if(arguments.length>0){if(!YOe(r))throw new TypeError(vW("invalid argument. Options argument must be an object. Value: `%s`.",r));if(e=XOe({},r),ZOe(e,"iter")){if(!HOe(e.iter))throw new TypeError(vW("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",e.iter))}else e.iter=sW;i=uW(e),e.prng===void 0&&e.copy!==!1&&(e.state=i.state)}else i=uW(),e={iter:sW,state:i.state};return a=0,t={},vi(t,"next",u),vi(t,"return",o),e&&e.prng?(vi(t,"seed",null),vi(t,"seedLength",null),aW(t,"state",BOe(null),DOe),vi(t,"stateLength",null),vi(t,"byteLength",null)):(Cg(t,"seed",g),Cg(t,"seedLength",c),aW(t,"state",h,p),Cg(t,"stateLength",l),Cg(t,"byteLength",m)),vi(t,"PRNG",i.PRNG),oW&&vi(t,oW,v),t;function u(){return a+=1,n||a>e.iter?{done:!0}:{value:i(),done:!1}}function o(d){return n=!0,arguments.length?{value:d,done:!0}:{done:!0}}function v(){return gW(e)}function g(){return i.PRNG.seed}function c(){return i.PRNG.seedLength}function l(){return i.PRNG.stateLength}function m(){return i.PRNG.byteLength}function h(){return i.PRNG.state}function p(d){i.PRNG.state=d}}fW.exports=gW});var cW=s(function(_Ke,lW){"use strict";var QOe=dW();lW.exports=QOe});var wW=s(function(NKe,bW){"use strict";var Bg=require("@stdlib/utils/define-nonenumerable-read-only-property"),Dg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),$Oe=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),KOe=require("@stdlib/object/assign"),eEe=require("@stdlib/assert/is-plain-object"),rEe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,tEe=require("@stdlib/assert/has-own-property"),mW=require("@stdlib/constants/float64/max"),hW=Tt().factory,pW=require("@stdlib/symbol/iterator"),yW=require("@stdlib/string/format");function qW(r){var e,t,i,n,a;if(arguments.length>0){if(!eEe(r))throw new TypeError(yW("invalid argument. Options argument must be an object. Value: `%s`.",r));if(e=KOe({},r),tEe(e,"iter")){if(!rEe(e.iter))throw new TypeError(yW("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",e.iter))}else e.iter=mW;i=hW(e),e.copy!==!1&&(e.state=i.state)}else i=hW(),e={iter:mW,state:i.state};return a=0,t={},Bg(t,"next",u),Bg(t,"return",o),Dg(t,"seed",g),Dg(t,"seedLength",c),$Oe(t,"state",h,p),Dg(t,"stateLength",l),Dg(t,"byteLength",m),Bg(t,"PRNG",i.PRNG),pW&&Bg(t,pW,v),t;function u(){return a+=1,n||a>e.iter?{done:!0}:{value:i(),done:!1}}function o(d){return n=!0,arguments.length?{value:d,done:!0}:{done:!0}}function v(){return qW(e)}function g(){return i.PRNG.seed}function c(){return i.PRNG.seedLength}function l(){return i.PRNG.stateLength}function m(){return i.PRNG.byteLength}function h(){return i.PRNG.state}function p(d){i.PRNG.state=d}}bW.exports=qW});var OW=s(function(LKe,SW){"use strict";var iEe=wW();SW.exports=iEe});var TW=s(function(RKe,PW){"use strict";var gi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Xg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),EW=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),nEe=require("@stdlib/utils/constant-function"),aEe=require("@stdlib/utils/noop"),sEe=require("@stdlib/object/assign"),uEe=require("@stdlib/assert/is-positive-number").isPrimitive,oEe=require("@stdlib/assert/is-plain-object"),vEe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,gEe=require("@stdlib/assert/has-own-property"),_W=require("@stdlib/constants/float64/max"),NW=Ja().factory,LW=require("@stdlib/symbol/iterator"),dm=require("@stdlib/string/format");function RW(r,e){var t,i,n,a,u;if(!uEe(r))throw new TypeError(dm("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(arguments.length>1){if(!oEe(e))throw new TypeError(dm("invalid argument. Options argument must be an object. Value: `%s`.",e));if(t=sEe({},e),gEe(t,"iter")){if(!vEe(t.iter))throw new TypeError(dm("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=_W;n=NW(r,t),t.prng===void 0&&t.copy!==!1&&(t.state=n.state)}else n=NW(r),t={iter:_W,state:n.state};return u=0,i={},gi(i,"next",o),gi(i,"return",v),t&&t.prng?(gi(i,"seed",null),gi(i,"seedLength",null),EW(i,"state",nEe(null),aEe),gi(i,"stateLength",null),gi(i,"byteLength",null)):(Xg(i,"seed",c),Xg(i,"seedLength",l),EW(i,"state",p,d),Xg(i,"stateLength",m),Xg(i,"byteLength",h)),gi(i,"PRNG",n.PRNG),LW&&gi(i,LW,g),i;function o(){return u+=1,a||u>t.iter?{done:!0}:{value:n(),done:!1}}function v(f){return a=!0,arguments.length?{value:f,done:!0}:{done:!0}}function g(){return RW(r,t)}function c(){return n.PRNG.seed}function l(){return n.PRNG.seedLength}function m(){return n.PRNG.stateLength}function h(){return n.PRNG.byteLength}function p(){return n.PRNG.state}function d(f){n.PRNG.state=f}}PW.exports=RW});var MW=s(function(PKe,jW){"use strict";var fEe=TW();jW.exports=fEe});var IW=s(function(TKe,WW){"use strict";var fi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Yg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),xW=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),dEe=require("@stdlib/utils/constant-function"),lEe=require("@stdlib/utils/noop"),cEe=require("@stdlib/object/assign"),mEe=require("@stdlib/assert/is-positive-number").isPrimitive,hEe=require("@stdlib/assert/is-plain-object"),pEe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,yEe=require("@stdlib/assert/has-own-property"),AW=require("@stdlib/constants/float64/max"),GW=Ba().factory,VW=require("@stdlib/symbol/iterator"),lm=require("@stdlib/string/format");function FW(r,e){var t,i,n,a,u;if(!mEe(r))throw new TypeError(lm("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(arguments.length>1){if(!hEe(e))throw new TypeError(lm("invalid argument. Options argument must be an object. Value: `%s`.",e));if(t=cEe({},e),yEe(t,"iter")){if(!pEe(t.iter))throw new TypeError(lm("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=AW;n=GW(r,t),t.prng===void 0&&t.copy!==!1&&(t.state=n.state)}else n=GW(r),t={iter:AW,state:n.state};return u=0,i={},fi(i,"next",o),fi(i,"return",v),t&&t.prng?(fi(i,"seed",null),fi(i,"seedLength",null),xW(i,"state",dEe(null),lEe),fi(i,"stateLength",null),fi(i,"byteLength",null)):(Yg(i,"seed",c),Yg(i,"seedLength",l),xW(i,"state",p,d),Yg(i,"stateLength",m),Yg(i,"byteLength",h)),fi(i,"PRNG",n.PRNG),VW&&fi(i,VW,g),i;function o(){return u+=1,a||u>t.iter?{done:!0}:{value:n(),done:!1}}function v(f){return a=!0,arguments.length?{value:f,done:!0}:{done:!0}}function g(){return FW(r,t)}function c(){return n.PRNG.seed}function l(){return n.PRNG.seedLength}function m(){return n.PRNG.stateLength}function h(){return n.PRNG.byteLength}function p(){return n.PRNG.state}function d(f){n.PRNG.state=f}}WW.exports=FW});var zW=s(function(jKe,kW){"use strict";var qEe=IW();kW.exports=qEe});var YW=s(function(MKe,XW){"use strict";var di=require("@stdlib/utils/define-nonenumerable-read-only-property"),Hg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),JW=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),bEe=require("@stdlib/utils/constant-function"),wEe=require("@stdlib/utils/noop"),SEe=require("@stdlib/object/assign"),cm=require("@stdlib/assert/is-number").isPrimitive,mm=require("@stdlib/math/base/assert/is-nan"),OEe=require("@stdlib/assert/is-plain-object"),EEe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,_Ee=require("@stdlib/assert/has-own-property"),UW=require("@stdlib/constants/float64/max"),CW=Da().factory,BW=require("@stdlib/symbol/iterator"),Ha=require("@stdlib/string/format");function DW(r,e,t,i){var n,a,u,o,v;if(!cm(r)||mm(r))throw new TypeError(Ha("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!cm(e)||mm(e))throw new TypeError(Ha("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e));if(!cm(t)||mm(t))throw new TypeError(Ha("invalid argument. Third argument must be a number and not NaN. Value: `%s`.",t));if(!(r<=t&&t<=e))throw new RangeError(Ha("invalid arguments. Parameters must satisfy the following condition: %s. a: `%f`. b: `%f`. c: `%f`.","a <= c <= b",r,e,t));if(arguments.length>3){if(!OEe(i))throw new TypeError(Ha("invalid argument. Options argument must be an object. Value: `%s`.",i));if(n=SEe({},i),_Ee(n,"iter")){if(!EEe(n.iter))throw new TypeError(Ha("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",n.iter))}else n.iter=UW;u=CW(r,e,t,n),n.prng===void 0&&n.copy!==!1&&(n.state=u.state)}else u=CW(r,e,t),n={iter:UW,state:u.state};return v=0,a={},di(a,"next",g),di(a,"return",c),n&&n.prng?(di(a,"seed",null),di(a,"seedLength",null),JW(a,"state",bEe(null),wEe),di(a,"stateLength",null),di(a,"byteLength",null)):(Hg(a,"seed",m),Hg(a,"seedLength",h),JW(a,"state",f,y),Hg(a,"stateLength",p),Hg(a,"byteLength",d)),di(a,"PRNG",u.PRNG),BW&&di(a,BW,l),a;function g(){return v+=1,o||v>n.iter?{done:!0}:{value:u(),done:!1}}function c(q){return o=!0,arguments.length?{value:q,done:!0}:{done:!0}}function l(){return DW(r,e,t,n)}function m(){return u.PRNG.seed}function h(){return u.PRNG.seedLength}function p(){return u.PRNG.stateLength}function d(){return u.PRNG.byteLength}function f(){return u.PRNG.state}function y(q){u.PRNG.state=q}}XW.exports=DW});var ZW=s(function(xKe,HW){"use strict";var NEe=YW();HW.exports=NEe});var aI=s(function(AKe,nI){"use strict";var li=require("@stdlib/utils/define-nonenumerable-read-only-property"),Zg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),QW=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),LEe=require("@stdlib/utils/constant-function"),REe=require("@stdlib/utils/noop"),PEe=require("@stdlib/object/assign"),$W=require("@stdlib/assert/is-number").isPrimitive,KW=require("@stdlib/math/base/assert/is-nan"),TEe=require("@stdlib/assert/is-plain-object"),jEe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,MEe=require("@stdlib/assert/has-own-property"),eI=require("@stdlib/constants/float64/max"),rI=yn().factory,tI=require("@stdlib/symbol/iterator"),Ou=require("@stdlib/string/format");function iI(r,e,t){var i,n,a,u,o;if(!$W(r)||KW(r))throw new TypeError(Ou("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!$W(e)||KW(e))throw new TypeError(Ou("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e));if(r>=e)throw new RangeError(Ou("invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.",r,e));if(arguments.length>2){if(!TEe(t))throw new TypeError(Ou("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=PEe({},t),MEe(i,"iter")){if(!jEe(i.iter))throw new TypeError(Ou("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=eI;a=rI(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=rI(r,e),i={iter:eI,state:a.state};return o=0,n={},li(n,"next",v),li(n,"return",g),i&&i.prng?(li(n,"seed",null),li(n,"seedLength",null),QW(n,"state",LEe(null),REe),li(n,"stateLength",null),li(n,"byteLength",null)):(Zg(n,"seed",l),Zg(n,"seedLength",m),QW(n,"state",d,f),Zg(n,"stateLength",h),Zg(n,"byteLength",p)),li(n,"PRNG",a.PRNG),tI&&li(n,tI,c),n;function v(){return o+=1,u||o>i.iter?{done:!0}:{value:a(),done:!1}}function g(y){return u=!0,arguments.length?{value:y,done:!0}:{done:!0}}function c(){return iI(r,e,i)}function l(){return a.PRNG.seed}function m(){return a.PRNG.seedLength}function h(){return a.PRNG.stateLength}function p(){return a.PRNG.byteLength}function d(){return a.PRNG.state}function f(y){a.PRNG.state=y}}nI.exports=iI});var uI=s(function(GKe,sI){"use strict";var xEe=aI();sI.exports=xEe});var mI=s(function(VKe,cI){"use strict";var ci=require("@stdlib/utils/define-nonenumerable-read-only-property"),Qg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),oI=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),AEe=require("@stdlib/utils/constant-function"),GEe=require("@stdlib/utils/noop"),VEe=require("@stdlib/object/assign"),vI=require("@stdlib/assert/is-positive-number").isPrimitive,FEe=require("@stdlib/assert/is-plain-object"),WEe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,IEe=require("@stdlib/assert/has-own-property"),gI=require("@stdlib/constants/float64/max"),fI=qn().factory,dI=require("@stdlib/symbol/iterator"),$g=require("@stdlib/string/format");function lI(r,e,t){var i,n,a,u,o;if(!vI(r))throw new TypeError($g("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!vI(e))throw new TypeError($g("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!FEe(t))throw new TypeError($g("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=VEe({},t),IEe(i,"iter")){if(!WEe(i.iter))throw new TypeError($g("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=gI;a=fI(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=fI(r,e),i={iter:gI,state:a.state};return o=0,n={},ci(n,"next",v),ci(n,"return",g),i&&i.prng?(ci(n,"seed",null),ci(n,"seedLength",null),oI(n,"state",AEe(null),GEe),ci(n,"stateLength",null),ci(n,"byteLength",null)):(Qg(n,"seed",l),Qg(n,"seedLength",m),oI(n,"state",d,f),Qg(n,"stateLength",h),Qg(n,"byteLength",p)),ci(n,"PRNG",a.PRNG),dI&&ci(n,dI,c),n;function v(){return o+=1,u||o>i.iter?{done:!0}:{value:a(),done:!1}}function g(y){return u=!0,arguments.length?{value:y,done:!0}:{done:!0}}function c(){return lI(r,e,i)}function l(){return a.PRNG.seed}function m(){return a.PRNG.seedLength}function h(){return a.PRNG.stateLength}function p(){return a.PRNG.byteLength}function d(){return a.PRNG.state}function f(y){a.PRNG.state=y}}cI.exports=lI});var pI=s(function(FKe,hI){"use strict";var kEe=mI();hI.exports=kEe});var qI=s(function(WKe,yI){"use strict";var R=require("@stdlib/utils/define-read-only-property"),N={};R(N,"arcsine",b1());R(N,"bernoulli",P1());R(N,"beta",I1());R(N,"betaprime",H1());R(N,"binomial",nA());R(N,"boxMuller",cA());R(N,"cauchy",OA());R(N,"chi",MA());R(N,"chisquare",zA());R(N,"cosine",ZA());R(N,"discreteUniform",sG());R(N,"erlang",mG());R(N,"exponential",EG());R(N,"f",AG());R(N,"frechet",CG());R(N,"gamma",eV());R(N,"geometric",vV());R(N,"gumbel",yV());R(N,"hypergeometric",LV());R(N,"improvedZiggurat",FV());R(N,"invgamma",XV());R(N,"kumaraswamy",i2());R(N,"laplace",d2());R(N,"levy",w2());R(N,"logistic",T2());R(N,"lognormal",I2());R(N,"minstd",Y2());R(N,"minstdShuffle",iF());R(N,"mt19937",dF());R(N,"negativeBinomial",wF());R(N,"normal",TF());R(N,"pareto1",kF());R(N,"poisson",HF());R(N,"randi",nW());R(N,"randn",cW());R(N,"randu",OW());R(N,"rayleigh",MW());R(N,"t",zW());R(N,"triangular",ZW());R(N,"uniform",uI());R(N,"weibull",pI());yI.exports=N});var wI=s(function(IKe,bI){"use strict";var zEe=require("@stdlib/math/base/special/floor");function JEe(r,e,t){var i,n,a,u;for(a=r.length,n=new Array(e),u=0;u0;a--)u=CEe(t()*(a+1)),i=r[a],r[a]=r[u],r[u]=i;return BEe.call(r,0,e)}EI.exports=DEe});var LI=s(function(JKe,NI){"use strict";var XEe=require("@stdlib/math/base/special/floor");function YEe(r,e,t,i){var n,a,u,o,v,g,c,l,m,h;for(u=i.slice(),g=r.length,n=[],a=[],m=0;m1){if(e=arguments[0],r=arguments[1],!(hm(e)||pm(e)))throw new TypeError(ef("invalid argument. `%s` argument must be array-like. Value: `%s`.","pool",e));n=rf(t,r)}if(n)throw n;return r&&r.seed?i=AI({seed:r.seed}):i=AI(),e===void 0?a=u:(xI(e)?e=e.split(""):e=GI(e),a=o),MI(a,"seed",i.seed),MI(a,"PRNG",i),i=i.normalized,a;function u(v,g){var c,l,m,h,p,d;if(!(hm(v)||pm(v)))throw new TypeError(ef("invalid argument. First argument must be array-like. Value: `%s`.",v));if(xI(v)&&(v=v.split("")),h={},arguments.length>1&&(d=rf(h,g),d))throw d;if(h.replace===void 0?c=t.replace:c=h.replace,h.probs!==void 0&&(m=h.probs),h.size?p=h.size:t.size?p=t.size:p=v.length,c===!1&&p>v.length)throw new RangeError(ef("invalid option. `size` option must be less than or equal to the length of `x` when `replace` is `false`. Option: `%s`.",p));return m?c?r_e(v,p,i,m):e_e(v,p,i,m):c?VI(v,p,i):(l=i_e.call(v),FI(l,p,i))}function o(v){var g,c,l,m,h,p;if(e.length===0)return null;if(l={},arguments.length&&(h=rf(l,v),h))throw h;if(l.mutate===void 0?c=t.mutate:c=l.mutate,l.replace===void 0?g=t.replace:g=l.replace,l.size?m=l.size:t.size?m=t.size:m=e.length,g===!1&&m>e.length)throw new RangeError(ef("invalid option. `size` option must be less than or equal to the population size when `replace` is `false`. Option: `%s`.",m));return g?VI(e,m,i):(p=FI(e,m,i),c&&(e=e.slice(m,e.length)),p)}}WI.exports=n_e});var kI=s(function(DKe,II){"use strict";var a_e=ym(),s_e=a_e();II.exports=s_e});var UI=s(function(XKe,JI){"use strict";var u_e=require("@stdlib/utils/define-nonenumerable-read-only-property"),zI=kI(),o_e=ym();u_e(zI,"factory",o_e);JI.exports=zI});var CI=s(function(YKe,v_e){v_e.exports={copy:"shallow"}});var XI=s(function(HKe,DI){"use strict";var g_e=require("@stdlib/assert/has-own-property"),f_e=require("@stdlib/assert/is-string").isPrimitive,d_e=require("@stdlib/assert/is-plain-object"),l_e=require("@stdlib/utils/index-of"),qm=require("@stdlib/string/format"),BI=["deep","shallow","none"];function c_e(r,e){if(!d_e(e))return new TypeError(qm("invalid argument. Options argument must be an object. Value: `%s`.",e));if(g_e(e,"copy")){if(r.copy=e.copy,!f_e(r.copy))return new TypeError(qm("invalid option. `%s` option must be a string. Option: `%s`.","copy",r.copy));if(l_e(BI,r.copy)===-1)return new TypeError(qm('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"copy",BI.join('", "'),r.copy))}return null}DI.exports=c_e});var bm=s(function(ZKe,$I){"use strict";var YI=require("@stdlib/utils/define-nonenumerable-read-only-property"),m_e=require("@stdlib/assert/is-array-like"),h_e=require("@stdlib/assert/is-typed-array-like"),p_e=require("@stdlib/assert/is-string").isPrimitive,HI=require("@stdlib/utils/copy"),y_e=require("@stdlib/math/base/special/floor"),ZI=T().factory,q_e=require("@stdlib/string/format"),b_e=CI(),QI=XI();function w_e(r){var e,t,i;if(e=HI(b_e),arguments.length&&(i=QI(e,r),i))throw i;return r&&r.seed?t=ZI({seed:r.seed}):t=ZI(),YI(n,"seed",t.seed),YI(n,"PRNG",t),t=t.normalized,n;function n(a,u){var o,v,g,c,l,m,h,p,d,f;if(!(m_e(a)||h_e(a)))throw new TypeError(q_e("invalid argument. First argument must be array-like. Value: `%s`.",a));if(arguments.length>1&&(c={},l=QI(c,u),l))throw l;for(g=c&&c.copy?c.copy:e.copy,o=p_e(a),o&&(a=a.split(""),g="none"),v=0,g==="shallow"?v+=1:g==="deep"&&(v+=2),p=a.length,m=HI(a,v),d=p-1;d>0;d--)f=y_e(t()*(d+1)),h=m[d],m[d]=m[f],m[f]=h;return o&&(m=a.join("")),m}}$I.exports=w_e});var ek=s(function(QKe,KI){"use strict";var S_e=bm(),O_e=S_e();KI.exports=O_e});var ik=s(function($Ke,tk){"use strict";var E_e=require("@stdlib/utils/define-nonenumerable-read-only-property"),rk=ek(),__e=bm();E_e(rk,"factory",__e);tk.exports=rk});var nk=s(function(KKe,N_e){N_e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var uk=s(function(eer,sk){"use strict";var L_e=require("@stdlib/assert/is-plain-object"),He=require("@stdlib/assert/has-own-property"),R_e=require("@stdlib/assert/is-boolean").isPrimitive,P_e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,ak=require("@stdlib/assert/is-string").isPrimitive,T_e=require("@stdlib/assert/is-positive-integer").isPrimitive,j_e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,wn=require("@stdlib/string/format");function M_e(r,e){return L_e(e)?He(e,"sep")&&(r.sep=e.sep,!ak(r.sep))?new TypeError(wn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):He(e,"objectMode")&&(r.objectMode=e.objectMode,!R_e(r.objectMode))?new TypeError(wn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):He(e,"encoding")&&(r.encoding=e.encoding,!ak(r.encoding)&&r.encoding!==null)?new TypeError(wn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):He(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!P_e(r.highWaterMark))?new TypeError(wn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):He(e,"iter")&&(r.iter=e.iter,!j_e(r.iter))?new TypeError(wn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):He(e,"siter")&&(r.siter=e.siter,!T_e(r.siter))?new TypeError(wn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(He(e,"prng")&&(r.prng=e.prng),He(e,"seed")&&(r.seed=e.seed),He(e,"state")&&(r.state=e.state),He(e,"copy")&&(r.copy=e.copy),null):new TypeError(wn("invalid argument. Options argument must be an object. Value: `%s`.",e))}sk.exports=M_e});var vk=s(function(rer,ok){"use strict";var x_e=require("debug"),A_e=x_e("random:streams:arcsine");ok.exports=A_e});var nf=s(function(ter,mk){"use strict";var ck=require("readable-stream").Readable,gk=require("@stdlib/assert/is-number").isPrimitive,fk=require("@stdlib/math/base/assert/is-nan"),G_e=require("@stdlib/assert/is-error"),V_e=require("@stdlib/object/assign"),F_e=require("@stdlib/utils/inherit"),dk=require("@stdlib/utils/define-nonenumerable-property"),mi=require("@stdlib/utils/define-nonenumerable-read-only-property"),tf=require("@stdlib/utils/define-read-only-accessor"),W_e=require("@stdlib/utils/define-read-write-accessor"),I_e=nn().factory,lk=require("@stdlib/buffer/from-string"),k_e=require("@stdlib/utils/next-tick"),wm=require("@stdlib/string/format"),z_e=nk(),J_e=uk(),Za=vk();function U_e(){return this._prng.seed}function C_e(){return this._prng.seedLength}function B_e(){return this._prng.stateLength}function D_e(){return this._prng.byteLength}function X_e(){return this._prng.state}function Y_e(r){this._prng.state=r}function H_e(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Za("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Za("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=lk(e):e=lk(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function Z_e(r){var e;if(this._destroyed)return Za("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,k_e(t),this;function t(){r&&(Za("Stream was destroyed due to an error. Error: %s.",G_e(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Za("Closing the stream..."),e.emit("close")}}function te(r,e,t){var i,n;if(!(this instanceof te))return arguments.length>2?new te(r,e,t):new te(r,e);if(!gk(r)||fk(r))throw new TypeError(wm("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!gk(e)||fk(e))throw new TypeError(wm("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e));if(r>=e)throw new RangeError(wm("invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.",r,e));if(i=V_e({},z_e),arguments.length>2&&(n=J_e(i,t),n))throw n;return Za("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),ck.call(this,i),dk(this,"_destroyed",!1),mi(this,"_objectMode",i.objectMode),mi(this,"_sep",i.sep),mi(this,"_iter",i.iter),mi(this,"_siter",i.siter),dk(this,"_i",0),mi(this,"_prng",I_e(r,e,i)),mi(this,"PRNG",this._prng.PRNG),this}F_e(te,ck);tf(te.prototype,"seed",U_e);tf(te.prototype,"seedLength",C_e);W_e(te.prototype,"state",X_e,Y_e);tf(te.prototype,"stateLength",B_e);tf(te.prototype,"byteLength",D_e);mi(te.prototype,"_read",H_e);mi(te.prototype,"destroy",Z_e);mk.exports=te});var pk=s(function(ier,hk){"use strict";var Q_e=require("@stdlib/assert/is-plain-object"),$_e=require("@stdlib/string/format"),K_e=require("@stdlib/object/assign"),eNe=nf();function rNe(r,e,t){var i;if(arguments.length>2){if(i=t,!Q_e(i))throw new TypeError($_e("invalid argument. Options argument must be an object. Value: `%s`.",i));i=K_e({},t)}else i={};return i.objectMode=!0,new eNe(r,e,i)}hk.exports=rNe});var Ok=s(function(ner,Sk){"use strict";var yk=require("@stdlib/assert/is-plain-object"),qk=require("@stdlib/object/assign"),bk=require("@stdlib/string/format"),wk=nf();function tNe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!yk(r))throw new TypeError(bk("invalid argument. Options argument must be an object. Value: `%s`.",r));n=qk({},r)}else if(i>2){if(!yk(t))throw new TypeError(bk("invalid argument. Options argument must be an object. Value: `%s`.",t));n=qk({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new wk(v,g,n)}function o(){return new wk(r,e,n)}}Sk.exports=tNe});var Nk=s(function(aer,_k){"use strict";var Ek=require("@stdlib/utils/define-nonenumerable-read-only-property"),Sm=nf(),iNe=pk(),nNe=Ok();Ek(Sm,"objectMode",iNe);Ek(Sm,"factory",nNe);_k.exports=Sm});var Lk=s(function(ser,aNe){aNe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var Tk=s(function(uer,Pk){"use strict";var sNe=require("@stdlib/assert/is-plain-object"),Ze=require("@stdlib/assert/has-own-property"),uNe=require("@stdlib/assert/is-boolean").isPrimitive,oNe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,Rk=require("@stdlib/assert/is-string").isPrimitive,vNe=require("@stdlib/assert/is-positive-integer").isPrimitive,gNe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Sn=require("@stdlib/string/format");function fNe(r,e){return sNe(e)?Ze(e,"sep")&&(r.sep=e.sep,!Rk(r.sep))?new TypeError(Sn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Ze(e,"objectMode")&&(r.objectMode=e.objectMode,!uNe(r.objectMode))?new TypeError(Sn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Ze(e,"encoding")&&(r.encoding=e.encoding,!Rk(r.encoding)&&r.encoding!==null)?new TypeError(Sn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Ze(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!oNe(r.highWaterMark))?new TypeError(Sn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Ze(e,"iter")&&(r.iter=e.iter,!gNe(r.iter))?new TypeError(Sn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Ze(e,"siter")&&(r.siter=e.siter,!vNe(r.siter))?new TypeError(Sn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(Ze(e,"prng")&&(r.prng=e.prng),Ze(e,"seed")&&(r.seed=e.seed),Ze(e,"state")&&(r.state=e.state),Ze(e,"copy")&&(r.copy=e.copy),null):new TypeError(Sn("invalid argument. Options argument must be an object. Value: `%s`.",e))}Pk.exports=fNe});var Mk=s(function(oer,jk){"use strict";var dNe=require("debug"),lNe=dNe("random:streams:bernoulli");jk.exports=lNe});var sf=s(function(ver,Vk){"use strict";var Gk=require("readable-stream").Readable,cNe=require("@stdlib/assert/is-probability").isPrimitive,mNe=require("@stdlib/assert/is-error"),hNe=require("@stdlib/object/assign"),pNe=require("@stdlib/utils/inherit"),xk=require("@stdlib/utils/define-nonenumerable-property"),hi=require("@stdlib/utils/define-nonenumerable-read-only-property"),af=require("@stdlib/utils/define-read-only-accessor"),yNe=require("@stdlib/utils/define-read-write-accessor"),qNe=an().factory,Ak=require("@stdlib/buffer/from-string"),bNe=require("@stdlib/utils/next-tick"),wNe=require("@stdlib/string/format"),SNe=Lk(),ONe=Tk(),Qa=Mk();function ENe(){return this._prng.seed}function _Ne(){return this._prng.seedLength}function NNe(){return this._prng.stateLength}function LNe(){return this._prng.byteLength}function RNe(){return this._prng.state}function PNe(r){this._prng.state=r}function TNe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Qa("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Qa("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=Ak(e):e=Ak(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function jNe(r){var e;if(this._destroyed)return Qa("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,bNe(t),this;function t(){r&&(Qa("Stream was destroyed due to an error. Error: %s.",mNe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Qa("Closing the stream..."),e.emit("close")}}function ie(r,e){var t,i;if(!(this instanceof ie))return arguments.length>1?new ie(r,e):new ie(r);if(!cNe(r))throw new TypeError(wNe("invalid argument. First argument must be a probability. Value: `%s`.",r));if(t=hNe({},SNe),arguments.length>1&&(i=ONe(t,e),i))throw i;return Qa("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),Gk.call(this,t),xk(this,"_destroyed",!1),hi(this,"_objectMode",t.objectMode),hi(this,"_sep",t.sep),hi(this,"_iter",t.iter),hi(this,"_siter",t.siter),xk(this,"_i",0),hi(this,"_prng",qNe(r,t)),hi(this,"PRNG",this._prng.PRNG),this}pNe(ie,Gk);af(ie.prototype,"seed",ENe);af(ie.prototype,"seedLength",_Ne);yNe(ie.prototype,"state",RNe,PNe);af(ie.prototype,"stateLength",NNe);af(ie.prototype,"byteLength",LNe);hi(ie.prototype,"_read",TNe);hi(ie.prototype,"destroy",jNe);Vk.exports=ie});var Wk=s(function(ger,Fk){"use strict";var MNe=require("@stdlib/assert/is-plain-object"),xNe=require("@stdlib/string/format"),ANe=require("@stdlib/object/assign"),GNe=sf();function VNe(r,e){var t;if(arguments.length>1){if(t=e,!MNe(t))throw new TypeError(xNe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=ANe({},e)}else t={};return t.objectMode=!0,new GNe(r,t)}Fk.exports=VNe});var Ck=s(function(fer,Uk){"use strict";var Ik=require("@stdlib/assert/is-plain-object"),FNe=require("@stdlib/assert/is-probability").isPrimitive,kk=require("@stdlib/string/format"),zk=require("@stdlib/object/assign"),Jk=sf();function WNe(r,e){var t,i,n;if(t=arguments.length,t>1){if(!Ik(e))throw new TypeError(kk("invalid argument. Options argument must be an object. Value: `%s`.",e));n=u,i=zk({},e)}else if(t===1)if(FNe(r))n=u,i={};else{if(!Ik(r))throw new TypeError(kk("invalid argument. Options argument must be an object. Value: `%s`.",r));i=zk({},r),n=a}else i={},n=a;return n;function a(o){return new Jk(o,i)}function u(){return new Jk(r,i)}}Uk.exports=WNe});var Xk=s(function(der,Dk){"use strict";var Bk=require("@stdlib/utils/define-nonenumerable-read-only-property"),Om=sf(),INe=Wk(),kNe=Ck();Bk(Om,"objectMode",INe);Bk(Om,"factory",kNe);Dk.exports=Om});var Yk=s(function(ler,zNe){zNe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var Qk=s(function(cer,Zk){"use strict";var JNe=require("@stdlib/assert/is-plain-object"),Qe=require("@stdlib/assert/has-own-property"),UNe=require("@stdlib/assert/is-boolean").isPrimitive,CNe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,Hk=require("@stdlib/assert/is-string").isPrimitive,BNe=require("@stdlib/assert/is-positive-integer").isPrimitive,DNe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,On=require("@stdlib/string/format");function XNe(r,e){return JNe(e)?Qe(e,"sep")&&(r.sep=e.sep,!Hk(r.sep))?new TypeError(On("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Qe(e,"objectMode")&&(r.objectMode=e.objectMode,!UNe(r.objectMode))?new TypeError(On("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Qe(e,"encoding")&&(r.encoding=e.encoding,!Hk(r.encoding)&&r.encoding!==null)?new TypeError(On("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Qe(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!CNe(r.highWaterMark))?new TypeError(On("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Qe(e,"iter")&&(r.iter=e.iter,!DNe(r.iter))?new TypeError(On("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Qe(e,"siter")&&(r.siter=e.siter,!BNe(r.siter))?new TypeError(On("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(Qe(e,"prng")&&(r.prng=e.prng),Qe(e,"seed")&&(r.seed=e.seed),Qe(e,"state")&&(r.state=e.state),Qe(e,"copy")&&(r.copy=e.copy),null):new TypeError(On("invalid argument. Options argument must be an object. Value: `%s`.",e))}Zk.exports=XNe});var Kk=s(function(mer,$k){"use strict";var YNe=require("debug"),HNe=YNe("random:streams:beta");$k.exports=HNe});var of=s(function(her,az){"use strict";var nz=require("readable-stream").Readable,ez=require("@stdlib/assert/is-positive-number").isPrimitive,ZNe=require("@stdlib/assert/is-error"),QNe=require("@stdlib/object/assign"),$Ne=require("@stdlib/utils/inherit"),rz=require("@stdlib/utils/define-nonenumerable-property"),pi=require("@stdlib/utils/define-nonenumerable-read-only-property"),uf=require("@stdlib/utils/define-read-only-accessor"),KNe=require("@stdlib/utils/define-read-write-accessor"),eLe=un().factory,tz=require("@stdlib/buffer/from-string"),rLe=require("@stdlib/utils/next-tick"),iz=require("@stdlib/string/format"),tLe=Yk(),iLe=Qk(),$a=Kk();function nLe(){return this._prng.seed}function aLe(){return this._prng.seedLength}function sLe(){return this._prng.stateLength}function uLe(){return this._prng.byteLength}function oLe(){return this._prng.state}function vLe(r){this._prng.state=r}function gLe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return $a("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),$a("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=tz(e):e=tz(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function fLe(r){var e;if(this._destroyed)return $a("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,rLe(t),this;function t(){r&&($a("Stream was destroyed due to an error. Error: %s.",ZNe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),$a("Closing the stream..."),e.emit("close")}}function ne(r,e,t){var i,n;if(!(this instanceof ne))return arguments.length>2?new ne(r,e,t):new ne(r,e);if(!ez(r))throw new TypeError(iz("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!ez(e))throw new TypeError(iz("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=QNe({},tLe),arguments.length>2&&(n=iLe(i,t),n))throw n;return $a("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),nz.call(this,i),rz(this,"_destroyed",!1),pi(this,"_objectMode",i.objectMode),pi(this,"_sep",i.sep),pi(this,"_iter",i.iter),pi(this,"_siter",i.siter),rz(this,"_i",0),pi(this,"_prng",eLe(r,e,i)),pi(this,"PRNG",this._prng.PRNG),this}$Ne(ne,nz);uf(ne.prototype,"seed",nLe);uf(ne.prototype,"seedLength",aLe);KNe(ne.prototype,"state",oLe,vLe);uf(ne.prototype,"stateLength",sLe);uf(ne.prototype,"byteLength",uLe);pi(ne.prototype,"_read",gLe);pi(ne.prototype,"destroy",fLe);az.exports=ne});var uz=s(function(per,sz){"use strict";var dLe=require("@stdlib/assert/is-plain-object"),lLe=require("@stdlib/string/format"),cLe=require("@stdlib/object/assign"),mLe=of();function hLe(r,e,t){var i;if(arguments.length>2){if(i=t,!dLe(i))throw new TypeError(lLe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=cLe({},t)}else i={};return i.objectMode=!0,new mLe(r,e,i)}sz.exports=hLe});var lz=s(function(yer,dz){"use strict";var oz=require("@stdlib/assert/is-plain-object"),vz=require("@stdlib/object/assign"),gz=require("@stdlib/string/format"),fz=of();function pLe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!oz(r))throw new TypeError(gz("invalid argument. Options argument must be an object. Value: `%s`.",r));n=vz({},r)}else if(i>2){if(!oz(t))throw new TypeError(gz("invalid argument. Options argument must be an object. Value: `%s`.",t));n=vz({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new fz(v,g,n)}function o(){return new fz(r,e,n)}}dz.exports=pLe});var hz=s(function(qer,mz){"use strict";var cz=require("@stdlib/utils/define-nonenumerable-read-only-property"),Em=of(),yLe=uz(),qLe=lz();cz(Em,"objectMode",yLe);cz(Em,"factory",qLe);mz.exports=Em});var pz=s(function(ber,bLe){bLe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var bz=s(function(wer,qz){"use strict";var wLe=require("@stdlib/assert/is-plain-object"),$e=require("@stdlib/assert/has-own-property"),SLe=require("@stdlib/assert/is-boolean").isPrimitive,OLe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,yz=require("@stdlib/assert/is-string").isPrimitive,ELe=require("@stdlib/assert/is-positive-integer").isPrimitive,_Le=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,En=require("@stdlib/string/format");function NLe(r,e){return wLe(e)?$e(e,"sep")&&(r.sep=e.sep,!yz(r.sep))?new TypeError(En("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):$e(e,"objectMode")&&(r.objectMode=e.objectMode,!SLe(r.objectMode))?new TypeError(En("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):$e(e,"encoding")&&(r.encoding=e.encoding,!yz(r.encoding)&&r.encoding!==null)?new TypeError(En("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):$e(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!OLe(r.highWaterMark))?new TypeError(En("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):$e(e,"iter")&&(r.iter=e.iter,!_Le(r.iter))?new TypeError(En("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):$e(e,"siter")&&(r.siter=e.siter,!ELe(r.siter))?new TypeError(En("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):($e(e,"prng")&&(r.prng=e.prng),$e(e,"seed")&&(r.seed=e.seed),$e(e,"state")&&(r.state=e.state),$e(e,"copy")&&(r.copy=e.copy),null):new TypeError(En("invalid argument. Options argument must be an object. Value: `%s`.",e))}qz.exports=NLe});var Sz=s(function(Ser,wz){"use strict";var LLe=require("debug"),RLe=LLe("random:streams:betaprime");wz.exports=RLe});var gf=s(function(Oer,Rz){"use strict";var Lz=require("readable-stream").Readable,Oz=require("@stdlib/assert/is-positive-number").isPrimitive,PLe=require("@stdlib/assert/is-error"),TLe=require("@stdlib/object/assign"),jLe=require("@stdlib/utils/inherit"),Ez=require("@stdlib/utils/define-nonenumerable-property"),yi=require("@stdlib/utils/define-nonenumerable-read-only-property"),vf=require("@stdlib/utils/define-read-only-accessor"),MLe=require("@stdlib/utils/define-read-write-accessor"),xLe=on().factory,_z=require("@stdlib/buffer/from-string"),ALe=require("@stdlib/utils/next-tick"),Nz=require("@stdlib/string/format"),GLe=pz(),VLe=bz(),Ka=Sz();function FLe(){return this._prng.seed}function WLe(){return this._prng.seedLength}function ILe(){return this._prng.stateLength}function kLe(){return this._prng.byteLength}function zLe(){return this._prng.state}function JLe(r){this._prng.state=r}function ULe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Ka("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Ka("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=_z(e):e=_z(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function CLe(r){var e;if(this._destroyed)return Ka("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,ALe(t),this;function t(){r&&(Ka("Stream was destroyed due to an error. Error: %s.",PLe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Ka("Closing the stream..."),e.emit("close")}}function ae(r,e,t){var i,n;if(!(this instanceof ae))return arguments.length>2?new ae(r,e,t):new ae(r,e);if(!Oz(r))throw new TypeError(Nz("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!Oz(e))throw new TypeError(Nz("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=TLe({},GLe),arguments.length>2&&(n=VLe(i,t),n))throw n;return Ka("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),Lz.call(this,i),Ez(this,"_destroyed",!1),yi(this,"_objectMode",i.objectMode),yi(this,"_sep",i.sep),yi(this,"_iter",i.iter),yi(this,"_siter",i.siter),Ez(this,"_i",0),yi(this,"_prng",xLe(r,e,i)),yi(this,"PRNG",this._prng.PRNG),this}jLe(ae,Lz);vf(ae.prototype,"seed",FLe);vf(ae.prototype,"seedLength",WLe);MLe(ae.prototype,"state",zLe,JLe);vf(ae.prototype,"stateLength",ILe);vf(ae.prototype,"byteLength",kLe);yi(ae.prototype,"_read",ULe);yi(ae.prototype,"destroy",CLe);Rz.exports=ae});var Tz=s(function(Eer,Pz){"use strict";var BLe=require("@stdlib/assert/is-plain-object"),DLe=require("@stdlib/string/format"),XLe=require("@stdlib/object/assign"),YLe=gf();function HLe(r,e,t){var i;if(arguments.length>2){if(i=t,!BLe(i))throw new TypeError(DLe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=XLe({},t)}else i={};return i.objectMode=!0,new YLe(r,e,i)}Pz.exports=HLe});var Vz=s(function(_er,Gz){"use strict";var jz=require("@stdlib/assert/is-plain-object"),Mz=require("@stdlib/object/assign"),xz=require("@stdlib/string/format"),Az=gf();function ZLe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!jz(r))throw new TypeError(xz("invalid argument. Options argument must be an object. Value: `%s`.",r));n=Mz({},r)}else if(i>2){if(!jz(t))throw new TypeError(xz("invalid argument. Options argument must be an object. Value: `%s`.",t));n=Mz({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new Az(v,g,n)}function o(){return new Az(r,e,n)}}Gz.exports=ZLe});var Iz=s(function(Ner,Wz){"use strict";var Fz=require("@stdlib/utils/define-nonenumerable-read-only-property"),_m=gf(),QLe=Tz(),$Le=Vz();Fz(_m,"objectMode",QLe);Fz(_m,"factory",$Le);Wz.exports=_m});var kz=s(function(Ler,KLe){KLe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var Uz=s(function(Rer,Jz){"use strict";var eRe=require("@stdlib/assert/is-plain-object"),Ke=require("@stdlib/assert/has-own-property"),rRe=require("@stdlib/assert/is-boolean").isPrimitive,tRe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,zz=require("@stdlib/assert/is-string").isPrimitive,iRe=require("@stdlib/assert/is-positive-integer").isPrimitive,nRe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,_n=require("@stdlib/string/format");function aRe(r,e){return eRe(e)?Ke(e,"sep")&&(r.sep=e.sep,!zz(r.sep))?new TypeError(_n("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Ke(e,"objectMode")&&(r.objectMode=e.objectMode,!rRe(r.objectMode))?new TypeError(_n("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Ke(e,"encoding")&&(r.encoding=e.encoding,!zz(r.encoding)&&r.encoding!==null)?new TypeError(_n("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Ke(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!tRe(r.highWaterMark))?new TypeError(_n("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Ke(e,"iter")&&(r.iter=e.iter,!nRe(r.iter))?new TypeError(_n("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Ke(e,"siter")&&(r.siter=e.siter,!iRe(r.siter))?new TypeError(_n("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(Ke(e,"prng")&&(r.prng=e.prng),Ke(e,"seed")&&(r.seed=e.seed),Ke(e,"state")&&(r.state=e.state),Ke(e,"copy")&&(r.copy=e.copy),null):new TypeError(_n("invalid argument. Options argument must be an object. Value: `%s`.",e))}Jz.exports=aRe});var Bz=s(function(Per,Cz){"use strict";var sRe=require("debug"),uRe=sRe("random:streams:binomial");Cz.exports=uRe});var df=s(function(Ter,Zz){"use strict";var Hz=require("readable-stream").Readable,oRe=require("@stdlib/assert/is-positive-integer").isPrimitive,vRe=require("@stdlib/assert/is-probability").isPrimitive,gRe=require("@stdlib/assert/is-error"),fRe=require("@stdlib/object/assign"),dRe=require("@stdlib/utils/inherit"),Dz=require("@stdlib/utils/define-nonenumerable-property"),qi=require("@stdlib/utils/define-nonenumerable-read-only-property"),ff=require("@stdlib/utils/define-read-only-accessor"),lRe=require("@stdlib/utils/define-read-write-accessor"),cRe=ca().factory,Xz=require("@stdlib/buffer/from-string"),mRe=require("@stdlib/utils/next-tick"),Yz=require("@stdlib/string/format"),hRe=kz(),pRe=Uz(),es=Bz();function yRe(){return this._prng.seed}function qRe(){return this._prng.seedLength}function bRe(){return this._prng.stateLength}function wRe(){return this._prng.byteLength}function SRe(){return this._prng.state}function ORe(r){this._prng.state=r}function ERe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return es("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),es("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=Xz(e):e=Xz(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function _Re(r){var e;if(this._destroyed)return es("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,mRe(t),this;function t(){r&&(es("Stream was destroyed due to an error. Error: %s.",gRe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),es("Closing the stream..."),e.emit("close")}}function se(r,e,t){var i,n;if(!(this instanceof se))return arguments.length>2?new se(r,e,t):new se(r,e);if(!oRe(r))throw new TypeError(Yz("invalid argument. First argument must be a positive integer. Value: `%s`.",r));if(!vRe(e))throw new TypeError(Yz("invalid argument. Second argument must be a probability. Value: `%s`.",e));if(i=fRe({},hRe),arguments.length>2&&(n=pRe(i,t),n))throw n;return es("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),Hz.call(this,i),Dz(this,"_destroyed",!1),qi(this,"_objectMode",i.objectMode),qi(this,"_sep",i.sep),qi(this,"_iter",i.iter),qi(this,"_siter",i.siter),Dz(this,"_i",0),qi(this,"_prng",cRe(r,e,i)),qi(this,"PRNG",this._prng.PRNG),this}dRe(se,Hz);ff(se.prototype,"seed",yRe);ff(se.prototype,"seedLength",qRe);lRe(se.prototype,"state",SRe,ORe);ff(se.prototype,"stateLength",bRe);ff(se.prototype,"byteLength",wRe);qi(se.prototype,"_read",ERe);qi(se.prototype,"destroy",_Re);Zz.exports=se});var $z=s(function(jer,Qz){"use strict";var NRe=require("@stdlib/assert/is-plain-object"),LRe=require("@stdlib/object/assign"),RRe=require("@stdlib/string/format"),PRe=df();function TRe(r,e,t){var i;if(arguments.length>2){if(i=t,!NRe(i))throw new TypeError(RRe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=LRe({},t)}else i={};return i.objectMode=!0,new PRe(r,e,i)}Qz.exports=TRe});var n3=s(function(Mer,i3){"use strict";var Kz=require("@stdlib/assert/is-plain-object"),e3=require("@stdlib/object/assign"),r3=require("@stdlib/string/format"),t3=df();function jRe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!Kz(r))throw new TypeError(r3("invalid argument. Options argument must be an object. Value: `%s`.",r));n=e3({},r)}else if(i>2){if(!Kz(t))throw new TypeError(r3("invalid argument. Options argument must be an object. Value: `%s`.",t));n=e3({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new t3(v,g,n)}function o(){return new t3(r,e,n)}}i3.exports=jRe});var u3=s(function(xer,s3){"use strict";var a3=require("@stdlib/utils/define-nonenumerable-read-only-property"),Nm=df(),MRe=$z(),xRe=n3();a3(Nm,"objectMode",MRe);a3(Nm,"factory",xRe);s3.exports=Nm});var o3=s(function(Aer,ARe){ARe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var f3=s(function(Ger,g3){"use strict";var GRe=require("@stdlib/assert/is-plain-object"),er=require("@stdlib/assert/has-own-property"),VRe=require("@stdlib/assert/is-boolean").isPrimitive,FRe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,v3=require("@stdlib/assert/is-string").isPrimitive,WRe=require("@stdlib/assert/is-positive-integer").isPrimitive,IRe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Nn=require("@stdlib/string/format");function kRe(r,e){return GRe(e)?er(e,"sep")&&(r.sep=e.sep,!v3(r.sep))?new TypeError(Nn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):er(e,"objectMode")&&(r.objectMode=e.objectMode,!VRe(r.objectMode))?new TypeError(Nn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):er(e,"encoding")&&(r.encoding=e.encoding,!v3(r.encoding)&&r.encoding!==null)?new TypeError(Nn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):er(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!FRe(r.highWaterMark))?new TypeError(Nn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):er(e,"iter")&&(r.iter=e.iter,!IRe(r.iter))?new TypeError(Nn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):er(e,"siter")&&(r.siter=e.siter,!WRe(r.siter))?new TypeError(Nn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(er(e,"prng")&&(r.prng=e.prng),er(e,"seed")&&(r.seed=e.seed),er(e,"state")&&(r.state=e.state),er(e,"copy")&&(r.copy=e.copy),null):new TypeError(Nn("invalid argument. Options argument must be an object. Value: `%s`.",e))}g3.exports=kRe});var l3=s(function(Ver,d3){"use strict";var zRe=require("debug"),JRe=zRe("random:streams:box-muller");d3.exports=JRe});var cf=s(function(Fer,p3){"use strict";var h3=require("readable-stream").Readable,URe=require("@stdlib/assert/is-error"),CRe=require("@stdlib/object/assign"),BRe=require("@stdlib/utils/inherit"),c3=require("@stdlib/utils/define-nonenumerable-property"),bi=require("@stdlib/utils/define-nonenumerable-read-only-property"),lf=require("@stdlib/utils/define-read-only-accessor"),DRe=require("@stdlib/utils/define-read-write-accessor"),XRe=Xa().factory,m3=require("@stdlib/buffer/from-string"),YRe=require("@stdlib/utils/next-tick"),HRe=o3(),ZRe=f3(),rs=l3();function QRe(){return this._prng.seed}function $Re(){return this._prng.seedLength}function KRe(){return this._prng.stateLength}function ePe(){return this._prng.byteLength}function rPe(){return this._prng.state}function tPe(r){this._prng.state=r}function iPe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return rs("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),rs("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=m3(e):e=m3(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function nPe(r){var e;if(this._destroyed)return rs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,YRe(t),this;function t(){r&&(rs("Stream was destroyed due to an error. Error: %s.",URe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),rs("Closing the stream..."),e.emit("close")}}function ue(r){var e,t;if(!(this instanceof ue))return arguments.length>0?new ue(r):new ue;if(e=CRe({},HRe),arguments.length>0&&(t=ZRe(e,r),t))throw t;return rs("Creating a readable stream configured with the following options: %s.",JSON.stringify(e)),h3.call(this,e),c3(this,"_destroyed",!1),bi(this,"_objectMode",e.objectMode),bi(this,"_sep",e.sep),bi(this,"_iter",e.iter),bi(this,"_siter",e.siter),c3(this,"_i",0),bi(this,"_prng",XRe(e)),bi(this,"PRNG",this._prng.PRNG),this}BRe(ue,h3);lf(ue.prototype,"seed",QRe);lf(ue.prototype,"seedLength",$Re);DRe(ue.prototype,"state",rPe,tPe);lf(ue.prototype,"stateLength",KRe);lf(ue.prototype,"byteLength",ePe);bi(ue.prototype,"_read",iPe);bi(ue.prototype,"destroy",nPe);p3.exports=ue});var q3=s(function(Wer,y3){"use strict";var aPe=require("@stdlib/assert/is-plain-object"),sPe=require("@stdlib/object/assign"),uPe=require("@stdlib/string/format"),oPe=cf();function vPe(r){var e;if(arguments.length>0){if(e=r,!aPe(e))throw new TypeError(uPe("invalid argument. Options argument must be an object. Value: `%s`.",e));e=sPe({},r)}else e={};return e.objectMode=!0,new oPe(e)}y3.exports=vPe});var w3=s(function(Ier,b3){"use strict";var gPe=require("@stdlib/assert/is-plain-object"),fPe=require("@stdlib/object/assign"),dPe=require("@stdlib/string/format"),lPe=cf();function cPe(r){var e;if(arguments.length>0){if(!gPe(r))throw new TypeError(dPe("invalid argument. Options argument must be an object. Value: `%s`.",r));e=fPe({},r)}else e={};return t;function t(){return new lPe(e)}}b3.exports=cPe});var E3=s(function(ker,O3){"use strict";var S3=require("@stdlib/utils/define-nonenumerable-read-only-property"),Lm=cf(),mPe=q3(),hPe=w3();S3(Lm,"objectMode",mPe);S3(Lm,"factory",hPe);O3.exports=Lm});var _3=s(function(zer,pPe){pPe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var R3=s(function(Jer,L3){"use strict";var yPe=require("@stdlib/assert/is-plain-object"),rr=require("@stdlib/assert/has-own-property"),qPe=require("@stdlib/assert/is-boolean").isPrimitive,bPe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,N3=require("@stdlib/assert/is-string").isPrimitive,wPe=require("@stdlib/assert/is-positive-integer").isPrimitive,SPe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Ln=require("@stdlib/string/format");function OPe(r,e){return yPe(e)?rr(e,"sep")&&(r.sep=e.sep,!N3(r.sep))?new TypeError(Ln("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):rr(e,"objectMode")&&(r.objectMode=e.objectMode,!qPe(r.objectMode))?new TypeError(Ln("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):rr(e,"encoding")&&(r.encoding=e.encoding,!N3(r.encoding)&&r.encoding!==null)?new TypeError(Ln("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):rr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!bPe(r.highWaterMark))?new TypeError(Ln("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):rr(e,"iter")&&(r.iter=e.iter,!SPe(r.iter))?new TypeError(Ln("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):rr(e,"siter")&&(r.siter=e.siter,!wPe(r.siter))?new TypeError(Ln("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(rr(e,"prng")&&(r.prng=e.prng),rr(e,"seed")&&(r.seed=e.seed),rr(e,"state")&&(r.state=e.state),rr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Ln("invalid argument. Options argument must be an object. Value: `%s`.",e))}L3.exports=OPe});var T3=s(function(Uer,P3){"use strict";var EPe=require("debug"),_Pe=EPe("random:streams:cauchy");P3.exports=_Pe});var hf=s(function(Cer,G3){"use strict";var A3=require("readable-stream").Readable,NPe=require("@stdlib/assert/is-positive-number").isPrimitive,LPe=require("@stdlib/assert/is-number").isPrimitive,RPe=require("@stdlib/math/base/assert/is-nan"),PPe=require("@stdlib/assert/is-error"),TPe=require("@stdlib/object/assign"),jPe=require("@stdlib/utils/inherit"),j3=require("@stdlib/utils/define-nonenumerable-property"),wi=require("@stdlib/utils/define-nonenumerable-read-only-property"),mf=require("@stdlib/utils/define-read-only-accessor"),MPe=require("@stdlib/utils/define-read-write-accessor"),xPe=ha().factory,M3=require("@stdlib/buffer/from-string"),APe=require("@stdlib/utils/next-tick"),x3=require("@stdlib/string/format"),GPe=_3(),VPe=R3(),ts=T3();function FPe(){return this._prng.seed}function WPe(){return this._prng.seedLength}function IPe(){return this._prng.stateLength}function kPe(){return this._prng.byteLength}function zPe(){return this._prng.state}function JPe(r){this._prng.state=r}function UPe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return ts("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),ts("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=M3(e):e=M3(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function CPe(r){var e;if(this._destroyed)return ts("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,APe(t),this;function t(){r&&(ts("Stream was destroyed due to an error. Error: %s.",PPe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),ts("Closing the stream..."),e.emit("close")}}function oe(r,e,t){var i,n;if(!(this instanceof oe))return arguments.length>2?new oe(r,e,t):new oe(r,e);if(!LPe(r)||RPe(r))throw new TypeError(x3("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!NPe(e))throw new TypeError(x3("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=TPe({},GPe),arguments.length>2&&(n=VPe(i,t),n))throw n;return ts("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),A3.call(this,i),j3(this,"_destroyed",!1),wi(this,"_objectMode",i.objectMode),wi(this,"_sep",i.sep),wi(this,"_iter",i.iter),wi(this,"_siter",i.siter),j3(this,"_i",0),wi(this,"_prng",xPe(r,e,i)),wi(this,"PRNG",this._prng.PRNG),this}jPe(oe,A3);mf(oe.prototype,"seed",FPe);mf(oe.prototype,"seedLength",WPe);MPe(oe.prototype,"state",zPe,JPe);mf(oe.prototype,"stateLength",IPe);mf(oe.prototype,"byteLength",kPe);wi(oe.prototype,"_read",UPe);wi(oe.prototype,"destroy",CPe);G3.exports=oe});var F3=s(function(Ber,V3){"use strict";var BPe=require("@stdlib/assert/is-plain-object"),DPe=require("@stdlib/object/assign"),XPe=require("@stdlib/string/format"),YPe=hf();function HPe(r,e,t){var i;if(arguments.length>2){if(i=t,!BPe(i))throw new TypeError(XPe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=DPe({},t)}else i={};return i.objectMode=!0,new YPe(r,e,i)}V3.exports=HPe});var U3=s(function(Der,J3){"use strict";var W3=require("@stdlib/assert/is-plain-object"),I3=require("@stdlib/object/assign"),k3=require("@stdlib/string/format"),z3=hf();function ZPe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!W3(r))throw new TypeError(k3("invalid argument. Options argument must be an object. Value: `%s`.",r));n=I3({},r)}else if(i>2){if(!W3(t))throw new TypeError(k3("invalid argument. Options argument must be an object. Value: `%s`.",t));n=I3({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new z3(v,g,n)}function o(){return new z3(r,e,n)}}J3.exports=ZPe});var D3=s(function(Xer,B3){"use strict";var C3=require("@stdlib/utils/define-nonenumerable-read-only-property"),Rm=hf(),QPe=F3(),$Pe=U3();C3(Rm,"objectMode",QPe);C3(Rm,"factory",$Pe);B3.exports=Rm});var X3=s(function(Yer,KPe){KPe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var Z3=s(function(Her,H3){"use strict";var eTe=require("@stdlib/assert/is-plain-object"),tr=require("@stdlib/assert/has-own-property"),rTe=require("@stdlib/assert/is-boolean").isPrimitive,tTe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,Y3=require("@stdlib/assert/is-string").isPrimitive,iTe=require("@stdlib/assert/is-positive-integer").isPrimitive,nTe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Rn=require("@stdlib/string/format");function aTe(r,e){return eTe(e)?tr(e,"sep")&&(r.sep=e.sep,!Y3(r.sep))?new TypeError(Rn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):tr(e,"objectMode")&&(r.objectMode=e.objectMode,!rTe(r.objectMode))?new TypeError(Rn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):tr(e,"encoding")&&(r.encoding=e.encoding,!Y3(r.encoding)&&r.encoding!==null)?new TypeError(Rn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):tr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!tTe(r.highWaterMark))?new TypeError(Rn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):tr(e,"iter")&&(r.iter=e.iter,!nTe(r.iter))?new TypeError(Rn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):tr(e,"siter")&&(r.siter=e.siter,!iTe(r.siter))?new TypeError(Rn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(tr(e,"prng")&&(r.prng=e.prng),tr(e,"seed")&&(r.seed=e.seed),tr(e,"state")&&(r.state=e.state),tr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Rn("invalid argument. Options argument must be an object. Value: `%s`.",e))}H3.exports=aTe});var $3=s(function(Zer,Q3){"use strict";var sTe=require("debug"),uTe=sTe("random:streams:chi");Q3.exports=uTe});var yf=s(function(Qer,tJ){"use strict";var rJ=require("readable-stream").Readable,oTe=require("@stdlib/assert/is-positive-number").isPrimitive,vTe=require("@stdlib/assert/is-error"),gTe=require("@stdlib/object/assign"),fTe=require("@stdlib/utils/inherit"),K3=require("@stdlib/utils/define-nonenumerable-property"),Si=require("@stdlib/utils/define-nonenumerable-read-only-property"),pf=require("@stdlib/utils/define-read-only-accessor"),dTe=require("@stdlib/utils/define-read-write-accessor"),lTe=vn().factory,eJ=require("@stdlib/buffer/from-string"),cTe=require("@stdlib/utils/next-tick"),mTe=require("@stdlib/string/format"),hTe=X3(),pTe=Z3(),is=$3();function yTe(){return this._prng.seed}function qTe(){return this._prng.seedLength}function bTe(){return this._prng.stateLength}function wTe(){return this._prng.byteLength}function STe(){return this._prng.state}function OTe(r){this._prng.state=r}function ETe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return is("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),is("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=eJ(e):e=eJ(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function _Te(r){var e;if(this._destroyed)return is("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,cTe(t),this;function t(){r&&(is("Stream was destroyed due to an error. Error: %s.",vTe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),is("Closing the stream..."),e.emit("close")}}function ve(r,e){var t,i;if(!(this instanceof ve))return arguments.length>1?new ve(r,e):new ve(r);if(!oTe(r))throw new TypeError(mTe("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(t=gTe({},hTe),arguments.length>1&&(i=pTe(t,e),i))throw i;return is("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),rJ.call(this,t),K3(this,"_destroyed",!1),Si(this,"_objectMode",t.objectMode),Si(this,"_sep",t.sep),Si(this,"_iter",t.iter),Si(this,"_siter",t.siter),K3(this,"_i",0),Si(this,"_prng",lTe(r,t)),Si(this,"PRNG",this._prng.PRNG),this}fTe(ve,rJ);pf(ve.prototype,"seed",yTe);pf(ve.prototype,"seedLength",qTe);dTe(ve.prototype,"state",STe,OTe);pf(ve.prototype,"stateLength",bTe);pf(ve.prototype,"byteLength",wTe);Si(ve.prototype,"_read",ETe);Si(ve.prototype,"destroy",_Te);tJ.exports=ve});var nJ=s(function($er,iJ){"use strict";var NTe=require("@stdlib/assert/is-plain-object"),LTe=require("@stdlib/object/assign"),RTe=require("@stdlib/string/format"),PTe=yf();function TTe(r,e){var t;if(arguments.length>1){if(t=e,!NTe(t))throw new TypeError(RTe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=LTe({},e)}else t={};return t.objectMode=!0,new PTe(r,t)}iJ.exports=TTe});var gJ=s(function(Ker,vJ){"use strict";var aJ=require("@stdlib/assert/is-plain-object"),jTe=require("@stdlib/assert/is-positive-number").isPrimitive,sJ=require("@stdlib/object/assign"),uJ=require("@stdlib/string/format"),oJ=yf();function MTe(r,e){var t,i,n;if(t=arguments.length,t>1){if(!aJ(e))throw new TypeError(uJ("invalid argument. Options argument must be an object. Value: `%s`.",e));n=u,i=sJ({},e)}else if(t===1)if(jTe(r))n=u,i={};else{if(!aJ(r))throw new TypeError(uJ("invalid argument. Options argument must be an object. Value: `%s`.",r));i=sJ({},r),n=a}else i={},n=a;return n;function a(o){return new oJ(o,i)}function u(){return new oJ(r,i)}}vJ.exports=MTe});var lJ=s(function(err,dJ){"use strict";var fJ=require("@stdlib/utils/define-nonenumerable-read-only-property"),Pm=yf(),xTe=nJ(),ATe=gJ();fJ(Pm,"objectMode",xTe);fJ(Pm,"factory",ATe);dJ.exports=Pm});var cJ=s(function(rrr,GTe){GTe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var pJ=s(function(trr,hJ){"use strict";var VTe=require("@stdlib/assert/is-plain-object"),ir=require("@stdlib/assert/has-own-property"),FTe=require("@stdlib/assert/is-boolean").isPrimitive,WTe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,mJ=require("@stdlib/assert/is-string").isPrimitive,ITe=require("@stdlib/assert/is-positive-integer").isPrimitive,kTe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Pn=require("@stdlib/string/format");function zTe(r,e){return VTe(e)?ir(e,"sep")&&(r.sep=e.sep,!mJ(r.sep))?new TypeError(Pn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):ir(e,"objectMode")&&(r.objectMode=e.objectMode,!FTe(r.objectMode))?new TypeError(Pn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):ir(e,"encoding")&&(r.encoding=e.encoding,!mJ(r.encoding)&&r.encoding!==null)?new TypeError(Pn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):ir(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!WTe(r.highWaterMark))?new TypeError(Pn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):ir(e,"iter")&&(r.iter=e.iter,!kTe(r.iter))?new TypeError(Pn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):ir(e,"siter")&&(r.siter=e.siter,!ITe(r.siter))?new TypeError(Pn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(ir(e,"prng")&&(r.prng=e.prng),ir(e,"seed")&&(r.seed=e.seed),ir(e,"state")&&(r.state=e.state),ir(e,"copy")&&(r.copy=e.copy),null):new TypeError(Pn("invalid argument. Options argument must be an object. Value: `%s`.",e))}hJ.exports=zTe});var qJ=s(function(irr,yJ){"use strict";var JTe=require("debug"),UTe=JTe("random:streams:chisquare");yJ.exports=UTe});var bf=s(function(nrr,OJ){"use strict";var SJ=require("readable-stream").Readable,CTe=require("@stdlib/assert/is-positive-number").isPrimitive,BTe=require("@stdlib/assert/is-error"),DTe=require("@stdlib/object/assign"),XTe=require("@stdlib/utils/inherit"),bJ=require("@stdlib/utils/define-nonenumerable-property"),Oi=require("@stdlib/utils/define-nonenumerable-read-only-property"),qf=require("@stdlib/utils/define-read-only-accessor"),YTe=require("@stdlib/utils/define-read-write-accessor"),HTe=Xe().factory,wJ=require("@stdlib/buffer/from-string"),ZTe=require("@stdlib/utils/next-tick"),QTe=require("@stdlib/string/format"),$Te=cJ(),KTe=pJ(),ns=qJ();function eje(){return this._prng.seed}function rje(){return this._prng.seedLength}function tje(){return this._prng.stateLength}function ije(){return this._prng.byteLength}function nje(){return this._prng.state}function aje(r){this._prng.state=r}function sje(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return ns("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),ns("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=wJ(e):e=wJ(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function uje(r){var e;if(this._destroyed)return ns("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,ZTe(t),this;function t(){r&&(ns("Stream was destroyed due to an error. Error: %s.",BTe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),ns("Closing the stream..."),e.emit("close")}}function ge(r,e){var t,i;if(!(this instanceof ge))return arguments.length>1?new ge(r,e):new ge(r);if(!CTe(r))throw new TypeError(QTe("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(t=DTe({},$Te),arguments.length>1&&(i=KTe(t,e),i))throw i;return ns("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),SJ.call(this,t),bJ(this,"_destroyed",!1),Oi(this,"_objectMode",t.objectMode),Oi(this,"_sep",t.sep),Oi(this,"_iter",t.iter),Oi(this,"_siter",t.siter),bJ(this,"_i",0),Oi(this,"_prng",HTe(r,t)),Oi(this,"PRNG",this._prng.PRNG),this}XTe(ge,SJ);qf(ge.prototype,"seed",eje);qf(ge.prototype,"seedLength",rje);YTe(ge.prototype,"state",nje,aje);qf(ge.prototype,"stateLength",tje);qf(ge.prototype,"byteLength",ije);Oi(ge.prototype,"_read",sje);Oi(ge.prototype,"destroy",uje);OJ.exports=ge});var _J=s(function(arr,EJ){"use strict";var oje=require("@stdlib/assert/is-plain-object"),vje=require("@stdlib/object/assign"),gje=require("@stdlib/string/format"),fje=bf();function dje(r,e){var t;if(arguments.length>1){if(t=e,!oje(t))throw new TypeError(gje("invalid argument. Options argument must be an object. Value: `%s`.",t));t=vje({},t)}else t={};return t.objectMode=!0,new fje(r,t)}EJ.exports=dje});var jJ=s(function(srr,TJ){"use strict";var lje=require("@stdlib/assert/is-positive-number").isPrimitive,NJ=require("@stdlib/assert/is-plain-object"),LJ=require("@stdlib/object/assign"),RJ=require("@stdlib/string/format"),PJ=bf();function cje(r,e){var t,i,n;if(t=arguments.length,t>1){if(!NJ(e))throw new TypeError(RJ("invalid argument. Options argument must be an object. Value: `%s`.",e));n=u,i=LJ({},e)}else if(t===1)if(lje(r))n=u,i={};else{if(!NJ(r))throw new TypeError(RJ("invalid argument. Options argument must be an object. Value: `%s`.",r));i=LJ({},r),n=a}else i={},n=a;return n;function a(o){return new PJ(o,i)}function u(){return new PJ(r,i)}}TJ.exports=cje});var AJ=s(function(urr,xJ){"use strict";var MJ=require("@stdlib/utils/define-nonenumerable-read-only-property"),Tm=bf(),mje=_J(),hje=jJ();MJ(Tm,"objectMode",mje);MJ(Tm,"factory",hje);xJ.exports=Tm});var GJ=s(function(orr,pje){pje.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var WJ=s(function(vrr,FJ){"use strict";var yje=require("@stdlib/assert/is-plain-object"),nr=require("@stdlib/assert/has-own-property"),qje=require("@stdlib/assert/is-boolean").isPrimitive,bje=require("@stdlib/assert/is-nonnegative-number").isPrimitive,VJ=require("@stdlib/assert/is-string").isPrimitive,wje=require("@stdlib/assert/is-positive-integer").isPrimitive,Sje=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Tn=require("@stdlib/string/format");function Oje(r,e){return yje(e)?nr(e,"sep")&&(r.sep=e.sep,!VJ(r.sep))?new TypeError(Tn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):nr(e,"objectMode")&&(r.objectMode=e.objectMode,!qje(r.objectMode))?new TypeError(Tn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):nr(e,"encoding")&&(r.encoding=e.encoding,!VJ(r.encoding)&&r.encoding!==null)?new TypeError(Tn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):nr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!bje(r.highWaterMark))?new TypeError(Tn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):nr(e,"iter")&&(r.iter=e.iter,!Sje(r.iter))?new TypeError(Tn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):nr(e,"siter")&&(r.siter=e.siter,!wje(r.siter))?new TypeError(Tn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(nr(e,"prng")&&(r.prng=e.prng),nr(e,"seed")&&(r.seed=e.seed),nr(e,"state")&&(r.state=e.state),nr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Tn("invalid argument. Options argument must be an object. Value: `%s`.",e))}FJ.exports=Oje});var kJ=s(function(grr,IJ){"use strict";var Eje=require("debug"),_je=Eje("random:streams:cosine");IJ.exports=_je});var Sf=s(function(frr,BJ){"use strict";var CJ=require("readable-stream").Readable,Nje=require("@stdlib/assert/is-positive-number").isPrimitive,Lje=require("@stdlib/assert/is-number").isPrimitive,Rje=require("@stdlib/math/base/assert/is-nan"),Pje=require("@stdlib/assert/is-error"),Tje=require("@stdlib/object/assign"),jje=require("@stdlib/utils/inherit"),zJ=require("@stdlib/utils/define-nonenumerable-property"),Ei=require("@stdlib/utils/define-nonenumerable-read-only-property"),wf=require("@stdlib/utils/define-read-only-accessor"),Mje=require("@stdlib/utils/define-read-write-accessor"),xje=gn().factory,JJ=require("@stdlib/buffer/from-string"),Aje=require("@stdlib/utils/next-tick"),UJ=require("@stdlib/string/format"),Gje=GJ(),Vje=WJ(),as=kJ();function Fje(){return this._prng.seed}function Wje(){return this._prng.seedLength}function Ije(){return this._prng.stateLength}function kje(){return this._prng.byteLength}function zje(){return this._prng.state}function Jje(r){this._prng.state=r}function Uje(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return as("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),as("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=JJ(e):e=JJ(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function Cje(r){var e;if(this._destroyed)return as("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,Aje(t),this;function t(){r&&(as("Stream was destroyed due to an error. Error: %s.",Pje(r)?r.message:JSON.stringify(r)),e.emit("error",r)),as("Closing the stream..."),e.emit("close")}}function fe(r,e,t){var i,n;if(!(this instanceof fe))return arguments.length>2?new fe(r,e,t):new fe(r,e);if(!Lje(r)||Rje(r))throw new TypeError(UJ("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!Nje(e))throw new TypeError(UJ("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=Tje({},Gje),arguments.length>2&&(n=Vje(i,t),n))throw n;return as("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),CJ.call(this,i),zJ(this,"_destroyed",!1),Ei(this,"_objectMode",i.objectMode),Ei(this,"_sep",i.sep),Ei(this,"_iter",i.iter),Ei(this,"_siter",i.siter),zJ(this,"_i",0),Ei(this,"_prng",xje(r,e,i)),Ei(this,"PRNG",this._prng.PRNG),this}jje(fe,CJ);wf(fe.prototype,"seed",Fje);wf(fe.prototype,"seedLength",Wje);Mje(fe.prototype,"state",zje,Jje);wf(fe.prototype,"stateLength",Ije);wf(fe.prototype,"byteLength",kje);Ei(fe.prototype,"_read",Uje);Ei(fe.prototype,"destroy",Cje);BJ.exports=fe});var XJ=s(function(drr,DJ){"use strict";var Bje=require("@stdlib/assert/is-plain-object"),Dje=require("@stdlib/object/assign"),Xje=require("@stdlib/string/format"),Yje=Sf();function Hje(r,e,t){var i;if(arguments.length>2){if(i=t,!Bje(i))throw new TypeError(Xje("invalid argument. Options argument must be an object. Value: `%s`.",i));i=Dje({},t)}else i={};return i.objectMode=!0,new Yje(r,e,i)}DJ.exports=Hje});var KJ=s(function(lrr,$J){"use strict";var YJ=require("@stdlib/assert/is-plain-object"),HJ=require("@stdlib/object/assign"),ZJ=require("@stdlib/string/format"),QJ=Sf();function Zje(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!YJ(r))throw new TypeError(ZJ("invalid argument. Options argument must be an object. Value: `%s`.",r));n=HJ({},r)}else if(i>2){if(!YJ(t))throw new TypeError(ZJ("invalid argument. Options argument must be an object. Value: `%s`.",t));n=HJ({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new QJ(v,g,n)}function o(){return new QJ(r,e,n)}}$J.exports=Zje});var tU=s(function(crr,rU){"use strict";var eU=require("@stdlib/utils/define-nonenumerable-read-only-property"),jm=Sf(),Qje=XJ(),$je=KJ();eU(jm,"objectMode",Qje);eU(jm,"factory",$je);rU.exports=jm});var iU=s(function(mrr,Kje){Kje.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var sU=s(function(hrr,aU){"use strict";var e0e=require("@stdlib/assert/is-plain-object"),ar=require("@stdlib/assert/has-own-property"),r0e=require("@stdlib/assert/is-boolean").isPrimitive,t0e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,nU=require("@stdlib/assert/is-string").isPrimitive,i0e=require("@stdlib/assert/is-positive-integer").isPrimitive,n0e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,jn=require("@stdlib/string/format");function a0e(r,e){return e0e(e)?ar(e,"sep")&&(r.sep=e.sep,!nU(r.sep))?new TypeError(jn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):ar(e,"objectMode")&&(r.objectMode=e.objectMode,!r0e(r.objectMode))?new TypeError(jn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):ar(e,"encoding")&&(r.encoding=e.encoding,!nU(r.encoding)&&r.encoding!==null)?new TypeError(jn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):ar(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!t0e(r.highWaterMark))?new TypeError(jn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):ar(e,"iter")&&(r.iter=e.iter,!n0e(r.iter))?new TypeError(jn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):ar(e,"siter")&&(r.siter=e.siter,!i0e(r.siter))?new TypeError(jn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(ar(e,"prng")&&(r.prng=e.prng),ar(e,"seed")&&(r.seed=e.seed),ar(e,"state")&&(r.state=e.state),ar(e,"copy")&&(r.copy=e.copy),null):new TypeError(jn("invalid argument. Options argument must be an object. Value: `%s`.",e))}aU.exports=a0e});var oU=s(function(prr,uU){"use strict";var s0e=require("debug"),u0e=s0e("random:streams:discrete-uniform");uU.exports=u0e});var Ef=s(function(yrr,lU){"use strict";var dU=require("readable-stream").Readable,vU=require("@stdlib/assert/is-integer").isPrimitive,o0e=require("@stdlib/assert/is-error"),v0e=require("@stdlib/object/assign"),g0e=require("@stdlib/utils/inherit"),gU=require("@stdlib/utils/define-nonenumerable-property"),_i=require("@stdlib/utils/define-nonenumerable-read-only-property"),Of=require("@stdlib/utils/define-read-only-accessor"),f0e=require("@stdlib/utils/define-read-write-accessor"),d0e=fn().factory,fU=require("@stdlib/buffer/from-string"),l0e=require("@stdlib/utils/next-tick"),Mm=require("@stdlib/string/format"),c0e=iU(),m0e=sU(),ss=oU();function h0e(){return this._prng.seed}function p0e(){return this._prng.seedLength}function y0e(){return this._prng.stateLength}function q0e(){return this._prng.byteLength}function b0e(){return this._prng.state}function w0e(r){this._prng.state=r}function S0e(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return ss("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),ss("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=fU(e):e=fU(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function O0e(r){var e;if(this._destroyed)return ss("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,l0e(t),this;function t(){r&&(ss("Stream was destroyed due to an error. Error: %s.",o0e(r)?r.message:JSON.stringify(r)),e.emit("error",r)),ss("Closing the stream..."),e.emit("close")}}function de(r,e,t){var i,n;if(!(this instanceof de))return arguments.length>2?new de(r,e,t):new de(r,e);if(!vU(r))throw new TypeError(Mm("invalid argument. First argument must be an integer. Value: `%s`.",r));if(!vU(e))throw new TypeError(Mm("invalid argument. Second argument must be an integer. Value: `%s`.",e));if(r>e)throw new RangeError(Mm("invalid argument. Minimum support must be less than or equal to maximum support. Value: `[%d, %d]`.",r,e));if(i=v0e({},c0e),arguments.length>2&&(n=m0e(i,t),n))throw n;return ss("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),dU.call(this,i),gU(this,"_destroyed",!1),_i(this,"_objectMode",i.objectMode),_i(this,"_sep",i.sep),_i(this,"_iter",i.iter),_i(this,"_siter",i.siter),gU(this,"_i",0),_i(this,"_prng",d0e(r,e,i)),_i(this,"PRNG",this._prng.PRNG),this}g0e(de,dU);Of(de.prototype,"seed",h0e);Of(de.prototype,"seedLength",p0e);f0e(de.prototype,"state",b0e,w0e);Of(de.prototype,"stateLength",y0e);Of(de.prototype,"byteLength",q0e);_i(de.prototype,"_read",S0e);_i(de.prototype,"destroy",O0e);lU.exports=de});var mU=s(function(qrr,cU){"use strict";var E0e=require("@stdlib/assert/is-plain-object"),_0e=require("@stdlib/object/assign"),N0e=require("@stdlib/string/format"),L0e=Ef();function R0e(r,e,t){var i;if(arguments.length>2){if(i=t,!E0e(i))throw new TypeError(N0e("invalid argument. Options argument must be an object. Value: `%s`.",i));i=_0e({},t)}else i={};return i.objectMode=!0,new L0e(r,e,i)}cU.exports=R0e});var wU=s(function(brr,bU){"use strict";var hU=require("@stdlib/assert/is-plain-object"),pU=require("@stdlib/object/assign"),yU=require("@stdlib/string/format"),qU=Ef();function P0e(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!hU(r))throw new TypeError(yU("invalid argument. Options argument must be an object. Value: `%s`.",r));n=pU({},r)}else if(i>2){if(!hU(t))throw new TypeError(yU("invalid argument. Options argument must be an object. Value: `%s`.",t));n=pU({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new qU(v,g,n)}function o(){return new qU(r,e,n)}}bU.exports=P0e});var EU=s(function(wrr,OU){"use strict";var SU=require("@stdlib/utils/define-nonenumerable-read-only-property"),xm=Ef(),T0e=mU(),j0e=wU();SU(xm,"objectMode",T0e);SU(xm,"factory",j0e);OU.exports=xm});var _U=s(function(Srr,M0e){M0e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var RU=s(function(Orr,LU){"use strict";var x0e=require("@stdlib/assert/is-plain-object"),sr=require("@stdlib/assert/has-own-property"),A0e=require("@stdlib/assert/is-boolean").isPrimitive,G0e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,NU=require("@stdlib/assert/is-string").isPrimitive,V0e=require("@stdlib/assert/is-positive-integer").isPrimitive,F0e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Mn=require("@stdlib/string/format");function W0e(r,e){return x0e(e)?sr(e,"sep")&&(r.sep=e.sep,!NU(r.sep))?new TypeError(Mn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):sr(e,"objectMode")&&(r.objectMode=e.objectMode,!A0e(r.objectMode))?new TypeError(Mn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):sr(e,"encoding")&&(r.encoding=e.encoding,!NU(r.encoding)&&r.encoding!==null)?new TypeError(Mn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):sr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!G0e(r.highWaterMark))?new TypeError(Mn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):sr(e,"iter")&&(r.iter=e.iter,!F0e(r.iter))?new TypeError(Mn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):sr(e,"siter")&&(r.siter=e.siter,!V0e(r.siter))?new TypeError(Mn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(sr(e,"prng")&&(r.prng=e.prng),sr(e,"seed")&&(r.seed=e.seed),sr(e,"state")&&(r.state=e.state),sr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Mn("invalid argument. Options argument must be an object. Value: `%s`.",e))}LU.exports=W0e});var TU=s(function(Err,PU){"use strict";var I0e=require("debug"),k0e=I0e("random:streams:erlang");PU.exports=k0e});var Nf=s(function(_rr,GU){"use strict";var AU=require("readable-stream").Readable,z0e=require("@stdlib/assert/is-positive-integer").isPrimitive,J0e=require("@stdlib/assert/is-positive-number").isPrimitive,U0e=require("@stdlib/assert/is-error"),C0e=require("@stdlib/object/assign"),B0e=require("@stdlib/utils/inherit"),jU=require("@stdlib/utils/define-nonenumerable-property"),Ni=require("@stdlib/utils/define-nonenumerable-read-only-property"),_f=require("@stdlib/utils/define-read-only-accessor"),D0e=require("@stdlib/utils/define-read-write-accessor"),X0e=wa().factory,MU=require("@stdlib/buffer/from-string"),Y0e=require("@stdlib/utils/next-tick"),xU=require("@stdlib/string/format"),H0e=_U(),Z0e=RU(),us=TU();function Q0e(){return this._prng.seed}function $0e(){return this._prng.seedLength}function K0e(){return this._prng.stateLength}function eMe(){return this._prng.byteLength}function rMe(){return this._prng.state}function tMe(r){this._prng.state=r}function iMe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return us("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),us("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=MU(e):e=MU(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function nMe(r){var e;if(this._destroyed)return us("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,Y0e(t),this;function t(){r&&(us("Stream was destroyed due to an error. Error: %s.",U0e(r)?r.message:JSON.stringify(r)),e.emit("error",r)),us("Closing the stream..."),e.emit("close")}}function le(r,e,t){var i,n;if(!(this instanceof le))return arguments.length>2?new le(r,e,t):new le(r,e);if(!z0e(r))throw new TypeError(xU("invalid argument. First argument must be a positive integer. Value: `%s`.",r));if(!J0e(e))throw new TypeError(xU("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=C0e({},H0e),arguments.length>2&&(n=Z0e(i,t),n))throw n;return us("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),AU.call(this,i),jU(this,"_destroyed",!1),Ni(this,"_objectMode",i.objectMode),Ni(this,"_sep",i.sep),Ni(this,"_iter",i.iter),Ni(this,"_siter",i.siter),jU(this,"_i",0),Ni(this,"_prng",X0e(r,e,i)),Ni(this,"PRNG",this._prng.PRNG),this}B0e(le,AU);_f(le.prototype,"seed",Q0e);_f(le.prototype,"seedLength",$0e);D0e(le.prototype,"state",rMe,tMe);_f(le.prototype,"stateLength",K0e);_f(le.prototype,"byteLength",eMe);Ni(le.prototype,"_read",iMe);Ni(le.prototype,"destroy",nMe);GU.exports=le});var FU=s(function(Nrr,VU){"use strict";var aMe=require("@stdlib/assert/is-plain-object"),sMe=require("@stdlib/object/assign"),uMe=require("@stdlib/string/format"),oMe=Nf();function vMe(r,e,t){var i;if(arguments.length>2){if(i=t,!aMe(i))throw new TypeError(uMe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=sMe({},t)}else i={};return i.objectMode=!0,new oMe(r,e,i)}VU.exports=vMe});var UU=s(function(Lrr,JU){"use strict";var WU=require("@stdlib/assert/is-plain-object"),IU=require("@stdlib/object/assign"),kU=require("@stdlib/string/format"),zU=Nf();function gMe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!WU(r))throw new TypeError(kU("invalid argument. Options argument must be an object. Value: `%s`.",r));n=IU({},r)}else if(i>2){if(!WU(t))throw new TypeError(kU("invalid argument. Options argument must be an object. Value: `%s`.",t));n=IU({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new zU(v,g,n)}function o(){return new zU(r,e,n)}}JU.exports=gMe});var DU=s(function(Rrr,BU){"use strict";var CU=require("@stdlib/utils/define-nonenumerable-read-only-property"),Am=Nf(),fMe=FU(),dMe=UU();CU(Am,"objectMode",fMe);CU(Am,"factory",dMe);BU.exports=Am});var XU=s(function(Prr,lMe){lMe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var ZU=s(function(Trr,HU){"use strict";var cMe=require("@stdlib/assert/is-plain-object"),ur=require("@stdlib/assert/has-own-property"),mMe=require("@stdlib/assert/is-boolean").isPrimitive,hMe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,YU=require("@stdlib/assert/is-string").isPrimitive,pMe=require("@stdlib/assert/is-positive-integer").isPrimitive,yMe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,xn=require("@stdlib/string/format");function qMe(r,e){return cMe(e)?ur(e,"sep")&&(r.sep=e.sep,!YU(r.sep))?new TypeError(xn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):ur(e,"objectMode")&&(r.objectMode=e.objectMode,!mMe(r.objectMode))?new TypeError(xn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):ur(e,"encoding")&&(r.encoding=e.encoding,!YU(r.encoding)&&r.encoding!==null)?new TypeError(xn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):ur(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!hMe(r.highWaterMark))?new TypeError(xn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):ur(e,"iter")&&(r.iter=e.iter,!yMe(r.iter))?new TypeError(xn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):ur(e,"siter")&&(r.siter=e.siter,!pMe(r.siter))?new TypeError(xn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(ur(e,"prng")&&(r.prng=e.prng),ur(e,"seed")&&(r.seed=e.seed),ur(e,"state")&&(r.state=e.state),ur(e,"copy")&&(r.copy=e.copy),null):new TypeError(xn("invalid argument. Options argument must be an object. Value: `%s`.",e))}HU.exports=qMe});var $U=s(function(jrr,QU){"use strict";var bMe=require("debug"),wMe=bMe("random:streams:exponential");QU.exports=wMe});var Rf=s(function(Mrr,tC){"use strict";var rC=require("readable-stream").Readable,SMe=require("@stdlib/assert/is-positive-number").isPrimitive,OMe=require("@stdlib/assert/is-error"),EMe=require("@stdlib/object/assign"),_Me=require("@stdlib/utils/inherit"),KU=require("@stdlib/utils/define-nonenumerable-property"),Li=require("@stdlib/utils/define-nonenumerable-read-only-property"),Lf=require("@stdlib/utils/define-read-only-accessor"),NMe=require("@stdlib/utils/define-read-write-accessor"),LMe=dn().factory,eC=require("@stdlib/buffer/from-string"),RMe=require("@stdlib/utils/next-tick"),PMe=require("@stdlib/string/format"),TMe=XU(),jMe=ZU(),os=$U();function MMe(){return this._prng.seed}function xMe(){return this._prng.seedLength}function AMe(){return this._prng.stateLength}function GMe(){return this._prng.byteLength}function VMe(){return this._prng.state}function FMe(r){this._prng.state=r}function WMe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return os("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),os("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=eC(e):e=eC(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function IMe(r){var e;if(this._destroyed)return os("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,RMe(t),this;function t(){r&&(os("Stream was destroyed due to an error. Error: %s.",OMe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),os("Closing the stream..."),e.emit("close")}}function ce(r,e){var t,i;if(!(this instanceof ce))return arguments.length>1?new ce(r,e):new ce(r);if(!SMe(r))throw new TypeError(PMe("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(t=EMe({},TMe),arguments.length>1&&(i=jMe(t,e),i))throw i;return os("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),rC.call(this,t),KU(this,"_destroyed",!1),Li(this,"_objectMode",t.objectMode),Li(this,"_sep",t.sep),Li(this,"_iter",t.iter),Li(this,"_siter",t.siter),KU(this,"_i",0),Li(this,"_prng",LMe(r,t)),Li(this,"PRNG",this._prng.PRNG),this}_Me(ce,rC);Lf(ce.prototype,"seed",MMe);Lf(ce.prototype,"seedLength",xMe);NMe(ce.prototype,"state",VMe,FMe);Lf(ce.prototype,"stateLength",AMe);Lf(ce.prototype,"byteLength",GMe);Li(ce.prototype,"_read",WMe);Li(ce.prototype,"destroy",IMe);tC.exports=ce});var nC=s(function(xrr,iC){"use strict";var kMe=require("@stdlib/assert/is-plain-object"),zMe=require("@stdlib/object/assign"),JMe=require("@stdlib/string/format"),UMe=Rf();function CMe(r,e){var t;if(arguments.length>1){if(t=e,!kMe(t))throw new TypeError(JMe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=zMe({},e)}else t={};return t.objectMode=!0,new UMe(r,t)}iC.exports=CMe});var gC=s(function(Arr,vC){"use strict";var BMe=require("@stdlib/assert/is-positive-number").isPrimitive,aC=require("@stdlib/assert/is-plain-object"),sC=require("@stdlib/object/assign"),uC=require("@stdlib/string/format"),oC=Rf();function DMe(r,e){var t,i,n;if(t=arguments.length,t>1){if(!aC(e))throw new TypeError(uC("invalid argument. Options argument must be an object. Value: `%s`.",e));n=u,i=sC({},e)}else if(t===1)if(BMe(r))n=u,i={};else{if(!aC(r))throw new TypeError(uC("invalid argument. Options argument must be an object. Value: `%s`.",r));i=sC({},r),n=a}else i={},n=a;return n;function a(o){return new oC(o,i)}function u(){return new oC(r,i)}}vC.exports=DMe});var lC=s(function(Grr,dC){"use strict";var fC=require("@stdlib/utils/define-nonenumerable-read-only-property"),Gm=Rf(),XMe=nC(),YMe=gC();fC(Gm,"objectMode",XMe);fC(Gm,"factory",YMe);dC.exports=Gm});var cC=s(function(Vrr,HMe){HMe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var pC=s(function(Frr,hC){"use strict";var ZMe=require("@stdlib/assert/is-plain-object"),or=require("@stdlib/assert/has-own-property"),QMe=require("@stdlib/assert/is-boolean").isPrimitive,$Me=require("@stdlib/assert/is-nonnegative-number").isPrimitive,mC=require("@stdlib/assert/is-string").isPrimitive,KMe=require("@stdlib/assert/is-positive-integer").isPrimitive,exe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,An=require("@stdlib/string/format");function rxe(r,e){return ZMe(e)?or(e,"sep")&&(r.sep=e.sep,!mC(r.sep))?new TypeError(An("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):or(e,"objectMode")&&(r.objectMode=e.objectMode,!QMe(r.objectMode))?new TypeError(An("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):or(e,"encoding")&&(r.encoding=e.encoding,!mC(r.encoding)&&r.encoding!==null)?new TypeError(An("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):or(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!$Me(r.highWaterMark))?new TypeError(An("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):or(e,"iter")&&(r.iter=e.iter,!exe(r.iter))?new TypeError(An("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):or(e,"siter")&&(r.siter=e.siter,!KMe(r.siter))?new TypeError(An("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(or(e,"prng")&&(r.prng=e.prng),or(e,"seed")&&(r.seed=e.seed),or(e,"state")&&(r.state=e.state),or(e,"copy")&&(r.copy=e.copy),null):new TypeError(An("invalid argument. Options argument must be an object. Value: `%s`.",e))}hC.exports=rxe});var qC=s(function(Wrr,yC){"use strict";var txe=require("debug"),ixe=txe("random:streams:f");yC.exports=ixe});var Tf=s(function(Irr,_C){"use strict";var EC=require("readable-stream").Readable,bC=require("@stdlib/assert/is-positive-number").isPrimitive,nxe=require("@stdlib/assert/is-error"),axe=require("@stdlib/object/assign"),sxe=require("@stdlib/utils/inherit"),wC=require("@stdlib/utils/define-nonenumerable-property"),Ri=require("@stdlib/utils/define-nonenumerable-read-only-property"),Pf=require("@stdlib/utils/define-read-only-accessor"),uxe=require("@stdlib/utils/define-read-write-accessor"),oxe=Oa().factory,SC=require("@stdlib/buffer/from-string"),vxe=require("@stdlib/utils/next-tick"),OC=require("@stdlib/string/format"),gxe=cC(),fxe=pC(),vs=qC();function dxe(){return this._prng.seed}function lxe(){return this._prng.seedLength}function cxe(){return this._prng.stateLength}function mxe(){return this._prng.byteLength}function hxe(){return this._prng.state}function pxe(r){this._prng.state=r}function yxe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return vs("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),vs("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=SC(e):e=SC(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function qxe(r){var e;if(this._destroyed)return vs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,vxe(t),this;function t(){r&&(vs("Stream was destroyed due to an error. Error: %s.",nxe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),vs("Closing the stream..."),e.emit("close")}}function me(r,e,t){var i,n;if(!(this instanceof me))return arguments.length>2?new me(r,e,t):new me(r,e);if(!bC(r))throw new TypeError(OC("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!bC(e))throw new TypeError(OC("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=axe({},gxe),arguments.length>2&&(n=fxe(i,t),n))throw n;return vs("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),EC.call(this,i),wC(this,"_destroyed",!1),Ri(this,"_objectMode",i.objectMode),Ri(this,"_sep",i.sep),Ri(this,"_iter",i.iter),Ri(this,"_siter",i.siter),wC(this,"_i",0),Ri(this,"_prng",oxe(r,e,i)),Ri(this,"PRNG",this._prng.PRNG),this}sxe(me,EC);Pf(me.prototype,"seed",dxe);Pf(me.prototype,"seedLength",lxe);uxe(me.prototype,"state",hxe,pxe);Pf(me.prototype,"stateLength",cxe);Pf(me.prototype,"byteLength",mxe);Ri(me.prototype,"_read",yxe);Ri(me.prototype,"destroy",qxe);_C.exports=me});var LC=s(function(krr,NC){"use strict";var bxe=require("@stdlib/assert/is-plain-object"),wxe=require("@stdlib/object/assign"),Sxe=require("@stdlib/string/format"),Oxe=Tf();function Exe(r,e,t){var i;if(arguments.length>2){if(i=t,!bxe(i))throw new TypeError(Sxe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=wxe({},t)}else i={};return i.objectMode=!0,new Oxe(r,e,i)}NC.exports=Exe});var xC=s(function(zrr,MC){"use strict";var RC=require("@stdlib/assert/is-plain-object"),PC=require("@stdlib/object/assign"),TC=require("@stdlib/string/format"),jC=Tf();function _xe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!RC(r))throw new TypeError(TC("invalid argument. Options argument must be an object. Value: `%s`.",r));n=PC({},r)}else if(i>2){if(!RC(t))throw new TypeError(TC("invalid argument. Options argument must be an object. Value: `%s`.",t));n=PC({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new jC(v,g,n)}function o(){return new jC(r,e,n)}}MC.exports=_xe});var VC=s(function(Jrr,GC){"use strict";var AC=require("@stdlib/utils/define-nonenumerable-read-only-property"),Vm=Tf(),Nxe=LC(),Lxe=xC();AC(Vm,"objectMode",Nxe);AC(Vm,"factory",Lxe);GC.exports=Vm});var FC=s(function(Urr,Rxe){Rxe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var kC=s(function(Crr,IC){"use strict";var Pxe=require("@stdlib/assert/is-plain-object"),vr=require("@stdlib/assert/has-own-property"),Txe=require("@stdlib/assert/is-boolean").isPrimitive,jxe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,WC=require("@stdlib/assert/is-string").isPrimitive,Mxe=require("@stdlib/assert/is-positive-integer").isPrimitive,xxe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Gn=require("@stdlib/string/format");function Axe(r,e){return Pxe(e)?vr(e,"sep")&&(r.sep=e.sep,!WC(r.sep))?new TypeError(Gn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):vr(e,"objectMode")&&(r.objectMode=e.objectMode,!Txe(r.objectMode))?new TypeError(Gn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):vr(e,"encoding")&&(r.encoding=e.encoding,!WC(r.encoding)&&r.encoding!==null)?new TypeError(Gn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):vr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!jxe(r.highWaterMark))?new TypeError(Gn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):vr(e,"iter")&&(r.iter=e.iter,!xxe(r.iter))?new TypeError(Gn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):vr(e,"siter")&&(r.siter=e.siter,!Mxe(r.siter))?new TypeError(Gn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(vr(e,"prng")&&(r.prng=e.prng),vr(e,"seed")&&(r.seed=e.seed),vr(e,"state")&&(r.state=e.state),vr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Gn("invalid argument. Options argument must be an object. Value: `%s`.",e))}IC.exports=Axe});var JC=s(function(Brr,zC){"use strict";var Gxe=require("debug"),Vxe=Gxe("random:streams:frechet");zC.exports=Vxe});var Mf=s(function(Drr,XC){"use strict";var DC=require("readable-stream").Readable,UC=require("@stdlib/assert/is-positive-number"),Fxe=require("@stdlib/assert/is-number").isPrimitive,Wxe=require("@stdlib/math/base/assert/is-nan"),Ixe=require("@stdlib/assert/is-error"),kxe=require("@stdlib/object/assign"),zxe=require("@stdlib/utils/inherit"),CC=require("@stdlib/utils/define-nonenumerable-property"),Pi=require("@stdlib/utils/define-nonenumerable-read-only-property"),jf=require("@stdlib/utils/define-read-only-accessor"),Jxe=require("@stdlib/utils/define-read-write-accessor"),Uxe=_a().factory,BC=require("@stdlib/buffer/from-string"),Cxe=require("@stdlib/utils/next-tick"),Fm=require("@stdlib/string/format"),Bxe=FC(),Dxe=kC(),gs=JC();function Xxe(){return this._prng.seed}function Yxe(){return this._prng.seedLength}function Hxe(){return this._prng.stateLength}function Zxe(){return this._prng.byteLength}function Qxe(){return this._prng.state}function $xe(r){this._prng.state=r}function Kxe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return gs("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),gs("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=BC(e):e=BC(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function e1e(r){var e;if(this._destroyed)return gs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,Cxe(t),this;function t(){r&&(gs("Stream was destroyed due to an error. Error: %s.",Ixe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),gs("Closing the stream..."),e.emit("close")}}function he(r,e,t,i){var n,a;if(!(this instanceof he))return arguments.length>3?new he(r,e,t,i):new he(r,e,t);if(!UC(r))throw new TypeError(Fm("invalid argument. First argument must be a positive number and not NaN. Value: `%s`.",r));if(!UC(e))throw new TypeError(Fm("invalid argument. Second argument must be a positive number and not NaN. Value: `%s`.",e));if(!Fxe(t)||Wxe(t))throw new TypeError(Fm("invalid argument. Third argument must be a number. Value: `%s`.",t));if(n=kxe({},Bxe),arguments.length>3&&(a=Dxe(n,i),a))throw a;return gs("Creating a readable stream configured with the following options: %s.",JSON.stringify(n)),DC.call(this,n),CC(this,"_destroyed",!1),Pi(this,"_objectMode",n.objectMode),Pi(this,"_sep",n.sep),Pi(this,"_iter",n.iter),Pi(this,"_siter",n.siter),CC(this,"_i",0),Pi(this,"_prng",Uxe(r,e,t,n)),Pi(this,"PRNG",this._prng.PRNG),this}zxe(he,DC);jf(he.prototype,"seed",Xxe);jf(he.prototype,"seedLength",Yxe);Jxe(he.prototype,"state",Qxe,$xe);jf(he.prototype,"stateLength",Hxe);jf(he.prototype,"byteLength",Zxe);Pi(he.prototype,"_read",Kxe);Pi(he.prototype,"destroy",e1e);XC.exports=he});var HC=s(function(Xrr,YC){"use strict";var r1e=require("@stdlib/assert/is-plain-object"),t1e=require("@stdlib/object/assign"),i1e=require("@stdlib/string/format"),n1e=Mf();function a1e(r,e,t,i){var n;if(arguments.length>3){if(n=i,!r1e(n))throw new TypeError(i1e("invalid argument. Options argument must be an object. Value: `%s`.",n));n=t1e({},i)}else n={};return n.objectMode=!0,new n1e(r,e,t,n)}YC.exports=a1e});var rB=s(function(Yrr,eB){"use strict";var ZC=require("@stdlib/assert/is-plain-object"),QC=require("@stdlib/object/assign"),$C=require("@stdlib/string/format"),KC=Mf();function s1e(r,e,t,i){var n,a,u;if(n=arguments.length,n===1){if(!ZC(r))throw new TypeError($C("invalid argument. Options argument must be an object. Value: `%s`.",r));a=QC({},r)}else if(n>3){if(!ZC(i))throw new TypeError($C("invalid argument. Options argument must be an object. Value: `%s`.",i));a=QC({},i)}else a={};return n<3?u=o:u=v,u;function o(g,c,l){return new KC(g,c,l,a)}function v(){return new KC(r,e,t,a)}}eB.exports=s1e});var nB=s(function(Hrr,iB){"use strict";var tB=require("@stdlib/utils/define-nonenumerable-read-only-property"),Wm=Mf(),u1e=HC(),o1e=rB();tB(Wm,"objectMode",u1e);tB(Wm,"factory",o1e);iB.exports=Wm});var aB=s(function(Zrr,v1e){v1e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var oB=s(function(Qrr,uB){"use strict";var g1e=require("@stdlib/assert/is-plain-object"),gr=require("@stdlib/assert/has-own-property"),f1e=require("@stdlib/assert/is-boolean").isPrimitive,d1e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,sB=require("@stdlib/assert/is-string").isPrimitive,l1e=require("@stdlib/assert/is-positive-integer").isPrimitive,c1e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Vn=require("@stdlib/string/format");function m1e(r,e){return g1e(e)?gr(e,"sep")&&(r.sep=e.sep,!sB(r.sep))?new TypeError(Vn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):gr(e,"objectMode")&&(r.objectMode=e.objectMode,!f1e(r.objectMode))?new TypeError(Vn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):gr(e,"encoding")&&(r.encoding=e.encoding,!sB(r.encoding)&&r.encoding!==null)?new TypeError(Vn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):gr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!d1e(r.highWaterMark))?new TypeError(Vn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):gr(e,"iter")&&(r.iter=e.iter,!c1e(r.iter))?new TypeError(Vn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):gr(e,"siter")&&(r.siter=e.siter,!l1e(r.siter))?new TypeError(Vn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(gr(e,"prng")&&(r.prng=e.prng),gr(e,"seed")&&(r.seed=e.seed),gr(e,"state")&&(r.state=e.state),gr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Vn("invalid argument. Options argument must be an object. Value: `%s`.",e))}uB.exports=m1e});var gB=s(function($rr,vB){"use strict";var h1e=require("debug"),p1e=h1e("random:streams:gamma");vB.exports=p1e});var Af=s(function(Krr,hB){"use strict";var mB=require("readable-stream").Readable,fB=require("@stdlib/assert/is-positive-number").isPrimitive,y1e=require("@stdlib/assert/is-error"),q1e=require("@stdlib/object/assign"),b1e=require("@stdlib/utils/inherit"),dB=require("@stdlib/utils/define-nonenumerable-property"),Ti=require("@stdlib/utils/define-nonenumerable-read-only-property"),xf=require("@stdlib/utils/define-read-only-accessor"),w1e=require("@stdlib/utils/define-read-write-accessor"),S1e=Ce().factory,lB=require("@stdlib/buffer/from-string"),O1e=require("@stdlib/utils/next-tick"),cB=require("@stdlib/string/format"),E1e=aB(),_1e=oB(),fs=gB();function N1e(){return this._prng.seed}function L1e(){return this._prng.seedLength}function R1e(){return this._prng.stateLength}function P1e(){return this._prng.byteLength}function T1e(){return this._prng.state}function j1e(r){this._prng.state=r}function M1e(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return fs("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),fs("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=lB(e):e=lB(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function x1e(r){var e;if(this._destroyed)return fs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,O1e(t),this;function t(){r&&(fs("Stream was destroyed due to an error. Error: %s.",y1e(r)?r.message:JSON.stringify(r)),e.emit("error",r)),fs("Closing the stream..."),e.emit("close")}}function pe(r,e,t){var i,n;if(!(this instanceof pe))return arguments.length>2?new pe(r,e,t):new pe(r,e);if(!fB(r))throw new TypeError(cB("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!fB(e))throw new TypeError(cB("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=q1e({},E1e),arguments.length>2&&(n=_1e(i,t),n))throw n;return fs("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),mB.call(this,i),dB(this,"_destroyed",!1),Ti(this,"_objectMode",i.objectMode),Ti(this,"_sep",i.sep),Ti(this,"_iter",i.iter),Ti(this,"_siter",i.siter),dB(this,"_i",0),Ti(this,"_prng",S1e(r,e,i)),Ti(this,"PRNG",this._prng.PRNG),this}b1e(pe,mB);xf(pe.prototype,"seed",N1e);xf(pe.prototype,"seedLength",L1e);w1e(pe.prototype,"state",T1e,j1e);xf(pe.prototype,"stateLength",R1e);xf(pe.prototype,"byteLength",P1e);Ti(pe.prototype,"_read",M1e);Ti(pe.prototype,"destroy",x1e);hB.exports=pe});var yB=s(function(etr,pB){"use strict";var A1e=require("@stdlib/assert/is-plain-object"),G1e=require("@stdlib/object/assign"),V1e=require("@stdlib/string/format"),F1e=Af();function W1e(r,e,t){var i;if(arguments.length>2){if(i=t,!A1e(i))throw new TypeError(V1e("invalid argument. Options argument must be an object. Value: `%s`.",i));i=G1e({},t)}else i={};return i.objectMode=!0,new F1e(r,e,i)}pB.exports=W1e});var EB=s(function(rtr,OB){"use strict";var qB=require("@stdlib/assert/is-plain-object"),bB=require("@stdlib/object/assign"),wB=require("@stdlib/string/format"),SB=Af();function I1e(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!qB(r))throw new TypeError(wB("invalid argument. Options argument must be an object. Value: `%s`.",r));n=bB({},r)}else if(i>2){if(!qB(t))throw new TypeError(wB("invalid argument. Options argument must be an object. Value: `%s`.",t));n=bB({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new SB(v,g,n)}function o(){return new SB(r,e,n)}}OB.exports=I1e});var LB=s(function(ttr,NB){"use strict";var _B=require("@stdlib/utils/define-nonenumerable-read-only-property"),Im=Af(),k1e=yB(),z1e=EB();_B(Im,"objectMode",k1e);_B(Im,"factory",z1e);NB.exports=Im});var RB=s(function(itr,J1e){J1e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var jB=s(function(ntr,TB){"use strict";var U1e=require("@stdlib/assert/is-plain-object"),fr=require("@stdlib/assert/has-own-property"),C1e=require("@stdlib/assert/is-boolean").isPrimitive,B1e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,PB=require("@stdlib/assert/is-string").isPrimitive,D1e=require("@stdlib/assert/is-positive-integer").isPrimitive,X1e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Fn=require("@stdlib/string/format");function Y1e(r,e){return U1e(e)?fr(e,"sep")&&(r.sep=e.sep,!PB(r.sep))?new TypeError(Fn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):fr(e,"objectMode")&&(r.objectMode=e.objectMode,!C1e(r.objectMode))?new TypeError(Fn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):fr(e,"encoding")&&(r.encoding=e.encoding,!PB(r.encoding)&&r.encoding!==null)?new TypeError(Fn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):fr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!B1e(r.highWaterMark))?new TypeError(Fn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):fr(e,"iter")&&(r.iter=e.iter,!X1e(r.iter))?new TypeError(Fn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):fr(e,"siter")&&(r.siter=e.siter,!D1e(r.siter))?new TypeError(Fn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(fr(e,"prng")&&(r.prng=e.prng),fr(e,"seed")&&(r.seed=e.seed),fr(e,"state")&&(r.state=e.state),fr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Fn("invalid argument. Options argument must be an object. Value: `%s`.",e))}TB.exports=Y1e});var xB=s(function(atr,MB){"use strict";var H1e=require("debug"),Z1e=H1e("random:streams:geometric");MB.exports=Z1e});var Vf=s(function(str,FB){"use strict";var VB=require("readable-stream").Readable,Q1e=require("@stdlib/assert/is-probability").isPrimitive,$1e=require("@stdlib/assert/is-error"),K1e=require("@stdlib/object/assign"),eAe=require("@stdlib/utils/inherit"),AB=require("@stdlib/utils/define-nonenumerable-property"),ji=require("@stdlib/utils/define-nonenumerable-read-only-property"),Gf=require("@stdlib/utils/define-read-only-accessor"),rAe=require("@stdlib/utils/define-read-write-accessor"),tAe=ln().factory,GB=require("@stdlib/buffer/from-string"),iAe=require("@stdlib/utils/next-tick"),nAe=require("@stdlib/string/format"),aAe=RB(),sAe=jB(),ds=xB();function uAe(){return this._prng.seed}function oAe(){return this._prng.seedLength}function vAe(){return this._prng.stateLength}function gAe(){return this._prng.byteLength}function fAe(){return this._prng.state}function dAe(r){this._prng.state=r}function lAe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return ds("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),ds("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=GB(e):e=GB(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function cAe(r){var e;if(this._destroyed)return ds("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,iAe(t),this;function t(){r&&(ds("Stream was destroyed due to an error. Error: %s.",$1e(r)?r.message:JSON.stringify(r)),e.emit("error",r)),ds("Closing the stream..."),e.emit("close")}}function ye(r,e){var t,i;if(!(this instanceof ye))return arguments.length>1?new ye(r,e):new ye(r);if(!Q1e(r))throw new TypeError(nAe("invalid argument. First argument must be a probability. Value: `%s`.",r));if(t=K1e({},aAe),arguments.length>1&&(i=sAe(t,e),i))throw i;return ds("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),VB.call(this,t),AB(this,"_destroyed",!1),ji(this,"_objectMode",t.objectMode),ji(this,"_sep",t.sep),ji(this,"_iter",t.iter),ji(this,"_siter",t.siter),AB(this,"_i",0),ji(this,"_prng",tAe(r,t)),ji(this,"PRNG",this._prng.PRNG),this}eAe(ye,VB);Gf(ye.prototype,"seed",uAe);Gf(ye.prototype,"seedLength",oAe);rAe(ye.prototype,"state",fAe,dAe);Gf(ye.prototype,"stateLength",vAe);Gf(ye.prototype,"byteLength",gAe);ji(ye.prototype,"_read",lAe);ji(ye.prototype,"destroy",cAe);FB.exports=ye});var IB=s(function(utr,WB){"use strict";var mAe=require("@stdlib/assert/is-plain-object"),hAe=require("@stdlib/object/assign"),pAe=require("@stdlib/string/format"),yAe=Vf();function qAe(r,e){var t;if(arguments.length>1){if(t=e,!mAe(t))throw new TypeError(pAe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=hAe({},e)}else t={};return t.objectMode=!0,new yAe(r,t)}WB.exports=qAe});var BB=s(function(otr,CB){"use strict";var bAe=require("@stdlib/assert/is-probability").isPrimitive,kB=require("@stdlib/assert/is-plain-object"),zB=require("@stdlib/object/assign"),JB=require("@stdlib/string/format"),UB=Vf();function wAe(r,e){var t,i,n;if(t=arguments.length,t>1){if(!kB(e))throw new TypeError(JB("invalid argument. Options argument must be an object. Value: `%s`.",e));n=u,i=zB({},e)}else if(t===1)if(bAe(r))n=u,i={};else{if(!kB(r))throw new TypeError(JB("invalid argument. Options argument must be an object. Value: `%s`.",r));i=zB({},r),n=a}else i={},n=a;return n;function a(o){return new UB(o,i)}function u(){return new UB(r,i)}}CB.exports=wAe});var YB=s(function(vtr,XB){"use strict";var DB=require("@stdlib/utils/define-nonenumerable-read-only-property"),km=Vf(),SAe=IB(),OAe=BB();DB(km,"objectMode",SAe);DB(km,"factory",OAe);XB.exports=km});var HB=s(function(gtr,EAe){EAe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var $B=s(function(ftr,QB){"use strict";var _Ae=require("@stdlib/assert/is-plain-object"),dr=require("@stdlib/assert/has-own-property"),NAe=require("@stdlib/assert/is-boolean").isPrimitive,LAe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,ZB=require("@stdlib/assert/is-string").isPrimitive,RAe=require("@stdlib/assert/is-positive-integer").isPrimitive,PAe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Wn=require("@stdlib/string/format");function TAe(r,e){return _Ae(e)?dr(e,"sep")&&(r.sep=e.sep,!ZB(r.sep))?new TypeError(Wn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):dr(e,"objectMode")&&(r.objectMode=e.objectMode,!NAe(r.objectMode))?new TypeError(Wn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):dr(e,"encoding")&&(r.encoding=e.encoding,!ZB(r.encoding)&&r.encoding!==null)?new TypeError(Wn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):dr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!LAe(r.highWaterMark))?new TypeError(Wn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):dr(e,"iter")&&(r.iter=e.iter,!PAe(r.iter))?new TypeError(Wn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):dr(e,"siter")&&(r.siter=e.siter,!RAe(r.siter))?new TypeError(Wn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(dr(e,"prng")&&(r.prng=e.prng),dr(e,"seed")&&(r.seed=e.seed),dr(e,"state")&&(r.state=e.state),dr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Wn("invalid argument. Options argument must be an object. Value: `%s`.",e))}QB.exports=TAe});var e9=s(function(dtr,KB){"use strict";var jAe=require("debug"),MAe=jAe("random:streams:gumbel");KB.exports=MAe});var Wf=s(function(ltr,a9){"use strict";var n9=require("readable-stream").Readable,xAe=require("@stdlib/assert/is-positive-number").isPrimitive,AAe=require("@stdlib/assert/is-number").isPrimitive,GAe=require("@stdlib/math/base/assert/is-nan"),VAe=require("@stdlib/assert/is-error"),FAe=require("@stdlib/object/assign"),WAe=require("@stdlib/utils/inherit"),r9=require("@stdlib/utils/define-nonenumerable-property"),Mi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ff=require("@stdlib/utils/define-read-only-accessor"),IAe=require("@stdlib/utils/define-read-write-accessor"),kAe=Na().factory,t9=require("@stdlib/buffer/from-string"),zAe=require("@stdlib/utils/next-tick"),i9=require("@stdlib/string/format"),JAe=HB(),UAe=$B(),ls=e9();function CAe(){return this._prng.seed}function BAe(){return this._prng.seedLength}function DAe(){return this._prng.stateLength}function XAe(){return this._prng.byteLength}function YAe(){return this._prng.state}function HAe(r){this._prng.state=r}function ZAe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return ls("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),ls("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=t9(e):e=t9(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function QAe(r){var e;if(this._destroyed)return ls("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,zAe(t),this;function t(){r&&(ls("Stream was destroyed due to an error. Error: %s.",VAe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),ls("Closing the stream..."),e.emit("close")}}function qe(r,e,t){var i,n;if(!(this instanceof qe))return arguments.length>2?new qe(r,e,t):new qe(r,e);if(!AAe(r)||GAe(r))throw new TypeError(i9("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!xAe(e))throw new TypeError(i9("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=FAe({},JAe),arguments.length>2&&(n=UAe(i,t),n))throw n;return ls("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),n9.call(this,i),r9(this,"_destroyed",!1),Mi(this,"_objectMode",i.objectMode),Mi(this,"_sep",i.sep),Mi(this,"_iter",i.iter),Mi(this,"_siter",i.siter),r9(this,"_i",0),Mi(this,"_prng",kAe(r,e,i)),Mi(this,"PRNG",this._prng.PRNG),this}WAe(qe,n9);Ff(qe.prototype,"seed",CAe);Ff(qe.prototype,"seedLength",BAe);IAe(qe.prototype,"state",YAe,HAe);Ff(qe.prototype,"stateLength",DAe);Ff(qe.prototype,"byteLength",XAe);Mi(qe.prototype,"_read",ZAe);Mi(qe.prototype,"destroy",QAe);a9.exports=qe});var u9=s(function(ctr,s9){"use strict";var $Ae=require("@stdlib/assert/is-plain-object"),KAe=require("@stdlib/object/assign"),eGe=require("@stdlib/string/format"),rGe=Wf();function tGe(r,e,t){var i;if(arguments.length>2){if(i=t,!$Ae(i))throw new TypeError(eGe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=KAe({},t)}else i={};return i.objectMode=!0,new rGe(r,e,i)}s9.exports=tGe});var l9=s(function(mtr,d9){"use strict";var o9=require("@stdlib/assert/is-plain-object"),v9=require("@stdlib/object/assign"),g9=require("@stdlib/string/format"),f9=Wf();function iGe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!o9(r))throw new TypeError(g9("invalid argument. Options argument must be an object. Value: `%s`.",r));n=v9({},r)}else if(i>2){if(!o9(t))throw new TypeError(g9("invalid argument. Options argument must be an object. Value: `%s`.",t));n=v9({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new f9(v,g,n)}function o(){return new f9(r,e,n)}}d9.exports=iGe});var h9=s(function(htr,m9){"use strict";var c9=require("@stdlib/utils/define-nonenumerable-read-only-property"),zm=Wf(),nGe=u9(),aGe=l9();c9(zm,"objectMode",nGe);c9(zm,"factory",aGe);m9.exports=zm});var p9=s(function(ptr,sGe){sGe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var b9=s(function(ytr,q9){"use strict";var uGe=require("@stdlib/assert/is-plain-object"),lr=require("@stdlib/assert/has-own-property"),oGe=require("@stdlib/assert/is-boolean").isPrimitive,vGe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,y9=require("@stdlib/assert/is-string").isPrimitive,gGe=require("@stdlib/assert/is-positive-integer").isPrimitive,fGe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,In=require("@stdlib/string/format");function dGe(r,e){return uGe(e)?lr(e,"sep")&&(r.sep=e.sep,!y9(r.sep))?new TypeError(In("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):lr(e,"objectMode")&&(r.objectMode=e.objectMode,!oGe(r.objectMode))?new TypeError(In("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):lr(e,"encoding")&&(r.encoding=e.encoding,!y9(r.encoding)&&r.encoding!==null)?new TypeError(In("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):lr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!vGe(r.highWaterMark))?new TypeError(In("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):lr(e,"iter")&&(r.iter=e.iter,!fGe(r.iter))?new TypeError(In("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):lr(e,"siter")&&(r.siter=e.siter,!gGe(r.siter))?new TypeError(In("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(lr(e,"prng")&&(r.prng=e.prng),lr(e,"seed")&&(r.seed=e.seed),lr(e,"state")&&(r.state=e.state),lr(e,"copy")&&(r.copy=e.copy),null):new TypeError(In("invalid argument. Options argument must be an object. Value: `%s`.",e))}q9.exports=dGe});var S9=s(function(qtr,w9){"use strict";var lGe=require("debug"),cGe=lGe("random:streams:hypergeometric");w9.exports=cGe});var kf=s(function(btr,N9){"use strict";var _9=require("readable-stream").Readable,Jm=require("@stdlib/assert/is-nonnegative-integer"),mGe=require("@stdlib/assert/is-error"),hGe=require("@stdlib/object/assign"),pGe=require("@stdlib/utils/inherit"),O9=require("@stdlib/utils/define-nonenumerable-property"),xi=require("@stdlib/utils/define-nonenumerable-read-only-property"),If=require("@stdlib/utils/define-read-only-accessor"),yGe=require("@stdlib/utils/define-read-write-accessor"),qGe=La().factory,E9=require("@stdlib/buffer/from-string"),bGe=require("@stdlib/utils/next-tick"),Um=require("@stdlib/string/format"),wGe=p9(),SGe=b9(),cs=S9();function OGe(){return this._prng.seed}function EGe(){return this._prng.seedLength}function _Ge(){return this._prng.stateLength}function NGe(){return this._prng.byteLength}function LGe(){return this._prng.state}function RGe(r){this._prng.state=r}function PGe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return cs("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),cs("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=E9(e):e=E9(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function TGe(r){var e;if(this._destroyed)return cs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,bGe(t),this;function t(){r&&(cs("Stream was destroyed due to an error. Error: %s.",mGe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),cs("Closing the stream..."),e.emit("close")}}function be(r,e,t,i){var n,a;if(!(this instanceof be))return arguments.length>3?new be(r,e,t,i):new be(r,e,t);if(!Jm(r))throw new TypeError(Um("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",r));if(!Jm(e))throw new TypeError(Um("invalid argument. Second argument must be a nonnegative integer. Value: `%s`.",e));if(!Jm(t))throw new TypeError(Um("invalid argument. Third argument must be a nonnegative integer. Value: `%s`.",t));if(t>r)throw new RangeError("invalid argument. Third argument must be less than or equal to the first argument.");if(e>r)throw new RangeError("invalid argument. Second argument must be less than or equal to the first argument.");if(n=hGe({},wGe),arguments.length>3&&(a=SGe(n,i),a))throw a;return cs("Creating a readable stream configured with the following options: %s.",JSON.stringify(n)),_9.call(this,n),O9(this,"_destroyed",!1),xi(this,"_objectMode",n.objectMode),xi(this,"_sep",n.sep),xi(this,"_iter",n.iter),xi(this,"_siter",n.siter),O9(this,"_i",0),xi(this,"_prng",qGe(r,e,t,n)),xi(this,"PRNG",this._prng.PRNG),this}pGe(be,_9);If(be.prototype,"seed",OGe);If(be.prototype,"seedLength",EGe);yGe(be.prototype,"state",LGe,RGe);If(be.prototype,"stateLength",_Ge);If(be.prototype,"byteLength",NGe);xi(be.prototype,"_read",PGe);xi(be.prototype,"destroy",TGe);N9.exports=be});var R9=s(function(wtr,L9){"use strict";var jGe=require("@stdlib/assert/is-plain-object"),MGe=require("@stdlib/object/assign"),xGe=require("@stdlib/string/format"),AGe=kf();function GGe(r,e,t,i){var n;if(arguments.length>3){if(n=i,!jGe(n))throw new TypeError(xGe("invalid argument. Options argument must be an object. Value: `%s`.",n));n=MGe({},i)}else n={};return n.objectMode=!0,new AGe(r,e,t,n)}L9.exports=GGe});var A9=s(function(Str,x9){"use strict";var P9=require("@stdlib/assert/is-plain-object"),T9=require("@stdlib/object/assign"),j9=require("@stdlib/string/format"),M9=kf();function VGe(r,e,t,i){var n,a,u;if(n=arguments.length,n===1){if(!P9(r))throw new TypeError(j9("invalid argument. Options argument must be an object. Value: `%s`.",r));a=T9({},r)}else if(n>3){if(!P9(i))throw new TypeError(j9("invalid argument. Options argument must be an object. Value: `%s`.",i));a=T9({},i)}else a={};return n<3?u=o:u=v,u;function o(g,c,l){return new M9(g,c,l,a)}function v(){return new M9(r,e,t,a)}}x9.exports=VGe});var F9=s(function(Otr,V9){"use strict";var G9=require("@stdlib/utils/define-nonenumerable-read-only-property"),Cm=kf(),FGe=R9(),WGe=A9();G9(Cm,"objectMode",FGe);G9(Cm,"factory",WGe);V9.exports=Cm});var W9=s(function(Etr,IGe){IGe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var z9=s(function(_tr,k9){"use strict";var kGe=require("@stdlib/assert/is-plain-object"),cr=require("@stdlib/assert/has-own-property"),zGe=require("@stdlib/assert/is-boolean").isPrimitive,JGe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,I9=require("@stdlib/assert/is-string").isPrimitive,UGe=require("@stdlib/assert/is-positive-integer").isPrimitive,CGe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,kn=require("@stdlib/string/format");function BGe(r,e){return kGe(e)?cr(e,"sep")&&(r.sep=e.sep,!I9(r.sep))?new TypeError(kn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):cr(e,"objectMode")&&(r.objectMode=e.objectMode,!zGe(r.objectMode))?new TypeError(kn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):cr(e,"encoding")&&(r.encoding=e.encoding,!I9(r.encoding)&&r.encoding!==null)?new TypeError(kn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):cr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!JGe(r.highWaterMark))?new TypeError(kn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):cr(e,"iter")&&(r.iter=e.iter,!CGe(r.iter))?new TypeError(kn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):cr(e,"siter")&&(r.siter=e.siter,!UGe(r.siter))?new TypeError(kn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(cr(e,"prng")&&(r.prng=e.prng),cr(e,"seed")&&(r.seed=e.seed),cr(e,"state")&&(r.state=e.state),cr(e,"copy")&&(r.copy=e.copy),null):new TypeError(kn("invalid argument. Options argument must be an object. Value: `%s`.",e))}k9.exports=BGe});var U9=s(function(Ntr,J9){"use strict";var DGe=require("debug"),XGe=DGe("random:streams:improved-ziggurat");J9.exports=XGe});var Jf=s(function(Ltr,X9){"use strict";var D9=require("readable-stream").Readable,YGe=require("@stdlib/assert/is-error"),HGe=require("@stdlib/object/assign"),ZGe=require("@stdlib/utils/inherit"),C9=require("@stdlib/utils/define-nonenumerable-property"),Ai=require("@stdlib/utils/define-nonenumerable-read-only-property"),zf=require("@stdlib/utils/define-read-only-accessor"),QGe=require("@stdlib/utils/define-read-write-accessor"),$Ge=Q().factory,B9=require("@stdlib/buffer/from-string"),KGe=require("@stdlib/utils/next-tick"),eVe=W9(),rVe=z9(),ms=U9();function tVe(){return this._prng.seed}function iVe(){return this._prng.seedLength}function nVe(){return this._prng.stateLength}function aVe(){return this._prng.byteLength}function sVe(){return this._prng.state}function uVe(r){this._prng.state=r}function oVe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return ms("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),ms("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=B9(e):e=B9(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function vVe(r){var e;if(this._destroyed)return ms("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,KGe(t),this;function t(){r&&(ms("Stream was destroyed due to an error. Error: %s.",YGe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),ms("Closing the stream..."),e.emit("close")}}function we(r){var e,t;if(!(this instanceof we))return arguments.length>0?new we(r):new we;if(e=HGe({},eVe),arguments.length>0&&(t=rVe(e,r),t))throw t;return ms("Creating a readable stream configured with the following options: %s.",JSON.stringify(e)),D9.call(this,e),C9(this,"_destroyed",!1),Ai(this,"_objectMode",e.objectMode),Ai(this,"_sep",e.sep),Ai(this,"_iter",e.iter),Ai(this,"_siter",e.siter),C9(this,"_i",0),Ai(this,"_prng",$Ge(e)),Ai(this,"PRNG",this._prng.PRNG),this}ZGe(we,D9);zf(we.prototype,"seed",tVe);zf(we.prototype,"seedLength",iVe);QGe(we.prototype,"state",sVe,uVe);zf(we.prototype,"stateLength",nVe);zf(we.prototype,"byteLength",aVe);Ai(we.prototype,"_read",oVe);Ai(we.prototype,"destroy",vVe);X9.exports=we});var H9=s(function(Rtr,Y9){"use strict";var gVe=require("@stdlib/assert/is-plain-object"),fVe=require("@stdlib/object/assign"),dVe=require("@stdlib/string/format"),lVe=Jf();function cVe(r){var e;if(arguments.length>0){if(e=r,!gVe(e))throw new TypeError(dVe("invalid argument. Options argument must be an object. Value: `%s`.",e));e=fVe({},r)}else e={};return e.objectMode=!0,new lVe(e)}Y9.exports=cVe});var Q9=s(function(Ptr,Z9){"use strict";var mVe=require("@stdlib/assert/is-plain-object"),hVe=require("@stdlib/object/assign"),pVe=require("@stdlib/string/format"),yVe=Jf();function qVe(r){var e;if(arguments.length>0){if(!mVe(r))throw new TypeError(pVe("invalid argument. Options argument must be an object. Value: `%s`.",r));e=hVe({},r)}else e={};return t;function t(){return new yVe(e)}}Z9.exports=qVe});var eD=s(function(Ttr,K9){"use strict";var $9=require("@stdlib/utils/define-nonenumerable-read-only-property"),Bm=Jf(),bVe=H9(),wVe=Q9();$9(Bm,"objectMode",bVe);$9(Bm,"factory",wVe);K9.exports=Bm});var rD=s(function(jtr,SVe){SVe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var nD=s(function(Mtr,iD){"use strict";var OVe=require("@stdlib/assert/is-plain-object"),mr=require("@stdlib/assert/has-own-property"),EVe=require("@stdlib/assert/is-boolean").isPrimitive,_Ve=require("@stdlib/assert/is-nonnegative-number").isPrimitive,tD=require("@stdlib/assert/is-string").isPrimitive,NVe=require("@stdlib/assert/is-positive-integer").isPrimitive,LVe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,zn=require("@stdlib/string/format");function RVe(r,e){return OVe(e)?mr(e,"sep")&&(r.sep=e.sep,!tD(r.sep))?new TypeError(zn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):mr(e,"objectMode")&&(r.objectMode=e.objectMode,!EVe(r.objectMode))?new TypeError(zn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):mr(e,"encoding")&&(r.encoding=e.encoding,!tD(r.encoding)&&r.encoding!==null)?new TypeError(zn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):mr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!_Ve(r.highWaterMark))?new TypeError(zn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):mr(e,"iter")&&(r.iter=e.iter,!LVe(r.iter))?new TypeError(zn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):mr(e,"siter")&&(r.siter=e.siter,!NVe(r.siter))?new TypeError(zn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(mr(e,"prng")&&(r.prng=e.prng),mr(e,"seed")&&(r.seed=e.seed),mr(e,"state")&&(r.state=e.state),mr(e,"copy")&&(r.copy=e.copy),null):new TypeError(zn("invalid argument. Options argument must be an object. Value: `%s`.",e))}iD.exports=RVe});var sD=s(function(xtr,aD){"use strict";var PVe=require("debug"),TVe=PVe("random:streams:invgamma");aD.exports=TVe});var Cf=s(function(Atr,dD){"use strict";var fD=require("readable-stream").Readable,uD=require("@stdlib/assert/is-positive-number").isPrimitive,jVe=require("@stdlib/assert/is-error"),MVe=require("@stdlib/object/assign"),xVe=require("@stdlib/utils/inherit"),oD=require("@stdlib/utils/define-nonenumerable-property"),Gi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Uf=require("@stdlib/utils/define-read-only-accessor"),AVe=require("@stdlib/utils/define-read-write-accessor"),GVe=cn().factory,vD=require("@stdlib/buffer/from-string"),VVe=require("@stdlib/utils/next-tick"),gD=require("@stdlib/string/format"),FVe=rD(),WVe=nD(),hs=sD();function IVe(){return this._prng.seed}function kVe(){return this._prng.seedLength}function zVe(){return this._prng.stateLength}function JVe(){return this._prng.byteLength}function UVe(){return this._prng.state}function CVe(r){this._prng.state=r}function BVe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return hs("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),hs("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=vD(e):e=vD(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function DVe(r){var e;if(this._destroyed)return hs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,VVe(t),this;function t(){r&&(hs("Stream was destroyed due to an error. Error: %s.",jVe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),hs("Closing the stream..."),e.emit("close")}}function Se(r,e,t){var i,n;if(!(this instanceof Se))return arguments.length>2?new Se(r,e,t):new Se(r,e);if(!uD(r))throw new TypeError(gD("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!uD(e))throw new TypeError(gD("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=MVe({},FVe),arguments.length>2&&(n=WVe(i,t),n))throw n;return hs("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),fD.call(this,i),oD(this,"_destroyed",!1),Gi(this,"_objectMode",i.objectMode),Gi(this,"_sep",i.sep),Gi(this,"_iter",i.iter),Gi(this,"_siter",i.siter),oD(this,"_i",0),Gi(this,"_prng",GVe(r,e,i)),Gi(this,"PRNG",this._prng.PRNG),this}xVe(Se,fD);Uf(Se.prototype,"seed",IVe);Uf(Se.prototype,"seedLength",kVe);AVe(Se.prototype,"state",UVe,CVe);Uf(Se.prototype,"stateLength",zVe);Uf(Se.prototype,"byteLength",JVe);Gi(Se.prototype,"_read",BVe);Gi(Se.prototype,"destroy",DVe);dD.exports=Se});var cD=s(function(Gtr,lD){"use strict";var XVe=require("@stdlib/assert/is-plain-object"),YVe=require("@stdlib/object/assign"),HVe=require("@stdlib/string/format"),ZVe=Cf();function QVe(r,e,t){var i;if(arguments.length>2){if(i=t,!XVe(i))throw new TypeError(HVe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=YVe({},t)}else i={};return i.objectMode=!0,new ZVe(r,e,i)}lD.exports=QVe});var bD=s(function(Vtr,qD){"use strict";var mD=require("@stdlib/assert/is-plain-object"),hD=require("@stdlib/object/assign"),pD=require("@stdlib/string/format"),yD=Cf();function $Ve(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!mD(r))throw new TypeError(pD("invalid argument. Options argument must be an object. Value: `%s`.",r));n=hD({},r)}else if(i>2){if(!mD(t))throw new TypeError(pD("invalid argument. Options argument must be an object. Value: `%s`.",t));n=hD({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new yD(v,g,n)}function o(){return new yD(r,e,n)}}qD.exports=$Ve});var OD=s(function(Ftr,SD){"use strict";var wD=require("@stdlib/utils/define-nonenumerable-read-only-property"),Dm=Cf(),KVe=cD(),e2e=bD();wD(Dm,"objectMode",KVe);wD(Dm,"factory",e2e);SD.exports=Dm});var ED=s(function(Wtr,r2e){r2e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var LD=s(function(Itr,ND){"use strict";var t2e=require("@stdlib/assert/is-plain-object"),hr=require("@stdlib/assert/has-own-property"),i2e=require("@stdlib/assert/is-boolean").isPrimitive,n2e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,_D=require("@stdlib/assert/is-string").isPrimitive,a2e=require("@stdlib/assert/is-positive-integer").isPrimitive,s2e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Jn=require("@stdlib/string/format");function u2e(r,e){return t2e(e)?hr(e,"sep")&&(r.sep=e.sep,!_D(r.sep))?new TypeError(Jn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):hr(e,"objectMode")&&(r.objectMode=e.objectMode,!i2e(r.objectMode))?new TypeError(Jn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):hr(e,"encoding")&&(r.encoding=e.encoding,!_D(r.encoding)&&r.encoding!==null)?new TypeError(Jn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):hr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!n2e(r.highWaterMark))?new TypeError(Jn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):hr(e,"iter")&&(r.iter=e.iter,!s2e(r.iter))?new TypeError(Jn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):hr(e,"siter")&&(r.siter=e.siter,!a2e(r.siter))?new TypeError(Jn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(hr(e,"prng")&&(r.prng=e.prng),hr(e,"seed")&&(r.seed=e.seed),hr(e,"state")&&(r.state=e.state),hr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Jn("invalid argument. Options argument must be an object. Value: `%s`.",e))}ND.exports=u2e});var PD=s(function(ktr,RD){"use strict";var o2e=require("debug"),v2e=o2e("random:streams:kumaraswamy");RD.exports=v2e});var Df=s(function(ztr,GD){"use strict";var AD=require("readable-stream").Readable,TD=require("@stdlib/assert/is-positive-number").isPrimitive,g2e=require("@stdlib/assert/is-error"),f2e=require("@stdlib/object/assign"),d2e=require("@stdlib/utils/inherit"),jD=require("@stdlib/utils/define-nonenumerable-property"),Vi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Bf=require("@stdlib/utils/define-read-only-accessor"),l2e=require("@stdlib/utils/define-read-write-accessor"),c2e=Pa().factory,MD=require("@stdlib/buffer/from-string"),m2e=require("@stdlib/utils/next-tick"),xD=require("@stdlib/string/format"),h2e=ED(),p2e=LD(),ps=PD();function y2e(){return this._prng.seed}function q2e(){return this._prng.seedLength}function b2e(){return this._prng.stateLength}function w2e(){return this._prng.byteLength}function S2e(){return this._prng.state}function O2e(r){this._prng.state=r}function E2e(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return ps("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),ps("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=MD(e):e=MD(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function _2e(r){var e;if(this._destroyed)return ps("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,m2e(t),this;function t(){r&&(ps("Stream was destroyed due to an error. Error: %s.",g2e(r)?r.message:JSON.stringify(r)),e.emit("error",r)),ps("Closing the stream..."),e.emit("close")}}function Oe(r,e,t){var i,n;if(!(this instanceof Oe))return arguments.length>2?new Oe(r,e,t):new Oe(r,e);if(!TD(r))throw new TypeError(xD("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!TD(e))throw new TypeError(xD("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=f2e({},h2e),arguments.length>2&&(n=p2e(i,t),n))throw n;return ps("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),AD.call(this,i),jD(this,"_destroyed",!1),Vi(this,"_objectMode",i.objectMode),Vi(this,"_sep",i.sep),Vi(this,"_iter",i.iter),Vi(this,"_siter",i.siter),jD(this,"_i",0),Vi(this,"_prng",c2e(r,e,i)),Vi(this,"PRNG",this._prng.PRNG),this}d2e(Oe,AD);Bf(Oe.prototype,"seed",y2e);Bf(Oe.prototype,"seedLength",q2e);l2e(Oe.prototype,"state",S2e,O2e);Bf(Oe.prototype,"stateLength",b2e);Bf(Oe.prototype,"byteLength",w2e);Vi(Oe.prototype,"_read",E2e);Vi(Oe.prototype,"destroy",_2e);GD.exports=Oe});var FD=s(function(Jtr,VD){"use strict";var N2e=require("@stdlib/assert/is-plain-object"),L2e=require("@stdlib/object/assign"),R2e=require("@stdlib/string/format"),P2e=Df();function T2e(r,e,t){var i;if(arguments.length>2){if(i=t,!N2e(i))throw new TypeError(R2e("invalid argument. Options argument must be an object. Value: `%s`.",i));i=L2e({},t)}else i={};return i.objectMode=!0,new P2e(r,e,i)}VD.exports=T2e});var UD=s(function(Utr,JD){"use strict";var WD=require("@stdlib/assert/is-plain-object"),ID=require("@stdlib/object/assign"),kD=require("@stdlib/string/format"),zD=Df();function j2e(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!WD(r))throw new TypeError(kD("invalid argument. Options argument must be an object. Value: `%s`.",r));n=ID({},r)}else if(i>2){if(!WD(t))throw new TypeError(kD("invalid argument. Options argument must be an object. Value: `%s`.",t));n=ID({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new zD(v,g,n)}function o(){return new zD(r,e,n)}}JD.exports=j2e});var DD=s(function(Ctr,BD){"use strict";var CD=require("@stdlib/utils/define-nonenumerable-read-only-property"),Xm=Df(),M2e=FD(),x2e=UD();CD(Xm,"objectMode",M2e);CD(Xm,"factory",x2e);BD.exports=Xm});var XD=s(function(Btr,A2e){A2e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var ZD=s(function(Dtr,HD){"use strict";var G2e=require("@stdlib/assert/is-plain-object"),pr=require("@stdlib/assert/has-own-property"),V2e=require("@stdlib/assert/is-boolean").isPrimitive,F2e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,YD=require("@stdlib/assert/is-string").isPrimitive,W2e=require("@stdlib/assert/is-positive-integer").isPrimitive,I2e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Un=require("@stdlib/string/format");function k2e(r,e){return G2e(e)?pr(e,"sep")&&(r.sep=e.sep,!YD(r.sep))?new TypeError(Un("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):pr(e,"objectMode")&&(r.objectMode=e.objectMode,!V2e(r.objectMode))?new TypeError(Un("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):pr(e,"encoding")&&(r.encoding=e.encoding,!YD(r.encoding)&&r.encoding!==null)?new TypeError(Un("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):pr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!F2e(r.highWaterMark))?new TypeError(Un("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):pr(e,"iter")&&(r.iter=e.iter,!I2e(r.iter))?new TypeError(Un("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):pr(e,"siter")&&(r.siter=e.siter,!W2e(r.siter))?new TypeError(Un("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(pr(e,"prng")&&(r.prng=e.prng),pr(e,"seed")&&(r.seed=e.seed),pr(e,"state")&&(r.state=e.state),pr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Un("invalid argument. Options argument must be an object. Value: `%s`.",e))}HD.exports=k2e});var $D=s(function(Xtr,QD){"use strict";var z2e=require("debug"),J2e=z2e("random:streams:laplace");QD.exports=J2e});var Yf=s(function(Ytr,i8){"use strict";var t8=require("readable-stream").Readable,U2e=require("@stdlib/assert/is-positive-number").isPrimitive,C2e=require("@stdlib/assert/is-number").isPrimitive,B2e=require("@stdlib/math/base/assert/is-nan"),D2e=require("@stdlib/assert/is-error"),X2e=require("@stdlib/object/assign"),Y2e=require("@stdlib/utils/inherit"),KD=require("@stdlib/utils/define-nonenumerable-property"),Fi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Xf=require("@stdlib/utils/define-read-only-accessor"),H2e=require("@stdlib/utils/define-read-write-accessor"),Z2e=Ta().factory,e8=require("@stdlib/buffer/from-string"),r8=require("@stdlib/string/format"),Q2e=require("@stdlib/utils/next-tick"),$2e=XD(),K2e=ZD(),ys=$D();function eFe(){return this._prng.seed}function rFe(){return this._prng.seedLength}function tFe(){return this._prng.stateLength}function iFe(){return this._prng.byteLength}function nFe(){return this._prng.state}function aFe(r){this._prng.state=r}function sFe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return ys("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),ys("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=e8(e):e=e8(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function uFe(r){var e;if(this._destroyed)return ys("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,Q2e(t),this;function t(){r&&(ys("Stream was destroyed due to an error. Error: %s.",D2e(r)?r.message:JSON.stringify(r)),e.emit("error",r)),ys("Closing the stream..."),e.emit("close")}}function Ee(r,e,t){var i,n;if(!(this instanceof Ee))return arguments.length>2?new Ee(r,e,t):new Ee(r,e);if(!C2e(r)||B2e(r))throw new TypeError(r8("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!U2e(e))throw new TypeError(r8("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=X2e({},$2e),arguments.length>2&&(n=K2e(i,t),n))throw n;return ys("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),t8.call(this,i),KD(this,"_destroyed",!1),Fi(this,"_objectMode",i.objectMode),Fi(this,"_sep",i.sep),Fi(this,"_iter",i.iter),Fi(this,"_siter",i.siter),KD(this,"_i",0),Fi(this,"_prng",Z2e(r,e,i)),Fi(this,"PRNG",this._prng.PRNG),this}Y2e(Ee,t8);Xf(Ee.prototype,"seed",eFe);Xf(Ee.prototype,"seedLength",rFe);H2e(Ee.prototype,"state",nFe,aFe);Xf(Ee.prototype,"stateLength",tFe);Xf(Ee.prototype,"byteLength",iFe);Fi(Ee.prototype,"_read",sFe);Fi(Ee.prototype,"destroy",uFe);i8.exports=Ee});var a8=s(function(Htr,n8){"use strict";var oFe=require("@stdlib/assert/is-plain-object"),vFe=require("@stdlib/object/assign"),gFe=require("@stdlib/string/format"),fFe=Yf();function dFe(r,e,t){var i;if(arguments.length>2){if(i=t,!oFe(i))throw new TypeError(gFe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=vFe({},t)}else i={};return i.objectMode=!0,new fFe(r,e,i)}n8.exports=dFe});var f8=s(function(Ztr,g8){"use strict";var s8=require("@stdlib/assert/is-plain-object"),u8=require("@stdlib/object/assign"),o8=require("@stdlib/string/format"),v8=Yf();function lFe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!s8(r))throw new TypeError(o8("invalid argument. Options argument must be an object. Value: `%s`.",r));n=u8({},r)}else if(i>2){if(!s8(t))throw new TypeError(o8("invalid argument. Options argument must be an object. Value: `%s`.",t));n=u8({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new v8(v,g,n)}function o(){return new v8(r,e,n)}}g8.exports=lFe});var c8=s(function(Qtr,l8){"use strict";var d8=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ym=Yf(),cFe=a8(),mFe=f8();d8(Ym,"objectMode",cFe);d8(Ym,"factory",mFe);l8.exports=Ym});var m8=s(function($tr,hFe){hFe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var y8=s(function(Ktr,p8){"use strict";var pFe=require("@stdlib/assert/is-plain-object"),yr=require("@stdlib/assert/has-own-property"),yFe=require("@stdlib/assert/is-boolean").isPrimitive,qFe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,h8=require("@stdlib/assert/is-string").isPrimitive,bFe=require("@stdlib/assert/is-positive-integer").isPrimitive,wFe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Cn=require("@stdlib/string/format");function SFe(r,e){return pFe(e)?yr(e,"sep")&&(r.sep=e.sep,!h8(r.sep))?new TypeError(Cn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):yr(e,"objectMode")&&(r.objectMode=e.objectMode,!yFe(r.objectMode))?new TypeError(Cn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):yr(e,"encoding")&&(r.encoding=e.encoding,!h8(r.encoding)&&r.encoding!==null)?new TypeError(Cn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):yr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!qFe(r.highWaterMark))?new TypeError(Cn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):yr(e,"iter")&&(r.iter=e.iter,!wFe(r.iter))?new TypeError(Cn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):yr(e,"siter")&&(r.siter=e.siter,!bFe(r.siter))?new TypeError(Cn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(yr(e,"prng")&&(r.prng=e.prng),yr(e,"seed")&&(r.seed=e.seed),yr(e,"state")&&(r.state=e.state),yr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Cn("invalid argument. Options argument must be an object. Value: `%s`.",e))}p8.exports=SFe});var b8=s(function(eir,q8){"use strict";var OFe=require("debug"),EFe=OFe("random:streams:levy");q8.exports=EFe});var Zf=s(function(rir,_8){"use strict";var E8=require("readable-stream").Readable,_Fe=require("@stdlib/assert/is-positive-number").isPrimitive,NFe=require("@stdlib/assert/is-number").isPrimitive,LFe=require("@stdlib/math/base/assert/is-nan"),RFe=require("@stdlib/assert/is-error"),PFe=require("@stdlib/object/assign"),TFe=require("@stdlib/utils/inherit"),w8=require("@stdlib/utils/define-nonenumerable-property"),Wi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Hf=require("@stdlib/utils/define-read-only-accessor"),jFe=require("@stdlib/utils/define-read-write-accessor"),MFe=ja().factory,S8=require("@stdlib/buffer/from-string"),xFe=require("@stdlib/utils/next-tick"),O8=require("@stdlib/string/format"),AFe=m8(),GFe=y8(),qs=b8();function VFe(){return this._prng.seed}function FFe(){return this._prng.seedLength}function WFe(){return this._prng.stateLength}function IFe(){return this._prng.byteLength}function kFe(){return this._prng.state}function zFe(r){this._prng.state=r}function JFe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return qs("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),qs("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=S8(e):e=S8(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function UFe(r){var e;if(this._destroyed)return qs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,xFe(t),this;function t(){r&&(qs("Stream was destroyed due to an error. Error: %s.",RFe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),qs("Closing the stream..."),e.emit("close")}}function _e(r,e,t){var i,n;if(!(this instanceof _e))return arguments.length>2?new _e(r,e,t):new _e(r,e);if(!NFe(r)||LFe(r))throw new TypeError(O8("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!_Fe(e))throw new TypeError(O8("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=PFe({},AFe),arguments.length>2&&(n=GFe(i,t),n))throw n;return qs("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),E8.call(this,i),w8(this,"_destroyed",!1),Wi(this,"_objectMode",i.objectMode),Wi(this,"_sep",i.sep),Wi(this,"_iter",i.iter),Wi(this,"_siter",i.siter),w8(this,"_i",0),Wi(this,"_prng",MFe(r,e,i)),Wi(this,"PRNG",this._prng.PRNG),this}TFe(_e,E8);Hf(_e.prototype,"seed",VFe);Hf(_e.prototype,"seedLength",FFe);jFe(_e.prototype,"state",kFe,zFe);Hf(_e.prototype,"stateLength",WFe);Hf(_e.prototype,"byteLength",IFe);Wi(_e.prototype,"_read",JFe);Wi(_e.prototype,"destroy",UFe);_8.exports=_e});var L8=s(function(tir,N8){"use strict";var CFe=require("@stdlib/assert/is-plain-object"),BFe=require("@stdlib/object/assign"),DFe=require("@stdlib/string/format"),XFe=Zf();function YFe(r,e,t){var i;if(arguments.length>2){if(i=t,!CFe(i))throw new TypeError(DFe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=BFe({},t)}else i={};return i.objectMode=!0,new XFe(r,e,i)}N8.exports=YFe});var x8=s(function(iir,M8){"use strict";var R8=require("@stdlib/assert/is-plain-object"),P8=require("@stdlib/object/assign"),T8=require("@stdlib/string/format"),j8=Zf();function HFe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!R8(r))throw new TypeError(T8("invalid argument. Options argument must be an object. Value: `%s`.",r));n=P8({},r)}else if(i>2){if(!R8(t))throw new TypeError(T8("invalid argument. Options argument must be an object. Value: `%s`.",t));n=P8({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new j8(v,g,n)}function o(){return new j8(r,e,n)}}M8.exports=HFe});var V8=s(function(nir,G8){"use strict";var A8=require("@stdlib/utils/define-nonenumerable-read-only-property"),Hm=Zf(),ZFe=L8(),QFe=x8();A8(Hm,"objectMode",ZFe);A8(Hm,"factory",QFe);G8.exports=Hm});var F8=s(function(air,$Fe){$Fe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var k8=s(function(sir,I8){"use strict";var KFe=require("@stdlib/assert/is-plain-object"),qr=require("@stdlib/assert/has-own-property"),eWe=require("@stdlib/assert/is-boolean").isPrimitive,rWe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,W8=require("@stdlib/assert/is-string").isPrimitive,tWe=require("@stdlib/assert/is-positive-integer").isPrimitive,iWe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Bn=require("@stdlib/string/format");function nWe(r,e){return KFe(e)?qr(e,"sep")&&(r.sep=e.sep,!W8(r.sep))?new TypeError(Bn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):qr(e,"objectMode")&&(r.objectMode=e.objectMode,!eWe(r.objectMode))?new TypeError(Bn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):qr(e,"encoding")&&(r.encoding=e.encoding,!W8(r.encoding)&&r.encoding!==null)?new TypeError(Bn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):qr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!rWe(r.highWaterMark))?new TypeError(Bn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):qr(e,"iter")&&(r.iter=e.iter,!iWe(r.iter))?new TypeError(Bn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):qr(e,"siter")&&(r.siter=e.siter,!tWe(r.siter))?new TypeError(Bn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(qr(e,"prng")&&(r.prng=e.prng),qr(e,"seed")&&(r.seed=e.seed),qr(e,"state")&&(r.state=e.state),qr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Bn("invalid argument. Options argument must be an object. Value: `%s`.",e))}I8.exports=nWe});var J8=s(function(uir,z8){"use strict";var aWe=require("debug"),sWe=aWe("random:streams:logistic");z8.exports=sWe});var $f=s(function(oir,X8){"use strict";var D8=require("readable-stream").Readable,uWe=require("@stdlib/assert/is-positive-number").isPrimitive,oWe=require("@stdlib/assert/is-number").isPrimitive,vWe=require("@stdlib/math/base/assert/is-nan"),gWe=require("@stdlib/assert/is-error"),fWe=require("@stdlib/object/assign"),dWe=require("@stdlib/utils/inherit"),U8=require("@stdlib/utils/define-nonenumerable-property"),Ii=require("@stdlib/utils/define-nonenumerable-read-only-property"),Qf=require("@stdlib/utils/define-read-only-accessor"),lWe=require("@stdlib/utils/define-read-write-accessor"),cWe=Ma().factory,C8=require("@stdlib/buffer/from-string"),mWe=require("@stdlib/utils/next-tick"),B8=require("@stdlib/string/format"),hWe=F8(),pWe=k8(),bs=J8();function yWe(){return this._prng.seed}function qWe(){return this._prng.seedLength}function bWe(){return this._prng.stateLength}function wWe(){return this._prng.byteLength}function SWe(){return this._prng.state}function OWe(r){this._prng.state=r}function EWe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return bs("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),bs("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=C8(e):e=C8(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function _We(r){var e;if(this._destroyed)return bs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,mWe(t),this;function t(){r&&(bs("Stream was destroyed due to an error. Error: %s.",gWe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),bs("Closing the stream..."),e.emit("close")}}function Ne(r,e,t){var i,n;if(!(this instanceof Ne))return arguments.length>2?new Ne(r,e,t):new Ne(r,e);if(!oWe(r)||vWe(r))throw new TypeError(B8("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!uWe(e))throw new TypeError(B8("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=fWe({},hWe),arguments.length>2&&(n=pWe(i,t),n))throw n;return bs("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),D8.call(this,i),U8(this,"_destroyed",!1),Ii(this,"_objectMode",i.objectMode),Ii(this,"_sep",i.sep),Ii(this,"_iter",i.iter),Ii(this,"_siter",i.siter),U8(this,"_i",0),Ii(this,"_prng",cWe(r,e,i)),Ii(this,"PRNG",this._prng.PRNG),this}dWe(Ne,D8);Qf(Ne.prototype,"seed",yWe);Qf(Ne.prototype,"seedLength",qWe);lWe(Ne.prototype,"state",SWe,OWe);Qf(Ne.prototype,"stateLength",bWe);Qf(Ne.prototype,"byteLength",wWe);Ii(Ne.prototype,"_read",EWe);Ii(Ne.prototype,"destroy",_We);X8.exports=Ne});var H8=s(function(vir,Y8){"use strict";var NWe=require("@stdlib/assert/is-plain-object"),LWe=require("@stdlib/object/assign"),RWe=require("@stdlib/string/format"),PWe=$f();function TWe(r,e,t){var i;if(arguments.length>2){if(i=t,!NWe(i))throw new TypeError(RWe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=LWe({},t)}else i={};return i.objectMode=!0,new PWe(r,e,i)}Y8.exports=TWe});var rX=s(function(gir,eX){"use strict";var Z8=require("@stdlib/assert/is-plain-object"),Q8=require("@stdlib/object/assign"),$8=require("@stdlib/string/format"),K8=$f();function jWe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!Z8(r))throw new TypeError($8("invalid argument. Options argument must be an object. Value: `%s`.",r));n=Q8({},r)}else if(i>2){if(!Z8(t))throw new TypeError($8("invalid argument. Options argument must be an object. Value: `%s`.",t));n=Q8({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new K8(v,g,n)}function o(){return new K8(r,e,n)}}eX.exports=jWe});var nX=s(function(fir,iX){"use strict";var tX=require("@stdlib/utils/define-nonenumerable-read-only-property"),Zm=$f(),MWe=H8(),xWe=rX();tX(Zm,"objectMode",MWe);tX(Zm,"factory",xWe);iX.exports=Zm});var aX=s(function(dir,AWe){AWe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var oX=s(function(lir,uX){"use strict";var GWe=require("@stdlib/assert/is-plain-object"),br=require("@stdlib/assert/has-own-property"),VWe=require("@stdlib/assert/is-boolean").isPrimitive,FWe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,sX=require("@stdlib/assert/is-string").isPrimitive,WWe=require("@stdlib/assert/is-positive-integer").isPrimitive,IWe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Dn=require("@stdlib/string/format");function kWe(r,e){return GWe(e)?br(e,"sep")&&(r.sep=e.sep,!sX(r.sep))?new TypeError(Dn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):br(e,"objectMode")&&(r.objectMode=e.objectMode,!VWe(r.objectMode))?new TypeError(Dn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):br(e,"encoding")&&(r.encoding=e.encoding,!sX(r.encoding)&&r.encoding!==null)?new TypeError(Dn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):br(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!FWe(r.highWaterMark))?new TypeError(Dn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):br(e,"iter")&&(r.iter=e.iter,!IWe(r.iter))?new TypeError(Dn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):br(e,"siter")&&(r.siter=e.siter,!WWe(r.siter))?new TypeError(Dn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(br(e,"prng")&&(r.prng=e.prng),br(e,"seed")&&(r.seed=e.seed),br(e,"state")&&(r.state=e.state),br(e,"copy")&&(r.copy=e.copy),null):new TypeError(Dn("invalid argument. Options argument must be an object. Value: `%s`.",e))}uX.exports=kWe});var gX=s(function(cir,vX){"use strict";var zWe=require("debug"),JWe=zWe("random:streams:lognormal");vX.exports=JWe});var ed=s(function(mir,mX){"use strict";var cX=require("readable-stream").Readable,UWe=require("@stdlib/assert/is-positive-number").isPrimitive,CWe=require("@stdlib/assert/is-number").isPrimitive,BWe=require("@stdlib/math/base/assert/is-nan"),DWe=require("@stdlib/assert/is-error"),XWe=require("@stdlib/object/assign"),YWe=require("@stdlib/utils/inherit"),fX=require("@stdlib/utils/define-nonenumerable-property"),ki=require("@stdlib/utils/define-nonenumerable-read-only-property"),Kf=require("@stdlib/utils/define-read-only-accessor"),HWe=require("@stdlib/utils/define-read-write-accessor"),ZWe=mn().factory,dX=require("@stdlib/buffer/from-string"),QWe=require("@stdlib/utils/next-tick"),lX=require("@stdlib/string/format"),$We=aX(),KWe=oX(),ws=gX();function eIe(){return this._prng.seed}function rIe(){return this._prng.seedLength}function tIe(){return this._prng.stateLength}function iIe(){return this._prng.byteLength}function nIe(){return this._prng.state}function aIe(r){this._prng.state=r}function sIe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return ws("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),ws("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=dX(e):e=dX(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function uIe(r){var e;if(this._destroyed)return ws("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,QWe(t),this;function t(){r&&(ws("Stream was destroyed due to an error. Error: %s.",DWe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),ws("Closing the stream..."),e.emit("close")}}function Le(r,e,t){var i,n;if(!(this instanceof Le))return arguments.length>2?new Le(r,e,t):new Le(r,e);if(!CWe(r)||BWe(r))throw new TypeError(lX("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!UWe(e))throw new TypeError(lX("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=XWe({},$We),arguments.length>2&&(n=KWe(i,t),n))throw n;return ws("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),cX.call(this,i),fX(this,"_destroyed",!1),ki(this,"_objectMode",i.objectMode),ki(this,"_sep",i.sep),ki(this,"_iter",i.iter),ki(this,"_siter",i.siter),fX(this,"_i",0),ki(this,"_prng",ZWe(r,e,i)),ki(this,"PRNG",this._prng.PRNG),this}YWe(Le,cX);Kf(Le.prototype,"seed",eIe);Kf(Le.prototype,"seedLength",rIe);HWe(Le.prototype,"state",nIe,aIe);Kf(Le.prototype,"stateLength",tIe);Kf(Le.prototype,"byteLength",iIe);ki(Le.prototype,"_read",sIe);ki(Le.prototype,"destroy",uIe);mX.exports=Le});var pX=s(function(hir,hX){"use strict";var oIe=require("@stdlib/assert/is-plain-object"),vIe=require("@stdlib/object/assign"),gIe=require("@stdlib/string/format"),fIe=ed();function dIe(r,e,t){var i;if(arguments.length>2){if(i=t,!oIe(i))throw new TypeError(gIe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=vIe({},t)}else i={};return i.objectMode=!0,new fIe(r,e,i)}hX.exports=dIe});var OX=s(function(pir,SX){"use strict";var yX=require("@stdlib/assert/is-plain-object"),qX=require("@stdlib/object/assign"),bX=require("@stdlib/string/format"),wX=ed();function lIe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!yX(r))throw new TypeError(bX("invalid argument. Options argument must be an object. Value: `%s`.",r));n=qX({},r)}else if(i>2){if(!yX(t))throw new TypeError(bX("invalid argument. Options argument must be an object. Value: `%s`.",t));n=qX({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new wX(v,g,n)}function o(){return new wX(r,e,n)}}SX.exports=lIe});var NX=s(function(yir,_X){"use strict";var EX=require("@stdlib/utils/define-nonenumerable-read-only-property"),Qm=ed(),cIe=pX(),mIe=OX();EX(Qm,"objectMode",cIe);EX(Qm,"factory",mIe);_X.exports=Qm});var LX=s(function(qir,hIe){hIe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308,normalized:!1}});var jX=s(function(bir,TX){"use strict";var pIe=require("@stdlib/assert/is-plain-object"),wr=require("@stdlib/assert/has-own-property"),RX=require("@stdlib/assert/is-boolean").isPrimitive,yIe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,PX=require("@stdlib/assert/is-string").isPrimitive,qIe=require("@stdlib/assert/is-positive-integer").isPrimitive,bIe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,zi=require("@stdlib/string/format");function wIe(r,e){return pIe(e)?wr(e,"sep")&&(r.sep=e.sep,!PX(r.sep))?new TypeError(zi("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):wr(e,"objectMode")&&(r.objectMode=e.objectMode,!RX(r.objectMode))?new TypeError(zi("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):wr(e,"encoding")&&(r.encoding=e.encoding,!PX(r.encoding)&&r.encoding!==null)?new TypeError(zi("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):wr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!yIe(r.highWaterMark))?new TypeError(zi("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):wr(e,"iter")&&(r.iter=e.iter,!bIe(r.iter))?new TypeError(zi("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):wr(e,"siter")&&(r.siter=e.siter,!qIe(r.siter))?new TypeError(zi("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):wr(e,"normalized")&&(r.normalized=e.normalized,!RX(r.normalized))?new TypeError(zi("invalid option. `%s` option must be a boolean. Option: `%s`.","normalized",r.normalized)):(wr(e,"seed")&&(r.seed=e.seed),wr(e,"state")&&(r.state=e.state),wr(e,"copy")&&(r.copy=e.copy),null):new TypeError(zi("invalid argument. Options argument must be an object. Value: `%s`.",e))}TX.exports=wIe});var xX=s(function(wir,MX){"use strict";var SIe=require("debug"),OIe=SIe("random:streams:minstd");MX.exports=OIe});var td=s(function(Sir,FX){"use strict";var VX=require("readable-stream").Readable,EIe=require("@stdlib/assert/is-error"),_Ie=require("@stdlib/object/assign"),NIe=require("@stdlib/utils/inherit"),AX=require("@stdlib/utils/define-nonenumerable-property"),Xn=require("@stdlib/utils/define-nonenumerable-read-only-property"),rd=require("@stdlib/utils/define-read-only-accessor"),LIe=require("@stdlib/utils/define-read-write-accessor"),RIe=$().factory,GX=require("@stdlib/buffer/from-string"),PIe=require("@stdlib/utils/next-tick"),TIe=LX(),jIe=jX(),Ss=xX();function MIe(){return this._prng.seed}function xIe(){return this._prng.seedLength}function AIe(){return this._prng.stateLength}function GIe(){return this._prng.byteLength}function VIe(){return this._prng.state}function FIe(r){this._prng.state=r}function WIe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Ss("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Ss("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=GX(e):e=GX(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function IIe(r){var e;if(this._destroyed)return Ss("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,PIe(t),this;function t(){r&&(Ss("Stream was destroyed due to an error. Error: %s.",EIe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Ss("Closing the stream..."),e.emit("close")}}function Re(r){var e,t,i;if(!(this instanceof Re))return arguments.length>0?new Re(r):new Re;if(t=_Ie({},TIe),arguments.length>0&&(i=jIe(t,r),i))throw i;return Ss("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),VX.call(this,t),AX(this,"_destroyed",!1),Xn(this,"_objectMode",t.objectMode),Xn(this,"_sep",t.sep),Xn(this,"_iter",t.iter),Xn(this,"_siter",t.siter),AX(this,"_i",0),e=RIe(t),t.normalized&&(e=e.normalized),Xn(this,"_prng",e),this}NIe(Re,VX);rd(Re.prototype,"seed",MIe);rd(Re.prototype,"seedLength",xIe);LIe(Re.prototype,"state",VIe,FIe);rd(Re.prototype,"stateLength",AIe);rd(Re.prototype,"byteLength",GIe);Xn(Re.prototype,"_read",WIe);Xn(Re.prototype,"destroy",IIe);FX.exports=Re});var IX=s(function(Oir,WX){"use strict";var kIe=require("@stdlib/assert/is-plain-object"),zIe=require("@stdlib/object/assign"),JIe=require("@stdlib/string/format"),UIe=td();function CIe(r){var e;if(arguments.length>0){if(e=r,!kIe(e))throw new TypeError(JIe("invalid argument. Options argument must be an object. Value: `%s`.",e));e=zIe({},r)}else e={};return e.objectMode=!0,new UIe(e)}WX.exports=CIe});var zX=s(function(Eir,kX){"use strict";var BIe=require("@stdlib/assert/is-plain-object"),DIe=require("@stdlib/object/assign"),XIe=require("@stdlib/string/format"),YIe=td();function HIe(r){var e;if(arguments.length>0){if(!BIe(r))throw new TypeError(XIe("invalid argument. Options argument must be an object. Value: `%s`.",r));e=DIe({},r)}else e={};return t;function t(){return new YIe(e)}}kX.exports=HIe});var CX=s(function(_ir,UX){"use strict";var JX=require("@stdlib/utils/define-nonenumerable-read-only-property"),$m=td(),ZIe=IX(),QIe=zX();JX($m,"objectMode",ZIe);JX($m,"factory",QIe);UX.exports=$m});var BX=s(function(Nir,$Ie){$Ie.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308,normalized:!1}});var HX=s(function(Lir,YX){"use strict";var KIe=require("@stdlib/assert/is-plain-object"),Sr=require("@stdlib/assert/has-own-property"),DX=require("@stdlib/assert/is-boolean").isPrimitive,eke=require("@stdlib/assert/is-nonnegative-number").isPrimitive,XX=require("@stdlib/assert/is-string").isPrimitive,rke=require("@stdlib/assert/is-positive-integer").isPrimitive,tke=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Ji=require("@stdlib/string/format");function ike(r,e){return KIe(e)?Sr(e,"sep")&&(r.sep=e.sep,!XX(r.sep))?new TypeError(Ji("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Sr(e,"objectMode")&&(r.objectMode=e.objectMode,!DX(r.objectMode))?new TypeError(Ji("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Sr(e,"encoding")&&(r.encoding=e.encoding,!XX(r.encoding)&&r.encoding!==null)?new TypeError(Ji("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Sr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!eke(r.highWaterMark))?new TypeError(Ji("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Sr(e,"iter")&&(r.iter=e.iter,!tke(r.iter))?new TypeError(Ji("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Sr(e,"siter")&&(r.siter=e.siter,!rke(r.siter))?new TypeError(Ji("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):Sr(e,"normalized")&&(r.normalized=e.normalized,!DX(r.normalized))?new TypeError(Ji("invalid option. `%s` option must be a boolean. Option: `%s`.","normalized",r.normalized)):(Sr(e,"seed")&&(r.seed=e.seed),Sr(e,"state")&&(r.state=e.state),Sr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Ji("invalid argument. Options argument must be an object. Value: `%s`.",e))}YX.exports=ike});var QX=s(function(Rir,ZX){"use strict";var nke=require("debug"),ake=nke("random:streams:minstd-shuffle");ZX.exports=ake});var nd=s(function(Pir,r7){"use strict";var e7=require("readable-stream").Readable,ske=require("@stdlib/assert/is-error"),uke=require("@stdlib/object/assign"),oke=require("@stdlib/utils/inherit"),$X=require("@stdlib/utils/define-nonenumerable-property"),Yn=require("@stdlib/utils/define-nonenumerable-read-only-property"),id=require("@stdlib/utils/define-read-only-accessor"),vke=require("@stdlib/utils/define-read-write-accessor"),gke=ee().factory,KX=require("@stdlib/buffer/from-string"),fke=require("@stdlib/utils/next-tick"),dke=BX(),lke=HX(),Os=QX();function cke(){return this._prng.seed}function mke(){return this._prng.seedLength}function hke(){return this._prng.stateLength}function pke(){return this._prng.byteLength}function yke(){return this._prng.state}function qke(r){this._prng.state=r}function bke(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Os("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Os("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=KX(e):e=KX(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function wke(r){var e;if(this._destroyed)return Os("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,fke(t),this;function t(){r&&(Os("Stream was destroyed due to an error. Error: %s.",ske(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Os("Closing the stream..."),e.emit("close")}}function Pe(r){var e,t,i;if(!(this instanceof Pe))return arguments.length>0?new Pe(r):new Pe;if(t=uke({},dke),arguments.length>0&&(i=lke(t,r),i))throw i;return Os("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),e7.call(this,t),$X(this,"_destroyed",!1),Yn(this,"_objectMode",t.objectMode),Yn(this,"_sep",t.sep),Yn(this,"_iter",t.iter),Yn(this,"_siter",t.siter),$X(this,"_i",0),e=gke(t),t.normalized&&(e=e.normalized),Yn(this,"_prng",e),this}oke(Pe,e7);id(Pe.prototype,"seed",cke);id(Pe.prototype,"seedLength",mke);vke(Pe.prototype,"state",yke,qke);id(Pe.prototype,"stateLength",hke);id(Pe.prototype,"byteLength",pke);Yn(Pe.prototype,"_read",bke);Yn(Pe.prototype,"destroy",wke);r7.exports=Pe});var i7=s(function(Tir,t7){"use strict";var Ske=require("@stdlib/assert/is-plain-object"),Oke=require("@stdlib/object/assign"),Eke=require("@stdlib/string/format"),_ke=nd();function Nke(r){var e;if(arguments.length>0){if(e=r,!Ske(e))throw new TypeError(Eke("invalid argument. Options argument must be an object. Value: `%s`.",e));e=Oke({},r)}else e={};return e.objectMode=!0,new _ke(e)}t7.exports=Nke});var a7=s(function(jir,n7){"use strict";var Lke=require("@stdlib/assert/is-plain-object"),Rke=require("@stdlib/object/assign"),Pke=require("@stdlib/string/format"),Tke=nd();function jke(r){var e;if(arguments.length>0){if(!Lke(r))throw new TypeError(Pke("invalid argument. Options argument must be an object. Value: `%s`.",r));e=Rke({},r)}else e={};return t;function t(){return new Tke(e)}}n7.exports=jke});var o7=s(function(Mir,u7){"use strict";var s7=require("@stdlib/utils/define-nonenumerable-read-only-property"),Km=nd(),Mke=i7(),xke=a7();s7(Km,"objectMode",Mke);s7(Km,"factory",xke);u7.exports=Km});var v7=s(function(xir,Ake){Ake.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308,normalized:!1}});var l7=s(function(Air,d7){"use strict";var Gke=require("@stdlib/assert/is-plain-object"),Or=require("@stdlib/assert/has-own-property"),g7=require("@stdlib/assert/is-boolean").isPrimitive,Vke=require("@stdlib/assert/is-nonnegative-number").isPrimitive,f7=require("@stdlib/assert/is-string").isPrimitive,Fke=require("@stdlib/assert/is-positive-integer").isPrimitive,Wke=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Ui=require("@stdlib/string/format");function Ike(r,e){return Gke(e)?Or(e,"sep")&&(r.sep=e.sep,!f7(r.sep))?new TypeError(Ui("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Or(e,"objectMode")&&(r.objectMode=e.objectMode,!g7(r.objectMode))?new TypeError(Ui("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Or(e,"encoding")&&(r.encoding=e.encoding,!f7(r.encoding)&&r.encoding!==null)?new TypeError(Ui("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Or(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!Vke(r.highWaterMark))?new TypeError(Ui("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Or(e,"iter")&&(r.iter=e.iter,!Wke(r.iter))?new TypeError(Ui("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Or(e,"siter")&&(r.siter=e.siter,!Fke(r.siter))?new TypeError(Ui("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):Or(e,"normalized")&&(r.normalized=e.normalized,!g7(r.normalized))?new TypeError(Ui("invalid option. `%s` option must be a boolean. Option: `%s`.","normalized",r.normalized)):(Or(e,"seed")&&(r.seed=e.seed),Or(e,"state")&&(r.state=e.state),Or(e,"copy")&&(r.copy=e.copy),null):new TypeError(Ui("invalid argument. Options argument must be an object. Value: `%s`.",e))}d7.exports=Ike});var m7=s(function(Gir,c7){"use strict";var kke=require("debug"),zke=kke("random:streams:mt19937");c7.exports=zke});var sd=s(function(Vir,q7){"use strict";var y7=require("readable-stream").Readable,Jke=require("@stdlib/assert/is-error"),Uke=require("@stdlib/object/assign"),Cke=require("@stdlib/utils/inherit"),h7=require("@stdlib/utils/define-nonenumerable-property"),Hn=require("@stdlib/utils/define-nonenumerable-read-only-property"),ad=require("@stdlib/utils/define-read-only-accessor"),Bke=require("@stdlib/utils/define-read-write-accessor"),Dke=T().factory,p7=require("@stdlib/buffer/from-string"),Xke=require("@stdlib/utils/next-tick"),Yke=v7(),Hke=l7(),Es=m7();function Zke(){return this._prng.seed}function Qke(){return this._prng.seedLength}function $ke(){return this._prng.stateLength}function Kke(){return this._prng.byteLength}function eze(){return this._prng.state}function rze(r){this._prng.state=r}function tze(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Es("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Es("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=p7(e):e=p7(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function ize(r){var e;if(this._destroyed)return Es("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,Xke(t),this;function t(){r&&(Es("Stream was destroyed due to an error. Error: %s.",Jke(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Es("Closing the stream..."),e.emit("close")}}function Te(r){var e,t,i;if(!(this instanceof Te))return arguments.length>0?new Te(r):new Te;if(t=Uke({},Yke),arguments.length>0&&(i=Hke(t,r),i))throw i;return Es("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),y7.call(this,t),h7(this,"_destroyed",!1),Hn(this,"_objectMode",t.objectMode),Hn(this,"_sep",t.sep),Hn(this,"_iter",t.iter),Hn(this,"_siter",t.siter),h7(this,"_i",0),e=Dke(t),t.normalized&&(e=e.normalized),Hn(this,"_prng",e),this}Cke(Te,y7);ad(Te.prototype,"seed",Zke);ad(Te.prototype,"seedLength",Qke);Bke(Te.prototype,"state",eze,rze);ad(Te.prototype,"stateLength",$ke);ad(Te.prototype,"byteLength",Kke);Hn(Te.prototype,"_read",tze);Hn(Te.prototype,"destroy",ize);q7.exports=Te});var w7=s(function(Fir,b7){"use strict";var nze=require("@stdlib/assert/is-plain-object"),aze=require("@stdlib/object/assign"),sze=require("@stdlib/string/format"),uze=sd();function oze(r){var e;if(arguments.length>0){if(e=r,!nze(e))throw new TypeError(sze("invalid argument. Options argument must be an object. Value: `%s`.",e));e=aze({},r)}else e={};return e.objectMode=!0,new uze(e)}b7.exports=oze});var O7=s(function(Wir,S7){"use strict";var vze=require("@stdlib/assert/is-plain-object"),gze=require("@stdlib/object/assign"),fze=require("@stdlib/string/format"),dze=sd();function lze(r){var e;if(arguments.length>0){if(!vze(r))throw new TypeError(fze("invalid argument. Options argument must be an object. Value: `%s`.",r));e=gze({},r)}else e={};return t;function t(){return new dze(e)}}S7.exports=lze});var N7=s(function(Iir,_7){"use strict";var E7=require("@stdlib/utils/define-nonenumerable-read-only-property"),eh=sd(),cze=w7(),mze=O7();E7(eh,"objectMode",cze);E7(eh,"factory",mze);_7.exports=eh});var L7=s(function(kir,hze){hze.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var T7=s(function(zir,P7){"use strict";var pze=require("@stdlib/assert/is-plain-object"),Er=require("@stdlib/assert/has-own-property"),yze=require("@stdlib/assert/is-boolean").isPrimitive,qze=require("@stdlib/assert/is-nonnegative-number").isPrimitive,R7=require("@stdlib/assert/is-string").isPrimitive,bze=require("@stdlib/assert/is-positive-integer").isPrimitive,wze=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Zn=require("@stdlib/string/format");function Sze(r,e){return pze(e)?Er(e,"sep")&&(r.sep=e.sep,!R7(r.sep))?new TypeError(Zn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Er(e,"objectMode")&&(r.objectMode=e.objectMode,!yze(r.objectMode))?new TypeError(Zn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Er(e,"encoding")&&(r.encoding=e.encoding,!R7(r.encoding)&&r.encoding!==null)?new TypeError(Zn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Er(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!qze(r.highWaterMark))?new TypeError(Zn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Er(e,"iter")&&(r.iter=e.iter,!wze(r.iter))?new TypeError(Zn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Er(e,"siter")&&(r.siter=e.siter,!bze(r.siter))?new TypeError(Zn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(Er(e,"prng")&&(r.prng=e.prng),Er(e,"seed")&&(r.seed=e.seed),Er(e,"state")&&(r.state=e.state),Er(e,"copy")&&(r.copy=e.copy),null):new TypeError(Zn("invalid argument. Options argument must be an object. Value: `%s`.",e))}P7.exports=Sze});var M7=s(function(Jir,j7){"use strict";var Oze=require("debug"),Eze=Oze("random:streams:negative-binomial");j7.exports=Eze});var od=s(function(Uir,F7){"use strict";var V7=require("readable-stream").Readable,_ze=require("@stdlib/assert/is-positive-number").isPrimitive,Nze=require("@stdlib/assert/is-probability").isPrimitive,Lze=require("@stdlib/assert/is-error"),Rze=require("@stdlib/object/assign"),Pze=require("@stdlib/utils/inherit"),x7=require("@stdlib/utils/define-nonenumerable-property"),Ci=require("@stdlib/utils/define-nonenumerable-read-only-property"),ud=require("@stdlib/utils/define-read-only-accessor"),Tze=require("@stdlib/utils/define-read-write-accessor"),jze=Ia().factory,A7=require("@stdlib/buffer/from-string"),Mze=require("@stdlib/utils/next-tick"),G7=require("@stdlib/string/format"),xze=L7(),Aze=T7(),_s=M7();function Gze(){return this._prng.seed}function Vze(){return this._prng.seedLength}function Fze(){return this._prng.stateLength}function Wze(){return this._prng.byteLength}function Ize(){return this._prng.state}function kze(r){this._prng.state=r}function zze(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return _s("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),_s("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=A7(e):e=A7(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function Jze(r){var e;if(this._destroyed)return _s("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,Mze(t),this;function t(){r&&(_s("Stream was destroyed due to an error. Error: %s.",Lze(r)?r.message:JSON.stringify(r)),e.emit("error",r)),_s("Closing the stream..."),e.emit("close")}}function je(r,e,t){var i,n;if(!(this instanceof je))return arguments.length>2?new je(r,e,t):new je(r,e);if(!_ze(r))throw new TypeError(G7("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!Nze(e))throw new TypeError(G7("invalid argument. Second argument must be a probability. Value: `%s`.",e));if(i=Rze({},xze),arguments.length>2&&(n=Aze(i,t),n))throw n;return _s("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),V7.call(this,i),x7(this,"_destroyed",!1),Ci(this,"_objectMode",i.objectMode),Ci(this,"_sep",i.sep),Ci(this,"_iter",i.iter),Ci(this,"_siter",i.siter),x7(this,"_i",0),Ci(this,"_prng",jze(r,e,i)),Ci(this,"PRNG",this._prng.PRNG),this}Pze(je,V7);ud(je.prototype,"seed",Gze);ud(je.prototype,"seedLength",Vze);Tze(je.prototype,"state",Ize,kze);ud(je.prototype,"stateLength",Fze);ud(je.prototype,"byteLength",Wze);Ci(je.prototype,"_read",zze);Ci(je.prototype,"destroy",Jze);F7.exports=je});var I7=s(function(Cir,W7){"use strict";var Uze=require("@stdlib/assert/is-plain-object"),Cze=require("@stdlib/object/assign"),Bze=require("@stdlib/string/format"),Dze=od();function Xze(r,e,t){var i;if(arguments.length>2){if(i=t,!Uze(i))throw new TypeError(Bze("invalid argument. Options argument must be an object. Value: `%s`.",i));i=Cze({},t)}else i={};return i.objectMode=!0,new Dze(r,e,i)}W7.exports=Xze});var B7=s(function(Bir,C7){"use strict";var k7=require("@stdlib/assert/is-plain-object"),z7=require("@stdlib/object/assign"),J7=require("@stdlib/string/format"),U7=od();function Yze(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!k7(r))throw new TypeError(J7("invalid argument. Options argument must be an object. Value: `%s`.",r));n=z7({},r)}else if(i>2){if(!k7(t))throw new TypeError(J7("invalid argument. Options argument must be an object. Value: `%s`.",t));n=z7({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new U7(v,g,n)}function o(){return new U7(r,e,n)}}C7.exports=Yze});var Y7=s(function(Dir,X7){"use strict";var D7=require("@stdlib/utils/define-nonenumerable-read-only-property"),rh=od(),Hze=I7(),Zze=B7();D7(rh,"objectMode",Hze);D7(rh,"factory",Zze);X7.exports=rh});var H7=s(function(Xir,Qze){Qze.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var $7=s(function(Yir,Q7){"use strict";var $ze=require("@stdlib/assert/is-plain-object"),_r=require("@stdlib/assert/has-own-property"),Kze=require("@stdlib/assert/is-boolean").isPrimitive,e3e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,Z7=require("@stdlib/assert/is-string").isPrimitive,r3e=require("@stdlib/assert/is-positive-integer").isPrimitive,t3e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Qn=require("@stdlib/string/format");function i3e(r,e){return $ze(e)?_r(e,"sep")&&(r.sep=e.sep,!Z7(r.sep))?new TypeError(Qn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):_r(e,"objectMode")&&(r.objectMode=e.objectMode,!Kze(r.objectMode))?new TypeError(Qn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):_r(e,"encoding")&&(r.encoding=e.encoding,!Z7(r.encoding)&&r.encoding!==null)?new TypeError(Qn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):_r(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!e3e(r.highWaterMark))?new TypeError(Qn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):_r(e,"iter")&&(r.iter=e.iter,!t3e(r.iter))?new TypeError(Qn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):_r(e,"siter")&&(r.siter=e.siter,!r3e(r.siter))?new TypeError(Qn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(_r(e,"prng")&&(r.prng=e.prng),_r(e,"seed")&&(r.seed=e.seed),_r(e,"state")&&(r.state=e.state),_r(e,"copy")&&(r.copy=e.copy),null):new TypeError(Qn("invalid argument. Options argument must be an object. Value: `%s`.",e))}Q7.exports=i3e});var e5=s(function(Hir,K7){"use strict";var n3e=require("debug"),a3e=n3e("random:streams:normal");K7.exports=a3e});var gd=s(function(Zir,a5){"use strict";var n5=require("readable-stream").Readable,s3e=require("@stdlib/assert/is-positive-number").isPrimitive,u3e=require("@stdlib/assert/is-number").isPrimitive,o3e=require("@stdlib/math/base/assert/is-nan"),v3e=require("@stdlib/assert/is-error"),g3e=require("@stdlib/object/assign"),f3e=require("@stdlib/utils/inherit"),r5=require("@stdlib/utils/define-nonenumerable-property"),Bi=require("@stdlib/utils/define-nonenumerable-read-only-property"),vd=require("@stdlib/utils/define-read-only-accessor"),d3e=require("@stdlib/utils/define-read-write-accessor"),l3e=pn().factory,t5=require("@stdlib/buffer/from-string"),c3e=require("@stdlib/utils/next-tick"),i5=require("@stdlib/string/format"),m3e=H7(),h3e=$7(),Ns=e5();function p3e(){return this._prng.seed}function y3e(){return this._prng.seedLength}function q3e(){return this._prng.stateLength}function b3e(){return this._prng.byteLength}function w3e(){return this._prng.state}function S3e(r){this._prng.state=r}function O3e(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Ns("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Ns("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=t5(e):e=t5(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function E3e(r){var e;if(this._destroyed)return Ns("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,c3e(t),this;function t(){r&&(Ns("Stream was destroyed due to an error. Error: %s.",v3e(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Ns("Closing the stream..."),e.emit("close")}}function Me(r,e,t){var i,n;if(!(this instanceof Me))return arguments.length>2?new Me(r,e,t):new Me(r,e);if(!u3e(r)||o3e(r))throw new TypeError(i5("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!s3e(e))throw new TypeError(i5("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=g3e({},m3e),arguments.length>2&&(n=h3e(i,t),n))throw n;return Ns("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),n5.call(this,i),r5(this,"_destroyed",!1),Bi(this,"_objectMode",i.objectMode),Bi(this,"_sep",i.sep),Bi(this,"_iter",i.iter),Bi(this,"_siter",i.siter),r5(this,"_i",0),Bi(this,"_prng",l3e(r,e,i)),Bi(this,"PRNG",this._prng.PRNG),this}f3e(Me,n5);vd(Me.prototype,"seed",p3e);vd(Me.prototype,"seedLength",y3e);d3e(Me.prototype,"state",w3e,S3e);vd(Me.prototype,"stateLength",q3e);vd(Me.prototype,"byteLength",b3e);Bi(Me.prototype,"_read",O3e);Bi(Me.prototype,"destroy",E3e);a5.exports=Me});var u5=s(function(Qir,s5){"use strict";var _3e=require("@stdlib/assert/is-plain-object"),N3e=require("@stdlib/object/assign"),L3e=require("@stdlib/string/format"),R3e=gd();function P3e(r,e,t){var i;if(arguments.length>2){if(i=t,!_3e(i))throw new TypeError(L3e("invalid argument. Options argument must be an object. Value: `%s`.",i));i=N3e({},t)}else i={};return i.objectMode=!0,new R3e(r,e,i)}s5.exports=P3e});var l5=s(function($ir,d5){"use strict";var o5=require("@stdlib/assert/is-plain-object"),v5=require("@stdlib/object/assign"),g5=require("@stdlib/string/format"),f5=gd();function T3e(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!o5(r))throw new TypeError(g5("invalid argument. Options argument must be an object. Value: `%s`.",r));n=v5({},r)}else if(i>2){if(!o5(t))throw new TypeError(g5("invalid argument. Options argument must be an object. Value: `%s`.",t));n=v5({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new f5(v,g,n)}function o(){return new f5(r,e,n)}}d5.exports=T3e});var h5=s(function(Kir,m5){"use strict";var c5=require("@stdlib/utils/define-nonenumerable-read-only-property"),th=gd(),j3e=u5(),M3e=l5();c5(th,"objectMode",j3e);c5(th,"factory",M3e);m5.exports=th});var p5=s(function(enr,x3e){x3e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var b5=s(function(rnr,q5){"use strict";var A3e=require("@stdlib/assert/is-plain-object"),Nr=require("@stdlib/assert/has-own-property"),G3e=require("@stdlib/assert/is-boolean").isPrimitive,V3e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,y5=require("@stdlib/assert/is-string").isPrimitive,F3e=require("@stdlib/assert/is-positive-integer").isPrimitive,W3e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,$n=require("@stdlib/string/format");function I3e(r,e){return A3e(e)?Nr(e,"sep")&&(r.sep=e.sep,!y5(r.sep))?new TypeError($n("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Nr(e,"objectMode")&&(r.objectMode=e.objectMode,!G3e(r.objectMode))?new TypeError($n("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Nr(e,"encoding")&&(r.encoding=e.encoding,!y5(r.encoding)&&r.encoding!==null)?new TypeError($n("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Nr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!V3e(r.highWaterMark))?new TypeError($n("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Nr(e,"iter")&&(r.iter=e.iter,!W3e(r.iter))?new TypeError($n("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Nr(e,"siter")&&(r.siter=e.siter,!F3e(r.siter))?new TypeError($n("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(Nr(e,"prng")&&(r.prng=e.prng),Nr(e,"seed")&&(r.seed=e.seed),Nr(e,"state")&&(r.state=e.state),Nr(e,"copy")&&(r.copy=e.copy),null):new TypeError($n("invalid argument. Options argument must be an object. Value: `%s`.",e))}q5.exports=I3e});var S5=s(function(tnr,w5){"use strict";var k3e=require("debug"),z3e=k3e("random:streams:pareto1");w5.exports=z3e});var dd=s(function(inr,R5){"use strict";var L5=require("readable-stream").Readable,O5=require("@stdlib/assert/is-positive-number").isPrimitive,J3e=require("@stdlib/assert/is-error"),U3e=require("@stdlib/object/assign"),C3e=require("@stdlib/utils/inherit"),E5=require("@stdlib/utils/define-nonenumerable-property"),Di=require("@stdlib/utils/define-nonenumerable-read-only-property"),fd=require("@stdlib/utils/define-read-only-accessor"),B3e=require("@stdlib/utils/define-read-write-accessor"),D3e=za().factory,_5=require("@stdlib/buffer/from-string"),X3e=require("@stdlib/utils/next-tick"),N5=require("@stdlib/string/format"),Y3e=p5(),H3e=b5(),Ls=S5();function Z3e(){return this._prng.seed}function Q3e(){return this._prng.seedLength}function $3e(){return this._prng.stateLength}function K3e(){return this._prng.byteLength}function eJe(){return this._prng.state}function rJe(r){this._prng.state=r}function tJe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Ls("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Ls("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=_5(e):e=_5(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function iJe(r){var e;if(this._destroyed)return Ls("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,X3e(t),this;function t(){r&&(Ls("Stream was destroyed due to an error. Error: %s.",J3e(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Ls("Closing the stream..."),e.emit("close")}}function xe(r,e,t){var i,n;if(!(this instanceof xe))return arguments.length>2?new xe(r,e,t):new xe(r,e);if(!O5(r))throw new TypeError(N5("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!O5(e))throw new TypeError(N5("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=U3e({},Y3e),arguments.length>2&&(n=H3e(i,t),n))throw n;return Ls("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),L5.call(this,i),E5(this,"_destroyed",!1),Di(this,"_objectMode",i.objectMode),Di(this,"_sep",i.sep),Di(this,"_iter",i.iter),Di(this,"_siter",i.siter),E5(this,"_i",0),Di(this,"_prng",D3e(r,e,i)),Di(this,"PRNG",this._prng.PRNG),this}C3e(xe,L5);fd(xe.prototype,"seed",Z3e);fd(xe.prototype,"seedLength",Q3e);B3e(xe.prototype,"state",eJe,rJe);fd(xe.prototype,"stateLength",$3e);fd(xe.prototype,"byteLength",K3e);Di(xe.prototype,"_read",tJe);Di(xe.prototype,"destroy",iJe);R5.exports=xe});var T5=s(function(nnr,P5){"use strict";var nJe=require("@stdlib/assert/is-plain-object"),aJe=require("@stdlib/object/assign"),sJe=require("@stdlib/string/format"),uJe=dd();function oJe(r,e,t){var i;if(arguments.length>2){if(i=t,!nJe(i))throw new TypeError(sJe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=aJe({},t)}else i={};return i.objectMode=!0,new uJe(r,e,i)}P5.exports=oJe});var V5=s(function(anr,G5){"use strict";var j5=require("@stdlib/assert/is-plain-object"),M5=require("@stdlib/object/assign"),x5=require("@stdlib/string/format"),A5=dd();function vJe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!j5(r))throw new TypeError(x5("invalid argument. Options argument must be an object. Value: `%s`.",r));n=M5({},r)}else if(i>2){if(!j5(t))throw new TypeError(x5("invalid argument. Options argument must be an object. Value: `%s`.",t));n=M5({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new A5(v,g,n)}function o(){return new A5(r,e,n)}}G5.exports=vJe});var I5=s(function(snr,W5){"use strict";var F5=require("@stdlib/utils/define-nonenumerable-read-only-property"),ih=dd(),gJe=T5(),fJe=V5();F5(ih,"objectMode",gJe);F5(ih,"factory",fJe);W5.exports=ih});var k5=s(function(unr,dJe){dJe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var U5=s(function(onr,J5){"use strict";var lJe=require("@stdlib/assert/is-plain-object"),Lr=require("@stdlib/assert/has-own-property"),cJe=require("@stdlib/assert/is-boolean").isPrimitive,mJe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,z5=require("@stdlib/assert/is-string").isPrimitive,hJe=require("@stdlib/assert/is-positive-integer").isPrimitive,pJe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Kn=require("@stdlib/string/format");function yJe(r,e){return lJe(e)?Lr(e,"sep")&&(r.sep=e.sep,!z5(r.sep))?new TypeError(Kn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Lr(e,"objectMode")&&(r.objectMode=e.objectMode,!cJe(r.objectMode))?new TypeError(Kn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Lr(e,"encoding")&&(r.encoding=e.encoding,!z5(r.encoding)&&r.encoding!==null)?new TypeError(Kn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Lr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!mJe(r.highWaterMark))?new TypeError(Kn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Lr(e,"iter")&&(r.iter=e.iter,!pJe(r.iter))?new TypeError(Kn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Lr(e,"siter")&&(r.siter=e.siter,!hJe(r.siter))?new TypeError(Kn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(Lr(e,"prng")&&(r.prng=e.prng),Lr(e,"seed")&&(r.seed=e.seed),Lr(e,"state")&&(r.state=e.state),Lr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Kn("invalid argument. Options argument must be an object. Value: `%s`.",e))}J5.exports=yJe});var B5=s(function(vnr,C5){"use strict";var qJe=require("debug"),bJe=qJe("random:streams:poisson");C5.exports=bJe});var cd=s(function(gnr,H5){"use strict";var Y5=require("readable-stream").Readable,wJe=require("@stdlib/assert/is-positive-number").isPrimitive,SJe=require("@stdlib/assert/is-error"),OJe=require("@stdlib/object/assign"),EJe=require("@stdlib/utils/inherit"),D5=require("@stdlib/utils/define-nonenumerable-property"),Xi=require("@stdlib/utils/define-nonenumerable-read-only-property"),ld=require("@stdlib/utils/define-read-only-accessor"),_Je=require("@stdlib/utils/define-read-write-accessor"),NJe=hn().factory,X5=require("@stdlib/buffer/from-string"),LJe=require("@stdlib/string/format"),RJe=require("@stdlib/utils/next-tick"),PJe=k5(),TJe=U5(),Rs=B5();function jJe(){return this._prng.seed}function MJe(){return this._prng.seedLength}function xJe(){return this._prng.stateLength}function AJe(){return this._prng.byteLength}function GJe(){return this._prng.state}function VJe(r){this._prng.state=r}function FJe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Rs("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Rs("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=X5(e):e=X5(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function WJe(r){var e;if(this._destroyed)return Rs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,RJe(t),this;function t(){r&&(Rs("Stream was destroyed due to an error. Error: %s.",SJe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Rs("Closing the stream..."),e.emit("close")}}function Ae(r,e){var t,i;if(!(this instanceof Ae))return arguments.length>1?new Ae(r,e):new Ae(r);if(!wJe(r))throw new TypeError(LJe("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(t=OJe({},PJe),arguments.length>1&&(i=TJe(t,e),i))throw i;return Rs("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),Y5.call(this,t),D5(this,"_destroyed",!1),Xi(this,"_objectMode",t.objectMode),Xi(this,"_sep",t.sep),Xi(this,"_iter",t.iter),Xi(this,"_siter",t.siter),D5(this,"_i",0),Xi(this,"_prng",NJe(r,t)),Xi(this,"PRNG",this._prng.PRNG),this}EJe(Ae,Y5);ld(Ae.prototype,"seed",jJe);ld(Ae.prototype,"seedLength",MJe);_Je(Ae.prototype,"state",GJe,VJe);ld(Ae.prototype,"stateLength",xJe);ld(Ae.prototype,"byteLength",AJe);Xi(Ae.prototype,"_read",FJe);Xi(Ae.prototype,"destroy",WJe);H5.exports=Ae});var Q5=s(function(fnr,Z5){"use strict";var IJe=require("@stdlib/assert/is-plain-object"),kJe=require("@stdlib/object/assign"),zJe=require("@stdlib/string/format"),JJe=cd();function UJe(r,e){var t;if(arguments.length>1){if(t=e,!IJe(t))throw new TypeError(zJe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=kJe({},e)}else t={};return t.objectMode=!0,new JJe(r,t)}Z5.exports=UJe});var iY=s(function(dnr,tY){"use strict";var CJe=require("@stdlib/assert/is-positive-number").isPrimitive,$5=require("@stdlib/assert/is-plain-object"),K5=require("@stdlib/object/assign"),eY=require("@stdlib/string/format"),rY=cd();function BJe(r,e){var t,i,n;if(t=arguments.length,t>1){if(!$5(e))throw new TypeError(eY("invalid argument. Options argument must be an object. Value: `%s`.",e));n=u,i=K5({},e)}else if(t===1)if(CJe(r))n=u,i={};else{if(!$5(r))throw new TypeError(eY("invalid argument. Options argument must be an object. Value: `%s`.",r));i=K5({},r),n=a}else i={},n=a;return n;function a(o){return new rY(o,i)}function u(){return new rY(r,i)}}tY.exports=BJe});var sY=s(function(lnr,aY){"use strict";var nY=require("@stdlib/utils/define-nonenumerable-read-only-property"),nh=cd(),DJe=Q5(),XJe=iY();nY(nh,"objectMode",DJe);nY(nh,"factory",XJe);aY.exports=nh});var uY=s(function(cnr,YJe){YJe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308,name:"mt19937"}});var gY=s(function(mnr,vY){"use strict";var HJe=require("@stdlib/assert/is-plain-object"),Rr=require("@stdlib/assert/has-own-property"),ZJe=require("@stdlib/assert/is-boolean").isPrimitive,QJe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,oY=require("@stdlib/assert/is-string").isPrimitive,$Je=require("@stdlib/assert/is-positive-integer").isPrimitive,KJe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,ea=require("@stdlib/string/format");function eUe(r,e){return HJe(e)?Rr(e,"sep")&&(r.sep=e.sep,!oY(r.sep))?new TypeError(ea("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Rr(e,"objectMode")&&(r.objectMode=e.objectMode,!ZJe(r.objectMode))?new TypeError(ea("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Rr(e,"encoding")&&(r.encoding=e.encoding,!oY(r.encoding)&&r.encoding!==null)?new TypeError(ea("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Rr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!QJe(r.highWaterMark))?new TypeError(ea("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Rr(e,"iter")&&(r.iter=e.iter,!KJe(r.iter))?new TypeError(ea("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Rr(e,"siter")&&(r.siter=e.siter,!$Je(r.siter))?new TypeError(ea("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(Rr(e,"name")&&(r.name=e.name),Rr(e,"seed")&&(r.seed=e.seed),Rr(e,"state")&&(r.state=e.state),Rr(e,"copy")&&(r.copy=e.copy),null):new TypeError(ea("invalid argument. Options argument must be an object. Value: `%s`.",e))}vY.exports=eUe});var dY=s(function(hnr,fY){"use strict";var rUe=require("debug"),tUe=rUe("random:streams:randi");fY.exports=tUe});var hd=s(function(pnr,hY){"use strict";var mY=require("readable-stream").Readable,iUe=require("@stdlib/assert/is-error"),nUe=require("@stdlib/object/assign"),aUe=require("@stdlib/utils/inherit"),lY=require("@stdlib/utils/define-nonenumerable-property"),Yi=require("@stdlib/utils/define-nonenumerable-read-only-property"),md=require("@stdlib/utils/define-read-only-accessor"),sUe=require("@stdlib/utils/define-read-write-accessor"),uUe=pu().factory,cY=require("@stdlib/buffer/from-string"),oUe=require("@stdlib/utils/next-tick"),vUe=uY(),gUe=gY(),Ps=dY();function fUe(){return this._prng.seed}function dUe(){return this._prng.seedLength}function lUe(){return this._prng.stateLength}function cUe(){return this._prng.byteLength}function mUe(){return this._prng.state}function hUe(r){this._prng.state=r}function pUe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Ps("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Ps("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=cY(e):e=cY(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function yUe(r){var e;if(this._destroyed)return Ps("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,oUe(t),this;function t(){r&&(Ps("Stream was destroyed due to an error. Error: %s.",iUe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Ps("Closing the stream..."),e.emit("close")}}function Ge(r){var e,t;if(!(this instanceof Ge))return arguments.length>0?new Ge(r):new Ge;if(e=nUe({},vUe),arguments.length>0&&(t=gUe(e,r),t))throw t;return Ps("Creating a readable stream configured with the following options: %s.",JSON.stringify(e)),mY.call(this,e),lY(this,"_destroyed",!1),Yi(this,"_objectMode",e.objectMode),Yi(this,"_sep",e.sep),Yi(this,"_iter",e.iter),Yi(this,"_siter",e.siter),lY(this,"_i",0),Yi(this,"_prng",uUe(e)),Yi(this,"PRNG",this._prng.PRNG),this}aUe(Ge,mY);md(Ge.prototype,"seed",fUe);md(Ge.prototype,"seedLength",dUe);sUe(Ge.prototype,"state",mUe,hUe);md(Ge.prototype,"stateLength",lUe);md(Ge.prototype,"byteLength",cUe);Yi(Ge.prototype,"_read",pUe);Yi(Ge.prototype,"destroy",yUe);hY.exports=Ge});var yY=s(function(ynr,pY){"use strict";var qUe=require("@stdlib/assert/is-plain-object"),bUe=require("@stdlib/object/assign"),wUe=require("@stdlib/string/format"),SUe=hd();function OUe(r){var e;if(arguments.length>0){if(e=r,!qUe(e))throw new TypeError(wUe("invalid argument. Options argument must be an object. Value: `%s`.",e));e=bUe({},r)}else e={};return e.objectMode=!0,new SUe(e)}pY.exports=OUe});var bY=s(function(qnr,qY){"use strict";var EUe=require("@stdlib/assert/is-plain-object"),_Ue=require("@stdlib/object/assign"),NUe=require("@stdlib/string/format"),LUe=hd();function RUe(r){var e;if(arguments.length>0){if(!EUe(r))throw new TypeError(NUe("invalid argument. Options argument must be an object. Value: `%s`.",r));e=_Ue({},r)}else e={};return t;function t(){return new LUe(e)}}qY.exports=RUe});var OY=s(function(bnr,SY){"use strict";var wY=require("@stdlib/utils/define-nonenumerable-read-only-property"),ah=hd(),PUe=yY(),TUe=bY();wY(ah,"objectMode",PUe);wY(ah,"factory",TUe);SY.exports=ah});var EY=s(function(wnr,jUe){jUe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308,name:"improved-ziggurat"}});var LY=s(function(Snr,NY){"use strict";var MUe=require("@stdlib/assert/is-plain-object"),De=require("@stdlib/assert/has-own-property"),xUe=require("@stdlib/assert/is-boolean").isPrimitive,AUe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,_Y=require("@stdlib/assert/is-string").isPrimitive,GUe=require("@stdlib/assert/is-positive-integer").isPrimitive,VUe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,ra=require("@stdlib/string/format");function FUe(r,e){return MUe(e)?De(e,"sep")&&(r.sep=e.sep,!_Y(r.sep))?new TypeError(ra("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):De(e,"objectMode")&&(r.objectMode=e.objectMode,!xUe(r.objectMode))?new TypeError(ra("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):De(e,"encoding")&&(r.encoding=e.encoding,!_Y(r.encoding)&&r.encoding!==null)?new TypeError(ra("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):De(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!AUe(r.highWaterMark))?new TypeError(ra("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):De(e,"iter")&&(r.iter=e.iter,!VUe(r.iter))?new TypeError(ra("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):De(e,"siter")&&(r.siter=e.siter,!GUe(r.siter))?new TypeError(ra("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(De(e,"name")&&(r.name=e.name),De(e,"prng")&&(r.prng=e.prng),De(e,"seed")&&(r.seed=e.seed),De(e,"state")&&(r.state=e.state),De(e,"copy")&&(r.copy=e.copy),null):new TypeError(ra("invalid argument. Options argument must be an object. Value: `%s`.",e))}NY.exports=FUe});var PY=s(function(Onr,RY){"use strict";var WUe=require("debug"),IUe=WUe("random:streams:randn");RY.exports=IUe});var yd=s(function(Enr,xY){"use strict";var MY=require("readable-stream").Readable,kUe=require("@stdlib/assert/is-error"),zUe=require("@stdlib/object/assign"),JUe=require("@stdlib/utils/inherit"),TY=require("@stdlib/utils/define-nonenumerable-property"),Hi=require("@stdlib/utils/define-nonenumerable-read-only-property"),pd=require("@stdlib/utils/define-read-only-accessor"),UUe=require("@stdlib/utils/define-read-write-accessor"),CUe=qu().factory,jY=require("@stdlib/buffer/from-string"),BUe=require("@stdlib/utils/next-tick"),DUe=EY(),XUe=LY(),Ts=PY();function YUe(){return this._prng.seed}function HUe(){return this._prng.seedLength}function ZUe(){return this._prng.stateLength}function QUe(){return this._prng.byteLength}function $Ue(){return this._prng.state}function KUe(r){this._prng.state=r}function eCe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Ts("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Ts("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=jY(e):e=jY(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function rCe(r){var e;if(this._destroyed)return Ts("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,BUe(t),this;function t(){r&&(Ts("Stream was destroyed due to an error. Error: %s.",kUe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Ts("Closing the stream..."),e.emit("close")}}function Ve(r){var e,t;if(!(this instanceof Ve))return arguments.length>0?new Ve(r):new Ve;if(e=zUe({},DUe),arguments.length>0&&(t=XUe(e,r),t))throw t;return Ts("Creating a readable stream configured with the following options: %s.",JSON.stringify(e)),MY.call(this,e),TY(this,"_destroyed",!1),Hi(this,"_objectMode",e.objectMode),Hi(this,"_sep",e.sep),Hi(this,"_iter",e.iter),Hi(this,"_siter",e.siter),TY(this,"_i",0),Hi(this,"_prng",CUe(e)),Hi(this,"PRNG",this._prng.PRNG),this}JUe(Ve,MY);pd(Ve.prototype,"seed",YUe);pd(Ve.prototype,"seedLength",HUe);UUe(Ve.prototype,"state",$Ue,KUe);pd(Ve.prototype,"stateLength",ZUe);pd(Ve.prototype,"byteLength",QUe);Hi(Ve.prototype,"_read",eCe);Hi(Ve.prototype,"destroy",rCe);xY.exports=Ve});var GY=s(function(_nr,AY){"use strict";var tCe=require("@stdlib/assert/is-plain-object"),iCe=require("@stdlib/object/assign"),nCe=require("@stdlib/string/format"),aCe=yd();function sCe(r){var e;if(arguments.length>0){if(e=r,!tCe(e))throw new TypeError(nCe("invalid argument. Options argument must be an object. Value: `%s`.",e));e=iCe({},r)}else e={};return e.objectMode=!0,new aCe(e)}AY.exports=sCe});var FY=s(function(Nnr,VY){"use strict";var uCe=require("@stdlib/assert/is-plain-object"),oCe=require("@stdlib/object/assign"),vCe=require("@stdlib/string/format"),gCe=yd();function fCe(r){var e;if(arguments.length>0){if(!uCe(r))throw new TypeError(vCe("invalid argument. Options argument must be an object. Value: `%s`.",r));e=oCe({},r)}else e={};return t;function t(){return new gCe(e)}}VY.exports=fCe});var kY=s(function(Lnr,IY){"use strict";var WY=require("@stdlib/utils/define-nonenumerable-read-only-property"),sh=yd(),dCe=GY(),lCe=FY();WY(sh,"objectMode",dCe);WY(sh,"factory",lCe);IY.exports=sh});var zY=s(function(Rnr,cCe){cCe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308,name:"mt19937"}});var CY=s(function(Pnr,UY){"use strict";var mCe=require("@stdlib/assert/is-plain-object"),Pr=require("@stdlib/assert/has-own-property"),hCe=require("@stdlib/assert/is-boolean").isPrimitive,pCe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,JY=require("@stdlib/assert/is-string").isPrimitive,yCe=require("@stdlib/assert/is-positive-integer").isPrimitive,qCe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,ta=require("@stdlib/string/format");function bCe(r,e){return mCe(e)?Pr(e,"sep")&&(r.sep=e.sep,!JY(r.sep))?new TypeError(ta("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Pr(e,"objectMode")&&(r.objectMode=e.objectMode,!hCe(r.objectMode))?new TypeError(ta("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Pr(e,"encoding")&&(r.encoding=e.encoding,!JY(r.encoding)&&r.encoding!==null)?new TypeError(ta("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Pr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!pCe(r.highWaterMark))?new TypeError(ta("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Pr(e,"iter")&&(r.iter=e.iter,!qCe(r.iter))?new TypeError(ta("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Pr(e,"siter")&&(r.siter=e.siter,!yCe(r.siter))?new TypeError(ta("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(Pr(e,"name")&&(r.name=e.name),Pr(e,"seed")&&(r.seed=e.seed),Pr(e,"state")&&(r.state=e.state),Pr(e,"copy")&&(r.copy=e.copy),null):new TypeError(ta("invalid argument. Options argument must be an object. Value: `%s`.",e))}UY.exports=bCe});var DY=s(function(Tnr,BY){"use strict";var wCe=require("debug"),SCe=wCe("random:streams:randu");BY.exports=SCe});var bd=s(function(jnr,ZY){"use strict";var HY=require("readable-stream").Readable,OCe=require("@stdlib/assert/is-error"),ECe=require("@stdlib/object/assign"),_Ce=require("@stdlib/utils/inherit"),XY=require("@stdlib/utils/define-nonenumerable-property"),Zi=require("@stdlib/utils/define-nonenumerable-read-only-property"),qd=require("@stdlib/utils/define-read-only-accessor"),NCe=require("@stdlib/utils/define-read-write-accessor"),LCe=Tt().factory,YY=require("@stdlib/buffer/from-string"),RCe=require("@stdlib/utils/next-tick"),PCe=zY(),TCe=CY(),js=DY();function jCe(){return this._prng.seed}function MCe(){return this._prng.seedLength}function xCe(){return this._prng.stateLength}function ACe(){return this._prng.byteLength}function GCe(){return this._prng.state}function VCe(r){this._prng.state=r}function FCe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return js("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),js("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=YY(e):e=YY(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function WCe(r){var e;if(this._destroyed)return js("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,RCe(t),this;function t(){r&&(js("Stream was destroyed due to an error. Error: %s.",OCe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),js("Closing the stream..."),e.emit("close")}}function Fe(r){var e,t;if(!(this instanceof Fe))return arguments.length>0?new Fe(r):new Fe;if(e=ECe({},PCe),arguments.length>0&&(t=TCe(e,r),t))throw t;return js("Creating a readable stream configured with the following options: %s.",JSON.stringify(e)),HY.call(this,e),XY(this,"_destroyed",!1),Zi(this,"_objectMode",e.objectMode),Zi(this,"_sep",e.sep),Zi(this,"_iter",e.iter),Zi(this,"_siter",e.siter),XY(this,"_i",0),Zi(this,"_prng",LCe(e)),Zi(this,"PRNG",this._prng.PRNG),this}_Ce(Fe,HY);qd(Fe.prototype,"seed",jCe);qd(Fe.prototype,"seedLength",MCe);NCe(Fe.prototype,"state",GCe,VCe);qd(Fe.prototype,"stateLength",xCe);qd(Fe.prototype,"byteLength",ACe);Zi(Fe.prototype,"_read",FCe);Zi(Fe.prototype,"destroy",WCe);ZY.exports=Fe});var $Y=s(function(Mnr,QY){"use strict";var ICe=require("@stdlib/assert/is-plain-object"),kCe=require("@stdlib/object/assign"),zCe=require("@stdlib/string/format"),JCe=bd();function UCe(r){var e;if(arguments.length>0){if(e=r,!ICe(e))throw new TypeError(zCe("invalid argument. Options argument must be an object. Value: `%s`.",e));e=kCe({},r)}else e={};return e.objectMode=!0,new JCe(e)}QY.exports=UCe});var e6=s(function(xnr,KY){"use strict";var CCe=require("@stdlib/assert/is-plain-object"),BCe=require("@stdlib/object/assign"),DCe=require("@stdlib/string/format"),XCe=bd();function YCe(r){var e;if(arguments.length>0){if(!CCe(r))throw new TypeError(DCe("invalid argument. Options argument must be an object. Value: `%s`.",r));e=BCe({},r)}else e={};return t;function t(){return new XCe(e)}}KY.exports=YCe});var i6=s(function(Anr,t6){"use strict";var r6=require("@stdlib/utils/define-nonenumerable-read-only-property"),uh=bd(),HCe=$Y(),ZCe=e6();r6(uh,"objectMode",HCe);r6(uh,"factory",ZCe);t6.exports=uh});var n6=s(function(Gnr,QCe){QCe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var u6=s(function(Vnr,s6){"use strict";var $Ce=require("@stdlib/assert/is-plain-object"),Tr=require("@stdlib/assert/has-own-property"),KCe=require("@stdlib/assert/is-boolean").isPrimitive,eBe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,a6=require("@stdlib/assert/is-string").isPrimitive,rBe=require("@stdlib/assert/is-positive-integer").isPrimitive,tBe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,ia=require("@stdlib/string/format");function iBe(r,e){return $Ce(e)?Tr(e,"sep")&&(r.sep=e.sep,!a6(r.sep))?new TypeError(ia("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Tr(e,"objectMode")&&(r.objectMode=e.objectMode,!KCe(r.objectMode))?new TypeError(ia("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Tr(e,"encoding")&&(r.encoding=e.encoding,!a6(r.encoding)&&r.encoding!==null)?new TypeError(ia("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Tr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!eBe(r.highWaterMark))?new TypeError(ia("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Tr(e,"iter")&&(r.iter=e.iter,!tBe(r.iter))?new TypeError(ia("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Tr(e,"siter")&&(r.siter=e.siter,!rBe(r.siter))?new TypeError(ia("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(Tr(e,"prng")&&(r.prng=e.prng),Tr(e,"seed")&&(r.seed=e.seed),Tr(e,"state")&&(r.state=e.state),Tr(e,"copy")&&(r.copy=e.copy),null):new TypeError(ia("invalid argument. Options argument must be an object. Value: `%s`.",e))}s6.exports=iBe});var v6=s(function(Fnr,o6){"use strict";var nBe=require("debug"),aBe=nBe("random:streams:rayleigh");o6.exports=aBe});var Sd=s(function(Wnr,l6){"use strict";var d6=require("readable-stream").Readable,sBe=require("@stdlib/assert/is-positive-number").isPrimitive,uBe=require("@stdlib/assert/is-error"),oBe=require("@stdlib/object/assign"),vBe=require("@stdlib/utils/inherit"),g6=require("@stdlib/utils/define-nonenumerable-property"),Qi=require("@stdlib/utils/define-nonenumerable-read-only-property"),wd=require("@stdlib/utils/define-read-only-accessor"),gBe=require("@stdlib/utils/define-read-write-accessor"),fBe=Ja().factory,f6=require("@stdlib/buffer/from-string"),dBe=require("@stdlib/utils/next-tick"),lBe=require("@stdlib/string/format"),cBe=n6(),mBe=u6(),Ms=v6();function hBe(){return this._prng.seed}function pBe(){return this._prng.seedLength}function yBe(){return this._prng.stateLength}function qBe(){return this._prng.byteLength}function bBe(){return this._prng.state}function wBe(r){this._prng.state=r}function SBe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Ms("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Ms("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=f6(e):e=f6(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function OBe(r){var e;if(this._destroyed)return Ms("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,dBe(t),this;function t(){r&&(Ms("Stream was destroyed due to an error. Error: %s.",uBe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Ms("Closing the stream..."),e.emit("close")}}function We(r,e){var t,i;if(!(this instanceof We))return arguments.length>1?new We(r,e):new We(r);if(!sBe(r))throw new TypeError(lBe("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(t=oBe({},cBe),arguments.length>1&&(i=mBe(t,e),i))throw i;return Ms("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),d6.call(this,t),g6(this,"_destroyed",!1),Qi(this,"_objectMode",t.objectMode),Qi(this,"_sep",t.sep),Qi(this,"_iter",t.iter),Qi(this,"_siter",t.siter),g6(this,"_i",0),Qi(this,"_prng",fBe(r,t)),Qi(this,"PRNG",this._prng.PRNG),this}vBe(We,d6);wd(We.prototype,"seed",hBe);wd(We.prototype,"seedLength",pBe);gBe(We.prototype,"state",bBe,wBe);wd(We.prototype,"stateLength",yBe);wd(We.prototype,"byteLength",qBe);Qi(We.prototype,"_read",SBe);Qi(We.prototype,"destroy",OBe);l6.exports=We});var m6=s(function(Inr,c6){"use strict";var EBe=require("@stdlib/assert/is-plain-object"),_Be=require("@stdlib/object/assign"),NBe=require("@stdlib/string/format"),LBe=Sd();function RBe(r,e){var t;if(arguments.length>1){if(t=e,!EBe(t))throw new TypeError(NBe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=_Be({},e)}else t={};return t.objectMode=!0,new LBe(r,t)}c6.exports=RBe});var w6=s(function(knr,b6){"use strict";var PBe=require("@stdlib/assert/is-positive-number").isPrimitive,h6=require("@stdlib/assert/is-plain-object"),p6=require("@stdlib/object/assign"),y6=require("@stdlib/string/format"),q6=Sd();function TBe(r,e){var t,i,n;if(t=arguments.length,t>1){if(!h6(e))throw new TypeError(y6("invalid argument. Options argument must be an object. Value: `%s`.",e));n=u,i=p6({},e)}else if(t===1)if(PBe(r))n=u,i={};else{if(!h6(r))throw new TypeError(y6("invalid argument. Options argument must be an object. Value: `%s`.",r));i=p6({},r),n=a}else i={},n=a;return n;function a(o){return new q6(o,i)}function u(){return new q6(r,i)}}b6.exports=TBe});var E6=s(function(znr,O6){"use strict";var S6=require("@stdlib/utils/define-nonenumerable-read-only-property"),oh=Sd(),jBe=m6(),MBe=w6();S6(oh,"objectMode",jBe);S6(oh,"factory",MBe);O6.exports=oh});var _6=s(function(Jnr,xBe){xBe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var R6=s(function(Unr,L6){"use strict";var ABe=require("@stdlib/assert/is-plain-object"),jr=require("@stdlib/assert/has-own-property"),GBe=require("@stdlib/assert/is-boolean").isPrimitive,VBe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,N6=require("@stdlib/assert/is-string").isPrimitive,FBe=require("@stdlib/assert/is-positive-integer").isPrimitive,WBe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,na=require("@stdlib/string/format");function IBe(r,e){return ABe(e)?jr(e,"sep")&&(r.sep=e.sep,!N6(r.sep))?new TypeError(na("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):jr(e,"objectMode")&&(r.objectMode=e.objectMode,!GBe(r.objectMode))?new TypeError(na("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):jr(e,"encoding")&&(r.encoding=e.encoding,!N6(r.encoding)&&r.encoding!==null)?new TypeError(na("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):jr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!VBe(r.highWaterMark))?new TypeError(na("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):jr(e,"iter")&&(r.iter=e.iter,!WBe(r.iter))?new TypeError(na("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):jr(e,"siter")&&(r.siter=e.siter,!FBe(r.siter))?new TypeError(na("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(jr(e,"prng")&&(r.prng=e.prng),jr(e,"seed")&&(r.seed=e.seed),jr(e,"state")&&(r.state=e.state),jr(e,"copy")&&(r.copy=e.copy),null):new TypeError(na("invalid argument. Options argument must be an object. Value: `%s`.",e))}L6.exports=IBe});var T6=s(function(Cnr,P6){"use strict";var kBe=require("debug"),zBe=kBe("random:streams:t");P6.exports=zBe});var Ed=s(function(Bnr,A6){"use strict";var x6=require("readable-stream").Readable,JBe=require("@stdlib/assert/is-positive-number").isPrimitive,UBe=require("@stdlib/assert/is-error"),CBe=require("@stdlib/object/assign"),BBe=require("@stdlib/utils/inherit"),j6=require("@stdlib/utils/define-nonenumerable-property"),$i=require("@stdlib/utils/define-nonenumerable-read-only-property"),Od=require("@stdlib/utils/define-read-only-accessor"),DBe=require("@stdlib/utils/define-read-write-accessor"),XBe=Ba().factory,M6=require("@stdlib/buffer/from-string"),YBe=require("@stdlib/utils/next-tick"),HBe=require("@stdlib/string/format"),ZBe=_6(),QBe=R6(),xs=T6();function $Be(){return this._prng.seed}function KBe(){return this._prng.seedLength}function e9e(){return this._prng.stateLength}function r9e(){return this._prng.byteLength}function t9e(){return this._prng.state}function i9e(r){this._prng.state=r}function n9e(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return xs("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),xs("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=M6(e):e=M6(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function a9e(r){var e;if(this._destroyed)return xs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,YBe(t),this;function t(){r&&(xs("Stream was destroyed due to an error. Error: %s.",UBe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),xs("Closing the stream..."),e.emit("close")}}function Ie(r,e){var t,i;if(!(this instanceof Ie))return arguments.length>1?new Ie(r,e):new Ie(r);if(!JBe(r))throw new TypeError(HBe("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(t=CBe({},ZBe),arguments.length>1&&(i=QBe(t,e),i))throw i;return xs("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),x6.call(this,t),j6(this,"_destroyed",!1),$i(this,"_objectMode",t.objectMode),$i(this,"_sep",t.sep),$i(this,"_iter",t.iter),$i(this,"_siter",t.siter),j6(this,"_i",0),$i(this,"_prng",XBe(r,t)),$i(this,"PRNG",this._prng.PRNG),this}BBe(Ie,x6);Od(Ie.prototype,"seed",$Be);Od(Ie.prototype,"seedLength",KBe);DBe(Ie.prototype,"state",t9e,i9e);Od(Ie.prototype,"stateLength",e9e);Od(Ie.prototype,"byteLength",r9e);$i(Ie.prototype,"_read",n9e);$i(Ie.prototype,"destroy",a9e);A6.exports=Ie});var V6=s(function(Dnr,G6){"use strict";var s9e=require("@stdlib/assert/is-plain-object"),u9e=require("@stdlib/object/assign"),o9e=require("@stdlib/string/format"),v9e=Ed();function g9e(r,e){var t;if(arguments.length>1){if(t=e,!s9e(t))throw new TypeError(o9e("invalid argument. Options argument must be an object. Value: `%s`.",t));t=u9e({},e)}else t={};return t.objectMode=!0,new v9e(r,t)}G6.exports=g9e});var J6=s(function(Xnr,z6){"use strict";var f9e=require("@stdlib/assert/is-positive-number").isPrimitive,F6=require("@stdlib/assert/is-plain-object"),W6=require("@stdlib/object/assign"),I6=require("@stdlib/string/format"),k6=Ed();function d9e(r,e){var t,i,n;if(t=arguments.length,t>1){if(!F6(e))throw new TypeError(I6("invalid argument. Options argument must be an object. Value: `%s`.",e));n=u,i=W6({},e)}else if(t===1)if(f9e(r))n=u,i={};else{if(!F6(r))throw new TypeError(I6("invalid argument. Options argument must be an object. Value: `%s`.",r));i=W6({},r),n=a}else i={},n=a;return n;function a(o){return new k6(o,i)}function u(){return new k6(r,i)}}z6.exports=d9e});var B6=s(function(Ynr,C6){"use strict";var U6=require("@stdlib/utils/define-nonenumerable-read-only-property"),vh=Ed(),l9e=V6(),c9e=J6();U6(vh,"objectMode",l9e);U6(vh,"factory",c9e);C6.exports=vh});var D6=s(function(Hnr,m9e){m9e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var H6=s(function(Znr,Y6){"use strict";var h9e=require("@stdlib/assert/is-plain-object"),Mr=require("@stdlib/assert/has-own-property"),p9e=require("@stdlib/assert/is-boolean").isPrimitive,y9e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,X6=require("@stdlib/assert/is-string").isPrimitive,q9e=require("@stdlib/assert/is-positive-integer").isPrimitive,b9e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,aa=require("@stdlib/string/format");function w9e(r,e){return h9e(e)?Mr(e,"sep")&&(r.sep=e.sep,!X6(r.sep))?new TypeError(aa("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Mr(e,"objectMode")&&(r.objectMode=e.objectMode,!p9e(r.objectMode))?new TypeError(aa("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Mr(e,"encoding")&&(r.encoding=e.encoding,!X6(r.encoding)&&r.encoding!==null)?new TypeError(aa("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Mr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!y9e(r.highWaterMark))?new TypeError(aa("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Mr(e,"iter")&&(r.iter=e.iter,!b9e(r.iter))?new TypeError(aa("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Mr(e,"siter")&&(r.siter=e.siter,!q9e(r.siter))?new TypeError(aa("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(Mr(e,"prng")&&(r.prng=e.prng),Mr(e,"seed")&&(r.seed=e.seed),Mr(e,"state")&&(r.state=e.state),Mr(e,"copy")&&(r.copy=e.copy),null):new TypeError(aa("invalid argument. Options argument must be an object. Value: `%s`.",e))}Y6.exports=w9e});var Q6=s(function(Qnr,Z6){"use strict";var S9e=require("debug"),O9e=S9e("random:streams:triangular");Z6.exports=O9e});var Ld=s(function($nr,r4){"use strict";var e4=require("readable-stream").Readable,gh=require("@stdlib/assert/is-number").isPrimitive,fh=require("@stdlib/math/base/assert/is-nan"),E9e=require("@stdlib/assert/is-error"),_9e=require("@stdlib/object/assign"),N9e=require("@stdlib/utils/inherit"),$6=require("@stdlib/utils/define-nonenumerable-property"),Ki=require("@stdlib/utils/define-nonenumerable-read-only-property"),Nd=require("@stdlib/utils/define-read-only-accessor"),L9e=require("@stdlib/utils/define-read-write-accessor"),R9e=Da().factory,K6=require("@stdlib/buffer/from-string"),P9e=require("@stdlib/utils/next-tick"),_d=require("@stdlib/string/format"),T9e=D6(),j9e=H6(),As=Q6();function M9e(){return this._prng.seed}function x9e(){return this._prng.seedLength}function A9e(){return this._prng.stateLength}function G9e(){return this._prng.byteLength}function V9e(){return this._prng.state}function F9e(r){this._prng.state=r}function W9e(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return As("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),As("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=K6(e):e=K6(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function I9e(r){var e;if(this._destroyed)return As("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,P9e(t),this;function t(){r&&(As("Stream was destroyed due to an error. Error: %s.",E9e(r)?r.message:JSON.stringify(r)),e.emit("error",r)),As("Closing the stream..."),e.emit("close")}}function ke(r,e,t,i){var n,a;if(!(this instanceof ke))return arguments.length>3?new ke(r,e,t,i):new ke(r,e,t);if(!gh(r)||fh(r))throw new TypeError(_d("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!gh(e)||fh(e))throw new TypeError(_d("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e));if(!gh(t)||fh(t))throw new TypeError(_d("invalid argument. Third argument must be a number and not NaN. Value: `%s`.",t));if(!(r<=t&&t<=e))throw new RangeError(_d("invalid arguments. Parameters must satisfy the following condition: %s. a: `%f`. b: `%f`. c: `%f`.","a <= c <= b",r,e,t));if(n=_9e({},T9e),arguments.length>3&&(a=j9e(n,i),a))throw a;return As("Creating a readable stream configured with the following options: %s.",JSON.stringify(n)),e4.call(this,n),$6(this,"_destroyed",!1),Ki(this,"_objectMode",n.objectMode),Ki(this,"_sep",n.sep),Ki(this,"_iter",n.iter),Ki(this,"_siter",n.siter),$6(this,"_i",0),Ki(this,"_prng",R9e(r,e,t,n)),Ki(this,"PRNG",this._prng.PRNG),this}N9e(ke,e4);Nd(ke.prototype,"seed",M9e);Nd(ke.prototype,"seedLength",x9e);L9e(ke.prototype,"state",V9e,F9e);Nd(ke.prototype,"stateLength",A9e);Nd(ke.prototype,"byteLength",G9e);Ki(ke.prototype,"_read",W9e);Ki(ke.prototype,"destroy",I9e);r4.exports=ke});var i4=s(function(Knr,t4){"use strict";var k9e=require("@stdlib/assert/is-plain-object"),z9e=require("@stdlib/object/assign"),J9e=require("@stdlib/string/format"),U9e=Ld();function C9e(r,e,t,i){var n;if(arguments.length>3){if(n=i,!k9e(n))throw new TypeError(J9e("invalid argument. Options argument must be an object. Value: `%s`.",n));n=z9e({},i)}else n={};return n.objectMode=!0,new U9e(r,e,t,n)}t4.exports=C9e});var v4=s(function(ear,o4){"use strict";var n4=require("@stdlib/assert/is-plain-object"),a4=require("@stdlib/object/assign"),s4=require("@stdlib/string/format"),u4=Ld();function B9e(r,e,t,i){var n,a,u;if(n=arguments.length,n===1){if(!n4(r))throw new TypeError(s4("invalid argument. Options argument must be an object. Value: `%s`.",r));a=a4({},r)}else if(n>3){if(!n4(i))throw new TypeError(s4("invalid argument. Options argument must be an object. Value: `%s`.",i));a=a4({},i)}else a={};return n<3?u=o:u=v,u;function o(g,c,l){return new u4(g,c,l,a)}function v(){return new u4(r,e,t,a)}}o4.exports=B9e});var d4=s(function(rar,f4){"use strict";var g4=require("@stdlib/utils/define-nonenumerable-read-only-property"),dh=Ld(),D9e=i4(),X9e=v4();g4(dh,"objectMode",D9e);g4(dh,"factory",X9e);f4.exports=dh});var l4=s(function(tar,Y9e){Y9e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var h4=s(function(iar,m4){"use strict";var H9e=require("@stdlib/assert/is-plain-object"),xr=require("@stdlib/assert/has-own-property"),Z9e=require("@stdlib/assert/is-boolean").isPrimitive,Q9e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,c4=require("@stdlib/assert/is-string").isPrimitive,$9e=require("@stdlib/assert/is-positive-integer").isPrimitive,K9e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,sa=require("@stdlib/string/format");function eDe(r,e){return H9e(e)?xr(e,"sep")&&(r.sep=e.sep,!c4(r.sep))?new TypeError(sa("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):xr(e,"objectMode")&&(r.objectMode=e.objectMode,!Z9e(r.objectMode))?new TypeError(sa("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):xr(e,"encoding")&&(r.encoding=e.encoding,!c4(r.encoding)&&r.encoding!==null)?new TypeError(sa("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):xr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!Q9e(r.highWaterMark))?new TypeError(sa("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):xr(e,"iter")&&(r.iter=e.iter,!K9e(r.iter))?new TypeError(sa("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):xr(e,"siter")&&(r.siter=e.siter,!$9e(r.siter))?new TypeError(sa("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(xr(e,"prng")&&(r.prng=e.prng),xr(e,"seed")&&(r.seed=e.seed),xr(e,"state")&&(r.state=e.state),xr(e,"copy")&&(r.copy=e.copy),null):new TypeError(sa("invalid argument. Options argument must be an object. Value: `%s`.",e))}m4.exports=eDe});var y4=s(function(nar,p4){"use strict";var rDe=require("debug"),tDe=rDe("random:streams:uniform");p4.exports=tDe});var Pd=s(function(aar,E4){"use strict";var O4=require("readable-stream").Readable,q4=require("@stdlib/assert/is-number").isPrimitive,b4=require("@stdlib/math/base/assert/is-nan"),iDe=require("@stdlib/assert/is-error"),nDe=require("@stdlib/object/assign"),aDe=require("@stdlib/utils/inherit"),w4=require("@stdlib/utils/define-nonenumerable-property"),en=require("@stdlib/utils/define-nonenumerable-read-only-property"),Rd=require("@stdlib/utils/define-read-only-accessor"),sDe=require("@stdlib/utils/define-read-write-accessor"),uDe=yn().factory,S4=require("@stdlib/buffer/from-string"),oDe=require("@stdlib/utils/next-tick"),lh=require("@stdlib/string/format"),vDe=l4(),gDe=h4(),Gs=y4();function fDe(){return this._prng.seed}function dDe(){return this._prng.seedLength}function lDe(){return this._prng.stateLength}function cDe(){return this._prng.byteLength}function mDe(){return this._prng.state}function hDe(r){this._prng.state=r}function pDe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Gs("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Gs("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=S4(e):e=S4(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function yDe(r){var e;if(this._destroyed)return Gs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,oDe(t),this;function t(){r&&(Gs("Stream was destroyed due to an error. Error: %s.",iDe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Gs("Closing the stream..."),e.emit("close")}}function ze(r,e,t){var i,n;if(!(this instanceof ze))return arguments.length>2?new ze(r,e,t):new ze(r,e);if(!q4(r)||b4(r))throw new TypeError(lh("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!q4(e)||b4(e))throw new TypeError(lh("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e));if(r>=e)throw new RangeError(lh("invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.",r,e));if(i=nDe({},vDe),arguments.length>2&&(n=gDe(i,t),n))throw n;return Gs("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),O4.call(this,i),w4(this,"_destroyed",!1),en(this,"_objectMode",i.objectMode),en(this,"_sep",i.sep),en(this,"_iter",i.iter),en(this,"_siter",i.siter),w4(this,"_i",0),en(this,"_prng",uDe(r,e,i)),en(this,"PRNG",this._prng.PRNG),this}aDe(ze,O4);Rd(ze.prototype,"seed",fDe);Rd(ze.prototype,"seedLength",dDe);sDe(ze.prototype,"state",mDe,hDe);Rd(ze.prototype,"stateLength",lDe);Rd(ze.prototype,"byteLength",cDe);en(ze.prototype,"_read",pDe);en(ze.prototype,"destroy",yDe);E4.exports=ze});var N4=s(function(sar,_4){"use strict";var qDe=require("@stdlib/assert/is-plain-object"),bDe=require("@stdlib/object/assign"),wDe=require("@stdlib/string/format"),SDe=Pd();function ODe(r,e,t){var i;if(arguments.length>2){if(i=t,!qDe(i))throw new TypeError(wDe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=bDe({},t)}else i={};return i.objectMode=!0,new SDe(r,e,i)}_4.exports=ODe});var M4=s(function(uar,j4){"use strict";var L4=require("@stdlib/assert/is-plain-object"),R4=require("@stdlib/object/assign"),P4=require("@stdlib/string/format"),T4=Pd();function EDe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!L4(r))throw new TypeError(P4("invalid argument. Options argument must be an object. Value: `%s`.",r));n=R4({},r)}else if(i>2){if(!L4(t))throw new TypeError(P4("invalid argument. Options argument must be an object. Value: `%s`.",t));n=R4({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new T4(v,g,n)}function o(){return new T4(r,e,n)}}j4.exports=EDe});var G4=s(function(oar,A4){"use strict";var x4=require("@stdlib/utils/define-nonenumerable-read-only-property"),ch=Pd(),_De=N4(),NDe=M4();x4(ch,"objectMode",_De);x4(ch,"factory",NDe);A4.exports=ch});var V4=s(function(gar,LDe){LDe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var I4=s(function(far,W4){"use strict";var RDe=require("@stdlib/assert/is-plain-object"),Ar=require("@stdlib/assert/has-own-property"),PDe=require("@stdlib/assert/is-boolean").isPrimitive,TDe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,F4=require("@stdlib/assert/is-string").isPrimitive,jDe=require("@stdlib/assert/is-positive-integer").isPrimitive,MDe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,ua=require("@stdlib/string/format");function xDe(r,e){return RDe(e)?Ar(e,"sep")&&(r.sep=e.sep,!F4(r.sep))?new TypeError(ua("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Ar(e,"objectMode")&&(r.objectMode=e.objectMode,!PDe(r.objectMode))?new TypeError(ua("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Ar(e,"encoding")&&(r.encoding=e.encoding,!F4(r.encoding)&&r.encoding!==null)?new TypeError(ua("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Ar(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!TDe(r.highWaterMark))?new TypeError(ua("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Ar(e,"iter")&&(r.iter=e.iter,!MDe(r.iter))?new TypeError(ua("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Ar(e,"siter")&&(r.siter=e.siter,!jDe(r.siter))?new TypeError(ua("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(Ar(e,"prng")&&(r.prng=e.prng),Ar(e,"seed")&&(r.seed=e.seed),Ar(e,"state")&&(r.state=e.state),Ar(e,"copy")&&(r.copy=e.copy),null):new TypeError(ua("invalid argument. Options argument must be an object. Value: `%s`.",e))}W4.exports=xDe});var z4=s(function(dar,k4){"use strict";var ADe=require("debug"),GDe=ADe("random:streams:weibull");k4.exports=GDe});var jd=s(function(lar,X4){"use strict";var D4=require("readable-stream").Readable,J4=require("@stdlib/assert/is-positive-number").isPrimitive,VDe=require("@stdlib/assert/is-error"),FDe=require("@stdlib/object/assign"),WDe=require("@stdlib/utils/inherit"),U4=require("@stdlib/utils/define-nonenumerable-property"),rn=require("@stdlib/utils/define-nonenumerable-read-only-property"),Td=require("@stdlib/utils/define-read-only-accessor"),IDe=require("@stdlib/utils/define-read-write-accessor"),kDe=qn().factory,C4=require("@stdlib/buffer/from-string"),B4=require("@stdlib/string/format"),zDe=require("@stdlib/utils/next-tick"),JDe=V4(),UDe=I4(),Vs=z4();function CDe(){return this._prng.seed}function BDe(){return this._prng.seedLength}function DDe(){return this._prng.stateLength}function XDe(){return this._prng.byteLength}function YDe(){return this._prng.state}function HDe(r){this._prng.state=r}function ZDe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Vs("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Vs("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=C4(e):e=C4(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function QDe(r){var e;if(this._destroyed)return Vs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,zDe(t),this;function t(){r&&(Vs("Stream was destroyed due to an error. Error: %s.",VDe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Vs("Closing the stream..."),e.emit("close")}}function Je(r,e,t){var i,n;if(!(this instanceof Je))return arguments.length>2?new Je(r,e,t):new Je(r,e);if(!J4(r))throw new TypeError(B4("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!J4(e))throw new TypeError(B4("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=FDe({},JDe),arguments.length>2&&(n=UDe(i,t),n))throw n;return Vs("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),D4.call(this,i),U4(this,"_destroyed",!1),rn(this,"_objectMode",i.objectMode),rn(this,"_sep",i.sep),rn(this,"_iter",i.iter),rn(this,"_siter",i.siter),U4(this,"_i",0),rn(this,"_prng",kDe(r,e,i)),rn(this,"PRNG",this._prng.PRNG),this}WDe(Je,D4);Td(Je.prototype,"seed",CDe);Td(Je.prototype,"seedLength",BDe);IDe(Je.prototype,"state",YDe,HDe);Td(Je.prototype,"stateLength",DDe);Td(Je.prototype,"byteLength",XDe);rn(Je.prototype,"_read",ZDe);rn(Je.prototype,"destroy",QDe);X4.exports=Je});var H4=s(function(car,Y4){"use strict";var $De=require("@stdlib/assert/is-plain-object"),KDe=require("@stdlib/object/assign"),e8e=require("@stdlib/string/format"),r8e=jd();function t8e(r,e,t){var i;if(arguments.length>2){if(i=t,!$De(i))throw new TypeError(e8e("invalid argument. Options argument must be an object. Value: `%s`.",i));i=KDe({},t)}else i={};return i.objectMode=!0,new r8e(r,e,i)}Y4.exports=t8e});var rH=s(function(mar,eH){"use strict";var Z4=require("@stdlib/assert/is-plain-object"),Q4=require("@stdlib/object/assign"),$4=require("@stdlib/string/format"),K4=jd();function i8e(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!Z4(r))throw new TypeError($4("invalid argument. Options argument must be an object. Value: `%s`.",r));n=Q4({},r)}else if(i>2){if(!Z4(t))throw new TypeError($4("invalid argument. Options argument must be an object. Value: `%s`.",t));n=Q4({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new K4(v,g,n)}function o(){return new K4(r,e,n)}}eH.exports=i8e});var nH=s(function(har,iH){"use strict";var tH=require("@stdlib/utils/define-nonenumerable-read-only-property"),mh=jd(),n8e=H4(),a8e=rH();tH(mh,"objectMode",n8e);tH(mh,"factory",a8e);iH.exports=mh});var sH=s(function(par,aH){"use strict";var P=require("@stdlib/utils/define-read-only-property"),L={};P(L,"arcsine",Nk());P(L,"bernoulli",Xk());P(L,"beta",hz());P(L,"betaprime",Iz());P(L,"binomial",u3());P(L,"boxMuller",E3());P(L,"cauchy",D3());P(L,"chi",lJ());P(L,"chisquare",AJ());P(L,"cosine",tU());P(L,"discreteUniform",EU());P(L,"erlang",DU());P(L,"exponential",lC());P(L,"f",VC());P(L,"frechet",nB());P(L,"gamma",LB());P(L,"geometric",YB());P(L,"gumbel",h9());P(L,"hypergeometric",F9());P(L,"improvedZiggurat",eD());P(L,"invgamma",OD());P(L,"kumaraswamy",DD());P(L,"laplace",c8());P(L,"levy",V8());P(L,"logistic",nX());P(L,"lognormal",NX());P(L,"minstd",CX());P(L,"minstdShuffle",o7());P(L,"mt19937",N7());P(L,"negativeBinomial",Y7());P(L,"normal",h5());P(L,"pareto1",I5());P(L,"poisson",sY());P(L,"randi",OY());P(L,"randn",kY());P(L,"randu",i6());P(L,"rayleigh",E6());P(L,"t",B6());P(L,"triangular",d4());P(L,"uniform",G4());P(L,"weibull",nH());aH.exports=L});var ph=s(function(yar,oH){"use strict";var uH=require("@stdlib/array/base/assert/is-accessor-array"),hh=nn();function s8e(r,e,t,i,n,a,u,o){var v,g,c;if(v={arity:0,fcn:null},u){if(e===0&&n===0)return uH(r)?g=r.get(t):g=r[t],uH(i)?c=i.get(a):c=i[a],v.fcn=hh.factory(g,c,o),v;v.fcn=hh.factory(o)}else v.fcn=hh;return v.arity+=2,v}oH.exports=s8e});var gH=s(function(qar,vH){"use strict";var u8e=require("@stdlib/strided/base/nullary"),o8e=require("@stdlib/strided/base/binary"),v8e=ph();function g8e(r,e,t,i,n,a,u,o){var v=v8e(e,t,0,i,n,0,arguments.length>7,o);return v.arity===0?(u8e([a],[r],[u],v.fcn),a):(o8e([e,i,a],[r],[t,n,u],v.fcn),a)}vH.exports=g8e});var dH=s(function(bar,fH){"use strict";var f8e=require("@stdlib/strided/base/nullary").ndarray,d8e=require("@stdlib/strided/base/binary").ndarray,l8e=ph();function c8e(r,e,t,i,n,a,u,o,v,g,c){var l=l8e(e,t,i,n,a,u,arguments.length>10,c);return l.arity===0?(f8e([o],[r],[v],[g],l.fcn),o):(d8e([e,n,o],[r],[t,a,v],[i,u,g],l.fcn),o)}fH.exports=c8e});var mH=s(function(war,cH){"use strict";var m8e=require("@stdlib/utils/define-nonenumerable-read-only-property"),lH=gH(),h8e=dH();m8e(lH,"ndarray",h8e);cH.exports=lH});var qH=s(function(Sar,yH){"use strict";var hH=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Md=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Fs=require("@stdlib/utils/define-nonenumerable-read-only-property"),p8e=require("@stdlib/assert/is-function"),y8e=require("@stdlib/assert/is-method-in"),q8e=require("@stdlib/assert/is-plain-object"),b8e=require("@stdlib/utils/constant-function"),w8e=require("@stdlib/utils/noop"),pH=require("@stdlib/strided/base/unary"),yh=require("@stdlib/string/format");function S8e(r){if(!p8e(r))throw new TypeError(yh("invalid argument. First argument must be a function. Value: `%s`.",r));if(!y8e(r,"factory"))throw new TypeError(yh("invalid argument. First argument must have a `%s` method.","factory"));return e;function e(){var t,i;if(arguments.length>0){if(i=arguments[0],!q8e(i))throw new TypeError(yh("invalid argument. Options argument must be an object. Value: `%s`.",i));t=r.factory(i)}else i={},t=r;return i&&i.prng?(Fs(n,"seed",null),Fs(n,"seedLength",null),hH(n,"state",b8e(null),w8e),Fs(n,"stateLength",null),Fs(n,"byteLength",null)):(Md(n,"seed",u),Md(n,"seedLength",o),hH(n,"state",c,l),Md(n,"stateLength",v),Md(n,"byteLength",g)),Fs(n,"PRNG",t.PRNG),Fs(n,"ndarray",a),n;function n(m,h,p,d,f){return pH([h,d],[m],[p,f],t),d}function a(m,h,p,d,f,y,q){return pH.ndarray([h,f],[m],[p,y],[d,q],t),f}function u(){return n.PRNG.seed}function o(){return n.PRNG.seedLength}function v(){return n.PRNG.stateLength}function g(){return n.PRNG.byteLength}function c(){return n.PRNG.state}function l(m){n.PRNG.state=m}}}yH.exports=S8e});var Ws=s(function(Oar,bH){"use strict";var O8e=qH();bH.exports=O8e});var qh=s(function(Ear,wH){"use strict";var E8e=Ws(),_8e=an(),N8e=E8e(_8e);wH.exports=N8e});var OH=s(function(_ar,SH){"use strict";var L8e=qh(),R8e=L8e();SH.exports=R8e});var NH=s(function(Nar,_H){"use strict";var P8e=require("@stdlib/utils/define-nonenumerable-read-only-property"),EH=OH(),T8e=qh();P8e(EH,"factory",T8e);_H.exports=EH});var wh=s(function(Lar,RH){"use strict";var LH=require("@stdlib/array/base/assert/is-accessor-array"),bh=un();function j8e(r,e,t,i,n,a,u,o){var v,g,c;if(v={arity:0,fcn:null},u){if(e===0&&n===0)return LH(r)?g=r.get(t):g=r[t],LH(i)?c=i.get(a):c=i[a],v.fcn=bh.factory(g,c,o),v;v.fcn=bh.factory(o)}else v.fcn=bh;return v.arity+=2,v}RH.exports=j8e});var TH=s(function(Rar,PH){"use strict";var M8e=require("@stdlib/strided/base/nullary"),x8e=require("@stdlib/strided/base/binary"),A8e=wh();function G8e(r,e,t,i,n,a,u,o){var v=A8e(e,t,0,i,n,0,arguments.length>7,o);return v.arity===0?(M8e([a],[r],[u],v.fcn),a):(x8e([e,i,a],[r],[t,n,u],v.fcn),a)}PH.exports=G8e});var MH=s(function(Par,jH){"use strict";var V8e=require("@stdlib/strided/base/nullary").ndarray,F8e=require("@stdlib/strided/base/binary").ndarray,W8e=wh();function I8e(r,e,t,i,n,a,u,o,v,g,c){var l=W8e(e,t,i,n,a,u,arguments.length>10,c);return l.arity===0?(V8e([o],[r],[v],[g],l.fcn),o):(F8e([e,n,o],[r],[t,a,v],[i,u,g],l.fcn),o)}jH.exports=I8e});var GH=s(function(Tar,AH){"use strict";var k8e=require("@stdlib/utils/define-nonenumerable-read-only-property"),xH=TH(),z8e=MH();k8e(xH,"ndarray",z8e);AH.exports=xH});var Oh=s(function(jar,FH){"use strict";var VH=require("@stdlib/array/base/assert/is-accessor-array"),Sh=on();function J8e(r,e,t,i,n,a,u,o){var v,g,c;if(v={arity:0,fcn:null},u){if(e===0&&n===0)return VH(r)?g=r.get(t):g=r[t],VH(i)?c=i.get(a):c=i[a],v.fcn=Sh.factory(g,c,o),v;v.fcn=Sh.factory(o)}else v.fcn=Sh;return v.arity+=2,v}FH.exports=J8e});var IH=s(function(Mar,WH){"use strict";var U8e=require("@stdlib/strided/base/nullary"),C8e=require("@stdlib/strided/base/binary"),B8e=Oh();function D8e(r,e,t,i,n,a,u,o){var v=B8e(e,t,0,i,n,0,arguments.length>7,o);return v.arity===0?(U8e([a],[r],[u],v.fcn),a):(C8e([e,i,a],[r],[t,n,u],v.fcn),a)}WH.exports=D8e});var zH=s(function(xar,kH){"use strict";var X8e=require("@stdlib/strided/base/nullary").ndarray,Y8e=require("@stdlib/strided/base/binary").ndarray,H8e=Oh();function Z8e(r,e,t,i,n,a,u,o,v,g,c){var l=H8e(e,t,i,n,a,u,arguments.length>10,c);return l.arity===0?(X8e([o],[r],[v],[g],l.fcn),o):(Y8e([e,n,o],[r],[t,a,v],[i,u,g],l.fcn),o)}kH.exports=Z8e});var CH=s(function(Aar,UH){"use strict";var Q8e=require("@stdlib/utils/define-nonenumerable-read-only-property"),JH=IH(),$8e=zH();Q8e(JH,"ndarray",$8e);UH.exports=JH});var Eh=s(function(Gar,BH){"use strict";var K8e=Ws(),eXe=vn(),rXe=K8e(eXe);BH.exports=rXe});var XH=s(function(Var,DH){"use strict";var tXe=Eh(),iXe=tXe();DH.exports=iXe});var ZH=s(function(Far,HH){"use strict";var nXe=require("@stdlib/utils/define-nonenumerable-read-only-property"),YH=XH(),aXe=Eh();nXe(YH,"factory",aXe);HH.exports=YH});var _h=s(function(War,QH){"use strict";var sXe=Ws(),uXe=Xe(),oXe=sXe(uXe);QH.exports=oXe});var KH=s(function(Iar,$H){"use strict";var vXe=_h(),gXe=vXe();$H.exports=gXe});var tZ=s(function(kar,rZ){"use strict";var fXe=require("@stdlib/utils/define-nonenumerable-read-only-property"),eZ=KH(),dXe=_h();fXe(eZ,"factory",dXe);rZ.exports=eZ});var Lh=s(function(zar,nZ){"use strict";var iZ=require("@stdlib/array/base/assert/is-accessor-array"),Nh=gn();function lXe(r,e,t,i,n,a,u,o){var v,g,c;if(v={arity:0,fcn:null},u){if(e===0&&n===0)return iZ(r)?g=r.get(t):g=r[t],iZ(i)?c=i.get(a):c=i[a],v.fcn=Nh.factory(g,c,o),v;v.fcn=Nh.factory(o)}else v.fcn=Nh;return v.arity+=2,v}nZ.exports=lXe});var sZ=s(function(Jar,aZ){"use strict";var cXe=require("@stdlib/strided/base/nullary"),mXe=require("@stdlib/strided/base/binary"),hXe=Lh();function pXe(r,e,t,i,n,a,u,o){var v=hXe(e,t,0,i,n,0,arguments.length>7,o);return v.arity===0?(cXe([a],[r],[u],v.fcn),a):(mXe([e,i,a],[r],[t,n,u],v.fcn),a)}aZ.exports=pXe});var oZ=s(function(Uar,uZ){"use strict";var yXe=require("@stdlib/strided/base/nullary").ndarray,qXe=require("@stdlib/strided/base/binary").ndarray,bXe=Lh();function wXe(r,e,t,i,n,a,u,o,v,g,c){var l=bXe(e,t,i,n,a,u,arguments.length>10,c);return l.arity===0?(yXe([o],[r],[v],[g],l.fcn),o):(qXe([e,n,o],[r],[t,a,v],[i,u,g],l.fcn),o)}uZ.exports=wXe});var fZ=s(function(Car,gZ){"use strict";var SXe=require("@stdlib/utils/define-nonenumerable-read-only-property"),vZ=sZ(),OXe=oZ();SXe(vZ,"ndarray",OXe);gZ.exports=vZ});var Ph=s(function(Bar,lZ){"use strict";var dZ=require("@stdlib/array/base/assert/is-accessor-array"),Rh=fn();function EXe(r,e,t,i,n,a,u,o){var v,g,c;if(v={arity:0,fcn:null},u){if(e===0&&n===0)return dZ(r)?g=r.get(t):g=r[t],dZ(i)?c=i.get(a):c=i[a],v.fcn=Rh.factory(g,c,o),v;v.fcn=Rh.factory(o)}else v.fcn=Rh;return v.arity+=2,v}lZ.exports=EXe});var mZ=s(function(Dar,cZ){"use strict";var _Xe=require("@stdlib/strided/base/nullary"),NXe=require("@stdlib/strided/base/binary"),LXe=Ph();function RXe(r,e,t,i,n,a,u,o){var v=LXe(e,t,0,i,n,0,arguments.length>7,o);return v.arity===0?(_Xe([a],[r],[u],v.fcn),a):(NXe([e,i,a],[r],[t,n,u],v.fcn),a)}cZ.exports=RXe});var pZ=s(function(Xar,hZ){"use strict";var PXe=require("@stdlib/strided/base/nullary").ndarray,TXe=require("@stdlib/strided/base/binary").ndarray,jXe=Ph();function MXe(r,e,t,i,n,a,u,o,v,g,c){var l=jXe(e,t,i,n,a,u,arguments.length>10,c);return l.arity===0?(PXe([o],[r],[v],[g],l.fcn),o):(TXe([e,n,o],[r],[t,a,v],[i,u,g],l.fcn),o)}hZ.exports=MXe});var bZ=s(function(Yar,qZ){"use strict";var xXe=require("@stdlib/utils/define-nonenumerable-read-only-property"),yZ=mZ(),AXe=pZ();xXe(yZ,"ndarray",AXe);qZ.exports=yZ});var Th=s(function(Har,wZ){"use strict";var GXe=Ws(),VXe=dn(),FXe=GXe(VXe);wZ.exports=FXe});var OZ=s(function(Zar,SZ){"use strict";var WXe=Th(),IXe=WXe();SZ.exports=IXe});var NZ=s(function(Qar,_Z){"use strict";var kXe=require("@stdlib/utils/define-nonenumerable-read-only-property"),EZ=OZ(),zXe=Th();kXe(EZ,"factory",zXe);_Z.exports=EZ});var Mh=s(function($ar,RZ){"use strict";var LZ=require("@stdlib/array/base/assert/is-accessor-array"),jh=Ce();function JXe(r,e,t,i,n,a,u,o){var v,g,c;if(v={arity:0,fcn:null},u){if(e===0&&n===0)return LZ(r)?g=r.get(t):g=r[t],LZ(i)?c=i.get(a):c=i[a],v.fcn=jh.factory(g,c,o),v;v.fcn=jh.factory(o)}else v.fcn=jh;return v.arity+=2,v}RZ.exports=JXe});var TZ=s(function(Kar,PZ){"use strict";var UXe=require("@stdlib/strided/base/nullary"),CXe=require("@stdlib/strided/base/binary"),BXe=Mh();function DXe(r,e,t,i,n,a,u,o){var v=BXe(e,t,0,i,n,0,arguments.length>7,o);return v.arity===0?(UXe([a],[r],[u],v.fcn),a):(CXe([e,i,a],[r],[t,n,u],v.fcn),a)}PZ.exports=DXe});var MZ=s(function(esr,jZ){"use strict";var XXe=require("@stdlib/strided/base/nullary").ndarray,YXe=require("@stdlib/strided/base/binary").ndarray,HXe=Mh();function ZXe(r,e,t,i,n,a,u,o,v,g,c){var l=HXe(e,t,i,n,a,u,arguments.length>10,c);return l.arity===0?(XXe([o],[r],[v],[g],l.fcn),o):(YXe([e,n,o],[r],[t,a,v],[i,u,g],l.fcn),o)}jZ.exports=ZXe});var GZ=s(function(rsr,AZ){"use strict";var QXe=require("@stdlib/utils/define-nonenumerable-read-only-property"),xZ=TZ(),$Xe=MZ();QXe(xZ,"ndarray",$Xe);AZ.exports=xZ});var xh=s(function(tsr,VZ){"use strict";var KXe=Ws(),e7e=ln(),r7e=KXe(e7e);VZ.exports=r7e});var WZ=s(function(isr,FZ){"use strict";var t7e=xh(),i7e=t7e();FZ.exports=i7e});var zZ=s(function(nsr,kZ){"use strict";var n7e=require("@stdlib/utils/define-nonenumerable-read-only-property"),IZ=WZ(),a7e=xh();n7e(IZ,"factory",a7e);kZ.exports=IZ});var Gh=s(function(asr,UZ){"use strict";var JZ=require("@stdlib/array/base/assert/is-accessor-array"),Ah=cn();function s7e(r,e,t,i,n,a,u,o){var v,g,c;if(v={arity:0,fcn:null},u){if(e===0&&n===0)return JZ(r)?g=r.get(t):g=r[t],JZ(i)?c=i.get(a):c=i[a],v.fcn=Ah.factory(g,c,o),v;v.fcn=Ah.factory(o)}else v.fcn=Ah;return v.arity+=2,v}UZ.exports=s7e});var BZ=s(function(ssr,CZ){"use strict";var u7e=require("@stdlib/strided/base/nullary"),o7e=require("@stdlib/strided/base/binary"),v7e=Gh();function g7e(r,e,t,i,n,a,u,o){var v=v7e(e,t,0,i,n,0,arguments.length>7,o);return v.arity===0?(u7e([a],[r],[u],v.fcn),a):(o7e([e,i,a],[r],[t,n,u],v.fcn),a)}CZ.exports=g7e});var XZ=s(function(usr,DZ){"use strict";var f7e=require("@stdlib/strided/base/nullary").ndarray,d7e=require("@stdlib/strided/base/binary").ndarray,l7e=Gh();function c7e(r,e,t,i,n,a,u,o,v,g,c){var l=l7e(e,t,i,n,a,u,arguments.length>10,c);return l.arity===0?(f7e([o],[r],[v],[g],l.fcn),o):(d7e([e,n,o],[r],[t,a,v],[i,u,g],l.fcn),o)}DZ.exports=c7e});var ZZ=s(function(osr,HZ){"use strict";var m7e=require("@stdlib/utils/define-nonenumerable-read-only-property"),YZ=BZ(),h7e=XZ();m7e(YZ,"ndarray",h7e);HZ.exports=YZ});var Fh=s(function(vsr,$Z){"use strict";var QZ=require("@stdlib/array/base/assert/is-accessor-array"),Vh=mn();function p7e(r,e,t,i,n,a,u,o){var v,g,c;if(v={arity:0,fcn:null},u){if(e===0&&n===0)return QZ(r)?g=r.get(t):g=r[t],QZ(i)?c=i.get(a):c=i[a],v.fcn=Vh.factory(g,c,o),v;v.fcn=Vh.factory(o)}else v.fcn=Vh;return v.arity+=2,v}$Z.exports=p7e});var eQ=s(function(gsr,KZ){"use strict";var y7e=require("@stdlib/strided/base/nullary"),q7e=require("@stdlib/strided/base/binary"),b7e=Fh();function w7e(r,e,t,i,n,a,u,o){var v=b7e(e,t,0,i,n,0,arguments.length>7,o);return v.arity===0?(y7e([a],[r],[u],v.fcn),a):(q7e([e,i,a],[r],[t,n,u],v.fcn),a)}KZ.exports=w7e});var tQ=s(function(fsr,rQ){"use strict";var S7e=require("@stdlib/strided/base/nullary").ndarray,O7e=require("@stdlib/strided/base/binary").ndarray,E7e=Fh();function _7e(r,e,t,i,n,a,u,o,v,g,c){var l=E7e(e,t,i,n,a,u,arguments.length>10,c);return l.arity===0?(S7e([o],[r],[v],[g],l.fcn),o):(O7e([e,n,o],[r],[t,a,v],[i,u,g],l.fcn),o)}rQ.exports=_7e});var aQ=s(function(dsr,nQ){"use strict";var N7e=require("@stdlib/utils/define-nonenumerable-read-only-property"),iQ=eQ(),L7e=tQ();N7e(iQ,"ndarray",L7e);nQ.exports=iQ});var oQ=s(function(lsr,uQ){"use strict";var R7e=require("@stdlib/strided/base/nullary"),sQ=$();function P7e(r,e,t,i){var n;return arguments.length>3?n=sQ.factory(i):n=sQ,R7e([e],[r],[t],n),e}uQ.exports=P7e});var fQ=s(function(csr,gQ){"use strict";var T7e=require("@stdlib/strided/base/nullary").ndarray,vQ=$();function j7e(r,e,t,i,n){var a;return arguments.length>4?a=vQ.factory(n):a=vQ,T7e([e],[r],[t],[i],a),e}gQ.exports=j7e});var cQ=s(function(msr,lQ){"use strict";var M7e=require("@stdlib/strided/base/nullary"),dQ=$();function x7e(r,e,t,i){var n;return arguments.length>3?n=dQ.factory(i):n=dQ,M7e([e],[r],[t],n.normalized),e}lQ.exports=x7e});var pQ=s(function(hsr,hQ){"use strict";var A7e=require("@stdlib/strided/base/nullary").ndarray,mQ=$();function G7e(r,e,t,i,n){var a;return arguments.length>4?a=mQ.factory(n):a=mQ,A7e([e],[r],[t],[i],a.normalized),e}hQ.exports=G7e});var bQ=s(function(psr,qQ){"use strict";var Wh=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ih=oQ(),V7e=fQ(),yQ=cQ(),F7e=pQ();Wh(Ih,"ndarray",V7e);Wh(Ih,"normalized",yQ);Wh(yQ,"ndarray",F7e);qQ.exports=Ih});var OQ=s(function(ysr,SQ){"use strict";var W7e=require("@stdlib/strided/base/nullary"),wQ=ee();function I7e(r,e,t,i){var n;return arguments.length>3?n=wQ.factory(i):n=wQ,W7e([e],[r],[t],n),e}SQ.exports=I7e});var NQ=s(function(qsr,_Q){"use strict";var k7e=require("@stdlib/strided/base/nullary").ndarray,EQ=ee();function z7e(r,e,t,i,n){var a;return arguments.length>4?a=EQ.factory(n):a=EQ,k7e([e],[r],[t],[i],a),e}_Q.exports=z7e});var PQ=s(function(bsr,RQ){"use strict";var J7e=require("@stdlib/strided/base/nullary"),LQ=ee();function U7e(r,e,t,i){var n;return arguments.length>3?n=LQ.factory(i):n=LQ,J7e([e],[r],[t],n.normalized),e}RQ.exports=U7e});var MQ=s(function(wsr,jQ){"use strict";var C7e=require("@stdlib/strided/base/nullary").ndarray,TQ=ee();function B7e(r,e,t,i,n){var a;return arguments.length>4?a=TQ.factory(n):a=TQ,C7e([e],[r],[t],[i],a.normalized),e}jQ.exports=B7e});var GQ=s(function(Ssr,AQ){"use strict";var kh=require("@stdlib/utils/define-nonenumerable-read-only-property"),zh=OQ(),D7e=NQ(),xQ=PQ(),X7e=MQ();kh(zh,"ndarray",D7e);kh(zh,"normalized",xQ);kh(xQ,"ndarray",X7e);AQ.exports=zh});var WQ=s(function(Osr,FQ){"use strict";var Y7e=require("@stdlib/strided/base/nullary"),VQ=T();function H7e(r,e,t,i){var n;return arguments.length>3?n=VQ.factory(i):n=VQ,Y7e([e],[r],[t],n),e}FQ.exports=H7e});var zQ=s(function(Esr,kQ){"use strict";var Z7e=require("@stdlib/strided/base/nullary").ndarray,IQ=T();function Q7e(r,e,t,i,n){var a;return arguments.length>4?a=IQ.factory(n):a=IQ,Z7e([e],[r],[t],[i],a),e}kQ.exports=Q7e});var CQ=s(function(_sr,UQ){"use strict";var $7e=require("@stdlib/strided/base/nullary"),JQ=T();function K7e(r,e,t,i){var n;return arguments.length>3?n=JQ.factory(i):n=JQ,$7e([e],[r],[t],n.normalized),e}UQ.exports=K7e});var XQ=s(function(Nsr,DQ){"use strict";var e5e=require("@stdlib/strided/base/nullary").ndarray,BQ=T();function r5e(r,e,t,i,n){var a;return arguments.length>4?a=BQ.factory(n):a=BQ,e5e([e],[r],[t],[i],a.normalized),e}DQ.exports=r5e});var ZQ=s(function(Lsr,HQ){"use strict";var Jh=require("@stdlib/utils/define-nonenumerable-read-only-property"),Uh=WQ(),t5e=zQ(),YQ=CQ(),i5e=XQ();Jh(Uh,"ndarray",t5e);Jh(Uh,"normalized",YQ);Jh(YQ,"ndarray",i5e);HQ.exports=Uh});var Bh=s(function(Rsr,$Q){"use strict";var QQ=require("@stdlib/array/base/assert/is-accessor-array"),Ch=pn();function n5e(r,e,t,i,n,a,u,o){var v,g,c;if(v={arity:0,fcn:null},u){if(e===0&&n===0)return QQ(r)?g=r.get(t):g=r[t],QQ(i)?c=i.get(a):c=i[a],v.fcn=Ch.factory(g,c,o),v;v.fcn=Ch.factory(o)}else v.fcn=Ch;return v.arity+=2,v}$Q.exports=n5e});var e$=s(function(Psr,KQ){"use strict";var a5e=require("@stdlib/strided/base/nullary"),s5e=require("@stdlib/strided/base/binary"),u5e=Bh();function o5e(r,e,t,i,n,a,u,o){var v=u5e(e,t,0,i,n,0,arguments.length>7,o);return v.arity===0?(a5e([a],[r],[u],v.fcn),a):(s5e([e,i,a],[r],[t,n,u],v.fcn),a)}KQ.exports=o5e});var t$=s(function(Tsr,r$){"use strict";var v5e=require("@stdlib/strided/base/nullary").ndarray,g5e=require("@stdlib/strided/base/binary").ndarray,f5e=Bh();function d5e(r,e,t,i,n,a,u,o,v,g,c){var l=f5e(e,t,i,n,a,u,arguments.length>10,c);return l.arity===0?(v5e([o],[r],[v],[g],l.fcn),o):(g5e([e,n,o],[r],[t,a,v],[i,u,g],l.fcn),o)}r$.exports=d5e});var a$=s(function(jsr,n$){"use strict";var l5e=require("@stdlib/utils/define-nonenumerable-read-only-property"),i$=e$(),c5e=t$();l5e(i$,"ndarray",c5e);n$.exports=i$});var o$=s(function(Msr,u$){"use strict";var m5e=require("@stdlib/strided/base/nullary"),s$=Tt();function h5e(r,e,t,i){var n;return arguments.length>3?n=s$.factory(i):n=s$,m5e([e],[r],[t],n),e}u$.exports=h5e});var f$=s(function(xsr,g$){"use strict";var p5e=require("@stdlib/strided/base/nullary").ndarray,v$=Tt();function y5e(r,e,t,i,n){var a;return arguments.length>4?a=v$.factory(n):a=v$,p5e([e],[r],[t],[i],a),e}g$.exports=y5e});var c$=s(function(Asr,l$){"use strict";var q5e=require("@stdlib/utils/define-nonenumerable-read-only-property"),d$=o$(),b5e=f$();q5e(d$,"ndarray",b5e);l$.exports=d$});var Xh=s(function(Gsr,h$){"use strict";var m$=require("@stdlib/array/base/assert/is-accessor-array"),Dh=yn();function w5e(r,e,t,i,n,a,u,o){var v,g,c;if(v={arity:0,fcn:null},u){if(e===0&&n===0)return m$(r)?g=r.get(t):g=r[t],m$(i)?c=i.get(a):c=i[a],v.fcn=Dh.factory(g,c,o),v;v.fcn=Dh.factory(o)}else v.fcn=Dh;return v.arity+=2,v}h$.exports=w5e});var y$=s(function(Vsr,p$){"use strict";var S5e=require("@stdlib/strided/base/nullary"),O5e=require("@stdlib/strided/base/binary"),E5e=Xh();function _5e(r,e,t,i,n,a,u,o){var v=E5e(e,t,0,i,n,0,arguments.length>7,o);return v.arity===0?(S5e([a],[r],[u],v.fcn),a):(O5e([e,i,a],[r],[t,n,u],v.fcn),a)}p$.exports=_5e});var b$=s(function(Fsr,q$){"use strict";var N5e=require("@stdlib/strided/base/nullary").ndarray,L5e=require("@stdlib/strided/base/binary").ndarray,R5e=Xh();function P5e(r,e,t,i,n,a,u,o,v,g,c){var l=R5e(e,t,i,n,a,u,arguments.length>10,c);return l.arity===0?(N5e([o],[r],[v],[g],l.fcn),o):(L5e([e,n,o],[r],[t,a,v],[i,u,g],l.fcn),o)}q$.exports=P5e});var O$=s(function(Wsr,S$){"use strict";var T5e=require("@stdlib/utils/define-nonenumerable-read-only-property"),w$=y$(),j5e=b$();T5e(w$,"ndarray",j5e);S$.exports=w$});var Hh=s(function(Isr,_$){"use strict";var E$=require("@stdlib/array/base/assert/is-accessor-array"),Yh=qn();function M5e(r,e,t,i,n,a,u,o){var v,g,c;if(v={arity:0,fcn:null},u){if(e===0&&n===0)return E$(r)?g=r.get(t):g=r[t],E$(i)?c=i.get(a):c=i[a],v.fcn=Yh.factory(g,c,o),v;v.fcn=Yh.factory(o)}else v.fcn=Yh;return v.arity+=2,v}_$.exports=M5e});var L$=s(function(ksr,N$){"use strict";var x5e=require("@stdlib/strided/base/nullary"),A5e=require("@stdlib/strided/base/binary"),G5e=Hh();function V5e(r,e,t,i,n,a,u,o){var v=G5e(e,t,0,i,n,0,arguments.length>7,o);return v.arity===0?(x5e([a],[r],[u],v.fcn),a):(A5e([e,i,a],[r],[t,n,u],v.fcn),a)}N$.exports=V5e});var P$=s(function(zsr,R$){"use strict";var F5e=require("@stdlib/strided/base/nullary").ndarray,W5e=require("@stdlib/strided/base/binary").ndarray,I5e=Hh();function k5e(r,e,t,i,n,a,u,o,v,g,c){var l=I5e(e,t,i,n,a,u,arguments.length>10,c);return l.arity===0?(F5e([o],[r],[v],[g],l.fcn),o):(W5e([e,n,o],[r],[t,a,v],[i,u,g],l.fcn),o)}R$.exports=k5e});var M$=s(function(Jsr,j$){"use strict";var z5e=require("@stdlib/utils/define-nonenumerable-read-only-property"),T$=L$(),J5e=P$();z5e(T$,"ndarray",J5e);j$.exports=T$});var A$=s(function(Usr,x$){"use strict";var k=require("@stdlib/utils/define-read-only-property"),I={};k(I,"arcsine",mH());k(I,"bernoulli",NH());k(I,"beta",GH());k(I,"betaprime",CH());k(I,"chi",ZH());k(I,"chisquare",tZ());k(I,"cosine",fZ());k(I,"discreteUniform",bZ());k(I,"exponential",NZ());k(I,"gamma",GZ());k(I,"geometric",zZ());k(I,"invgamma",ZZ());k(I,"lognormal",aQ());k(I,"minstd",bQ());k(I,"minstdShuffle",GQ());k(I,"mt19937",ZQ());k(I,"normal",a$());k(I,"randu",c$());k(I,"uniform",O$());k(I,"weibull",M$());x$.exports=I});var oa=require("@stdlib/utils/define-read-only-property"),tn={};oa(tn,"array",yx());oa(tn,"base",v1());oa(tn,"iterators",qI());oa(tn,"sample",UI());oa(tn,"shuffle",ik());oa(tn,"streams",sH());oa(tn,"strided",A$());module.exports=tn; +"use strict";var s=function(r,e){return function(){return e||r((e={exports:{}}).exports,e),e.exports}};var Kh=s(function(nYe,$h){"use strict";var U$=require("@stdlib/assert/is-plain-object"),C$=require("@stdlib/assert/has-own-property"),B$=require("@stdlib/array/base/assert/contains"),Qh=require("@stdlib/string/format");function D$(r,e,t){return U$(t)?C$(t,"dtype")&&(r.dtype=t.dtype,!B$(e,r.dtype))?new TypeError(Qh('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",e.join('", "'),r.dtype)):null:new TypeError(Qh("invalid argument. Options argument must be an object. Value: `%s`.",t))}$h.exports=D$});var ip=s(function(aYe,tp){"use strict";var ep=require("@stdlib/utils/define-nonenumerable-read-only-property"),X$=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Y$=require("@stdlib/assert/is-function"),H$=require("@stdlib/assert/is-string-array").primitives,Z$=require("@stdlib/assert/is-collection"),Q$=require("@stdlib/array/base/assert/contains"),$$=require("@stdlib/array/base/filled-by"),rp=require("@stdlib/strided/base/binary"),K$=require("@stdlib/array/ctors"),Is=require("@stdlib/string/format"),eK=Kh();function ks(r,e,t){if(!(this instanceof ks))return new ks(r,e,t);if(!Y$(r))throw new TypeError(Is("invalid argument. First argument must be a function. Value: `%s`.",r));if(!H$(e))throw new TypeError(Is("invalid argument. Second argument must be an array of strings. Value: `%s`.",e));if(!Q$(e,t))throw new TypeError(Is("invalid argument. Third argument must be a supported data type. Value: `%s`.",t));return this._prng=r,this._dtypes=e,this._dtype=t,this}ep(ks.prototype,"generate",function(e,t,i,n){var a,u,o,v,g,c;if(!X$(e))throw new TypeError(Is("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",e));if(u={},arguments.length>3&&(g=eK(u,this._dtypes,n),g))throw g;if(o=this._prng,c=u.dtype||this._dtype,c==="generic")return $$(e,l);return a=K$(c),v=new a(e),rp([[t],[i],v],[e],[0,0,1],o),v;function l(){return o(t,i)}});ep(ks.prototype,"assign",function(e,t,i){if(!Z$(i))throw new TypeError(Is("invalid argument. Third argument must be an array-like object. Value: `%s`.",i));return rp([[e],[t],i],[i.length],[0,0,1],this._prng),i});tp.exports=ks});var ap=s(function(sYe,np){"use strict";var rK=ip();np.exports=rK});var op=s(function(uYe,up){"use strict";var tK=require("@stdlib/assert/is-plain-object"),iK=require("@stdlib/assert/has-own-property"),nK=require("@stdlib/array/base/assert/contains"),sp=require("@stdlib/string/format");function aK(r,e,t){return tK(t)?iK(t,"dtype")&&(r.dtype=t.dtype,!nK(e,r.dtype))?new TypeError(sp('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",e.join('", "'),r.dtype)):null:new TypeError(sp("invalid argument. Options argument must be an object. Value: `%s`.",t))}up.exports=aK});var dp=s(function(oYe,fp){"use strict";var vp=require("@stdlib/utils/define-nonenumerable-read-only-property"),sK=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,uK=require("@stdlib/assert/is-function"),oK=require("@stdlib/assert/is-string-array").primitives,vK=require("@stdlib/assert/is-collection"),gK=require("@stdlib/array/base/assert/contains"),fK=require("@stdlib/array/base/filled-by"),gp=require("@stdlib/strided/base/nullary"),dK=require("@stdlib/array/ctors"),zs=require("@stdlib/string/format"),lK=op();function Js(r,e,t){if(!(this instanceof Js))return new Js(r,e,t);if(!uK(r))throw new TypeError(zs("invalid argument. First argument must be a function. Value: `%s`.",r));if(!oK(e))throw new TypeError(zs("invalid argument. Second argument must be an array of strings. Value: `%s`.",e));if(!gK(e,t))throw new TypeError(zs("invalid argument. Third argument must be a supported data type. Value: `%s`.",t));return this._prng=r,this._dtypes=e,this._dtype=t,this}vp(Js.prototype,"generate",function(e,t){var i,n,a,u,o;if(!sK(e))throw new TypeError(zs("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",e));if(n={},arguments.length>1&&(u=lK(n,this._dtypes,t),u))throw u;return o=n.dtype||this._dtype,o==="generic"?fK(e,this._prng):(i=dK(o),a=new i(e),gp([a],[e],[1],this._prng),a)});vp(Js.prototype,"assign",function(e){if(!vK(e))throw new TypeError(zs("invalid argument. First argument must be an array-like object. Value: `%s`.",e));return gp([e],[e.length],[1],this._prng),e});fp.exports=Js});var Nu=s(function(vYe,lp){"use strict";var cK=dp();lp.exports=cK});var pp=s(function(gYe,hp){"use strict";var cp=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Lu=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),ga=require("@stdlib/utils/define-nonenumerable-read-only-property"),mK=require("@stdlib/assert/is-string-array").primitives,hK=require("@stdlib/assert/is-function"),pK=require("@stdlib/assert/is-method-in"),yK=require("@stdlib/assert/has-own-property"),mp=require("@stdlib/array/base/assert/contains").factory,qK=require("@stdlib/utils/constant-function"),bK=require("@stdlib/utils/noop"),wK=ap(),SK=Nu(),Us=require("@stdlib/string/format");function OK(r,e,t){var i;if(!hK(r))throw new TypeError(Us("invalid argument. First argument must be a function. Value: `%s`.",r));if(!pK(r,"factory"))throw new TypeError(Us("invalid argument. First argument must have a `%s` method.","factory"));if(!mK(e))throw new TypeError(Us("invalid argument. Second argument must an array of strings. Value: `%s`.",e));if(!mp(e,t))throw new TypeError(Us("invalid argument. Third argument must be a supported data type. Value: `%s`.",t));return i=mp(e),n;function n(){var a,u,o,v,g,c,l,m,h,p;if(c=arguments.length,c<1?(m={},l=r,h=d):c===1?(m=arguments[0],l=r.factory(m),h=d):c===2?(o=arguments[0],v=arguments[1],m={},l=r.factory(o,v),h=f):(o=arguments[0],v=arguments[1],m=arguments[2],l=r.factory(o,v,m),h=f),yK(m,"dtype")){if(p=m.dtype,!i(p))throw new TypeError(Us('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",e.join('", "'),p))}else p=t;return h===d?(g=y,a=wK):(g=q,a=SK),u=new a(l,e,p),m&&m.prng?(ga(h,"seed",null),ga(h,"seedLength",null),cp(h,"state",qK(null),bK),ga(h,"stateLength",null),ga(h,"byteLength",null)):(Lu(h,"seed",b),Lu(h,"seedLength",w),cp(h,"state",J,x),Lu(h,"stateLength",S),Lu(h,"byteLength",W)),ga(h,"PRNG",l.PRNG),ga(h,"assign",g),h;function d(V,A,G,Ue){return arguments.length<4?u.generate(V,A,G):u.generate(V,A,G,Ue)}function f(V,A){return arguments.length<2?u.generate(V):u.generate(V,A)}function y(V,A,G){return u.assign(V,A,G)}function q(V){return u.assign(V)}function b(){return h.PRNG.seed}function w(){return h.PRNG.seedLength}function S(){return h.PRNG.stateLength}function W(){return h.PRNG.byteLength}function J(){return h.PRNG.state}function x(V){h.PRNG.state=V}}}hp.exports=OK});var F=s(function(fYe,yp){"use strict";var EK=pp();yp.exports=EK});var xd=s(function(dYe,qp){"use strict";var _K=require("@stdlib/constants/uint32/max"),NK=require("@stdlib/math/base/special/floor"),LK=_K-1;function RK(){var r=NK(1+LK*Math.random());return r>>>0}qp.exports=RK});var zd=s(function(lYe,Tp){"use strict";var Gr=require("@stdlib/utils/define-nonenumerable-read-only-property"),ft=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),bp=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Ad=require("@stdlib/assert/has-own-property"),PK=require("@stdlib/assert/is-plain-object"),TK=require("@stdlib/assert/is-collection"),wp=require("@stdlib/assert/is-uint32array"),jK=require("@stdlib/assert/is-boolean").isPrimitive,Sp=require("@stdlib/assert/is-positive-integer").isPrimitive,Lp=require("@stdlib/constants/float64/max-safe-integer"),Rp=require("@stdlib/constants/uint32/max"),U=require("@stdlib/array/uint32"),MK=require("@stdlib/math/base/special/max"),kd=require("@stdlib/math/base/ops/umul"),fa=require("@stdlib/blas/base/gcopy"),xK=require("@stdlib/array/to-json"),B=require("@stdlib/string/format"),Op=xd(),z=624,Gd=397,Ep=Rp>>>0,AK=19650218,Vd=2147483648,Fd=2147483647,GK=1812433253,VK=1664525,FK=1566083941,WK=2636928640,IK=4022730752,kK=2567483615,Wd=[0,kK>>>0],Pp=1/(Lp+1),zK=67108864,JK=2147483648,Id=1,UK=Lp*Pp,Ru=1,Pu=3,dt=2,lt=z+3,C=z+5,Cs=z+6;function _p(r,e){var t;return e?t="option":t="argument",r.length>>0,i=1;i>>0,t=(t^t>>>30)>>>0,r[i]=kd(t,GK)+i>>>0;return r}function CK(r,e,t,i){var n,a,u,o;for(a=1,u=0,o=MK(e,i);o>0;o--)n=r[a-1]>>>0,n=(n^n>>>30)>>>0,n=kd(n,VK)>>>0,r[a]=(r[a]>>>0^n)+t[u]+u>>>0,a+=1,u+=1,a>=e&&(r[0]=r[e-1],a=1),u>=i&&(u=0);for(o=e-1;o>0;o--)n=r[a-1]>>>0,n=(n^n>>>30)>>>0,n=kd(n,FK)>>>0,r[a]=(r[a]>>>0^n)-a>>>0,a+=1,a>=e&&(r[0]=r[e-1],a=1);return r[0]=JK,r}function BK(r){var e,t,i,n;for(n=z-Gd,t=0;t>>1^Wd[e&Id];for(i=z-1;t>>1^Wd[e&Id];return e=r[i]&Vd|r[0]&Fd,r[i]=r[Gd-1]^e>>>1^Wd[e&Id],r}function DK(r){var e,t,i,n,a,u;if(i={},arguments.length){if(!PK(r))throw new TypeError(B("invalid argument. Options argument must be an object. Value: `%s`.",r));if(Ad(r,"copy")&&(i.copy=r.copy,!jK(r.copy)))throw new TypeError(B("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",r.copy));if(Ad(r,"state")){if(t=r.state,i.state=!0,!wp(t))throw new TypeError(B("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",t));if(u=_p(t,!0),u)throw u;i.copy===!1?e=t:(e=new U(t.length),fa(t.length,t,1,e,1)),t=new U(e.buffer,e.byteOffset+(dt+1)*e.BYTES_PER_ELEMENT,z),n=new U(e.buffer,e.byteOffset+(C+1)*e.BYTES_PER_ELEMENT,t[C])}if(n===void 0)if(Ad(r,"seed"))if(n=r.seed,i.seed=!0,Sp(n)){if(n>Ep)throw new RangeError(B("invalid option. `%s` option must be a positive integer less than or equal to the maximum unsigned 32-bit integer. Option: `%u`.","seed",n));n>>>=0}else{if(TK(n)===!1||n.length<1)throw new TypeError(B("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",n));if(n.length===1){if(n=n[0],!Sp(n))throw new TypeError(B("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",n));if(n>Ep)throw new RangeError(B("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",n));n>>>=0}else a=n.length,e=new U(Cs+a),e[0]=Ru,e[1]=Pu,e[dt]=z,e[lt]=1,e[lt+1]=z,e[C]=a,fa.ndarray(a,n,1,0,e,1,C+1),t=new U(e.buffer,e.byteOffset+(dt+1)*e.BYTES_PER_ELEMENT,z),n=new U(e.buffer,e.byteOffset+(C+1)*e.BYTES_PER_ELEMENT,a),t=Np(t,z,AK),t=CK(t,z,n,a)}else n=Op()>>>0}else n=Op()>>>0;return t===void 0&&(e=new U(Cs+1),e[0]=Ru,e[1]=Pu,e[dt]=z,e[lt]=1,e[lt+1]=z,e[C]=1,e[C+1]=n,t=new U(e.buffer,e.byteOffset+(dt+1)*e.BYTES_PER_ELEMENT,z),n=new U(e.buffer,e.byteOffset+(C+1)*e.BYTES_PER_ELEMENT,1),t=Np(t,z,n)),Gr(p,"NAME","mt19937"),ft(p,"seed",o),ft(p,"seedLength",v),bp(p,"state",l,m),ft(p,"stateLength",g),ft(p,"byteLength",c),Gr(p,"toJSON",h),Gr(p,"MIN",0),Gr(p,"MAX",Rp),Gr(p,"normalized",d),Gr(d,"NAME",p.NAME),ft(d,"seed",o),ft(d,"seedLength",v),bp(d,"state",l,m),ft(d,"stateLength",g),ft(d,"byteLength",c),Gr(d,"toJSON",h),Gr(d,"MIN",0),Gr(d,"MAX",UK),p;function o(){var f=e[C];return fa(f,n,1,new U(f),1)}function v(){return e[C]}function g(){return e.length}function c(){return e.byteLength}function l(){var f=e.length;return fa(f,e,1,new U(f),1)}function m(f){var y;if(!wp(f))throw new TypeError(B("invalid argument. Must provide a Uint32Array. Value: `%s`.",f));if(y=_p(f,!1),y)throw y;i.copy===!1?i.state&&f.length===e.length?fa(f.length,f,1,e,1):(e=f,i.state=!0):(f.length!==e.length&&(e=new U(f.length)),fa(f.length,f,1,e,1)),t=new U(e.buffer,e.byteOffset+(dt+1)*e.BYTES_PER_ELEMENT,z),n=new U(e.buffer,e.byteOffset+(C+1)*e.BYTES_PER_ELEMENT,e[C])}function h(){var f={};return f.type="PRNG",f.name=p.NAME,f.state=xK(e),f.params=[],f}function p(){var f,y;return y=e[lt+1],y>=z&&(t=BK(t),y=0),f=t[y],e[lt+1]=y+1,f^=f>>>11,f^=f<<7&WK,f^=f<<15&IK,f^=f>>>18,f>>>0}function d(){var f=p()>>>5,y=p()>>>6;return(f*zK+y)*Pp}}Tp.exports=DK});var Mp=s(function(cYe,jp){"use strict";var XK=zd(),YK=xd(),HK=XK({seed:YK()});jp.exports=HK});var T=s(function(mYe,Ap){"use strict";var ZK=require("@stdlib/utils/define-nonenumerable-read-only-property"),xp=Mp(),QK=zd();ZK(xp,"factory",QK);Ap.exports=xp});var Wp=s(function(hYe,Fp){"use strict";var Gp=require("@stdlib/assert/is-number").isPrimitive,Jd=require("@stdlib/string/format"),Vp=require("@stdlib/assert/is-nan");function $K(r,e){return!Gp(r)||Vp(r)?new TypeError(Jd("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):!Gp(e)||Vp(e)?new TypeError(Jd("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e)):r>=e?new RangeError(Jd("invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.",r,e)):null}Fp.exports=$K});var kp=s(function(pYe,Ip){"use strict";var KK=require("@stdlib/math/base/special/pow"),eee=require("@stdlib/math/base/special/sin"),ree=require("@stdlib/constants/float64/half-pi");function tee(r,e,t){return e+KK(eee(ree*r()),2)*(t-e)}Ip.exports=tee});var Ud=s(function(yYe,Yp){"use strict";var Vr=require("@stdlib/utils/define-nonenumerable-read-only-property"),Tu=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),zp=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Jp=require("@stdlib/assert/is-plain-object"),Up=require("@stdlib/assert/is-function"),Cp=require("@stdlib/assert/has-own-property"),Bp=require("@stdlib/utils/constant-function"),iee=require("@stdlib/utils/noop"),ju=T().factory,Dp=require("@stdlib/math/base/assert/is-nan"),nee=require("@stdlib/array/to-json"),Mu=require("@stdlib/string/format"),aee=Wp(),Xp=kp();function see(){var r,e,t,i,n,a;if(arguments.length===0)e=ju();else if(arguments.length===1){if(r=arguments[0],!Jp(r))throw new TypeError(Mu("invalid argument. Options argument must be an object. Value: `%s`.",r));if(Cp(r,"prng")){if(!Up(r.prng))throw new TypeError(Mu("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=ju(r)}else{if(n=arguments[0],a=arguments[1],i=aee(n,a),i)throw i;if(arguments.length>2){if(r=arguments[2],!Jp(r))throw new TypeError(Mu("invalid argument. Options argument must be an object. Value: `%s`.",r));if(Cp(r,"prng")){if(!Up(r.prng))throw new TypeError(Mu("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=ju(r)}else e=ju()}return n===void 0?t=p:t=h,Vr(t,"NAME","arcsine"),r&&r.prng?(Vr(t,"seed",null),Vr(t,"seedLength",null),zp(t,"state",Bp(null),iee),Vr(t,"stateLength",null),Vr(t,"byteLength",null),Vr(t,"toJSON",Bp(null)),Vr(t,"PRNG",e)):(Tu(t,"seed",u),Tu(t,"seedLength",o),zp(t,"state",c,l),Tu(t,"stateLength",v),Tu(t,"byteLength",g),Vr(t,"toJSON",m),Vr(t,"PRNG",e),e=e.normalized),t;function u(){return e.seed}function o(){return e.seedLength}function v(){return e.stateLength}function g(){return e.byteLength}function c(){return e.state}function l(d){e.state=d}function m(){var d={};return d.type="PRNG",d.name=t.NAME,d.state=nee(e.state),n===void 0?d.params=[]:d.params=[n,a],d}function h(){return Xp(e,n,a)}function p(d,f){return Dp(d)||Dp(f)||d>=f?NaN:Xp(e,d,f)}}Yp.exports=see});var Zp=s(function(qYe,Hp){"use strict";var uee=Ud(),oee=uee();Hp.exports=oee});var an=s(function(bYe,$p){"use strict";var vee=require("@stdlib/utils/define-nonenumerable-read-only-property"),Qp=Zp(),gee=Ud();vee(Qp,"factory",gee);$p.exports=Qp});var Cd=s(function(wYe,Kp){"use strict";var fee=F(),dee=require("@stdlib/array/dtypes"),lee=require("@stdlib/array/defaults"),cee=an(),mee=dee("real_floating_point_and_generic"),hee=fee(cee,mee,lee.get("dtypes.real_floating_point"));Kp.exports=hee});var ry=s(function(SYe,ey){"use strict";var pee=Cd(),yee=pee();ey.exports=yee});var ny=s(function(OYe,iy){"use strict";var qee=require("@stdlib/utils/define-nonenumerable-read-only-property"),ty=ry(),bee=Cd();qee(ty,"factory",bee);iy.exports=ty});var uy=s(function(EYe,sy){"use strict";var wee=require("@stdlib/assert/is-plain-object"),See=require("@stdlib/assert/has-own-property"),Oee=require("@stdlib/array/base/assert/contains"),ay=require("@stdlib/string/format");function Eee(r,e,t){return wee(t)?See(t,"dtype")&&(r.dtype=t.dtype,!Oee(e,r.dtype))?new TypeError(ay('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",e.join('", "'),r.dtype)):null:new TypeError(ay("invalid argument. Options argument must be an object. Value: `%s`.",t))}sy.exports=Eee});var fy=s(function(_Ye,gy){"use strict";var oy=require("@stdlib/utils/define-nonenumerable-read-only-property"),_ee=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Nee=require("@stdlib/assert/is-function"),Lee=require("@stdlib/assert/is-string-array").primitives,Ree=require("@stdlib/assert/is-collection"),Pee=require("@stdlib/array/base/assert/contains"),Tee=require("@stdlib/array/base/filled-by"),vy=require("@stdlib/strided/base/unary"),jee=require("@stdlib/array/ctors"),Bs=require("@stdlib/string/format"),Mee=uy();function Ds(r,e,t){if(!(this instanceof Ds))return new Ds(r,e,t);if(!Nee(r))throw new TypeError(Bs("invalid argument. First argument must be a function. Value: `%s`.",r));if(!Lee(e))throw new TypeError(Bs("invalid argument. Second argument must be an array of strings. Value: `%s`.",e));if(!Pee(e,t))throw new TypeError(Bs("invalid argument. Third argument must be a supported data type. Value: `%s`.",t));return this._prng=r,this._dtypes=e,this._dtype=t,this}oy(Ds.prototype,"generate",function(e,t,i){var n,a,u,o,v,g;if(!_ee(e))throw new TypeError(Bs("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",e));if(a={},arguments.length>2&&(v=Mee(a,this._dtypes,i),v))throw v;if(u=this._prng,g=a.dtype||this._dtype,g==="generic")return Tee(e,c);return n=jee(g),o=new n(e),vy([[t],o],[e],[0,1],u),o;function c(){return u(t)}});oy(Ds.prototype,"assign",function(e,t){if(!Ree(t))throw new TypeError(Bs("invalid argument. Second argument must be an array-like object. Value: `%s`.",t));return vy([[e],t],[t.length],[0,1],this._prng),t});gy.exports=Ds});var ly=s(function(NYe,dy){"use strict";var xee=fy();dy.exports=xee});var py=s(function(LYe,hy){"use strict";var cy=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),xu=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),da=require("@stdlib/utils/define-nonenumerable-read-only-property"),Aee=require("@stdlib/assert/is-string-array").primitives,Gee=require("@stdlib/assert/is-function"),Vee=require("@stdlib/assert/is-method-in"),Fee=require("@stdlib/assert/is-plain-object"),Wee=require("@stdlib/assert/has-own-property"),my=require("@stdlib/array/base/assert/contains").factory,Iee=require("@stdlib/utils/constant-function"),kee=require("@stdlib/utils/noop"),zee=ly(),Jee=Nu(),Xs=require("@stdlib/string/format");function Uee(r,e,t){var i;if(!Gee(r))throw new TypeError(Xs("invalid argument. First argument must be a function. Value: `%s`.",r));if(!Vee(r,"factory"))throw new TypeError(Xs("invalid argument. First argument must have a `%s` method.","factory"));if(!Aee(e))throw new TypeError(Xs("invalid argument. Second argument must an array of strings. Value: `%s`.",e));if(!my(e,t))throw new TypeError(Xs("invalid argument. Third argument must be a supported data type. Value: `%s`.",t));return i=my(e),n;function n(){var a,u,o,v,g,c,l,m,h;if(g=arguments.length,g<1?(l={},c=r,m=p):g>1?(o=arguments[0],l=arguments[1],c=r.factory(o,l),m=d):Fee(arguments[0])?(l=arguments[0],c=r.factory(l),m=p):(o=arguments[0],l={},c=r.factory(o),m=d),Wee(l,"dtype")){if(h=l.dtype,!i(h))throw new TypeError(Xs('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",e.join('", "'),h))}else h=t;return m===p?(v=f,a=zee):(v=y,a=Jee),u=new a(c,e,h),l&&l.prng?(da(m,"seed",null),da(m,"seedLength",null),cy(m,"state",Iee(null),kee),da(m,"stateLength",null),da(m,"byteLength",null)):(xu(m,"seed",q),xu(m,"seedLength",b),cy(m,"state",W,J),xu(m,"stateLength",w),xu(m,"byteLength",S)),da(m,"PRNG",c.PRNG),da(m,"assign",v),m;function p(x,V,A){return arguments.length<3?u.generate(x,V):u.generate(x,V,A)}function d(x,V){return arguments.length<2?u.generate(x):u.generate(x,V)}function f(x,V){return u.assign(x,V)}function y(x){return u.assign(x)}function q(){return m.PRNG.seed}function b(){return m.PRNG.seedLength}function w(){return m.PRNG.stateLength}function S(){return m.PRNG.byteLength}function W(){return m.PRNG.state}function J(x){m.PRNG.state=x}}}hy.exports=Uee});var Fr=s(function(RYe,yy){"use strict";var Cee=py();yy.exports=Cee});var Bd=s(function(PYe,Ey){"use strict";var Wr=require("@stdlib/utils/define-nonenumerable-read-only-property"),Au=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),qy=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),by=require("@stdlib/assert/is-plain-object"),Bee=require("@stdlib/assert/is-probability").isPrimitive,wy=require("@stdlib/assert/is-function"),Sy=require("@stdlib/assert/has-own-property"),Oy=require("@stdlib/utils/constant-function"),Dee=require("@stdlib/utils/noop"),Gu=T().factory,Xee=require("@stdlib/math/base/assert/is-nan"),Yee=require("@stdlib/array/to-json"),Vu=require("@stdlib/string/format");function Hee(){var r,e,t,i;if(arguments.length===0)e=Gu();else if(arguments.length===1&&by(arguments[0]))if(r=arguments[0],Sy(r,"prng")){if(!wy(r.prng))throw new TypeError(Vu("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Gu(r);else{if(i=arguments[0],!Bee(i))throw new TypeError(Vu("invalid argument. First argument must be a probability. Value: `%s`.",i));if(arguments.length>1){if(r=arguments[1],!by(r))throw new TypeError(Vu("invalid argument. Options argument must be an object. Value: `%s`.",r));if(Sy(r,"prng")){if(!wy(r.prng))throw new TypeError(Vu("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Gu(r)}else e=Gu()}return i===void 0?t=m:t=l,Wr(t,"NAME","bernoulli"),r&&r.prng?(Wr(t,"seed",null),Wr(t,"seedLength",null),qy(t,"state",Oy(null),Dee),Wr(t,"stateLength",null),Wr(t,"byteLength",null),Wr(t,"toJSON",Oy(null)),Wr(t,"PRNG",e)):(Au(t,"seed",n),Au(t,"seedLength",a),qy(t,"state",v,g),Au(t,"stateLength",u),Au(t,"byteLength",o),Wr(t,"toJSON",c),Wr(t,"PRNG",e),e=e.normalized),t;function n(){return e.seed}function a(){return e.seedLength}function u(){return e.stateLength}function o(){return e.byteLength}function v(){return e.state}function g(h){e.state=h}function c(){var h={};return h.type="PRNG",h.name=t.NAME,h.state=Yee(e.state),i===void 0?h.params=[]:h.params=[i],h}function l(){return e()<=i?1:0}function m(h){return Xee(h)||h<0||h>1?NaN:e()<=h?1:0}}Ey.exports=Hee});var Ny=s(function(TYe,_y){"use strict";var Zee=Bd(),Qee=Zee();_y.exports=Qee});var sn=s(function(jYe,Ry){"use strict";var $ee=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ly=Ny(),Kee=Bd();$ee(Ly,"factory",Kee);Ry.exports=Ly});var Dd=s(function(MYe,Py){"use strict";var ere=Fr(),rre=require("@stdlib/array/dtypes"),tre=require("@stdlib/array/defaults"),ire=sn(),nre=rre("real_and_generic"),are=ere(ire,nre,tre.get("dtypes.real"));Py.exports=are});var jy=s(function(xYe,Ty){"use strict";var sre=Dd(),ure=sre();Ty.exports=ure});var Ay=s(function(AYe,xy){"use strict";var ore=require("@stdlib/utils/define-nonenumerable-read-only-property"),My=jy(),vre=Dd();ore(My,"factory",vre);xy.exports=My});var Wy=s(function(GYe,Fy){"use strict";var gre=require("@stdlib/math/base/special/sqrt"),Gy=require("@stdlib/math/base/special/exp"),fre=require("@stdlib/math/base/special/ln"),Vy=.00991256303526217;function dre(r,e){var t,i,n;for(i=Gy(-.5*e*e),t=[],t.push(Vy/i),t.push(e),n=2;n=0&&g<=1&&(v=r(),n=Hd(u,4),c=8*t-12,c=1-n/c,v<=c?i=!1:(c+=.5*Hd(n/(8*t-8),2),v=gq(v)&&(i=!1))));return g}fq.exports=kre});var cq=s(function(BYe,lq){"use strict";var zre=require("@stdlib/math/base/special/pow"),Iu=require("@stdlib/math/base/special/ln");function Jre(r,e,t,i){var n,a,u,o,v,g,c,l,m,h,p;for(o=t-1,v=i-1,g=o+v,c=g*Iu(g),u=o/g,n=.5/zre(g,.5),a=!0;a===!0;)l=e(),h=u+l*n,h>=0&&h<=1&&(m=r(),p=o*Iu(h/o),p+=v*Iu((1-h)/v),p+=c+.5*l*l,p>=Iu(m)&&(a=!1));return h}lq.exports=Jre});var pq=s(function(DYe,hq){"use strict";var Zd=require("@stdlib/math/base/special/exp"),mq=require("@stdlib/math/base/special/pow"),Qd=require("@stdlib/math/base/special/ln");function Ure(r,e,t){for(var i,n,a,u,o,v,g;;)if(u=r(),o=r(),v=mq(u,1/e),g=mq(o,1/t),a=v+g,a<=1)return a>0?v/a:(i=Qd(u)/e,n=Qd(o)/t,i>n?(n-=i,i=0):(i-=n,n=0),Zd(i-Qd(Zd(i)+Zd(n))))}hq.exports=Ure});var bq=s(function(XYe,qq){"use strict";var yq=vq(),Cre=dq(),Bre=cq(),Dre=pq();function Xre(r,e,t,i){var n,a;return t===i&&t>1.5?Cre(r,e,t):t>1&&i>1?Bre(r,e,t,i):t<1&&i<1?Dre(r,t,i):(n=yq(r,e,t),a=yq(r,e,i),n/(n+a))}qq.exports=Xre});var rl=s(function(YYe,Tq){"use strict";var Ir=require("@stdlib/utils/define-nonenumerable-read-only-property"),ku=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),wq=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Sq=require("@stdlib/assert/is-plain-object"),Oq=require("@stdlib/assert/is-boolean").isPrimitive,Eq=require("@stdlib/assert/is-function"),la=require("@stdlib/assert/has-own-property"),_q=require("@stdlib/utils/constant-function"),Yre=require("@stdlib/utils/noop"),Nq=Q().factory,zu=T().factory,Lq=require("@stdlib/math/base/assert/is-nan"),$d=require("@stdlib/blas/base/gcopy"),Kd=require("@stdlib/array/uint32"),el=require("@stdlib/assert/is-uint32array"),Rq=require("@stdlib/object/assign"),Hre=require("@stdlib/array/to-json"),kr=require("@stdlib/string/format"),Zre=nq(),Pq=bq();function Qre(){var r,e,t,i,n,a,u,o,v;if(o=!0,arguments.length===0)n={copy:!1},a=zu(n);else if(arguments.length===1){if(n=arguments[0],!Sq(n))throw new TypeError(kr("invalid argument. Options argument must be an object. Value: `%s`.",n));if(la(n,"copy")&&!Oq(n.copy))throw new TypeError(kr("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",n.copy));if(la(n,"prng")){if(!Eq(n.prng))throw new TypeError(kr("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",n.prng));a=n.prng}else{if(la(n,"state")&&!el(n.state))throw new TypeError(kr("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",n.state));n=Rq({},n),n.copy===!1?o=!1:n.state&&(n.state=$d(n.state.length,n.state,1,new Kd(n.state.length),1)),n.copy=!1,a=zu(n)}}else{if(t=arguments[0],i=arguments[1],v=Zre(t,i),v)throw v;if(arguments.length>2){if(n=arguments[2],!Sq(n))throw new TypeError(kr("invalid argument. Options argument must be an object. Value: `%s`.",n));if(la(n,"copy")&&!Oq(n.copy))throw new TypeError(kr("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",n.copy));if(la(n,"prng")){if(!Eq(n.prng))throw new TypeError(kr("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",n.prng));a=n.prng}else{if(la(n,"state")&&!el(n.state))throw new TypeError(kr("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",n.state));n=Rq({},n),n.copy===!1?o=!1:n.state&&(n.state=$d(n.state.length,n.state,1,new Kd(n.state.length),1)),n.copy=!1,a=zu(n)}}else n={copy:!1},a=zu(n)}return n&&n.prng?e=Nq({prng:n.prng}):(n.state?r=n.state:(r=a.state,a.state=r),e=Nq({state:r,copy:!1})),t===void 0?u=y:u=f,Ir(u,"NAME","beta"),n&&n.prng?(Ir(u,"seed",null),Ir(u,"seedLength",null),wq(u,"state",_q(null),Yre),Ir(u,"stateLength",null),Ir(u,"byteLength",null),Ir(u,"toJSON",_q(null)),Ir(u,"PRNG",a)):(ku(u,"seed",g),ku(u,"seedLength",c),wq(u,"state",h,p),ku(u,"stateLength",l),ku(u,"byteLength",m),Ir(u,"toJSON",d),Ir(u,"PRNG",a),a=a.normalized),u;function g(){return a.seed}function c(){return a.seedLength}function l(){return a.stateLength}function m(){return a.byteLength}function h(){return a.state}function p(q){if(!el(q))throw new TypeError(kr("invalid argument. Must provide a Uint32Array. Value: `%s`.",q));o&&(q=$d(q.length,q,1,new Kd(q.length),1)),a.state=q}function d(){var q={};return q.type="PRNG",q.name=u.NAME,q.state=Hre(a.state),t===void 0?q.params=[]:q.params=[t,i],q}function f(){return Pq(a,e,t,i)}function y(q,b){return Lq(q)||Lq(b)||q<=0||b<=0?NaN:Pq(a,e,q,b)}}Tq.exports=Qre});var Mq=s(function(HYe,jq){"use strict";var $re=rl(),Kre=$re();jq.exports=Kre});var on=s(function(ZYe,Aq){"use strict";var ete=require("@stdlib/utils/define-nonenumerable-read-only-property"),xq=Mq(),rte=rl();ete(xq,"factory",rte);Aq.exports=xq});var tl=s(function(QYe,Gq){"use strict";var tte=F(),ite=require("@stdlib/array/dtypes"),nte=require("@stdlib/array/defaults"),ate=on(),ste=ite("real_floating_point_and_generic"),ute=tte(ate,ste,nte.get("dtypes.real_floating_point"));Gq.exports=ute});var Fq=s(function($Ye,Vq){"use strict";var ote=tl(),vte=ote();Vq.exports=vte});var kq=s(function(KYe,Iq){"use strict";var gte=require("@stdlib/utils/define-nonenumerable-read-only-property"),Wq=Fq(),fte=tl();gte(Wq,"factory",fte);Iq.exports=Wq});var Cq=s(function(e6e,Uq){"use strict";var zq=require("@stdlib/assert/is-positive-number").isPrimitive,Jq=require("@stdlib/string/format");function dte(r,e){return zq(r)?zq(e)?null:new TypeError(Jq("invalid argument. Second argument must be a positive number. Value: `%s`.",e)):new TypeError(Jq("invalid argument. First argument must be a positive number. Value: `%s`.",r))}Uq.exports=dte});var Xq=s(function(r6e,Dq){"use strict";var Bq=require("@stdlib/math/base/special/ln");function lte(r,e,t,i,n){var a,u,o,v,g,c,l;for(a=!0;a;){do g=e(),l=1+n*g;while(l<=0);l*=l*l,u=g*g,o=1-.331*u*u,v=.5*u+i*(1-l+Bq(l)),c=r(),(c2){if(n=arguments[2],!Hq(n))throw new TypeError(Jr("invalid argument. Options argument must be an object. Value: `%s`.",n));if(ca(n,"copy")&&!Zq(n.copy))throw new TypeError(Jr("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",n.copy));if(ca(n,"prng")){if(!Qq(n.prng))throw new TypeError(Jr("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",n.prng));a=n.prng}else{if(ca(n,"state")&&!il(n.state))throw new TypeError(Jr("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",n.state));n=tb({},n),n.copy===!1?o=!1:n.state&&(n.state=al(n.state.length,n.state,1,new sl(n.state.length),1)),n.copy=!1,a=Uu(n)}}else n={copy:!1},a=Uu(n)}return n&&n.prng?t=Kq({prng:n.prng}):(n.state?r=n.state:(r=a.state,a.state=r),t=Kq({state:r,copy:!1})),e===void 0?u=w:(e>=1?(u=q,c=e-Bu):(u=b,c=e+1-Bu),g=1/nl(9*c)),zr(u,"NAME","gamma"),n&&n.prng?(zr(u,"seed",null),zr(u,"seedLength",null),Yq(u,"state",$q(null),cte),zr(u,"stateLength",null),zr(u,"byteLength",null),zr(u,"toJSON",$q(null)),zr(u,"PRNG",a)):(Ju(u,"seed",l),Ju(u,"seedLength",m),Yq(u,"state",d,f),Ju(u,"stateLength",h),Ju(u,"byteLength",p),zr(u,"toJSON",y),zr(u,"PRNG",a),a=a.normalized),u;function l(){return a.seed}function m(){return a.seedLength}function h(){return a.stateLength}function p(){return a.byteLength}function d(){return a.state}function f(S){if(!il(S))throw new TypeError(Jr("invalid argument. Must provide a Uint32Array. Value: `%s`.",S));o&&(S=al(S.length,S,1,new sl(S.length),1)),a.state=S}function y(){var S={};return S.type="PRNG",S.name=u.NAME,S.state=mte(a.state),e===void 0?S.params=[]:S.params=[e,i],S}function q(){return Cu(a,t,i,c,g)}function b(){return Cu(a,t,i,c,g)*rb(a(),1/e)}function w(S,W){var J,x;return eb(S)||eb(W)||S<=0||W<=0?NaN:S<1?(x=S+1-Bu,J=1/nl(9*x),Cu(a,t,W,x,J)*rb(a(),1/S)):(x=S-Bu,J=1/nl(9*x),Cu(a,t,W,x,J))}}ib.exports=pte});var ab=s(function(i6e,nb){"use strict";var yte=ul(),qte=yte();nb.exports=qte});var Ce=s(function(n6e,ub){"use strict";var bte=require("@stdlib/utils/define-nonenumerable-read-only-property"),sb=ab(),wte=ul();bte(sb,"factory",wte);ub.exports=sb});var fb=s(function(a6e,gb){"use strict";var ob=require("@stdlib/assert/is-positive-number").isPrimitive,vb=require("@stdlib/string/format");function Ste(r,e){return ob(r)?ob(e)?null:new TypeError(vb("invalid argument. Second argument must be a positive number. Value: `%s`.",e)):new TypeError(vb("invalid argument. First argument must be a positive number. Value: `%s`.",r))}gb.exports=Ste});var lb=s(function(s6e,db){"use strict";function Ote(r,e,t){return r(e,1)/r(t,1)}db.exports=Ote});var ol=s(function(u6e,bb){"use strict";var mt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Du=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),cb=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),mb=require("@stdlib/assert/is-plain-object"),hb=require("@stdlib/utils/constant-function"),Ete=require("@stdlib/utils/noop"),Xu=Ce().factory,pb=require("@stdlib/math/base/assert/is-nan"),_te=require("@stdlib/array/to-json"),yb=require("@stdlib/string/format"),Nte=fb(),qb=lb();function Lte(){var r,e,t,i,n,a,u;if(arguments.length===0)r=Xu();else if(arguments.length===1){if(i=arguments[0],!mb(i))throw new TypeError(yb("invalid argument. Options argument must be an object. Value: `%s`.",i));r=Xu(i)}else{if(e=arguments[0],t=arguments[1],u=Nte(e,t),u)throw u;if(arguments.length>2){if(i=arguments[2],!mb(i))throw new TypeError(yb("invalid argument. Options argument must be an object. Value: `%s`.",i));r=Xu(i)}else r=Xu()}return e===void 0?a=d:a=p,n=r.PRNG,mt(a,"NAME","betaprime"),i&&i.prng?(mt(a,"seed",null),mt(a,"seedLength",null),cb(a,"state",hb(null),Ete),mt(a,"stateLength",null),mt(a,"byteLength",null),mt(a,"toJSON",hb(null))):(Du(a,"seed",o),Du(a,"seedLength",v),cb(a,"state",l,m),Du(a,"stateLength",g),Du(a,"byteLength",c),mt(a,"toJSON",h)),mt(a,"PRNG",n),a;function o(){return n.seed}function v(){return n.seedLength}function g(){return n.stateLength}function c(){return n.byteLength}function l(){return n.state}function m(f){n.state=f}function h(){var f={};return f.type="PRNG",f.name=a.NAME,f.state=_te(n.state),e===void 0?f.params=[]:f.params=[e,t],f}function p(){return qb(r,e,t)}function d(f,y){return pb(f)||pb(y)||f<=0||y<=0?NaN:qb(r,f,y)}}bb.exports=Lte});var Sb=s(function(o6e,wb){"use strict";var Rte=ol(),Pte=Rte();wb.exports=Pte});var vn=s(function(v6e,Eb){"use strict";var Tte=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ob=Sb(),jte=ol();Tte(Ob,"factory",jte);Eb.exports=Ob});var vl=s(function(g6e,_b){"use strict";var Mte=F(),xte=require("@stdlib/array/dtypes"),Ate=require("@stdlib/array/defaults"),Gte=vn(),Vte=xte("real_floating_point_and_generic"),Fte=Mte(Gte,Vte,Ate.get("dtypes.real_floating_point"));_b.exports=Fte});var Lb=s(function(f6e,Nb){"use strict";var Wte=vl(),Ite=Wte();Nb.exports=Ite});var Tb=s(function(d6e,Pb){"use strict";var kte=require("@stdlib/utils/define-nonenumerable-read-only-property"),Rb=Lb(),zte=vl();kte(Rb,"factory",zte);Pb.exports=Rb});var xb=s(function(l6e,Mb){"use strict";var Jte=require("@stdlib/assert/is-positive-integer").isPrimitive,Ute=require("@stdlib/assert/is-probability").isPrimitive,jb=require("@stdlib/string/format");function Cte(r,e){return Jte(r)?Ute(e)?null:new TypeError(jb("invalid argument. Second argument must be a probability. Value: `%s`.",e)):new TypeError(jb("invalid argument. First argument must be a positive integer. Value: `%s`.",e))}Mb.exports=Cte});var Gb=s(function(c6e,Ab){"use strict";function Bte(r,e,t){var i=0,n;for(n=0;n=p?A=r()-.5:(A=G/p-.93,A=Qte(A)*.5-A,G=p*r()),l=.5-fl(A),S=gl(A*(2*d/l+f)+y),!(S<0||S>e))if(G=G*i/(d/(l*l)+f),m=fl(S-W),m>15){if(G=Yu(G),o=m/u,v=(m/3+.625)*m,v+=Kte,v/=u,o*=v+.5,V=-(m*m)/(2*u),GS)for(w=S;w<=W;w++)G*=c/w-x;if(G<=q)return S}}}Wb.exports=eie});var Jb=s(function(p6e,zb){"use strict";var rie=Gb(),tie=Ib();function kb(r,e,t){return t>.5?e-kb(r,e,1-t):e*t<10?rie(r,e,t):tie(r,e,t)}zb.exports=kb});var dl=s(function(y6e,Zb){"use strict";var Ur=require("@stdlib/utils/define-nonenumerable-read-only-property"),Zu=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Ub=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Cb=require("@stdlib/assert/is-plain-object"),Bb=require("@stdlib/assert/is-function"),Db=require("@stdlib/assert/has-own-property"),Xb=require("@stdlib/utils/constant-function"),iie=require("@stdlib/utils/noop"),Yb=require("@stdlib/math/base/assert/is-nan"),nie=require("@stdlib/math/base/assert/is-positive-integer"),aie=require("@stdlib/math/base/assert/is-probability"),Qu=T().factory,sie=require("@stdlib/array/to-json"),$u=require("@stdlib/string/format"),uie=xb(),Hb=Jb();function oie(){var r,e,t,i,n,a;if(arguments.length===0)e=Qu();else if(arguments.length===1){if(r=arguments[0],!Cb(r))throw new TypeError($u("invalid argument. Options argument must be an object. Value: `%s`.",r));if(Db(r,"prng")){if(!Bb(r.prng))throw new TypeError($u("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Qu(r)}else{if(n=arguments[0],a=arguments[1],i=uie(n,a),i)throw i;if(arguments.length>2){if(r=arguments[2],!Cb(r))throw new TypeError($u("invalid argument. Options argument must be an object. Value: `%s`.",r));if(Db(r,"prng")){if(!Bb(r.prng))throw new TypeError($u("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Qu(r)}else e=Qu()}return n===void 0?t=p:t=h,Ur(t,"NAME","binomial"),r&&r.prng?(Ur(t,"seed",null),Ur(t,"seedLength",null),Ub(t,"state",Xb(null),iie),Ur(t,"stateLength",null),Ur(t,"byteLength",null),Ur(t,"toJSON",Xb(null)),Ur(t,"PRNG",e)):(Zu(t,"seed",u),Zu(t,"seedLength",o),Ub(t,"state",c,l),Zu(t,"stateLength",v),Zu(t,"byteLength",g),Ur(t,"toJSON",m),Ur(t,"PRNG",e),e=e.normalized),t;function u(){return e.seed}function o(){return e.seedLength}function v(){return e.stateLength}function g(){return e.byteLength}function c(){return e.state}function l(d){e.state=d}function m(){var d={};return d.type="PRNG",d.name=t.NAME,d.state=sie(e.state),n===void 0?d.params=[]:d.params=[n,a],d}function h(){return Hb(e,n,a)}function p(d,f){return Yb(d)||Yb(f)||!nie(d)||!aie(f)?NaN:Hb(e,d,f)}}Zb.exports=oie});var $b=s(function(q6e,Qb){"use strict";var vie=dl(),gie=vie();Qb.exports=gie});var ma=s(function(b6e,ew){"use strict";var fie=require("@stdlib/utils/define-nonenumerable-read-only-property"),Kb=$b(),die=dl();fie(Kb,"factory",die);ew.exports=Kb});var ll=s(function(w6e,rw){"use strict";var lie=F(),cie=require("@stdlib/array/dtypes"),mie=require("@stdlib/array/defaults"),hie=ma(),pie=cie("real_and_generic"),yie=lie(hie,pie,mie.get("dtypes.real"));rw.exports=yie});var iw=s(function(S6e,tw){"use strict";var qie=ll(),bie=qie();tw.exports=bie});var sw=s(function(O6e,aw){"use strict";var wie=require("@stdlib/utils/define-nonenumerable-read-only-property"),nw=iw(),Sie=ll();wie(nw,"factory",Sie);aw.exports=nw});var vw=s(function(E6e,ow){"use strict";var Oie=require("@stdlib/assert/is-number").isPrimitive,Eie=require("@stdlib/assert/is-positive-number").isPrimitive,uw=require("@stdlib/string/format"),_ie=require("@stdlib/assert/is-nan");function Nie(r,e){return!Oie(r)||_ie(r)?new TypeError(uw("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):Eie(e)?null:new TypeError(uw("invalid argument. Second argument must be a positive number. Value: `%s`.",e))}ow.exports=Nie});var fw=s(function(_6e,gw){"use strict";var Lie=require("@stdlib/math/base/special/tan"),Rie=require("@stdlib/constants/float64/pi");function Pie(r,e,t){return e+t*Lie(Rie*(r()-.5))}gw.exports=Pie});var cl=s(function(N6e,qw){"use strict";var ht=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ku=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),dw=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),lw=require("@stdlib/assert/is-plain-object"),cw=require("@stdlib/assert/is-function"),mw=require("@stdlib/assert/has-own-property"),hw=require("@stdlib/utils/constant-function"),Tie=require("@stdlib/utils/noop"),pw=require("@stdlib/math/base/assert/is-nan"),ha=Q().factory,jie=require("@stdlib/array/to-json"),eo=require("@stdlib/string/format"),Mie=vw(),yw=fw();function xie(){var r,e,t,i,n,a,u;if(arguments.length===0)e=ha();else if(arguments.length===1){if(t=arguments[0],!lw(t))throw new TypeError(eo("invalid argument. Options argument must be an object. Value: `%s`.",t));if(mw(t,"prng")){if(!cw(t.prng))throw new TypeError(eo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",t.prng));e=ha({prng:t.prng})}else e=ha(t)}else{if(u=arguments[0],r=arguments[1],a=Mie(u,r),a)throw a;if(arguments.length>2){if(t=arguments[2],!lw(t))throw new TypeError(eo("invalid argument. Options argument must be an object. Value: `%s`.",t));if(mw(t,"prng")){if(!cw(t.prng))throw new TypeError(eo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",t.prng));e=ha({prng:t.prng})}else e=ha(t)}else e=ha()}return u===void 0?n=d:n=p,i=e.PRNG,ht(n,"NAME","cauchy"),t&&t.prng?(ht(n,"seed",null),ht(n,"seedLength",null),dw(n,"state",hw(null),Tie),ht(n,"stateLength",null),ht(n,"byteLength",null),ht(n,"toJSON",hw(null))):(Ku(n,"seed",o),Ku(n,"seedLength",v),dw(n,"state",l,m),Ku(n,"stateLength",g),Ku(n,"byteLength",c),ht(n,"toJSON",h)),ht(n,"PRNG",i),n;function o(){return i.seed}function v(){return i.seedLength}function g(){return i.stateLength}function c(){return i.byteLength}function l(){return i.state}function m(f){i.state=f}function h(){var f={};return f.type="PRNG",f.name=n.NAME,f.state=jie(i.state),u===void 0?f.params=[]:f.params=[u,r],f}function p(){return yw(e,u,r)}function d(f,y){return pw(f)||pw(y)||y<=0?NaN:yw(e,f,y)}}qw.exports=xie});var ww=s(function(L6e,bw){"use strict";var Aie=cl(),Gie=Aie();bw.exports=Gie});var pa=s(function(R6e,Ow){"use strict";var Vie=require("@stdlib/utils/define-nonenumerable-read-only-property"),Sw=ww(),Fie=cl();Vie(Sw,"factory",Fie);Ow.exports=Sw});var ml=s(function(P6e,Ew){"use strict";var Wie=F(),Iie=require("@stdlib/array/dtypes"),kie=require("@stdlib/array/defaults"),zie=pa(),Jie=Iie("real_floating_point_and_generic"),Uie=Wie(zie,Jie,kie.get("dtypes.real_floating_point"));Ew.exports=Uie});var Nw=s(function(T6e,_w){"use strict";var Cie=ml(),Bie=Cie();_w.exports=Bie});var Pw=s(function(j6e,Rw){"use strict";var Die=require("@stdlib/utils/define-nonenumerable-read-only-property"),Lw=Nw(),Xie=ml();Die(Lw,"factory",Xie);Rw.exports=Lw});var hl=s(function(M6e,Gw){"use strict";var pt=require("@stdlib/utils/define-nonenumerable-read-only-property"),ro=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Tw=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Yie=require("@stdlib/assert/is-positive-number").isPrimitive,jw=require("@stdlib/assert/is-plain-object"),Mw=require("@stdlib/assert/is-function"),xw=require("@stdlib/assert/has-own-property"),Aw=require("@stdlib/utils/constant-function"),Hie=require("@stdlib/utils/noop"),Zie=require("@stdlib/math/base/assert/is-nan"),ya=Ce().factory,Qie=require("@stdlib/array/to-json"),to=require("@stdlib/string/format");function $ie(){var r,e,t,i,n;if(arguments.length===0)r=ya();else if(arguments.length===1&&jw(arguments[0]))if(t=arguments[0],xw(t,"prng")){if(!Mw(t.prng))throw new TypeError(to("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",t.prng));r=ya({prng:t.prng})}else r=ya(t);else{if(n=arguments[0],!Yie(n))throw new TypeError(to("invalid argument. First argument must be a positive number. Value: `%s`.",n));if(arguments.length>1){if(t=arguments[1],!jw(t))throw new TypeError(to("invalid argument. Options argument must be an object. Value: `%s`.",t));if(xw(t,"prng")){if(!Mw(t.prng))throw new TypeError(to("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",t.prng));r=ya(n/2,.5,{prng:t.prng})}else r=ya(n/2,.5,t)}else r=ya(n/2,.5)}return n===void 0?i=h:i=m,e=r.PRNG,pt(i,"NAME","chisquare"),t&&t.prng?(pt(i,"seed",null),pt(i,"seedLength",null),Tw(i,"state",Aw(null),Hie),pt(i,"stateLength",null),pt(i,"byteLength",null),pt(i,"toJSON",Aw(null))):(ro(i,"seed",a),ro(i,"seedLength",u),Tw(i,"state",g,c),ro(i,"stateLength",o),ro(i,"byteLength",v),pt(i,"toJSON",l)),pt(i,"PRNG",e),i;function a(){return e.seed}function u(){return e.seedLength}function o(){return e.stateLength}function v(){return e.byteLength}function g(){return e.state}function c(p){e.state=p}function l(){var p={};return p.type="PRNG",p.name=i.NAME,p.state=Qie(e.state),n===void 0?p.params=[]:p.params=[n],p}function m(){return r()}function h(p){return Zie(p)||p<=0?NaN:r(p/2,.5)}}Gw.exports=$ie});var Fw=s(function(x6e,Vw){"use strict";var Kie=hl(),ene=Kie();Vw.exports=ene});var Xe=s(function(A6e,Iw){"use strict";var rne=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ww=Fw(),tne=hl();rne(Ww,"factory",tne);Iw.exports=Ww});var pl=s(function(G6e,Dw){"use strict";var yt=require("@stdlib/utils/define-nonenumerable-read-only-property"),io=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),kw=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),ine=require("@stdlib/assert/is-positive-number").isPrimitive,zw=require("@stdlib/assert/is-plain-object"),Jw=require("@stdlib/assert/is-function"),Uw=require("@stdlib/assert/has-own-property"),Cw=require("@stdlib/utils/constant-function"),nne=require("@stdlib/utils/noop"),ane=require("@stdlib/math/base/assert/is-nan"),qa=Xe().factory,sne=require("@stdlib/array/to-json"),Bw=require("@stdlib/math/base/special/sqrt"),no=require("@stdlib/string/format");function une(){var r,e,t,i,n;if(arguments.length===0)r=qa();else if(arguments.length===1&&zw(arguments[0]))if(t=arguments[0],Uw(t,"prng")){if(!Jw(t.prng))throw new TypeError(no("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",t.prng));r=qa({prng:t.prng})}else r=qa(t);else{if(n=arguments[0],!ine(n))throw new TypeError(no("invalid argument. First argument must be a positive number. Value: `%s`.",n));if(arguments.length>1){if(t=arguments[1],!zw(t))throw new TypeError(no("invalid argument. Options argument must be an object. Value: `%s`.",t));if(Uw(t,"prng")){if(!Jw(t.prng))throw new TypeError(no("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",t.prng));r=qa(n,{prng:t.prng})}else r=qa(n,t)}else r=qa(n)}return n===void 0?i=h:i=m,e=r.PRNG,yt(i,"NAME","chi"),t&&t.prng?(yt(i,"seed",null),yt(i,"seedLength",null),kw(i,"state",Cw(null),nne),yt(i,"stateLength",null),yt(i,"byteLength",null),yt(i,"toJSON",Cw(null))):(io(i,"seed",a),io(i,"seedLength",u),kw(i,"state",g,c),io(i,"stateLength",o),io(i,"byteLength",v),yt(i,"toJSON",l)),yt(i,"PRNG",e),i;function a(){return e.seed}function u(){return e.seedLength}function o(){return e.stateLength}function v(){return e.byteLength}function g(){return e.state}function c(p){e.state=p}function l(){var p={};return p.type="PRNG",p.name=i.NAME,p.state=sne(e.state),n===void 0?p.params=[]:p.params=[n],p}function m(){return Bw(r())}function h(p){return ane(p)||p<=0?NaN:Bw(r(p))}}Dw.exports=une});var Yw=s(function(V6e,Xw){"use strict";var one=pl(),vne=one();Xw.exports=vne});var gn=s(function(F6e,Zw){"use strict";var gne=require("@stdlib/utils/define-nonenumerable-read-only-property"),Hw=Yw(),fne=pl();gne(Hw,"factory",fne);Zw.exports=Hw});var yl=s(function(W6e,Qw){"use strict";var dne=Fr(),lne=require("@stdlib/array/dtypes"),cne=require("@stdlib/array/defaults"),mne=gn(),hne=lne("real_floating_point_and_generic"),pne=dne(mne,hne,cne.get("dtypes.real_floating_point"));Qw.exports=pne});var Kw=s(function(I6e,$w){"use strict";var yne=yl(),qne=yne();$w.exports=qne});var tS=s(function(k6e,rS){"use strict";var bne=require("@stdlib/utils/define-nonenumerable-read-only-property"),eS=Kw(),wne=yl();bne(eS,"factory",wne);rS.exports=eS});var ql=s(function(z6e,iS){"use strict";var Sne=Fr(),One=require("@stdlib/array/dtypes"),Ene=require("@stdlib/array/defaults"),_ne=Xe(),Nne=One("real_floating_point_and_generic"),Lne=Sne(_ne,Nne,Ene.get("dtypes.real_floating_point"));iS.exports=Lne});var aS=s(function(J6e,nS){"use strict";var Rne=ql(),Pne=Rne();nS.exports=Pne});var oS=s(function(U6e,uS){"use strict";var Tne=require("@stdlib/utils/define-nonenumerable-read-only-property"),sS=aS(),jne=ql();Tne(sS,"factory",jne);uS.exports=sS});var fS=s(function(C6e,gS){"use strict";var Mne=require("@stdlib/assert/is-number").isPrimitive,xne=require("@stdlib/assert/is-positive-number").isPrimitive,vS=require("@stdlib/string/format"),Ane=require("@stdlib/assert/is-nan");function Gne(r,e){return!Mne(r)||Ane(r)?new TypeError(vS("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):xne(e)?null:new TypeError(vS("invalid argument. Second argument must be a positive number. Value: `%s`.",e))}gS.exports=Gne});var lS=s(function(B6e,dS){"use strict";var Vne=require("@stdlib/stats/base/dists/cosine/quantile");function Fne(r,e,t){return Vne(r(),e,t)}dS.exports=Fne});var bl=s(function(D6e,wS){"use strict";var Cr=require("@stdlib/utils/define-nonenumerable-read-only-property"),ao=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),cS=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),mS=require("@stdlib/assert/is-plain-object"),hS=require("@stdlib/assert/is-function"),pS=require("@stdlib/assert/has-own-property"),yS=require("@stdlib/utils/constant-function"),Wne=require("@stdlib/utils/noop"),so=T().factory,qS=require("@stdlib/math/base/assert/is-nan"),Ine=require("@stdlib/array/to-json"),uo=require("@stdlib/string/format"),kne=fS(),bS=lS();function zne(){var r,e,t,i,n,a;if(arguments.length===0)e=so();else if(arguments.length===1){if(r=arguments[0],!mS(r))throw new TypeError(uo("invalid argument. Options argument must be an object. Value: `%s`.",r));if(pS(r,"prng")){if(!hS(r.prng))throw new TypeError(uo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=so(r)}else{if(n=arguments[0],a=arguments[1],i=kne(n,a),i)throw i;if(arguments.length>2){if(r=arguments[2],!mS(r))throw new TypeError(uo("invalid argument. Options argument must be an object. Value: `%s`.",r));if(pS(r,"prng")){if(!hS(r.prng))throw new TypeError(uo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=so(r)}else e=so()}return n===void 0?t=p:t=h,Cr(t,"NAME","cosine"),r&&r.prng?(Cr(t,"seed",null),Cr(t,"seedLength",null),cS(t,"state",yS(null),Wne),Cr(t,"stateLength",null),Cr(t,"byteLength",null),Cr(t,"toJSON",yS(null)),Cr(t,"PRNG",e)):(ao(t,"seed",u),ao(t,"seedLength",o),cS(t,"state",c,l),ao(t,"stateLength",v),ao(t,"byteLength",g),Cr(t,"toJSON",m),Cr(t,"PRNG",e),e=e.normalized),t;function u(){return e.seed}function o(){return e.seedLength}function v(){return e.stateLength}function g(){return e.byteLength}function c(){return e.state}function l(d){e.state=d}function m(){var d={};return d.type="PRNG",d.name=t.NAME,d.state=Ine(e.state),n===void 0?d.params=[]:d.params=[n,a],d}function h(){return bS(e,n,a)}function p(d,f){return qS(d)||qS(f)||f<=0?NaN:bS(e,d,f)}}wS.exports=zne});var OS=s(function(X6e,SS){"use strict";var Jne=bl(),Une=Jne();SS.exports=Une});var fn=s(function(Y6e,_S){"use strict";var Cne=require("@stdlib/utils/define-nonenumerable-read-only-property"),ES=OS(),Bne=bl();Cne(ES,"factory",Bne);_S.exports=ES});var wl=s(function(H6e,NS){"use strict";var Dne=F(),Xne=require("@stdlib/array/dtypes"),Yne=require("@stdlib/array/defaults"),Hne=fn(),Zne=Xne("real_floating_point_and_generic"),Qne=Dne(Hne,Zne,Yne.get("dtypes.real_floating_point"));NS.exports=Qne});var RS=s(function(Z6e,LS){"use strict";var $ne=wl(),Kne=$ne();LS.exports=Kne});var jS=s(function(Q6e,TS){"use strict";var eae=require("@stdlib/utils/define-nonenumerable-read-only-property"),PS=RS(),rae=wl();eae(PS,"factory",rae);TS.exports=PS});var GS=s(function($6e,AS){"use strict";var MS=require("@stdlib/assert/is-integer").isPrimitive,Sl=require("@stdlib/string/format"),xS=require("@stdlib/assert/is-nan");function tae(r,e){return!MS(r)||xS(r)?new TypeError(Sl("invalid argument. First argument must be an integer and not NaN. Value: `%s`.",r)):!MS(e)||xS(e)?new TypeError(Sl("invalid argument. Second argument must be an integer and not NaN. Value: `%s`.",e)):r>e?new RangeError(Sl("invalid argument. Minimum support must be less than or equal to maximum support. Value: `[%d, %d]`.",r,e)):null}AS.exports=tae});var WS=s(function(K6e,FS){"use strict";var Ol=require("@stdlib/constants/float64/max-safe-integer"),ba=require("@stdlib/math/base/special/floor");function VS(r,e,t){var i,n,a,u,o,v,g,c,l;if(a=t-e,a===0)return e;if(g=r.MIN,c=r.MAX,n=c-g,n===a)return r()-g+e;if(nOl/v)&&(l*=v,i+=l,!(i>a)))return i+e}for(n===Ol?(o=ba(n/(a+1)),n%(a+1)===a&&(o+=1)):o=ba((n+1)/(a+1));;)if(i=r()-g,i=ba(i/o),i<=a)return i+e}FS.exports=VS});var El=s(function(e4e,DS){"use strict";var Br=require("@stdlib/utils/define-nonenumerable-read-only-property"),oo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),IS=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),kS=require("@stdlib/assert/is-plain-object"),zS=require("@stdlib/assert/is-function"),JS=require("@stdlib/assert/has-own-property"),US=require("@stdlib/utils/constant-function"),iae=require("@stdlib/utils/noop"),vo=T().factory,CS=require("@stdlib/math/base/assert/is-nan"),wa=require("@stdlib/math/base/assert/is-integer"),nae=require("@stdlib/array/to-json"),qt=require("@stdlib/string/format"),aae=GS(),BS=WS();function sae(){var r,e,t,i,n,a;if(arguments.length===0)e=vo();else if(arguments.length===1){if(r=arguments[0],!kS(r))throw new TypeError(qt("invalid argument. Options argument must be an object. Value: `%s`.",r));if(JS(r,"prng")){if(!zS(r.prng))throw new TypeError(qt("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));if(e=r.prng,!wa(e.MIN))throw new TypeError(qt("invalid option. `%s` option must have a `MIN` property specifying the minimum possible pseudorandom integer value.","prng"));if(!wa(e.MAX))throw new TypeError(qt("invalid option. `%s` option must have a `MAX` property specifying the maximum possible pseudorandom integer value.","prng"))}else e=vo(r)}else{if(n=arguments[0],a=arguments[1],i=aae(n,a),i)throw i;if(arguments.length>2){if(r=arguments[2],!kS(r))throw new TypeError(qt("invalid argument. Options argument must be an object. Value: `%s`.",r));if(JS(r,"prng")){if(!zS(r.prng))throw new TypeError(qt("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));if(e=r.prng,!wa(e.MIN))throw new TypeError(qt("invalid option. `%s` option must have a `MIN` property specifying the minimum possible pseudorandom integer value.","prng"));if(!wa(e.MAX))throw new TypeError(qt("invalid option. `%s` option must have a `MAX` property specifying the maximum possible pseudorandom integer value.","prng"))}else e=vo(r)}else e=vo()}return n===void 0?t=p:t=h,Br(t,"NAME","discrete-uniform"),r&&r.prng?(Br(t,"seed",null),Br(t,"seedLength",null),IS(t,"state",US(null),iae),Br(t,"stateLength",null),Br(t,"byteLength",null),Br(t,"toJSON",US(null)),Br(t,"PRNG",e)):(oo(t,"seed",u),oo(t,"seedLength",o),IS(t,"state",c,l),oo(t,"stateLength",v),oo(t,"byteLength",g),Br(t,"toJSON",m),Br(t,"PRNG",e)),t;function u(){return e.seed}function o(){return e.seedLength}function v(){return e.stateLength}function g(){return e.byteLength}function c(){return e.state}function l(d){e.state=d}function m(){var d={};return d.type="PRNG",d.name=t.NAME,d.state=nae(e.state),n===void 0?d.params=[]:d.params=[n,a],d}function h(){return BS(e,n,a)}function p(d,f){return CS(d)||CS(f)||!wa(d)||!wa(f)||d>f?NaN:BS(e,d,f)}}DS.exports=sae});var YS=s(function(r4e,XS){"use strict";var uae=El(),oae=uae();XS.exports=oae});var dn=s(function(t4e,ZS){"use strict";var vae=require("@stdlib/utils/define-nonenumerable-read-only-property"),HS=YS(),gae=El();vae(HS,"factory",gae);ZS.exports=HS});var _l=s(function(i4e,QS){"use strict";var fae=F(),dae=require("@stdlib/array/dtypes"),lae=require("@stdlib/array/defaults"),cae=dn(),mae=dae("real_and_generic"),hae=fae(cae,mae,lae.get("dtypes.real"));QS.exports=hae});var KS=s(function(n4e,$S){"use strict";var pae=_l(),yae=pae();$S.exports=yae});var tO=s(function(a4e,rO){"use strict";var qae=require("@stdlib/utils/define-nonenumerable-read-only-property"),eO=KS(),bae=_l();qae(eO,"factory",bae);rO.exports=eO});var aO=s(function(s4e,nO){"use strict";var wae=require("@stdlib/assert/is-positive-number").isPrimitive,Sae=require("@stdlib/assert/is-positive-integer").isPrimitive,iO=require("@stdlib/string/format");function Oae(r,e){return Sae(r)?wae(e)?null:new TypeError(iO("invalid argument. Second argument must be a positive number. Value: `%s`.",e)):new TypeError(iO("invalid argument. First argument must be a positive integer. Value: `%s`.",r))}nO.exports=Oae});var uO=s(function(u4e,sO){"use strict";var Eae=require("@stdlib/math/base/special/ln");function _ae(r,e,t){var i,n;for(i=1,n=0;n2){if(t=arguments[2],!vO(t))throw new TypeError(lo("invalid argument. Options argument must be an object. Value: `%s`.",t));if(fO(t,"prng")){if(!gO(t.prng))throw new TypeError(lo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",t.prng));e=t.prng}else e=fo(t)}else e=fo()}return a===void 0?i=p:i=h,Dr(i,"NAME","erlang"),t&&t.prng?(Dr(i,"seed",null),Dr(i,"seedLength",null),oO(i,"state",dO(null),Nae),Dr(i,"stateLength",null),Dr(i,"byteLength",null),Dr(i,"toJSON",dO(null)),Dr(i,"PRNG",e)):(go(i,"seed",u),go(i,"seedLength",o),oO(i,"state",c,l),go(i,"stateLength",v),go(i,"byteLength",g),Dr(i,"toJSON",m),Dr(i,"PRNG",e),e=e.normalized),i;function u(){return e.seed}function o(){return e.seedLength}function v(){return e.stateLength}function g(){return e.byteLength}function c(){return e.state}function l(d){e.state=d}function m(){var d={};return d.type="PRNG",d.name=i.NAME,d.state=Rae(e.state),a===void 0?d.params=[]:d.params=[a,r],d}function h(){return cO(e,a,r)}function p(d,f){return lO(d)||lO(f)||!Lae(d)||f<=0?NaN:cO(e,d,f)}}mO.exports=Tae});var pO=s(function(v4e,hO){"use strict";var jae=Nl(),Mae=jae();hO.exports=Mae});var Sa=s(function(g4e,qO){"use strict";var xae=require("@stdlib/utils/define-nonenumerable-read-only-property"),yO=pO(),Aae=Nl();xae(yO,"factory",Aae);qO.exports=yO});var Ll=s(function(f4e,bO){"use strict";var Gae=F(),Vae=require("@stdlib/array/dtypes"),Fae=require("@stdlib/array/defaults"),Wae=Sa(),Iae=Vae("real_floating_point_and_generic"),kae=Gae(Wae,Iae,Fae.get("dtypes.real_floating_point"));bO.exports=kae});var SO=s(function(d4e,wO){"use strict";var zae=Ll(),Jae=zae();wO.exports=Jae});var _O=s(function(l4e,EO){"use strict";var Uae=require("@stdlib/utils/define-nonenumerable-read-only-property"),OO=SO(),Cae=Ll();Uae(OO,"factory",Cae);EO.exports=OO});var LO=s(function(c4e,NO){"use strict";var Bae=require("@stdlib/math/base/special/ln");function Dae(r,e){return-Bae(1-r())/e}NO.exports=Dae});var Rl=s(function(m4e,AO){"use strict";var Xr=require("@stdlib/utils/define-nonenumerable-read-only-property"),co=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),RO=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Xae=require("@stdlib/assert/is-positive-number").isPrimitive,PO=require("@stdlib/assert/is-plain-object"),TO=require("@stdlib/assert/is-function"),jO=require("@stdlib/assert/has-own-property"),MO=require("@stdlib/utils/constant-function"),Yae=require("@stdlib/utils/noop"),mo=T().factory,Hae=require("@stdlib/math/base/assert/is-nan"),Zae=require("@stdlib/array/to-json"),ho=require("@stdlib/string/format"),xO=LO();function Qae(){var r,e,t,i;if(arguments.length===0)t=mo();else if(arguments.length===1&&PO(arguments[0]))if(e=arguments[0],jO(e,"prng")){if(!TO(e.prng))throw new TypeError(ho("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));t=e.prng}else t=mo(e);else{if(r=arguments[0],!Xae(r))throw new TypeError(ho("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(arguments.length>1){if(e=arguments[1],!PO(e))throw new TypeError(ho("invalid argument. Options argument must be an object. Value: `%s`.",e));if(jO(e,"prng")){if(!TO(e.prng))throw new TypeError(ho("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));t=e.prng}else t=mo(e)}else t=mo()}return r===void 0?i=m:i=l,Xr(i,"NAME","exponential"),e&&e.prng?(Xr(i,"seed",null),Xr(i,"seedLength",null),RO(i,"state",MO(null),Yae),Xr(i,"stateLength",null),Xr(i,"byteLength",null),Xr(i,"toJSON",MO(null)),Xr(i,"PRNG",t)):(co(i,"seed",n),co(i,"seedLength",a),RO(i,"state",v,g),co(i,"stateLength",u),co(i,"byteLength",o),Xr(i,"toJSON",c),Xr(i,"PRNG",t),t=t.normalized),i;function n(){return t.seed}function a(){return t.seedLength}function u(){return t.stateLength}function o(){return t.byteLength}function v(){return t.state}function g(h){t.state=h}function c(){var h={};return h.type="PRNG",h.name=i.NAME,h.state=Zae(t.state),r===void 0?h.params=[]:h.params=[r],h}function l(){return xO(t,r)}function m(h){return Hae(h)||h<=0?NaN:xO(t,h)}}AO.exports=Qae});var VO=s(function(h4e,GO){"use strict";var $ae=Rl(),Kae=$ae();GO.exports=Kae});var ln=s(function(p4e,WO){"use strict";var ese=require("@stdlib/utils/define-nonenumerable-read-only-property"),FO=VO(),rse=Rl();ese(FO,"factory",rse);WO.exports=FO});var Pl=s(function(y4e,IO){"use strict";var tse=Fr(),ise=require("@stdlib/array/dtypes"),nse=require("@stdlib/array/defaults"),ase=ln(),sse=ise("real_floating_point_and_generic"),use=tse(ase,sse,nse.get("dtypes.real_floating_point"));IO.exports=use});var zO=s(function(q4e,kO){"use strict";var ose=Pl(),vse=ose();kO.exports=vse});var CO=s(function(b4e,UO){"use strict";var gse=require("@stdlib/utils/define-nonenumerable-read-only-property"),JO=zO(),fse=Pl();gse(JO,"factory",fse);UO.exports=JO});var YO=s(function(w4e,XO){"use strict";var BO=require("@stdlib/assert/is-positive-number").isPrimitive,DO=require("@stdlib/string/format");function dse(r,e){return BO(r)?BO(e)?null:new TypeError(DO("invalid argument. Second argument must be a positive number. Value: `%s`.",e)):new TypeError(DO("invalid argument. First argument must be a positive number. Value: `%s`.",r))}XO.exports=dse});var ZO=s(function(S4e,HO){"use strict";function lse(r,e,t){var i=r(e)/e,n=r(t)/t;return i/n}HO.exports=lse});var Tl=s(function(O4e,nE){"use strict";var bt=require("@stdlib/utils/define-nonenumerable-read-only-property"),po=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),QO=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),$O=require("@stdlib/assert/is-plain-object"),KO=require("@stdlib/assert/is-function"),eE=require("@stdlib/assert/has-own-property"),rE=require("@stdlib/utils/constant-function"),cse=require("@stdlib/utils/noop"),Oa=Xe().factory,tE=require("@stdlib/math/base/assert/is-nan"),mse=require("@stdlib/array/to-json"),yo=require("@stdlib/string/format"),hse=YO(),iE=ZO();function pse(){var r,e,t,i,n,a,u;if(arguments.length===0)r=Oa();else if(arguments.length===1){if(e=arguments[0],!$O(e))throw new TypeError(yo("invalid argument. Options argument must be an object. Value: `%s`.",e));if(eE(e,"prng")){if(!KO(e.prng))throw new TypeError(yo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));r=Oa({prng:e.prng})}else r=Oa(e)}else{if(a=arguments[0],u=arguments[1],n=hse(a,u),n)throw n;if(arguments.length>2){if(e=arguments[2],!$O(e))throw new TypeError(yo("invalid argument. Options argument must be an object. Value: `%s`.",e));if(eE(e,"prng")){if(!KO(e.prng))throw new TypeError(yo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));r=Oa({prng:e.prng})}else r=Oa(e)}else r=Oa()}return a===void 0?i=d:i=p,t=r.PRNG,bt(i,"NAME","f"),e&&e.prng?(bt(i,"seed",null),bt(i,"seedLength",null),QO(i,"state",rE(null),cse),bt(i,"stateLength",null),bt(i,"byteLength",null),bt(i,"toJSON",rE(null))):(po(i,"seed",o),po(i,"seedLength",v),QO(i,"state",l,m),po(i,"stateLength",g),po(i,"byteLength",c),bt(i,"toJSON",h)),bt(i,"PRNG",t),i;function o(){return t.seed}function v(){return t.seedLength}function g(){return t.stateLength}function c(){return t.byteLength}function l(){return t.state}function m(f){t.state=f}function h(){var f={};return f.type="PRNG",f.name=i.NAME,f.state=mse(t.state),a===void 0?f.params=[]:f.params=[a,u],f}function p(){return iE(r,a,u)}function d(f,y){return tE(f)||tE(y)||f<=0||y<=0?NaN:iE(r,f,y)}}nE.exports=pse});var sE=s(function(E4e,aE){"use strict";var yse=Tl(),qse=yse();aE.exports=qse});var Ea=s(function(_4e,oE){"use strict";var bse=require("@stdlib/utils/define-nonenumerable-read-only-property"),uE=sE(),wse=Tl();bse(uE,"factory",wse);oE.exports=uE});var jl=s(function(N4e,vE){"use strict";var Sse=F(),Ose=require("@stdlib/array/dtypes"),Ese=require("@stdlib/array/defaults"),_se=Ea(),Nse=Ose("real_floating_point_and_generic"),Lse=Sse(_se,Nse,Ese.get("dtypes.real_floating_point"));vE.exports=Lse});var fE=s(function(L4e,gE){"use strict";var Rse=jl(),Pse=Rse();gE.exports=Pse});var cE=s(function(R4e,lE){"use strict";var Tse=require("@stdlib/utils/define-nonenumerable-read-only-property"),dE=fE(),jse=jl();Tse(dE,"factory",jse);lE.exports=dE});var pE=s(function(P4e,hE){"use strict";var Mse=require("@stdlib/assert/is-plain-object"),xse=require("@stdlib/assert/has-own-property"),Ase=require("@stdlib/array/base/assert/contains"),mE=require("@stdlib/string/format");function Gse(r,e,t){return Mse(t)?xse(t,"dtype")&&(r.dtype=t.dtype,!Ase(e,r.dtype))?new TypeError(mE('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",e.join('", "'),r.dtype)):null:new TypeError(mE("invalid argument. Options argument must be an object. Value: `%s`.",t))}hE.exports=Gse});var wE=s(function(T4e,bE){"use strict";var yE=require("@stdlib/utils/define-nonenumerable-read-only-property"),Vse=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Fse=require("@stdlib/assert/is-function"),Wse=require("@stdlib/assert/is-string-array").primitives,Ise=require("@stdlib/assert/is-collection"),kse=require("@stdlib/array/base/assert/contains"),zse=require("@stdlib/array/base/filled-by"),qE=require("@stdlib/strided/base/ternary"),Jse=require("@stdlib/array/ctors"),Hs=require("@stdlib/string/format"),Use=pE();function Zs(r,e,t){if(!(this instanceof Zs))return new Zs(r,e,t);if(!Fse(r))throw new TypeError(Hs("invalid argument. First argument must be a function. Value: `%s`.",r));if(!Wse(e))throw new TypeError(Hs("invalid argument. Second argument must be an array of strings. Value: `%s`.",e));if(!kse(e,t))throw new TypeError(Hs("invalid argument. Third argument must be a supported data type. Value: `%s`.",t));return this._prng=r,this._dtypes=e,this._dtype=t,this}yE(Zs.prototype,"generate",function(e,t,i,n,a){var u,o,v,g,c,l;if(!Vse(e))throw new TypeError(Hs("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",e));if(o={},arguments.length>4&&(c=Use(o,this._dtypes,a),c))throw c;if(v=this._prng,l=o.dtype||this._dtype,l==="generic")return zse(e,m);return u=Jse(l),g=new u(e),qE([[t],[i],[n],g],[e],[0,0,0,1],v),g;function m(){return v(t,i,n)}});yE(Zs.prototype,"assign",function(e,t,i,n){if(!Ise(n))throw new TypeError(Hs("invalid argument. Third argument must be an array-like object. Value: `%s`.",n));return qE([[e],[t],[i],n],[n.length],[0,0,0,1],this._prng),n});bE.exports=Zs});var OE=s(function(j4e,SE){"use strict";var Cse=wE();SE.exports=Cse});var LE=s(function(M4e,NE){"use strict";var EE=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),qo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),_a=require("@stdlib/utils/define-nonenumerable-read-only-property"),Bse=require("@stdlib/assert/is-string-array").primitives,Dse=require("@stdlib/assert/is-function"),Xse=require("@stdlib/assert/is-method-in"),Yse=require("@stdlib/assert/has-own-property"),_E=require("@stdlib/array/base/assert/contains").factory,Hse=require("@stdlib/utils/constant-function"),Zse=require("@stdlib/utils/noop"),Qse=OE(),$se=Nu(),Qs=require("@stdlib/string/format");function Kse(r,e,t){var i;if(!Dse(r))throw new TypeError(Qs("invalid argument. First argument must be a function. Value: `%s`.",r));if(!Xse(r,"factory"))throw new TypeError(Qs("invalid argument. First argument must have a `%s` method.","factory"));if(!Bse(e))throw new TypeError(Qs("invalid argument. Second argument must an array of strings. Value: `%s`.",e));if(!_E(e,t))throw new TypeError(Qs("invalid argument. Third argument must be a supported data type. Value: `%s`.",t));return i=_E(e),n;function n(){var a,u,o,v,g,c,l,m,h,p,d;if(l=arguments.length,l<1?(h={},m=r,p=f):l===1?(h=arguments[0],m=r.factory(h),p=f):l===3?(o=arguments[0],v=arguments[1],g=arguments[2],h={},m=r.factory(o,v,g),p=y):(o=arguments[0],v=arguments[1],g=arguments[2],h=arguments[3],m=r.factory(o,v,g,h),p=y),Yse(h,"dtype")){if(d=h.dtype,!i(d))throw new TypeError(Qs('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",e.join('", "'),d))}else d=t;return p===f?(c=q,a=Qse):(c=b,a=$se),u=new a(m,e,d),h&&h.prng?(_a(p,"seed",null),_a(p,"seedLength",null),EE(p,"state",Hse(null),Zse),_a(p,"stateLength",null),_a(p,"byteLength",null)):(qo(p,"seed",w),qo(p,"seedLength",S),EE(p,"state",x,V),qo(p,"stateLength",W),qo(p,"byteLength",J)),_a(p,"PRNG",m.PRNG),_a(p,"assign",c),p;function f(A,G,Ue,_u,J$){return arguments.length<5?u.generate(A,G,Ue,_u):u.generate(A,G,Ue,_u,J$)}function y(A,G){return arguments.length<2?u.generate(A):u.generate(A,G)}function q(A,G,Ue,_u){return u.assign(A,G,Ue,_u)}function b(A){return u.assign(A)}function w(){return p.PRNG.seed}function S(){return p.PRNG.seedLength}function W(){return p.PRNG.stateLength}function J(){return p.PRNG.byteLength}function x(){return p.PRNG.state}function V(A){p.PRNG.state=A}}}NE.exports=Kse});var bo=s(function(x4e,RE){"use strict";var eue=LE();RE.exports=eue});var jE=s(function(A4e,TE){"use strict";var PE=require("@stdlib/assert/is-positive-number").isPrimitive,rue=require("@stdlib/assert/is-number").isPrimitive,Ml=require("@stdlib/assert/is-nan"),xl=require("@stdlib/string/format");function tue(r,e,t){return!PE(r)||Ml(r)?new TypeError(xl("invalid argument. First argument must be a positive number and not NaN. Value: `%s`.",r)):!PE(e)||Ml(e)?new TypeError(xl("invalid argument. Second argument must be a positive number and not NaN. Value: `%s`.",e)):!rue(t)||Ml(t)?new TypeError(xl("invalid argument. Third argument must be a number and not NaN. Value: `%s`.",t)):null}TE.exports=tue});var xE=s(function(G4e,ME){"use strict";var iue=require("@stdlib/math/base/special/pow"),nue=require("@stdlib/math/base/special/ln");function aue(r,e,t,i){return i+t*iue(-nue(r()),-1/e)}ME.exports=aue});var Gl=s(function(V4e,kE){"use strict";var Yr=require("@stdlib/utils/define-nonenumerable-read-only-property"),wo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),AE=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),GE=require("@stdlib/assert/is-plain-object"),VE=require("@stdlib/assert/is-function"),FE=require("@stdlib/assert/has-own-property"),WE=require("@stdlib/utils/constant-function"),sue=require("@stdlib/utils/noop"),So=T().factory,Al=require("@stdlib/math/base/assert/is-nan"),uue=require("@stdlib/array/to-json"),Oo=require("@stdlib/string/format"),oue=jE(),IE=xE();function vue(){var r,e,t,i,n,a,u;if(arguments.length===0)t=So();else if(arguments.length===1){if(e=arguments[0],!GE(e))throw new TypeError(Oo("invalid argument. Options argument must be an object. Value: `%s`.",e));if(FE(e,"prng")){if(!VE(e.prng))throw new TypeError(Oo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));t=e.prng}else t=So(e)}else{if(r=arguments[0],a=arguments[1],u=arguments[2],n=oue(r,a,u),n)throw n;if(arguments.length>3){if(e=arguments[3],!GE(e))throw new TypeError(Oo("invalid argument. Options argument must be an object. Value: `%s`.",e));if(FE(e,"prng")){if(!VE(e.prng))throw new TypeError(Oo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));t=e.prng}else t=So(e)}else t=So()}return r===void 0?i=d:i=p,Yr(i,"NAME","frechet"),e&&e.prng?(Yr(i,"seed",null),Yr(i,"seedLength",null),AE(i,"state",WE(null),sue),Yr(i,"stateLength",null),Yr(i,"byteLength",null),Yr(i,"toJSON",WE(null)),Yr(i,"PRNG",t)):(wo(i,"seed",o),wo(i,"seedLength",v),AE(i,"state",l,m),wo(i,"stateLength",g),wo(i,"byteLength",c),Yr(i,"toJSON",h),Yr(i,"PRNG",t),t=t.normalized),i;function o(){return t.seed}function v(){return t.seedLength}function g(){return t.stateLength}function c(){return t.byteLength}function l(){return t.state}function m(f){t.state=f}function h(){var f={};return f.type="PRNG",f.name=i.NAME,f.state=uue(t.state),r===void 0?f.params=[]:f.params=[r,a,u],f}function p(){return IE(t,r,a,u)}function d(f,y,q){return Al(f)||Al(y)||Al(q)||f<=0||y<=0?NaN:IE(t,f,y,q)}}kE.exports=vue});var JE=s(function(F4e,zE){"use strict";var gue=Gl(),fue=gue();zE.exports=fue});var Na=s(function(W4e,CE){"use strict";var due=require("@stdlib/utils/define-nonenumerable-read-only-property"),UE=JE(),lue=Gl();due(UE,"factory",lue);CE.exports=UE});var Vl=s(function(I4e,BE){"use strict";var cue=bo(),mue=require("@stdlib/array/dtypes"),hue=require("@stdlib/array/defaults"),pue=Na(),yue=mue("real_floating_point_and_generic"),que=cue(pue,yue,hue.get("dtypes.real_floating_point"));BE.exports=que});var XE=s(function(k4e,DE){"use strict";var bue=Vl(),wue=bue();DE.exports=wue});var ZE=s(function(z4e,HE){"use strict";var Sue=require("@stdlib/utils/define-nonenumerable-read-only-property"),YE=XE(),Oue=Vl();Sue(YE,"factory",Oue);HE.exports=YE});var Fl=s(function(J4e,QE){"use strict";var Eue=F(),_ue=require("@stdlib/array/dtypes"),Nue=require("@stdlib/array/defaults"),Lue=Ce(),Rue=_ue("real_floating_point_and_generic"),Pue=Eue(Lue,Rue,Nue.get("dtypes.real_floating_point"));QE.exports=Pue});var KE=s(function(U4e,$E){"use strict";var Tue=Fl(),jue=Tue();$E.exports=jue});var t_=s(function(C4e,r_){"use strict";var Mue=require("@stdlib/utils/define-nonenumerable-read-only-property"),e_=KE(),xue=Fl();Mue(e_,"factory",xue);r_.exports=e_});var a_=s(function(B4e,n_){"use strict";var Aue=require("@stdlib/math/base/special/floor"),i_=require("@stdlib/math/base/special/ln");function Gue(r,e){var t=r();return t===0&&(t=r()),Aue(i_(t)/i_(1-e))}n_.exports=Gue});var Wl=s(function(D4e,d_){"use strict";var Hr=require("@stdlib/utils/define-nonenumerable-read-only-property"),Eo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),s_=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),u_=require("@stdlib/assert/is-plain-object"),Vue=require("@stdlib/assert/is-probability").isPrimitive,o_=require("@stdlib/assert/is-function"),v_=require("@stdlib/assert/has-own-property"),g_=require("@stdlib/utils/constant-function"),Fue=require("@stdlib/utils/noop"),_o=T().factory,Wue=require("@stdlib/math/base/assert/is-nan"),Iue=require("@stdlib/array/to-json"),No=require("@stdlib/string/format"),f_=a_();function kue(){var r,e,t,i;if(arguments.length===0)e=_o();else if(arguments.length===1&&u_(arguments[0]))if(r=arguments[0],v_(r,"prng")){if(!o_(r.prng))throw new TypeError(No("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=_o(r);else{if(i=arguments[0],!Vue(i))throw new TypeError(No("invalid argument. First argument must be a probability. Value: `%s`.",i));if(arguments.length>1){if(r=arguments[1],!u_(r))throw new TypeError(No("invalid argument. Options argument must be an object. Value: `%s`.",r));if(v_(r,"prng")){if(!o_(r.prng))throw new TypeError(No("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=_o(r)}else e=_o()}return i===void 0?t=m:t=l,Hr(t,"NAME","geometric"),r&&r.prng?(Hr(t,"seed",null),Hr(t,"seedLength",null),s_(t,"state",g_(null),Fue),Hr(t,"stateLength",null),Hr(t,"byteLength",null),Hr(t,"toJSON",g_(null)),Hr(t,"PRNG",e)):(Eo(t,"seed",n),Eo(t,"seedLength",a),s_(t,"state",v,g),Eo(t,"stateLength",u),Eo(t,"byteLength",o),Hr(t,"toJSON",c),Hr(t,"PRNG",e),e=e.normalized),t;function n(){return e.seed}function a(){return e.seedLength}function u(){return e.stateLength}function o(){return e.byteLength}function v(){return e.state}function g(h){e.state=h}function c(){var h={};return h.type="PRNG",h.name=t.NAME,h.state=Iue(e.state),i===void 0?h.params=[]:h.params=[i],h}function l(){return f_(e,i)}function m(h){return Wue(h)||h<0||h>1?NaN:f_(e,h)}}d_.exports=kue});var c_=s(function(X4e,l_){"use strict";var zue=Wl(),Jue=zue();l_.exports=Jue});var cn=s(function(Y4e,h_){"use strict";var Uue=require("@stdlib/utils/define-nonenumerable-read-only-property"),m_=c_(),Cue=Wl();Uue(m_,"factory",Cue);h_.exports=m_});var Il=s(function(H4e,p_){"use strict";var Bue=Fr(),Due=require("@stdlib/array/dtypes"),Xue=require("@stdlib/array/defaults"),Yue=cn(),Hue=Due("real_and_generic"),Zue=Bue(Yue,Hue,Xue.get("dtypes.real"));p_.exports=Zue});var q_=s(function(Z4e,y_){"use strict";var Que=Il(),$ue=Que();y_.exports=$ue});var S_=s(function(Q4e,w_){"use strict";var Kue=require("@stdlib/utils/define-nonenumerable-read-only-property"),b_=q_(),eoe=Il();Kue(b_,"factory",eoe);w_.exports=b_});var __=s(function($4e,E_){"use strict";var roe=require("@stdlib/assert/is-number").isPrimitive,toe=require("@stdlib/assert/is-positive-number").isPrimitive,O_=require("@stdlib/string/format"),ioe=require("@stdlib/assert/is-nan");function noe(r,e){return!roe(r)||ioe(r)?new TypeError(O_("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):toe(e)?null:new TypeError(O_("invalid argument. Second argument must be a positive number. Value: `%s`.",e))}E_.exports=noe});var R_=s(function(K4e,L_){"use strict";var N_=require("@stdlib/math/base/special/ln");function aoe(r,e,t){return e-t*N_(-N_(r()))}L_.exports=aoe});var kl=s(function(eHe,V_){"use strict";var Zr=require("@stdlib/utils/define-nonenumerable-read-only-property"),Lo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),P_=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),T_=require("@stdlib/assert/is-plain-object"),j_=require("@stdlib/assert/is-function"),M_=require("@stdlib/assert/has-own-property"),x_=require("@stdlib/utils/constant-function"),soe=require("@stdlib/utils/noop"),Ro=T().factory,A_=require("@stdlib/math/base/assert/is-nan"),uoe=require("@stdlib/array/to-json"),Po=require("@stdlib/string/format"),ooe=__(),G_=R_();function voe(){var r,e,t,i,n,a;if(arguments.length===0)t=Ro();else if(arguments.length===1){if(e=arguments[0],!T_(e))throw new TypeError(Po("invalid argument. Options argument must be an object. Value: `%s`.",e));if(M_(e,"prng")){if(!j_(e.prng))throw new TypeError(Po("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));t=e.prng}else t=Ro(e)}else{if(a=arguments[0],r=arguments[1],n=ooe(a,r),n)throw n;if(arguments.length>2){if(e=arguments[2],!T_(e))throw new TypeError(Po("invalid argument. Options argument must be an object. Value: `%s`.",e));if(M_(e,"prng")){if(!j_(e.prng))throw new TypeError(Po("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));t=e.prng}else t=Ro(e)}else t=Ro()}return a===void 0?i=p:i=h,Zr(i,"NAME","gumbel"),e&&e.prng?(Zr(i,"seed",null),Zr(i,"seedLength",null),P_(i,"state",x_(null),soe),Zr(i,"stateLength",null),Zr(i,"byteLength",null),Zr(i,"toJSON",x_(null)),Zr(i,"PRNG",t)):(Lo(i,"seed",u),Lo(i,"seedLength",o),P_(i,"state",c,l),Lo(i,"stateLength",v),Lo(i,"byteLength",g),Zr(i,"toJSON",m),Zr(i,"PRNG",t),t=t.normalized),i;function u(){return t.seed}function o(){return t.seedLength}function v(){return t.stateLength}function g(){return t.byteLength}function c(){return t.state}function l(d){t.state=d}function m(){var d={};return d.type="PRNG",d.name=i.NAME,d.state=uoe(t.state),a===void 0?d.params=[]:d.params=[a,r],d}function h(){return G_(t,a,r)}function p(d,f){return A_(d)||A_(f)||f<=0?NaN:G_(t,d,f)}}V_.exports=voe});var W_=s(function(rHe,F_){"use strict";var goe=kl(),foe=goe();F_.exports=foe});var La=s(function(tHe,k_){"use strict";var doe=require("@stdlib/utils/define-nonenumerable-read-only-property"),I_=W_(),loe=kl();doe(I_,"factory",loe);k_.exports=I_});var zl=s(function(iHe,z_){"use strict";var coe=F(),moe=require("@stdlib/array/dtypes"),hoe=require("@stdlib/array/defaults"),poe=La(),yoe=moe("real_floating_point_and_generic"),qoe=coe(poe,yoe,hoe.get("dtypes.real_floating_point"));z_.exports=qoe});var U_=s(function(nHe,J_){"use strict";var boe=zl(),woe=boe();J_.exports=woe});var D_=s(function(aHe,B_){"use strict";var Soe=require("@stdlib/utils/define-nonenumerable-read-only-property"),C_=U_(),Ooe=zl();Soe(C_,"factory",Ooe);B_.exports=C_});var Y_=s(function(sHe,X_){"use strict";var Jl=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,$s=require("@stdlib/string/format");function Eoe(r,e,t){return Jl(r)?Jl(e)?Jl(t)?t>r?new RangeError($s("invalid argument. Third argument must be less than or equal to the first argument. Value: `%u`.",t)):e>r?new RangeError($s("invalid argument. Second argument must be less than or equal to the first argument. Value: `%u`.",e)):null:new TypeError($s("invalid argument. Third argument must be a nonnegative integer. Value: `%s`.",t)):new TypeError($s("invalid argument. Second argument must be a nonnegative integer. Value: `%s`.",e)):new TypeError($s("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",r))}X_.exports=Eoe});var Z_=s(function(uHe,H_){"use strict";var wt=require("@stdlib/math/base/special/factorial");function _oe(r,e,t,i){var n,a,u;for(in;)a-=n,n*=(e-u)*(i-u)/((u+1)*(t-i+1+u)),u+=1;return u}H_.exports=_oe});var $_=s(function(oHe,Q_){"use strict";var To=Z_();function Noe(r,e,t,i){var n,a,u,o;return i>e/2?(u=e-i,2*t<=e?(n=t,a=e-t,o=To(r,n,a,u),t-o):(a=t,n=e-t,o=To(r,n,a,u),i-e+t+o)):(u=i,2*t<=e?(n=t,a=e-t,o=To(r,n,a,u),o):(n=e-t,a=t,o=To(r,n,a,u),i-o))}Q_.exports=Noe});var Cl=s(function(vHe,sN){"use strict";var Qr=require("@stdlib/utils/define-nonenumerable-read-only-property"),jo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),K_=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),eN=require("@stdlib/assert/is-plain-object"),rN=require("@stdlib/assert/is-function"),tN=require("@stdlib/assert/has-own-property"),iN=require("@stdlib/utils/constant-function"),Loe=require("@stdlib/utils/noop"),Mo=T().factory,Ul=require("@stdlib/math/base/assert/is-nonnegative-integer"),nN=require("@stdlib/constants/float64/pinf"),Roe=require("@stdlib/array/to-json"),xo=require("@stdlib/string/format"),Poe=Y_(),aN=$_();function Toe(){var r,e,t,i,n,a,u;if(arguments.length===0)e=Mo();else if(arguments.length===1){if(r=arguments[0],!eN(r))throw new TypeError(xo("invalid argument. Options argument must be an object. Value: `%s`.",r));if(tN(r,"prng")){if(!rN(r.prng))throw new TypeError(xo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Mo(r)}else{if(n=arguments[0],a=arguments[1],u=arguments[2],i=Poe(n,a,u),i)throw i;if(arguments.length>3){if(r=arguments[3],!eN(r))throw new TypeError(xo("invalid argument. Options argument must be an object. Value: `%s`.",r));if(tN(r,"prng")){if(!rN(r.prng))throw new TypeError(xo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Mo(r)}else e=Mo()}return n===void 0?t=d:t=p,Qr(t,"NAME","hypergeometric"),r&&r.prng?(Qr(t,"seed",null),Qr(t,"seedLength",null),K_(t,"state",iN(null),Loe),Qr(t,"stateLength",null),Qr(t,"byteLength",null),Qr(t,"toJSON",iN(null)),Qr(t,"PRNG",e)):(jo(t,"seed",o),jo(t,"seedLength",v),K_(t,"state",l,m),jo(t,"stateLength",g),jo(t,"byteLength",c),Qr(t,"toJSON",h),Qr(t,"PRNG",e),e=e.normalized),t;function o(){return e.seed}function v(){return e.seedLength}function g(){return e.stateLength}function c(){return e.byteLength}function l(){return e.state}function m(f){e.state=f}function h(){var f={};return f.type="PRNG",f.name=t.NAME,f.state=Roe(e.state),n===void 0?f.params=[]:f.params=[n,a,u],f}function p(){return aN(e,n,a,u)}function d(f,y,q){return f===nN||y===nN||!Ul(f)||!Ul(y)||!Ul(q)||q>f?NaN:aN(e,f,y,q)}}sN.exports=Toe});var oN=s(function(gHe,uN){"use strict";var joe=Cl(),Moe=joe();uN.exports=Moe});var Ra=s(function(fHe,gN){"use strict";var xoe=require("@stdlib/utils/define-nonenumerable-read-only-property"),vN=oN(),Aoe=Cl();xoe(vN,"factory",Aoe);gN.exports=vN});var Bl=s(function(dHe,fN){"use strict";var Goe=bo(),Voe=require("@stdlib/array/dtypes"),Foe=require("@stdlib/array/defaults"),Woe=Ra(),Ioe=Voe("real_and_generic"),koe=Goe(Woe,Ioe,Foe.get("dtypes.real"));fN.exports=koe});var lN=s(function(lHe,dN){"use strict";var zoe=Bl(),Joe=zoe();dN.exports=Joe});var hN=s(function(cHe,mN){"use strict";var Uoe=require("@stdlib/utils/define-nonenumerable-read-only-property"),cN=lN(),Coe=Bl();Uoe(cN,"factory",Coe);mN.exports=cN});var bN=s(function(mHe,qN){"use strict";var pN=require("@stdlib/assert/is-positive-number").isPrimitive,yN=require("@stdlib/string/format");function Boe(r,e){return pN(r)?pN(e)?null:new TypeError(yN("invalid argument. Second argument must be a positive number. Value: `%s`.",e)):new TypeError(yN("invalid argument. First argument must be a positive number. Value: `%s`.",r))}qN.exports=Boe});var Dl=s(function(hHe,LN){"use strict";var St=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ao=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),wN=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),SN=require("@stdlib/assert/is-plain-object"),ON=require("@stdlib/assert/is-function"),EN=require("@stdlib/assert/has-own-property"),_N=require("@stdlib/utils/constant-function"),Doe=require("@stdlib/utils/noop"),Pa=Ce().factory,NN=require("@stdlib/math/base/assert/is-nan"),Xoe=require("@stdlib/array/to-json"),Go=require("@stdlib/string/format"),Yoe=bN();function Hoe(){var r,e,t,i,n,a,u;if(arguments.length===0)r=Pa();else if(arguments.length===1){if(i=arguments[0],!SN(i))throw new TypeError(Go("invalid argument. Options argument must be an object. Value: `%s`.",i));if(EN(i,"prng")){if(!ON(i.prng))throw new TypeError(Go("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",i.prng));r=Pa({prng:i.prng})}else r=Pa(i)}else{if(e=arguments[0],t=arguments[1],u=Yoe(e,t),u)throw u;if(arguments.length>2){if(i=arguments[2],!SN(i))throw new TypeError(Go("invalid argument. Options argument must be an object. Value: `%s`.",i));if(EN(i,"prng")){if(!ON(i.prng))throw new TypeError(Go("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",i.prng));r=Pa(e,t,{prng:i.prng})}else r=Pa(e,t,i)}else r=Pa(e,t)}return e===void 0?a=d:a=p,n=r.PRNG,St(a,"NAME","invgamma"),i&&i.prng?(St(a,"seed",null),St(a,"seedLength",null),wN(a,"state",_N(null),Doe),St(a,"stateLength",null),St(a,"byteLength",null),St(a,"toJSON",_N(null))):(Ao(a,"seed",o),Ao(a,"seedLength",v),wN(a,"state",l,m),Ao(a,"stateLength",g),Ao(a,"byteLength",c),St(a,"toJSON",h)),St(a,"PRNG",n),a;function o(){return n.seed}function v(){return n.seedLength}function g(){return n.stateLength}function c(){return n.byteLength}function l(){return n.state}function m(f){n.state=f}function h(){var f={};return f.type="PRNG",f.name=a.NAME,f.state=Xoe(n.state),e===void 0?f.params=[]:f.params=[e,t],f}function p(){return 1/r()}function d(f,y){return NN(f)||NN(y)||f<=0||y<=0?NaN:1/r(f,y)}}LN.exports=Hoe});var PN=s(function(pHe,RN){"use strict";var Zoe=Dl(),Qoe=Zoe();RN.exports=Qoe});var mn=s(function(yHe,jN){"use strict";var $oe=require("@stdlib/utils/define-nonenumerable-read-only-property"),TN=PN(),Koe=Dl();$oe(TN,"factory",Koe);jN.exports=TN});var Xl=s(function(qHe,MN){"use strict";var eve=F(),rve=require("@stdlib/array/dtypes"),tve=require("@stdlib/array/defaults"),ive=mn(),nve=rve("real_floating_point_and_generic"),ave=eve(ive,nve,tve.get("dtypes.real_floating_point"));MN.exports=ave});var AN=s(function(bHe,xN){"use strict";var sve=Xl(),uve=sve();xN.exports=uve});var FN=s(function(wHe,VN){"use strict";var ove=require("@stdlib/utils/define-nonenumerable-read-only-property"),GN=AN(),vve=Xl();ove(GN,"factory",vve);VN.exports=GN});var zN=s(function(SHe,kN){"use strict";var WN=require("@stdlib/assert/is-positive-number").isPrimitive,IN=require("@stdlib/string/format");function gve(r,e){return WN(r)?WN(e)?null:new TypeError(IN("invalid argument. Second argument must be a positive number. Value: `%s`.",e)):new TypeError(IN("invalid argument. First argument must be a positive number. Value: `%s`.",r))}kN.exports=gve});var CN=s(function(OHe,UN){"use strict";var JN=require("@stdlib/math/base/special/pow");function fve(r,e,t){var i=r();return JN(1-JN(1-i,1/t),1/e)}UN.exports=fve});var Yl=s(function(EHe,$N){"use strict";var $r=require("@stdlib/utils/define-nonenumerable-read-only-property"),Vo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),BN=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),DN=require("@stdlib/assert/is-plain-object"),XN=require("@stdlib/assert/is-function"),YN=require("@stdlib/assert/has-own-property"),HN=require("@stdlib/utils/constant-function"),dve=require("@stdlib/utils/noop"),Fo=T().factory,ZN=require("@stdlib/math/base/assert/is-nan"),lve=require("@stdlib/array/to-json"),Wo=require("@stdlib/string/format"),cve=zN(),QN=CN();function mve(){var r,e,t,i,n,a;if(arguments.length===0)e=Fo();else if(arguments.length===1){if(r=arguments[0],!DN(r))throw new TypeError(Wo("invalid argument. Options argument must be an object. Value: `%s`.",r));if(YN(r,"prng")){if(!XN(r.prng))throw new TypeError(Wo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Fo(r)}else{if(n=arguments[0],a=arguments[1],i=cve(n,a),i)throw i;if(arguments.length>2){if(r=arguments[2],!DN(r))throw new TypeError(Wo("invalid argument. Options argument must be an object. Value: `%s`.",r));if(YN(r,"prng")){if(!XN(r.prng))throw new TypeError(Wo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Fo(r)}else e=Fo()}return n===void 0?t=p:t=h,$r(t,"NAME","kumaraswamy"),r&&r.prng?($r(t,"seed",null),$r(t,"seedLength",null),BN(t,"state",HN(null),dve),$r(t,"stateLength",null),$r(t,"byteLength",null),$r(t,"toJSON",HN(null)),$r(t,"PRNG",e)):(Vo(t,"seed",u),Vo(t,"seedLength",o),BN(t,"state",c,l),Vo(t,"stateLength",v),Vo(t,"byteLength",g),$r(t,"toJSON",m),$r(t,"PRNG",e),e=e.normalized),t;function u(){return e.seed}function o(){return e.seedLength}function v(){return e.stateLength}function g(){return e.byteLength}function c(){return e.state}function l(d){e.state=d}function m(){var d={};return d.type="PRNG",d.name=t.NAME,d.state=lve(e.state),n===void 0?d.params=[]:d.params=[n,a],d}function h(){return QN(e,n,a)}function p(d,f){return ZN(d)||ZN(f)||d<=0||f<=0?NaN:QN(e,d,f)}}$N.exports=mve});var eL=s(function(_He,KN){"use strict";var hve=Yl(),pve=hve();KN.exports=pve});var Ta=s(function(NHe,tL){"use strict";var yve=require("@stdlib/utils/define-nonenumerable-read-only-property"),rL=eL(),qve=Yl();yve(rL,"factory",qve);tL.exports=rL});var Hl=s(function(LHe,iL){"use strict";var bve=F(),wve=require("@stdlib/array/dtypes"),Sve=require("@stdlib/array/defaults"),Ove=Ta(),Eve=wve("real_floating_point_and_generic"),_ve=bve(Ove,Eve,Sve.get("dtypes.real_floating_point"));iL.exports=_ve});var aL=s(function(RHe,nL){"use strict";var Nve=Hl(),Lve=Nve();nL.exports=Lve});var oL=s(function(PHe,uL){"use strict";var Rve=require("@stdlib/utils/define-nonenumerable-read-only-property"),sL=aL(),Pve=Hl();Rve(sL,"factory",Pve);uL.exports=sL});var fL=s(function(THe,gL){"use strict";var Tve=require("@stdlib/assert/is-number").isPrimitive,jve=require("@stdlib/assert/is-positive-number").isPrimitive,vL=require("@stdlib/string/format"),Mve=require("@stdlib/assert/is-nan");function xve(r,e){return!Tve(r)||Mve(r)?new TypeError(vL("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):jve(e)?null:new TypeError(vL("invalid argument. Second argument must be a positive number. Value: `%s`.",e))}gL.exports=xve});var lL=s(function(jHe,dL){"use strict";var Ave=require("@stdlib/math/base/special/signum"),Gve=require("@stdlib/math/base/special/abs"),Vve=require("@stdlib/math/base/special/ln");function Fve(r,e,t){var i=r()-.5;return e-t*Ave(i)*Vve(1-2*Gve(i))}dL.exports=Fve});var Zl=s(function(MHe,wL){"use strict";var Kr=require("@stdlib/utils/define-nonenumerable-read-only-property"),Io=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),cL=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),mL=require("@stdlib/assert/is-plain-object"),hL=require("@stdlib/assert/is-function"),pL=require("@stdlib/assert/has-own-property"),yL=require("@stdlib/utils/constant-function"),Wve=require("@stdlib/utils/noop"),ko=T().factory,qL=require("@stdlib/math/base/assert/is-nan"),Ive=require("@stdlib/array/to-json"),zo=require("@stdlib/string/format"),kve=fL(),bL=lL();function zve(){var r,e,t,i,n,a;if(arguments.length===0)e=ko();else if(arguments.length===1){if(r=arguments[0],!mL(r))throw new TypeError(zo("invalid argument. Options argument must be an object. Value: `%s`.",r));if(pL(r,"prng")){if(!hL(r.prng))throw new TypeError(zo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=ko(r)}else{if(n=arguments[0],a=arguments[1],i=kve(n,a),i)throw i;if(arguments.length>2){if(r=arguments[2],!mL(r))throw new TypeError(zo("invalid argument. Options argument must be an object. Value: `%s`.",r));if(pL(r,"prng")){if(!hL(r.prng))throw new TypeError(zo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=ko(r)}else e=ko()}return n===void 0?t=p:t=h,Kr(t,"NAME","laplace"),r&&r.prng?(Kr(t,"seed",null),Kr(t,"seedLength",null),cL(t,"state",yL(null),Wve),Kr(t,"stateLength",null),Kr(t,"byteLength",null),Kr(t,"toJSON",yL(null)),Kr(t,"PRNG",e)):(Io(t,"seed",u),Io(t,"seedLength",o),cL(t,"state",c,l),Io(t,"stateLength",v),Io(t,"byteLength",g),Kr(t,"toJSON",m),Kr(t,"PRNG",e),e=e.normalized),t;function u(){return e.seed}function o(){return e.seedLength}function v(){return e.stateLength}function g(){return e.byteLength}function c(){return e.state}function l(d){e.state=d}function m(){var d={};return d.type="PRNG",d.name=t.NAME,d.state=Ive(e.state),n===void 0?d.params=[]:d.params=[n,a],d}function h(){return bL(e,n,a)}function p(d,f){return qL(d)||qL(f)||f<=0?NaN:bL(e,d,f)}}wL.exports=zve});var OL=s(function(xHe,SL){"use strict";var Jve=Zl(),Uve=Jve();SL.exports=Uve});var ja=s(function(AHe,_L){"use strict";var Cve=require("@stdlib/utils/define-nonenumerable-read-only-property"),EL=OL(),Bve=Zl();Cve(EL,"factory",Bve);_L.exports=EL});var Ql=s(function(GHe,NL){"use strict";var Dve=F(),Xve=require("@stdlib/array/dtypes"),Yve=require("@stdlib/array/defaults"),Hve=ja(),Zve=Xve("real_floating_point_and_generic"),Qve=Dve(Hve,Zve,Yve.get("dtypes.real_floating_point"));NL.exports=Qve});var RL=s(function(VHe,LL){"use strict";var $ve=Ql(),Kve=$ve();LL.exports=Kve});var jL=s(function(FHe,TL){"use strict";var ege=require("@stdlib/utils/define-nonenumerable-read-only-property"),PL=RL(),rge=Ql();ege(PL,"factory",rge);TL.exports=PL});var AL=s(function(WHe,xL){"use strict";var tge=require("@stdlib/assert/is-number").isPrimitive,ige=require("@stdlib/assert/is-positive-number").isPrimitive,ML=require("@stdlib/string/format"),nge=require("@stdlib/assert/is-nan");function age(r,e){return!tge(r)||nge(r)?new TypeError(ML("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):ige(e)?null:new TypeError(ML("invalid argument. Second argument must be a positive number. Value: `%s`.",e))}xL.exports=age});var VL=s(function(IHe,GL){"use strict";var sge=require("@stdlib/stats/base/dists/normal/quantile");function uge(r,e,t){var i=sge(1-r()/2,0,1);return e+t/(i*i)}GL.exports=uge});var $l=s(function(kHe,CL){"use strict";var et=require("@stdlib/utils/define-nonenumerable-read-only-property"),Jo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),FL=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),WL=require("@stdlib/assert/is-plain-object"),IL=require("@stdlib/assert/is-function"),kL=require("@stdlib/assert/has-own-property"),zL=require("@stdlib/utils/constant-function"),oge=require("@stdlib/utils/noop"),Uo=T().factory,JL=require("@stdlib/math/base/assert/is-nan"),vge=require("@stdlib/array/to-json"),Co=require("@stdlib/string/format"),gge=AL(),UL=VL();function fge(){var r,e,t,i,n,a;if(arguments.length===0)e=Uo();else if(arguments.length===1){if(r=arguments[0],!WL(r))throw new TypeError(Co("invalid argument. Options argument must be an object. Value: `%s`.",r));if(kL(r,"prng")){if(!IL(r.prng))throw new TypeError(Co("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Uo(r)}else{if(n=arguments[0],a=arguments[1],i=gge(n,a),i)throw i;if(arguments.length>2){if(r=arguments[2],!WL(r))throw new TypeError(Co("invalid argument. Options argument must be an object. Value: `%s`.",r));if(kL(r,"prng")){if(!IL(r.prng))throw new TypeError(Co("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Uo(r)}else e=Uo()}return n===void 0?t=p:t=h,et(t,"NAME","levy"),r&&r.prng?(et(t,"seed",null),et(t,"seedLength",null),FL(t,"state",zL(null),oge),et(t,"stateLength",null),et(t,"byteLength",null),et(t,"toJSON",zL(null)),et(t,"PRNG",e)):(Jo(t,"seed",u),Jo(t,"seedLength",o),FL(t,"state",c,l),Jo(t,"stateLength",v),Jo(t,"byteLength",g),et(t,"toJSON",m),et(t,"PRNG",e),e=e.normalized),t;function u(){return e.seed}function o(){return e.seedLength}function v(){return e.stateLength}function g(){return e.byteLength}function c(){return e.state}function l(d){e.state=d}function m(){var d={};return d.type="PRNG",d.name=t.NAME,d.state=vge(e.state),n===void 0?d.params=[]:d.params=[n,a],d}function h(){return UL(e,n,a)}function p(d,f){return JL(d)||JL(f)||f<=0?NaN:UL(e,d,f)}}CL.exports=fge});var DL=s(function(zHe,BL){"use strict";var dge=$l(),lge=dge();BL.exports=lge});var Ma=s(function(JHe,YL){"use strict";var cge=require("@stdlib/utils/define-nonenumerable-read-only-property"),XL=DL(),mge=$l();cge(XL,"factory",mge);YL.exports=XL});var Kl=s(function(UHe,HL){"use strict";var hge=F(),pge=require("@stdlib/array/dtypes"),yge=require("@stdlib/array/defaults"),qge=Ma(),bge=pge("real_floating_point_and_generic"),wge=hge(qge,bge,yge.get("dtypes.real_floating_point"));HL.exports=wge});var QL=s(function(CHe,ZL){"use strict";var Sge=Kl(),Oge=Sge();ZL.exports=Oge});var eR=s(function(BHe,KL){"use strict";var Ege=require("@stdlib/utils/define-nonenumerable-read-only-property"),$L=QL(),_ge=Kl();Ege($L,"factory",_ge);KL.exports=$L});var iR=s(function(DHe,tR){"use strict";var Nge=require("@stdlib/assert/is-number").isPrimitive,Lge=require("@stdlib/assert/is-positive-number").isPrimitive,Rge=require("@stdlib/assert/is-nan"),rR=require("@stdlib/string/format");function Pge(r,e){return!Nge(r)||Rge(r)?new TypeError(rR("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):Lge(e)?null:new TypeError(rR("invalid argument. Second argument must be a positive number. Value: `%s`.",e))}tR.exports=Pge});var aR=s(function(XHe,nR){"use strict";var Tge=require("@stdlib/math/base/special/ln");function jge(r,e,t){var i=r();return e+t*Tge(i/(1-i))}nR.exports=jge});var ec=s(function(YHe,lR){"use strict";var rt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Bo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),sR=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),uR=require("@stdlib/assert/is-plain-object"),oR=require("@stdlib/assert/is-function"),vR=require("@stdlib/assert/has-own-property"),gR=require("@stdlib/utils/constant-function"),Mge=require("@stdlib/utils/noop"),Do=T().factory,fR=require("@stdlib/math/base/assert/is-nan"),xge=require("@stdlib/array/to-json"),Xo=require("@stdlib/string/format"),Age=iR(),dR=aR();function Gge(){var r,e,t,i,n,a;if(arguments.length===0)e=Do();else if(arguments.length===1){if(r=arguments[0],!uR(r))throw new TypeError(Xo("invalid argument. Options argument must be an object. Value: `%s`.",r));if(vR(r,"prng")){if(!oR(r.prng))throw new TypeError(Xo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Do(r)}else{if(n=arguments[0],a=arguments[1],i=Age(n,a),i)throw i;if(arguments.length>2){if(r=arguments[2],!uR(r))throw new TypeError(Xo("invalid argument. Options argument must be an object. Value: `%s`.",r));if(vR(r,"prng")){if(!oR(r.prng))throw new TypeError(Xo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Do(r)}else e=Do()}return n===void 0?t=p:t=h,rt(t,"NAME","logistic"),r&&r.prng?(rt(t,"seed",null),rt(t,"seedLength",null),sR(t,"state",gR(null),Mge),rt(t,"stateLength",null),rt(t,"byteLength",null),rt(t,"toJSON",gR(null)),rt(t,"PRNG",e)):(Bo(t,"seed",u),Bo(t,"seedLength",o),sR(t,"state",c,l),Bo(t,"stateLength",v),Bo(t,"byteLength",g),rt(t,"toJSON",m),rt(t,"PRNG",e),e=e.normalized),t;function u(){return e.seed}function o(){return e.seedLength}function v(){return e.stateLength}function g(){return e.byteLength}function c(){return e.state}function l(d){e.state=d}function m(){var d={};return d.type="PRNG",d.name=t.NAME,d.state=xge(e.state),n===void 0?d.params=[]:d.params=[n,a],d}function h(){return dR(e,n,a)}function p(d,f){return fR(d)||fR(f)||f<=0?NaN:dR(e,d,f)}}lR.exports=Gge});var mR=s(function(HHe,cR){"use strict";var Vge=ec(),Fge=Vge();cR.exports=Fge});var xa=s(function(ZHe,pR){"use strict";var Wge=require("@stdlib/utils/define-nonenumerable-read-only-property"),hR=mR(),Ige=ec();Wge(hR,"factory",Ige);pR.exports=hR});var rc=s(function(QHe,yR){"use strict";var kge=F(),zge=require("@stdlib/array/dtypes"),Jge=require("@stdlib/array/defaults"),Uge=xa(),Cge=zge("real_floating_point_and_generic"),Bge=kge(Uge,Cge,Jge.get("dtypes.real_floating_point"));yR.exports=Bge});var bR=s(function($He,qR){"use strict";var Dge=rc(),Xge=Dge();qR.exports=Xge});var OR=s(function(KHe,SR){"use strict";var Yge=require("@stdlib/utils/define-nonenumerable-read-only-property"),wR=bR(),Hge=rc();Yge(wR,"factory",Hge);SR.exports=wR});var NR=s(function(eZe,_R){"use strict";var Zge=require("@stdlib/assert/is-number").isPrimitive,Qge=require("@stdlib/assert/is-positive-number").isPrimitive,ER=require("@stdlib/string/format"),$ge=require("@stdlib/assert/is-nan");function Kge(r,e){return!Zge(r)||$ge(r)?new TypeError(ER("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):Qge(e)?null:new TypeError(ER("invalid argument. Second argument must be a positive number. Value: `%s`.",e))}_R.exports=Kge});var RR=s(function(rZe,LR){"use strict";var efe=require("@stdlib/math/base/special/exp");function rfe(r,e,t){return efe(e+t*r())}LR.exports=rfe});var tc=s(function(tZe,VR){"use strict";var Ot=require("@stdlib/utils/define-nonenumerable-read-only-property"),Yo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),PR=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),TR=require("@stdlib/assert/is-plain-object"),jR=require("@stdlib/assert/is-function"),MR=require("@stdlib/assert/has-own-property"),xR=require("@stdlib/utils/constant-function"),tfe=require("@stdlib/utils/noop"),Aa=Q().factory,AR=require("@stdlib/math/base/assert/is-nan"),ife=require("@stdlib/array/to-json"),Ho=require("@stdlib/string/format"),nfe=NR(),GR=RR();function afe(){var r,e,t,i,n,a,u;if(arguments.length===0)e=Aa();else if(arguments.length===1){if(t=arguments[0],!TR(t))throw new TypeError(Ho("invalid argument. Options argument must be an object. Value: `%s`.",t));if(MR(t,"prng")){if(!jR(t.prng))throw new TypeError(Ho("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",t.prng));e=Aa({prng:t.prng})}else e=Aa(t)}else{if(u=arguments[0],r=arguments[1],a=nfe(u,r),a)throw a;if(arguments.length>2){if(t=arguments[2],!TR(t))throw new TypeError(Ho("invalid argument. Options argument must be an object. Value: `%s`.",t));if(MR(t,"prng")){if(!jR(t.prng))throw new TypeError(Ho("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",t.prng));e=Aa({prng:t.prng})}else e=Aa(t)}else e=Aa()}return u===void 0?n=d:n=p,i=e.PRNG,Ot(n,"NAME","lognormal"),t&&t.prng?(Ot(n,"seed",null),Ot(n,"seedLength",null),PR(n,"state",xR(null),tfe),Ot(n,"stateLength",null),Ot(n,"byteLength",null),Ot(n,"toJSON",xR(null))):(Yo(n,"seed",o),Yo(n,"seedLength",v),PR(n,"state",l,m),Yo(n,"stateLength",g),Yo(n,"byteLength",c),Ot(n,"toJSON",h)),Ot(n,"PRNG",i),n;function o(){return i.seed}function v(){return i.seedLength}function g(){return i.stateLength}function c(){return i.byteLength}function l(){return i.state}function m(f){i.state=f}function h(){var f={};return f.type="PRNG",f.name=n.NAME,f.state=ife(i.state),u===void 0?f.params=[]:f.params=[u,r],f}function p(){return GR(e,u,r)}function d(f,y){return AR(f)||AR(y)||y<=0?NaN:GR(e,f,y)}}VR.exports=afe});var WR=s(function(iZe,FR){"use strict";var sfe=tc(),ufe=sfe();FR.exports=ufe});var hn=s(function(nZe,kR){"use strict";var ofe=require("@stdlib/utils/define-nonenumerable-read-only-property"),IR=WR(),vfe=tc();ofe(IR,"factory",vfe);kR.exports=IR});var ic=s(function(aZe,zR){"use strict";var gfe=F(),ffe=require("@stdlib/array/dtypes"),dfe=require("@stdlib/array/defaults"),lfe=hn(),cfe=ffe("real_floating_point_and_generic"),mfe=gfe(lfe,cfe,dfe.get("dtypes.real_floating_point"));zR.exports=mfe});var UR=s(function(sZe,JR){"use strict";var hfe=ic(),pfe=hfe();JR.exports=pfe});var DR=s(function(uZe,BR){"use strict";var yfe=require("@stdlib/utils/define-nonenumerable-read-only-property"),CR=UR(),qfe=ic();yfe(CR,"factory",qfe);BR.exports=CR});var nc=s(function(oZe,XR){"use strict";var bfe=require("@stdlib/constants/int32/max"),wfe=require("@stdlib/math/base/special/floor"),Sfe=bfe-1;function Ofe(){var r=wfe(1+Sfe*Math.random());return r|0}XR.exports=Ofe});var uc=s(function(vZe,$R){"use strict";var tt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Et=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),YR=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),ac=require("@stdlib/assert/has-own-property"),Efe=require("@stdlib/assert/is-plain-object"),_fe=require("@stdlib/assert/is-boolean").isPrimitive,Nfe=require("@stdlib/assert/is-collection"),Lfe=require("@stdlib/assert/is-positive-integer").isPrimitive,HR=require("@stdlib/assert/is-int32array"),Be=require("@stdlib/string/format"),Zo=require("@stdlib/constants/int32/max"),D=require("@stdlib/array/int32"),Ga=require("@stdlib/blas/base/gcopy"),Rfe=require("@stdlib/array/to-json"),ZR=nc(),sc=Zo-1|0,Pfe=Zo-1|0,Tfe=16807,Qo=1,$o=2,_t=2,X=4,Ks=5;function QR(r,e){var t;return e?t="option":t="argument",r.lengthPfe)throw new RangeError(Be("invalid option. `%s` option must be a positive integer less than the maximum signed 32-bit integer. Option: `%u`.","seed",n));n|=0}else if(Nfe(n)&&n.length>0)a=n.length,e=new D(Ks+a),e[0]=Qo,e[1]=$o,e[_t]=1,e[X]=a,Ga.ndarray(a,n,1,0,e,1,X+1),t=new D(e.buffer,e.byteOffset+(_t+1)*e.BYTES_PER_ELEMENT,1),n=new D(e.buffer,e.byteOffset+(X+1)*e.BYTES_PER_ELEMENT,a),t[0]=n[0];else throw new TypeError(Be("invalid option. `%s` option must be either a positive integer less than the maximum signed 32-bit integer or an array-like object containing integer values less than the maximum signed 32-bit integer. Option: `%s`.","seed",n));else n=ZR()|0}else n=ZR()|0;return t===void 0&&(e=new D(Ks+1),e[0]=Qo,e[1]=$o,e[_t]=1,e[X]=1,e[X+1]=n,t=new D(e.buffer,e.byteOffset+(_t+1)*e.BYTES_PER_ELEMENT,1),n=new D(e.buffer,e.byteOffset+(X+1)*e.BYTES_PER_ELEMENT,1),t[0]=n[0]),tt(p,"NAME","minstd"),Et(p,"seed",o),Et(p,"seedLength",v),YR(p,"state",l,m),Et(p,"stateLength",g),Et(p,"byteLength",c),tt(p,"toJSON",h),tt(p,"MIN",1),tt(p,"MAX",Zo-1),tt(p,"normalized",d),tt(d,"NAME",p.NAME),Et(d,"seed",o),Et(d,"seedLength",v),YR(d,"state",l,m),Et(d,"stateLength",g),Et(d,"byteLength",c),tt(d,"toJSON",h),tt(d,"MIN",(p.MIN-1)/sc),tt(d,"MAX",(p.MAX-1)/sc),p;function o(){var f=e[X];return Ga(f,n,1,new D(f),1)}function v(){return e[X]}function g(){return e.length}function c(){return e.byteLength}function l(){var f=e.length;return Ga(f,e,1,new D(f),1)}function m(f){var y;if(!HR(f))throw new TypeError(Be("invalid argument. Must provide an Int32Array. Value: `%s`.",f));if(y=QR(f,!1),y)throw y;i.copy===!1?i.state&&f.length===e.length?Ga(f.length,f,1,e,1):(e=f,i.state=!0):(f.length!==e.length&&(e=new D(f.length)),Ga(f.length,f,1,e,1)),t=new D(e.buffer,e.byteOffset+(_t+1)*e.BYTES_PER_ELEMENT,1),n=new D(e.buffer,e.byteOffset+(X+1)*e.BYTES_PER_ELEMENT,e[X])}function h(){var f={};return f.type="PRNG",f.name=p.NAME,f.state=Rfe(e),f.params=[],f}function p(){var f=t[0]|0;return f=Tfe*f%Zo|0,t[0]=f,f|0}function d(){return(p()-1)/sc}}$R.exports=jfe});var eP=s(function(gZe,KR){"use strict";var Mfe=uc(),xfe=nc(),Afe=Mfe({seed:xfe()});KR.exports=Afe});var $=s(function(fZe,tP){"use strict";var Gfe=require("@stdlib/utils/define-nonenumerable-read-only-property"),rP=eP(),Vfe=uc();Gfe(rP,"factory",Vfe);tP.exports=rP});var iP=s(function(dZe,Ffe){Ffe.exports={idtype:"float64",ndtype:"float64"}});var aP=s(function(lZe,nP){"use strict";var Wfe=require("@stdlib/array/typed-real-float-dtypes"),Ife=require("@stdlib/array/typed-real-dtypes"),kfe=require("@stdlib/assert/is-plain-object"),Ko=require("@stdlib/assert/has-own-property"),eu=require("@stdlib/string/format"),ru=Ife(),tu=Wfe();ru.push("generic");tu.push("generic");function zfe(r,e,t){if(!kfe(e))return new TypeError(eu("invalid argument. Options argument must be an object. Value: `%s`.",e));if(t===0){if(Ko(e,"idtype")&&(r.idtype=e.idtype,ru.indexOf(r.idtype)<0))return new TypeError(eu('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"idtype",ru.join('", "'),r.idtype));if(Ko(e,"ndtype")&&(r.ndtype=e.ndtype,tu.indexOf(r.ndtype)<0))return new TypeError(eu('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"ndtype",tu.join('", "'),r.ndtype))}else if(t===1&&Ko(e,"dtype")){if(r.dtype=e.dtype,ru.indexOf(r.dtype)<0)return new TypeError(eu('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",ru.join('", "'),r.dtype))}else if(Ko(e,"dtype")&&(r.dtype=e.dtype,tu.indexOf(r.dtype)<0))return new TypeError(eu('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",tu.join('", "'),r.dtype));return null}nP.exports=zfe});var vc=s(function(cZe,cP){"use strict";var sP=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,uP=require("@stdlib/utils/define-nonenumerable-read-only-property"),ev=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Jfe=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),oP=$(),vP=require("@stdlib/array/typed-real-ctors"),gP=require("@stdlib/array/base/filled-by"),fP=require("@stdlib/strided/base/nullary"),dP=require("@stdlib/string/format"),lP=iP(),oc=aP();function Ufe(){var r,e,t,i,n,a;if(t={idtype:lP.idtype,ndtype:lP.ndtype},e=arguments.length,i=u,e===0)n=oP;else if(e===1&&(r=arguments[0],n=oP.factory(r),a=oc(t,r,0),a))throw a;return ev(i,"seed",v),ev(i,"seedLength",g),Jfe(i,"state",m,h),ev(i,"stateLength",c),ev(i,"byteLength",l),uP(i,"PRNG",n),uP(i,"normalized",o),i;function u(p,d){var f,y,q,b,w;if(!sP(p))throw new TypeError(dP("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",p));if(w={},arguments.length>1&&(q=oc(w,d,1),q))throw q;return b=w.dtype||t.idtype,b==="generic"?gP(p,n):(f=vP(b),y=new f(p),fP([y],[p],[1],n),y)}function o(p,d){var f,y,q,b,w;if(!sP(p))throw new TypeError(dP("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",p));if(w={},arguments.length>1&&(q=oc(w,d,2),q))throw q;return b=w.dtype||t.ndtype,b==="generic"?gP(p,n.normalized):(f=vP(b),y=new f(p),fP([y],[p],[1],n.normalized),y)}function v(){return i.PRNG.seed}function g(){return i.PRNG.seedLength}function c(){return i.PRNG.stateLength}function l(){return i.PRNG.byteLength}function m(){return i.PRNG.state}function h(p){i.PRNG.state=p}}cP.exports=Ufe});var hP=s(function(mZe,mP){"use strict";var Cfe=vc(),Bfe=Cfe();mP.exports=Bfe});var qP=s(function(hZe,yP){"use strict";var Dfe=require("@stdlib/utils/define-nonenumerable-read-only-property"),pP=hP(),Xfe=vc();Dfe(pP,"factory",Xfe);yP.exports=pP});var wP=s(function(pZe,bP){"use strict";var Yfe=require("@stdlib/math/base/assert/is-nan"),Hfe=8;function Zfe(r,e,t){var i,n;for(n=0;n=0;n--)e[n]=r();return e}bP.exports=Zfe});var gc=s(function(yZe,SP){"use strict";var Qfe=require("@stdlib/constants/int32/max"),$fe=require("@stdlib/math/base/special/floor"),Kfe=Qfe-1;function ede(){var r=$fe(1+Kfe*Math.random());return r|0}SP.exports=ede});var lc=s(function(qZe,RP){"use strict";var it=require("@stdlib/utils/define-nonenumerable-read-only-property"),Nt=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),OP=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),fc=require("@stdlib/assert/has-own-property"),rde=require("@stdlib/assert/is-plain-object"),tde=require("@stdlib/assert/is-boolean").isPrimitive,ide=require("@stdlib/assert/is-collection"),nde=require("@stdlib/assert/is-positive-integer").isPrimitive,EP=require("@stdlib/assert/is-int32array"),Va=require("@stdlib/blas/base/gcopy"),ade=require("@stdlib/math/base/special/floor"),Y=require("@stdlib/array/int32"),iu=require("@stdlib/constants/int32/max"),sde=require("@stdlib/array/to-json"),K=require("@stdlib/string/format"),_P=wP(),NP=gc(),dc=iu-1|0,ude=iu-1|0,ode=16807,Z=32,iv=1,nv=3,Lt=2,Fa=Z+3,H=Z+6,nu=Z+7,rv=Fa+1,tv=Fa+2;function LP(r,e){var t;return e?t="option":t="argument",r.lengthude)throw new RangeError(K("invalid option. `%s` option must be a positive integer less than the maximum signed 32-bit integer. Option: `%u`.","seed",n));n|=0}else if(ide(n)&&n.length>0)a=n.length,e=new Y(nu+a),e[0]=iv,e[1]=nv,e[Lt]=Z,e[Fa]=2,e[tv]=n[0],e[H]=a,Va.ndarray(a,n,1,0,e,1,H+1),t=new Y(e.buffer,e.byteOffset+(Lt+1)*e.BYTES_PER_ELEMENT,Z),n=new Y(e.buffer,e.byteOffset+(H+1)*e.BYTES_PER_ELEMENT,a),t=_P(p,t,Z),e[rv]=t[0];else throw new TypeError(K("invalid option. `%s` option must be either a positive integer less than the maximum signed 32-bit integer or an array-like object containing integer values less than the maximum signed 32-bit integer. Option: `%s`.","seed",n));else n=NP()|0}else n=NP()|0;return t===void 0&&(e=new Y(nu+1),e[0]=iv,e[1]=nv,e[Lt]=Z,e[Fa]=2,e[tv]=n,e[H]=1,e[H+1]=n,t=new Y(e.buffer,e.byteOffset+(Lt+1)*e.BYTES_PER_ELEMENT,Z),n=new Y(e.buffer,e.byteOffset+(H+1)*e.BYTES_PER_ELEMENT,1),t=_P(p,t,Z),e[rv]=t[0]),it(d,"NAME","minstd-shuffle"),Nt(d,"seed",o),Nt(d,"seedLength",v),OP(d,"state",l,m),Nt(d,"stateLength",g),Nt(d,"byteLength",c),it(d,"toJSON",h),it(d,"MIN",1),it(d,"MAX",iu-1),it(d,"normalized",f),it(f,"NAME",d.NAME),Nt(f,"seed",o),Nt(f,"seedLength",v),OP(f,"state",l,m),Nt(f,"stateLength",g),Nt(f,"byteLength",c),it(f,"toJSON",h),it(f,"MIN",(d.MIN-1)/dc),it(f,"MAX",(d.MAX-1)/dc),d;function o(){var y=e[H];return Va(y,n,1,new Y(y),1)}function v(){return e[H]}function g(){return e.length}function c(){return e.byteLength}function l(){var y=e.length;return Va(y,e,1,new Y(y),1)}function m(y){var q;if(!EP(y))throw new TypeError(K("invalid argument. Must provide an Int32Array. Value: `%s`.",y));if(q=LP(y,!1),q)throw q;i.copy===!1?i.state&&y.length===e.length?Va(y.length,y,1,e,1):(e=y,i.state=!0):(y.length!==e.length&&(e=new Y(y.length)),Va(y.length,y,1,e,1)),t=new Y(e.buffer,e.byteOffset+(Lt+1)*e.BYTES_PER_ELEMENT,Z),n=new Y(e.buffer,e.byteOffset+(H+1)*e.BYTES_PER_ELEMENT,e[H])}function h(){var y={};return y.type="PRNG",y.name=d.NAME,y.state=sde(e),y.params=[],y}function p(){var y=e[tv]|0;return y=ode*y%iu|0,e[tv]=y,y|0}function d(){var y,q;return y=e[rv],q=ade(Z*(y/iu)),y=t[q],e[rv]=y,t[q]=p(),y}function f(){return(d()-1)/dc}}RP.exports=vde});var TP=s(function(bZe,PP){"use strict";var gde=lc(),fde=gc(),dde=gde({seed:fde()});PP.exports=dde});var ee=s(function(wZe,MP){"use strict";var lde=require("@stdlib/utils/define-nonenumerable-read-only-property"),jP=TP(),cde=lc();lde(jP,"factory",cde);MP.exports=jP});var xP=s(function(SZe,mde){mde.exports={idtype:"float64",ndtype:"float64"}});var GP=s(function(OZe,AP){"use strict";var hde=require("@stdlib/array/typed-real-float-dtypes"),pde=require("@stdlib/array/typed-real-dtypes"),yde=require("@stdlib/assert/is-plain-object"),av=require("@stdlib/assert/has-own-property"),au=require("@stdlib/string/format"),su=pde(),uu=hde();su.push("generic");uu.push("generic");function qde(r,e,t){if(!yde(e))return new TypeError(au("invalid argument. Options argument must be an object. Value: `%s`.",e));if(t===0){if(av(e,"idtype")&&(r.idtype=e.idtype,su.indexOf(r.idtype)<0))return new TypeError(au('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"idtype",su.join('", "'),r.idtype));if(av(e,"ndtype")&&(r.ndtype=e.ndtype,uu.indexOf(r.ndtype)<0))return new TypeError(au('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"ndtype",uu.join('", "'),r.ndtype))}else if(t===1&&av(e,"dtype")){if(r.dtype=e.dtype,su.indexOf(r.dtype)<0)return new TypeError(au('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",su.join('", "'),r.dtype))}else if(av(e,"dtype")&&(r.dtype=e.dtype,uu.indexOf(r.dtype)<0))return new TypeError(au('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",uu.join('", "'),r.dtype));return null}AP.exports=qde});var mc=s(function(EZe,CP){"use strict";var VP=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,FP=require("@stdlib/utils/define-nonenumerable-read-only-property"),sv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),bde=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),WP=ee(),IP=require("@stdlib/array/typed-real-ctors"),kP=require("@stdlib/array/base/filled-by"),zP=require("@stdlib/strided/base/nullary"),JP=require("@stdlib/string/format"),UP=xP(),cc=GP();function wde(){var r,e,t,i,n,a;if(t={idtype:UP.idtype,ndtype:UP.ndtype},e=arguments.length,i=u,e===0)n=WP;else if(e===1&&(r=arguments[0],n=WP.factory(r),a=cc(t,r,0),a))throw a;return sv(i,"seed",v),sv(i,"seedLength",g),bde(i,"state",m,h),sv(i,"stateLength",c),sv(i,"byteLength",l),FP(i,"PRNG",n),FP(i,"normalized",o),i;function u(p,d){var f,y,q,b,w;if(!VP(p))throw new TypeError(JP("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",p));if(w={},arguments.length>1&&(q=cc(w,d,1),q))throw q;return b=w.dtype||t.idtype,b==="generic"?kP(p,n):(f=IP(b),y=new f(p),zP([y],[p],[1],n),y)}function o(p,d){var f,y,q,b,w;if(!VP(p))throw new TypeError(JP("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",p));if(w={},arguments.length>1&&(q=cc(w,d,2),q))throw q;return b=w.dtype||t.ndtype,b==="generic"?kP(p,n.normalized):(f=IP(b),y=new f(p),zP([y],[p],[1],n.normalized),y)}function v(){return i.PRNG.seed}function g(){return i.PRNG.seedLength}function c(){return i.PRNG.stateLength}function l(){return i.PRNG.byteLength}function m(){return i.PRNG.state}function h(p){i.PRNG.state=p}}CP.exports=wde});var DP=s(function(_Ze,BP){"use strict";var Sde=mc(),Ode=Sde();BP.exports=Ode});var HP=s(function(NZe,YP){"use strict";var Ede=require("@stdlib/utils/define-nonenumerable-read-only-property"),XP=DP(),_de=mc();Ede(XP,"factory",_de);YP.exports=XP});var ZP=s(function(LZe,Nde){Nde.exports={idtype:"float64",ndtype:"float64"}});var $P=s(function(RZe,QP){"use strict";var Lde=require("@stdlib/array/typed-real-float-dtypes"),Rde=require("@stdlib/array/typed-real-dtypes"),Pde=require("@stdlib/assert/is-plain-object"),uv=require("@stdlib/assert/has-own-property"),ou=require("@stdlib/string/format"),vu=Rde(),gu=Lde();vu.push("generic");gu.push("generic");function Tde(r,e,t){if(!Pde(e))return new TypeError(ou("invalid argument. Options argument must be an object. Value: `%s`.",e));if(t===0){if(uv(e,"idtype")&&(r.idtype=e.idtype,vu.indexOf(r.idtype)<0))return new TypeError(ou('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"idtype",vu.join('", "'),r.idtype));if(uv(e,"ndtype")&&(r.ndtype=e.ndtype,gu.indexOf(r.ndtype)<0))return new TypeError(ou('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"ndtype",gu.join('", "'),r.ndtype))}else if(t===1&&uv(e,"dtype")){if(r.dtype=e.dtype,vu.indexOf(r.dtype)<0)return new TypeError(ou('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",vu.join('", "'),r.dtype))}else if(uv(e,"dtype")&&(r.dtype=e.dtype,gu.indexOf(r.dtype)<0))return new TypeError(ou('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",gu.join('", "'),r.dtype));return null}QP.exports=Tde});var pc=s(function(PZe,uT){"use strict";var KP=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,eT=require("@stdlib/utils/define-nonenumerable-read-only-property"),ov=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),jde=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),rT=T(),tT=require("@stdlib/array/typed-real-ctors"),iT=require("@stdlib/array/base/filled-by"),nT=require("@stdlib/strided/base/nullary"),aT=require("@stdlib/string/format"),sT=ZP(),hc=$P();function Mde(){var r,e,t,i,n,a;if(t={idtype:sT.idtype,ndtype:sT.ndtype},e=arguments.length,i=u,e===0)n=rT;else if(e===1&&(r=arguments[0],n=rT.factory(r),a=hc(t,r,0),a))throw a;return ov(i,"seed",v),ov(i,"seedLength",g),jde(i,"state",m,h),ov(i,"stateLength",c),ov(i,"byteLength",l),eT(i,"PRNG",n),eT(i,"normalized",o),i;function u(p,d){var f,y,q,b,w;if(!KP(p))throw new TypeError(aT("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",p));if(w={},arguments.length>1&&(q=hc(w,d,1),q))throw q;return b=w.dtype||t.idtype,b==="generic"?iT(p,n):(f=tT(b),y=new f(p),nT([y],[p],[1],n),y)}function o(p,d){var f,y,q,b,w;if(!KP(p))throw new TypeError(aT("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",p));if(w={},arguments.length>1&&(q=hc(w,d,2),q))throw q;return b=w.dtype||t.ndtype,b==="generic"?iT(p,n.normalized):(f=tT(b),y=new f(p),nT([y],[p],[1],n.normalized),y)}function v(){return i.PRNG.seed}function g(){return i.PRNG.seedLength}function c(){return i.PRNG.stateLength}function l(){return i.PRNG.byteLength}function m(){return i.PRNG.state}function h(p){i.PRNG.state=p}}uT.exports=Mde});var vT=s(function(TZe,oT){"use strict";var xde=pc(),Ade=xde();oT.exports=Ade});var dT=s(function(jZe,fT){"use strict";var Gde=require("@stdlib/utils/define-nonenumerable-read-only-property"),gT=vT(),Vde=pc();Gde(gT,"factory",Vde);fT.exports=gT});var cT=s(function(MZe,lT){"use strict";var Fde=require("@stdlib/math/base/special/exp");function Wde(r,e){for(var t=r(),i=1;t>Fde(-e);)i+=1,t*=r();return i-1}lT.exports=Wde});var yT=s(function(xZe,pT){"use strict";var Ide=require("@stdlib/math/base/special/factorialln"),mT=require("@stdlib/math/base/special/floor"),kde=require("@stdlib/math/base/special/signum"),zde=require("@stdlib/math/base/special/sqrt"),hT=require("@stdlib/math/base/special/abs"),vv=require("@stdlib/math/base/special/ln"),Jde=require("@stdlib/constants/float64/ln-sqrt-two-pi"),Ude=1/12,Cde=1/360;function Bde(r,e){var t,i,n,a,u,o,v,g,c,l;for(t=zde(e),v=2.53*t+.931,o=.02483*v-.059,i=1.1328/(v-3.4)+1.1239,u=-3.6224/(v-2)+.9277,n=.86*u;;){if(l=r(),l<=n)return c=l/u-.43,c*=2*o/(.5-hT(c))+v,c+=e+.445,mT(c);if(l>=u?c=r()-.5:(c=l/u-.93,c=kde(c)*.5-c,l=u*r()),a=.5-hT(c),(a>=.013||a>=l)&&(g=mT((2*o/a+v)*c+e+.445),l*=i/(o/(a*a)+v),c=(g+.5)*vv(e/g),c+=-e-Jde+g,c-=(Ude-Cde/(g*g))/g,g>=10&&c>=vv(l*t)||(c=g*vv(e)-e-Ide(g),g>=0&&g<=9&&c>=vv(l))))return g}}pT.exports=Bde});var bT=s(function(AZe,qT){"use strict";var Dde=cT(),Xde=yT();function Yde(r,e){return e<30?Dde(r,e):Xde(r,e)}qT.exports=Yde});var yc=s(function(GZe,LT){"use strict";var nt=require("@stdlib/utils/define-nonenumerable-read-only-property"),gv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),wT=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Hde=require("@stdlib/assert/is-positive-number").isPrimitive,ST=require("@stdlib/assert/is-plain-object"),OT=require("@stdlib/assert/is-function"),ET=require("@stdlib/assert/has-own-property"),_T=require("@stdlib/utils/constant-function"),Zde=require("@stdlib/utils/noop"),fv=T().factory,Qde=require("@stdlib/math/base/assert/is-nan"),$de=require("@stdlib/array/to-json"),dv=require("@stdlib/string/format"),NT=bT();function Kde(){var r,e,t,i;if(arguments.length===0)t=fv();else if(arguments.length===1&&ST(arguments[0]))if(e=arguments[0],ET(e,"prng")){if(!OT(e.prng))throw new TypeError(dv("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));t=e.prng}else t=fv(e);else{if(r=arguments[0],!Hde(r))throw new TypeError(dv("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(arguments.length>1){if(e=arguments[1],!ST(e))throw new TypeError(dv("invalid argument. Options argument must be an object. Value: `%s`.",e));if(ET(e,"prng")){if(!OT(e.prng))throw new TypeError(dv("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));t=e.prng}else t=fv(e)}else t=fv()}return r===void 0?i=m:i=l,nt(i,"NAME","poisson"),e&&e.prng?(nt(i,"seed",null),nt(i,"seedLength",null),wT(i,"state",_T(null),Zde),nt(i,"stateLength",null),nt(i,"byteLength",null),nt(i,"toJSON",_T(null)),nt(i,"PRNG",t)):(gv(i,"seed",n),gv(i,"seedLength",a),wT(i,"state",v,g),gv(i,"stateLength",u),gv(i,"byteLength",o),nt(i,"toJSON",c),nt(i,"PRNG",t),t=t.normalized),i;function n(){return t.seed}function a(){return t.seedLength}function u(){return t.stateLength}function o(){return t.byteLength}function v(){return t.state}function g(h){t.state=h}function c(){var h={};return h.type="PRNG",h.name=i.NAME,h.state=$de(t.state),r===void 0?h.params=[]:h.params=[r],h}function l(){return NT(t,r)}function m(h){return Qde(h)||h<=0?NaN:NT(t,h)}}LT.exports=Kde});var PT=s(function(VZe,RT){"use strict";var ele=yc(),rle=ele();RT.exports=rle});var Rt=s(function(FZe,jT){"use strict";var tle=require("@stdlib/utils/define-nonenumerable-read-only-property"),TT=PT(),ile=yc();tle(TT,"factory",ile);jT.exports=TT});var xT=s(function(WZe,MT){"use strict";var nle=require("@stdlib/assert/is-positive-number").isPrimitive,ale=require("@stdlib/assert/is-number").isPrimitive,qc=require("@stdlib/string/format"),sle=require("@stdlib/assert/is-nan");function ule(r,e){return nle(r)?!ale(e)||sle(e)?new TypeError(qc("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e)):e<=0||e>=1?new RangeError(qc("invalid argument. Second argument must be on the interval: (0, 1). Value: `%f`.",e)):null:new TypeError(qc("invalid argument. First argument must be a positive number. Value: `%s`.",r))}MT.exports=ule});var Oc=s(function(IZe,zT){"use strict";var Pt=require("@stdlib/utils/define-nonenumerable-read-only-property"),lv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),AT=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Wa=require("@stdlib/assert/has-own-property"),GT=require("@stdlib/assert/is-plain-object"),bc=require("@stdlib/assert/is-uint32array"),VT=require("@stdlib/assert/is-boolean").isPrimitive,FT=require("@stdlib/assert/is-function"),WT=require("@stdlib/utils/constant-function"),ole=require("@stdlib/utils/noop"),IT=require("@stdlib/math/base/assert/is-nan"),Ia=Rt().factory,cv=Ce().factory,wc=require("@stdlib/blas/base/gcopy"),Sc=require("@stdlib/array/uint32"),kT=require("@stdlib/object/assign"),vle=require("@stdlib/array/to-json"),at=require("@stdlib/string/format"),gle=xT();function fle(){var r,e,t,i,n,a,u,o,v,g;if(u=!0,arguments.length===0)i={copy:!1},t=Ia(i);else if(arguments.length===1){if(i=arguments[0],!GT(i))throw new TypeError(at("invalid argument. Options argument must be an object. Value: `%s`.",i));if(Wa(i,"copy")&&!VT(i.copy))throw new TypeError(at("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",i.copy));if(Wa(i,"prng")){if(!FT(i.prng))throw new TypeError(at("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",i.prng));t=Ia({prng:i.prng})}else{if(Wa(i,"state")&&!bc(i.state))throw new TypeError(at("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",i.state));i=kT({},i),i.copy===!1?u=!1:i.state&&(i.state=wc(i.state.length,i.state,1,new Sc(i.state.length),1)),i.copy=!1,t=Ia(i)}}else{if(g=arguments[0],v=arguments[1],o=gle(g,v),o)throw o;if(arguments.length>2){if(i=arguments[2],!GT(i))throw new TypeError(at("invalid argument. Options argument must be an object. Value: `%s`.",i));if(Wa(i,"copy")&&!VT(i.copy))throw new TypeError(at("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",i.copy));if(Wa(i,"prng")){if(!FT(i.prng))throw new TypeError(at("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",i.prng));t=Ia({prng:i.prng})}else{if(Wa(i,"state")&&!bc(i.state))throw new TypeError(at("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",i.state));i=kT({},i),i.copy===!1?u=!1:i.state&&(i.state=wc(i.state.length,i.state,1,new Sc(i.state.length),1)),i.copy=!1,t=Ia(i)}}else i={copy:!1},t=Ia(i)}return i&&i.prng?g===void 0?r=cv({prng:i.prng}):r=cv(g,v/(1-v),{prng:i.prng}):(i.state?e=i.state:(e=t.state,t.state=e),g===void 0?r=cv({state:e,copy:!1}):r=cv(g,v/(1-v),{state:e,copy:!1})),g===void 0?n=q:n=y,a=t.PRNG,Pt(n,"NAME","negative-binomial"),i&&i.prng?(Pt(n,"seed",null),Pt(n,"seedLength",null),AT(n,"state",WT(null),ole),Pt(n,"stateLength",null),Pt(n,"byteLength",null),Pt(n,"toJSON",WT(null))):(lv(n,"seed",c),lv(n,"seedLength",l),AT(n,"state",p,d),lv(n,"stateLength",m),lv(n,"byteLength",h),Pt(n,"toJSON",f)),Pt(n,"PRNG",a),n;function c(){return a.seed}function l(){return a.seedLength}function m(){return a.stateLength}function h(){return a.byteLength}function p(){return a.state}function d(b){if(!bc(b))throw new TypeError(at("invalid argument. Must provide a Uint32Array. Value: `%s`.",b));u&&(b=wc(b.length,b,1,new Sc(b.length),1)),a.state=b}function f(){var b={};return b.type="PRNG",b.name=n.NAME,b.state=vle(a.state),g===void 0?b.params=[]:b.params=[g,v],b}function y(){return t(r())}function q(b,w){return IT(b)||IT(w)||w<=0||w>=1?NaN:t(r(b,w/(1-w)))}}zT.exports=fle});var UT=s(function(kZe,JT){"use strict";var dle=Oc(),lle=dle();JT.exports=lle});var ka=s(function(zZe,BT){"use strict";var cle=require("@stdlib/utils/define-nonenumerable-read-only-property"),CT=UT(),mle=Oc();cle(CT,"factory",mle);BT.exports=CT});var Ec=s(function(JZe,DT){"use strict";var hle=F(),ple=require("@stdlib/array/dtypes"),yle=require("@stdlib/array/defaults"),qle=ka(),ble=ple("real_and_generic"),wle=hle(qle,ble,yle.get("dtypes.real"));DT.exports=wle});var YT=s(function(UZe,XT){"use strict";var Sle=Ec(),Ole=Sle();XT.exports=Ole});var QT=s(function(CZe,ZT){"use strict";var Ele=require("@stdlib/utils/define-nonenumerable-read-only-property"),HT=YT(),_le=Ec();Ele(HT,"factory",_le);ZT.exports=HT});var ej=s(function(BZe,KT){"use strict";var Nle=require("@stdlib/assert/is-number").isPrimitive,Lle=require("@stdlib/assert/is-positive-number").isPrimitive,$T=require("@stdlib/string/format"),Rle=require("@stdlib/assert/is-nan");function Ple(r,e){return!Nle(r)||Rle(r)?new TypeError($T("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):Lle(e)?null:new TypeError($T("invalid argument. Second argument must be a positive number. Value: `%s`.",e))}KT.exports=Ple});var tj=s(function(DZe,rj){"use strict";function Tle(r,e,t){return e+t*r()}rj.exports=Tle});var _c=s(function(XZe,gj){"use strict";var Tt=require("@stdlib/utils/define-nonenumerable-read-only-property"),mv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),ij=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),nj=require("@stdlib/assert/is-plain-object"),aj=require("@stdlib/assert/is-function"),sj=require("@stdlib/assert/has-own-property"),uj=require("@stdlib/utils/constant-function"),jle=require("@stdlib/utils/noop"),za=Q().factory,oj=require("@stdlib/math/base/assert/is-nan"),Mle=require("@stdlib/array/to-json"),hv=require("@stdlib/string/format"),xle=ej(),vj=tj();function Ale(){var r,e,t,i,n,a,u;if(arguments.length===0)e=za();else if(arguments.length===1){if(t=arguments[0],!nj(t))throw new TypeError(hv("invalid argument. Options argument must be an object. Value: `%s`.",t));if(sj(t,"prng")){if(!aj(t.prng))throw new TypeError(hv("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",t.prng));e=za({prng:t.prng})}else e=za(t)}else{if(u=arguments[0],r=arguments[1],a=xle(u,r),a)throw a;if(arguments.length>2){if(t=arguments[2],!nj(t))throw new TypeError(hv("invalid argument. Options argument must be an object. Value: `%s`.",t));if(sj(t,"prng")){if(!aj(t.prng))throw new TypeError(hv("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",t.prng));e=za({prng:t.prng})}else e=za(t)}else e=za()}return u===void 0?n=d:n=p,i=e.PRNG,Tt(n,"NAME","normal"),t&&t.prng?(Tt(n,"seed",null),Tt(n,"seedLength",null),ij(n,"state",uj(null),jle),Tt(n,"stateLength",null),Tt(n,"byteLength",null),Tt(n,"toJSON",uj(null))):(mv(n,"seed",o),mv(n,"seedLength",v),ij(n,"state",l,m),mv(n,"stateLength",g),mv(n,"byteLength",c),Tt(n,"toJSON",h)),Tt(n,"PRNG",i),n;function o(){return i.seed}function v(){return i.seedLength}function g(){return i.stateLength}function c(){return i.byteLength}function l(){return i.state}function m(f){i.state=f}function h(){var f={};return f.type="PRNG",f.name=n.NAME,f.state=Mle(i.state),u===void 0?f.params=[]:f.params=[u,r],f}function p(){return vj(e,u,r)}function d(f,y){return oj(f)||oj(y)||y<=0?NaN:vj(e,f,y)}}gj.exports=Ale});var dj=s(function(YZe,fj){"use strict";var Gle=_c(),Vle=Gle();fj.exports=Vle});var pn=s(function(HZe,cj){"use strict";var Fle=require("@stdlib/utils/define-nonenumerable-read-only-property"),lj=dj(),Wle=_c();Fle(lj,"factory",Wle);cj.exports=lj});var Nc=s(function(ZZe,mj){"use strict";var Ile=F(),kle=require("@stdlib/array/dtypes"),zle=require("@stdlib/array/defaults"),Jle=pn(),Ule=kle("real_floating_point_and_generic"),Cle=Ile(Jle,Ule,zle.get("dtypes.real_floating_point"));mj.exports=Cle});var pj=s(function(QZe,hj){"use strict";var Ble=Nc(),Dle=Ble();hj.exports=Dle});var bj=s(function($Ze,qj){"use strict";var Xle=require("@stdlib/utils/define-nonenumerable-read-only-property"),yj=pj(),Yle=Nc();Xle(yj,"factory",Yle);qj.exports=yj});var Ej=s(function(KZe,Oj){"use strict";var wj=require("@stdlib/assert/is-positive-number").isPrimitive,Sj=require("@stdlib/string/format");function Hle(r,e){return wj(r)?wj(e)?null:new TypeError(Sj("invalid argument. Second argument must be a positive number. Value: `%s`.",e)):new TypeError(Sj("invalid argument. First argument must be a positive number. Value: `%s`.",r))}Oj.exports=Hle});var Nj=s(function(eQe,_j){"use strict";var Zle=require("@stdlib/math/base/special/pow");function Qle(r,e,t){return t/Zle(r(),1/e)}_j.exports=Qle});var Lc=s(function(rQe,Aj){"use strict";var st=require("@stdlib/utils/define-nonenumerable-read-only-property"),pv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Lj=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Rj=require("@stdlib/assert/is-plain-object"),Pj=require("@stdlib/assert/is-function"),Tj=require("@stdlib/assert/has-own-property"),jj=require("@stdlib/utils/constant-function"),$le=require("@stdlib/utils/noop"),yv=T().factory,Mj=require("@stdlib/math/base/assert/is-nan"),Kle=require("@stdlib/array/to-json"),qv=require("@stdlib/string/format"),ece=Ej(),xj=Nj();function rce(){var r,e,t,i,n,a;if(arguments.length===0)i=yv();else if(arguments.length===1){if(t=arguments[0],!Rj(t))throw new TypeError(qv("invalid argument. Options argument must be an object. Value: `%s`.",t));if(Tj(t,"prng")){if(!Pj(t.prng))throw new TypeError(qv("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",t.prng));i=t.prng}else i=yv(t)}else{if(r=arguments[0],e=arguments[1],a=ece(r,e),a)throw a;if(arguments.length>2){if(t=arguments[2],!Rj(t))throw new TypeError(qv("invalid argument. Options argument must be an object. Value: `%s`.",t));if(Tj(t,"prng")){if(!Pj(t.prng))throw new TypeError(qv("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",t.prng));i=t.prng}else i=yv(t)}else i=yv()}return r===void 0?n=p:n=h,st(n,"NAME","pareto-type1"),t&&t.prng?(st(n,"seed",null),st(n,"seedLength",null),Lj(n,"state",jj(null),$le),st(n,"stateLength",null),st(n,"byteLength",null),st(n,"toJSON",jj(null)),st(n,"PRNG",i)):(pv(n,"seed",u),pv(n,"seedLength",o),Lj(n,"state",c,l),pv(n,"stateLength",v),pv(n,"byteLength",g),st(n,"toJSON",m),st(n,"PRNG",i),i=i.normalized),n;function u(){return i.seed}function o(){return i.seedLength}function v(){return i.stateLength}function g(){return i.byteLength}function c(){return i.state}function l(d){i.state=d}function m(){var d={};return d.type="PRNG",d.name=n.NAME,d.state=Kle(i.state),r===void 0?d.params=[]:d.params=[r,e],d}function h(){return xj(i,r,e)}function p(d,f){return Mj(d)||Mj(f)||d<=0||f<=0?NaN:xj(i,d,f)}}Aj.exports=rce});var Vj=s(function(tQe,Gj){"use strict";var tce=Lc(),ice=tce();Gj.exports=ice});var Ja=s(function(iQe,Wj){"use strict";var nce=require("@stdlib/utils/define-nonenumerable-read-only-property"),Fj=Vj(),ace=Lc();nce(Fj,"factory",ace);Wj.exports=Fj});var Rc=s(function(nQe,Ij){"use strict";var sce=F(),uce=require("@stdlib/array/dtypes"),oce=require("@stdlib/array/defaults"),vce=Ja(),gce=uce("real_floating_point_and_generic"),fce=sce(vce,gce,oce.get("dtypes.real_floating_point"));Ij.exports=fce});var zj=s(function(aQe,kj){"use strict";var dce=Rc(),lce=dce();kj.exports=lce});var Cj=s(function(sQe,Uj){"use strict";var cce=require("@stdlib/utils/define-nonenumerable-read-only-property"),Jj=zj(),mce=Rc();cce(Jj,"factory",mce);Uj.exports=Jj});var Pc=s(function(uQe,Bj){"use strict";var hce=Fr(),pce=require("@stdlib/array/dtypes"),yce=require("@stdlib/array/defaults"),qce=Rt(),bce=pce("real_and_generic"),wce=hce(qce,bce,yce.get("dtypes.real"));Bj.exports=wce});var Xj=s(function(oQe,Dj){"use strict";var Sce=Pc(),Oce=Sce();Dj.exports=Oce});var Zj=s(function(vQe,Hj){"use strict";var Ece=require("@stdlib/utils/define-nonenumerable-read-only-property"),Yj=Xj(),_ce=Pc();Ece(Yj,"factory",_ce);Hj.exports=Yj});var Qj=s(function(gQe,Nce){Nce.exports={name:"mt19937",copy:!0}});var Kj=s(function(fQe,$j){"use strict";var Lce=$(),Rce=ee(),Pce=T(),bv={};bv.minstd=Lce;bv["minstd-shuffle"]=Rce;bv.mt19937=Pce;$j.exports=bv});var Tc=s(function(dQe,r0){"use strict";var fu=require("@stdlib/utils/define-nonenumerable-read-only-property"),wv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Tce=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),jce=require("@stdlib/assert/is-plain-object"),Mce=require("@stdlib/assert/is-boolean").isPrimitive,Sv=require("@stdlib/assert/has-own-property"),xce=require("@stdlib/array/to-json"),du=require("@stdlib/string/format"),e0=Qj(),Ace=Kj();function Gce(r){var e,t,i;if(e={name:e0.name,copy:e0.copy},arguments.length){if(!jce(r))throw new TypeError(du("invalid argument. Must provide an object. Value: `%s`.",r));if(Sv(r,"name")&&(e.name=r.name),Sv(r,"state")){if(e.state=r.state,e.state===void 0)throw new TypeError(du("invalid option. `%s` option cannot be undefined. Option: `%s`.","state",e.state))}else if(Sv(r,"seed")&&(e.seed=r.seed,e.seed===void 0))throw new TypeError(du("invalid option. `%s` option cannot be undefined. Option: `%s`.","seed",e.seed));if(Sv(r,"copy")&&(e.copy=r.copy,!Mce(e.copy)))throw new TypeError(du("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",e.copy))}if(i=Ace[e.name],i===void 0)throw new Error(du("invalid option. Unrecognized/unsupported PRNG. Option: `%s`.",e.name));return e.state===void 0?e.seed===void 0?t=i.factory():t=i.factory({seed:e.seed}):t=i.factory({state:e.state,copy:e.copy}),fu(l,"NAME","randu"),wv(l,"seed",n),wv(l,"seedLength",a),Tce(l,"state",v,g),wv(l,"stateLength",u),wv(l,"byteLength",o),fu(l,"toJSON",c),fu(l,"PRNG",t),fu(l,"MIN",t.normalized.MIN),fu(l,"MAX",t.normalized.MAX),l;function n(){return t.seed}function a(){return t.seedLength}function u(){return t.stateLength}function o(){return t.byteLength}function v(){return t.state}function g(m){t.state=m}function c(){var m={};return m.type="PRNG",m.name=l.NAME+"-"+t.NAME,m.state=xce(t.state),m.params=[],m}function l(){return t.normalized()}}r0.exports=Gce});var i0=s(function(lQe,t0){"use strict";var Vce=Tc(),Fce=Vce();t0.exports=Fce});var jt=s(function(cQe,a0){"use strict";var Wce=require("@stdlib/utils/define-nonenumerable-read-only-property"),n0=i0(),Ice=Tc();Wce(n0,"factory",Ice);a0.exports=n0});var s0=s(function(mQe,kce){kce.exports={dtype:"float64"}});var v0=s(function(hQe,o0){"use strict";var zce=require("@stdlib/array/typed-real-float-dtypes"),Jce=require("@stdlib/assert/is-plain-object"),Uce=require("@stdlib/assert/has-own-property"),u0=require("@stdlib/string/format"),jc=zce();jc.push("generic");function Cce(r,e){return Jce(e)?Uce(e,"dtype")&&(r.dtype=e.dtype,jc.indexOf(r.dtype)<0)?new TypeError(u0('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",jc.join('", "'),r.dtype)):null:new TypeError(u0("invalid argument. Options argument must be an object. Value: `%s`.",e))}o0.exports=Cce});var Mc=s(function(pQe,d0){"use strict";var Bce=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Dce=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ov=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Xce=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),g0=jt(),Yce=require("@stdlib/array/typed-real-float-ctors"),Hce=require("@stdlib/array/base/filled-by"),Zce=require("@stdlib/strided/base/nullary"),Qce=require("@stdlib/string/format"),$ce=s0(),f0=v0();function Kce(){var r,e,t,i,n,a;if(t={dtype:$ce.dtype},e=arguments.length,i=u,e===0)n=g0;else if(e===1&&(r=arguments[0],n=g0.factory(r),a=f0(t,r),a))throw a;return Ov(i,"seed",o),Ov(i,"seedLength",v),Xce(i,"state",l,m),Ov(i,"stateLength",g),Ov(i,"byteLength",c),Dce(i,"PRNG",n.PRNG),i;function u(h,p){var d,f,y,q,b;if(!Bce(h))throw new TypeError(Qce("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",h));if(b={},arguments.length>1&&(y=f0(b,p),y))throw y;return q=b.dtype||t.dtype,q==="generic"?Hce(h,n):(d=Yce(q),f=new d(h),Zce([f],[h],[1],n),f)}function o(){return i.PRNG.seed}function v(){return i.PRNG.seedLength}function g(){return i.PRNG.stateLength}function c(){return i.PRNG.byteLength}function l(){return i.PRNG.state}function m(h){i.PRNG.state=h}}d0.exports=Kce});var c0=s(function(yQe,l0){"use strict";var eme=Mc(),rme=eme();l0.exports=rme});var p0=s(function(qQe,h0){"use strict";var tme=require("@stdlib/utils/define-nonenumerable-read-only-property"),m0=c0(),ime=Mc();tme(m0,"factory",ime);h0.exports=m0});var q0=s(function(bQe,y0){"use strict";var nme=require("@stdlib/math/base/special/sqrt"),ame=require("@stdlib/math/base/special/ln");function sme(r,e){return e*nme(-2*ame(r()))}y0.exports=sme});var xc=s(function(wQe,N0){"use strict";var ut=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ev=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),b0=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),ume=require("@stdlib/assert/is-positive-number").isPrimitive,w0=require("@stdlib/assert/is-plain-object"),S0=require("@stdlib/assert/is-function"),O0=require("@stdlib/assert/has-own-property"),E0=require("@stdlib/utils/constant-function"),ome=require("@stdlib/utils/noop"),_v=T().factory,vme=require("@stdlib/math/base/assert/is-nan"),gme=require("@stdlib/array/to-json"),Nv=require("@stdlib/string/format"),_0=q0();function fme(){var r,e,t,i;if(arguments.length===0)t=_v();else if(arguments.length===1&&w0(arguments[0]))if(e=arguments[0],O0(e,"prng")){if(!S0(e.prng))throw new TypeError(Nv("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));t=e.prng}else t=_v(e);else{if(r=arguments[0],!ume(r))throw new TypeError(Nv("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(arguments.length>1){if(e=arguments[1],!w0(e))throw new TypeError(Nv("invalid argument. Options argument must be an object. Value: `%s`.",e));if(O0(e,"prng")){if(!S0(e.prng))throw new TypeError(Nv("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));t=e.prng}else t=_v(e)}else t=_v()}return r===void 0?i=m:i=l,ut(i,"NAME","rayleigh"),e&&e.prng?(ut(i,"seed",null),ut(i,"seedLength",null),b0(i,"state",E0(null),ome),ut(i,"stateLength",null),ut(i,"byteLength",null),ut(i,"toJSON",E0(null)),ut(i,"PRNG",t)):(Ev(i,"seed",n),Ev(i,"seedLength",a),b0(i,"state",v,g),Ev(i,"stateLength",u),Ev(i,"byteLength",o),ut(i,"toJSON",c),ut(i,"PRNG",t),t=t.normalized),i;function n(){return t.seed}function a(){return t.seedLength}function u(){return t.stateLength}function o(){return t.byteLength}function v(){return t.state}function g(h){t.state=h}function c(){var h={};return h.type="PRNG",h.name=i.NAME,h.state=gme(t.state),r===void 0?h.params=[]:h.params=[r],h}function l(){return _0(t,r)}function m(h){return vme(h)||h<=0?NaN:_0(t,h)}}N0.exports=fme});var R0=s(function(SQe,L0){"use strict";var dme=xc(),lme=dme();L0.exports=lme});var Ua=s(function(OQe,T0){"use strict";var cme=require("@stdlib/utils/define-nonenumerable-read-only-property"),P0=R0(),mme=xc();cme(P0,"factory",mme);T0.exports=P0});var Ac=s(function(EQe,j0){"use strict";var hme=Fr(),pme=require("@stdlib/array/dtypes"),yme=require("@stdlib/array/defaults"),qme=Ua(),bme=pme("real_floating_point_and_generic"),wme=hme(qme,bme,yme.get("dtypes.real_floating_point"));j0.exports=wme});var x0=s(function(_Qe,M0){"use strict";var Sme=Ac(),Ome=Sme();M0.exports=Ome});var V0=s(function(NQe,G0){"use strict";var Eme=require("@stdlib/utils/define-nonenumerable-read-only-property"),A0=x0(),_me=Ac();Eme(A0,"factory",_me);G0.exports=A0});var Wc=s(function(LQe,B0){"use strict";var Mt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Lv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),F0=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Ca=require("@stdlib/assert/has-own-property"),W0=require("@stdlib/assert/is-positive-number").isPrimitive,I0=require("@stdlib/assert/is-plain-object"),Gc=require("@stdlib/assert/is-uint32array"),k0=require("@stdlib/assert/is-boolean").isPrimitive,Nme=require("@stdlib/math/base/assert/is-nan"),z0=require("@stdlib/assert/is-function"),J0=require("@stdlib/utils/constant-function"),Lme=require("@stdlib/utils/noop"),Rv=Xe().factory,Ba=Q().factory,Vc=require("@stdlib/blas/base/gcopy"),Fc=require("@stdlib/array/uint32"),U0=require("@stdlib/object/assign"),Rme=require("@stdlib/array/to-json"),Ye=require("@stdlib/string/format"),C0=require("@stdlib/math/base/special/sqrt");function Pme(){var r,e,t,i,n,a,u,o;if(u=!0,arguments.length===0)n={copy:!1},t=Ba(n);else if(arguments.length===1)if(I0(arguments[0])){if(n=arguments[0],Ca(n,"copy")&&!k0(n.copy))throw new TypeError(Ye("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",n.copy));if(Ca(n,"prng")){if(!z0(n.prng))throw new TypeError(Ye("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",n.prng));t=Ba({prng:n.prng})}else{if(Ca(n,"state")&&!Gc(n.state))throw new TypeError(Ye("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",n.state));n=U0({},n),n.copy===!1?u=!1:n.state&&(n.state=Vc(n.state.length,n.state,1,new Fc(n.state.length),1)),n.copy=!1,t=Ba(n)}}else{if(o=arguments[0],!W0(o))throw new TypeError(Ye("invalid argument. First argument must be a positive number or an options object. Value: `%s`.",o));n={copy:!1},t=Ba(n)}else{if(o=arguments[0],!W0(o))throw new TypeError(Ye("invalid argument. First argument must be a positive number. Value: `%s`.",o));if(n=arguments[1],!I0(n))throw new TypeError(Ye("invalid argument. Options argument must be an object. Value: `%s`.",n));if(Ca(n,"copy")&&!k0(n.copy))throw new TypeError(Ye("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",n.copy));if(Ca(n,"prng")){if(!z0(n.prng))throw new TypeError(Ye("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",n.prng));t=Ba({prng:n.prng})}else{if(Ca(n,"state")&&!Gc(n.state))throw new TypeError(Ye("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",n.state));n=U0({},n),n.copy===!1?u=!1:n.state&&(n.state=Vc(n.state.length,n.state,1,new Fc(n.state.length),1)),n.copy=!1,t=Ba(n)}}return n&&n.prng?o===void 0?r=Rv({prng:n.prng}):r=Rv(o,{prng:n.prng}):(n.state?e=n.state:(e=t.state,t.state=e),o===void 0?r=Rv({state:e,copy:!1}):r=Rv(o,{state:e,copy:!1})),o===void 0?a=f:a=d,i=t.PRNG,Mt(a,"NAME","t"),n&&n.prng?(Mt(a,"seed",null),Mt(a,"seedLength",null),F0(a,"state",J0(null),Lme),Mt(a,"stateLength",null),Mt(a,"byteLength",null),Mt(a,"toJSON",J0(null))):(Lv(a,"seed",v),Lv(a,"seedLength",g),F0(a,"state",m,h),Lv(a,"stateLength",c),Lv(a,"byteLength",l),Mt(a,"toJSON",p)),Mt(a,"PRNG",i),a;function v(){return i.seed}function g(){return i.seedLength}function c(){return i.stateLength}function l(){return i.byteLength}function m(){return i.state}function h(y){if(!Gc(y))throw new TypeError(Ye("invalid argument. Must provide a Uint32Array. Value: `%s`.",y));u&&(y=Vc(y.length,y,1,new Fc(y.length),1)),i.state=y}function p(){var y={};return y.type="PRNG",y.name=a.NAME,y.state=Rme(i.state),o===void 0?y.params=[]:y.params=[o],y}function d(){return t()/C0(r()/o)}function f(y){return Nme(y)||y<=0?NaN:t()/C0(r(y)/y)}}B0.exports=Pme});var X0=s(function(RQe,D0){"use strict";var Tme=Wc(),jme=Tme();D0.exports=jme});var Da=s(function(PQe,H0){"use strict";var Mme=require("@stdlib/utils/define-nonenumerable-read-only-property"),Y0=X0(),xme=Wc();Mme(Y0,"factory",xme);H0.exports=Y0});var Ic=s(function(TQe,Z0){"use strict";var Ame=Fr(),Gme=require("@stdlib/array/dtypes"),Vme=require("@stdlib/array/defaults"),Fme=Da(),Wme=Gme("real_floating_point_and_generic"),Ime=Ame(Fme,Wme,Vme.get("dtypes.real_floating_point"));Z0.exports=Ime});var $0=s(function(jQe,Q0){"use strict";var kme=Ic(),zme=kme();Q0.exports=zme});var rM=s(function(MQe,eM){"use strict";var Jme=require("@stdlib/utils/define-nonenumerable-read-only-property"),K0=$0(),Ume=Ic();Jme(K0,"factory",Ume);eM.exports=K0});var iM=s(function(xQe,tM){"use strict";var kc=require("@stdlib/assert/is-number").isPrimitive,Pv=require("@stdlib/string/format"),zc=require("@stdlib/assert/is-nan");function Cme(r,e,t){return!kc(r)||zc(r)?new TypeError(Pv("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):!kc(e)||zc(e)?new TypeError(Pv("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e)):!kc(t)||zc(t)?new TypeError(Pv("invalid argument. Third argument must be a number and not NaN. Value: `%s`.",t)):r<=t&&t<=e?null:new RangeError(Pv("invalid arguments. Parameters must satisfy the following condition: %s. a: `%f`. b: `%f`. c: `%f`.","a <= c <= b",r,e,t))}tM.exports=Cme});var sM=s(function(AQe,aM){"use strict";var nM=require("@stdlib/math/base/special/sqrt");function Bme(r,e,t,i){var n,a,u;return n=(i-e)/(t-e),u=r(),u3){if(r=arguments[3],!oM(r))throw new TypeError(Mv("invalid argument. Options argument must be an object. Value: `%s`.",r));if(gM(r,"prng")){if(!vM(r.prng))throw new TypeError(Mv("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=jv(r)}else e=jv()}return n===void 0?t=d:t=p,ot(t,"NAME","triangular"),r&&r.prng?(ot(t,"seed",null),ot(t,"seedLength",null),uM(t,"state",fM(null),Dme),ot(t,"stateLength",null),ot(t,"byteLength",null),ot(t,"toJSON",fM(null)),ot(t,"PRNG",e)):(Tv(t,"seed",o),Tv(t,"seedLength",v),uM(t,"state",l,m),Tv(t,"stateLength",g),Tv(t,"byteLength",c),ot(t,"toJSON",h),ot(t,"PRNG",e),e=e.normalized),t;function o(){return e.seed}function v(){return e.seedLength}function g(){return e.stateLength}function c(){return e.byteLength}function l(){return e.state}function m(f){e.state=f}function h(){var f={};return f.type="PRNG",f.name=t.NAME,f.state=Xme(e.state),n===void 0?f.params=[]:f.params=[n,a,u],f}function p(){return dM(e,n,a,u)}function d(f,y,q){return Jc(f)||Jc(y)||Jc(q)||!(f<=q&&q<=y)?NaN:dM(e,f,y,q)}}lM.exports=Hme});var mM=s(function(VQe,cM){"use strict";var Zme=Uc(),Qme=Zme();cM.exports=Qme});var Xa=s(function(FQe,pM){"use strict";var $me=require("@stdlib/utils/define-nonenumerable-read-only-property"),hM=mM(),Kme=Uc();$me(hM,"factory",Kme);pM.exports=hM});var Cc=s(function(WQe,yM){"use strict";var ehe=bo(),rhe=require("@stdlib/array/dtypes"),the=require("@stdlib/array/defaults"),ihe=Xa(),nhe=rhe("real_floating_point_and_generic"),ahe=ehe(ihe,nhe,the.get("dtypes.real_floating_point"));yM.exports=ahe});var bM=s(function(IQe,qM){"use strict";var she=Cc(),uhe=she();qM.exports=uhe});var OM=s(function(kQe,SM){"use strict";var ohe=require("@stdlib/utils/define-nonenumerable-read-only-property"),wM=bM(),vhe=Cc();ohe(wM,"factory",vhe);SM.exports=wM});var LM=s(function(zQe,NM){"use strict";var EM=require("@stdlib/assert/is-number").isPrimitive,Bc=require("@stdlib/string/format"),_M=require("@stdlib/assert/is-nan");function ghe(r,e){return!EM(r)||_M(r)?new TypeError(Bc("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):!EM(e)||_M(e)?new TypeError(Bc("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e)):r>=e?new RangeError(Bc("invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.",r,e)):null}NM.exports=ghe});var PM=s(function(JQe,RM){"use strict";function fhe(r,e,t){var i=r();return t*i+(1-i)*e}RM.exports=fhe});var Dc=s(function(UQe,FM){"use strict";var vt=require("@stdlib/utils/define-nonenumerable-read-only-property"),xv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),TM=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),jM=require("@stdlib/assert/is-plain-object"),MM=require("@stdlib/assert/is-function"),xM=require("@stdlib/assert/has-own-property"),AM=require("@stdlib/utils/constant-function"),dhe=require("@stdlib/utils/noop"),Av=T().factory,GM=require("@stdlib/math/base/assert/is-nan"),lhe=require("@stdlib/array/to-json"),Gv=require("@stdlib/string/format"),che=LM(),VM=PM();function mhe(){var r,e,t,i,n,a;if(arguments.length===0)e=Av();else if(arguments.length===1){if(r=arguments[0],!jM(r))throw new TypeError(Gv("invalid argument. Options argument must be an object. Value: `%s`.",r));if(xM(r,"prng")){if(!MM(r.prng))throw new TypeError(Gv("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Av(r)}else{if(n=arguments[0],a=arguments[1],i=che(n,a),i)throw i;if(arguments.length>2){if(r=arguments[2],!jM(r))throw new TypeError(Gv("invalid argument. Options argument must be an object. Value: `%s`.",r));if(xM(r,"prng")){if(!MM(r.prng))throw new TypeError(Gv("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Av(r)}else e=Av()}return n===void 0?t=p:t=h,vt(t,"NAME","uniform"),r&&r.prng?(vt(t,"seed",null),vt(t,"seedLength",null),TM(t,"state",AM(null),dhe),vt(t,"stateLength",null),vt(t,"byteLength",null),vt(t,"toJSON",AM(null)),vt(t,"PRNG",e)):(xv(t,"seed",u),xv(t,"seedLength",o),TM(t,"state",c,l),xv(t,"stateLength",v),xv(t,"byteLength",g),vt(t,"toJSON",m),vt(t,"PRNG",e),e=e.normalized),t;function u(){return e.seed}function o(){return e.seedLength}function v(){return e.stateLength}function g(){return e.byteLength}function c(){return e.state}function l(d){e.state=d}function m(){var d={};return d.type="PRNG",d.name=t.NAME,d.state=lhe(e.state),n===void 0?d.params=[]:d.params=[n,a],d}function h(){return VM(e,n,a)}function p(d,f){return GM(d)||GM(f)||d>=f?NaN:VM(e,d,f)}}FM.exports=mhe});var IM=s(function(CQe,WM){"use strict";var hhe=Dc(),phe=hhe();WM.exports=phe});var yn=s(function(BQe,zM){"use strict";var yhe=require("@stdlib/utils/define-nonenumerable-read-only-property"),kM=IM(),qhe=Dc();yhe(kM,"factory",qhe);zM.exports=kM});var Xc=s(function(DQe,JM){"use strict";var bhe=F(),whe=require("@stdlib/array/dtypes"),She=require("@stdlib/array/defaults"),Ohe=yn(),Ehe=whe("real_floating_point_and_generic"),_he=bhe(Ohe,Ehe,She.get("dtypes.real_floating_point"));JM.exports=_he});var CM=s(function(XQe,UM){"use strict";var Nhe=Xc(),Lhe=Nhe();UM.exports=Lhe});var XM=s(function(YQe,DM){"use strict";var Rhe=require("@stdlib/utils/define-nonenumerable-read-only-property"),BM=CM(),Phe=Xc();Rhe(BM,"factory",Phe);DM.exports=BM});var QM=s(function(HQe,ZM){"use strict";var YM=require("@stdlib/assert/is-positive-number").isPrimitive,HM=require("@stdlib/string/format");function The(r,e){return YM(r)?YM(e)?null:new TypeError(HM("invalid argument. Shape parameter must be a positive number. Value: `%s`.",e)):new TypeError(HM("invalid argument. Scale parameter must be a positive number. Value: `%s`.",r))}ZM.exports=The});var KM=s(function(ZQe,$M){"use strict";var jhe=require("@stdlib/math/base/special/pow"),Mhe=require("@stdlib/math/base/special/ln");function xhe(r,e,t){return t*jhe(-Mhe(1-r()),1/e)}$M.exports=xhe});var Yc=s(function(QQe,ux){"use strict";var gt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Vv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),ex=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),rx=require("@stdlib/assert/is-plain-object"),tx=require("@stdlib/assert/is-function"),ix=require("@stdlib/assert/has-own-property"),nx=require("@stdlib/utils/constant-function"),Ahe=require("@stdlib/utils/noop"),Fv=T().factory,ax=require("@stdlib/math/base/assert/is-nan"),Ghe=require("@stdlib/array/to-json"),Wv=require("@stdlib/string/format"),Vhe=QM(),sx=KM();function Fhe(){var r,e,t,i,n,a;if(arguments.length===0)t=Fv();else if(arguments.length===1){if(e=arguments[0],!rx(e))throw new TypeError(Wv("invalid argument. Options argument must be an object. Value: `%s`.",e));if(ix(e,"prng")){if(!tx(e.prng))throw new TypeError(Wv("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));t=e.prng}else t=Fv(e)}else{if(a=arguments[0],r=arguments[1],n=Vhe(r,a),n)throw n;if(arguments.length>2){if(e=arguments[2],!rx(e))throw new TypeError(Wv("invalid argument. Options argument must be an object. Value: `%s`.",e));if(ix(e,"prng")){if(!tx(e.prng))throw new TypeError(Wv("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));t=e.prng}else t=Fv(e)}else t=Fv()}return r===void 0?i=p:i=h,gt(i,"NAME","weibull"),e&&e.prng?(gt(i,"seed",null),gt(i,"seedLength",null),ex(i,"state",nx(null),Ahe),gt(i,"stateLength",null),gt(i,"byteLength",null),gt(i,"toJSON",nx(null)),gt(i,"PRNG",t)):(Vv(i,"seed",u),Vv(i,"seedLength",o),ex(i,"state",c,l),Vv(i,"stateLength",v),Vv(i,"byteLength",g),gt(i,"toJSON",m),gt(i,"PRNG",t),t=t.normalized),i;function u(){return t.seed}function o(){return t.seedLength}function v(){return t.stateLength}function g(){return t.byteLength}function c(){return t.state}function l(d){t.state=d}function m(){var d={};return d.type="PRNG",d.name=i.NAME,d.state=Ghe(t.state),a===void 0?d.params=[]:d.params=[a,r],d}function h(){return sx(t,a,r)}function p(d,f){return ax(d)||ax(f)||d<=0||f<=0?NaN:sx(t,d,f)}}ux.exports=Fhe});var vx=s(function($Qe,ox){"use strict";var Whe=Yc(),Ihe=Whe();ox.exports=Ihe});var qn=s(function(KQe,fx){"use strict";var khe=require("@stdlib/utils/define-nonenumerable-read-only-property"),gx=vx(),zhe=Yc();khe(gx,"factory",zhe);fx.exports=gx});var Hc=s(function(e$e,dx){"use strict";var Jhe=F(),Uhe=require("@stdlib/array/dtypes"),Che=require("@stdlib/array/defaults"),Bhe=qn(),Dhe=Uhe("real_floating_point_and_generic"),Xhe=Jhe(Bhe,Dhe,Che.get("dtypes.real_floating_point"));dx.exports=Xhe});var cx=s(function(r$e,lx){"use strict";var Yhe=Hc(),Hhe=Yhe();lx.exports=Hhe});var px=s(function(t$e,hx){"use strict";var Zhe=require("@stdlib/utils/define-nonenumerable-read-only-property"),mx=cx(),Qhe=Hc();Zhe(mx,"factory",Qhe);hx.exports=mx});var qx=s(function(i$e,yx){"use strict";var M=require("@stdlib/utils/define-read-only-property"),j={};M(j,"arcsine",ny());M(j,"bernoulli",Ay());M(j,"beta",kq());M(j,"betaprime",Tb());M(j,"binomial",sw());M(j,"cauchy",Pw());M(j,"chi",tS());M(j,"chisquare",oS());M(j,"cosine",jS());M(j,"discreteUniform",tO());M(j,"erlang",_O());M(j,"exponential",CO());M(j,"f",cE());M(j,"frechet",ZE());M(j,"gamma",t_());M(j,"geometric",S_());M(j,"gumbel",D_());M(j,"hypergeometric",hN());M(j,"invgamma",FN());M(j,"kumaraswamy",oL());M(j,"laplace",jL());M(j,"levy",eR());M(j,"logistic",OR());M(j,"lognormal",DR());M(j,"minstd",qP());M(j,"minstdShuffle",HP());M(j,"mt19937",dT());M(j,"negativeBinomial",QT());M(j,"normal",bj());M(j,"pareto1",Cj());M(j,"poisson",Zj());M(j,"randu",p0());M(j,"rayleigh",V0());M(j,"t",rM());M(j,"triangular",OM());M(j,"uniform",XM());M(j,"weibull",px());yx.exports=j});var wx=s(function(n$e,bx){"use strict";var $he=require("@stdlib/math/base/special/sqrt"),Khe=require("@stdlib/math/base/special/ln"),epe=require("@stdlib/math/base/special/sin"),rpe=require("@stdlib/math/base/special/cos"),tpe=require("@stdlib/constants/float64/two-pi");function ipe(r){var e,t;return e=!0,i;function i(){var n,a,u,o;if(e){do n=r(),a=r();while(n===0);return u=$he(-2*Khe(n)),o=tpe*a,t=u*rpe(o),e=!1,u*epe(o)}return e=!0,t}}bx.exports=ipe});var Ox=s(function(a$e,Sx){"use strict";var npe=require("@stdlib/math/base/special/sqrt"),ape=require("@stdlib/math/base/special/ln"),spe=require("@stdlib/math/base/special/cos"),upe=require("@stdlib/constants/float64/pi"),ope=spe(upe);function vpe(r){var e=npe(-2*ape(r));return e*ope}Sx.exports=vpe});var _x=s(function(s$e,Ex){"use strict";var gpe=require("@stdlib/math/base/special/sqrt"),fpe=require("@stdlib/math/base/special/ln"),dpe=require("@stdlib/math/base/special/cos"),lpe=require("@stdlib/constants/float64/two-pi");function cpe(r){var e=gpe(-2*fpe(r)),t=lpe*r;return e*dpe(t)}Ex.exports=cpe});var Zc=s(function(u$e,Px){"use strict";var re=require("@stdlib/utils/define-nonenumerable-read-only-property"),Iv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Nx=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),mpe=require("@stdlib/assert/is-plain-object"),hpe=require("@stdlib/assert/is-function"),ppe=require("@stdlib/assert/is-boolean").isPrimitive,lu=require("@stdlib/assert/has-own-property"),ype=require("@stdlib/assert/is-uint32array"),Lx=T().factory,Rx=require("@stdlib/utils/constant-function"),qpe=require("@stdlib/utils/noop"),bpe=require("@stdlib/array/to-json"),cu=require("@stdlib/string/format"),wpe=wx(),Spe=Ox(),Ope=_x();function Epe(r){var e,t,i,n;if(n={copy:!0},arguments.length){if(!mpe(r))throw new TypeError(cu("invalid argument. Must provide an object. Value: `%s`.",r));if(lu(r,"copy")&&(n.copy=r.copy,!ppe(r.copy)))throw new TypeError(cu("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",r.copy));if(lu(r,"prng")){if(!hpe(r.prng))throw new TypeError(cu("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else if(lu(r,"state")){if(n.state=r.state,!ype(r.state))throw new TypeError(cu("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",r.state))}else if(lu(r,"seed")&&(n.seed=r.seed,r.seed===void 0))throw new TypeError(cu("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",r.seed))}return n.state===void 0?e===void 0?(i=Lx(n),e=i.normalized):n.seed=null:(i=Lx(n),e=i.normalized),t=wpe(e),re(t,"NAME","box-muller"),n.seed===null?(re(t,"seed",null),re(t,"seedLength",null)):(Iv(t,"seed",a),Iv(t,"seedLength",u)),r&&r.prng?(Nx(t,"state",Rx(null),qpe),re(t,"stateLength",null),re(t,"byteLength",null),re(t,"toJSON",Rx(null))):(Nx(t,"state",g,c),Iv(t,"stateLength",o),Iv(t,"byteLength",v),re(t,"toJSON",l)),re(t,"PRNG",e),lu(e,"MIN")?(re(t,"MIN",Spe(e.MIN)),re(t,"MAX",Ope(e.MIN))):(re(t,"MIN",null),re(t,"MAX",null)),t;function a(){return i.seed}function u(){return i.seedLength}function o(){return i.stateLength}function v(){return i.byteLength}function g(){return i.state}function c(m){i.state=m}function l(){var m={};return m.type="PRNG",m.name=t.NAME,m.state=bpe(i.state),m.params=[],m}}Px.exports=Epe});var jx=s(function(o$e,Tx){"use strict";var _pe=Zc(),Npe=_pe();Tx.exports=Npe});var Ya=s(function(v$e,xx){"use strict";var Lpe=require("@stdlib/utils/define-nonenumerable-read-only-property"),Mx=jx(),Rpe=Zc();Lpe(Mx,"factory",Rpe);xx.exports=Mx});var Ax=s(function(g$e,Ppe){Ppe.exports={name:"mt19937",copy:!0}});var Vx=s(function(f$e,Gx){"use strict";var Tpe=$(),jpe=ee(),Mpe=T(),kv={};kv.minstd=Tpe;kv["minstd-shuffle"]=jpe;kv.mt19937=Mpe;Gx.exports=kv});var Qc=s(function(d$e,Wx){"use strict";var mu=require("@stdlib/utils/define-nonenumerable-read-only-property"),zv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),xpe=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Ape=require("@stdlib/assert/is-plain-object"),Gpe=require("@stdlib/assert/is-boolean").isPrimitive,Jv=require("@stdlib/assert/has-own-property"),Vpe=require("@stdlib/array/to-json"),hu=require("@stdlib/string/format"),Fx=Ax(),Fpe=Vx();function Wpe(r){var e,t,i;if(e={name:Fx.name,copy:Fx.copy},arguments.length){if(!Ape(r))throw new TypeError(hu("invalid argument. Must provide an object. Value: `%s`.",r));if(Jv(r,"name")&&(e.name=r.name),Jv(r,"state")){if(e.state=r.state,e.state===void 0)throw new TypeError(hu("invalid option. `%s` option cannot be undefined. Option: `%s`.","state",e.state))}else if(Jv(r,"seed")&&(e.seed=r.seed,e.seed===void 0))throw new TypeError(hu("invalid option. `%s` option cannot be undefined. Option: `%s`.","seed",e.seed));if(Jv(r,"copy")&&(e.copy=r.copy,!Gpe(e.copy)))throw new TypeError(hu("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",e.copy))}if(i=Fpe[e.name],i===void 0)throw new Error(hu("invalid option. Unrecognized/unsupported PRNG. Option: `%s`.",e.name));return e.state===void 0?e.seed===void 0?t=i.factory():t=i.factory({seed:e.seed}):t=i.factory({state:e.state,copy:e.copy}),mu(l,"NAME","randi"),zv(l,"seed",n),zv(l,"seedLength",a),xpe(l,"state",v,g),zv(l,"stateLength",u),zv(l,"byteLength",o),mu(l,"toJSON",c),mu(l,"PRNG",t),mu(l,"MIN",t.MIN),mu(l,"MAX",t.MAX),l;function n(){return t.seed}function a(){return t.seedLength}function u(){return t.stateLength}function o(){return t.byteLength}function v(){return t.state}function g(m){t.state=m}function c(){var m={};return m.type="PRNG",m.name=l.NAME+"-"+t.NAME,m.state=Vpe(t.state),m.params=[],m}function l(){return t()}}Wx.exports=Wpe});var kx=s(function(l$e,Ix){"use strict";var Ipe=Qc(),kpe=Ipe();Ix.exports=kpe});var pu=s(function(c$e,Jx){"use strict";var zpe=require("@stdlib/utils/define-nonenumerable-read-only-property"),zx=kx(),Jpe=Qc();zpe(zx,"factory",Jpe);Jx.exports=zx});var Ux=s(function(m$e,Upe){Upe.exports={name:"improved-ziggurat",copy:!0}});var Bx=s(function(h$e,Cx){"use strict";var Cpe=Ya(),Bpe=Q(),$c={};$c["box-muller"]=Cpe;$c["improved-ziggurat"]=Bpe;Cx.exports=$c});var Kc=s(function(p$e,Hx){"use strict";var xt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Uv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Dx=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Dpe=require("@stdlib/assert/is-plain-object"),Xpe=require("@stdlib/assert/is-boolean").isPrimitive,yu=require("@stdlib/assert/has-own-property"),Xx=require("@stdlib/utils/constant-function"),Ha=require("@stdlib/string/format"),Ype=require("@stdlib/utils/noop"),Hpe=require("@stdlib/array/to-json"),Yx=Ux(),Zpe=Bx();function Qpe(r){var e,t,i;if(e={name:Yx.name,copy:Yx.copy},arguments.length){if(!Dpe(r))throw new TypeError(Ha("invalid argument. Must provide an object. Value: `%s`.",r));if(yu(r,"name")&&(e.name=r.name),yu(r,"prng")){if(e.prng=r.prng,e.prng===void 0)throw new TypeError(Ha("invalid option. `%s` option cannot be undefined. Option: `%s`.","prng",e.prng))}else if(yu(r,"state")){if(e.state=r.state,e.state===void 0)throw new TypeError(Ha("invalid option. `%s` option cannot be undefined. Option: `%s`.","state",e.state))}else if(yu(r,"seed")&&(e.seed=r.seed,e.seed===void 0))throw new TypeError(Ha("invalid option. `%s` option cannot be undefined. Option: `%s`.","seed",e.seed));if(yu(r,"copy")&&(e.copy=r.copy,!Xpe(e.copy)))throw new TypeError(Ha("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",e.copy))}if(i=Zpe[e.name],i===void 0)throw new Error(Ha("invalid option. Unrecognized/unsupported PRNG. Option: `%s`.",e.name));return e.prng===void 0?e.state===void 0?e.seed===void 0?t=i.factory():t=i.factory({seed:e.seed}):t=i.factory({state:e.state,copy:e.copy}):t=i.factory({prng:e.prng}),xt(l,"NAME","randn"),e.prng?(xt(l,"seed",null),xt(l,"seedLength",null),Dx(l,"state",Xx(null),Ype),xt(l,"stateLength",null),xt(l,"byteLength",null),xt(l,"toJSON",Xx(null))):(Uv(l,"seed",n),Uv(l,"seedLength",a),Dx(l,"state",v,g),Uv(l,"stateLength",u),Uv(l,"byteLength",o),xt(l,"toJSON",c)),xt(l,"PRNG",t.PRNG),l;function n(){return t.seed}function a(){return t.seedLength}function u(){return t.stateLength}function o(){return t.byteLength}function v(){return t.state}function g(m){t.state=m}function c(){var m={};return m.type="PRNG",m.name=l.NAME+"-"+t.NAME,m.state=Hpe(t.state),m.params=[],m}function l(){return t()}}Hx.exports=Qpe});var Qx=s(function(y$e,Zx){"use strict";var $pe=Kc(),Kpe=$pe();Zx.exports=Kpe});var qu=s(function(q$e,Kx){"use strict";var eye=require("@stdlib/utils/define-nonenumerable-read-only-property"),$x=Qx(),rye=Kc();eye($x,"factory",rye);Kx.exports=$x});var r1=s(function(b$e,e1){"use strict";var tye=an(),iye=sn(),nye=on(),aye=vn(),sye=ma(),uye=Ya(),oye=pa(),vye=gn(),gye=Xe(),fye=fn(),dye=dn(),lye=Sa(),cye=ln(),mye=Ea(),hye=Na(),pye=Ce(),yye=cn(),qye=La(),bye=Ra(),wye=Q(),Sye=mn(),Oye=Ta(),Eye=ja(),_ye=Ma(),Nye=xa(),Lye=hn(),Rye=$(),Pye=ee(),Tye=T(),jye=ka(),Mye=pn(),xye=Ja(),Aye=Rt(),Gye=pu(),Vye=qu(),Fye=jt(),Wye=Ua(),Iye=Da(),kye=Xa(),zye=yn(),Jye=qn(),E={};E.arcsine=tye.factory;E.bernoulli=iye.factory;E.beta=nye.factory;E.betaprime=aye.factory;E.binomial=sye.factory;E["box-muller"]=uye.factory;E.cauchy=oye.factory;E.chi=vye.factory;E.chisquare=gye.factory;E.cosine=fye.factory;E["discrete-uniform"]=dye.factory;E.erlang=lye.factory;E.exponential=cye.factory;E.f=mye.factory;E.frechet=hye.factory;E.gamma=pye.factory;E.geometric=yye.factory;E.gumbel=qye.factory;E.hypergeometric=bye.factory;E["improved-ziggurat"]=wye.factory;E.invgamma=Sye.factory;E.kumaraswamy=Oye.factory;E.laplace=Eye.factory;E.levy=_ye.factory;E.logistic=Nye.factory;E.lognormal=Lye.factory;E.minstd=Rye.factory;E["minstd-shuffle"]=Pye.factory;E.mt19937=Tye.factory;E["negative-binomial"]=jye.factory;E.normal=Mye.factory;E["pareto-type1"]=xye.factory;E.poisson=Aye.factory;E.randi=Gye.factory;E.randn=Vye.factory;E.randu=Fye.factory;E.rayleigh=Wye.factory;E.t=Iye.factory;E.triangular=kye.factory;E.uniform=zye.factory;E.weibull=Jye.factory;e1.exports=E});var s1=s(function(w$e,a1){"use strict";var t1=require("@stdlib/assert/is-string").isPrimitive,Uye=require("@stdlib/assert/is-plain-object"),i1=require("@stdlib/assert/is-array"),Cye=require("@stdlib/assert/contains"),Bye=require("@stdlib/array/int32"),Dye=require("@stdlib/array/uint32"),n1=r1(),Xye={Int32Array:Bye,Uint32Array:Dye},Yye=["randi","randn","randu"];function Hye(r,e){var t,i,n,a,u;if(e&&e.type==="PRNG"&&t1(e.name)&&Uye(e.state)&&i1(e.params)&&t1(e.state.type)&&i1(e.state.data)&&(i={},t=n1[e.name],t===void 0&&(u=e.name.split("-"),Cye(Yye,u[0])&&(t=n1[u[0]],i.name=u.slice(1).join("-"))),t&&(a=Xye[e.state.type],a))){i.state=new a(e.state.data),n=e.params.slice(),n.push(i);try{return t.apply(null,n)}catch(o){}}return e}a1.exports=Hye});var o1=s(function(S$e,u1){"use strict";var Zye=s1();u1.exports=Zye});var g1=s(function(O$e,v1){"use strict";var _=require("@stdlib/utils/define-read-only-property"),O={};_(O,"arcsine",an());_(O,"bernoulli",sn());_(O,"beta",on());_(O,"betaprime",vn());_(O,"binomial",ma());_(O,"boxMuller",Ya());_(O,"cauchy",pa());_(O,"chi",gn());_(O,"chisquare",Xe());_(O,"cosine",fn());_(O,"discreteUniform",dn());_(O,"erlang",Sa());_(O,"exponential",ln());_(O,"f",Ea());_(O,"frechet",Na());_(O,"gamma",Ce());_(O,"geometric",cn());_(O,"gumbel",La());_(O,"hypergeometric",Ra());_(O,"improvedZiggurat",Q());_(O,"invgamma",mn());_(O,"kumaraswamy",Ta());_(O,"laplace",ja());_(O,"levy",Ma());_(O,"logistic",xa());_(O,"lognormal",hn());_(O,"minstd",$());_(O,"minstdShuffle",ee());_(O,"mt19937",T());_(O,"negativeBinomial",ka());_(O,"normal",pn());_(O,"pareto1",Ja());_(O,"poisson",Rt());_(O,"randi",pu());_(O,"randn",qu());_(O,"randu",jt());_(O,"rayleigh",Ua());_(O,"reviveBasePRNG",o1());_(O,"t",Da());_(O,"triangular",Xa());_(O,"uniform",yn());_(O,"weibull",qn());v1.exports=O});var q1=s(function(E$e,y1){"use strict";var At=require("@stdlib/utils/define-nonenumerable-read-only-property"),Cv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),f1=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Qye=require("@stdlib/utils/constant-function"),$ye=require("@stdlib/utils/noop"),Kye=require("@stdlib/object/assign"),d1=require("@stdlib/assert/is-number").isPrimitive,l1=require("@stdlib/math/base/assert/is-nan"),eqe=require("@stdlib/assert/is-plain-object"),rqe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,tqe=require("@stdlib/assert/has-own-property"),c1=require("@stdlib/constants/float64/max"),m1=an().factory,h1=require("@stdlib/symbol/iterator"),bu=require("@stdlib/string/format");function p1(r,e,t){var i,n,a,u,o;if(!d1(r)||l1(r))throw new TypeError(bu("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!d1(e)||l1(e))throw new TypeError(bu("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e));if(r>=e)throw new RangeError(bu("invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.",r,e));if(arguments.length>2){if(!eqe(t))throw new TypeError(bu("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=Kye({},t),tqe(i,"iter")){if(!rqe(i.iter))throw new TypeError(bu("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=c1;a=m1(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=m1(r,e),i={iter:c1,state:a.state};return o=0,n={},At(n,"next",v),At(n,"return",g),i&&i.prng?(At(n,"seed",null),At(n,"seedLength",null),f1(n,"state",Qye(null),$ye),At(n,"stateLength",null),At(n,"byteLength",null)):(Cv(n,"seed",l),Cv(n,"seedLength",m),f1(n,"state",d,f),Cv(n,"stateLength",h),Cv(n,"byteLength",p)),At(n,"PRNG",a.PRNG),h1&&At(n,h1,c),n;function v(){return o+=1,u||o>i.iter?{done:!0}:{value:a(),done:!1}}function g(y){return u=!0,arguments.length?{value:y,done:!0}:{done:!0}}function c(){return p1(r,e,i)}function l(){return a.PRNG.seed}function m(){return a.PRNG.seedLength}function h(){return a.PRNG.stateLength}function p(){return a.PRNG.byteLength}function d(){return a.PRNG.state}function f(y){a.PRNG.state=y}}y1.exports=p1});var w1=s(function(_$e,b1){"use strict";var iqe=q1();b1.exports=iqe});var R1=s(function(N$e,L1){"use strict";var Gt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Bv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),S1=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),nqe=require("@stdlib/utils/constant-function"),aqe=require("@stdlib/utils/noop"),sqe=require("@stdlib/object/assign"),uqe=require("@stdlib/assert/is-probability").isPrimitive,oqe=require("@stdlib/assert/is-plain-object"),vqe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,gqe=require("@stdlib/assert/has-own-property"),O1=require("@stdlib/constants/float64/max"),E1=sn().factory,_1=require("@stdlib/symbol/iterator"),em=require("@stdlib/string/format");function N1(r,e){var t,i,n,a,u;if(!uqe(r))throw new TypeError(em("invalid argument. First argument must be a probability. Value: `%s`.",r));if(arguments.length>1){if(!oqe(e))throw new TypeError(em("invalid argument. Options argument must be an object. Value: `%s`.",e));if(t=sqe({},e),gqe(t,"iter")){if(!vqe(t.iter))throw new TypeError(em("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=O1;n=E1(r,t),t.prng===void 0&&t.copy!==!1&&(t.state=n.state)}else n=E1(r),t={iter:O1,state:n.state};return u=0,i={},Gt(i,"next",o),Gt(i,"return",v),t&&t.prng?(Gt(i,"seed",null),Gt(i,"seedLength",null),S1(i,"state",nqe(null),aqe),Gt(i,"stateLength",null),Gt(i,"byteLength",null)):(Bv(i,"seed",c),Bv(i,"seedLength",l),S1(i,"state",p,d),Bv(i,"stateLength",m),Bv(i,"byteLength",h)),Gt(i,"PRNG",n.PRNG),_1&&Gt(i,_1,g),i;function o(){return u+=1,a||u>t.iter?{done:!0}:{value:n(),done:!1}}function v(f){return a=!0,arguments.length?{value:f,done:!0}:{done:!0}}function g(){return N1(r,t)}function c(){return n.PRNG.seed}function l(){return n.PRNG.seedLength}function m(){return n.PRNG.stateLength}function h(){return n.PRNG.byteLength}function p(){return n.PRNG.state}function d(f){n.PRNG.state=f}}L1.exports=N1});var T1=s(function(L$e,P1){"use strict";var fqe=R1();P1.exports=fqe});var W1=s(function(R$e,F1){"use strict";var Vt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Dv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),j1=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),dqe=require("@stdlib/utils/constant-function"),lqe=require("@stdlib/utils/noop"),cqe=require("@stdlib/object/assign"),M1=require("@stdlib/assert/is-positive-number").isPrimitive,mqe=require("@stdlib/assert/is-plain-object"),hqe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,pqe=require("@stdlib/assert/has-own-property"),x1=require("@stdlib/constants/float64/max"),A1=on().factory,G1=require("@stdlib/symbol/iterator"),Xv=require("@stdlib/string/format");function V1(r,e,t){var i,n,a,u,o;if(!M1(r))throw new TypeError(Xv("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!M1(e))throw new TypeError(Xv("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!mqe(t))throw new TypeError(Xv("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=cqe({},t),pqe(i,"iter")){if(!hqe(i.iter))throw new TypeError(Xv("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=x1;a=A1(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=A1(r,e),i={iter:x1,state:a.state};return o=0,n={},Vt(n,"next",v),Vt(n,"return",g),i&&i.prng?(Vt(n,"seed",null),Vt(n,"seedLength",null),j1(n,"state",dqe(null),lqe),Vt(n,"stateLength",null),Vt(n,"byteLength",null)):(Dv(n,"seed",l),Dv(n,"seedLength",m),j1(n,"state",d,f),Dv(n,"stateLength",h),Dv(n,"byteLength",p)),Vt(n,"PRNG",a.PRNG),G1&&Vt(n,G1,c),n;function v(){return o+=1,u||o>i.iter?{done:!0}:{value:a(),done:!1}}function g(y){return u=!0,arguments.length?{value:y,done:!0}:{done:!0}}function c(){return V1(r,e,i)}function l(){return a.PRNG.seed}function m(){return a.PRNG.seedLength}function h(){return a.PRNG.stateLength}function p(){return a.PRNG.byteLength}function d(){return a.PRNG.state}function f(y){a.PRNG.state=y}}F1.exports=V1});var k1=s(function(P$e,I1){"use strict";var yqe=W1();I1.exports=yqe});var Y1=s(function(T$e,X1){"use strict";var Ft=require("@stdlib/utils/define-nonenumerable-read-only-property"),Yv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),z1=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),qqe=require("@stdlib/utils/constant-function"),bqe=require("@stdlib/utils/noop"),wqe=require("@stdlib/object/assign"),J1=require("@stdlib/assert/is-positive-number").isPrimitive,Sqe=require("@stdlib/assert/is-plain-object"),Oqe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Eqe=require("@stdlib/assert/has-own-property"),U1=require("@stdlib/constants/float64/max"),C1=vn().factory,B1=require("@stdlib/symbol/iterator"),Hv=require("@stdlib/string/format");function D1(r,e,t){var i,n,a,u,o;if(!J1(r))throw new TypeError(Hv("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!J1(e))throw new TypeError(Hv("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!Sqe(t))throw new TypeError(Hv("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=wqe({},t),Eqe(i,"iter")){if(!Oqe(i.iter))throw new TypeError(Hv("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=U1;a=C1(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=C1(r,e),i={iter:U1,state:a.state};return o=0,n={},Ft(n,"next",v),Ft(n,"return",g),i&&i.prng?(Ft(n,"seed",null),Ft(n,"seedLength",null),z1(n,"state",qqe(null),bqe),Ft(n,"stateLength",null),Ft(n,"byteLength",null)):(Yv(n,"seed",l),Yv(n,"seedLength",m),z1(n,"state",d,f),Yv(n,"stateLength",h),Yv(n,"byteLength",p)),Ft(n,"PRNG",a.PRNG),B1&&Ft(n,B1,c),n;function v(){return o+=1,u||o>i.iter?{done:!0}:{value:a(),done:!1}}function g(y){return u=!0,arguments.length?{value:y,done:!0}:{done:!0}}function c(){return D1(r,e,i)}function l(){return a.PRNG.seed}function m(){return a.PRNG.seedLength}function h(){return a.PRNG.stateLength}function p(){return a.PRNG.byteLength}function d(){return a.PRNG.state}function f(y){a.PRNG.state=y}}X1.exports=D1});var Z1=s(function(j$e,H1){"use strict";var _qe=Y1();H1.exports=_qe});var iA=s(function(M$e,tA){"use strict";var Wt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Zv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Q1=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Nqe=require("@stdlib/utils/constant-function"),Lqe=require("@stdlib/utils/noop"),Rqe=require("@stdlib/object/assign"),Pqe=require("@stdlib/assert/is-probability").isPrimitive,Tqe=require("@stdlib/assert/is-plain-object"),jqe=require("@stdlib/assert/is-positive-integer").isPrimitive,Mqe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,xqe=require("@stdlib/assert/has-own-property"),$1=require("@stdlib/constants/float64/max"),K1=ma().factory,eA=require("@stdlib/symbol/iterator"),Qv=require("@stdlib/string/format");function rA(r,e,t){var i,n,a,u,o;if(!jqe(r))throw new TypeError(Qv("invalid argument. First argument must be a positive integer. Value: `%s`.",r));if(!Pqe(e))throw new TypeError(Qv("invalid argument. Second argument must be a probability. Value: `%s`.",e));if(arguments.length>2){if(!Tqe(t))throw new TypeError(Qv("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=Rqe({},t),xqe(i,"iter")){if(!Mqe(i.iter))throw new TypeError(Qv("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=$1;a=K1(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=K1(r,e),i={iter:$1,state:a.state};return o=0,n={},Wt(n,"next",v),Wt(n,"return",g),i&&i.prng?(Wt(n,"seed",null),Wt(n,"seedLength",null),Q1(n,"state",Nqe(null),Lqe),Wt(n,"stateLength",null),Wt(n,"byteLength",null)):(Zv(n,"seed",l),Zv(n,"seedLength",m),Q1(n,"state",d,f),Zv(n,"stateLength",h),Zv(n,"byteLength",p)),Wt(n,"PRNG",a.PRNG),eA&&Wt(n,eA,c),n;function v(){return o+=1,u||o>i.iter?{done:!0}:{value:a(),done:!1}}function g(y){return u=!0,arguments.length?{value:y,done:!0}:{done:!0}}function c(){return rA(r,e,i)}function l(){return a.PRNG.seed}function m(){return a.PRNG.seedLength}function h(){return a.PRNG.stateLength}function p(){return a.PRNG.byteLength}function d(){return a.PRNG.state}function f(y){a.PRNG.state=y}}tA.exports=rA});var aA=s(function(x$e,nA){"use strict";var Aqe=iA();nA.exports=Aqe});var lA=s(function(A$e,dA){"use strict";var It=require("@stdlib/utils/define-nonenumerable-read-only-property"),$v=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),sA=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Gqe=require("@stdlib/utils/constant-function"),Vqe=require("@stdlib/utils/noop"),Fqe=require("@stdlib/object/assign"),Wqe=require("@stdlib/assert/is-plain-object"),Iqe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,kqe=require("@stdlib/assert/has-own-property"),uA=require("@stdlib/constants/float64/max"),oA=Ya().factory,vA=require("@stdlib/symbol/iterator"),gA=require("@stdlib/string/format");function fA(r){var e,t,i,n,a;if(arguments.length>0){if(!Wqe(r))throw new TypeError(gA("invalid argument. Options argument must be an object. Value: `%s`.",r));if(e=Fqe({},r),kqe(e,"iter")){if(!Iqe(e.iter))throw new TypeError(gA("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",e.iter))}else e.iter=uA;i=oA(e),e.prng===void 0&&e.copy!==!1&&(e.state=i.state)}else i=oA(),e={iter:uA,state:i.state};return a=0,t={},It(t,"next",u),It(t,"return",o),e&&e.prng?(It(t,"seed",null),It(t,"seedLength",null),sA(t,"state",Gqe(null),Vqe),It(t,"stateLength",null),It(t,"byteLength",null)):($v(t,"seed",g),$v(t,"seedLength",c),sA(t,"state",h,p),$v(t,"stateLength",l),$v(t,"byteLength",m)),It(t,"PRNG",i.PRNG),vA&&It(t,vA,v),t;function u(){return a+=1,n||a>e.iter?{done:!0}:{value:i(),done:!1}}function o(d){return n=!0,arguments.length?{value:d,done:!0}:{done:!0}}function v(){return fA(e)}function g(){return i.PRNG.seed}function c(){return i.PRNG.seedLength}function l(){return i.PRNG.stateLength}function m(){return i.PRNG.byteLength}function h(){return i.PRNG.state}function p(d){i.PRNG.state=d}}dA.exports=fA});var mA=s(function(G$e,cA){"use strict";var zqe=lA();cA.exports=zqe});var SA=s(function(V$e,wA){"use strict";var kt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Kv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),hA=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Jqe=require("@stdlib/utils/constant-function"),Uqe=require("@stdlib/utils/noop"),Cqe=require("@stdlib/object/assign"),Bqe=require("@stdlib/assert/is-number").isPrimitive,Dqe=require("@stdlib/math/base/assert/is-nan"),Xqe=require("@stdlib/assert/is-plain-object"),Yqe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Hqe=require("@stdlib/assert/is-positive-number").isPrimitive,Zqe=require("@stdlib/assert/has-own-property"),pA=require("@stdlib/constants/float64/max"),yA=pa().factory,qA=require("@stdlib/symbol/iterator"),eg=require("@stdlib/string/format");function bA(r,e,t){var i,n,a,u,o;if(!Bqe(r)||Dqe(r))throw new TypeError(eg("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!Hqe(e))throw new TypeError(eg("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!Xqe(t))throw new TypeError(eg("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=Cqe({},t),Zqe(i,"iter")){if(!Yqe(i.iter))throw new TypeError(eg("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=pA;a=yA(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=yA(r,e),i={iter:pA,state:a.state};return o=0,n={},kt(n,"next",v),kt(n,"return",g),i&&i.prng?(kt(n,"seed",null),kt(n,"seedLength",null),hA(n,"state",Jqe(null),Uqe),kt(n,"stateLength",null),kt(n,"byteLength",null)):(Kv(n,"seed",l),Kv(n,"seedLength",m),hA(n,"state",d,f),Kv(n,"stateLength",h),Kv(n,"byteLength",p)),kt(n,"PRNG",a.PRNG),qA&&kt(n,qA,c),n;function v(){return o+=1,u||o>i.iter?{done:!0}:{value:a(),done:!1}}function g(y){return u=!0,arguments.length?{value:y,done:!0}:{done:!0}}function c(){return bA(r,e,i)}function l(){return a.PRNG.seed}function m(){return a.PRNG.seedLength}function h(){return a.PRNG.stateLength}function p(){return a.PRNG.byteLength}function d(){return a.PRNG.state}function f(y){a.PRNG.state=y}}wA.exports=bA});var EA=s(function(F$e,OA){"use strict";var Qqe=SA();OA.exports=Qqe});var jA=s(function(W$e,TA){"use strict";var zt=require("@stdlib/utils/define-nonenumerable-read-only-property"),rg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),_A=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),$qe=require("@stdlib/utils/constant-function"),Kqe=require("@stdlib/utils/noop"),ebe=require("@stdlib/object/assign"),rbe=require("@stdlib/assert/is-positive-number").isPrimitive,tbe=require("@stdlib/assert/is-plain-object"),ibe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,nbe=require("@stdlib/assert/has-own-property"),NA=require("@stdlib/constants/float64/max"),LA=gn().factory,RA=require("@stdlib/symbol/iterator"),rm=require("@stdlib/string/format");function PA(r,e){var t,i,n,a,u;if(!rbe(r))throw new TypeError(rm("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(arguments.length>1){if(!tbe(e))throw new TypeError(rm("invalid argument. Options argument must be an object. Value: `%s`.",e));if(t=ebe({},e),nbe(t,"iter")){if(!ibe(t.iter))throw new TypeError(rm("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=NA;n=LA(r,t),t.prng===void 0&&t.copy!==!1&&(t.state=n.state)}else n=LA(r),t={iter:NA,state:n.state};return u=0,i={},zt(i,"next",o),zt(i,"return",v),t&&t.prng?(zt(i,"seed",null),zt(i,"seedLength",null),_A(i,"state",$qe(null),Kqe),zt(i,"stateLength",null),zt(i,"byteLength",null)):(rg(i,"seed",c),rg(i,"seedLength",l),_A(i,"state",p,d),rg(i,"stateLength",m),rg(i,"byteLength",h)),zt(i,"PRNG",n.PRNG),RA&&zt(i,RA,g),i;function o(){return u+=1,a||u>t.iter?{done:!0}:{value:n(),done:!1}}function v(f){return a=!0,arguments.length?{value:f,done:!0}:{done:!0}}function g(){return PA(r,t)}function c(){return n.PRNG.seed}function l(){return n.PRNG.seedLength}function m(){return n.PRNG.stateLength}function h(){return n.PRNG.byteLength}function p(){return n.PRNG.state}function d(f){n.PRNG.state=f}}TA.exports=PA});var xA=s(function(I$e,MA){"use strict";var abe=jA();MA.exports=abe});var kA=s(function(k$e,IA){"use strict";var Jt=require("@stdlib/utils/define-nonenumerable-read-only-property"),tg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),AA=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),sbe=require("@stdlib/utils/constant-function"),ube=require("@stdlib/utils/noop"),obe=require("@stdlib/object/assign"),vbe=require("@stdlib/assert/is-positive-number").isPrimitive,gbe=require("@stdlib/assert/is-plain-object"),fbe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,dbe=require("@stdlib/assert/has-own-property"),GA=require("@stdlib/constants/float64/max"),VA=Xe().factory,FA=require("@stdlib/symbol/iterator"),tm=require("@stdlib/string/format");function WA(r,e){var t,i,n,a,u;if(!vbe(r))throw new TypeError(tm("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(arguments.length>1){if(!gbe(e))throw new TypeError(tm("invalid argument. Options argument must be an object. Value: `%s`.",e));if(t=obe({},e),dbe(t,"iter")){if(!fbe(t.iter))throw new TypeError(tm("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=GA;n=VA(r,t),t.prng===void 0&&t.copy!==!1&&(t.state=n.state)}else n=VA(r),t={iter:GA,state:n.state};return u=0,i={},Jt(i,"next",o),Jt(i,"return",v),t&&t.prng?(Jt(i,"seed",null),Jt(i,"seedLength",null),AA(i,"state",sbe(null),ube),Jt(i,"stateLength",null),Jt(i,"byteLength",null)):(tg(i,"seed",c),tg(i,"seedLength",l),AA(i,"state",p,d),tg(i,"stateLength",m),tg(i,"byteLength",h)),Jt(i,"PRNG",n.PRNG),FA&&Jt(i,FA,g),i;function o(){return u+=1,a||u>t.iter?{done:!0}:{value:n(),done:!1}}function v(f){return a=!0,arguments.length?{value:f,done:!0}:{done:!0}}function g(){return WA(r,t)}function c(){return n.PRNG.seed}function l(){return n.PRNG.seedLength}function m(){return n.PRNG.stateLength}function h(){return n.PRNG.byteLength}function p(){return n.PRNG.state}function d(f){n.PRNG.state=f}}IA.exports=WA});var JA=s(function(z$e,zA){"use strict";var lbe=kA();zA.exports=lbe});var HA=s(function(J$e,YA){"use strict";var Ut=require("@stdlib/utils/define-nonenumerable-read-only-property"),ig=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),UA=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),cbe=require("@stdlib/utils/constant-function"),mbe=require("@stdlib/utils/noop"),hbe=require("@stdlib/object/assign"),pbe=require("@stdlib/assert/is-number").isPrimitive,ybe=require("@stdlib/math/base/assert/is-nan"),qbe=require("@stdlib/assert/is-plain-object"),bbe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,wbe=require("@stdlib/assert/is-positive-number").isPrimitive,Sbe=require("@stdlib/assert/has-own-property"),CA=require("@stdlib/constants/float64/max"),BA=fn().factory,DA=require("@stdlib/symbol/iterator"),ng=require("@stdlib/string/format");function XA(r,e,t){var i,n,a,u,o;if(!pbe(r)||ybe(r))throw new TypeError(ng("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!wbe(e))throw new TypeError(ng("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!qbe(t))throw new TypeError(ng("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=hbe({},t),Sbe(i,"iter")){if(!bbe(i.iter))throw new TypeError(ng("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=CA;a=BA(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=BA(r,e),i={iter:CA,state:a.state};return o=0,n={},Ut(n,"next",v),Ut(n,"return",g),i&&i.prng?(Ut(n,"seed",null),Ut(n,"seedLength",null),UA(n,"state",cbe(null),mbe),Ut(n,"stateLength",null),Ut(n,"byteLength",null)):(ig(n,"seed",l),ig(n,"seedLength",m),UA(n,"state",d,f),ig(n,"stateLength",h),ig(n,"byteLength",p)),Ut(n,"PRNG",a.PRNG),DA&&Ut(n,DA,c),n;function v(){return o+=1,u||o>i.iter?{done:!0}:{value:a(),done:!1}}function g(y){return u=!0,arguments.length?{value:y,done:!0}:{done:!0}}function c(){return XA(r,e,i)}function l(){return a.PRNG.seed}function m(){return a.PRNG.seedLength}function h(){return a.PRNG.stateLength}function p(){return a.PRNG.byteLength}function d(){return a.PRNG.state}function f(y){a.PRNG.state=y}}YA.exports=XA});var QA=s(function(U$e,ZA){"use strict";var Obe=HA();ZA.exports=Obe});var aG=s(function(C$e,nG){"use strict";var Ct=require("@stdlib/utils/define-nonenumerable-read-only-property"),ag=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),$A=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Ebe=require("@stdlib/utils/constant-function"),_be=require("@stdlib/utils/noop"),Nbe=require("@stdlib/object/assign"),KA=require("@stdlib/assert/is-number").isPrimitive,Lbe=require("@stdlib/assert/is-plain-object"),Rbe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Pbe=require("@stdlib/assert/has-own-property"),eG=require("@stdlib/constants/float64/max"),rG=dn().factory,tG=require("@stdlib/symbol/iterator"),wu=require("@stdlib/string/format");function iG(r,e,t){var i,n,a,u,o;if(!KA(r))throw new TypeError(wu("invalid argument. First argument must be an integer. Value: `%s`.",r));if(!KA(e))throw new TypeError(wu("invalid argument. Second argument must be an integer. Value: `%s`.",e));if(r>e)throw new RangeError(wu("invalid argument. Minimum support must be less than or equal to maximum support. Value: `[%d,%d]`.",r,e));if(arguments.length>2){if(!Lbe(t))throw new TypeError(wu("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=Nbe({},t),Pbe(i,"iter")){if(!Rbe(i.iter))throw new TypeError(wu("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=eG;a=rG(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=rG(r,e),i={iter:eG,state:a.state};return o=0,n={},Ct(n,"next",v),Ct(n,"return",g),i&&i.prng?(Ct(n,"seed",null),Ct(n,"seedLength",null),$A(n,"state",Ebe(null),_be),Ct(n,"stateLength",null),Ct(n,"byteLength",null)):(ag(n,"seed",l),ag(n,"seedLength",m),$A(n,"state",d,f),ag(n,"stateLength",h),ag(n,"byteLength",p)),Ct(n,"PRNG",a.PRNG),tG&&Ct(n,tG,c),n;function v(){return o+=1,u||o>i.iter?{done:!0}:{value:a(),done:!1}}function g(y){return u=!0,arguments.length?{value:y,done:!0}:{done:!0}}function c(){return iG(r,e,i)}function l(){return a.PRNG.seed}function m(){return a.PRNG.seedLength}function h(){return a.PRNG.stateLength}function p(){return a.PRNG.byteLength}function d(){return a.PRNG.state}function f(y){a.PRNG.state=y}}nG.exports=iG});var uG=s(function(B$e,sG){"use strict";var Tbe=aG();sG.exports=Tbe});var cG=s(function(D$e,lG){"use strict";var Bt=require("@stdlib/utils/define-nonenumerable-read-only-property"),sg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),oG=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),jbe=require("@stdlib/utils/constant-function"),Mbe=require("@stdlib/utils/noop"),xbe=require("@stdlib/object/assign"),Abe=require("@stdlib/assert/is-positive-number").isPrimitive,Gbe=require("@stdlib/assert/is-plain-object"),Vbe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Fbe=require("@stdlib/assert/is-positive-integer").isPrimitive,Wbe=require("@stdlib/assert/has-own-property"),vG=require("@stdlib/constants/float64/max"),gG=Sa().factory,fG=require("@stdlib/symbol/iterator"),ug=require("@stdlib/string/format");function dG(r,e,t){var i,n,a,u,o;if(!Fbe(r))throw new TypeError(ug("invalid argument. First argument must be a positive integer. Value: `%s`.",r));if(!Abe(e))throw new TypeError(ug("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!Gbe(t))throw new TypeError(ug("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=xbe({},t),Wbe(i,"iter")){if(!Vbe(i.iter))throw new TypeError(ug("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=vG;a=gG(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=gG(r,e),i={iter:vG,state:a.state};return o=0,n={},Bt(n,"next",v),Bt(n,"return",g),i&&i.prng?(Bt(n,"seed",null),Bt(n,"seedLength",null),oG(n,"state",jbe(null),Mbe),Bt(n,"stateLength",null),Bt(n,"byteLength",null)):(sg(n,"seed",l),sg(n,"seedLength",m),oG(n,"state",d,f),sg(n,"stateLength",h),sg(n,"byteLength",p)),Bt(n,"PRNG",a.PRNG),fG&&Bt(n,fG,c),n;function v(){return o+=1,u||o>i.iter?{done:!0}:{value:a(),done:!1}}function g(y){return u=!0,arguments.length?{value:y,done:!0}:{done:!0}}function c(){return dG(r,e,i)}function l(){return a.PRNG.seed}function m(){return a.PRNG.seedLength}function h(){return a.PRNG.stateLength}function p(){return a.PRNG.byteLength}function d(){return a.PRNG.state}function f(y){a.PRNG.state=y}}lG.exports=dG});var hG=s(function(X$e,mG){"use strict";var Ibe=cG();mG.exports=Ibe});var OG=s(function(Y$e,SG){"use strict";var Dt=require("@stdlib/utils/define-nonenumerable-read-only-property"),og=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),pG=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),kbe=require("@stdlib/utils/constant-function"),zbe=require("@stdlib/utils/noop"),Jbe=require("@stdlib/object/assign"),Ube=require("@stdlib/assert/is-positive-number").isPrimitive,Cbe=require("@stdlib/assert/is-plain-object"),Bbe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Dbe=require("@stdlib/assert/has-own-property"),yG=require("@stdlib/constants/float64/max"),qG=ln().factory,bG=require("@stdlib/symbol/iterator"),im=require("@stdlib/string/format");function wG(r,e){var t,i,n,a,u;if(!Ube(r))throw new TypeError(im("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(arguments.length>1){if(!Cbe(e))throw new TypeError(im("invalid argument. Options argument must be an object. Value: `%s`.",e));if(t=Jbe({},e),Dbe(t,"iter")){if(!Bbe(t.iter))throw new TypeError(im("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=yG;n=qG(r,t),t.prng===void 0&&t.copy!==!1&&(t.state=n.state)}else n=qG(r),t={iter:yG,state:n.state};return u=0,i={},Dt(i,"next",o),Dt(i,"return",v),t&&t.prng?(Dt(i,"seed",null),Dt(i,"seedLength",null),pG(i,"state",kbe(null),zbe),Dt(i,"stateLength",null),Dt(i,"byteLength",null)):(og(i,"seed",c),og(i,"seedLength",l),pG(i,"state",p,d),og(i,"stateLength",m),og(i,"byteLength",h)),Dt(i,"PRNG",n.PRNG),bG&&Dt(i,bG,g),i;function o(){return u+=1,a||u>t.iter?{done:!0}:{value:n(),done:!1}}function v(f){return a=!0,arguments.length?{value:f,done:!0}:{done:!0}}function g(){return wG(r,t)}function c(){return n.PRNG.seed}function l(){return n.PRNG.seedLength}function m(){return n.PRNG.stateLength}function h(){return n.PRNG.byteLength}function p(){return n.PRNG.state}function d(f){n.PRNG.state=f}}SG.exports=wG});var _G=s(function(H$e,EG){"use strict";var Xbe=OG();EG.exports=Xbe});var xG=s(function(Z$e,MG){"use strict";var Xt=require("@stdlib/utils/define-nonenumerable-read-only-property"),vg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),NG=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Ybe=require("@stdlib/utils/constant-function"),Hbe=require("@stdlib/utils/noop"),Zbe=require("@stdlib/object/assign"),LG=require("@stdlib/assert/is-positive-number").isPrimitive,Qbe=require("@stdlib/assert/is-plain-object"),$be=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Kbe=require("@stdlib/assert/has-own-property"),RG=require("@stdlib/constants/float64/max"),PG=Ea().factory,TG=require("@stdlib/symbol/iterator"),gg=require("@stdlib/string/format");function jG(r,e,t){var i,n,a,u,o;if(!LG(r))throw new TypeError(gg("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!LG(e))throw new TypeError(gg("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!Qbe(t))throw new TypeError(gg("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=Zbe({},t),Kbe(i,"iter")){if(!$be(i.iter))throw new TypeError(gg("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=RG;a=PG(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=PG(r,e),i={iter:RG,state:a.state};return o=0,n={},Xt(n,"next",v),Xt(n,"return",g),i&&i.prng?(Xt(n,"seed",null),Xt(n,"seedLength",null),NG(n,"state",Ybe(null),Hbe),Xt(n,"stateLength",null),Xt(n,"byteLength",null)):(vg(n,"seed",l),vg(n,"seedLength",m),NG(n,"state",d,f),vg(n,"stateLength",h),vg(n,"byteLength",p)),Xt(n,"PRNG",a.PRNG),TG&&Xt(n,TG,c),n;function v(){return o+=1,u||o>i.iter?{done:!0}:{value:a(),done:!1}}function g(y){return u=!0,arguments.length?{value:y,done:!0}:{done:!0}}function c(){return jG(r,e,i)}function l(){return a.PRNG.seed}function m(){return a.PRNG.seedLength}function h(){return a.PRNG.stateLength}function p(){return a.PRNG.byteLength}function d(){return a.PRNG.state}function f(y){a.PRNG.state=y}}MG.exports=jG});var GG=s(function(Q$e,AG){"use strict";var ewe=xG();AG.exports=ewe});var UG=s(function($$e,JG){"use strict";var Yt=require("@stdlib/utils/define-nonenumerable-read-only-property"),fg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),VG=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),rwe=require("@stdlib/utils/constant-function"),twe=require("@stdlib/utils/noop"),iwe=require("@stdlib/object/assign"),FG=require("@stdlib/assert/is-positive-number").isPrimitive,nwe=require("@stdlib/assert/is-plain-object"),awe=require("@stdlib/assert/is-number").isPrimitive,swe=require("@stdlib/math/base/assert/is-nan"),uwe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,owe=require("@stdlib/assert/has-own-property"),WG=require("@stdlib/constants/float64/max"),IG=Na().factory,kG=require("@stdlib/symbol/iterator"),Su=require("@stdlib/string/format");function zG(r,e,t,i){var n,a,u,o,v;if(!FG(r))throw new TypeError(Su("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!FG(e))throw new TypeError(Su("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(!awe(t)||swe(t))throw new TypeError(Su("invalid argument. Third argument must be a number. Value: `%s`.",t));if(arguments.length>3){if(!nwe(i))throw new TypeError(Su("invalid argument. Options argument must be an object. Value: `%s`.",i));if(n=iwe({},i),owe(n,"iter")){if(!uwe(n.iter))throw new TypeError(Su("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",n.iter))}else n.iter=WG;u=IG(r,e,t,n),n.prng===void 0&&n.copy!==!1&&(n.state=u.state)}else u=IG(r,e,t),n={iter:WG,state:u.state};return v=0,a={},Yt(a,"next",g),Yt(a,"return",c),n&&n.prng?(Yt(a,"seed",null),Yt(a,"seedLength",null),VG(a,"state",rwe(null),twe),Yt(a,"stateLength",null),Yt(a,"byteLength",null)):(fg(a,"seed",m),fg(a,"seedLength",h),VG(a,"state",f,y),fg(a,"stateLength",p),fg(a,"byteLength",d)),Yt(a,"PRNG",u.PRNG),kG&&Yt(a,kG,l),a;function g(){return v+=1,o||v>n.iter?{done:!0}:{value:u(),done:!1}}function c(q){return o=!0,arguments.length?{value:q,done:!0}:{done:!0}}function l(){return zG(r,e,t,n)}function m(){return u.PRNG.seed}function h(){return u.PRNG.seedLength}function p(){return u.PRNG.stateLength}function d(){return u.PRNG.byteLength}function f(){return u.PRNG.state}function y(q){u.PRNG.state=q}}JG.exports=zG});var BG=s(function(K$e,CG){"use strict";var vwe=UG();CG.exports=vwe});var KG=s(function(eKe,$G){"use strict";var Ht=require("@stdlib/utils/define-nonenumerable-read-only-property"),dg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),DG=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),gwe=require("@stdlib/utils/constant-function"),fwe=require("@stdlib/utils/noop"),dwe=require("@stdlib/object/assign"),XG=require("@stdlib/assert/is-positive-number").isPrimitive,lwe=require("@stdlib/assert/is-plain-object"),cwe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,mwe=require("@stdlib/assert/has-own-property"),YG=require("@stdlib/constants/float64/max"),HG=Ce().factory,ZG=require("@stdlib/symbol/iterator"),lg=require("@stdlib/string/format");function QG(r,e,t){var i,n,a,u,o;if(!XG(r))throw new TypeError(lg("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!XG(e))throw new TypeError(lg("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!lwe(t))throw new TypeError(lg("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=dwe({},t),mwe(i,"iter")){if(!cwe(i.iter))throw new TypeError(lg("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=YG;a=HG(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=HG(r,e),i={iter:YG,state:a.state};return o=0,n={},Ht(n,"next",v),Ht(n,"return",g),i&&i.prng?(Ht(n,"seed",null),Ht(n,"seedLength",null),DG(n,"state",gwe(null),fwe),Ht(n,"stateLength",null),Ht(n,"byteLength",null)):(dg(n,"seed",l),dg(n,"seedLength",m),DG(n,"state",d,f),dg(n,"stateLength",h),dg(n,"byteLength",p)),Ht(n,"PRNG",a.PRNG),ZG&&Ht(n,ZG,c),n;function v(){return o+=1,u||o>i.iter?{done:!0}:{value:a(),done:!1}}function g(y){return u=!0,arguments.length?{value:y,done:!0}:{done:!0}}function c(){return QG(r,e,i)}function l(){return a.PRNG.seed}function m(){return a.PRNG.seedLength}function h(){return a.PRNG.stateLength}function p(){return a.PRNG.byteLength}function d(){return a.PRNG.state}function f(y){a.PRNG.state=y}}$G.exports=QG});var rV=s(function(rKe,eV){"use strict";var hwe=KG();eV.exports=hwe});var oV=s(function(tKe,uV){"use strict";var Zt=require("@stdlib/utils/define-nonenumerable-read-only-property"),cg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),tV=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),pwe=require("@stdlib/utils/constant-function"),ywe=require("@stdlib/utils/noop"),qwe=require("@stdlib/object/assign"),bwe=require("@stdlib/assert/is-probability").isPrimitive,wwe=require("@stdlib/assert/is-plain-object"),Swe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Owe=require("@stdlib/assert/has-own-property"),iV=require("@stdlib/constants/float64/max"),nV=cn().factory,aV=require("@stdlib/symbol/iterator"),nm=require("@stdlib/string/format");function sV(r,e){var t,i,n,a,u;if(!bwe(r))throw new TypeError(nm("invalid argument. First argument must be a probability. Value: `%s`.",r));if(arguments.length>1){if(!wwe(e))throw new TypeError(nm("invalid argument. Options argument must be an object. Value: `%s`.",e));if(t=qwe({},e),Owe(t,"iter")){if(!Swe(t.iter))throw new TypeError(nm("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=iV;n=nV(r,t),t.prng===void 0&&t.copy!==!1&&(t.state=n.state)}else n=nV(r),t={iter:iV,state:n.state};return u=0,i={},Zt(i,"next",o),Zt(i,"return",v),t&&t.prng?(Zt(i,"seed",null),Zt(i,"seedLength",null),tV(i,"state",pwe(null),ywe),Zt(i,"stateLength",null),Zt(i,"byteLength",null)):(cg(i,"seed",c),cg(i,"seedLength",l),tV(i,"state",p,d),cg(i,"stateLength",m),cg(i,"byteLength",h)),Zt(i,"PRNG",n.PRNG),aV&&Zt(i,aV,g),i;function o(){return u+=1,a||u>t.iter?{done:!0}:{value:n(),done:!1}}function v(f){return a=!0,arguments.length?{value:f,done:!0}:{done:!0}}function g(){return sV(r,t)}function c(){return n.PRNG.seed}function l(){return n.PRNG.seedLength}function m(){return n.PRNG.stateLength}function h(){return n.PRNG.byteLength}function p(){return n.PRNG.state}function d(f){n.PRNG.state=f}}uV.exports=sV});var gV=s(function(iKe,vV){"use strict";var Ewe=oV();vV.exports=Ewe});var pV=s(function(nKe,hV){"use strict";var Qt=require("@stdlib/utils/define-nonenumerable-read-only-property"),mg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),fV=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),_we=require("@stdlib/utils/constant-function"),Nwe=require("@stdlib/utils/noop"),Lwe=require("@stdlib/object/assign"),Rwe=require("@stdlib/assert/is-number").isPrimitive,Pwe=require("@stdlib/math/base/assert/is-nan"),Twe=require("@stdlib/assert/is-plain-object"),jwe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Mwe=require("@stdlib/assert/is-positive-number").isPrimitive,xwe=require("@stdlib/assert/has-own-property"),dV=require("@stdlib/constants/float64/max"),lV=La().factory,cV=require("@stdlib/symbol/iterator"),hg=require("@stdlib/string/format");function mV(r,e,t){var i,n,a,u,o;if(!Rwe(r)||Pwe(r))throw new TypeError(hg("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!Mwe(e))throw new TypeError(hg("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!Twe(t))throw new TypeError(hg("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=Lwe({},t),xwe(i,"iter")){if(!jwe(i.iter))throw new TypeError(hg("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=dV;a=lV(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=lV(r,e),i={iter:dV,state:a.state};return o=0,n={},Qt(n,"next",v),Qt(n,"return",g),i&&i.prng?(Qt(n,"seed",null),Qt(n,"seedLength",null),fV(n,"state",_we(null),Nwe),Qt(n,"stateLength",null),Qt(n,"byteLength",null)):(mg(n,"seed",l),mg(n,"seedLength",m),fV(n,"state",d,f),mg(n,"stateLength",h),mg(n,"byteLength",p)),Qt(n,"PRNG",a.PRNG),cV&&Qt(n,cV,c),n;function v(){return o+=1,u||o>i.iter?{done:!0}:{value:a(),done:!1}}function g(y){return u=!0,arguments.length?{value:y,done:!0}:{done:!0}}function c(){return mV(r,e,i)}function l(){return a.PRNG.seed}function m(){return a.PRNG.seedLength}function h(){return a.PRNG.stateLength}function p(){return a.PRNG.byteLength}function d(){return a.PRNG.state}function f(y){a.PRNG.state=y}}hV.exports=mV});var qV=s(function(aKe,yV){"use strict";var Awe=pV();yV.exports=Awe});var NV=s(function(sKe,_V){"use strict";var $t=require("@stdlib/utils/define-nonenumerable-read-only-property"),pg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),bV=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Gwe=require("@stdlib/utils/constant-function"),Vwe=require("@stdlib/utils/noop"),Fwe=require("@stdlib/object/assign"),Wwe=require("@stdlib/assert/is-plain-object"),yg=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Iwe=require("@stdlib/assert/has-own-property"),wV=require("@stdlib/constants/float64/max"),SV=Ra().factory,OV=require("@stdlib/symbol/iterator"),bn=require("@stdlib/string/format");function EV(r,e,t,i){var n,a,u,o,v;if(!yg(r))throw new TypeError(bn("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",r));if(!yg(e))throw new TypeError(bn("invalid argument. Second argument must be a nonnegative integer. Value: `%s`.",e));if(!yg(t))throw new TypeError(bn("invalid argument. Third argument must be a nonnegative integer. Value: `%s`.",t));if(t>r)throw new RangeError(bn("invalid argument. Number of draws must be less than or equal to the population size. Value: `%u`.",t));if(e>r)throw new RangeError(bn("invalid argument. Subpopulation size must be less than or equal to the population size. Value: `%u`.",e));if(arguments.length>3){if(!Wwe(i))throw new TypeError(bn("invalid argument. Options argument must be an object. Value: `%s`.",i));if(n=Fwe({},i),Iwe(n,"iter")){if(!yg(n.iter))throw new TypeError(bn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",n.iter))}else n.iter=wV;u=SV(r,e,t,n),n.prng===void 0&&n.copy!==!1&&(n.state=u.state)}else u=SV(r,e,t),n={iter:wV,state:u.state};return v=0,a={},$t(a,"next",g),$t(a,"return",c),n&&n.prng?($t(a,"seed",null),$t(a,"seedLength",null),bV(a,"state",Gwe(null),Vwe),$t(a,"stateLength",null),$t(a,"byteLength",null)):(pg(a,"seed",m),pg(a,"seedLength",h),bV(a,"state",f,y),pg(a,"stateLength",p),pg(a,"byteLength",d)),$t(a,"PRNG",u.PRNG),OV&&$t(a,OV,l),a;function g(){return v+=1,o||v>n.iter?{done:!0}:{value:u(),done:!1}}function c(q){return o=!0,arguments.length?{value:q,done:!0}:{done:!0}}function l(){return EV(r,e,t,n)}function m(){return u.PRNG.seed}function h(){return u.PRNG.seedLength}function p(){return u.PRNG.stateLength}function d(){return u.PRNG.byteLength}function f(){return u.PRNG.state}function y(q){u.PRNG.state=q}}_V.exports=EV});var RV=s(function(uKe,LV){"use strict";var kwe=NV();LV.exports=kwe});var VV=s(function(oKe,GV){"use strict";var Kt=require("@stdlib/utils/define-nonenumerable-read-only-property"),qg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),PV=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),zwe=require("@stdlib/utils/constant-function"),Jwe=require("@stdlib/utils/noop"),Uwe=require("@stdlib/object/assign"),Cwe=require("@stdlib/assert/is-plain-object"),Bwe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Dwe=require("@stdlib/assert/has-own-property"),TV=require("@stdlib/constants/float64/max"),jV=Q().factory,MV=require("@stdlib/symbol/iterator"),xV=require("@stdlib/string/format");function AV(r){var e,t,i,n,a;if(arguments.length>0){if(!Cwe(r))throw new TypeError(xV("invalid argument. Options argument must be an object. Value: `%s`.",r));if(e=Uwe({},r),Dwe(e,"iter")){if(!Bwe(e.iter))throw new TypeError(xV("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",e.iter))}else e.iter=TV;i=jV(e),e.prng===void 0&&e.copy!==!1&&(e.state=i.state)}else i=jV(),e={iter:TV,state:i.state};return a=0,t={},Kt(t,"next",u),Kt(t,"return",o),e&&e.prng?(Kt(t,"seed",null),Kt(t,"seedLength",null),PV(t,"state",zwe(null),Jwe),Kt(t,"stateLength",null),Kt(t,"byteLength",null)):(qg(t,"seed",g),qg(t,"seedLength",c),PV(t,"state",h,p),qg(t,"stateLength",l),qg(t,"byteLength",m)),Kt(t,"PRNG",i.PRNG),MV&&Kt(t,MV,v),t;function u(){return a+=1,n||a>e.iter?{done:!0}:{value:i(),done:!1}}function o(d){return n=!0,arguments.length?{value:d,done:!0}:{done:!0}}function v(){return AV(e)}function g(){return i.PRNG.seed}function c(){return i.PRNG.seedLength}function l(){return i.PRNG.stateLength}function m(){return i.PRNG.byteLength}function h(){return i.PRNG.state}function p(d){i.PRNG.state=d}}GV.exports=AV});var WV=s(function(vKe,FV){"use strict";var Xwe=VV();FV.exports=Xwe});var DV=s(function(gKe,BV){"use strict";var ei=require("@stdlib/utils/define-nonenumerable-read-only-property"),bg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),IV=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Ywe=require("@stdlib/utils/constant-function"),Hwe=require("@stdlib/utils/noop"),Zwe=require("@stdlib/object/assign"),kV=require("@stdlib/assert/is-positive-number").isPrimitive,Qwe=require("@stdlib/assert/is-plain-object"),$we=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Kwe=require("@stdlib/assert/has-own-property"),zV=require("@stdlib/constants/float64/max"),JV=mn().factory,UV=require("@stdlib/symbol/iterator"),wg=require("@stdlib/string/format");function CV(r,e,t){var i,n,a,u,o;if(!kV(r))throw new TypeError(wg("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!kV(e))throw new TypeError(wg("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!Qwe(t))throw new TypeError(wg("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=Zwe({},t),Kwe(i,"iter")){if(!$we(i.iter))throw new TypeError(wg("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=zV;a=JV(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=JV(r,e),i={iter:zV,state:a.state};return o=0,n={},ei(n,"next",v),ei(n,"return",g),i&&i.prng?(ei(n,"seed",null),ei(n,"seedLength",null),IV(n,"state",Ywe(null),Hwe),ei(n,"stateLength",null),ei(n,"byteLength",null)):(bg(n,"seed",l),bg(n,"seedLength",m),IV(n,"state",d,f),bg(n,"stateLength",h),bg(n,"byteLength",p)),ei(n,"PRNG",a.PRNG),UV&&ei(n,UV,c),n;function v(){return o+=1,u||o>i.iter?{done:!0}:{value:a(),done:!1}}function g(y){return u=!0,arguments.length?{value:y,done:!0}:{done:!0}}function c(){return CV(r,e,i)}function l(){return a.PRNG.seed}function m(){return a.PRNG.seedLength}function h(){return a.PRNG.stateLength}function p(){return a.PRNG.byteLength}function d(){return a.PRNG.state}function f(y){a.PRNG.state=y}}BV.exports=CV});var YV=s(function(fKe,XV){"use strict";var eSe=DV();XV.exports=eSe});var t2=s(function(dKe,r2){"use strict";var ri=require("@stdlib/utils/define-nonenumerable-read-only-property"),Sg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),HV=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),rSe=require("@stdlib/utils/constant-function"),tSe=require("@stdlib/utils/noop"),iSe=require("@stdlib/object/assign"),ZV=require("@stdlib/assert/is-positive-number").isPrimitive,nSe=require("@stdlib/assert/is-plain-object"),aSe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,sSe=require("@stdlib/assert/has-own-property"),QV=require("@stdlib/constants/float64/max"),$V=Ta().factory,KV=require("@stdlib/symbol/iterator"),Og=require("@stdlib/string/format");function e2(r,e,t){var i,n,a,u,o;if(!ZV(r))throw new TypeError(Og("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!ZV(e))throw new TypeError(Og("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!nSe(t))throw new TypeError(Og("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=iSe({},t),sSe(i,"iter")){if(!aSe(i.iter))throw new TypeError(Og("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=QV;a=$V(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=$V(r,e),i={iter:QV,state:a.state};return o=0,n={},ri(n,"next",v),ri(n,"return",g),i&&i.prng?(ri(n,"seed",null),ri(n,"seedLength",null),HV(n,"state",rSe(null),tSe),ri(n,"stateLength",null),ri(n,"byteLength",null)):(Sg(n,"seed",l),Sg(n,"seedLength",m),HV(n,"state",d,f),Sg(n,"stateLength",h),Sg(n,"byteLength",p)),ri(n,"PRNG",a.PRNG),KV&&ri(n,KV,c),n;function v(){return o+=1,u||o>i.iter?{done:!0}:{value:a(),done:!1}}function g(y){return u=!0,arguments.length?{value:y,done:!0}:{done:!0}}function c(){return e2(r,e,i)}function l(){return a.PRNG.seed}function m(){return a.PRNG.seedLength}function h(){return a.PRNG.stateLength}function p(){return a.PRNG.byteLength}function d(){return a.PRNG.state}function f(y){a.PRNG.state=y}}r2.exports=e2});var n2=s(function(lKe,i2){"use strict";var uSe=t2();i2.exports=uSe});var f2=s(function(cKe,g2){"use strict";var ti=require("@stdlib/utils/define-nonenumerable-read-only-property"),Eg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),a2=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),oSe=require("@stdlib/utils/constant-function"),vSe=require("@stdlib/utils/noop"),gSe=require("@stdlib/object/assign"),fSe=require("@stdlib/assert/is-number").isPrimitive,dSe=require("@stdlib/math/base/assert/is-nan"),lSe=require("@stdlib/assert/is-plain-object"),cSe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,mSe=require("@stdlib/assert/is-positive-number").isPrimitive,hSe=require("@stdlib/assert/has-own-property"),s2=require("@stdlib/constants/float64/max"),u2=ja().factory,o2=require("@stdlib/symbol/iterator"),_g=require("@stdlib/string/format");function v2(r,e,t){var i,n,a,u,o;if(!fSe(r)||dSe(r))throw new TypeError(_g("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!mSe(e))throw new TypeError(_g("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!lSe(t))throw new TypeError(_g("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=gSe({},t),hSe(i,"iter")){if(!cSe(i.iter))throw new TypeError(_g("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=s2;a=u2(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=u2(r,e),i={iter:s2,state:a.state};return o=0,n={},ti(n,"next",v),ti(n,"return",g),i&&i.prng?(ti(n,"seed",null),ti(n,"seedLength",null),a2(n,"state",oSe(null),vSe),ti(n,"stateLength",null),ti(n,"byteLength",null)):(Eg(n,"seed",l),Eg(n,"seedLength",m),a2(n,"state",d,f),Eg(n,"stateLength",h),Eg(n,"byteLength",p)),ti(n,"PRNG",a.PRNG),o2&&ti(n,o2,c),n;function v(){return o+=1,u||o>i.iter?{done:!0}:{value:a(),done:!1}}function g(y){return u=!0,arguments.length?{value:y,done:!0}:{done:!0}}function c(){return v2(r,e,i)}function l(){return a.PRNG.seed}function m(){return a.PRNG.seedLength}function h(){return a.PRNG.stateLength}function p(){return a.PRNG.byteLength}function d(){return a.PRNG.state}function f(y){a.PRNG.state=y}}g2.exports=v2});var l2=s(function(mKe,d2){"use strict";var pSe=f2();d2.exports=pSe});var b2=s(function(hKe,q2){"use strict";var ii=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ng=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),c2=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),ySe=require("@stdlib/utils/constant-function"),qSe=require("@stdlib/utils/noop"),bSe=require("@stdlib/object/assign"),wSe=require("@stdlib/assert/is-number").isPrimitive,SSe=require("@stdlib/math/base/assert/is-nan"),OSe=require("@stdlib/assert/is-plain-object"),ESe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,_Se=require("@stdlib/assert/is-positive-number").isPrimitive,NSe=require("@stdlib/assert/has-own-property"),m2=require("@stdlib/constants/float64/max"),h2=Ma().factory,p2=require("@stdlib/symbol/iterator"),Lg=require("@stdlib/string/format");function y2(r,e,t){var i,n,a,u,o;if(!wSe(r)||SSe(r))throw new TypeError(Lg("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!_Se(e))throw new TypeError(Lg("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!OSe(t))throw new TypeError(Lg("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=bSe({},t),NSe(i,"iter")){if(!ESe(i.iter))throw new TypeError(Lg("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=m2;a=h2(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=h2(r,e),i={iter:m2,state:a.state};return o=0,n={},ii(n,"next",v),ii(n,"return",g),i&&i.prng?(ii(n,"seed",null),ii(n,"seedLength",null),c2(n,"state",ySe(null),qSe),ii(n,"stateLength",null),ii(n,"byteLength",null)):(Ng(n,"seed",l),Ng(n,"seedLength",m),c2(n,"state",d,f),Ng(n,"stateLength",h),Ng(n,"byteLength",p)),ii(n,"PRNG",a.PRNG),p2&&ii(n,p2,c),n;function v(){return o+=1,u||o>i.iter?{done:!0}:{value:a(),done:!1}}function g(y){return u=!0,arguments.length?{value:y,done:!0}:{done:!0}}function c(){return y2(r,e,i)}function l(){return a.PRNG.seed}function m(){return a.PRNG.seedLength}function h(){return a.PRNG.stateLength}function p(){return a.PRNG.byteLength}function d(){return a.PRNG.state}function f(y){a.PRNG.state=y}}q2.exports=y2});var S2=s(function(pKe,w2){"use strict";var LSe=b2();w2.exports=LSe});var P2=s(function(yKe,R2){"use strict";var ni=require("@stdlib/utils/define-nonenumerable-read-only-property"),Rg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),O2=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),RSe=require("@stdlib/utils/constant-function"),PSe=require("@stdlib/utils/noop"),TSe=require("@stdlib/object/assign"),jSe=require("@stdlib/assert/is-number").isPrimitive,MSe=require("@stdlib/math/base/assert/is-nan"),xSe=require("@stdlib/assert/is-plain-object"),ASe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,GSe=require("@stdlib/assert/is-positive-number").isPrimitive,VSe=require("@stdlib/assert/has-own-property"),E2=require("@stdlib/constants/float64/max"),_2=xa().factory,N2=require("@stdlib/symbol/iterator"),Pg=require("@stdlib/string/format");function L2(r,e,t){var i,n,a,u,o;if(!jSe(r)||MSe(r))throw new TypeError(Pg("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!GSe(e))throw new TypeError(Pg("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!xSe(t))throw new TypeError(Pg("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=TSe({},t),VSe(i,"iter")){if(!ASe(i.iter))throw new TypeError(Pg("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=E2;a=_2(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=_2(r,e),i={iter:E2,state:a.state};return o=0,n={},ni(n,"next",v),ni(n,"return",g),i&&i.prng?(ni(n,"seed",null),ni(n,"seedLength",null),O2(n,"state",RSe(null),PSe),ni(n,"stateLength",null),ni(n,"byteLength",null)):(Rg(n,"seed",l),Rg(n,"seedLength",m),O2(n,"state",d,f),Rg(n,"stateLength",h),Rg(n,"byteLength",p)),ni(n,"PRNG",a.PRNG),N2&&ni(n,N2,c),n;function v(){return o+=1,u||o>i.iter?{done:!0}:{value:a(),done:!1}}function g(y){return u=!0,arguments.length?{value:y,done:!0}:{done:!0}}function c(){return L2(r,e,i)}function l(){return a.PRNG.seed}function m(){return a.PRNG.seedLength}function h(){return a.PRNG.stateLength}function p(){return a.PRNG.byteLength}function d(){return a.PRNG.state}function f(y){a.PRNG.state=y}}R2.exports=L2});var j2=s(function(qKe,T2){"use strict";var FSe=P2();T2.exports=FSe});var W2=s(function(bKe,F2){"use strict";var ai=require("@stdlib/utils/define-nonenumerable-read-only-property"),Tg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),M2=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),WSe=require("@stdlib/utils/constant-function"),ISe=require("@stdlib/utils/noop"),kSe=require("@stdlib/object/assign"),zSe=require("@stdlib/assert/is-number").isPrimitive,JSe=require("@stdlib/math/base/assert/is-nan"),USe=require("@stdlib/assert/is-plain-object"),CSe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,BSe=require("@stdlib/assert/is-positive-number").isPrimitive,DSe=require("@stdlib/assert/has-own-property"),x2=require("@stdlib/constants/float64/max"),A2=hn().factory,G2=require("@stdlib/symbol/iterator"),jg=require("@stdlib/string/format");function V2(r,e,t){var i,n,a,u,o;if(!zSe(r)||JSe(r))throw new TypeError(jg("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!BSe(e))throw new TypeError(jg("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!USe(t))throw new TypeError(jg("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=kSe({},t),DSe(i,"iter")){if(!CSe(i.iter))throw new TypeError(jg("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=x2;a=A2(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=A2(r,e),i={iter:x2,state:a.state};return o=0,n={},ai(n,"next",v),ai(n,"return",g),i&&i.prng?(ai(n,"seed",null),ai(n,"seedLength",null),M2(n,"state",WSe(null),ISe),ai(n,"stateLength",null),ai(n,"byteLength",null)):(Tg(n,"seed",l),Tg(n,"seedLength",m),M2(n,"state",d,f),Tg(n,"stateLength",h),Tg(n,"byteLength",p)),ai(n,"PRNG",a.PRNG),G2&&ai(n,G2,c),n;function v(){return o+=1,u||o>i.iter?{done:!0}:{value:a(),done:!1}}function g(y){return u=!0,arguments.length?{value:y,done:!0}:{done:!0}}function c(){return V2(r,e,i)}function l(){return a.PRNG.seed}function m(){return a.PRNG.seedLength}function h(){return a.PRNG.stateLength}function p(){return a.PRNG.byteLength}function d(){return a.PRNG.state}function f(y){a.PRNG.state=y}}F2.exports=V2});var k2=s(function(wKe,I2){"use strict";var XSe=W2();I2.exports=XSe});var X2=s(function(SKe,D2){"use strict";var am=require("@stdlib/utils/define-nonenumerable-read-only-property"),Mg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),YSe=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),HSe=require("@stdlib/object/assign"),ZSe=require("@stdlib/assert/is-plain-object"),QSe=require("@stdlib/assert/is-boolean").isPrimitive,$Se=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,z2=require("@stdlib/assert/has-own-property"),J2=require("@stdlib/constants/float64/max"),U2=$().factory,C2=require("@stdlib/symbol/iterator"),sm=require("@stdlib/string/format");function B2(r){var e,t,i,n,a;if(arguments.length>0){if(!ZSe(r))throw new TypeError(sm("invalid argument. Options argument must be an object. Value: `%s`.",r));if(e=HSe({},r),z2(e,"normalized")&&!QSe(e.normalized))throw new TypeError(sm("invalid option. `%s` option must be a boolean. Option: `%s`.","normalized",e.normalized));if(z2(e,"iter")){if(!$Se(e.iter))throw new TypeError(sm("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",e.iter))}else e.iter=J2;i=U2(e),e.copy!==!1&&(e.state=i.state)}else i=U2(),e={iter:J2,state:i.state};return e.normalized&&(i=i.normalized),a=0,t={},am(t,"next",u),am(t,"return",o),Mg(t,"seed",g),Mg(t,"seedLength",c),YSe(t,"state",h,p),Mg(t,"stateLength",l),Mg(t,"byteLength",m),C2&&am(t,C2,v),t;function u(){return a+=1,n||a>e.iter?{done:!0}:{value:i(),done:!1}}function o(d){return n=!0,arguments.length?{value:d,done:!0}:{done:!0}}function v(){return B2(e)}function g(){return i.seed}function c(){return i.seedLength}function l(){return i.stateLength}function m(){return i.byteLength}function h(){return i.state}function p(d){i.state=d}}D2.exports=B2});var H2=s(function(OKe,Y2){"use strict";var KSe=X2();Y2.exports=KSe});var tF=s(function(EKe,rF){"use strict";var um=require("@stdlib/utils/define-nonenumerable-read-only-property"),xg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),eOe=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),rOe=require("@stdlib/object/assign"),tOe=require("@stdlib/assert/is-plain-object"),iOe=require("@stdlib/assert/is-boolean").isPrimitive,nOe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Z2=require("@stdlib/assert/has-own-property"),Q2=require("@stdlib/constants/float64/max"),$2=ee().factory,K2=require("@stdlib/symbol/iterator"),om=require("@stdlib/string/format");function eF(r){var e,t,i,n,a;if(arguments.length>0){if(!tOe(r))throw new TypeError(om("invalid argument. Options argument must be an object. Value: `%s`.",r));if(e=rOe({},r),Z2(e,"normalized")&&!iOe(e.normalized))throw new TypeError(om("invalid option. `%s` option must be a boolean. Option: `%s`.","normalized",e.normalized));if(Z2(e,"iter")){if(!nOe(e.iter))throw new TypeError(om("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",e.iter))}else e.iter=Q2;i=$2(e),e.copy!==!1&&(e.state=i.state)}else i=$2(),e={iter:Q2,state:i.state};return e.normalized&&(i=i.normalized),a=0,t={},um(t,"next",u),um(t,"return",o),xg(t,"seed",g),xg(t,"seedLength",c),eOe(t,"state",h,p),xg(t,"stateLength",l),xg(t,"byteLength",m),K2&&um(t,K2,v),t;function u(){return a+=1,n||a>e.iter?{done:!0}:{value:i(),done:!1}}function o(d){return n=!0,arguments.length?{value:d,done:!0}:{done:!0}}function v(){return eF(e)}function g(){return i.seed}function c(){return i.seedLength}function l(){return i.stateLength}function m(){return i.byteLength}function h(){return i.state}function p(d){i.state=d}}rF.exports=eF});var nF=s(function(_Ke,iF){"use strict";var aOe=tF();iF.exports=aOe});var fF=s(function(NKe,gF){"use strict";var vm=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ag=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),sOe=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),uOe=require("@stdlib/object/assign"),oOe=require("@stdlib/assert/is-plain-object"),vOe=require("@stdlib/assert/is-boolean").isPrimitive,gOe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,aF=require("@stdlib/assert/has-own-property"),sF=require("@stdlib/constants/float64/max"),uF=T().factory,oF=require("@stdlib/symbol/iterator"),gm=require("@stdlib/string/format");function vF(r){var e,t,i,n,a;if(arguments.length>0){if(!oOe(r))throw new TypeError(gm("invalid argument. Options argument must be an object. Value: `%s`.",r));if(e=uOe({},r),aF(e,"normalized")&&!vOe(e.normalized))throw new TypeError(gm("invalid option. `%s` option must be a boolean. Option: `%s`.","normalized",e.normalized));if(aF(e,"iter")){if(!gOe(e.iter))throw new TypeError(gm("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",e.iter))}else e.iter=sF;i=uF(e),e.copy!==!1&&(e.state=i.state)}else i=uF(),e={iter:sF,state:i.state};return e.normalized&&(i=i.normalized),a=0,t={},vm(t,"next",u),vm(t,"return",o),Ag(t,"seed",g),Ag(t,"seedLength",c),sOe(t,"state",h,p),Ag(t,"stateLength",l),Ag(t,"byteLength",m),oF&&vm(t,oF,v),t;function u(){return a+=1,n||a>e.iter?{done:!0}:{value:i(),done:!1}}function o(d){return n=!0,arguments.length?{value:d,done:!0}:{done:!0}}function v(){return vF(e)}function g(){return i.seed}function c(){return i.seedLength}function l(){return i.stateLength}function m(){return i.byteLength}function h(){return i.state}function p(d){i.state=d}}gF.exports=vF});var lF=s(function(LKe,dF){"use strict";var fOe=fF();dF.exports=fOe});var bF=s(function(RKe,qF){"use strict";var si=require("@stdlib/utils/define-nonenumerable-read-only-property"),Gg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),cF=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),dOe=require("@stdlib/utils/constant-function"),lOe=require("@stdlib/utils/noop"),cOe=require("@stdlib/object/assign"),mOe=require("@stdlib/assert/is-probability").isPrimitive,hOe=require("@stdlib/assert/is-plain-object"),pOe=require("@stdlib/assert/is-positive-number").isPrimitive,yOe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,qOe=require("@stdlib/assert/has-own-property"),mF=require("@stdlib/constants/float64/max"),hF=ka().factory,pF=require("@stdlib/symbol/iterator"),Vg=require("@stdlib/string/format");function yF(r,e,t){var i,n,a,u,o;if(!pOe(r))throw new TypeError(Vg("invalid argument. First argument must be a positive integer. Value: `%s`.",r));if(!mOe(e))throw new TypeError(Vg("invalid argument. Second argument must be a probability. Value: `%s`.",e));if(arguments.length>2){if(!hOe(t))throw new TypeError(Vg("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=cOe({},t),qOe(i,"iter")){if(!yOe(i.iter))throw new TypeError(Vg("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=mF;a=hF(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=hF(r,e),i={iter:mF,state:a.state};return o=0,n={},si(n,"next",v),si(n,"return",g),i&&i.prng?(si(n,"seed",null),si(n,"seedLength",null),cF(n,"state",dOe(null),lOe),si(n,"stateLength",null),si(n,"byteLength",null)):(Gg(n,"seed",l),Gg(n,"seedLength",m),cF(n,"state",d,f),Gg(n,"stateLength",h),Gg(n,"byteLength",p)),si(n,"PRNG",a.PRNG),pF&&si(n,pF,c),n;function v(){return o+=1,u||o>i.iter?{done:!0}:{value:a(),done:!1}}function g(y){return u=!0,arguments.length?{value:y,done:!0}:{done:!0}}function c(){return yF(r,e,i)}function l(){return a.PRNG.seed}function m(){return a.PRNG.seedLength}function h(){return a.PRNG.stateLength}function p(){return a.PRNG.byteLength}function d(){return a.PRNG.state}function f(y){a.PRNG.state=y}}qF.exports=yF});var SF=s(function(PKe,wF){"use strict";var bOe=bF();wF.exports=bOe});var PF=s(function(TKe,RF){"use strict";var ui=require("@stdlib/utils/define-nonenumerable-read-only-property"),Fg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),OF=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),wOe=require("@stdlib/utils/constant-function"),SOe=require("@stdlib/utils/noop"),OOe=require("@stdlib/object/assign"),EOe=require("@stdlib/assert/is-number").isPrimitive,_Oe=require("@stdlib/math/base/assert/is-nan"),NOe=require("@stdlib/assert/is-plain-object"),LOe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,ROe=require("@stdlib/assert/is-positive-number").isPrimitive,POe=require("@stdlib/assert/has-own-property"),EF=require("@stdlib/constants/float64/max"),_F=pn().factory,NF=require("@stdlib/symbol/iterator"),Wg=require("@stdlib/string/format");function LF(r,e,t){var i,n,a,u,o;if(!EOe(r)||_Oe(r))throw new TypeError(Wg("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!ROe(e))throw new TypeError(Wg("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!NOe(t))throw new TypeError(Wg("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=OOe({},t),POe(i,"iter")){if(!LOe(i.iter))throw new TypeError(Wg("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=EF;a=_F(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=_F(r,e),i={iter:EF,state:a.state};return o=0,n={},ui(n,"next",v),ui(n,"return",g),i&&i.prng?(ui(n,"seed",null),ui(n,"seedLength",null),OF(n,"state",wOe(null),SOe),ui(n,"stateLength",null),ui(n,"byteLength",null)):(Fg(n,"seed",l),Fg(n,"seedLength",m),OF(n,"state",d,f),Fg(n,"stateLength",h),Fg(n,"byteLength",p)),ui(n,"PRNG",a.PRNG),NF&&ui(n,NF,c),n;function v(){return o+=1,u||o>i.iter?{done:!0}:{value:a(),done:!1}}function g(y){return u=!0,arguments.length?{value:y,done:!0}:{done:!0}}function c(){return LF(r,e,i)}function l(){return a.PRNG.seed}function m(){return a.PRNG.seedLength}function h(){return a.PRNG.stateLength}function p(){return a.PRNG.byteLength}function d(){return a.PRNG.state}function f(y){a.PRNG.state=y}}RF.exports=LF});var jF=s(function(jKe,TF){"use strict";var TOe=PF();TF.exports=TOe});var IF=s(function(MKe,WF){"use strict";var oi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ig=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),MF=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),jOe=require("@stdlib/utils/constant-function"),MOe=require("@stdlib/utils/noop"),xOe=require("@stdlib/object/assign"),xF=require("@stdlib/assert/is-positive-number").isPrimitive,AOe=require("@stdlib/assert/is-plain-object"),GOe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,VOe=require("@stdlib/assert/has-own-property"),AF=require("@stdlib/constants/float64/max"),GF=Ja().factory,VF=require("@stdlib/symbol/iterator"),kg=require("@stdlib/string/format");function FF(r,e,t){var i,n,a,u,o;if(!xF(r))throw new TypeError(kg("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!xF(e))throw new TypeError(kg("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!AOe(t))throw new TypeError(kg("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=xOe({},t),VOe(i,"iter")){if(!GOe(i.iter))throw new TypeError(kg("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=AF;a=GF(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=GF(r,e),i={iter:AF,state:a.state};return o=0,n={},oi(n,"next",v),oi(n,"return",g),i&&i.prng?(oi(n,"seed",null),oi(n,"seedLength",null),MF(n,"state",jOe(null),MOe),oi(n,"stateLength",null),oi(n,"byteLength",null)):(Ig(n,"seed",l),Ig(n,"seedLength",m),MF(n,"state",d,f),Ig(n,"stateLength",h),Ig(n,"byteLength",p)),oi(n,"PRNG",a.PRNG),VF&&oi(n,VF,c),n;function v(){return o+=1,u||o>i.iter?{done:!0}:{value:a(),done:!1}}function g(y){return u=!0,arguments.length?{value:y,done:!0}:{done:!0}}function c(){return FF(r,e,i)}function l(){return a.PRNG.seed}function m(){return a.PRNG.seedLength}function h(){return a.PRNG.stateLength}function p(){return a.PRNG.byteLength}function d(){return a.PRNG.state}function f(y){a.PRNG.state=y}}WF.exports=FF});var zF=s(function(xKe,kF){"use strict";var FOe=IF();kF.exports=FOe});var YF=s(function(AKe,XF){"use strict";var vi=require("@stdlib/utils/define-nonenumerable-read-only-property"),zg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),JF=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),WOe=require("@stdlib/utils/constant-function"),IOe=require("@stdlib/utils/noop"),kOe=require("@stdlib/object/assign"),zOe=require("@stdlib/assert/is-positive-number").isPrimitive,JOe=require("@stdlib/assert/is-plain-object"),UOe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,COe=require("@stdlib/assert/has-own-property"),UF=require("@stdlib/constants/float64/max"),CF=Rt().factory,BF=require("@stdlib/symbol/iterator"),fm=require("@stdlib/string/format");function DF(r,e){var t,i,n,a,u;if(!zOe(r))throw new TypeError(fm("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(arguments.length>1){if(!JOe(e))throw new TypeError(fm("invalid argument. Options argument must be an object. Value: `%s`.",e));if(t=kOe({},e),COe(t,"iter")){if(!UOe(t.iter))throw new TypeError(fm("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=UF;n=CF(r,t),t.prng===void 0&&t.copy!==!1&&(t.state=n.state)}else n=CF(r),t={iter:UF,state:n.state};return u=0,i={},vi(i,"next",o),vi(i,"return",v),t&&t.prng?(vi(i,"seed",null),vi(i,"seedLength",null),JF(i,"state",WOe(null),IOe),vi(i,"stateLength",null),vi(i,"byteLength",null)):(zg(i,"seed",c),zg(i,"seedLength",l),JF(i,"state",p,d),zg(i,"stateLength",m),zg(i,"byteLength",h)),vi(i,"PRNG",n.PRNG),BF&&vi(i,BF,g),i;function o(){return u+=1,a||u>t.iter?{done:!0}:{value:n(),done:!1}}function v(f){return a=!0,arguments.length?{value:f,done:!0}:{done:!0}}function g(){return DF(r,t)}function c(){return n.PRNG.seed}function l(){return n.PRNG.seedLength}function m(){return n.PRNG.stateLength}function h(){return n.PRNG.byteLength}function p(){return n.PRNG.state}function d(f){n.PRNG.state=f}}XF.exports=DF});var ZF=s(function(GKe,HF){"use strict";var BOe=YF();HF.exports=BOe});var iW=s(function(VKe,tW){"use strict";var Jg=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ug=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),DOe=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),XOe=require("@stdlib/object/assign"),YOe=require("@stdlib/assert/is-plain-object"),HOe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,ZOe=require("@stdlib/assert/has-own-property"),QF=require("@stdlib/constants/float64/max"),$F=pu().factory,KF=require("@stdlib/symbol/iterator"),eW=require("@stdlib/string/format");function rW(r){var e,t,i,n,a;if(arguments.length>0){if(!YOe(r))throw new TypeError(eW("invalid argument. Options argument must be an object. Value: `%s`.",r));if(e=XOe({},r),ZOe(e,"iter")){if(!HOe(e.iter))throw new TypeError(eW("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",e.iter))}else e.iter=QF;i=$F(e),e.copy!==!1&&(e.state=i.state)}else i=$F(),e={iter:QF,state:i.state};return a=0,t={},Jg(t,"next",u),Jg(t,"return",o),Ug(t,"seed",g),Ug(t,"seedLength",c),DOe(t,"state",h,p),Ug(t,"stateLength",l),Ug(t,"byteLength",m),Jg(t,"PRNG",i.PRNG),KF&&Jg(t,KF,v),t;function u(){return a+=1,n||a>e.iter?{done:!0}:{value:i(),done:!1}}function o(d){return n=!0,arguments.length?{value:d,done:!0}:{done:!0}}function v(){return rW(e)}function g(){return i.PRNG.seed}function c(){return i.PRNG.seedLength}function l(){return i.PRNG.stateLength}function m(){return i.PRNG.byteLength}function h(){return i.PRNG.state}function p(d){i.PRNG.state=d}}tW.exports=rW});var aW=s(function(FKe,nW){"use strict";var QOe=iW();nW.exports=QOe});var lW=s(function(WKe,dW){"use strict";var gi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Cg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),sW=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),$Oe=require("@stdlib/utils/constant-function"),KOe=require("@stdlib/utils/noop"),eEe=require("@stdlib/object/assign"),rEe=require("@stdlib/assert/is-plain-object"),tEe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,iEe=require("@stdlib/assert/has-own-property"),uW=require("@stdlib/constants/float64/max"),oW=qu().factory,vW=require("@stdlib/symbol/iterator"),gW=require("@stdlib/string/format");function fW(r){var e,t,i,n,a;if(arguments.length>0){if(!rEe(r))throw new TypeError(gW("invalid argument. Options argument must be an object. Value: `%s`.",r));if(e=eEe({},r),iEe(e,"iter")){if(!tEe(e.iter))throw new TypeError(gW("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",e.iter))}else e.iter=uW;i=oW(e),e.prng===void 0&&e.copy!==!1&&(e.state=i.state)}else i=oW(),e={iter:uW,state:i.state};return a=0,t={},gi(t,"next",u),gi(t,"return",o),e&&e.prng?(gi(t,"seed",null),gi(t,"seedLength",null),sW(t,"state",$Oe(null),KOe),gi(t,"stateLength",null),gi(t,"byteLength",null)):(Cg(t,"seed",g),Cg(t,"seedLength",c),sW(t,"state",h,p),Cg(t,"stateLength",l),Cg(t,"byteLength",m)),gi(t,"PRNG",i.PRNG),vW&&gi(t,vW,v),t;function u(){return a+=1,n||a>e.iter?{done:!0}:{value:i(),done:!1}}function o(d){return n=!0,arguments.length?{value:d,done:!0}:{done:!0}}function v(){return fW(e)}function g(){return i.PRNG.seed}function c(){return i.PRNG.seedLength}function l(){return i.PRNG.stateLength}function m(){return i.PRNG.byteLength}function h(){return i.PRNG.state}function p(d){i.PRNG.state=d}}dW.exports=fW});var mW=s(function(IKe,cW){"use strict";var nEe=lW();cW.exports=nEe});var SW=s(function(kKe,wW){"use strict";var Bg=require("@stdlib/utils/define-nonenumerable-read-only-property"),Dg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),aEe=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),sEe=require("@stdlib/object/assign"),uEe=require("@stdlib/assert/is-plain-object"),oEe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,vEe=require("@stdlib/assert/has-own-property"),hW=require("@stdlib/constants/float64/max"),pW=jt().factory,yW=require("@stdlib/symbol/iterator"),qW=require("@stdlib/string/format");function bW(r){var e,t,i,n,a;if(arguments.length>0){if(!uEe(r))throw new TypeError(qW("invalid argument. Options argument must be an object. Value: `%s`.",r));if(e=sEe({},r),vEe(e,"iter")){if(!oEe(e.iter))throw new TypeError(qW("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",e.iter))}else e.iter=hW;i=pW(e),e.copy!==!1&&(e.state=i.state)}else i=pW(),e={iter:hW,state:i.state};return a=0,t={},Bg(t,"next",u),Bg(t,"return",o),Dg(t,"seed",g),Dg(t,"seedLength",c),aEe(t,"state",h,p),Dg(t,"stateLength",l),Dg(t,"byteLength",m),Bg(t,"PRNG",i.PRNG),yW&&Bg(t,yW,v),t;function u(){return a+=1,n||a>e.iter?{done:!0}:{value:i(),done:!1}}function o(d){return n=!0,arguments.length?{value:d,done:!0}:{done:!0}}function v(){return bW(e)}function g(){return i.PRNG.seed}function c(){return i.PRNG.seedLength}function l(){return i.PRNG.stateLength}function m(){return i.PRNG.byteLength}function h(){return i.PRNG.state}function p(d){i.PRNG.state=d}}wW.exports=bW});var EW=s(function(zKe,OW){"use strict";var gEe=SW();OW.exports=gEe});var jW=s(function(JKe,TW){"use strict";var fi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Xg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),_W=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),fEe=require("@stdlib/utils/constant-function"),dEe=require("@stdlib/utils/noop"),lEe=require("@stdlib/object/assign"),cEe=require("@stdlib/assert/is-positive-number").isPrimitive,mEe=require("@stdlib/assert/is-plain-object"),hEe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,pEe=require("@stdlib/assert/has-own-property"),NW=require("@stdlib/constants/float64/max"),LW=Ua().factory,RW=require("@stdlib/symbol/iterator"),dm=require("@stdlib/string/format");function PW(r,e){var t,i,n,a,u;if(!cEe(r))throw new TypeError(dm("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(arguments.length>1){if(!mEe(e))throw new TypeError(dm("invalid argument. Options argument must be an object. Value: `%s`.",e));if(t=lEe({},e),pEe(t,"iter")){if(!hEe(t.iter))throw new TypeError(dm("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=NW;n=LW(r,t),t.prng===void 0&&t.copy!==!1&&(t.state=n.state)}else n=LW(r),t={iter:NW,state:n.state};return u=0,i={},fi(i,"next",o),fi(i,"return",v),t&&t.prng?(fi(i,"seed",null),fi(i,"seedLength",null),_W(i,"state",fEe(null),dEe),fi(i,"stateLength",null),fi(i,"byteLength",null)):(Xg(i,"seed",c),Xg(i,"seedLength",l),_W(i,"state",p,d),Xg(i,"stateLength",m),Xg(i,"byteLength",h)),fi(i,"PRNG",n.PRNG),RW&&fi(i,RW,g),i;function o(){return u+=1,a||u>t.iter?{done:!0}:{value:n(),done:!1}}function v(f){return a=!0,arguments.length?{value:f,done:!0}:{done:!0}}function g(){return PW(r,t)}function c(){return n.PRNG.seed}function l(){return n.PRNG.seedLength}function m(){return n.PRNG.stateLength}function h(){return n.PRNG.byteLength}function p(){return n.PRNG.state}function d(f){n.PRNG.state=f}}TW.exports=PW});var xW=s(function(UKe,MW){"use strict";var yEe=jW();MW.exports=yEe});var kW=s(function(CKe,IW){"use strict";var di=require("@stdlib/utils/define-nonenumerable-read-only-property"),Yg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),AW=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),qEe=require("@stdlib/utils/constant-function"),bEe=require("@stdlib/utils/noop"),wEe=require("@stdlib/object/assign"),SEe=require("@stdlib/assert/is-positive-number").isPrimitive,OEe=require("@stdlib/assert/is-plain-object"),EEe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,_Ee=require("@stdlib/assert/has-own-property"),GW=require("@stdlib/constants/float64/max"),VW=Da().factory,FW=require("@stdlib/symbol/iterator"),lm=require("@stdlib/string/format");function WW(r,e){var t,i,n,a,u;if(!SEe(r))throw new TypeError(lm("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(arguments.length>1){if(!OEe(e))throw new TypeError(lm("invalid argument. Options argument must be an object. Value: `%s`.",e));if(t=wEe({},e),_Ee(t,"iter")){if(!EEe(t.iter))throw new TypeError(lm("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=GW;n=VW(r,t),t.prng===void 0&&t.copy!==!1&&(t.state=n.state)}else n=VW(r),t={iter:GW,state:n.state};return u=0,i={},di(i,"next",o),di(i,"return",v),t&&t.prng?(di(i,"seed",null),di(i,"seedLength",null),AW(i,"state",qEe(null),bEe),di(i,"stateLength",null),di(i,"byteLength",null)):(Yg(i,"seed",c),Yg(i,"seedLength",l),AW(i,"state",p,d),Yg(i,"stateLength",m),Yg(i,"byteLength",h)),di(i,"PRNG",n.PRNG),FW&&di(i,FW,g),i;function o(){return u+=1,a||u>t.iter?{done:!0}:{value:n(),done:!1}}function v(f){return a=!0,arguments.length?{value:f,done:!0}:{done:!0}}function g(){return WW(r,t)}function c(){return n.PRNG.seed}function l(){return n.PRNG.seedLength}function m(){return n.PRNG.stateLength}function h(){return n.PRNG.byteLength}function p(){return n.PRNG.state}function d(f){n.PRNG.state=f}}IW.exports=WW});var JW=s(function(BKe,zW){"use strict";var NEe=kW();zW.exports=NEe});var HW=s(function(DKe,YW){"use strict";var li=require("@stdlib/utils/define-nonenumerable-read-only-property"),Hg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),UW=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),LEe=require("@stdlib/utils/constant-function"),REe=require("@stdlib/utils/noop"),PEe=require("@stdlib/object/assign"),cm=require("@stdlib/assert/is-number").isPrimitive,mm=require("@stdlib/math/base/assert/is-nan"),TEe=require("@stdlib/assert/is-plain-object"),jEe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,MEe=require("@stdlib/assert/has-own-property"),CW=require("@stdlib/constants/float64/max"),BW=Xa().factory,DW=require("@stdlib/symbol/iterator"),Za=require("@stdlib/string/format");function XW(r,e,t,i){var n,a,u,o,v;if(!cm(r)||mm(r))throw new TypeError(Za("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!cm(e)||mm(e))throw new TypeError(Za("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e));if(!cm(t)||mm(t))throw new TypeError(Za("invalid argument. Third argument must be a number and not NaN. Value: `%s`.",t));if(!(r<=t&&t<=e))throw new RangeError(Za("invalid arguments. Parameters must satisfy the following condition: %s. a: `%f`. b: `%f`. c: `%f`.","a <= c <= b",r,e,t));if(arguments.length>3){if(!TEe(i))throw new TypeError(Za("invalid argument. Options argument must be an object. Value: `%s`.",i));if(n=PEe({},i),MEe(n,"iter")){if(!jEe(n.iter))throw new TypeError(Za("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",n.iter))}else n.iter=CW;u=BW(r,e,t,n),n.prng===void 0&&n.copy!==!1&&(n.state=u.state)}else u=BW(r,e,t),n={iter:CW,state:u.state};return v=0,a={},li(a,"next",g),li(a,"return",c),n&&n.prng?(li(a,"seed",null),li(a,"seedLength",null),UW(a,"state",LEe(null),REe),li(a,"stateLength",null),li(a,"byteLength",null)):(Hg(a,"seed",m),Hg(a,"seedLength",h),UW(a,"state",f,y),Hg(a,"stateLength",p),Hg(a,"byteLength",d)),li(a,"PRNG",u.PRNG),DW&&li(a,DW,l),a;function g(){return v+=1,o||v>n.iter?{done:!0}:{value:u(),done:!1}}function c(q){return o=!0,arguments.length?{value:q,done:!0}:{done:!0}}function l(){return XW(r,e,t,n)}function m(){return u.PRNG.seed}function h(){return u.PRNG.seedLength}function p(){return u.PRNG.stateLength}function d(){return u.PRNG.byteLength}function f(){return u.PRNG.state}function y(q){u.PRNG.state=q}}YW.exports=XW});var QW=s(function(XKe,ZW){"use strict";var xEe=HW();ZW.exports=xEe});var sI=s(function(YKe,aI){"use strict";var ci=require("@stdlib/utils/define-nonenumerable-read-only-property"),Zg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),$W=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),AEe=require("@stdlib/utils/constant-function"),GEe=require("@stdlib/utils/noop"),VEe=require("@stdlib/object/assign"),KW=require("@stdlib/assert/is-number").isPrimitive,eI=require("@stdlib/math/base/assert/is-nan"),FEe=require("@stdlib/assert/is-plain-object"),WEe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,IEe=require("@stdlib/assert/has-own-property"),rI=require("@stdlib/constants/float64/max"),tI=yn().factory,iI=require("@stdlib/symbol/iterator"),Ou=require("@stdlib/string/format");function nI(r,e,t){var i,n,a,u,o;if(!KW(r)||eI(r))throw new TypeError(Ou("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!KW(e)||eI(e))throw new TypeError(Ou("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e));if(r>=e)throw new RangeError(Ou("invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.",r,e));if(arguments.length>2){if(!FEe(t))throw new TypeError(Ou("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=VEe({},t),IEe(i,"iter")){if(!WEe(i.iter))throw new TypeError(Ou("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=rI;a=tI(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=tI(r,e),i={iter:rI,state:a.state};return o=0,n={},ci(n,"next",v),ci(n,"return",g),i&&i.prng?(ci(n,"seed",null),ci(n,"seedLength",null),$W(n,"state",AEe(null),GEe),ci(n,"stateLength",null),ci(n,"byteLength",null)):(Zg(n,"seed",l),Zg(n,"seedLength",m),$W(n,"state",d,f),Zg(n,"stateLength",h),Zg(n,"byteLength",p)),ci(n,"PRNG",a.PRNG),iI&&ci(n,iI,c),n;function v(){return o+=1,u||o>i.iter?{done:!0}:{value:a(),done:!1}}function g(y){return u=!0,arguments.length?{value:y,done:!0}:{done:!0}}function c(){return nI(r,e,i)}function l(){return a.PRNG.seed}function m(){return a.PRNG.seedLength}function h(){return a.PRNG.stateLength}function p(){return a.PRNG.byteLength}function d(){return a.PRNG.state}function f(y){a.PRNG.state=y}}aI.exports=nI});var oI=s(function(HKe,uI){"use strict";var kEe=sI();uI.exports=kEe});var hI=s(function(ZKe,mI){"use strict";var mi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Qg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),vI=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),zEe=require("@stdlib/utils/constant-function"),JEe=require("@stdlib/utils/noop"),UEe=require("@stdlib/object/assign"),gI=require("@stdlib/assert/is-positive-number").isPrimitive,CEe=require("@stdlib/assert/is-plain-object"),BEe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,DEe=require("@stdlib/assert/has-own-property"),fI=require("@stdlib/constants/float64/max"),dI=qn().factory,lI=require("@stdlib/symbol/iterator"),$g=require("@stdlib/string/format");function cI(r,e,t){var i,n,a,u,o;if(!gI(r))throw new TypeError($g("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!gI(e))throw new TypeError($g("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!CEe(t))throw new TypeError($g("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=UEe({},t),DEe(i,"iter")){if(!BEe(i.iter))throw new TypeError($g("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=fI;a=dI(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=dI(r,e),i={iter:fI,state:a.state};return o=0,n={},mi(n,"next",v),mi(n,"return",g),i&&i.prng?(mi(n,"seed",null),mi(n,"seedLength",null),vI(n,"state",zEe(null),JEe),mi(n,"stateLength",null),mi(n,"byteLength",null)):(Qg(n,"seed",l),Qg(n,"seedLength",m),vI(n,"state",d,f),Qg(n,"stateLength",h),Qg(n,"byteLength",p)),mi(n,"PRNG",a.PRNG),lI&&mi(n,lI,c),n;function v(){return o+=1,u||o>i.iter?{done:!0}:{value:a(),done:!1}}function g(y){return u=!0,arguments.length?{value:y,done:!0}:{done:!0}}function c(){return cI(r,e,i)}function l(){return a.PRNG.seed}function m(){return a.PRNG.seedLength}function h(){return a.PRNG.stateLength}function p(){return a.PRNG.byteLength}function d(){return a.PRNG.state}function f(y){a.PRNG.state=y}}mI.exports=cI});var yI=s(function(QKe,pI){"use strict";var XEe=hI();pI.exports=XEe});var bI=s(function($Ke,qI){"use strict";var R=require("@stdlib/utils/define-read-only-property"),N={};R(N,"arcsine",w1());R(N,"bernoulli",T1());R(N,"beta",k1());R(N,"betaprime",Z1());R(N,"binomial",aA());R(N,"boxMuller",mA());R(N,"cauchy",EA());R(N,"chi",xA());R(N,"chisquare",JA());R(N,"cosine",QA());R(N,"discreteUniform",uG());R(N,"erlang",hG());R(N,"exponential",_G());R(N,"f",GG());R(N,"frechet",BG());R(N,"gamma",rV());R(N,"geometric",gV());R(N,"gumbel",qV());R(N,"hypergeometric",RV());R(N,"improvedZiggurat",WV());R(N,"invgamma",YV());R(N,"kumaraswamy",n2());R(N,"laplace",l2());R(N,"levy",S2());R(N,"logistic",j2());R(N,"lognormal",k2());R(N,"minstd",H2());R(N,"minstdShuffle",nF());R(N,"mt19937",lF());R(N,"negativeBinomial",SF());R(N,"normal",jF());R(N,"pareto1",zF());R(N,"poisson",ZF());R(N,"randi",aW());R(N,"randn",mW());R(N,"randu",EW());R(N,"rayleigh",xW());R(N,"t",JW());R(N,"triangular",QW());R(N,"uniform",oI());R(N,"weibull",yI());qI.exports=N});var SI=s(function(KKe,wI){"use strict";var YEe=require("@stdlib/math/base/special/floor");function HEe(r,e,t){var i,n,a,u;for(a=r.length,n=new Array(e),u=0;u0;a--)u=QEe(t()*(a+1)),i=r[a],r[a]=r[u],r[u]=i;return $Ee.call(r,0,e)}_I.exports=KEe});var RI=s(function(ter,LI){"use strict";var e_e=require("@stdlib/math/base/special/floor");function r_e(r,e,t,i){var n,a,u,o,v,g,c,l,m,h;for(u=i.slice(),g=r.length,n=[],a=[],m=0;m1){if(e=arguments[0],r=arguments[1],!(hm(e)||pm(e)))throw new TypeError(ef("invalid argument. `%s` argument must be array-like. Value: `%s`.","pool",e));n=rf(t,r)}if(n)throw n;return r&&r.seed?i=GI({seed:r.seed}):i=GI(),e===void 0?a=u:(AI(e)?e=e.split(""):e=VI(e),a=o),xI(a,"seed",i.seed),xI(a,"PRNG",i),i=i.normalized,a;function u(v,g){var c,l,m,h,p,d;if(!(hm(v)||pm(v)))throw new TypeError(ef("invalid argument. First argument must be array-like. Value: `%s`.",v));if(AI(v)&&(v=v.split("")),h={},arguments.length>1&&(d=rf(h,g),d))throw d;if(h.replace===void 0?c=t.replace:c=h.replace,h.probs!==void 0&&(m=h.probs),h.size?p=h.size:t.size?p=t.size:p=v.length,c===!1&&p>v.length)throw new RangeError(ef("invalid option. `size` option must be less than or equal to the length of `x` when `replace` is `false`. Option: `%s`.",p));return m?c?o_e(v,p,i,m):u_e(v,p,i,m):c?FI(v,p,i):(l=g_e.call(v),WI(l,p,i))}function o(v){var g,c,l,m,h,p;if(e.length===0)return null;if(l={},arguments.length&&(h=rf(l,v),h))throw h;if(l.mutate===void 0?c=t.mutate:c=l.mutate,l.replace===void 0?g=t.replace:g=l.replace,l.size?m=l.size:t.size?m=t.size:m=e.length,g===!1&&m>e.length)throw new RangeError(ef("invalid option. `size` option must be less than or equal to the population size when `replace` is `false`. Option: `%s`.",m));return g?FI(e,m,i):(p=WI(e,m,i),c&&(e=e.slice(m,e.length)),p)}}II.exports=f_e});var zI=s(function(ser,kI){"use strict";var d_e=ym(),l_e=d_e();kI.exports=l_e});var CI=s(function(uer,UI){"use strict";var c_e=require("@stdlib/utils/define-nonenumerable-read-only-property"),JI=zI(),m_e=ym();c_e(JI,"factory",m_e);UI.exports=JI});var BI=s(function(oer,h_e){h_e.exports={copy:"shallow"}});var YI=s(function(ver,XI){"use strict";var p_e=require("@stdlib/assert/has-own-property"),y_e=require("@stdlib/assert/is-string").isPrimitive,q_e=require("@stdlib/assert/is-plain-object"),b_e=require("@stdlib/utils/index-of"),qm=require("@stdlib/string/format"),DI=["deep","shallow","none"];function w_e(r,e){if(!q_e(e))return new TypeError(qm("invalid argument. Options argument must be an object. Value: `%s`.",e));if(p_e(e,"copy")){if(r.copy=e.copy,!y_e(r.copy))return new TypeError(qm("invalid option. `%s` option must be a string. Option: `%s`.","copy",r.copy));if(b_e(DI,r.copy)===-1)return new TypeError(qm('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"copy",DI.join('", "'),r.copy))}return null}XI.exports=w_e});var bm=s(function(ger,KI){"use strict";var HI=require("@stdlib/utils/define-nonenumerable-read-only-property"),S_e=require("@stdlib/assert/is-array-like"),O_e=require("@stdlib/assert/is-typed-array-like"),E_e=require("@stdlib/assert/is-string").isPrimitive,ZI=require("@stdlib/utils/copy"),__e=require("@stdlib/math/base/special/floor"),QI=T().factory,N_e=require("@stdlib/string/format"),L_e=BI(),$I=YI();function R_e(r){var e,t,i;if(e=ZI(L_e),arguments.length&&(i=$I(e,r),i))throw i;return r&&r.seed?t=QI({seed:r.seed}):t=QI(),HI(n,"seed",t.seed),HI(n,"PRNG",t),t=t.normalized,n;function n(a,u){var o,v,g,c,l,m,h,p,d,f;if(!(S_e(a)||O_e(a)))throw new TypeError(N_e("invalid argument. First argument must be array-like. Value: `%s`.",a));if(arguments.length>1&&(c={},l=$I(c,u),l))throw l;for(g=c&&c.copy?c.copy:e.copy,o=E_e(a),o&&(a=a.split(""),g="none"),v=0,g==="shallow"?v+=1:g==="deep"&&(v+=2),p=a.length,m=ZI(a,v),d=p-1;d>0;d--)f=__e(t()*(d+1)),h=m[d],m[d]=m[f],m[f]=h;return o&&(m=a.join("")),m}}KI.exports=R_e});var rk=s(function(fer,ek){"use strict";var P_e=bm(),T_e=P_e();ek.exports=T_e});var nk=s(function(der,ik){"use strict";var j_e=require("@stdlib/utils/define-nonenumerable-read-only-property"),tk=rk(),M_e=bm();j_e(tk,"factory",M_e);ik.exports=tk});var ak=s(function(ler,x_e){x_e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var ok=s(function(cer,uk){"use strict";var A_e=require("@stdlib/assert/is-plain-object"),He=require("@stdlib/assert/has-own-property"),G_e=require("@stdlib/assert/is-boolean").isPrimitive,V_e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,sk=require("@stdlib/assert/is-string").isPrimitive,F_e=require("@stdlib/assert/is-positive-integer").isPrimitive,W_e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,wn=require("@stdlib/string/format");function I_e(r,e){return A_e(e)?He(e,"sep")&&(r.sep=e.sep,!sk(r.sep))?new TypeError(wn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):He(e,"objectMode")&&(r.objectMode=e.objectMode,!G_e(r.objectMode))?new TypeError(wn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):He(e,"encoding")&&(r.encoding=e.encoding,!sk(r.encoding)&&r.encoding!==null)?new TypeError(wn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):He(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!V_e(r.highWaterMark))?new TypeError(wn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):He(e,"iter")&&(r.iter=e.iter,!W_e(r.iter))?new TypeError(wn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):He(e,"siter")&&(r.siter=e.siter,!F_e(r.siter))?new TypeError(wn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(He(e,"prng")&&(r.prng=e.prng),He(e,"seed")&&(r.seed=e.seed),He(e,"state")&&(r.state=e.state),He(e,"copy")&&(r.copy=e.copy),null):new TypeError(wn("invalid argument. Options argument must be an object. Value: `%s`.",e))}uk.exports=I_e});var gk=s(function(mer,vk){"use strict";var k_e=require("debug"),z_e=k_e("random:streams:arcsine");vk.exports=z_e});var nf=s(function(her,hk){"use strict";var mk=require("readable-stream").Readable,fk=require("@stdlib/assert/is-number").isPrimitive,dk=require("@stdlib/math/base/assert/is-nan"),J_e=require("@stdlib/assert/is-error"),U_e=require("@stdlib/object/assign"),C_e=require("@stdlib/utils/inherit"),lk=require("@stdlib/utils/define-nonenumerable-property"),hi=require("@stdlib/utils/define-nonenumerable-read-only-property"),tf=require("@stdlib/utils/define-read-only-accessor"),B_e=require("@stdlib/utils/define-read-write-accessor"),D_e=an().factory,ck=require("@stdlib/buffer/from-string"),X_e=require("@stdlib/utils/next-tick"),wm=require("@stdlib/string/format"),Y_e=ak(),H_e=ok(),Qa=gk();function Z_e(){return this._prng.seed}function Q_e(){return this._prng.seedLength}function $_e(){return this._prng.stateLength}function K_e(){return this._prng.byteLength}function eNe(){return this._prng.state}function rNe(r){this._prng.state=r}function tNe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Qa("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Qa("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=ck(e):e=ck(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function iNe(r){var e;if(this._destroyed)return Qa("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,X_e(t),this;function t(){r&&(Qa("Stream was destroyed due to an error. Error: %s.",J_e(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Qa("Closing the stream..."),e.emit("close")}}function te(r,e,t){var i,n;if(!(this instanceof te))return arguments.length>2?new te(r,e,t):new te(r,e);if(!fk(r)||dk(r))throw new TypeError(wm("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!fk(e)||dk(e))throw new TypeError(wm("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e));if(r>=e)throw new RangeError(wm("invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.",r,e));if(i=U_e({},Y_e),arguments.length>2&&(n=H_e(i,t),n))throw n;return Qa("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),mk.call(this,i),lk(this,"_destroyed",!1),hi(this,"_objectMode",i.objectMode),hi(this,"_sep",i.sep),hi(this,"_iter",i.iter),hi(this,"_siter",i.siter),lk(this,"_i",0),hi(this,"_prng",D_e(r,e,i)),hi(this,"PRNG",this._prng.PRNG),this}C_e(te,mk);tf(te.prototype,"seed",Z_e);tf(te.prototype,"seedLength",Q_e);B_e(te.prototype,"state",eNe,rNe);tf(te.prototype,"stateLength",$_e);tf(te.prototype,"byteLength",K_e);hi(te.prototype,"_read",tNe);hi(te.prototype,"destroy",iNe);hk.exports=te});var yk=s(function(per,pk){"use strict";var nNe=require("@stdlib/assert/is-plain-object"),aNe=require("@stdlib/string/format"),sNe=require("@stdlib/object/assign"),uNe=nf();function oNe(r,e,t){var i;if(arguments.length>2){if(i=t,!nNe(i))throw new TypeError(aNe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=sNe({},t)}else i={};return i.objectMode=!0,new uNe(r,e,i)}pk.exports=oNe});var Ek=s(function(yer,Ok){"use strict";var qk=require("@stdlib/assert/is-plain-object"),bk=require("@stdlib/object/assign"),wk=require("@stdlib/string/format"),Sk=nf();function vNe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!qk(r))throw new TypeError(wk("invalid argument. Options argument must be an object. Value: `%s`.",r));n=bk({},r)}else if(i>2){if(!qk(t))throw new TypeError(wk("invalid argument. Options argument must be an object. Value: `%s`.",t));n=bk({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new Sk(v,g,n)}function o(){return new Sk(r,e,n)}}Ok.exports=vNe});var Lk=s(function(qer,Nk){"use strict";var _k=require("@stdlib/utils/define-nonenumerable-read-only-property"),Sm=nf(),gNe=yk(),fNe=Ek();_k(Sm,"objectMode",gNe);_k(Sm,"factory",fNe);Nk.exports=Sm});var Rk=s(function(ber,dNe){dNe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var jk=s(function(wer,Tk){"use strict";var lNe=require("@stdlib/assert/is-plain-object"),Ze=require("@stdlib/assert/has-own-property"),cNe=require("@stdlib/assert/is-boolean").isPrimitive,mNe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,Pk=require("@stdlib/assert/is-string").isPrimitive,hNe=require("@stdlib/assert/is-positive-integer").isPrimitive,pNe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Sn=require("@stdlib/string/format");function yNe(r,e){return lNe(e)?Ze(e,"sep")&&(r.sep=e.sep,!Pk(r.sep))?new TypeError(Sn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Ze(e,"objectMode")&&(r.objectMode=e.objectMode,!cNe(r.objectMode))?new TypeError(Sn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Ze(e,"encoding")&&(r.encoding=e.encoding,!Pk(r.encoding)&&r.encoding!==null)?new TypeError(Sn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Ze(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!mNe(r.highWaterMark))?new TypeError(Sn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Ze(e,"iter")&&(r.iter=e.iter,!pNe(r.iter))?new TypeError(Sn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Ze(e,"siter")&&(r.siter=e.siter,!hNe(r.siter))?new TypeError(Sn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(Ze(e,"prng")&&(r.prng=e.prng),Ze(e,"seed")&&(r.seed=e.seed),Ze(e,"state")&&(r.state=e.state),Ze(e,"copy")&&(r.copy=e.copy),null):new TypeError(Sn("invalid argument. Options argument must be an object. Value: `%s`.",e))}Tk.exports=yNe});var xk=s(function(Ser,Mk){"use strict";var qNe=require("debug"),bNe=qNe("random:streams:bernoulli");Mk.exports=bNe});var sf=s(function(Oer,Fk){"use strict";var Vk=require("readable-stream").Readable,wNe=require("@stdlib/assert/is-probability").isPrimitive,SNe=require("@stdlib/assert/is-error"),ONe=require("@stdlib/object/assign"),ENe=require("@stdlib/utils/inherit"),Ak=require("@stdlib/utils/define-nonenumerable-property"),pi=require("@stdlib/utils/define-nonenumerable-read-only-property"),af=require("@stdlib/utils/define-read-only-accessor"),_Ne=require("@stdlib/utils/define-read-write-accessor"),NNe=sn().factory,Gk=require("@stdlib/buffer/from-string"),LNe=require("@stdlib/utils/next-tick"),RNe=require("@stdlib/string/format"),PNe=Rk(),TNe=jk(),$a=xk();function jNe(){return this._prng.seed}function MNe(){return this._prng.seedLength}function xNe(){return this._prng.stateLength}function ANe(){return this._prng.byteLength}function GNe(){return this._prng.state}function VNe(r){this._prng.state=r}function FNe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return $a("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),$a("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=Gk(e):e=Gk(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function WNe(r){var e;if(this._destroyed)return $a("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,LNe(t),this;function t(){r&&($a("Stream was destroyed due to an error. Error: %s.",SNe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),$a("Closing the stream..."),e.emit("close")}}function ie(r,e){var t,i;if(!(this instanceof ie))return arguments.length>1?new ie(r,e):new ie(r);if(!wNe(r))throw new TypeError(RNe("invalid argument. First argument must be a probability. Value: `%s`.",r));if(t=ONe({},PNe),arguments.length>1&&(i=TNe(t,e),i))throw i;return $a("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),Vk.call(this,t),Ak(this,"_destroyed",!1),pi(this,"_objectMode",t.objectMode),pi(this,"_sep",t.sep),pi(this,"_iter",t.iter),pi(this,"_siter",t.siter),Ak(this,"_i",0),pi(this,"_prng",NNe(r,t)),pi(this,"PRNG",this._prng.PRNG),this}ENe(ie,Vk);af(ie.prototype,"seed",jNe);af(ie.prototype,"seedLength",MNe);_Ne(ie.prototype,"state",GNe,VNe);af(ie.prototype,"stateLength",xNe);af(ie.prototype,"byteLength",ANe);pi(ie.prototype,"_read",FNe);pi(ie.prototype,"destroy",WNe);Fk.exports=ie});var Ik=s(function(Eer,Wk){"use strict";var INe=require("@stdlib/assert/is-plain-object"),kNe=require("@stdlib/string/format"),zNe=require("@stdlib/object/assign"),JNe=sf();function UNe(r,e){var t;if(arguments.length>1){if(t=e,!INe(t))throw new TypeError(kNe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=zNe({},e)}else t={};return t.objectMode=!0,new JNe(r,t)}Wk.exports=UNe});var Bk=s(function(_er,Ck){"use strict";var kk=require("@stdlib/assert/is-plain-object"),CNe=require("@stdlib/assert/is-probability").isPrimitive,zk=require("@stdlib/string/format"),Jk=require("@stdlib/object/assign"),Uk=sf();function BNe(r,e){var t,i,n;if(t=arguments.length,t>1){if(!kk(e))throw new TypeError(zk("invalid argument. Options argument must be an object. Value: `%s`.",e));n=u,i=Jk({},e)}else if(t===1)if(CNe(r))n=u,i={};else{if(!kk(r))throw new TypeError(zk("invalid argument. Options argument must be an object. Value: `%s`.",r));i=Jk({},r),n=a}else i={},n=a;return n;function a(o){return new Uk(o,i)}function u(){return new Uk(r,i)}}Ck.exports=BNe});var Yk=s(function(Ner,Xk){"use strict";var Dk=require("@stdlib/utils/define-nonenumerable-read-only-property"),Om=sf(),DNe=Ik(),XNe=Bk();Dk(Om,"objectMode",DNe);Dk(Om,"factory",XNe);Xk.exports=Om});var Hk=s(function(Ler,YNe){YNe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var $k=s(function(Rer,Qk){"use strict";var HNe=require("@stdlib/assert/is-plain-object"),Qe=require("@stdlib/assert/has-own-property"),ZNe=require("@stdlib/assert/is-boolean").isPrimitive,QNe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,Zk=require("@stdlib/assert/is-string").isPrimitive,$Ne=require("@stdlib/assert/is-positive-integer").isPrimitive,KNe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,On=require("@stdlib/string/format");function eLe(r,e){return HNe(e)?Qe(e,"sep")&&(r.sep=e.sep,!Zk(r.sep))?new TypeError(On("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Qe(e,"objectMode")&&(r.objectMode=e.objectMode,!ZNe(r.objectMode))?new TypeError(On("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Qe(e,"encoding")&&(r.encoding=e.encoding,!Zk(r.encoding)&&r.encoding!==null)?new TypeError(On("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Qe(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!QNe(r.highWaterMark))?new TypeError(On("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Qe(e,"iter")&&(r.iter=e.iter,!KNe(r.iter))?new TypeError(On("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Qe(e,"siter")&&(r.siter=e.siter,!$Ne(r.siter))?new TypeError(On("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(Qe(e,"prng")&&(r.prng=e.prng),Qe(e,"seed")&&(r.seed=e.seed),Qe(e,"state")&&(r.state=e.state),Qe(e,"copy")&&(r.copy=e.copy),null):new TypeError(On("invalid argument. Options argument must be an object. Value: `%s`.",e))}Qk.exports=eLe});var ez=s(function(Per,Kk){"use strict";var rLe=require("debug"),tLe=rLe("random:streams:beta");Kk.exports=tLe});var of=s(function(Ter,sz){"use strict";var az=require("readable-stream").Readable,rz=require("@stdlib/assert/is-positive-number").isPrimitive,iLe=require("@stdlib/assert/is-error"),nLe=require("@stdlib/object/assign"),aLe=require("@stdlib/utils/inherit"),tz=require("@stdlib/utils/define-nonenumerable-property"),yi=require("@stdlib/utils/define-nonenumerable-read-only-property"),uf=require("@stdlib/utils/define-read-only-accessor"),sLe=require("@stdlib/utils/define-read-write-accessor"),uLe=on().factory,iz=require("@stdlib/buffer/from-string"),oLe=require("@stdlib/utils/next-tick"),nz=require("@stdlib/string/format"),vLe=Hk(),gLe=$k(),Ka=ez();function fLe(){return this._prng.seed}function dLe(){return this._prng.seedLength}function lLe(){return this._prng.stateLength}function cLe(){return this._prng.byteLength}function mLe(){return this._prng.state}function hLe(r){this._prng.state=r}function pLe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Ka("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Ka("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=iz(e):e=iz(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function yLe(r){var e;if(this._destroyed)return Ka("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,oLe(t),this;function t(){r&&(Ka("Stream was destroyed due to an error. Error: %s.",iLe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Ka("Closing the stream..."),e.emit("close")}}function ne(r,e,t){var i,n;if(!(this instanceof ne))return arguments.length>2?new ne(r,e,t):new ne(r,e);if(!rz(r))throw new TypeError(nz("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!rz(e))throw new TypeError(nz("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=nLe({},vLe),arguments.length>2&&(n=gLe(i,t),n))throw n;return Ka("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),az.call(this,i),tz(this,"_destroyed",!1),yi(this,"_objectMode",i.objectMode),yi(this,"_sep",i.sep),yi(this,"_iter",i.iter),yi(this,"_siter",i.siter),tz(this,"_i",0),yi(this,"_prng",uLe(r,e,i)),yi(this,"PRNG",this._prng.PRNG),this}aLe(ne,az);uf(ne.prototype,"seed",fLe);uf(ne.prototype,"seedLength",dLe);sLe(ne.prototype,"state",mLe,hLe);uf(ne.prototype,"stateLength",lLe);uf(ne.prototype,"byteLength",cLe);yi(ne.prototype,"_read",pLe);yi(ne.prototype,"destroy",yLe);sz.exports=ne});var oz=s(function(jer,uz){"use strict";var qLe=require("@stdlib/assert/is-plain-object"),bLe=require("@stdlib/string/format"),wLe=require("@stdlib/object/assign"),SLe=of();function OLe(r,e,t){var i;if(arguments.length>2){if(i=t,!qLe(i))throw new TypeError(bLe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=wLe({},t)}else i={};return i.objectMode=!0,new SLe(r,e,i)}uz.exports=OLe});var cz=s(function(Mer,lz){"use strict";var vz=require("@stdlib/assert/is-plain-object"),gz=require("@stdlib/object/assign"),fz=require("@stdlib/string/format"),dz=of();function ELe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!vz(r))throw new TypeError(fz("invalid argument. Options argument must be an object. Value: `%s`.",r));n=gz({},r)}else if(i>2){if(!vz(t))throw new TypeError(fz("invalid argument. Options argument must be an object. Value: `%s`.",t));n=gz({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new dz(v,g,n)}function o(){return new dz(r,e,n)}}lz.exports=ELe});var pz=s(function(xer,hz){"use strict";var mz=require("@stdlib/utils/define-nonenumerable-read-only-property"),Em=of(),_Le=oz(),NLe=cz();mz(Em,"objectMode",_Le);mz(Em,"factory",NLe);hz.exports=Em});var yz=s(function(Aer,LLe){LLe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var wz=s(function(Ger,bz){"use strict";var RLe=require("@stdlib/assert/is-plain-object"),$e=require("@stdlib/assert/has-own-property"),PLe=require("@stdlib/assert/is-boolean").isPrimitive,TLe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,qz=require("@stdlib/assert/is-string").isPrimitive,jLe=require("@stdlib/assert/is-positive-integer").isPrimitive,MLe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,En=require("@stdlib/string/format");function xLe(r,e){return RLe(e)?$e(e,"sep")&&(r.sep=e.sep,!qz(r.sep))?new TypeError(En("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):$e(e,"objectMode")&&(r.objectMode=e.objectMode,!PLe(r.objectMode))?new TypeError(En("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):$e(e,"encoding")&&(r.encoding=e.encoding,!qz(r.encoding)&&r.encoding!==null)?new TypeError(En("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):$e(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!TLe(r.highWaterMark))?new TypeError(En("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):$e(e,"iter")&&(r.iter=e.iter,!MLe(r.iter))?new TypeError(En("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):$e(e,"siter")&&(r.siter=e.siter,!jLe(r.siter))?new TypeError(En("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):($e(e,"prng")&&(r.prng=e.prng),$e(e,"seed")&&(r.seed=e.seed),$e(e,"state")&&(r.state=e.state),$e(e,"copy")&&(r.copy=e.copy),null):new TypeError(En("invalid argument. Options argument must be an object. Value: `%s`.",e))}bz.exports=xLe});var Oz=s(function(Ver,Sz){"use strict";var ALe=require("debug"),GLe=ALe("random:streams:betaprime");Sz.exports=GLe});var gf=s(function(Fer,Pz){"use strict";var Rz=require("readable-stream").Readable,Ez=require("@stdlib/assert/is-positive-number").isPrimitive,VLe=require("@stdlib/assert/is-error"),FLe=require("@stdlib/object/assign"),WLe=require("@stdlib/utils/inherit"),_z=require("@stdlib/utils/define-nonenumerable-property"),qi=require("@stdlib/utils/define-nonenumerable-read-only-property"),vf=require("@stdlib/utils/define-read-only-accessor"),ILe=require("@stdlib/utils/define-read-write-accessor"),kLe=vn().factory,Nz=require("@stdlib/buffer/from-string"),zLe=require("@stdlib/utils/next-tick"),Lz=require("@stdlib/string/format"),JLe=yz(),ULe=wz(),es=Oz();function CLe(){return this._prng.seed}function BLe(){return this._prng.seedLength}function DLe(){return this._prng.stateLength}function XLe(){return this._prng.byteLength}function YLe(){return this._prng.state}function HLe(r){this._prng.state=r}function ZLe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return es("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),es("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=Nz(e):e=Nz(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function QLe(r){var e;if(this._destroyed)return es("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,zLe(t),this;function t(){r&&(es("Stream was destroyed due to an error. Error: %s.",VLe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),es("Closing the stream..."),e.emit("close")}}function ae(r,e,t){var i,n;if(!(this instanceof ae))return arguments.length>2?new ae(r,e,t):new ae(r,e);if(!Ez(r))throw new TypeError(Lz("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!Ez(e))throw new TypeError(Lz("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=FLe({},JLe),arguments.length>2&&(n=ULe(i,t),n))throw n;return es("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),Rz.call(this,i),_z(this,"_destroyed",!1),qi(this,"_objectMode",i.objectMode),qi(this,"_sep",i.sep),qi(this,"_iter",i.iter),qi(this,"_siter",i.siter),_z(this,"_i",0),qi(this,"_prng",kLe(r,e,i)),qi(this,"PRNG",this._prng.PRNG),this}WLe(ae,Rz);vf(ae.prototype,"seed",CLe);vf(ae.prototype,"seedLength",BLe);ILe(ae.prototype,"state",YLe,HLe);vf(ae.prototype,"stateLength",DLe);vf(ae.prototype,"byteLength",XLe);qi(ae.prototype,"_read",ZLe);qi(ae.prototype,"destroy",QLe);Pz.exports=ae});var jz=s(function(Wer,Tz){"use strict";var $Le=require("@stdlib/assert/is-plain-object"),KLe=require("@stdlib/string/format"),eRe=require("@stdlib/object/assign"),rRe=gf();function tRe(r,e,t){var i;if(arguments.length>2){if(i=t,!$Le(i))throw new TypeError(KLe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=eRe({},t)}else i={};return i.objectMode=!0,new rRe(r,e,i)}Tz.exports=tRe});var Fz=s(function(Ier,Vz){"use strict";var Mz=require("@stdlib/assert/is-plain-object"),xz=require("@stdlib/object/assign"),Az=require("@stdlib/string/format"),Gz=gf();function iRe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!Mz(r))throw new TypeError(Az("invalid argument. Options argument must be an object. Value: `%s`.",r));n=xz({},r)}else if(i>2){if(!Mz(t))throw new TypeError(Az("invalid argument. Options argument must be an object. Value: `%s`.",t));n=xz({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new Gz(v,g,n)}function o(){return new Gz(r,e,n)}}Vz.exports=iRe});var kz=s(function(ker,Iz){"use strict";var Wz=require("@stdlib/utils/define-nonenumerable-read-only-property"),_m=gf(),nRe=jz(),aRe=Fz();Wz(_m,"objectMode",nRe);Wz(_m,"factory",aRe);Iz.exports=_m});var zz=s(function(zer,sRe){sRe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var Cz=s(function(Jer,Uz){"use strict";var uRe=require("@stdlib/assert/is-plain-object"),Ke=require("@stdlib/assert/has-own-property"),oRe=require("@stdlib/assert/is-boolean").isPrimitive,vRe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,Jz=require("@stdlib/assert/is-string").isPrimitive,gRe=require("@stdlib/assert/is-positive-integer").isPrimitive,fRe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,_n=require("@stdlib/string/format");function dRe(r,e){return uRe(e)?Ke(e,"sep")&&(r.sep=e.sep,!Jz(r.sep))?new TypeError(_n("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Ke(e,"objectMode")&&(r.objectMode=e.objectMode,!oRe(r.objectMode))?new TypeError(_n("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Ke(e,"encoding")&&(r.encoding=e.encoding,!Jz(r.encoding)&&r.encoding!==null)?new TypeError(_n("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Ke(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!vRe(r.highWaterMark))?new TypeError(_n("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Ke(e,"iter")&&(r.iter=e.iter,!fRe(r.iter))?new TypeError(_n("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Ke(e,"siter")&&(r.siter=e.siter,!gRe(r.siter))?new TypeError(_n("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(Ke(e,"prng")&&(r.prng=e.prng),Ke(e,"seed")&&(r.seed=e.seed),Ke(e,"state")&&(r.state=e.state),Ke(e,"copy")&&(r.copy=e.copy),null):new TypeError(_n("invalid argument. Options argument must be an object. Value: `%s`.",e))}Uz.exports=dRe});var Dz=s(function(Uer,Bz){"use strict";var lRe=require("debug"),cRe=lRe("random:streams:binomial");Bz.exports=cRe});var df=s(function(Cer,Qz){"use strict";var Zz=require("readable-stream").Readable,mRe=require("@stdlib/assert/is-positive-integer").isPrimitive,hRe=require("@stdlib/assert/is-probability").isPrimitive,pRe=require("@stdlib/assert/is-error"),yRe=require("@stdlib/object/assign"),qRe=require("@stdlib/utils/inherit"),Xz=require("@stdlib/utils/define-nonenumerable-property"),bi=require("@stdlib/utils/define-nonenumerable-read-only-property"),ff=require("@stdlib/utils/define-read-only-accessor"),bRe=require("@stdlib/utils/define-read-write-accessor"),wRe=ma().factory,Yz=require("@stdlib/buffer/from-string"),SRe=require("@stdlib/utils/next-tick"),Hz=require("@stdlib/string/format"),ORe=zz(),ERe=Cz(),rs=Dz();function _Re(){return this._prng.seed}function NRe(){return this._prng.seedLength}function LRe(){return this._prng.stateLength}function RRe(){return this._prng.byteLength}function PRe(){return this._prng.state}function TRe(r){this._prng.state=r}function jRe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return rs("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),rs("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=Yz(e):e=Yz(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function MRe(r){var e;if(this._destroyed)return rs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,SRe(t),this;function t(){r&&(rs("Stream was destroyed due to an error. Error: %s.",pRe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),rs("Closing the stream..."),e.emit("close")}}function se(r,e,t){var i,n;if(!(this instanceof se))return arguments.length>2?new se(r,e,t):new se(r,e);if(!mRe(r))throw new TypeError(Hz("invalid argument. First argument must be a positive integer. Value: `%s`.",r));if(!hRe(e))throw new TypeError(Hz("invalid argument. Second argument must be a probability. Value: `%s`.",e));if(i=yRe({},ORe),arguments.length>2&&(n=ERe(i,t),n))throw n;return rs("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),Zz.call(this,i),Xz(this,"_destroyed",!1),bi(this,"_objectMode",i.objectMode),bi(this,"_sep",i.sep),bi(this,"_iter",i.iter),bi(this,"_siter",i.siter),Xz(this,"_i",0),bi(this,"_prng",wRe(r,e,i)),bi(this,"PRNG",this._prng.PRNG),this}qRe(se,Zz);ff(se.prototype,"seed",_Re);ff(se.prototype,"seedLength",NRe);bRe(se.prototype,"state",PRe,TRe);ff(se.prototype,"stateLength",LRe);ff(se.prototype,"byteLength",RRe);bi(se.prototype,"_read",jRe);bi(se.prototype,"destroy",MRe);Qz.exports=se});var Kz=s(function(Ber,$z){"use strict";var xRe=require("@stdlib/assert/is-plain-object"),ARe=require("@stdlib/object/assign"),GRe=require("@stdlib/string/format"),VRe=df();function FRe(r,e,t){var i;if(arguments.length>2){if(i=t,!xRe(i))throw new TypeError(GRe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=ARe({},t)}else i={};return i.objectMode=!0,new VRe(r,e,i)}$z.exports=FRe});var a3=s(function(Der,n3){"use strict";var e3=require("@stdlib/assert/is-plain-object"),r3=require("@stdlib/object/assign"),t3=require("@stdlib/string/format"),i3=df();function WRe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!e3(r))throw new TypeError(t3("invalid argument. Options argument must be an object. Value: `%s`.",r));n=r3({},r)}else if(i>2){if(!e3(t))throw new TypeError(t3("invalid argument. Options argument must be an object. Value: `%s`.",t));n=r3({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new i3(v,g,n)}function o(){return new i3(r,e,n)}}n3.exports=WRe});var o3=s(function(Xer,u3){"use strict";var s3=require("@stdlib/utils/define-nonenumerable-read-only-property"),Nm=df(),IRe=Kz(),kRe=a3();s3(Nm,"objectMode",IRe);s3(Nm,"factory",kRe);u3.exports=Nm});var v3=s(function(Yer,zRe){zRe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var d3=s(function(Her,f3){"use strict";var JRe=require("@stdlib/assert/is-plain-object"),er=require("@stdlib/assert/has-own-property"),URe=require("@stdlib/assert/is-boolean").isPrimitive,CRe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,g3=require("@stdlib/assert/is-string").isPrimitive,BRe=require("@stdlib/assert/is-positive-integer").isPrimitive,DRe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Nn=require("@stdlib/string/format");function XRe(r,e){return JRe(e)?er(e,"sep")&&(r.sep=e.sep,!g3(r.sep))?new TypeError(Nn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):er(e,"objectMode")&&(r.objectMode=e.objectMode,!URe(r.objectMode))?new TypeError(Nn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):er(e,"encoding")&&(r.encoding=e.encoding,!g3(r.encoding)&&r.encoding!==null)?new TypeError(Nn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):er(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!CRe(r.highWaterMark))?new TypeError(Nn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):er(e,"iter")&&(r.iter=e.iter,!DRe(r.iter))?new TypeError(Nn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):er(e,"siter")&&(r.siter=e.siter,!BRe(r.siter))?new TypeError(Nn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(er(e,"prng")&&(r.prng=e.prng),er(e,"seed")&&(r.seed=e.seed),er(e,"state")&&(r.state=e.state),er(e,"copy")&&(r.copy=e.copy),null):new TypeError(Nn("invalid argument. Options argument must be an object. Value: `%s`.",e))}f3.exports=XRe});var c3=s(function(Zer,l3){"use strict";var YRe=require("debug"),HRe=YRe("random:streams:box-muller");l3.exports=HRe});var cf=s(function(Qer,y3){"use strict";var p3=require("readable-stream").Readable,ZRe=require("@stdlib/assert/is-error"),QRe=require("@stdlib/object/assign"),$Re=require("@stdlib/utils/inherit"),m3=require("@stdlib/utils/define-nonenumerable-property"),wi=require("@stdlib/utils/define-nonenumerable-read-only-property"),lf=require("@stdlib/utils/define-read-only-accessor"),KRe=require("@stdlib/utils/define-read-write-accessor"),ePe=Ya().factory,h3=require("@stdlib/buffer/from-string"),rPe=require("@stdlib/utils/next-tick"),tPe=v3(),iPe=d3(),ts=c3();function nPe(){return this._prng.seed}function aPe(){return this._prng.seedLength}function sPe(){return this._prng.stateLength}function uPe(){return this._prng.byteLength}function oPe(){return this._prng.state}function vPe(r){this._prng.state=r}function gPe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return ts("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),ts("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=h3(e):e=h3(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function fPe(r){var e;if(this._destroyed)return ts("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,rPe(t),this;function t(){r&&(ts("Stream was destroyed due to an error. Error: %s.",ZRe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),ts("Closing the stream..."),e.emit("close")}}function ue(r){var e,t;if(!(this instanceof ue))return arguments.length>0?new ue(r):new ue;if(e=QRe({},tPe),arguments.length>0&&(t=iPe(e,r),t))throw t;return ts("Creating a readable stream configured with the following options: %s.",JSON.stringify(e)),p3.call(this,e),m3(this,"_destroyed",!1),wi(this,"_objectMode",e.objectMode),wi(this,"_sep",e.sep),wi(this,"_iter",e.iter),wi(this,"_siter",e.siter),m3(this,"_i",0),wi(this,"_prng",ePe(e)),wi(this,"PRNG",this._prng.PRNG),this}$Re(ue,p3);lf(ue.prototype,"seed",nPe);lf(ue.prototype,"seedLength",aPe);KRe(ue.prototype,"state",oPe,vPe);lf(ue.prototype,"stateLength",sPe);lf(ue.prototype,"byteLength",uPe);wi(ue.prototype,"_read",gPe);wi(ue.prototype,"destroy",fPe);y3.exports=ue});var b3=s(function($er,q3){"use strict";var dPe=require("@stdlib/assert/is-plain-object"),lPe=require("@stdlib/object/assign"),cPe=require("@stdlib/string/format"),mPe=cf();function hPe(r){var e;if(arguments.length>0){if(e=r,!dPe(e))throw new TypeError(cPe("invalid argument. Options argument must be an object. Value: `%s`.",e));e=lPe({},r)}else e={};return e.objectMode=!0,new mPe(e)}q3.exports=hPe});var S3=s(function(Ker,w3){"use strict";var pPe=require("@stdlib/assert/is-plain-object"),yPe=require("@stdlib/object/assign"),qPe=require("@stdlib/string/format"),bPe=cf();function wPe(r){var e;if(arguments.length>0){if(!pPe(r))throw new TypeError(qPe("invalid argument. Options argument must be an object. Value: `%s`.",r));e=yPe({},r)}else e={};return t;function t(){return new bPe(e)}}w3.exports=wPe});var _3=s(function(err,E3){"use strict";var O3=require("@stdlib/utils/define-nonenumerable-read-only-property"),Lm=cf(),SPe=b3(),OPe=S3();O3(Lm,"objectMode",SPe);O3(Lm,"factory",OPe);E3.exports=Lm});var N3=s(function(rrr,EPe){EPe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var P3=s(function(trr,R3){"use strict";var _Pe=require("@stdlib/assert/is-plain-object"),rr=require("@stdlib/assert/has-own-property"),NPe=require("@stdlib/assert/is-boolean").isPrimitive,LPe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,L3=require("@stdlib/assert/is-string").isPrimitive,RPe=require("@stdlib/assert/is-positive-integer").isPrimitive,PPe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Ln=require("@stdlib/string/format");function TPe(r,e){return _Pe(e)?rr(e,"sep")&&(r.sep=e.sep,!L3(r.sep))?new TypeError(Ln("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):rr(e,"objectMode")&&(r.objectMode=e.objectMode,!NPe(r.objectMode))?new TypeError(Ln("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):rr(e,"encoding")&&(r.encoding=e.encoding,!L3(r.encoding)&&r.encoding!==null)?new TypeError(Ln("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):rr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!LPe(r.highWaterMark))?new TypeError(Ln("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):rr(e,"iter")&&(r.iter=e.iter,!PPe(r.iter))?new TypeError(Ln("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):rr(e,"siter")&&(r.siter=e.siter,!RPe(r.siter))?new TypeError(Ln("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(rr(e,"prng")&&(r.prng=e.prng),rr(e,"seed")&&(r.seed=e.seed),rr(e,"state")&&(r.state=e.state),rr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Ln("invalid argument. Options argument must be an object. Value: `%s`.",e))}R3.exports=TPe});var j3=s(function(irr,T3){"use strict";var jPe=require("debug"),MPe=jPe("random:streams:cauchy");T3.exports=MPe});var hf=s(function(nrr,V3){"use strict";var G3=require("readable-stream").Readable,xPe=require("@stdlib/assert/is-positive-number").isPrimitive,APe=require("@stdlib/assert/is-number").isPrimitive,GPe=require("@stdlib/math/base/assert/is-nan"),VPe=require("@stdlib/assert/is-error"),FPe=require("@stdlib/object/assign"),WPe=require("@stdlib/utils/inherit"),M3=require("@stdlib/utils/define-nonenumerable-property"),Si=require("@stdlib/utils/define-nonenumerable-read-only-property"),mf=require("@stdlib/utils/define-read-only-accessor"),IPe=require("@stdlib/utils/define-read-write-accessor"),kPe=pa().factory,x3=require("@stdlib/buffer/from-string"),zPe=require("@stdlib/utils/next-tick"),A3=require("@stdlib/string/format"),JPe=N3(),UPe=P3(),is=j3();function CPe(){return this._prng.seed}function BPe(){return this._prng.seedLength}function DPe(){return this._prng.stateLength}function XPe(){return this._prng.byteLength}function YPe(){return this._prng.state}function HPe(r){this._prng.state=r}function ZPe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return is("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),is("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=x3(e):e=x3(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function QPe(r){var e;if(this._destroyed)return is("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,zPe(t),this;function t(){r&&(is("Stream was destroyed due to an error. Error: %s.",VPe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),is("Closing the stream..."),e.emit("close")}}function oe(r,e,t){var i,n;if(!(this instanceof oe))return arguments.length>2?new oe(r,e,t):new oe(r,e);if(!APe(r)||GPe(r))throw new TypeError(A3("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!xPe(e))throw new TypeError(A3("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=FPe({},JPe),arguments.length>2&&(n=UPe(i,t),n))throw n;return is("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),G3.call(this,i),M3(this,"_destroyed",!1),Si(this,"_objectMode",i.objectMode),Si(this,"_sep",i.sep),Si(this,"_iter",i.iter),Si(this,"_siter",i.siter),M3(this,"_i",0),Si(this,"_prng",kPe(r,e,i)),Si(this,"PRNG",this._prng.PRNG),this}WPe(oe,G3);mf(oe.prototype,"seed",CPe);mf(oe.prototype,"seedLength",BPe);IPe(oe.prototype,"state",YPe,HPe);mf(oe.prototype,"stateLength",DPe);mf(oe.prototype,"byteLength",XPe);Si(oe.prototype,"_read",ZPe);Si(oe.prototype,"destroy",QPe);V3.exports=oe});var W3=s(function(arr,F3){"use strict";var $Pe=require("@stdlib/assert/is-plain-object"),KPe=require("@stdlib/object/assign"),eTe=require("@stdlib/string/format"),rTe=hf();function tTe(r,e,t){var i;if(arguments.length>2){if(i=t,!$Pe(i))throw new TypeError(eTe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=KPe({},t)}else i={};return i.objectMode=!0,new rTe(r,e,i)}F3.exports=tTe});var C3=s(function(srr,U3){"use strict";var I3=require("@stdlib/assert/is-plain-object"),k3=require("@stdlib/object/assign"),z3=require("@stdlib/string/format"),J3=hf();function iTe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!I3(r))throw new TypeError(z3("invalid argument. Options argument must be an object. Value: `%s`.",r));n=k3({},r)}else if(i>2){if(!I3(t))throw new TypeError(z3("invalid argument. Options argument must be an object. Value: `%s`.",t));n=k3({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new J3(v,g,n)}function o(){return new J3(r,e,n)}}U3.exports=iTe});var X3=s(function(urr,D3){"use strict";var B3=require("@stdlib/utils/define-nonenumerable-read-only-property"),Rm=hf(),nTe=W3(),aTe=C3();B3(Rm,"objectMode",nTe);B3(Rm,"factory",aTe);D3.exports=Rm});var Y3=s(function(orr,sTe){sTe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var Q3=s(function(vrr,Z3){"use strict";var uTe=require("@stdlib/assert/is-plain-object"),tr=require("@stdlib/assert/has-own-property"),oTe=require("@stdlib/assert/is-boolean").isPrimitive,vTe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,H3=require("@stdlib/assert/is-string").isPrimitive,gTe=require("@stdlib/assert/is-positive-integer").isPrimitive,fTe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Rn=require("@stdlib/string/format");function dTe(r,e){return uTe(e)?tr(e,"sep")&&(r.sep=e.sep,!H3(r.sep))?new TypeError(Rn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):tr(e,"objectMode")&&(r.objectMode=e.objectMode,!oTe(r.objectMode))?new TypeError(Rn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):tr(e,"encoding")&&(r.encoding=e.encoding,!H3(r.encoding)&&r.encoding!==null)?new TypeError(Rn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):tr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!vTe(r.highWaterMark))?new TypeError(Rn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):tr(e,"iter")&&(r.iter=e.iter,!fTe(r.iter))?new TypeError(Rn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):tr(e,"siter")&&(r.siter=e.siter,!gTe(r.siter))?new TypeError(Rn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(tr(e,"prng")&&(r.prng=e.prng),tr(e,"seed")&&(r.seed=e.seed),tr(e,"state")&&(r.state=e.state),tr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Rn("invalid argument. Options argument must be an object. Value: `%s`.",e))}Z3.exports=dTe});var K3=s(function(grr,$3){"use strict";var lTe=require("debug"),cTe=lTe("random:streams:chi");$3.exports=cTe});var yf=s(function(frr,iJ){"use strict";var tJ=require("readable-stream").Readable,mTe=require("@stdlib/assert/is-positive-number").isPrimitive,hTe=require("@stdlib/assert/is-error"),pTe=require("@stdlib/object/assign"),yTe=require("@stdlib/utils/inherit"),eJ=require("@stdlib/utils/define-nonenumerable-property"),Oi=require("@stdlib/utils/define-nonenumerable-read-only-property"),pf=require("@stdlib/utils/define-read-only-accessor"),qTe=require("@stdlib/utils/define-read-write-accessor"),bTe=gn().factory,rJ=require("@stdlib/buffer/from-string"),wTe=require("@stdlib/utils/next-tick"),STe=require("@stdlib/string/format"),OTe=Y3(),ETe=Q3(),ns=K3();function _Te(){return this._prng.seed}function NTe(){return this._prng.seedLength}function LTe(){return this._prng.stateLength}function RTe(){return this._prng.byteLength}function PTe(){return this._prng.state}function TTe(r){this._prng.state=r}function jTe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return ns("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),ns("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=rJ(e):e=rJ(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function MTe(r){var e;if(this._destroyed)return ns("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,wTe(t),this;function t(){r&&(ns("Stream was destroyed due to an error. Error: %s.",hTe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),ns("Closing the stream..."),e.emit("close")}}function ve(r,e){var t,i;if(!(this instanceof ve))return arguments.length>1?new ve(r,e):new ve(r);if(!mTe(r))throw new TypeError(STe("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(t=pTe({},OTe),arguments.length>1&&(i=ETe(t,e),i))throw i;return ns("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),tJ.call(this,t),eJ(this,"_destroyed",!1),Oi(this,"_objectMode",t.objectMode),Oi(this,"_sep",t.sep),Oi(this,"_iter",t.iter),Oi(this,"_siter",t.siter),eJ(this,"_i",0),Oi(this,"_prng",bTe(r,t)),Oi(this,"PRNG",this._prng.PRNG),this}yTe(ve,tJ);pf(ve.prototype,"seed",_Te);pf(ve.prototype,"seedLength",NTe);qTe(ve.prototype,"state",PTe,TTe);pf(ve.prototype,"stateLength",LTe);pf(ve.prototype,"byteLength",RTe);Oi(ve.prototype,"_read",jTe);Oi(ve.prototype,"destroy",MTe);iJ.exports=ve});var aJ=s(function(drr,nJ){"use strict";var xTe=require("@stdlib/assert/is-plain-object"),ATe=require("@stdlib/object/assign"),GTe=require("@stdlib/string/format"),VTe=yf();function FTe(r,e){var t;if(arguments.length>1){if(t=e,!xTe(t))throw new TypeError(GTe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=ATe({},e)}else t={};return t.objectMode=!0,new VTe(r,t)}nJ.exports=FTe});var fJ=s(function(lrr,gJ){"use strict";var sJ=require("@stdlib/assert/is-plain-object"),WTe=require("@stdlib/assert/is-positive-number").isPrimitive,uJ=require("@stdlib/object/assign"),oJ=require("@stdlib/string/format"),vJ=yf();function ITe(r,e){var t,i,n;if(t=arguments.length,t>1){if(!sJ(e))throw new TypeError(oJ("invalid argument. Options argument must be an object. Value: `%s`.",e));n=u,i=uJ({},e)}else if(t===1)if(WTe(r))n=u,i={};else{if(!sJ(r))throw new TypeError(oJ("invalid argument. Options argument must be an object. Value: `%s`.",r));i=uJ({},r),n=a}else i={},n=a;return n;function a(o){return new vJ(o,i)}function u(){return new vJ(r,i)}}gJ.exports=ITe});var cJ=s(function(crr,lJ){"use strict";var dJ=require("@stdlib/utils/define-nonenumerable-read-only-property"),Pm=yf(),kTe=aJ(),zTe=fJ();dJ(Pm,"objectMode",kTe);dJ(Pm,"factory",zTe);lJ.exports=Pm});var mJ=s(function(mrr,JTe){JTe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var yJ=s(function(hrr,pJ){"use strict";var UTe=require("@stdlib/assert/is-plain-object"),ir=require("@stdlib/assert/has-own-property"),CTe=require("@stdlib/assert/is-boolean").isPrimitive,BTe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,hJ=require("@stdlib/assert/is-string").isPrimitive,DTe=require("@stdlib/assert/is-positive-integer").isPrimitive,XTe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Pn=require("@stdlib/string/format");function YTe(r,e){return UTe(e)?ir(e,"sep")&&(r.sep=e.sep,!hJ(r.sep))?new TypeError(Pn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):ir(e,"objectMode")&&(r.objectMode=e.objectMode,!CTe(r.objectMode))?new TypeError(Pn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):ir(e,"encoding")&&(r.encoding=e.encoding,!hJ(r.encoding)&&r.encoding!==null)?new TypeError(Pn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):ir(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!BTe(r.highWaterMark))?new TypeError(Pn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):ir(e,"iter")&&(r.iter=e.iter,!XTe(r.iter))?new TypeError(Pn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):ir(e,"siter")&&(r.siter=e.siter,!DTe(r.siter))?new TypeError(Pn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(ir(e,"prng")&&(r.prng=e.prng),ir(e,"seed")&&(r.seed=e.seed),ir(e,"state")&&(r.state=e.state),ir(e,"copy")&&(r.copy=e.copy),null):new TypeError(Pn("invalid argument. Options argument must be an object. Value: `%s`.",e))}pJ.exports=YTe});var bJ=s(function(prr,qJ){"use strict";var HTe=require("debug"),ZTe=HTe("random:streams:chisquare");qJ.exports=ZTe});var bf=s(function(yrr,EJ){"use strict";var OJ=require("readable-stream").Readable,QTe=require("@stdlib/assert/is-positive-number").isPrimitive,$Te=require("@stdlib/assert/is-error"),KTe=require("@stdlib/object/assign"),eje=require("@stdlib/utils/inherit"),wJ=require("@stdlib/utils/define-nonenumerable-property"),Ei=require("@stdlib/utils/define-nonenumerable-read-only-property"),qf=require("@stdlib/utils/define-read-only-accessor"),rje=require("@stdlib/utils/define-read-write-accessor"),tje=Xe().factory,SJ=require("@stdlib/buffer/from-string"),ije=require("@stdlib/utils/next-tick"),nje=require("@stdlib/string/format"),aje=mJ(),sje=yJ(),as=bJ();function uje(){return this._prng.seed}function oje(){return this._prng.seedLength}function vje(){return this._prng.stateLength}function gje(){return this._prng.byteLength}function fje(){return this._prng.state}function dje(r){this._prng.state=r}function lje(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return as("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),as("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=SJ(e):e=SJ(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function cje(r){var e;if(this._destroyed)return as("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,ije(t),this;function t(){r&&(as("Stream was destroyed due to an error. Error: %s.",$Te(r)?r.message:JSON.stringify(r)),e.emit("error",r)),as("Closing the stream..."),e.emit("close")}}function ge(r,e){var t,i;if(!(this instanceof ge))return arguments.length>1?new ge(r,e):new ge(r);if(!QTe(r))throw new TypeError(nje("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(t=KTe({},aje),arguments.length>1&&(i=sje(t,e),i))throw i;return as("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),OJ.call(this,t),wJ(this,"_destroyed",!1),Ei(this,"_objectMode",t.objectMode),Ei(this,"_sep",t.sep),Ei(this,"_iter",t.iter),Ei(this,"_siter",t.siter),wJ(this,"_i",0),Ei(this,"_prng",tje(r,t)),Ei(this,"PRNG",this._prng.PRNG),this}eje(ge,OJ);qf(ge.prototype,"seed",uje);qf(ge.prototype,"seedLength",oje);rje(ge.prototype,"state",fje,dje);qf(ge.prototype,"stateLength",vje);qf(ge.prototype,"byteLength",gje);Ei(ge.prototype,"_read",lje);Ei(ge.prototype,"destroy",cje);EJ.exports=ge});var NJ=s(function(qrr,_J){"use strict";var mje=require("@stdlib/assert/is-plain-object"),hje=require("@stdlib/object/assign"),pje=require("@stdlib/string/format"),yje=bf();function qje(r,e){var t;if(arguments.length>1){if(t=e,!mje(t))throw new TypeError(pje("invalid argument. Options argument must be an object. Value: `%s`.",t));t=hje({},t)}else t={};return t.objectMode=!0,new yje(r,t)}_J.exports=qje});var MJ=s(function(brr,jJ){"use strict";var bje=require("@stdlib/assert/is-positive-number").isPrimitive,LJ=require("@stdlib/assert/is-plain-object"),RJ=require("@stdlib/object/assign"),PJ=require("@stdlib/string/format"),TJ=bf();function wje(r,e){var t,i,n;if(t=arguments.length,t>1){if(!LJ(e))throw new TypeError(PJ("invalid argument. Options argument must be an object. Value: `%s`.",e));n=u,i=RJ({},e)}else if(t===1)if(bje(r))n=u,i={};else{if(!LJ(r))throw new TypeError(PJ("invalid argument. Options argument must be an object. Value: `%s`.",r));i=RJ({},r),n=a}else i={},n=a;return n;function a(o){return new TJ(o,i)}function u(){return new TJ(r,i)}}jJ.exports=wje});var GJ=s(function(wrr,AJ){"use strict";var xJ=require("@stdlib/utils/define-nonenumerable-read-only-property"),Tm=bf(),Sje=NJ(),Oje=MJ();xJ(Tm,"objectMode",Sje);xJ(Tm,"factory",Oje);AJ.exports=Tm});var VJ=s(function(Srr,Eje){Eje.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var IJ=s(function(Orr,WJ){"use strict";var _je=require("@stdlib/assert/is-plain-object"),nr=require("@stdlib/assert/has-own-property"),Nje=require("@stdlib/assert/is-boolean").isPrimitive,Lje=require("@stdlib/assert/is-nonnegative-number").isPrimitive,FJ=require("@stdlib/assert/is-string").isPrimitive,Rje=require("@stdlib/assert/is-positive-integer").isPrimitive,Pje=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Tn=require("@stdlib/string/format");function Tje(r,e){return _je(e)?nr(e,"sep")&&(r.sep=e.sep,!FJ(r.sep))?new TypeError(Tn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):nr(e,"objectMode")&&(r.objectMode=e.objectMode,!Nje(r.objectMode))?new TypeError(Tn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):nr(e,"encoding")&&(r.encoding=e.encoding,!FJ(r.encoding)&&r.encoding!==null)?new TypeError(Tn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):nr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!Lje(r.highWaterMark))?new TypeError(Tn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):nr(e,"iter")&&(r.iter=e.iter,!Pje(r.iter))?new TypeError(Tn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):nr(e,"siter")&&(r.siter=e.siter,!Rje(r.siter))?new TypeError(Tn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(nr(e,"prng")&&(r.prng=e.prng),nr(e,"seed")&&(r.seed=e.seed),nr(e,"state")&&(r.state=e.state),nr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Tn("invalid argument. Options argument must be an object. Value: `%s`.",e))}WJ.exports=Tje});var zJ=s(function(Err,kJ){"use strict";var jje=require("debug"),Mje=jje("random:streams:cosine");kJ.exports=Mje});var Sf=s(function(_rr,DJ){"use strict";var BJ=require("readable-stream").Readable,xje=require("@stdlib/assert/is-positive-number").isPrimitive,Aje=require("@stdlib/assert/is-number").isPrimitive,Gje=require("@stdlib/math/base/assert/is-nan"),Vje=require("@stdlib/assert/is-error"),Fje=require("@stdlib/object/assign"),Wje=require("@stdlib/utils/inherit"),JJ=require("@stdlib/utils/define-nonenumerable-property"),_i=require("@stdlib/utils/define-nonenumerable-read-only-property"),wf=require("@stdlib/utils/define-read-only-accessor"),Ije=require("@stdlib/utils/define-read-write-accessor"),kje=fn().factory,UJ=require("@stdlib/buffer/from-string"),zje=require("@stdlib/utils/next-tick"),CJ=require("@stdlib/string/format"),Jje=VJ(),Uje=IJ(),ss=zJ();function Cje(){return this._prng.seed}function Bje(){return this._prng.seedLength}function Dje(){return this._prng.stateLength}function Xje(){return this._prng.byteLength}function Yje(){return this._prng.state}function Hje(r){this._prng.state=r}function Zje(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return ss("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),ss("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=UJ(e):e=UJ(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function Qje(r){var e;if(this._destroyed)return ss("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,zje(t),this;function t(){r&&(ss("Stream was destroyed due to an error. Error: %s.",Vje(r)?r.message:JSON.stringify(r)),e.emit("error",r)),ss("Closing the stream..."),e.emit("close")}}function fe(r,e,t){var i,n;if(!(this instanceof fe))return arguments.length>2?new fe(r,e,t):new fe(r,e);if(!Aje(r)||Gje(r))throw new TypeError(CJ("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!xje(e))throw new TypeError(CJ("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=Fje({},Jje),arguments.length>2&&(n=Uje(i,t),n))throw n;return ss("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),BJ.call(this,i),JJ(this,"_destroyed",!1),_i(this,"_objectMode",i.objectMode),_i(this,"_sep",i.sep),_i(this,"_iter",i.iter),_i(this,"_siter",i.siter),JJ(this,"_i",0),_i(this,"_prng",kje(r,e,i)),_i(this,"PRNG",this._prng.PRNG),this}Wje(fe,BJ);wf(fe.prototype,"seed",Cje);wf(fe.prototype,"seedLength",Bje);Ije(fe.prototype,"state",Yje,Hje);wf(fe.prototype,"stateLength",Dje);wf(fe.prototype,"byteLength",Xje);_i(fe.prototype,"_read",Zje);_i(fe.prototype,"destroy",Qje);DJ.exports=fe});var YJ=s(function(Nrr,XJ){"use strict";var $je=require("@stdlib/assert/is-plain-object"),Kje=require("@stdlib/object/assign"),e0e=require("@stdlib/string/format"),r0e=Sf();function t0e(r,e,t){var i;if(arguments.length>2){if(i=t,!$je(i))throw new TypeError(e0e("invalid argument. Options argument must be an object. Value: `%s`.",i));i=Kje({},t)}else i={};return i.objectMode=!0,new r0e(r,e,i)}XJ.exports=t0e});var eU=s(function(Lrr,KJ){"use strict";var HJ=require("@stdlib/assert/is-plain-object"),ZJ=require("@stdlib/object/assign"),QJ=require("@stdlib/string/format"),$J=Sf();function i0e(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!HJ(r))throw new TypeError(QJ("invalid argument. Options argument must be an object. Value: `%s`.",r));n=ZJ({},r)}else if(i>2){if(!HJ(t))throw new TypeError(QJ("invalid argument. Options argument must be an object. Value: `%s`.",t));n=ZJ({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new $J(v,g,n)}function o(){return new $J(r,e,n)}}KJ.exports=i0e});var iU=s(function(Rrr,tU){"use strict";var rU=require("@stdlib/utils/define-nonenumerable-read-only-property"),jm=Sf(),n0e=YJ(),a0e=eU();rU(jm,"objectMode",n0e);rU(jm,"factory",a0e);tU.exports=jm});var nU=s(function(Prr,s0e){s0e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var uU=s(function(Trr,sU){"use strict";var u0e=require("@stdlib/assert/is-plain-object"),ar=require("@stdlib/assert/has-own-property"),o0e=require("@stdlib/assert/is-boolean").isPrimitive,v0e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,aU=require("@stdlib/assert/is-string").isPrimitive,g0e=require("@stdlib/assert/is-positive-integer").isPrimitive,f0e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,jn=require("@stdlib/string/format");function d0e(r,e){return u0e(e)?ar(e,"sep")&&(r.sep=e.sep,!aU(r.sep))?new TypeError(jn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):ar(e,"objectMode")&&(r.objectMode=e.objectMode,!o0e(r.objectMode))?new TypeError(jn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):ar(e,"encoding")&&(r.encoding=e.encoding,!aU(r.encoding)&&r.encoding!==null)?new TypeError(jn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):ar(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!v0e(r.highWaterMark))?new TypeError(jn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):ar(e,"iter")&&(r.iter=e.iter,!f0e(r.iter))?new TypeError(jn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):ar(e,"siter")&&(r.siter=e.siter,!g0e(r.siter))?new TypeError(jn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(ar(e,"prng")&&(r.prng=e.prng),ar(e,"seed")&&(r.seed=e.seed),ar(e,"state")&&(r.state=e.state),ar(e,"copy")&&(r.copy=e.copy),null):new TypeError(jn("invalid argument. Options argument must be an object. Value: `%s`.",e))}sU.exports=d0e});var vU=s(function(jrr,oU){"use strict";var l0e=require("debug"),c0e=l0e("random:streams:discrete-uniform");oU.exports=c0e});var Ef=s(function(Mrr,cU){"use strict";var lU=require("readable-stream").Readable,gU=require("@stdlib/assert/is-integer").isPrimitive,m0e=require("@stdlib/assert/is-error"),h0e=require("@stdlib/object/assign"),p0e=require("@stdlib/utils/inherit"),fU=require("@stdlib/utils/define-nonenumerable-property"),Ni=require("@stdlib/utils/define-nonenumerable-read-only-property"),Of=require("@stdlib/utils/define-read-only-accessor"),y0e=require("@stdlib/utils/define-read-write-accessor"),q0e=dn().factory,dU=require("@stdlib/buffer/from-string"),b0e=require("@stdlib/utils/next-tick"),Mm=require("@stdlib/string/format"),w0e=nU(),S0e=uU(),us=vU();function O0e(){return this._prng.seed}function E0e(){return this._prng.seedLength}function _0e(){return this._prng.stateLength}function N0e(){return this._prng.byteLength}function L0e(){return this._prng.state}function R0e(r){this._prng.state=r}function P0e(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return us("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),us("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=dU(e):e=dU(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function T0e(r){var e;if(this._destroyed)return us("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,b0e(t),this;function t(){r&&(us("Stream was destroyed due to an error. Error: %s.",m0e(r)?r.message:JSON.stringify(r)),e.emit("error",r)),us("Closing the stream..."),e.emit("close")}}function de(r,e,t){var i,n;if(!(this instanceof de))return arguments.length>2?new de(r,e,t):new de(r,e);if(!gU(r))throw new TypeError(Mm("invalid argument. First argument must be an integer. Value: `%s`.",r));if(!gU(e))throw new TypeError(Mm("invalid argument. Second argument must be an integer. Value: `%s`.",e));if(r>e)throw new RangeError(Mm("invalid argument. Minimum support must be less than or equal to maximum support. Value: `[%d, %d]`.",r,e));if(i=h0e({},w0e),arguments.length>2&&(n=S0e(i,t),n))throw n;return us("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),lU.call(this,i),fU(this,"_destroyed",!1),Ni(this,"_objectMode",i.objectMode),Ni(this,"_sep",i.sep),Ni(this,"_iter",i.iter),Ni(this,"_siter",i.siter),fU(this,"_i",0),Ni(this,"_prng",q0e(r,e,i)),Ni(this,"PRNG",this._prng.PRNG),this}p0e(de,lU);Of(de.prototype,"seed",O0e);Of(de.prototype,"seedLength",E0e);y0e(de.prototype,"state",L0e,R0e);Of(de.prototype,"stateLength",_0e);Of(de.prototype,"byteLength",N0e);Ni(de.prototype,"_read",P0e);Ni(de.prototype,"destroy",T0e);cU.exports=de});var hU=s(function(xrr,mU){"use strict";var j0e=require("@stdlib/assert/is-plain-object"),M0e=require("@stdlib/object/assign"),x0e=require("@stdlib/string/format"),A0e=Ef();function G0e(r,e,t){var i;if(arguments.length>2){if(i=t,!j0e(i))throw new TypeError(x0e("invalid argument. Options argument must be an object. Value: `%s`.",i));i=M0e({},t)}else i={};return i.objectMode=!0,new A0e(r,e,i)}mU.exports=G0e});var SU=s(function(Arr,wU){"use strict";var pU=require("@stdlib/assert/is-plain-object"),yU=require("@stdlib/object/assign"),qU=require("@stdlib/string/format"),bU=Ef();function V0e(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!pU(r))throw new TypeError(qU("invalid argument. Options argument must be an object. Value: `%s`.",r));n=yU({},r)}else if(i>2){if(!pU(t))throw new TypeError(qU("invalid argument. Options argument must be an object. Value: `%s`.",t));n=yU({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new bU(v,g,n)}function o(){return new bU(r,e,n)}}wU.exports=V0e});var _U=s(function(Grr,EU){"use strict";var OU=require("@stdlib/utils/define-nonenumerable-read-only-property"),xm=Ef(),F0e=hU(),W0e=SU();OU(xm,"objectMode",F0e);OU(xm,"factory",W0e);EU.exports=xm});var NU=s(function(Vrr,I0e){I0e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var PU=s(function(Frr,RU){"use strict";var k0e=require("@stdlib/assert/is-plain-object"),sr=require("@stdlib/assert/has-own-property"),z0e=require("@stdlib/assert/is-boolean").isPrimitive,J0e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,LU=require("@stdlib/assert/is-string").isPrimitive,U0e=require("@stdlib/assert/is-positive-integer").isPrimitive,C0e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Mn=require("@stdlib/string/format");function B0e(r,e){return k0e(e)?sr(e,"sep")&&(r.sep=e.sep,!LU(r.sep))?new TypeError(Mn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):sr(e,"objectMode")&&(r.objectMode=e.objectMode,!z0e(r.objectMode))?new TypeError(Mn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):sr(e,"encoding")&&(r.encoding=e.encoding,!LU(r.encoding)&&r.encoding!==null)?new TypeError(Mn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):sr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!J0e(r.highWaterMark))?new TypeError(Mn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):sr(e,"iter")&&(r.iter=e.iter,!C0e(r.iter))?new TypeError(Mn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):sr(e,"siter")&&(r.siter=e.siter,!U0e(r.siter))?new TypeError(Mn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(sr(e,"prng")&&(r.prng=e.prng),sr(e,"seed")&&(r.seed=e.seed),sr(e,"state")&&(r.state=e.state),sr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Mn("invalid argument. Options argument must be an object. Value: `%s`.",e))}RU.exports=B0e});var jU=s(function(Wrr,TU){"use strict";var D0e=require("debug"),X0e=D0e("random:streams:erlang");TU.exports=X0e});var Nf=s(function(Irr,VU){"use strict";var GU=require("readable-stream").Readable,Y0e=require("@stdlib/assert/is-positive-integer").isPrimitive,H0e=require("@stdlib/assert/is-positive-number").isPrimitive,Z0e=require("@stdlib/assert/is-error"),Q0e=require("@stdlib/object/assign"),$0e=require("@stdlib/utils/inherit"),MU=require("@stdlib/utils/define-nonenumerable-property"),Li=require("@stdlib/utils/define-nonenumerable-read-only-property"),_f=require("@stdlib/utils/define-read-only-accessor"),K0e=require("@stdlib/utils/define-read-write-accessor"),eMe=Sa().factory,xU=require("@stdlib/buffer/from-string"),rMe=require("@stdlib/utils/next-tick"),AU=require("@stdlib/string/format"),tMe=NU(),iMe=PU(),os=jU();function nMe(){return this._prng.seed}function aMe(){return this._prng.seedLength}function sMe(){return this._prng.stateLength}function uMe(){return this._prng.byteLength}function oMe(){return this._prng.state}function vMe(r){this._prng.state=r}function gMe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return os("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),os("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=xU(e):e=xU(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function fMe(r){var e;if(this._destroyed)return os("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,rMe(t),this;function t(){r&&(os("Stream was destroyed due to an error. Error: %s.",Z0e(r)?r.message:JSON.stringify(r)),e.emit("error",r)),os("Closing the stream..."),e.emit("close")}}function le(r,e,t){var i,n;if(!(this instanceof le))return arguments.length>2?new le(r,e,t):new le(r,e);if(!Y0e(r))throw new TypeError(AU("invalid argument. First argument must be a positive integer. Value: `%s`.",r));if(!H0e(e))throw new TypeError(AU("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=Q0e({},tMe),arguments.length>2&&(n=iMe(i,t),n))throw n;return os("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),GU.call(this,i),MU(this,"_destroyed",!1),Li(this,"_objectMode",i.objectMode),Li(this,"_sep",i.sep),Li(this,"_iter",i.iter),Li(this,"_siter",i.siter),MU(this,"_i",0),Li(this,"_prng",eMe(r,e,i)),Li(this,"PRNG",this._prng.PRNG),this}$0e(le,GU);_f(le.prototype,"seed",nMe);_f(le.prototype,"seedLength",aMe);K0e(le.prototype,"state",oMe,vMe);_f(le.prototype,"stateLength",sMe);_f(le.prototype,"byteLength",uMe);Li(le.prototype,"_read",gMe);Li(le.prototype,"destroy",fMe);VU.exports=le});var WU=s(function(krr,FU){"use strict";var dMe=require("@stdlib/assert/is-plain-object"),lMe=require("@stdlib/object/assign"),cMe=require("@stdlib/string/format"),mMe=Nf();function hMe(r,e,t){var i;if(arguments.length>2){if(i=t,!dMe(i))throw new TypeError(cMe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=lMe({},t)}else i={};return i.objectMode=!0,new mMe(r,e,i)}FU.exports=hMe});var CU=s(function(zrr,UU){"use strict";var IU=require("@stdlib/assert/is-plain-object"),kU=require("@stdlib/object/assign"),zU=require("@stdlib/string/format"),JU=Nf();function pMe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!IU(r))throw new TypeError(zU("invalid argument. Options argument must be an object. Value: `%s`.",r));n=kU({},r)}else if(i>2){if(!IU(t))throw new TypeError(zU("invalid argument. Options argument must be an object. Value: `%s`.",t));n=kU({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new JU(v,g,n)}function o(){return new JU(r,e,n)}}UU.exports=pMe});var XU=s(function(Jrr,DU){"use strict";var BU=require("@stdlib/utils/define-nonenumerable-read-only-property"),Am=Nf(),yMe=WU(),qMe=CU();BU(Am,"objectMode",yMe);BU(Am,"factory",qMe);DU.exports=Am});var YU=s(function(Urr,bMe){bMe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var QU=s(function(Crr,ZU){"use strict";var wMe=require("@stdlib/assert/is-plain-object"),ur=require("@stdlib/assert/has-own-property"),SMe=require("@stdlib/assert/is-boolean").isPrimitive,OMe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,HU=require("@stdlib/assert/is-string").isPrimitive,EMe=require("@stdlib/assert/is-positive-integer").isPrimitive,_Me=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,xn=require("@stdlib/string/format");function NMe(r,e){return wMe(e)?ur(e,"sep")&&(r.sep=e.sep,!HU(r.sep))?new TypeError(xn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):ur(e,"objectMode")&&(r.objectMode=e.objectMode,!SMe(r.objectMode))?new TypeError(xn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):ur(e,"encoding")&&(r.encoding=e.encoding,!HU(r.encoding)&&r.encoding!==null)?new TypeError(xn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):ur(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!OMe(r.highWaterMark))?new TypeError(xn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):ur(e,"iter")&&(r.iter=e.iter,!_Me(r.iter))?new TypeError(xn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):ur(e,"siter")&&(r.siter=e.siter,!EMe(r.siter))?new TypeError(xn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(ur(e,"prng")&&(r.prng=e.prng),ur(e,"seed")&&(r.seed=e.seed),ur(e,"state")&&(r.state=e.state),ur(e,"copy")&&(r.copy=e.copy),null):new TypeError(xn("invalid argument. Options argument must be an object. Value: `%s`.",e))}ZU.exports=NMe});var KU=s(function(Brr,$U){"use strict";var LMe=require("debug"),RMe=LMe("random:streams:exponential");$U.exports=RMe});var Rf=s(function(Drr,iC){"use strict";var tC=require("readable-stream").Readable,PMe=require("@stdlib/assert/is-positive-number").isPrimitive,TMe=require("@stdlib/assert/is-error"),jMe=require("@stdlib/object/assign"),MMe=require("@stdlib/utils/inherit"),eC=require("@stdlib/utils/define-nonenumerable-property"),Ri=require("@stdlib/utils/define-nonenumerable-read-only-property"),Lf=require("@stdlib/utils/define-read-only-accessor"),xMe=require("@stdlib/utils/define-read-write-accessor"),AMe=ln().factory,rC=require("@stdlib/buffer/from-string"),GMe=require("@stdlib/utils/next-tick"),VMe=require("@stdlib/string/format"),FMe=YU(),WMe=QU(),vs=KU();function IMe(){return this._prng.seed}function kMe(){return this._prng.seedLength}function zMe(){return this._prng.stateLength}function JMe(){return this._prng.byteLength}function UMe(){return this._prng.state}function CMe(r){this._prng.state=r}function BMe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return vs("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),vs("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=rC(e):e=rC(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function DMe(r){var e;if(this._destroyed)return vs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,GMe(t),this;function t(){r&&(vs("Stream was destroyed due to an error. Error: %s.",TMe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),vs("Closing the stream..."),e.emit("close")}}function ce(r,e){var t,i;if(!(this instanceof ce))return arguments.length>1?new ce(r,e):new ce(r);if(!PMe(r))throw new TypeError(VMe("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(t=jMe({},FMe),arguments.length>1&&(i=WMe(t,e),i))throw i;return vs("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),tC.call(this,t),eC(this,"_destroyed",!1),Ri(this,"_objectMode",t.objectMode),Ri(this,"_sep",t.sep),Ri(this,"_iter",t.iter),Ri(this,"_siter",t.siter),eC(this,"_i",0),Ri(this,"_prng",AMe(r,t)),Ri(this,"PRNG",this._prng.PRNG),this}MMe(ce,tC);Lf(ce.prototype,"seed",IMe);Lf(ce.prototype,"seedLength",kMe);xMe(ce.prototype,"state",UMe,CMe);Lf(ce.prototype,"stateLength",zMe);Lf(ce.prototype,"byteLength",JMe);Ri(ce.prototype,"_read",BMe);Ri(ce.prototype,"destroy",DMe);iC.exports=ce});var aC=s(function(Xrr,nC){"use strict";var XMe=require("@stdlib/assert/is-plain-object"),YMe=require("@stdlib/object/assign"),HMe=require("@stdlib/string/format"),ZMe=Rf();function QMe(r,e){var t;if(arguments.length>1){if(t=e,!XMe(t))throw new TypeError(HMe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=YMe({},e)}else t={};return t.objectMode=!0,new ZMe(r,t)}nC.exports=QMe});var fC=s(function(Yrr,gC){"use strict";var $Me=require("@stdlib/assert/is-positive-number").isPrimitive,sC=require("@stdlib/assert/is-plain-object"),uC=require("@stdlib/object/assign"),oC=require("@stdlib/string/format"),vC=Rf();function KMe(r,e){var t,i,n;if(t=arguments.length,t>1){if(!sC(e))throw new TypeError(oC("invalid argument. Options argument must be an object. Value: `%s`.",e));n=u,i=uC({},e)}else if(t===1)if($Me(r))n=u,i={};else{if(!sC(r))throw new TypeError(oC("invalid argument. Options argument must be an object. Value: `%s`.",r));i=uC({},r),n=a}else i={},n=a;return n;function a(o){return new vC(o,i)}function u(){return new vC(r,i)}}gC.exports=KMe});var cC=s(function(Hrr,lC){"use strict";var dC=require("@stdlib/utils/define-nonenumerable-read-only-property"),Gm=Rf(),exe=aC(),rxe=fC();dC(Gm,"objectMode",exe);dC(Gm,"factory",rxe);lC.exports=Gm});var mC=s(function(Zrr,txe){txe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var yC=s(function(Qrr,pC){"use strict";var ixe=require("@stdlib/assert/is-plain-object"),or=require("@stdlib/assert/has-own-property"),nxe=require("@stdlib/assert/is-boolean").isPrimitive,axe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,hC=require("@stdlib/assert/is-string").isPrimitive,sxe=require("@stdlib/assert/is-positive-integer").isPrimitive,uxe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,An=require("@stdlib/string/format");function oxe(r,e){return ixe(e)?or(e,"sep")&&(r.sep=e.sep,!hC(r.sep))?new TypeError(An("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):or(e,"objectMode")&&(r.objectMode=e.objectMode,!nxe(r.objectMode))?new TypeError(An("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):or(e,"encoding")&&(r.encoding=e.encoding,!hC(r.encoding)&&r.encoding!==null)?new TypeError(An("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):or(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!axe(r.highWaterMark))?new TypeError(An("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):or(e,"iter")&&(r.iter=e.iter,!uxe(r.iter))?new TypeError(An("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):or(e,"siter")&&(r.siter=e.siter,!sxe(r.siter))?new TypeError(An("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(or(e,"prng")&&(r.prng=e.prng),or(e,"seed")&&(r.seed=e.seed),or(e,"state")&&(r.state=e.state),or(e,"copy")&&(r.copy=e.copy),null):new TypeError(An("invalid argument. Options argument must be an object. Value: `%s`.",e))}pC.exports=oxe});var bC=s(function($rr,qC){"use strict";var vxe=require("debug"),gxe=vxe("random:streams:f");qC.exports=gxe});var Tf=s(function(Krr,NC){"use strict";var _C=require("readable-stream").Readable,wC=require("@stdlib/assert/is-positive-number").isPrimitive,fxe=require("@stdlib/assert/is-error"),dxe=require("@stdlib/object/assign"),lxe=require("@stdlib/utils/inherit"),SC=require("@stdlib/utils/define-nonenumerable-property"),Pi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Pf=require("@stdlib/utils/define-read-only-accessor"),cxe=require("@stdlib/utils/define-read-write-accessor"),mxe=Ea().factory,OC=require("@stdlib/buffer/from-string"),hxe=require("@stdlib/utils/next-tick"),EC=require("@stdlib/string/format"),pxe=mC(),yxe=yC(),gs=bC();function qxe(){return this._prng.seed}function bxe(){return this._prng.seedLength}function wxe(){return this._prng.stateLength}function Sxe(){return this._prng.byteLength}function Oxe(){return this._prng.state}function Exe(r){this._prng.state=r}function _xe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return gs("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),gs("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=OC(e):e=OC(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function Nxe(r){var e;if(this._destroyed)return gs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,hxe(t),this;function t(){r&&(gs("Stream was destroyed due to an error. Error: %s.",fxe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),gs("Closing the stream..."),e.emit("close")}}function me(r,e,t){var i,n;if(!(this instanceof me))return arguments.length>2?new me(r,e,t):new me(r,e);if(!wC(r))throw new TypeError(EC("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!wC(e))throw new TypeError(EC("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=dxe({},pxe),arguments.length>2&&(n=yxe(i,t),n))throw n;return gs("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),_C.call(this,i),SC(this,"_destroyed",!1),Pi(this,"_objectMode",i.objectMode),Pi(this,"_sep",i.sep),Pi(this,"_iter",i.iter),Pi(this,"_siter",i.siter),SC(this,"_i",0),Pi(this,"_prng",mxe(r,e,i)),Pi(this,"PRNG",this._prng.PRNG),this}lxe(me,_C);Pf(me.prototype,"seed",qxe);Pf(me.prototype,"seedLength",bxe);cxe(me.prototype,"state",Oxe,Exe);Pf(me.prototype,"stateLength",wxe);Pf(me.prototype,"byteLength",Sxe);Pi(me.prototype,"_read",_xe);Pi(me.prototype,"destroy",Nxe);NC.exports=me});var RC=s(function(etr,LC){"use strict";var Lxe=require("@stdlib/assert/is-plain-object"),Rxe=require("@stdlib/object/assign"),Pxe=require("@stdlib/string/format"),Txe=Tf();function jxe(r,e,t){var i;if(arguments.length>2){if(i=t,!Lxe(i))throw new TypeError(Pxe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=Rxe({},t)}else i={};return i.objectMode=!0,new Txe(r,e,i)}LC.exports=jxe});var AC=s(function(rtr,xC){"use strict";var PC=require("@stdlib/assert/is-plain-object"),TC=require("@stdlib/object/assign"),jC=require("@stdlib/string/format"),MC=Tf();function Mxe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!PC(r))throw new TypeError(jC("invalid argument. Options argument must be an object. Value: `%s`.",r));n=TC({},r)}else if(i>2){if(!PC(t))throw new TypeError(jC("invalid argument. Options argument must be an object. Value: `%s`.",t));n=TC({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new MC(v,g,n)}function o(){return new MC(r,e,n)}}xC.exports=Mxe});var FC=s(function(ttr,VC){"use strict";var GC=require("@stdlib/utils/define-nonenumerable-read-only-property"),Vm=Tf(),xxe=RC(),Axe=AC();GC(Vm,"objectMode",xxe);GC(Vm,"factory",Axe);VC.exports=Vm});var WC=s(function(itr,Gxe){Gxe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var zC=s(function(ntr,kC){"use strict";var Vxe=require("@stdlib/assert/is-plain-object"),vr=require("@stdlib/assert/has-own-property"),Fxe=require("@stdlib/assert/is-boolean").isPrimitive,Wxe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,IC=require("@stdlib/assert/is-string").isPrimitive,Ixe=require("@stdlib/assert/is-positive-integer").isPrimitive,kxe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Gn=require("@stdlib/string/format");function zxe(r,e){return Vxe(e)?vr(e,"sep")&&(r.sep=e.sep,!IC(r.sep))?new TypeError(Gn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):vr(e,"objectMode")&&(r.objectMode=e.objectMode,!Fxe(r.objectMode))?new TypeError(Gn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):vr(e,"encoding")&&(r.encoding=e.encoding,!IC(r.encoding)&&r.encoding!==null)?new TypeError(Gn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):vr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!Wxe(r.highWaterMark))?new TypeError(Gn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):vr(e,"iter")&&(r.iter=e.iter,!kxe(r.iter))?new TypeError(Gn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):vr(e,"siter")&&(r.siter=e.siter,!Ixe(r.siter))?new TypeError(Gn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(vr(e,"prng")&&(r.prng=e.prng),vr(e,"seed")&&(r.seed=e.seed),vr(e,"state")&&(r.state=e.state),vr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Gn("invalid argument. Options argument must be an object. Value: `%s`.",e))}kC.exports=zxe});var UC=s(function(atr,JC){"use strict";var Jxe=require("debug"),Uxe=Jxe("random:streams:frechet");JC.exports=Uxe});var Mf=s(function(str,YC){"use strict";var XC=require("readable-stream").Readable,CC=require("@stdlib/assert/is-positive-number"),Cxe=require("@stdlib/assert/is-number").isPrimitive,Bxe=require("@stdlib/math/base/assert/is-nan"),Dxe=require("@stdlib/assert/is-error"),Xxe=require("@stdlib/object/assign"),Yxe=require("@stdlib/utils/inherit"),BC=require("@stdlib/utils/define-nonenumerable-property"),Ti=require("@stdlib/utils/define-nonenumerable-read-only-property"),jf=require("@stdlib/utils/define-read-only-accessor"),Hxe=require("@stdlib/utils/define-read-write-accessor"),Zxe=Na().factory,DC=require("@stdlib/buffer/from-string"),Qxe=require("@stdlib/utils/next-tick"),Fm=require("@stdlib/string/format"),$xe=WC(),Kxe=zC(),fs=UC();function e1e(){return this._prng.seed}function r1e(){return this._prng.seedLength}function t1e(){return this._prng.stateLength}function i1e(){return this._prng.byteLength}function n1e(){return this._prng.state}function a1e(r){this._prng.state=r}function s1e(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return fs("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),fs("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=DC(e):e=DC(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function u1e(r){var e;if(this._destroyed)return fs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,Qxe(t),this;function t(){r&&(fs("Stream was destroyed due to an error. Error: %s.",Dxe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),fs("Closing the stream..."),e.emit("close")}}function he(r,e,t,i){var n,a;if(!(this instanceof he))return arguments.length>3?new he(r,e,t,i):new he(r,e,t);if(!CC(r))throw new TypeError(Fm("invalid argument. First argument must be a positive number and not NaN. Value: `%s`.",r));if(!CC(e))throw new TypeError(Fm("invalid argument. Second argument must be a positive number and not NaN. Value: `%s`.",e));if(!Cxe(t)||Bxe(t))throw new TypeError(Fm("invalid argument. Third argument must be a number. Value: `%s`.",t));if(n=Xxe({},$xe),arguments.length>3&&(a=Kxe(n,i),a))throw a;return fs("Creating a readable stream configured with the following options: %s.",JSON.stringify(n)),XC.call(this,n),BC(this,"_destroyed",!1),Ti(this,"_objectMode",n.objectMode),Ti(this,"_sep",n.sep),Ti(this,"_iter",n.iter),Ti(this,"_siter",n.siter),BC(this,"_i",0),Ti(this,"_prng",Zxe(r,e,t,n)),Ti(this,"PRNG",this._prng.PRNG),this}Yxe(he,XC);jf(he.prototype,"seed",e1e);jf(he.prototype,"seedLength",r1e);Hxe(he.prototype,"state",n1e,a1e);jf(he.prototype,"stateLength",t1e);jf(he.prototype,"byteLength",i1e);Ti(he.prototype,"_read",s1e);Ti(he.prototype,"destroy",u1e);YC.exports=he});var ZC=s(function(utr,HC){"use strict";var o1e=require("@stdlib/assert/is-plain-object"),v1e=require("@stdlib/object/assign"),g1e=require("@stdlib/string/format"),f1e=Mf();function d1e(r,e,t,i){var n;if(arguments.length>3){if(n=i,!o1e(n))throw new TypeError(g1e("invalid argument. Options argument must be an object. Value: `%s`.",n));n=v1e({},i)}else n={};return n.objectMode=!0,new f1e(r,e,t,n)}HC.exports=d1e});var tB=s(function(otr,rB){"use strict";var QC=require("@stdlib/assert/is-plain-object"),$C=require("@stdlib/object/assign"),KC=require("@stdlib/string/format"),eB=Mf();function l1e(r,e,t,i){var n,a,u;if(n=arguments.length,n===1){if(!QC(r))throw new TypeError(KC("invalid argument. Options argument must be an object. Value: `%s`.",r));a=$C({},r)}else if(n>3){if(!QC(i))throw new TypeError(KC("invalid argument. Options argument must be an object. Value: `%s`.",i));a=$C({},i)}else a={};return n<3?u=o:u=v,u;function o(g,c,l){return new eB(g,c,l,a)}function v(){return new eB(r,e,t,a)}}rB.exports=l1e});var aB=s(function(vtr,nB){"use strict";var iB=require("@stdlib/utils/define-nonenumerable-read-only-property"),Wm=Mf(),c1e=ZC(),m1e=tB();iB(Wm,"objectMode",c1e);iB(Wm,"factory",m1e);nB.exports=Wm});var sB=s(function(gtr,h1e){h1e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var vB=s(function(ftr,oB){"use strict";var p1e=require("@stdlib/assert/is-plain-object"),gr=require("@stdlib/assert/has-own-property"),y1e=require("@stdlib/assert/is-boolean").isPrimitive,q1e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,uB=require("@stdlib/assert/is-string").isPrimitive,b1e=require("@stdlib/assert/is-positive-integer").isPrimitive,w1e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Vn=require("@stdlib/string/format");function S1e(r,e){return p1e(e)?gr(e,"sep")&&(r.sep=e.sep,!uB(r.sep))?new TypeError(Vn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):gr(e,"objectMode")&&(r.objectMode=e.objectMode,!y1e(r.objectMode))?new TypeError(Vn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):gr(e,"encoding")&&(r.encoding=e.encoding,!uB(r.encoding)&&r.encoding!==null)?new TypeError(Vn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):gr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!q1e(r.highWaterMark))?new TypeError(Vn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):gr(e,"iter")&&(r.iter=e.iter,!w1e(r.iter))?new TypeError(Vn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):gr(e,"siter")&&(r.siter=e.siter,!b1e(r.siter))?new TypeError(Vn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(gr(e,"prng")&&(r.prng=e.prng),gr(e,"seed")&&(r.seed=e.seed),gr(e,"state")&&(r.state=e.state),gr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Vn("invalid argument. Options argument must be an object. Value: `%s`.",e))}oB.exports=S1e});var fB=s(function(dtr,gB){"use strict";var O1e=require("debug"),E1e=O1e("random:streams:gamma");gB.exports=E1e});var Af=s(function(ltr,pB){"use strict";var hB=require("readable-stream").Readable,dB=require("@stdlib/assert/is-positive-number").isPrimitive,_1e=require("@stdlib/assert/is-error"),N1e=require("@stdlib/object/assign"),L1e=require("@stdlib/utils/inherit"),lB=require("@stdlib/utils/define-nonenumerable-property"),ji=require("@stdlib/utils/define-nonenumerable-read-only-property"),xf=require("@stdlib/utils/define-read-only-accessor"),R1e=require("@stdlib/utils/define-read-write-accessor"),P1e=Ce().factory,cB=require("@stdlib/buffer/from-string"),T1e=require("@stdlib/utils/next-tick"),mB=require("@stdlib/string/format"),j1e=sB(),M1e=vB(),ds=fB();function x1e(){return this._prng.seed}function A1e(){return this._prng.seedLength}function G1e(){return this._prng.stateLength}function V1e(){return this._prng.byteLength}function F1e(){return this._prng.state}function W1e(r){this._prng.state=r}function I1e(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return ds("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),ds("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=cB(e):e=cB(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function k1e(r){var e;if(this._destroyed)return ds("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,T1e(t),this;function t(){r&&(ds("Stream was destroyed due to an error. Error: %s.",_1e(r)?r.message:JSON.stringify(r)),e.emit("error",r)),ds("Closing the stream..."),e.emit("close")}}function pe(r,e,t){var i,n;if(!(this instanceof pe))return arguments.length>2?new pe(r,e,t):new pe(r,e);if(!dB(r))throw new TypeError(mB("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!dB(e))throw new TypeError(mB("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=N1e({},j1e),arguments.length>2&&(n=M1e(i,t),n))throw n;return ds("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),hB.call(this,i),lB(this,"_destroyed",!1),ji(this,"_objectMode",i.objectMode),ji(this,"_sep",i.sep),ji(this,"_iter",i.iter),ji(this,"_siter",i.siter),lB(this,"_i",0),ji(this,"_prng",P1e(r,e,i)),ji(this,"PRNG",this._prng.PRNG),this}L1e(pe,hB);xf(pe.prototype,"seed",x1e);xf(pe.prototype,"seedLength",A1e);R1e(pe.prototype,"state",F1e,W1e);xf(pe.prototype,"stateLength",G1e);xf(pe.prototype,"byteLength",V1e);ji(pe.prototype,"_read",I1e);ji(pe.prototype,"destroy",k1e);pB.exports=pe});var qB=s(function(ctr,yB){"use strict";var z1e=require("@stdlib/assert/is-plain-object"),J1e=require("@stdlib/object/assign"),U1e=require("@stdlib/string/format"),C1e=Af();function B1e(r,e,t){var i;if(arguments.length>2){if(i=t,!z1e(i))throw new TypeError(U1e("invalid argument. Options argument must be an object. Value: `%s`.",i));i=J1e({},t)}else i={};return i.objectMode=!0,new C1e(r,e,i)}yB.exports=B1e});var _B=s(function(mtr,EB){"use strict";var bB=require("@stdlib/assert/is-plain-object"),wB=require("@stdlib/object/assign"),SB=require("@stdlib/string/format"),OB=Af();function D1e(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!bB(r))throw new TypeError(SB("invalid argument. Options argument must be an object. Value: `%s`.",r));n=wB({},r)}else if(i>2){if(!bB(t))throw new TypeError(SB("invalid argument. Options argument must be an object. Value: `%s`.",t));n=wB({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new OB(v,g,n)}function o(){return new OB(r,e,n)}}EB.exports=D1e});var RB=s(function(htr,LB){"use strict";var NB=require("@stdlib/utils/define-nonenumerable-read-only-property"),Im=Af(),X1e=qB(),Y1e=_B();NB(Im,"objectMode",X1e);NB(Im,"factory",Y1e);LB.exports=Im});var PB=s(function(ptr,H1e){H1e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var MB=s(function(ytr,jB){"use strict";var Z1e=require("@stdlib/assert/is-plain-object"),fr=require("@stdlib/assert/has-own-property"),Q1e=require("@stdlib/assert/is-boolean").isPrimitive,$1e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,TB=require("@stdlib/assert/is-string").isPrimitive,K1e=require("@stdlib/assert/is-positive-integer").isPrimitive,eAe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Fn=require("@stdlib/string/format");function rAe(r,e){return Z1e(e)?fr(e,"sep")&&(r.sep=e.sep,!TB(r.sep))?new TypeError(Fn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):fr(e,"objectMode")&&(r.objectMode=e.objectMode,!Q1e(r.objectMode))?new TypeError(Fn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):fr(e,"encoding")&&(r.encoding=e.encoding,!TB(r.encoding)&&r.encoding!==null)?new TypeError(Fn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):fr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!$1e(r.highWaterMark))?new TypeError(Fn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):fr(e,"iter")&&(r.iter=e.iter,!eAe(r.iter))?new TypeError(Fn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):fr(e,"siter")&&(r.siter=e.siter,!K1e(r.siter))?new TypeError(Fn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(fr(e,"prng")&&(r.prng=e.prng),fr(e,"seed")&&(r.seed=e.seed),fr(e,"state")&&(r.state=e.state),fr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Fn("invalid argument. Options argument must be an object. Value: `%s`.",e))}jB.exports=rAe});var AB=s(function(qtr,xB){"use strict";var tAe=require("debug"),iAe=tAe("random:streams:geometric");xB.exports=iAe});var Vf=s(function(btr,WB){"use strict";var FB=require("readable-stream").Readable,nAe=require("@stdlib/assert/is-probability").isPrimitive,aAe=require("@stdlib/assert/is-error"),sAe=require("@stdlib/object/assign"),uAe=require("@stdlib/utils/inherit"),GB=require("@stdlib/utils/define-nonenumerable-property"),Mi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Gf=require("@stdlib/utils/define-read-only-accessor"),oAe=require("@stdlib/utils/define-read-write-accessor"),vAe=cn().factory,VB=require("@stdlib/buffer/from-string"),gAe=require("@stdlib/utils/next-tick"),fAe=require("@stdlib/string/format"),dAe=PB(),lAe=MB(),ls=AB();function cAe(){return this._prng.seed}function mAe(){return this._prng.seedLength}function hAe(){return this._prng.stateLength}function pAe(){return this._prng.byteLength}function yAe(){return this._prng.state}function qAe(r){this._prng.state=r}function bAe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return ls("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),ls("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=VB(e):e=VB(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function wAe(r){var e;if(this._destroyed)return ls("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,gAe(t),this;function t(){r&&(ls("Stream was destroyed due to an error. Error: %s.",aAe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),ls("Closing the stream..."),e.emit("close")}}function ye(r,e){var t,i;if(!(this instanceof ye))return arguments.length>1?new ye(r,e):new ye(r);if(!nAe(r))throw new TypeError(fAe("invalid argument. First argument must be a probability. Value: `%s`.",r));if(t=sAe({},dAe),arguments.length>1&&(i=lAe(t,e),i))throw i;return ls("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),FB.call(this,t),GB(this,"_destroyed",!1),Mi(this,"_objectMode",t.objectMode),Mi(this,"_sep",t.sep),Mi(this,"_iter",t.iter),Mi(this,"_siter",t.siter),GB(this,"_i",0),Mi(this,"_prng",vAe(r,t)),Mi(this,"PRNG",this._prng.PRNG),this}uAe(ye,FB);Gf(ye.prototype,"seed",cAe);Gf(ye.prototype,"seedLength",mAe);oAe(ye.prototype,"state",yAe,qAe);Gf(ye.prototype,"stateLength",hAe);Gf(ye.prototype,"byteLength",pAe);Mi(ye.prototype,"_read",bAe);Mi(ye.prototype,"destroy",wAe);WB.exports=ye});var kB=s(function(wtr,IB){"use strict";var SAe=require("@stdlib/assert/is-plain-object"),OAe=require("@stdlib/object/assign"),EAe=require("@stdlib/string/format"),_Ae=Vf();function NAe(r,e){var t;if(arguments.length>1){if(t=e,!SAe(t))throw new TypeError(EAe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=OAe({},e)}else t={};return t.objectMode=!0,new _Ae(r,t)}IB.exports=NAe});var DB=s(function(Str,BB){"use strict";var LAe=require("@stdlib/assert/is-probability").isPrimitive,zB=require("@stdlib/assert/is-plain-object"),JB=require("@stdlib/object/assign"),UB=require("@stdlib/string/format"),CB=Vf();function RAe(r,e){var t,i,n;if(t=arguments.length,t>1){if(!zB(e))throw new TypeError(UB("invalid argument. Options argument must be an object. Value: `%s`.",e));n=u,i=JB({},e)}else if(t===1)if(LAe(r))n=u,i={};else{if(!zB(r))throw new TypeError(UB("invalid argument. Options argument must be an object. Value: `%s`.",r));i=JB({},r),n=a}else i={},n=a;return n;function a(o){return new CB(o,i)}function u(){return new CB(r,i)}}BB.exports=RAe});var HB=s(function(Otr,YB){"use strict";var XB=require("@stdlib/utils/define-nonenumerable-read-only-property"),km=Vf(),PAe=kB(),TAe=DB();XB(km,"objectMode",PAe);XB(km,"factory",TAe);YB.exports=km});var ZB=s(function(Etr,jAe){jAe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var KB=s(function(_tr,$B){"use strict";var MAe=require("@stdlib/assert/is-plain-object"),dr=require("@stdlib/assert/has-own-property"),xAe=require("@stdlib/assert/is-boolean").isPrimitive,AAe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,QB=require("@stdlib/assert/is-string").isPrimitive,GAe=require("@stdlib/assert/is-positive-integer").isPrimitive,VAe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Wn=require("@stdlib/string/format");function FAe(r,e){return MAe(e)?dr(e,"sep")&&(r.sep=e.sep,!QB(r.sep))?new TypeError(Wn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):dr(e,"objectMode")&&(r.objectMode=e.objectMode,!xAe(r.objectMode))?new TypeError(Wn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):dr(e,"encoding")&&(r.encoding=e.encoding,!QB(r.encoding)&&r.encoding!==null)?new TypeError(Wn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):dr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!AAe(r.highWaterMark))?new TypeError(Wn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):dr(e,"iter")&&(r.iter=e.iter,!VAe(r.iter))?new TypeError(Wn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):dr(e,"siter")&&(r.siter=e.siter,!GAe(r.siter))?new TypeError(Wn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(dr(e,"prng")&&(r.prng=e.prng),dr(e,"seed")&&(r.seed=e.seed),dr(e,"state")&&(r.state=e.state),dr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Wn("invalid argument. Options argument must be an object. Value: `%s`.",e))}$B.exports=FAe});var r9=s(function(Ntr,e9){"use strict";var WAe=require("debug"),IAe=WAe("random:streams:gumbel");e9.exports=IAe});var Wf=s(function(Ltr,s9){"use strict";var a9=require("readable-stream").Readable,kAe=require("@stdlib/assert/is-positive-number").isPrimitive,zAe=require("@stdlib/assert/is-number").isPrimitive,JAe=require("@stdlib/math/base/assert/is-nan"),UAe=require("@stdlib/assert/is-error"),CAe=require("@stdlib/object/assign"),BAe=require("@stdlib/utils/inherit"),t9=require("@stdlib/utils/define-nonenumerable-property"),xi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ff=require("@stdlib/utils/define-read-only-accessor"),DAe=require("@stdlib/utils/define-read-write-accessor"),XAe=La().factory,i9=require("@stdlib/buffer/from-string"),YAe=require("@stdlib/utils/next-tick"),n9=require("@stdlib/string/format"),HAe=ZB(),ZAe=KB(),cs=r9();function QAe(){return this._prng.seed}function $Ae(){return this._prng.seedLength}function KAe(){return this._prng.stateLength}function eGe(){return this._prng.byteLength}function rGe(){return this._prng.state}function tGe(r){this._prng.state=r}function iGe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return cs("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),cs("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=i9(e):e=i9(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function nGe(r){var e;if(this._destroyed)return cs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,YAe(t),this;function t(){r&&(cs("Stream was destroyed due to an error. Error: %s.",UAe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),cs("Closing the stream..."),e.emit("close")}}function qe(r,e,t){var i,n;if(!(this instanceof qe))return arguments.length>2?new qe(r,e,t):new qe(r,e);if(!zAe(r)||JAe(r))throw new TypeError(n9("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!kAe(e))throw new TypeError(n9("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=CAe({},HAe),arguments.length>2&&(n=ZAe(i,t),n))throw n;return cs("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),a9.call(this,i),t9(this,"_destroyed",!1),xi(this,"_objectMode",i.objectMode),xi(this,"_sep",i.sep),xi(this,"_iter",i.iter),xi(this,"_siter",i.siter),t9(this,"_i",0),xi(this,"_prng",XAe(r,e,i)),xi(this,"PRNG",this._prng.PRNG),this}BAe(qe,a9);Ff(qe.prototype,"seed",QAe);Ff(qe.prototype,"seedLength",$Ae);DAe(qe.prototype,"state",rGe,tGe);Ff(qe.prototype,"stateLength",KAe);Ff(qe.prototype,"byteLength",eGe);xi(qe.prototype,"_read",iGe);xi(qe.prototype,"destroy",nGe);s9.exports=qe});var o9=s(function(Rtr,u9){"use strict";var aGe=require("@stdlib/assert/is-plain-object"),sGe=require("@stdlib/object/assign"),uGe=require("@stdlib/string/format"),oGe=Wf();function vGe(r,e,t){var i;if(arguments.length>2){if(i=t,!aGe(i))throw new TypeError(uGe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=sGe({},t)}else i={};return i.objectMode=!0,new oGe(r,e,i)}u9.exports=vGe});var c9=s(function(Ptr,l9){"use strict";var v9=require("@stdlib/assert/is-plain-object"),g9=require("@stdlib/object/assign"),f9=require("@stdlib/string/format"),d9=Wf();function gGe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!v9(r))throw new TypeError(f9("invalid argument. Options argument must be an object. Value: `%s`.",r));n=g9({},r)}else if(i>2){if(!v9(t))throw new TypeError(f9("invalid argument. Options argument must be an object. Value: `%s`.",t));n=g9({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new d9(v,g,n)}function o(){return new d9(r,e,n)}}l9.exports=gGe});var p9=s(function(Ttr,h9){"use strict";var m9=require("@stdlib/utils/define-nonenumerable-read-only-property"),zm=Wf(),fGe=o9(),dGe=c9();m9(zm,"objectMode",fGe);m9(zm,"factory",dGe);h9.exports=zm});var y9=s(function(jtr,lGe){lGe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var w9=s(function(Mtr,b9){"use strict";var cGe=require("@stdlib/assert/is-plain-object"),lr=require("@stdlib/assert/has-own-property"),mGe=require("@stdlib/assert/is-boolean").isPrimitive,hGe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,q9=require("@stdlib/assert/is-string").isPrimitive,pGe=require("@stdlib/assert/is-positive-integer").isPrimitive,yGe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,In=require("@stdlib/string/format");function qGe(r,e){return cGe(e)?lr(e,"sep")&&(r.sep=e.sep,!q9(r.sep))?new TypeError(In("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):lr(e,"objectMode")&&(r.objectMode=e.objectMode,!mGe(r.objectMode))?new TypeError(In("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):lr(e,"encoding")&&(r.encoding=e.encoding,!q9(r.encoding)&&r.encoding!==null)?new TypeError(In("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):lr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!hGe(r.highWaterMark))?new TypeError(In("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):lr(e,"iter")&&(r.iter=e.iter,!yGe(r.iter))?new TypeError(In("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):lr(e,"siter")&&(r.siter=e.siter,!pGe(r.siter))?new TypeError(In("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(lr(e,"prng")&&(r.prng=e.prng),lr(e,"seed")&&(r.seed=e.seed),lr(e,"state")&&(r.state=e.state),lr(e,"copy")&&(r.copy=e.copy),null):new TypeError(In("invalid argument. Options argument must be an object. Value: `%s`.",e))}b9.exports=qGe});var O9=s(function(xtr,S9){"use strict";var bGe=require("debug"),wGe=bGe("random:streams:hypergeometric");S9.exports=wGe});var kf=s(function(Atr,L9){"use strict";var N9=require("readable-stream").Readable,Jm=require("@stdlib/assert/is-nonnegative-integer"),SGe=require("@stdlib/assert/is-error"),OGe=require("@stdlib/object/assign"),EGe=require("@stdlib/utils/inherit"),E9=require("@stdlib/utils/define-nonenumerable-property"),Ai=require("@stdlib/utils/define-nonenumerable-read-only-property"),If=require("@stdlib/utils/define-read-only-accessor"),_Ge=require("@stdlib/utils/define-read-write-accessor"),NGe=Ra().factory,_9=require("@stdlib/buffer/from-string"),LGe=require("@stdlib/utils/next-tick"),Um=require("@stdlib/string/format"),RGe=y9(),PGe=w9(),ms=O9();function TGe(){return this._prng.seed}function jGe(){return this._prng.seedLength}function MGe(){return this._prng.stateLength}function xGe(){return this._prng.byteLength}function AGe(){return this._prng.state}function GGe(r){this._prng.state=r}function VGe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return ms("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),ms("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=_9(e):e=_9(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function FGe(r){var e;if(this._destroyed)return ms("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,LGe(t),this;function t(){r&&(ms("Stream was destroyed due to an error. Error: %s.",SGe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),ms("Closing the stream..."),e.emit("close")}}function be(r,e,t,i){var n,a;if(!(this instanceof be))return arguments.length>3?new be(r,e,t,i):new be(r,e,t);if(!Jm(r))throw new TypeError(Um("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",r));if(!Jm(e))throw new TypeError(Um("invalid argument. Second argument must be a nonnegative integer. Value: `%s`.",e));if(!Jm(t))throw new TypeError(Um("invalid argument. Third argument must be a nonnegative integer. Value: `%s`.",t));if(t>r)throw new RangeError("invalid argument. Third argument must be less than or equal to the first argument.");if(e>r)throw new RangeError("invalid argument. Second argument must be less than or equal to the first argument.");if(n=OGe({},RGe),arguments.length>3&&(a=PGe(n,i),a))throw a;return ms("Creating a readable stream configured with the following options: %s.",JSON.stringify(n)),N9.call(this,n),E9(this,"_destroyed",!1),Ai(this,"_objectMode",n.objectMode),Ai(this,"_sep",n.sep),Ai(this,"_iter",n.iter),Ai(this,"_siter",n.siter),E9(this,"_i",0),Ai(this,"_prng",NGe(r,e,t,n)),Ai(this,"PRNG",this._prng.PRNG),this}EGe(be,N9);If(be.prototype,"seed",TGe);If(be.prototype,"seedLength",jGe);_Ge(be.prototype,"state",AGe,GGe);If(be.prototype,"stateLength",MGe);If(be.prototype,"byteLength",xGe);Ai(be.prototype,"_read",VGe);Ai(be.prototype,"destroy",FGe);L9.exports=be});var P9=s(function(Gtr,R9){"use strict";var WGe=require("@stdlib/assert/is-plain-object"),IGe=require("@stdlib/object/assign"),kGe=require("@stdlib/string/format"),zGe=kf();function JGe(r,e,t,i){var n;if(arguments.length>3){if(n=i,!WGe(n))throw new TypeError(kGe("invalid argument. Options argument must be an object. Value: `%s`.",n));n=IGe({},i)}else n={};return n.objectMode=!0,new zGe(r,e,t,n)}R9.exports=JGe});var G9=s(function(Vtr,A9){"use strict";var T9=require("@stdlib/assert/is-plain-object"),j9=require("@stdlib/object/assign"),M9=require("@stdlib/string/format"),x9=kf();function UGe(r,e,t,i){var n,a,u;if(n=arguments.length,n===1){if(!T9(r))throw new TypeError(M9("invalid argument. Options argument must be an object. Value: `%s`.",r));a=j9({},r)}else if(n>3){if(!T9(i))throw new TypeError(M9("invalid argument. Options argument must be an object. Value: `%s`.",i));a=j9({},i)}else a={};return n<3?u=o:u=v,u;function o(g,c,l){return new x9(g,c,l,a)}function v(){return new x9(r,e,t,a)}}A9.exports=UGe});var W9=s(function(Ftr,F9){"use strict";var V9=require("@stdlib/utils/define-nonenumerable-read-only-property"),Cm=kf(),CGe=P9(),BGe=G9();V9(Cm,"objectMode",CGe);V9(Cm,"factory",BGe);F9.exports=Cm});var I9=s(function(Wtr,DGe){DGe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var J9=s(function(Itr,z9){"use strict";var XGe=require("@stdlib/assert/is-plain-object"),cr=require("@stdlib/assert/has-own-property"),YGe=require("@stdlib/assert/is-boolean").isPrimitive,HGe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,k9=require("@stdlib/assert/is-string").isPrimitive,ZGe=require("@stdlib/assert/is-positive-integer").isPrimitive,QGe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,kn=require("@stdlib/string/format");function $Ge(r,e){return XGe(e)?cr(e,"sep")&&(r.sep=e.sep,!k9(r.sep))?new TypeError(kn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):cr(e,"objectMode")&&(r.objectMode=e.objectMode,!YGe(r.objectMode))?new TypeError(kn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):cr(e,"encoding")&&(r.encoding=e.encoding,!k9(r.encoding)&&r.encoding!==null)?new TypeError(kn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):cr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!HGe(r.highWaterMark))?new TypeError(kn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):cr(e,"iter")&&(r.iter=e.iter,!QGe(r.iter))?new TypeError(kn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):cr(e,"siter")&&(r.siter=e.siter,!ZGe(r.siter))?new TypeError(kn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(cr(e,"prng")&&(r.prng=e.prng),cr(e,"seed")&&(r.seed=e.seed),cr(e,"state")&&(r.state=e.state),cr(e,"copy")&&(r.copy=e.copy),null):new TypeError(kn("invalid argument. Options argument must be an object. Value: `%s`.",e))}z9.exports=$Ge});var C9=s(function(ktr,U9){"use strict";var KGe=require("debug"),eVe=KGe("random:streams:improved-ziggurat");U9.exports=eVe});var Jf=s(function(ztr,Y9){"use strict";var X9=require("readable-stream").Readable,rVe=require("@stdlib/assert/is-error"),tVe=require("@stdlib/object/assign"),iVe=require("@stdlib/utils/inherit"),B9=require("@stdlib/utils/define-nonenumerable-property"),Gi=require("@stdlib/utils/define-nonenumerable-read-only-property"),zf=require("@stdlib/utils/define-read-only-accessor"),nVe=require("@stdlib/utils/define-read-write-accessor"),aVe=Q().factory,D9=require("@stdlib/buffer/from-string"),sVe=require("@stdlib/utils/next-tick"),uVe=I9(),oVe=J9(),hs=C9();function vVe(){return this._prng.seed}function gVe(){return this._prng.seedLength}function fVe(){return this._prng.stateLength}function dVe(){return this._prng.byteLength}function lVe(){return this._prng.state}function cVe(r){this._prng.state=r}function mVe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return hs("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),hs("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=D9(e):e=D9(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function hVe(r){var e;if(this._destroyed)return hs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,sVe(t),this;function t(){r&&(hs("Stream was destroyed due to an error. Error: %s.",rVe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),hs("Closing the stream..."),e.emit("close")}}function we(r){var e,t;if(!(this instanceof we))return arguments.length>0?new we(r):new we;if(e=tVe({},uVe),arguments.length>0&&(t=oVe(e,r),t))throw t;return hs("Creating a readable stream configured with the following options: %s.",JSON.stringify(e)),X9.call(this,e),B9(this,"_destroyed",!1),Gi(this,"_objectMode",e.objectMode),Gi(this,"_sep",e.sep),Gi(this,"_iter",e.iter),Gi(this,"_siter",e.siter),B9(this,"_i",0),Gi(this,"_prng",aVe(e)),Gi(this,"PRNG",this._prng.PRNG),this}iVe(we,X9);zf(we.prototype,"seed",vVe);zf(we.prototype,"seedLength",gVe);nVe(we.prototype,"state",lVe,cVe);zf(we.prototype,"stateLength",fVe);zf(we.prototype,"byteLength",dVe);Gi(we.prototype,"_read",mVe);Gi(we.prototype,"destroy",hVe);Y9.exports=we});var Z9=s(function(Jtr,H9){"use strict";var pVe=require("@stdlib/assert/is-plain-object"),yVe=require("@stdlib/object/assign"),qVe=require("@stdlib/string/format"),bVe=Jf();function wVe(r){var e;if(arguments.length>0){if(e=r,!pVe(e))throw new TypeError(qVe("invalid argument. Options argument must be an object. Value: `%s`.",e));e=yVe({},r)}else e={};return e.objectMode=!0,new bVe(e)}H9.exports=wVe});var $9=s(function(Utr,Q9){"use strict";var SVe=require("@stdlib/assert/is-plain-object"),OVe=require("@stdlib/object/assign"),EVe=require("@stdlib/string/format"),_Ve=Jf();function NVe(r){var e;if(arguments.length>0){if(!SVe(r))throw new TypeError(EVe("invalid argument. Options argument must be an object. Value: `%s`.",r));e=OVe({},r)}else e={};return t;function t(){return new _Ve(e)}}Q9.exports=NVe});var rD=s(function(Ctr,eD){"use strict";var K9=require("@stdlib/utils/define-nonenumerable-read-only-property"),Bm=Jf(),LVe=Z9(),RVe=$9();K9(Bm,"objectMode",LVe);K9(Bm,"factory",RVe);eD.exports=Bm});var tD=s(function(Btr,PVe){PVe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var aD=s(function(Dtr,nD){"use strict";var TVe=require("@stdlib/assert/is-plain-object"),mr=require("@stdlib/assert/has-own-property"),jVe=require("@stdlib/assert/is-boolean").isPrimitive,MVe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,iD=require("@stdlib/assert/is-string").isPrimitive,xVe=require("@stdlib/assert/is-positive-integer").isPrimitive,AVe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,zn=require("@stdlib/string/format");function GVe(r,e){return TVe(e)?mr(e,"sep")&&(r.sep=e.sep,!iD(r.sep))?new TypeError(zn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):mr(e,"objectMode")&&(r.objectMode=e.objectMode,!jVe(r.objectMode))?new TypeError(zn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):mr(e,"encoding")&&(r.encoding=e.encoding,!iD(r.encoding)&&r.encoding!==null)?new TypeError(zn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):mr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!MVe(r.highWaterMark))?new TypeError(zn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):mr(e,"iter")&&(r.iter=e.iter,!AVe(r.iter))?new TypeError(zn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):mr(e,"siter")&&(r.siter=e.siter,!xVe(r.siter))?new TypeError(zn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(mr(e,"prng")&&(r.prng=e.prng),mr(e,"seed")&&(r.seed=e.seed),mr(e,"state")&&(r.state=e.state),mr(e,"copy")&&(r.copy=e.copy),null):new TypeError(zn("invalid argument. Options argument must be an object. Value: `%s`.",e))}nD.exports=GVe});var uD=s(function(Xtr,sD){"use strict";var VVe=require("debug"),FVe=VVe("random:streams:invgamma");sD.exports=FVe});var Cf=s(function(Ytr,lD){"use strict";var dD=require("readable-stream").Readable,oD=require("@stdlib/assert/is-positive-number").isPrimitive,WVe=require("@stdlib/assert/is-error"),IVe=require("@stdlib/object/assign"),kVe=require("@stdlib/utils/inherit"),vD=require("@stdlib/utils/define-nonenumerable-property"),Vi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Uf=require("@stdlib/utils/define-read-only-accessor"),zVe=require("@stdlib/utils/define-read-write-accessor"),JVe=mn().factory,gD=require("@stdlib/buffer/from-string"),UVe=require("@stdlib/utils/next-tick"),fD=require("@stdlib/string/format"),CVe=tD(),BVe=aD(),ps=uD();function DVe(){return this._prng.seed}function XVe(){return this._prng.seedLength}function YVe(){return this._prng.stateLength}function HVe(){return this._prng.byteLength}function ZVe(){return this._prng.state}function QVe(r){this._prng.state=r}function $Ve(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return ps("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),ps("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=gD(e):e=gD(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function KVe(r){var e;if(this._destroyed)return ps("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,UVe(t),this;function t(){r&&(ps("Stream was destroyed due to an error. Error: %s.",WVe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),ps("Closing the stream..."),e.emit("close")}}function Se(r,e,t){var i,n;if(!(this instanceof Se))return arguments.length>2?new Se(r,e,t):new Se(r,e);if(!oD(r))throw new TypeError(fD("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!oD(e))throw new TypeError(fD("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=IVe({},CVe),arguments.length>2&&(n=BVe(i,t),n))throw n;return ps("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),dD.call(this,i),vD(this,"_destroyed",!1),Vi(this,"_objectMode",i.objectMode),Vi(this,"_sep",i.sep),Vi(this,"_iter",i.iter),Vi(this,"_siter",i.siter),vD(this,"_i",0),Vi(this,"_prng",JVe(r,e,i)),Vi(this,"PRNG",this._prng.PRNG),this}kVe(Se,dD);Uf(Se.prototype,"seed",DVe);Uf(Se.prototype,"seedLength",XVe);zVe(Se.prototype,"state",ZVe,QVe);Uf(Se.prototype,"stateLength",YVe);Uf(Se.prototype,"byteLength",HVe);Vi(Se.prototype,"_read",$Ve);Vi(Se.prototype,"destroy",KVe);lD.exports=Se});var mD=s(function(Htr,cD){"use strict";var e2e=require("@stdlib/assert/is-plain-object"),r2e=require("@stdlib/object/assign"),t2e=require("@stdlib/string/format"),i2e=Cf();function n2e(r,e,t){var i;if(arguments.length>2){if(i=t,!e2e(i))throw new TypeError(t2e("invalid argument. Options argument must be an object. Value: `%s`.",i));i=r2e({},t)}else i={};return i.objectMode=!0,new i2e(r,e,i)}cD.exports=n2e});var wD=s(function(Ztr,bD){"use strict";var hD=require("@stdlib/assert/is-plain-object"),pD=require("@stdlib/object/assign"),yD=require("@stdlib/string/format"),qD=Cf();function a2e(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!hD(r))throw new TypeError(yD("invalid argument. Options argument must be an object. Value: `%s`.",r));n=pD({},r)}else if(i>2){if(!hD(t))throw new TypeError(yD("invalid argument. Options argument must be an object. Value: `%s`.",t));n=pD({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new qD(v,g,n)}function o(){return new qD(r,e,n)}}bD.exports=a2e});var ED=s(function(Qtr,OD){"use strict";var SD=require("@stdlib/utils/define-nonenumerable-read-only-property"),Dm=Cf(),s2e=mD(),u2e=wD();SD(Dm,"objectMode",s2e);SD(Dm,"factory",u2e);OD.exports=Dm});var _D=s(function($tr,o2e){o2e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var RD=s(function(Ktr,LD){"use strict";var v2e=require("@stdlib/assert/is-plain-object"),hr=require("@stdlib/assert/has-own-property"),g2e=require("@stdlib/assert/is-boolean").isPrimitive,f2e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,ND=require("@stdlib/assert/is-string").isPrimitive,d2e=require("@stdlib/assert/is-positive-integer").isPrimitive,l2e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Jn=require("@stdlib/string/format");function c2e(r,e){return v2e(e)?hr(e,"sep")&&(r.sep=e.sep,!ND(r.sep))?new TypeError(Jn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):hr(e,"objectMode")&&(r.objectMode=e.objectMode,!g2e(r.objectMode))?new TypeError(Jn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):hr(e,"encoding")&&(r.encoding=e.encoding,!ND(r.encoding)&&r.encoding!==null)?new TypeError(Jn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):hr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!f2e(r.highWaterMark))?new TypeError(Jn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):hr(e,"iter")&&(r.iter=e.iter,!l2e(r.iter))?new TypeError(Jn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):hr(e,"siter")&&(r.siter=e.siter,!d2e(r.siter))?new TypeError(Jn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(hr(e,"prng")&&(r.prng=e.prng),hr(e,"seed")&&(r.seed=e.seed),hr(e,"state")&&(r.state=e.state),hr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Jn("invalid argument. Options argument must be an object. Value: `%s`.",e))}LD.exports=c2e});var TD=s(function(eir,PD){"use strict";var m2e=require("debug"),h2e=m2e("random:streams:kumaraswamy");PD.exports=h2e});var Df=s(function(rir,VD){"use strict";var GD=require("readable-stream").Readable,jD=require("@stdlib/assert/is-positive-number").isPrimitive,p2e=require("@stdlib/assert/is-error"),y2e=require("@stdlib/object/assign"),q2e=require("@stdlib/utils/inherit"),MD=require("@stdlib/utils/define-nonenumerable-property"),Fi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Bf=require("@stdlib/utils/define-read-only-accessor"),b2e=require("@stdlib/utils/define-read-write-accessor"),w2e=Ta().factory,xD=require("@stdlib/buffer/from-string"),S2e=require("@stdlib/utils/next-tick"),AD=require("@stdlib/string/format"),O2e=_D(),E2e=RD(),ys=TD();function _2e(){return this._prng.seed}function N2e(){return this._prng.seedLength}function L2e(){return this._prng.stateLength}function R2e(){return this._prng.byteLength}function P2e(){return this._prng.state}function T2e(r){this._prng.state=r}function j2e(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return ys("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),ys("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=xD(e):e=xD(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function M2e(r){var e;if(this._destroyed)return ys("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,S2e(t),this;function t(){r&&(ys("Stream was destroyed due to an error. Error: %s.",p2e(r)?r.message:JSON.stringify(r)),e.emit("error",r)),ys("Closing the stream..."),e.emit("close")}}function Oe(r,e,t){var i,n;if(!(this instanceof Oe))return arguments.length>2?new Oe(r,e,t):new Oe(r,e);if(!jD(r))throw new TypeError(AD("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!jD(e))throw new TypeError(AD("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=y2e({},O2e),arguments.length>2&&(n=E2e(i,t),n))throw n;return ys("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),GD.call(this,i),MD(this,"_destroyed",!1),Fi(this,"_objectMode",i.objectMode),Fi(this,"_sep",i.sep),Fi(this,"_iter",i.iter),Fi(this,"_siter",i.siter),MD(this,"_i",0),Fi(this,"_prng",w2e(r,e,i)),Fi(this,"PRNG",this._prng.PRNG),this}q2e(Oe,GD);Bf(Oe.prototype,"seed",_2e);Bf(Oe.prototype,"seedLength",N2e);b2e(Oe.prototype,"state",P2e,T2e);Bf(Oe.prototype,"stateLength",L2e);Bf(Oe.prototype,"byteLength",R2e);Fi(Oe.prototype,"_read",j2e);Fi(Oe.prototype,"destroy",M2e);VD.exports=Oe});var WD=s(function(tir,FD){"use strict";var x2e=require("@stdlib/assert/is-plain-object"),A2e=require("@stdlib/object/assign"),G2e=require("@stdlib/string/format"),V2e=Df();function F2e(r,e,t){var i;if(arguments.length>2){if(i=t,!x2e(i))throw new TypeError(G2e("invalid argument. Options argument must be an object. Value: `%s`.",i));i=A2e({},t)}else i={};return i.objectMode=!0,new V2e(r,e,i)}FD.exports=F2e});var CD=s(function(iir,UD){"use strict";var ID=require("@stdlib/assert/is-plain-object"),kD=require("@stdlib/object/assign"),zD=require("@stdlib/string/format"),JD=Df();function W2e(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!ID(r))throw new TypeError(zD("invalid argument. Options argument must be an object. Value: `%s`.",r));n=kD({},r)}else if(i>2){if(!ID(t))throw new TypeError(zD("invalid argument. Options argument must be an object. Value: `%s`.",t));n=kD({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new JD(v,g,n)}function o(){return new JD(r,e,n)}}UD.exports=W2e});var XD=s(function(nir,DD){"use strict";var BD=require("@stdlib/utils/define-nonenumerable-read-only-property"),Xm=Df(),I2e=WD(),k2e=CD();BD(Xm,"objectMode",I2e);BD(Xm,"factory",k2e);DD.exports=Xm});var YD=s(function(air,z2e){z2e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var QD=s(function(sir,ZD){"use strict";var J2e=require("@stdlib/assert/is-plain-object"),pr=require("@stdlib/assert/has-own-property"),U2e=require("@stdlib/assert/is-boolean").isPrimitive,C2e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,HD=require("@stdlib/assert/is-string").isPrimitive,B2e=require("@stdlib/assert/is-positive-integer").isPrimitive,D2e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Un=require("@stdlib/string/format");function X2e(r,e){return J2e(e)?pr(e,"sep")&&(r.sep=e.sep,!HD(r.sep))?new TypeError(Un("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):pr(e,"objectMode")&&(r.objectMode=e.objectMode,!U2e(r.objectMode))?new TypeError(Un("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):pr(e,"encoding")&&(r.encoding=e.encoding,!HD(r.encoding)&&r.encoding!==null)?new TypeError(Un("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):pr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!C2e(r.highWaterMark))?new TypeError(Un("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):pr(e,"iter")&&(r.iter=e.iter,!D2e(r.iter))?new TypeError(Un("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):pr(e,"siter")&&(r.siter=e.siter,!B2e(r.siter))?new TypeError(Un("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(pr(e,"prng")&&(r.prng=e.prng),pr(e,"seed")&&(r.seed=e.seed),pr(e,"state")&&(r.state=e.state),pr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Un("invalid argument. Options argument must be an object. Value: `%s`.",e))}ZD.exports=X2e});var KD=s(function(uir,$D){"use strict";var Y2e=require("debug"),H2e=Y2e("random:streams:laplace");$D.exports=H2e});var Yf=s(function(oir,n8){"use strict";var i8=require("readable-stream").Readable,Z2e=require("@stdlib/assert/is-positive-number").isPrimitive,Q2e=require("@stdlib/assert/is-number").isPrimitive,$2e=require("@stdlib/math/base/assert/is-nan"),K2e=require("@stdlib/assert/is-error"),eFe=require("@stdlib/object/assign"),rFe=require("@stdlib/utils/inherit"),e8=require("@stdlib/utils/define-nonenumerable-property"),Wi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Xf=require("@stdlib/utils/define-read-only-accessor"),tFe=require("@stdlib/utils/define-read-write-accessor"),iFe=ja().factory,r8=require("@stdlib/buffer/from-string"),t8=require("@stdlib/string/format"),nFe=require("@stdlib/utils/next-tick"),aFe=YD(),sFe=QD(),qs=KD();function uFe(){return this._prng.seed}function oFe(){return this._prng.seedLength}function vFe(){return this._prng.stateLength}function gFe(){return this._prng.byteLength}function fFe(){return this._prng.state}function dFe(r){this._prng.state=r}function lFe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return qs("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),qs("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=r8(e):e=r8(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function cFe(r){var e;if(this._destroyed)return qs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,nFe(t),this;function t(){r&&(qs("Stream was destroyed due to an error. Error: %s.",K2e(r)?r.message:JSON.stringify(r)),e.emit("error",r)),qs("Closing the stream..."),e.emit("close")}}function Ee(r,e,t){var i,n;if(!(this instanceof Ee))return arguments.length>2?new Ee(r,e,t):new Ee(r,e);if(!Q2e(r)||$2e(r))throw new TypeError(t8("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!Z2e(e))throw new TypeError(t8("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=eFe({},aFe),arguments.length>2&&(n=sFe(i,t),n))throw n;return qs("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),i8.call(this,i),e8(this,"_destroyed",!1),Wi(this,"_objectMode",i.objectMode),Wi(this,"_sep",i.sep),Wi(this,"_iter",i.iter),Wi(this,"_siter",i.siter),e8(this,"_i",0),Wi(this,"_prng",iFe(r,e,i)),Wi(this,"PRNG",this._prng.PRNG),this}rFe(Ee,i8);Xf(Ee.prototype,"seed",uFe);Xf(Ee.prototype,"seedLength",oFe);tFe(Ee.prototype,"state",fFe,dFe);Xf(Ee.prototype,"stateLength",vFe);Xf(Ee.prototype,"byteLength",gFe);Wi(Ee.prototype,"_read",lFe);Wi(Ee.prototype,"destroy",cFe);n8.exports=Ee});var s8=s(function(vir,a8){"use strict";var mFe=require("@stdlib/assert/is-plain-object"),hFe=require("@stdlib/object/assign"),pFe=require("@stdlib/string/format"),yFe=Yf();function qFe(r,e,t){var i;if(arguments.length>2){if(i=t,!mFe(i))throw new TypeError(pFe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=hFe({},t)}else i={};return i.objectMode=!0,new yFe(r,e,i)}a8.exports=qFe});var d8=s(function(gir,f8){"use strict";var u8=require("@stdlib/assert/is-plain-object"),o8=require("@stdlib/object/assign"),v8=require("@stdlib/string/format"),g8=Yf();function bFe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!u8(r))throw new TypeError(v8("invalid argument. Options argument must be an object. Value: `%s`.",r));n=o8({},r)}else if(i>2){if(!u8(t))throw new TypeError(v8("invalid argument. Options argument must be an object. Value: `%s`.",t));n=o8({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new g8(v,g,n)}function o(){return new g8(r,e,n)}}f8.exports=bFe});var m8=s(function(fir,c8){"use strict";var l8=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ym=Yf(),wFe=s8(),SFe=d8();l8(Ym,"objectMode",wFe);l8(Ym,"factory",SFe);c8.exports=Ym});var h8=s(function(dir,OFe){OFe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var q8=s(function(lir,y8){"use strict";var EFe=require("@stdlib/assert/is-plain-object"),yr=require("@stdlib/assert/has-own-property"),_Fe=require("@stdlib/assert/is-boolean").isPrimitive,NFe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,p8=require("@stdlib/assert/is-string").isPrimitive,LFe=require("@stdlib/assert/is-positive-integer").isPrimitive,RFe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Cn=require("@stdlib/string/format");function PFe(r,e){return EFe(e)?yr(e,"sep")&&(r.sep=e.sep,!p8(r.sep))?new TypeError(Cn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):yr(e,"objectMode")&&(r.objectMode=e.objectMode,!_Fe(r.objectMode))?new TypeError(Cn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):yr(e,"encoding")&&(r.encoding=e.encoding,!p8(r.encoding)&&r.encoding!==null)?new TypeError(Cn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):yr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!NFe(r.highWaterMark))?new TypeError(Cn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):yr(e,"iter")&&(r.iter=e.iter,!RFe(r.iter))?new TypeError(Cn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):yr(e,"siter")&&(r.siter=e.siter,!LFe(r.siter))?new TypeError(Cn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(yr(e,"prng")&&(r.prng=e.prng),yr(e,"seed")&&(r.seed=e.seed),yr(e,"state")&&(r.state=e.state),yr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Cn("invalid argument. Options argument must be an object. Value: `%s`.",e))}y8.exports=PFe});var w8=s(function(cir,b8){"use strict";var TFe=require("debug"),jFe=TFe("random:streams:levy");b8.exports=jFe});var Zf=s(function(mir,N8){"use strict";var _8=require("readable-stream").Readable,MFe=require("@stdlib/assert/is-positive-number").isPrimitive,xFe=require("@stdlib/assert/is-number").isPrimitive,AFe=require("@stdlib/math/base/assert/is-nan"),GFe=require("@stdlib/assert/is-error"),VFe=require("@stdlib/object/assign"),FFe=require("@stdlib/utils/inherit"),S8=require("@stdlib/utils/define-nonenumerable-property"),Ii=require("@stdlib/utils/define-nonenumerable-read-only-property"),Hf=require("@stdlib/utils/define-read-only-accessor"),WFe=require("@stdlib/utils/define-read-write-accessor"),IFe=Ma().factory,O8=require("@stdlib/buffer/from-string"),kFe=require("@stdlib/utils/next-tick"),E8=require("@stdlib/string/format"),zFe=h8(),JFe=q8(),bs=w8();function UFe(){return this._prng.seed}function CFe(){return this._prng.seedLength}function BFe(){return this._prng.stateLength}function DFe(){return this._prng.byteLength}function XFe(){return this._prng.state}function YFe(r){this._prng.state=r}function HFe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return bs("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),bs("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=O8(e):e=O8(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function ZFe(r){var e;if(this._destroyed)return bs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,kFe(t),this;function t(){r&&(bs("Stream was destroyed due to an error. Error: %s.",GFe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),bs("Closing the stream..."),e.emit("close")}}function _e(r,e,t){var i,n;if(!(this instanceof _e))return arguments.length>2?new _e(r,e,t):new _e(r,e);if(!xFe(r)||AFe(r))throw new TypeError(E8("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!MFe(e))throw new TypeError(E8("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=VFe({},zFe),arguments.length>2&&(n=JFe(i,t),n))throw n;return bs("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),_8.call(this,i),S8(this,"_destroyed",!1),Ii(this,"_objectMode",i.objectMode),Ii(this,"_sep",i.sep),Ii(this,"_iter",i.iter),Ii(this,"_siter",i.siter),S8(this,"_i",0),Ii(this,"_prng",IFe(r,e,i)),Ii(this,"PRNG",this._prng.PRNG),this}FFe(_e,_8);Hf(_e.prototype,"seed",UFe);Hf(_e.prototype,"seedLength",CFe);WFe(_e.prototype,"state",XFe,YFe);Hf(_e.prototype,"stateLength",BFe);Hf(_e.prototype,"byteLength",DFe);Ii(_e.prototype,"_read",HFe);Ii(_e.prototype,"destroy",ZFe);N8.exports=_e});var R8=s(function(hir,L8){"use strict";var QFe=require("@stdlib/assert/is-plain-object"),$Fe=require("@stdlib/object/assign"),KFe=require("@stdlib/string/format"),eWe=Zf();function rWe(r,e,t){var i;if(arguments.length>2){if(i=t,!QFe(i))throw new TypeError(KFe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=$Fe({},t)}else i={};return i.objectMode=!0,new eWe(r,e,i)}L8.exports=rWe});var A8=s(function(pir,x8){"use strict";var P8=require("@stdlib/assert/is-plain-object"),T8=require("@stdlib/object/assign"),j8=require("@stdlib/string/format"),M8=Zf();function tWe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!P8(r))throw new TypeError(j8("invalid argument. Options argument must be an object. Value: `%s`.",r));n=T8({},r)}else if(i>2){if(!P8(t))throw new TypeError(j8("invalid argument. Options argument must be an object. Value: `%s`.",t));n=T8({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new M8(v,g,n)}function o(){return new M8(r,e,n)}}x8.exports=tWe});var F8=s(function(yir,V8){"use strict";var G8=require("@stdlib/utils/define-nonenumerable-read-only-property"),Hm=Zf(),iWe=R8(),nWe=A8();G8(Hm,"objectMode",iWe);G8(Hm,"factory",nWe);V8.exports=Hm});var W8=s(function(qir,aWe){aWe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var z8=s(function(bir,k8){"use strict";var sWe=require("@stdlib/assert/is-plain-object"),qr=require("@stdlib/assert/has-own-property"),uWe=require("@stdlib/assert/is-boolean").isPrimitive,oWe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,I8=require("@stdlib/assert/is-string").isPrimitive,vWe=require("@stdlib/assert/is-positive-integer").isPrimitive,gWe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Bn=require("@stdlib/string/format");function fWe(r,e){return sWe(e)?qr(e,"sep")&&(r.sep=e.sep,!I8(r.sep))?new TypeError(Bn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):qr(e,"objectMode")&&(r.objectMode=e.objectMode,!uWe(r.objectMode))?new TypeError(Bn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):qr(e,"encoding")&&(r.encoding=e.encoding,!I8(r.encoding)&&r.encoding!==null)?new TypeError(Bn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):qr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!oWe(r.highWaterMark))?new TypeError(Bn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):qr(e,"iter")&&(r.iter=e.iter,!gWe(r.iter))?new TypeError(Bn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):qr(e,"siter")&&(r.siter=e.siter,!vWe(r.siter))?new TypeError(Bn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(qr(e,"prng")&&(r.prng=e.prng),qr(e,"seed")&&(r.seed=e.seed),qr(e,"state")&&(r.state=e.state),qr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Bn("invalid argument. Options argument must be an object. Value: `%s`.",e))}k8.exports=fWe});var U8=s(function(wir,J8){"use strict";var dWe=require("debug"),lWe=dWe("random:streams:logistic");J8.exports=lWe});var $f=s(function(Sir,Y8){"use strict";var X8=require("readable-stream").Readable,cWe=require("@stdlib/assert/is-positive-number").isPrimitive,mWe=require("@stdlib/assert/is-number").isPrimitive,hWe=require("@stdlib/math/base/assert/is-nan"),pWe=require("@stdlib/assert/is-error"),yWe=require("@stdlib/object/assign"),qWe=require("@stdlib/utils/inherit"),C8=require("@stdlib/utils/define-nonenumerable-property"),ki=require("@stdlib/utils/define-nonenumerable-read-only-property"),Qf=require("@stdlib/utils/define-read-only-accessor"),bWe=require("@stdlib/utils/define-read-write-accessor"),wWe=xa().factory,B8=require("@stdlib/buffer/from-string"),SWe=require("@stdlib/utils/next-tick"),D8=require("@stdlib/string/format"),OWe=W8(),EWe=z8(),ws=U8();function _We(){return this._prng.seed}function NWe(){return this._prng.seedLength}function LWe(){return this._prng.stateLength}function RWe(){return this._prng.byteLength}function PWe(){return this._prng.state}function TWe(r){this._prng.state=r}function jWe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return ws("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),ws("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=B8(e):e=B8(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function MWe(r){var e;if(this._destroyed)return ws("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,SWe(t),this;function t(){r&&(ws("Stream was destroyed due to an error. Error: %s.",pWe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),ws("Closing the stream..."),e.emit("close")}}function Ne(r,e,t){var i,n;if(!(this instanceof Ne))return arguments.length>2?new Ne(r,e,t):new Ne(r,e);if(!mWe(r)||hWe(r))throw new TypeError(D8("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!cWe(e))throw new TypeError(D8("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=yWe({},OWe),arguments.length>2&&(n=EWe(i,t),n))throw n;return ws("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),X8.call(this,i),C8(this,"_destroyed",!1),ki(this,"_objectMode",i.objectMode),ki(this,"_sep",i.sep),ki(this,"_iter",i.iter),ki(this,"_siter",i.siter),C8(this,"_i",0),ki(this,"_prng",wWe(r,e,i)),ki(this,"PRNG",this._prng.PRNG),this}qWe(Ne,X8);Qf(Ne.prototype,"seed",_We);Qf(Ne.prototype,"seedLength",NWe);bWe(Ne.prototype,"state",PWe,TWe);Qf(Ne.prototype,"stateLength",LWe);Qf(Ne.prototype,"byteLength",RWe);ki(Ne.prototype,"_read",jWe);ki(Ne.prototype,"destroy",MWe);Y8.exports=Ne});var Z8=s(function(Oir,H8){"use strict";var xWe=require("@stdlib/assert/is-plain-object"),AWe=require("@stdlib/object/assign"),GWe=require("@stdlib/string/format"),VWe=$f();function FWe(r,e,t){var i;if(arguments.length>2){if(i=t,!xWe(i))throw new TypeError(GWe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=AWe({},t)}else i={};return i.objectMode=!0,new VWe(r,e,i)}H8.exports=FWe});var tX=s(function(Eir,rX){"use strict";var Q8=require("@stdlib/assert/is-plain-object"),$8=require("@stdlib/object/assign"),K8=require("@stdlib/string/format"),eX=$f();function WWe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!Q8(r))throw new TypeError(K8("invalid argument. Options argument must be an object. Value: `%s`.",r));n=$8({},r)}else if(i>2){if(!Q8(t))throw new TypeError(K8("invalid argument. Options argument must be an object. Value: `%s`.",t));n=$8({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new eX(v,g,n)}function o(){return new eX(r,e,n)}}rX.exports=WWe});var aX=s(function(_ir,nX){"use strict";var iX=require("@stdlib/utils/define-nonenumerable-read-only-property"),Zm=$f(),IWe=Z8(),kWe=tX();iX(Zm,"objectMode",IWe);iX(Zm,"factory",kWe);nX.exports=Zm});var sX=s(function(Nir,zWe){zWe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var vX=s(function(Lir,oX){"use strict";var JWe=require("@stdlib/assert/is-plain-object"),br=require("@stdlib/assert/has-own-property"),UWe=require("@stdlib/assert/is-boolean").isPrimitive,CWe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,uX=require("@stdlib/assert/is-string").isPrimitive,BWe=require("@stdlib/assert/is-positive-integer").isPrimitive,DWe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Dn=require("@stdlib/string/format");function XWe(r,e){return JWe(e)?br(e,"sep")&&(r.sep=e.sep,!uX(r.sep))?new TypeError(Dn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):br(e,"objectMode")&&(r.objectMode=e.objectMode,!UWe(r.objectMode))?new TypeError(Dn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):br(e,"encoding")&&(r.encoding=e.encoding,!uX(r.encoding)&&r.encoding!==null)?new TypeError(Dn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):br(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!CWe(r.highWaterMark))?new TypeError(Dn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):br(e,"iter")&&(r.iter=e.iter,!DWe(r.iter))?new TypeError(Dn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):br(e,"siter")&&(r.siter=e.siter,!BWe(r.siter))?new TypeError(Dn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(br(e,"prng")&&(r.prng=e.prng),br(e,"seed")&&(r.seed=e.seed),br(e,"state")&&(r.state=e.state),br(e,"copy")&&(r.copy=e.copy),null):new TypeError(Dn("invalid argument. Options argument must be an object. Value: `%s`.",e))}oX.exports=XWe});var fX=s(function(Rir,gX){"use strict";var YWe=require("debug"),HWe=YWe("random:streams:lognormal");gX.exports=HWe});var ed=s(function(Pir,hX){"use strict";var mX=require("readable-stream").Readable,ZWe=require("@stdlib/assert/is-positive-number").isPrimitive,QWe=require("@stdlib/assert/is-number").isPrimitive,$We=require("@stdlib/math/base/assert/is-nan"),KWe=require("@stdlib/assert/is-error"),eIe=require("@stdlib/object/assign"),rIe=require("@stdlib/utils/inherit"),dX=require("@stdlib/utils/define-nonenumerable-property"),zi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Kf=require("@stdlib/utils/define-read-only-accessor"),tIe=require("@stdlib/utils/define-read-write-accessor"),iIe=hn().factory,lX=require("@stdlib/buffer/from-string"),nIe=require("@stdlib/utils/next-tick"),cX=require("@stdlib/string/format"),aIe=sX(),sIe=vX(),Ss=fX();function uIe(){return this._prng.seed}function oIe(){return this._prng.seedLength}function vIe(){return this._prng.stateLength}function gIe(){return this._prng.byteLength}function fIe(){return this._prng.state}function dIe(r){this._prng.state=r}function lIe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Ss("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Ss("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=lX(e):e=lX(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function cIe(r){var e;if(this._destroyed)return Ss("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,nIe(t),this;function t(){r&&(Ss("Stream was destroyed due to an error. Error: %s.",KWe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Ss("Closing the stream..."),e.emit("close")}}function Le(r,e,t){var i,n;if(!(this instanceof Le))return arguments.length>2?new Le(r,e,t):new Le(r,e);if(!QWe(r)||$We(r))throw new TypeError(cX("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!ZWe(e))throw new TypeError(cX("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=eIe({},aIe),arguments.length>2&&(n=sIe(i,t),n))throw n;return Ss("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),mX.call(this,i),dX(this,"_destroyed",!1),zi(this,"_objectMode",i.objectMode),zi(this,"_sep",i.sep),zi(this,"_iter",i.iter),zi(this,"_siter",i.siter),dX(this,"_i",0),zi(this,"_prng",iIe(r,e,i)),zi(this,"PRNG",this._prng.PRNG),this}rIe(Le,mX);Kf(Le.prototype,"seed",uIe);Kf(Le.prototype,"seedLength",oIe);tIe(Le.prototype,"state",fIe,dIe);Kf(Le.prototype,"stateLength",vIe);Kf(Le.prototype,"byteLength",gIe);zi(Le.prototype,"_read",lIe);zi(Le.prototype,"destroy",cIe);hX.exports=Le});var yX=s(function(Tir,pX){"use strict";var mIe=require("@stdlib/assert/is-plain-object"),hIe=require("@stdlib/object/assign"),pIe=require("@stdlib/string/format"),yIe=ed();function qIe(r,e,t){var i;if(arguments.length>2){if(i=t,!mIe(i))throw new TypeError(pIe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=hIe({},t)}else i={};return i.objectMode=!0,new yIe(r,e,i)}pX.exports=qIe});var EX=s(function(jir,OX){"use strict";var qX=require("@stdlib/assert/is-plain-object"),bX=require("@stdlib/object/assign"),wX=require("@stdlib/string/format"),SX=ed();function bIe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!qX(r))throw new TypeError(wX("invalid argument. Options argument must be an object. Value: `%s`.",r));n=bX({},r)}else if(i>2){if(!qX(t))throw new TypeError(wX("invalid argument. Options argument must be an object. Value: `%s`.",t));n=bX({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new SX(v,g,n)}function o(){return new SX(r,e,n)}}OX.exports=bIe});var LX=s(function(Mir,NX){"use strict";var _X=require("@stdlib/utils/define-nonenumerable-read-only-property"),Qm=ed(),wIe=yX(),SIe=EX();_X(Qm,"objectMode",wIe);_X(Qm,"factory",SIe);NX.exports=Qm});var RX=s(function(xir,OIe){OIe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308,normalized:!1}});var MX=s(function(Air,jX){"use strict";var EIe=require("@stdlib/assert/is-plain-object"),wr=require("@stdlib/assert/has-own-property"),PX=require("@stdlib/assert/is-boolean").isPrimitive,_Ie=require("@stdlib/assert/is-nonnegative-number").isPrimitive,TX=require("@stdlib/assert/is-string").isPrimitive,NIe=require("@stdlib/assert/is-positive-integer").isPrimitive,LIe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Ji=require("@stdlib/string/format");function RIe(r,e){return EIe(e)?wr(e,"sep")&&(r.sep=e.sep,!TX(r.sep))?new TypeError(Ji("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):wr(e,"objectMode")&&(r.objectMode=e.objectMode,!PX(r.objectMode))?new TypeError(Ji("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):wr(e,"encoding")&&(r.encoding=e.encoding,!TX(r.encoding)&&r.encoding!==null)?new TypeError(Ji("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):wr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!_Ie(r.highWaterMark))?new TypeError(Ji("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):wr(e,"iter")&&(r.iter=e.iter,!LIe(r.iter))?new TypeError(Ji("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):wr(e,"siter")&&(r.siter=e.siter,!NIe(r.siter))?new TypeError(Ji("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):wr(e,"normalized")&&(r.normalized=e.normalized,!PX(r.normalized))?new TypeError(Ji("invalid option. `%s` option must be a boolean. Option: `%s`.","normalized",r.normalized)):(wr(e,"seed")&&(r.seed=e.seed),wr(e,"state")&&(r.state=e.state),wr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Ji("invalid argument. Options argument must be an object. Value: `%s`.",e))}jX.exports=RIe});var AX=s(function(Gir,xX){"use strict";var PIe=require("debug"),TIe=PIe("random:streams:minstd");xX.exports=TIe});var td=s(function(Vir,WX){"use strict";var FX=require("readable-stream").Readable,jIe=require("@stdlib/assert/is-error"),MIe=require("@stdlib/object/assign"),xIe=require("@stdlib/utils/inherit"),GX=require("@stdlib/utils/define-nonenumerable-property"),Xn=require("@stdlib/utils/define-nonenumerable-read-only-property"),rd=require("@stdlib/utils/define-read-only-accessor"),AIe=require("@stdlib/utils/define-read-write-accessor"),GIe=$().factory,VX=require("@stdlib/buffer/from-string"),VIe=require("@stdlib/utils/next-tick"),FIe=RX(),WIe=MX(),Os=AX();function IIe(){return this._prng.seed}function kIe(){return this._prng.seedLength}function zIe(){return this._prng.stateLength}function JIe(){return this._prng.byteLength}function UIe(){return this._prng.state}function CIe(r){this._prng.state=r}function BIe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Os("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Os("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=VX(e):e=VX(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function DIe(r){var e;if(this._destroyed)return Os("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,VIe(t),this;function t(){r&&(Os("Stream was destroyed due to an error. Error: %s.",jIe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Os("Closing the stream..."),e.emit("close")}}function Re(r){var e,t,i;if(!(this instanceof Re))return arguments.length>0?new Re(r):new Re;if(t=MIe({},FIe),arguments.length>0&&(i=WIe(t,r),i))throw i;return Os("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),FX.call(this,t),GX(this,"_destroyed",!1),Xn(this,"_objectMode",t.objectMode),Xn(this,"_sep",t.sep),Xn(this,"_iter",t.iter),Xn(this,"_siter",t.siter),GX(this,"_i",0),e=GIe(t),t.normalized&&(e=e.normalized),Xn(this,"_prng",e),this}xIe(Re,FX);rd(Re.prototype,"seed",IIe);rd(Re.prototype,"seedLength",kIe);AIe(Re.prototype,"state",UIe,CIe);rd(Re.prototype,"stateLength",zIe);rd(Re.prototype,"byteLength",JIe);Xn(Re.prototype,"_read",BIe);Xn(Re.prototype,"destroy",DIe);WX.exports=Re});var kX=s(function(Fir,IX){"use strict";var XIe=require("@stdlib/assert/is-plain-object"),YIe=require("@stdlib/object/assign"),HIe=require("@stdlib/string/format"),ZIe=td();function QIe(r){var e;if(arguments.length>0){if(e=r,!XIe(e))throw new TypeError(HIe("invalid argument. Options argument must be an object. Value: `%s`.",e));e=YIe({},r)}else e={};return e.objectMode=!0,new ZIe(e)}IX.exports=QIe});var JX=s(function(Wir,zX){"use strict";var $Ie=require("@stdlib/assert/is-plain-object"),KIe=require("@stdlib/object/assign"),eke=require("@stdlib/string/format"),rke=td();function tke(r){var e;if(arguments.length>0){if(!$Ie(r))throw new TypeError(eke("invalid argument. Options argument must be an object. Value: `%s`.",r));e=KIe({},r)}else e={};return t;function t(){return new rke(e)}}zX.exports=tke});var BX=s(function(Iir,CX){"use strict";var UX=require("@stdlib/utils/define-nonenumerable-read-only-property"),$m=td(),ike=kX(),nke=JX();UX($m,"objectMode",ike);UX($m,"factory",nke);CX.exports=$m});var DX=s(function(kir,ake){ake.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308,normalized:!1}});var ZX=s(function(zir,HX){"use strict";var ske=require("@stdlib/assert/is-plain-object"),Sr=require("@stdlib/assert/has-own-property"),XX=require("@stdlib/assert/is-boolean").isPrimitive,uke=require("@stdlib/assert/is-nonnegative-number").isPrimitive,YX=require("@stdlib/assert/is-string").isPrimitive,oke=require("@stdlib/assert/is-positive-integer").isPrimitive,vke=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Ui=require("@stdlib/string/format");function gke(r,e){return ske(e)?Sr(e,"sep")&&(r.sep=e.sep,!YX(r.sep))?new TypeError(Ui("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Sr(e,"objectMode")&&(r.objectMode=e.objectMode,!XX(r.objectMode))?new TypeError(Ui("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Sr(e,"encoding")&&(r.encoding=e.encoding,!YX(r.encoding)&&r.encoding!==null)?new TypeError(Ui("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Sr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!uke(r.highWaterMark))?new TypeError(Ui("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Sr(e,"iter")&&(r.iter=e.iter,!vke(r.iter))?new TypeError(Ui("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Sr(e,"siter")&&(r.siter=e.siter,!oke(r.siter))?new TypeError(Ui("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):Sr(e,"normalized")&&(r.normalized=e.normalized,!XX(r.normalized))?new TypeError(Ui("invalid option. `%s` option must be a boolean. Option: `%s`.","normalized",r.normalized)):(Sr(e,"seed")&&(r.seed=e.seed),Sr(e,"state")&&(r.state=e.state),Sr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Ui("invalid argument. Options argument must be an object. Value: `%s`.",e))}HX.exports=gke});var $X=s(function(Jir,QX){"use strict";var fke=require("debug"),dke=fke("random:streams:minstd-shuffle");QX.exports=dke});var nd=s(function(Uir,t7){"use strict";var r7=require("readable-stream").Readable,lke=require("@stdlib/assert/is-error"),cke=require("@stdlib/object/assign"),mke=require("@stdlib/utils/inherit"),KX=require("@stdlib/utils/define-nonenumerable-property"),Yn=require("@stdlib/utils/define-nonenumerable-read-only-property"),id=require("@stdlib/utils/define-read-only-accessor"),hke=require("@stdlib/utils/define-read-write-accessor"),pke=ee().factory,e7=require("@stdlib/buffer/from-string"),yke=require("@stdlib/utils/next-tick"),qke=DX(),bke=ZX(),Es=$X();function wke(){return this._prng.seed}function Ske(){return this._prng.seedLength}function Oke(){return this._prng.stateLength}function Eke(){return this._prng.byteLength}function _ke(){return this._prng.state}function Nke(r){this._prng.state=r}function Lke(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Es("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Es("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=e7(e):e=e7(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function Rke(r){var e;if(this._destroyed)return Es("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,yke(t),this;function t(){r&&(Es("Stream was destroyed due to an error. Error: %s.",lke(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Es("Closing the stream..."),e.emit("close")}}function Pe(r){var e,t,i;if(!(this instanceof Pe))return arguments.length>0?new Pe(r):new Pe;if(t=cke({},qke),arguments.length>0&&(i=bke(t,r),i))throw i;return Es("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),r7.call(this,t),KX(this,"_destroyed",!1),Yn(this,"_objectMode",t.objectMode),Yn(this,"_sep",t.sep),Yn(this,"_iter",t.iter),Yn(this,"_siter",t.siter),KX(this,"_i",0),e=pke(t),t.normalized&&(e=e.normalized),Yn(this,"_prng",e),this}mke(Pe,r7);id(Pe.prototype,"seed",wke);id(Pe.prototype,"seedLength",Ske);hke(Pe.prototype,"state",_ke,Nke);id(Pe.prototype,"stateLength",Oke);id(Pe.prototype,"byteLength",Eke);Yn(Pe.prototype,"_read",Lke);Yn(Pe.prototype,"destroy",Rke);t7.exports=Pe});var n7=s(function(Cir,i7){"use strict";var Pke=require("@stdlib/assert/is-plain-object"),Tke=require("@stdlib/object/assign"),jke=require("@stdlib/string/format"),Mke=nd();function xke(r){var e;if(arguments.length>0){if(e=r,!Pke(e))throw new TypeError(jke("invalid argument. Options argument must be an object. Value: `%s`.",e));e=Tke({},r)}else e={};return e.objectMode=!0,new Mke(e)}i7.exports=xke});var s7=s(function(Bir,a7){"use strict";var Ake=require("@stdlib/assert/is-plain-object"),Gke=require("@stdlib/object/assign"),Vke=require("@stdlib/string/format"),Fke=nd();function Wke(r){var e;if(arguments.length>0){if(!Ake(r))throw new TypeError(Vke("invalid argument. Options argument must be an object. Value: `%s`.",r));e=Gke({},r)}else e={};return t;function t(){return new Fke(e)}}a7.exports=Wke});var v7=s(function(Dir,o7){"use strict";var u7=require("@stdlib/utils/define-nonenumerable-read-only-property"),Km=nd(),Ike=n7(),kke=s7();u7(Km,"objectMode",Ike);u7(Km,"factory",kke);o7.exports=Km});var g7=s(function(Xir,zke){zke.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308,normalized:!1}});var c7=s(function(Yir,l7){"use strict";var Jke=require("@stdlib/assert/is-plain-object"),Or=require("@stdlib/assert/has-own-property"),f7=require("@stdlib/assert/is-boolean").isPrimitive,Uke=require("@stdlib/assert/is-nonnegative-number").isPrimitive,d7=require("@stdlib/assert/is-string").isPrimitive,Cke=require("@stdlib/assert/is-positive-integer").isPrimitive,Bke=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Ci=require("@stdlib/string/format");function Dke(r,e){return Jke(e)?Or(e,"sep")&&(r.sep=e.sep,!d7(r.sep))?new TypeError(Ci("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Or(e,"objectMode")&&(r.objectMode=e.objectMode,!f7(r.objectMode))?new TypeError(Ci("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Or(e,"encoding")&&(r.encoding=e.encoding,!d7(r.encoding)&&r.encoding!==null)?new TypeError(Ci("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Or(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!Uke(r.highWaterMark))?new TypeError(Ci("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Or(e,"iter")&&(r.iter=e.iter,!Bke(r.iter))?new TypeError(Ci("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Or(e,"siter")&&(r.siter=e.siter,!Cke(r.siter))?new TypeError(Ci("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):Or(e,"normalized")&&(r.normalized=e.normalized,!f7(r.normalized))?new TypeError(Ci("invalid option. `%s` option must be a boolean. Option: `%s`.","normalized",r.normalized)):(Or(e,"seed")&&(r.seed=e.seed),Or(e,"state")&&(r.state=e.state),Or(e,"copy")&&(r.copy=e.copy),null):new TypeError(Ci("invalid argument. Options argument must be an object. Value: `%s`.",e))}l7.exports=Dke});var h7=s(function(Hir,m7){"use strict";var Xke=require("debug"),Yke=Xke("random:streams:mt19937");m7.exports=Yke});var sd=s(function(Zir,b7){"use strict";var q7=require("readable-stream").Readable,Hke=require("@stdlib/assert/is-error"),Zke=require("@stdlib/object/assign"),Qke=require("@stdlib/utils/inherit"),p7=require("@stdlib/utils/define-nonenumerable-property"),Hn=require("@stdlib/utils/define-nonenumerable-read-only-property"),ad=require("@stdlib/utils/define-read-only-accessor"),$ke=require("@stdlib/utils/define-read-write-accessor"),Kke=T().factory,y7=require("@stdlib/buffer/from-string"),eze=require("@stdlib/utils/next-tick"),rze=g7(),tze=c7(),_s=h7();function ize(){return this._prng.seed}function nze(){return this._prng.seedLength}function aze(){return this._prng.stateLength}function sze(){return this._prng.byteLength}function uze(){return this._prng.state}function oze(r){this._prng.state=r}function vze(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return _s("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),_s("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=y7(e):e=y7(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function gze(r){var e;if(this._destroyed)return _s("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,eze(t),this;function t(){r&&(_s("Stream was destroyed due to an error. Error: %s.",Hke(r)?r.message:JSON.stringify(r)),e.emit("error",r)),_s("Closing the stream..."),e.emit("close")}}function Te(r){var e,t,i;if(!(this instanceof Te))return arguments.length>0?new Te(r):new Te;if(t=Zke({},rze),arguments.length>0&&(i=tze(t,r),i))throw i;return _s("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),q7.call(this,t),p7(this,"_destroyed",!1),Hn(this,"_objectMode",t.objectMode),Hn(this,"_sep",t.sep),Hn(this,"_iter",t.iter),Hn(this,"_siter",t.siter),p7(this,"_i",0),e=Kke(t),t.normalized&&(e=e.normalized),Hn(this,"_prng",e),this}Qke(Te,q7);ad(Te.prototype,"seed",ize);ad(Te.prototype,"seedLength",nze);$ke(Te.prototype,"state",uze,oze);ad(Te.prototype,"stateLength",aze);ad(Te.prototype,"byteLength",sze);Hn(Te.prototype,"_read",vze);Hn(Te.prototype,"destroy",gze);b7.exports=Te});var S7=s(function(Qir,w7){"use strict";var fze=require("@stdlib/assert/is-plain-object"),dze=require("@stdlib/object/assign"),lze=require("@stdlib/string/format"),cze=sd();function mze(r){var e;if(arguments.length>0){if(e=r,!fze(e))throw new TypeError(lze("invalid argument. Options argument must be an object. Value: `%s`.",e));e=dze({},r)}else e={};return e.objectMode=!0,new cze(e)}w7.exports=mze});var E7=s(function($ir,O7){"use strict";var hze=require("@stdlib/assert/is-plain-object"),pze=require("@stdlib/object/assign"),yze=require("@stdlib/string/format"),qze=sd();function bze(r){var e;if(arguments.length>0){if(!hze(r))throw new TypeError(yze("invalid argument. Options argument must be an object. Value: `%s`.",r));e=pze({},r)}else e={};return t;function t(){return new qze(e)}}O7.exports=bze});var L7=s(function(Kir,N7){"use strict";var _7=require("@stdlib/utils/define-nonenumerable-read-only-property"),eh=sd(),wze=S7(),Sze=E7();_7(eh,"objectMode",wze);_7(eh,"factory",Sze);N7.exports=eh});var R7=s(function(enr,Oze){Oze.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var j7=s(function(rnr,T7){"use strict";var Eze=require("@stdlib/assert/is-plain-object"),Er=require("@stdlib/assert/has-own-property"),_ze=require("@stdlib/assert/is-boolean").isPrimitive,Nze=require("@stdlib/assert/is-nonnegative-number").isPrimitive,P7=require("@stdlib/assert/is-string").isPrimitive,Lze=require("@stdlib/assert/is-positive-integer").isPrimitive,Rze=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Zn=require("@stdlib/string/format");function Pze(r,e){return Eze(e)?Er(e,"sep")&&(r.sep=e.sep,!P7(r.sep))?new TypeError(Zn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Er(e,"objectMode")&&(r.objectMode=e.objectMode,!_ze(r.objectMode))?new TypeError(Zn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Er(e,"encoding")&&(r.encoding=e.encoding,!P7(r.encoding)&&r.encoding!==null)?new TypeError(Zn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Er(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!Nze(r.highWaterMark))?new TypeError(Zn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Er(e,"iter")&&(r.iter=e.iter,!Rze(r.iter))?new TypeError(Zn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Er(e,"siter")&&(r.siter=e.siter,!Lze(r.siter))?new TypeError(Zn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(Er(e,"prng")&&(r.prng=e.prng),Er(e,"seed")&&(r.seed=e.seed),Er(e,"state")&&(r.state=e.state),Er(e,"copy")&&(r.copy=e.copy),null):new TypeError(Zn("invalid argument. Options argument must be an object. Value: `%s`.",e))}T7.exports=Pze});var x7=s(function(tnr,M7){"use strict";var Tze=require("debug"),jze=Tze("random:streams:negative-binomial");M7.exports=jze});var od=s(function(inr,W7){"use strict";var F7=require("readable-stream").Readable,Mze=require("@stdlib/assert/is-positive-number").isPrimitive,xze=require("@stdlib/assert/is-probability").isPrimitive,Aze=require("@stdlib/assert/is-error"),Gze=require("@stdlib/object/assign"),Vze=require("@stdlib/utils/inherit"),A7=require("@stdlib/utils/define-nonenumerable-property"),Bi=require("@stdlib/utils/define-nonenumerable-read-only-property"),ud=require("@stdlib/utils/define-read-only-accessor"),Fze=require("@stdlib/utils/define-read-write-accessor"),Wze=ka().factory,G7=require("@stdlib/buffer/from-string"),Ize=require("@stdlib/utils/next-tick"),V7=require("@stdlib/string/format"),kze=R7(),zze=j7(),Ns=x7();function Jze(){return this._prng.seed}function Uze(){return this._prng.seedLength}function Cze(){return this._prng.stateLength}function Bze(){return this._prng.byteLength}function Dze(){return this._prng.state}function Xze(r){this._prng.state=r}function Yze(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Ns("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Ns("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=G7(e):e=G7(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function Hze(r){var e;if(this._destroyed)return Ns("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,Ize(t),this;function t(){r&&(Ns("Stream was destroyed due to an error. Error: %s.",Aze(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Ns("Closing the stream..."),e.emit("close")}}function je(r,e,t){var i,n;if(!(this instanceof je))return arguments.length>2?new je(r,e,t):new je(r,e);if(!Mze(r))throw new TypeError(V7("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!xze(e))throw new TypeError(V7("invalid argument. Second argument must be a probability. Value: `%s`.",e));if(i=Gze({},kze),arguments.length>2&&(n=zze(i,t),n))throw n;return Ns("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),F7.call(this,i),A7(this,"_destroyed",!1),Bi(this,"_objectMode",i.objectMode),Bi(this,"_sep",i.sep),Bi(this,"_iter",i.iter),Bi(this,"_siter",i.siter),A7(this,"_i",0),Bi(this,"_prng",Wze(r,e,i)),Bi(this,"PRNG",this._prng.PRNG),this}Vze(je,F7);ud(je.prototype,"seed",Jze);ud(je.prototype,"seedLength",Uze);Fze(je.prototype,"state",Dze,Xze);ud(je.prototype,"stateLength",Cze);ud(je.prototype,"byteLength",Bze);Bi(je.prototype,"_read",Yze);Bi(je.prototype,"destroy",Hze);W7.exports=je});var k7=s(function(nnr,I7){"use strict";var Zze=require("@stdlib/assert/is-plain-object"),Qze=require("@stdlib/object/assign"),$ze=require("@stdlib/string/format"),Kze=od();function e3e(r,e,t){var i;if(arguments.length>2){if(i=t,!Zze(i))throw new TypeError($ze("invalid argument. Options argument must be an object. Value: `%s`.",i));i=Qze({},t)}else i={};return i.objectMode=!0,new Kze(r,e,i)}I7.exports=e3e});var D7=s(function(anr,B7){"use strict";var z7=require("@stdlib/assert/is-plain-object"),J7=require("@stdlib/object/assign"),U7=require("@stdlib/string/format"),C7=od();function r3e(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!z7(r))throw new TypeError(U7("invalid argument. Options argument must be an object. Value: `%s`.",r));n=J7({},r)}else if(i>2){if(!z7(t))throw new TypeError(U7("invalid argument. Options argument must be an object. Value: `%s`.",t));n=J7({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new C7(v,g,n)}function o(){return new C7(r,e,n)}}B7.exports=r3e});var H7=s(function(snr,Y7){"use strict";var X7=require("@stdlib/utils/define-nonenumerable-read-only-property"),rh=od(),t3e=k7(),i3e=D7();X7(rh,"objectMode",t3e);X7(rh,"factory",i3e);Y7.exports=rh});var Z7=s(function(unr,n3e){n3e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var K7=s(function(onr,$7){"use strict";var a3e=require("@stdlib/assert/is-plain-object"),_r=require("@stdlib/assert/has-own-property"),s3e=require("@stdlib/assert/is-boolean").isPrimitive,u3e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,Q7=require("@stdlib/assert/is-string").isPrimitive,o3e=require("@stdlib/assert/is-positive-integer").isPrimitive,v3e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Qn=require("@stdlib/string/format");function g3e(r,e){return a3e(e)?_r(e,"sep")&&(r.sep=e.sep,!Q7(r.sep))?new TypeError(Qn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):_r(e,"objectMode")&&(r.objectMode=e.objectMode,!s3e(r.objectMode))?new TypeError(Qn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):_r(e,"encoding")&&(r.encoding=e.encoding,!Q7(r.encoding)&&r.encoding!==null)?new TypeError(Qn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):_r(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!u3e(r.highWaterMark))?new TypeError(Qn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):_r(e,"iter")&&(r.iter=e.iter,!v3e(r.iter))?new TypeError(Qn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):_r(e,"siter")&&(r.siter=e.siter,!o3e(r.siter))?new TypeError(Qn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(_r(e,"prng")&&(r.prng=e.prng),_r(e,"seed")&&(r.seed=e.seed),_r(e,"state")&&(r.state=e.state),_r(e,"copy")&&(r.copy=e.copy),null):new TypeError(Qn("invalid argument. Options argument must be an object. Value: `%s`.",e))}$7.exports=g3e});var r5=s(function(vnr,e5){"use strict";var f3e=require("debug"),d3e=f3e("random:streams:normal");e5.exports=d3e});var gd=s(function(gnr,s5){"use strict";var a5=require("readable-stream").Readable,l3e=require("@stdlib/assert/is-positive-number").isPrimitive,c3e=require("@stdlib/assert/is-number").isPrimitive,m3e=require("@stdlib/math/base/assert/is-nan"),h3e=require("@stdlib/assert/is-error"),p3e=require("@stdlib/object/assign"),y3e=require("@stdlib/utils/inherit"),t5=require("@stdlib/utils/define-nonenumerable-property"),Di=require("@stdlib/utils/define-nonenumerable-read-only-property"),vd=require("@stdlib/utils/define-read-only-accessor"),q3e=require("@stdlib/utils/define-read-write-accessor"),b3e=pn().factory,i5=require("@stdlib/buffer/from-string"),w3e=require("@stdlib/utils/next-tick"),n5=require("@stdlib/string/format"),S3e=Z7(),O3e=K7(),Ls=r5();function E3e(){return this._prng.seed}function _3e(){return this._prng.seedLength}function N3e(){return this._prng.stateLength}function L3e(){return this._prng.byteLength}function R3e(){return this._prng.state}function P3e(r){this._prng.state=r}function T3e(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Ls("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Ls("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=i5(e):e=i5(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function j3e(r){var e;if(this._destroyed)return Ls("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,w3e(t),this;function t(){r&&(Ls("Stream was destroyed due to an error. Error: %s.",h3e(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Ls("Closing the stream..."),e.emit("close")}}function Me(r,e,t){var i,n;if(!(this instanceof Me))return arguments.length>2?new Me(r,e,t):new Me(r,e);if(!c3e(r)||m3e(r))throw new TypeError(n5("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!l3e(e))throw new TypeError(n5("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=p3e({},S3e),arguments.length>2&&(n=O3e(i,t),n))throw n;return Ls("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),a5.call(this,i),t5(this,"_destroyed",!1),Di(this,"_objectMode",i.objectMode),Di(this,"_sep",i.sep),Di(this,"_iter",i.iter),Di(this,"_siter",i.siter),t5(this,"_i",0),Di(this,"_prng",b3e(r,e,i)),Di(this,"PRNG",this._prng.PRNG),this}y3e(Me,a5);vd(Me.prototype,"seed",E3e);vd(Me.prototype,"seedLength",_3e);q3e(Me.prototype,"state",R3e,P3e);vd(Me.prototype,"stateLength",N3e);vd(Me.prototype,"byteLength",L3e);Di(Me.prototype,"_read",T3e);Di(Me.prototype,"destroy",j3e);s5.exports=Me});var o5=s(function(fnr,u5){"use strict";var M3e=require("@stdlib/assert/is-plain-object"),x3e=require("@stdlib/object/assign"),A3e=require("@stdlib/string/format"),G3e=gd();function V3e(r,e,t){var i;if(arguments.length>2){if(i=t,!M3e(i))throw new TypeError(A3e("invalid argument. Options argument must be an object. Value: `%s`.",i));i=x3e({},t)}else i={};return i.objectMode=!0,new G3e(r,e,i)}u5.exports=V3e});var c5=s(function(dnr,l5){"use strict";var v5=require("@stdlib/assert/is-plain-object"),g5=require("@stdlib/object/assign"),f5=require("@stdlib/string/format"),d5=gd();function F3e(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!v5(r))throw new TypeError(f5("invalid argument. Options argument must be an object. Value: `%s`.",r));n=g5({},r)}else if(i>2){if(!v5(t))throw new TypeError(f5("invalid argument. Options argument must be an object. Value: `%s`.",t));n=g5({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new d5(v,g,n)}function o(){return new d5(r,e,n)}}l5.exports=F3e});var p5=s(function(lnr,h5){"use strict";var m5=require("@stdlib/utils/define-nonenumerable-read-only-property"),th=gd(),W3e=o5(),I3e=c5();m5(th,"objectMode",W3e);m5(th,"factory",I3e);h5.exports=th});var y5=s(function(cnr,k3e){k3e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var w5=s(function(mnr,b5){"use strict";var z3e=require("@stdlib/assert/is-plain-object"),Nr=require("@stdlib/assert/has-own-property"),J3e=require("@stdlib/assert/is-boolean").isPrimitive,U3e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,q5=require("@stdlib/assert/is-string").isPrimitive,C3e=require("@stdlib/assert/is-positive-integer").isPrimitive,B3e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,$n=require("@stdlib/string/format");function D3e(r,e){return z3e(e)?Nr(e,"sep")&&(r.sep=e.sep,!q5(r.sep))?new TypeError($n("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Nr(e,"objectMode")&&(r.objectMode=e.objectMode,!J3e(r.objectMode))?new TypeError($n("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Nr(e,"encoding")&&(r.encoding=e.encoding,!q5(r.encoding)&&r.encoding!==null)?new TypeError($n("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Nr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!U3e(r.highWaterMark))?new TypeError($n("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Nr(e,"iter")&&(r.iter=e.iter,!B3e(r.iter))?new TypeError($n("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Nr(e,"siter")&&(r.siter=e.siter,!C3e(r.siter))?new TypeError($n("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(Nr(e,"prng")&&(r.prng=e.prng),Nr(e,"seed")&&(r.seed=e.seed),Nr(e,"state")&&(r.state=e.state),Nr(e,"copy")&&(r.copy=e.copy),null):new TypeError($n("invalid argument. Options argument must be an object. Value: `%s`.",e))}b5.exports=D3e});var O5=s(function(hnr,S5){"use strict";var X3e=require("debug"),Y3e=X3e("random:streams:pareto1");S5.exports=Y3e});var dd=s(function(pnr,P5){"use strict";var R5=require("readable-stream").Readable,E5=require("@stdlib/assert/is-positive-number").isPrimitive,H3e=require("@stdlib/assert/is-error"),Z3e=require("@stdlib/object/assign"),Q3e=require("@stdlib/utils/inherit"),_5=require("@stdlib/utils/define-nonenumerable-property"),Xi=require("@stdlib/utils/define-nonenumerable-read-only-property"),fd=require("@stdlib/utils/define-read-only-accessor"),$3e=require("@stdlib/utils/define-read-write-accessor"),K3e=Ja().factory,N5=require("@stdlib/buffer/from-string"),eJe=require("@stdlib/utils/next-tick"),L5=require("@stdlib/string/format"),rJe=y5(),tJe=w5(),Rs=O5();function iJe(){return this._prng.seed}function nJe(){return this._prng.seedLength}function aJe(){return this._prng.stateLength}function sJe(){return this._prng.byteLength}function uJe(){return this._prng.state}function oJe(r){this._prng.state=r}function vJe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Rs("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Rs("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=N5(e):e=N5(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function gJe(r){var e;if(this._destroyed)return Rs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,eJe(t),this;function t(){r&&(Rs("Stream was destroyed due to an error. Error: %s.",H3e(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Rs("Closing the stream..."),e.emit("close")}}function xe(r,e,t){var i,n;if(!(this instanceof xe))return arguments.length>2?new xe(r,e,t):new xe(r,e);if(!E5(r))throw new TypeError(L5("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!E5(e))throw new TypeError(L5("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=Z3e({},rJe),arguments.length>2&&(n=tJe(i,t),n))throw n;return Rs("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),R5.call(this,i),_5(this,"_destroyed",!1),Xi(this,"_objectMode",i.objectMode),Xi(this,"_sep",i.sep),Xi(this,"_iter",i.iter),Xi(this,"_siter",i.siter),_5(this,"_i",0),Xi(this,"_prng",K3e(r,e,i)),Xi(this,"PRNG",this._prng.PRNG),this}Q3e(xe,R5);fd(xe.prototype,"seed",iJe);fd(xe.prototype,"seedLength",nJe);$3e(xe.prototype,"state",uJe,oJe);fd(xe.prototype,"stateLength",aJe);fd(xe.prototype,"byteLength",sJe);Xi(xe.prototype,"_read",vJe);Xi(xe.prototype,"destroy",gJe);P5.exports=xe});var j5=s(function(ynr,T5){"use strict";var fJe=require("@stdlib/assert/is-plain-object"),dJe=require("@stdlib/object/assign"),lJe=require("@stdlib/string/format"),cJe=dd();function mJe(r,e,t){var i;if(arguments.length>2){if(i=t,!fJe(i))throw new TypeError(lJe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=dJe({},t)}else i={};return i.objectMode=!0,new cJe(r,e,i)}T5.exports=mJe});var F5=s(function(qnr,V5){"use strict";var M5=require("@stdlib/assert/is-plain-object"),x5=require("@stdlib/object/assign"),A5=require("@stdlib/string/format"),G5=dd();function hJe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!M5(r))throw new TypeError(A5("invalid argument. Options argument must be an object. Value: `%s`.",r));n=x5({},r)}else if(i>2){if(!M5(t))throw new TypeError(A5("invalid argument. Options argument must be an object. Value: `%s`.",t));n=x5({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new G5(v,g,n)}function o(){return new G5(r,e,n)}}V5.exports=hJe});var k5=s(function(bnr,I5){"use strict";var W5=require("@stdlib/utils/define-nonenumerable-read-only-property"),ih=dd(),pJe=j5(),yJe=F5();W5(ih,"objectMode",pJe);W5(ih,"factory",yJe);I5.exports=ih});var z5=s(function(wnr,qJe){qJe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var C5=s(function(Snr,U5){"use strict";var bJe=require("@stdlib/assert/is-plain-object"),Lr=require("@stdlib/assert/has-own-property"),wJe=require("@stdlib/assert/is-boolean").isPrimitive,SJe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,J5=require("@stdlib/assert/is-string").isPrimitive,OJe=require("@stdlib/assert/is-positive-integer").isPrimitive,EJe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Kn=require("@stdlib/string/format");function _Je(r,e){return bJe(e)?Lr(e,"sep")&&(r.sep=e.sep,!J5(r.sep))?new TypeError(Kn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Lr(e,"objectMode")&&(r.objectMode=e.objectMode,!wJe(r.objectMode))?new TypeError(Kn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Lr(e,"encoding")&&(r.encoding=e.encoding,!J5(r.encoding)&&r.encoding!==null)?new TypeError(Kn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Lr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!SJe(r.highWaterMark))?new TypeError(Kn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Lr(e,"iter")&&(r.iter=e.iter,!EJe(r.iter))?new TypeError(Kn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Lr(e,"siter")&&(r.siter=e.siter,!OJe(r.siter))?new TypeError(Kn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(Lr(e,"prng")&&(r.prng=e.prng),Lr(e,"seed")&&(r.seed=e.seed),Lr(e,"state")&&(r.state=e.state),Lr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Kn("invalid argument. Options argument must be an object. Value: `%s`.",e))}U5.exports=_Je});var D5=s(function(Onr,B5){"use strict";var NJe=require("debug"),LJe=NJe("random:streams:poisson");B5.exports=LJe});var cd=s(function(Enr,Z5){"use strict";var H5=require("readable-stream").Readable,RJe=require("@stdlib/assert/is-positive-number").isPrimitive,PJe=require("@stdlib/assert/is-error"),TJe=require("@stdlib/object/assign"),jJe=require("@stdlib/utils/inherit"),X5=require("@stdlib/utils/define-nonenumerable-property"),Yi=require("@stdlib/utils/define-nonenumerable-read-only-property"),ld=require("@stdlib/utils/define-read-only-accessor"),MJe=require("@stdlib/utils/define-read-write-accessor"),xJe=Rt().factory,Y5=require("@stdlib/buffer/from-string"),AJe=require("@stdlib/string/format"),GJe=require("@stdlib/utils/next-tick"),VJe=z5(),FJe=C5(),Ps=D5();function WJe(){return this._prng.seed}function IJe(){return this._prng.seedLength}function kJe(){return this._prng.stateLength}function zJe(){return this._prng.byteLength}function JJe(){return this._prng.state}function UJe(r){this._prng.state=r}function CJe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Ps("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Ps("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=Y5(e):e=Y5(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function BJe(r){var e;if(this._destroyed)return Ps("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,GJe(t),this;function t(){r&&(Ps("Stream was destroyed due to an error. Error: %s.",PJe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Ps("Closing the stream..."),e.emit("close")}}function Ae(r,e){var t,i;if(!(this instanceof Ae))return arguments.length>1?new Ae(r,e):new Ae(r);if(!RJe(r))throw new TypeError(AJe("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(t=TJe({},VJe),arguments.length>1&&(i=FJe(t,e),i))throw i;return Ps("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),H5.call(this,t),X5(this,"_destroyed",!1),Yi(this,"_objectMode",t.objectMode),Yi(this,"_sep",t.sep),Yi(this,"_iter",t.iter),Yi(this,"_siter",t.siter),X5(this,"_i",0),Yi(this,"_prng",xJe(r,t)),Yi(this,"PRNG",this._prng.PRNG),this}jJe(Ae,H5);ld(Ae.prototype,"seed",WJe);ld(Ae.prototype,"seedLength",IJe);MJe(Ae.prototype,"state",JJe,UJe);ld(Ae.prototype,"stateLength",kJe);ld(Ae.prototype,"byteLength",zJe);Yi(Ae.prototype,"_read",CJe);Yi(Ae.prototype,"destroy",BJe);Z5.exports=Ae});var $5=s(function(_nr,Q5){"use strict";var DJe=require("@stdlib/assert/is-plain-object"),XJe=require("@stdlib/object/assign"),YJe=require("@stdlib/string/format"),HJe=cd();function ZJe(r,e){var t;if(arguments.length>1){if(t=e,!DJe(t))throw new TypeError(YJe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=XJe({},e)}else t={};return t.objectMode=!0,new HJe(r,t)}Q5.exports=ZJe});var nY=s(function(Nnr,iY){"use strict";var QJe=require("@stdlib/assert/is-positive-number").isPrimitive,K5=require("@stdlib/assert/is-plain-object"),eY=require("@stdlib/object/assign"),rY=require("@stdlib/string/format"),tY=cd();function $Je(r,e){var t,i,n;if(t=arguments.length,t>1){if(!K5(e))throw new TypeError(rY("invalid argument. Options argument must be an object. Value: `%s`.",e));n=u,i=eY({},e)}else if(t===1)if(QJe(r))n=u,i={};else{if(!K5(r))throw new TypeError(rY("invalid argument. Options argument must be an object. Value: `%s`.",r));i=eY({},r),n=a}else i={},n=a;return n;function a(o){return new tY(o,i)}function u(){return new tY(r,i)}}iY.exports=$Je});var uY=s(function(Lnr,sY){"use strict";var aY=require("@stdlib/utils/define-nonenumerable-read-only-property"),nh=cd(),KJe=$5(),eUe=nY();aY(nh,"objectMode",KJe);aY(nh,"factory",eUe);sY.exports=nh});var oY=s(function(Rnr,rUe){rUe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308,name:"mt19937"}});var fY=s(function(Pnr,gY){"use strict";var tUe=require("@stdlib/assert/is-plain-object"),Rr=require("@stdlib/assert/has-own-property"),iUe=require("@stdlib/assert/is-boolean").isPrimitive,nUe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,vY=require("@stdlib/assert/is-string").isPrimitive,aUe=require("@stdlib/assert/is-positive-integer").isPrimitive,sUe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,ea=require("@stdlib/string/format");function uUe(r,e){return tUe(e)?Rr(e,"sep")&&(r.sep=e.sep,!vY(r.sep))?new TypeError(ea("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Rr(e,"objectMode")&&(r.objectMode=e.objectMode,!iUe(r.objectMode))?new TypeError(ea("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Rr(e,"encoding")&&(r.encoding=e.encoding,!vY(r.encoding)&&r.encoding!==null)?new TypeError(ea("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Rr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!nUe(r.highWaterMark))?new TypeError(ea("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Rr(e,"iter")&&(r.iter=e.iter,!sUe(r.iter))?new TypeError(ea("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Rr(e,"siter")&&(r.siter=e.siter,!aUe(r.siter))?new TypeError(ea("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(Rr(e,"name")&&(r.name=e.name),Rr(e,"seed")&&(r.seed=e.seed),Rr(e,"state")&&(r.state=e.state),Rr(e,"copy")&&(r.copy=e.copy),null):new TypeError(ea("invalid argument. Options argument must be an object. Value: `%s`.",e))}gY.exports=uUe});var lY=s(function(Tnr,dY){"use strict";var oUe=require("debug"),vUe=oUe("random:streams:randi");dY.exports=vUe});var hd=s(function(jnr,pY){"use strict";var hY=require("readable-stream").Readable,gUe=require("@stdlib/assert/is-error"),fUe=require("@stdlib/object/assign"),dUe=require("@stdlib/utils/inherit"),cY=require("@stdlib/utils/define-nonenumerable-property"),Hi=require("@stdlib/utils/define-nonenumerable-read-only-property"),md=require("@stdlib/utils/define-read-only-accessor"),lUe=require("@stdlib/utils/define-read-write-accessor"),cUe=pu().factory,mY=require("@stdlib/buffer/from-string"),mUe=require("@stdlib/utils/next-tick"),hUe=oY(),pUe=fY(),Ts=lY();function yUe(){return this._prng.seed}function qUe(){return this._prng.seedLength}function bUe(){return this._prng.stateLength}function wUe(){return this._prng.byteLength}function SUe(){return this._prng.state}function OUe(r){this._prng.state=r}function EUe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Ts("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Ts("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=mY(e):e=mY(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function _Ue(r){var e;if(this._destroyed)return Ts("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,mUe(t),this;function t(){r&&(Ts("Stream was destroyed due to an error. Error: %s.",gUe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Ts("Closing the stream..."),e.emit("close")}}function Ge(r){var e,t;if(!(this instanceof Ge))return arguments.length>0?new Ge(r):new Ge;if(e=fUe({},hUe),arguments.length>0&&(t=pUe(e,r),t))throw t;return Ts("Creating a readable stream configured with the following options: %s.",JSON.stringify(e)),hY.call(this,e),cY(this,"_destroyed",!1),Hi(this,"_objectMode",e.objectMode),Hi(this,"_sep",e.sep),Hi(this,"_iter",e.iter),Hi(this,"_siter",e.siter),cY(this,"_i",0),Hi(this,"_prng",cUe(e)),Hi(this,"PRNG",this._prng.PRNG),this}dUe(Ge,hY);md(Ge.prototype,"seed",yUe);md(Ge.prototype,"seedLength",qUe);lUe(Ge.prototype,"state",SUe,OUe);md(Ge.prototype,"stateLength",bUe);md(Ge.prototype,"byteLength",wUe);Hi(Ge.prototype,"_read",EUe);Hi(Ge.prototype,"destroy",_Ue);pY.exports=Ge});var qY=s(function(Mnr,yY){"use strict";var NUe=require("@stdlib/assert/is-plain-object"),LUe=require("@stdlib/object/assign"),RUe=require("@stdlib/string/format"),PUe=hd();function TUe(r){var e;if(arguments.length>0){if(e=r,!NUe(e))throw new TypeError(RUe("invalid argument. Options argument must be an object. Value: `%s`.",e));e=LUe({},r)}else e={};return e.objectMode=!0,new PUe(e)}yY.exports=TUe});var wY=s(function(xnr,bY){"use strict";var jUe=require("@stdlib/assert/is-plain-object"),MUe=require("@stdlib/object/assign"),xUe=require("@stdlib/string/format"),AUe=hd();function GUe(r){var e;if(arguments.length>0){if(!jUe(r))throw new TypeError(xUe("invalid argument. Options argument must be an object. Value: `%s`.",r));e=MUe({},r)}else e={};return t;function t(){return new AUe(e)}}bY.exports=GUe});var EY=s(function(Anr,OY){"use strict";var SY=require("@stdlib/utils/define-nonenumerable-read-only-property"),ah=hd(),VUe=qY(),FUe=wY();SY(ah,"objectMode",VUe);SY(ah,"factory",FUe);OY.exports=ah});var _Y=s(function(Gnr,WUe){WUe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308,name:"improved-ziggurat"}});var RY=s(function(Vnr,LY){"use strict";var IUe=require("@stdlib/assert/is-plain-object"),De=require("@stdlib/assert/has-own-property"),kUe=require("@stdlib/assert/is-boolean").isPrimitive,zUe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,NY=require("@stdlib/assert/is-string").isPrimitive,JUe=require("@stdlib/assert/is-positive-integer").isPrimitive,UUe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,ra=require("@stdlib/string/format");function CUe(r,e){return IUe(e)?De(e,"sep")&&(r.sep=e.sep,!NY(r.sep))?new TypeError(ra("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):De(e,"objectMode")&&(r.objectMode=e.objectMode,!kUe(r.objectMode))?new TypeError(ra("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):De(e,"encoding")&&(r.encoding=e.encoding,!NY(r.encoding)&&r.encoding!==null)?new TypeError(ra("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):De(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!zUe(r.highWaterMark))?new TypeError(ra("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):De(e,"iter")&&(r.iter=e.iter,!UUe(r.iter))?new TypeError(ra("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):De(e,"siter")&&(r.siter=e.siter,!JUe(r.siter))?new TypeError(ra("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(De(e,"name")&&(r.name=e.name),De(e,"prng")&&(r.prng=e.prng),De(e,"seed")&&(r.seed=e.seed),De(e,"state")&&(r.state=e.state),De(e,"copy")&&(r.copy=e.copy),null):new TypeError(ra("invalid argument. Options argument must be an object. Value: `%s`.",e))}LY.exports=CUe});var TY=s(function(Fnr,PY){"use strict";var BUe=require("debug"),DUe=BUe("random:streams:randn");PY.exports=DUe});var yd=s(function(Wnr,AY){"use strict";var xY=require("readable-stream").Readable,XUe=require("@stdlib/assert/is-error"),YUe=require("@stdlib/object/assign"),HUe=require("@stdlib/utils/inherit"),jY=require("@stdlib/utils/define-nonenumerable-property"),Zi=require("@stdlib/utils/define-nonenumerable-read-only-property"),pd=require("@stdlib/utils/define-read-only-accessor"),ZUe=require("@stdlib/utils/define-read-write-accessor"),QUe=qu().factory,MY=require("@stdlib/buffer/from-string"),$Ue=require("@stdlib/utils/next-tick"),KUe=_Y(),eCe=RY(),js=TY();function rCe(){return this._prng.seed}function tCe(){return this._prng.seedLength}function iCe(){return this._prng.stateLength}function nCe(){return this._prng.byteLength}function aCe(){return this._prng.state}function sCe(r){this._prng.state=r}function uCe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return js("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),js("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=MY(e):e=MY(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function oCe(r){var e;if(this._destroyed)return js("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,$Ue(t),this;function t(){r&&(js("Stream was destroyed due to an error. Error: %s.",XUe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),js("Closing the stream..."),e.emit("close")}}function Ve(r){var e,t;if(!(this instanceof Ve))return arguments.length>0?new Ve(r):new Ve;if(e=YUe({},KUe),arguments.length>0&&(t=eCe(e,r),t))throw t;return js("Creating a readable stream configured with the following options: %s.",JSON.stringify(e)),xY.call(this,e),jY(this,"_destroyed",!1),Zi(this,"_objectMode",e.objectMode),Zi(this,"_sep",e.sep),Zi(this,"_iter",e.iter),Zi(this,"_siter",e.siter),jY(this,"_i",0),Zi(this,"_prng",QUe(e)),Zi(this,"PRNG",this._prng.PRNG),this}HUe(Ve,xY);pd(Ve.prototype,"seed",rCe);pd(Ve.prototype,"seedLength",tCe);ZUe(Ve.prototype,"state",aCe,sCe);pd(Ve.prototype,"stateLength",iCe);pd(Ve.prototype,"byteLength",nCe);Zi(Ve.prototype,"_read",uCe);Zi(Ve.prototype,"destroy",oCe);AY.exports=Ve});var VY=s(function(Inr,GY){"use strict";var vCe=require("@stdlib/assert/is-plain-object"),gCe=require("@stdlib/object/assign"),fCe=require("@stdlib/string/format"),dCe=yd();function lCe(r){var e;if(arguments.length>0){if(e=r,!vCe(e))throw new TypeError(fCe("invalid argument. Options argument must be an object. Value: `%s`.",e));e=gCe({},r)}else e={};return e.objectMode=!0,new dCe(e)}GY.exports=lCe});var WY=s(function(knr,FY){"use strict";var cCe=require("@stdlib/assert/is-plain-object"),mCe=require("@stdlib/object/assign"),hCe=require("@stdlib/string/format"),pCe=yd();function yCe(r){var e;if(arguments.length>0){if(!cCe(r))throw new TypeError(hCe("invalid argument. Options argument must be an object. Value: `%s`.",r));e=mCe({},r)}else e={};return t;function t(){return new pCe(e)}}FY.exports=yCe});var zY=s(function(znr,kY){"use strict";var IY=require("@stdlib/utils/define-nonenumerable-read-only-property"),sh=yd(),qCe=VY(),bCe=WY();IY(sh,"objectMode",qCe);IY(sh,"factory",bCe);kY.exports=sh});var JY=s(function(Jnr,wCe){wCe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308,name:"mt19937"}});var BY=s(function(Unr,CY){"use strict";var SCe=require("@stdlib/assert/is-plain-object"),Pr=require("@stdlib/assert/has-own-property"),OCe=require("@stdlib/assert/is-boolean").isPrimitive,ECe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,UY=require("@stdlib/assert/is-string").isPrimitive,_Ce=require("@stdlib/assert/is-positive-integer").isPrimitive,NCe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,ta=require("@stdlib/string/format");function LCe(r,e){return SCe(e)?Pr(e,"sep")&&(r.sep=e.sep,!UY(r.sep))?new TypeError(ta("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Pr(e,"objectMode")&&(r.objectMode=e.objectMode,!OCe(r.objectMode))?new TypeError(ta("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Pr(e,"encoding")&&(r.encoding=e.encoding,!UY(r.encoding)&&r.encoding!==null)?new TypeError(ta("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Pr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!ECe(r.highWaterMark))?new TypeError(ta("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Pr(e,"iter")&&(r.iter=e.iter,!NCe(r.iter))?new TypeError(ta("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Pr(e,"siter")&&(r.siter=e.siter,!_Ce(r.siter))?new TypeError(ta("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(Pr(e,"name")&&(r.name=e.name),Pr(e,"seed")&&(r.seed=e.seed),Pr(e,"state")&&(r.state=e.state),Pr(e,"copy")&&(r.copy=e.copy),null):new TypeError(ta("invalid argument. Options argument must be an object. Value: `%s`.",e))}CY.exports=LCe});var XY=s(function(Cnr,DY){"use strict";var RCe=require("debug"),PCe=RCe("random:streams:randu");DY.exports=PCe});var bd=s(function(Bnr,QY){"use strict";var ZY=require("readable-stream").Readable,TCe=require("@stdlib/assert/is-error"),jCe=require("@stdlib/object/assign"),MCe=require("@stdlib/utils/inherit"),YY=require("@stdlib/utils/define-nonenumerable-property"),Qi=require("@stdlib/utils/define-nonenumerable-read-only-property"),qd=require("@stdlib/utils/define-read-only-accessor"),xCe=require("@stdlib/utils/define-read-write-accessor"),ACe=jt().factory,HY=require("@stdlib/buffer/from-string"),GCe=require("@stdlib/utils/next-tick"),VCe=JY(),FCe=BY(),Ms=XY();function WCe(){return this._prng.seed}function ICe(){return this._prng.seedLength}function kCe(){return this._prng.stateLength}function zCe(){return this._prng.byteLength}function JCe(){return this._prng.state}function UCe(r){this._prng.state=r}function CCe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Ms("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Ms("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=HY(e):e=HY(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function BCe(r){var e;if(this._destroyed)return Ms("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,GCe(t),this;function t(){r&&(Ms("Stream was destroyed due to an error. Error: %s.",TCe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Ms("Closing the stream..."),e.emit("close")}}function Fe(r){var e,t;if(!(this instanceof Fe))return arguments.length>0?new Fe(r):new Fe;if(e=jCe({},VCe),arguments.length>0&&(t=FCe(e,r),t))throw t;return Ms("Creating a readable stream configured with the following options: %s.",JSON.stringify(e)),ZY.call(this,e),YY(this,"_destroyed",!1),Qi(this,"_objectMode",e.objectMode),Qi(this,"_sep",e.sep),Qi(this,"_iter",e.iter),Qi(this,"_siter",e.siter),YY(this,"_i",0),Qi(this,"_prng",ACe(e)),Qi(this,"PRNG",this._prng.PRNG),this}MCe(Fe,ZY);qd(Fe.prototype,"seed",WCe);qd(Fe.prototype,"seedLength",ICe);xCe(Fe.prototype,"state",JCe,UCe);qd(Fe.prototype,"stateLength",kCe);qd(Fe.prototype,"byteLength",zCe);Qi(Fe.prototype,"_read",CCe);Qi(Fe.prototype,"destroy",BCe);QY.exports=Fe});var KY=s(function(Dnr,$Y){"use strict";var DCe=require("@stdlib/assert/is-plain-object"),XCe=require("@stdlib/object/assign"),YCe=require("@stdlib/string/format"),HCe=bd();function ZCe(r){var e;if(arguments.length>0){if(e=r,!DCe(e))throw new TypeError(YCe("invalid argument. Options argument must be an object. Value: `%s`.",e));e=XCe({},r)}else e={};return e.objectMode=!0,new HCe(e)}$Y.exports=ZCe});var r6=s(function(Xnr,e6){"use strict";var QCe=require("@stdlib/assert/is-plain-object"),$Ce=require("@stdlib/object/assign"),KCe=require("@stdlib/string/format"),eBe=bd();function rBe(r){var e;if(arguments.length>0){if(!QCe(r))throw new TypeError(KCe("invalid argument. Options argument must be an object. Value: `%s`.",r));e=$Ce({},r)}else e={};return t;function t(){return new eBe(e)}}e6.exports=rBe});var n6=s(function(Ynr,i6){"use strict";var t6=require("@stdlib/utils/define-nonenumerable-read-only-property"),uh=bd(),tBe=KY(),iBe=r6();t6(uh,"objectMode",tBe);t6(uh,"factory",iBe);i6.exports=uh});var a6=s(function(Hnr,nBe){nBe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var o6=s(function(Znr,u6){"use strict";var aBe=require("@stdlib/assert/is-plain-object"),Tr=require("@stdlib/assert/has-own-property"),sBe=require("@stdlib/assert/is-boolean").isPrimitive,uBe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,s6=require("@stdlib/assert/is-string").isPrimitive,oBe=require("@stdlib/assert/is-positive-integer").isPrimitive,vBe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,ia=require("@stdlib/string/format");function gBe(r,e){return aBe(e)?Tr(e,"sep")&&(r.sep=e.sep,!s6(r.sep))?new TypeError(ia("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Tr(e,"objectMode")&&(r.objectMode=e.objectMode,!sBe(r.objectMode))?new TypeError(ia("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Tr(e,"encoding")&&(r.encoding=e.encoding,!s6(r.encoding)&&r.encoding!==null)?new TypeError(ia("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Tr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!uBe(r.highWaterMark))?new TypeError(ia("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Tr(e,"iter")&&(r.iter=e.iter,!vBe(r.iter))?new TypeError(ia("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Tr(e,"siter")&&(r.siter=e.siter,!oBe(r.siter))?new TypeError(ia("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(Tr(e,"prng")&&(r.prng=e.prng),Tr(e,"seed")&&(r.seed=e.seed),Tr(e,"state")&&(r.state=e.state),Tr(e,"copy")&&(r.copy=e.copy),null):new TypeError(ia("invalid argument. Options argument must be an object. Value: `%s`.",e))}u6.exports=gBe});var g6=s(function(Qnr,v6){"use strict";var fBe=require("debug"),dBe=fBe("random:streams:rayleigh");v6.exports=dBe});var Sd=s(function($nr,c6){"use strict";var l6=require("readable-stream").Readable,lBe=require("@stdlib/assert/is-positive-number").isPrimitive,cBe=require("@stdlib/assert/is-error"),mBe=require("@stdlib/object/assign"),hBe=require("@stdlib/utils/inherit"),f6=require("@stdlib/utils/define-nonenumerable-property"),$i=require("@stdlib/utils/define-nonenumerable-read-only-property"),wd=require("@stdlib/utils/define-read-only-accessor"),pBe=require("@stdlib/utils/define-read-write-accessor"),yBe=Ua().factory,d6=require("@stdlib/buffer/from-string"),qBe=require("@stdlib/utils/next-tick"),bBe=require("@stdlib/string/format"),wBe=a6(),SBe=o6(),xs=g6();function OBe(){return this._prng.seed}function EBe(){return this._prng.seedLength}function _Be(){return this._prng.stateLength}function NBe(){return this._prng.byteLength}function LBe(){return this._prng.state}function RBe(r){this._prng.state=r}function PBe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return xs("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),xs("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=d6(e):e=d6(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function TBe(r){var e;if(this._destroyed)return xs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,qBe(t),this;function t(){r&&(xs("Stream was destroyed due to an error. Error: %s.",cBe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),xs("Closing the stream..."),e.emit("close")}}function We(r,e){var t,i;if(!(this instanceof We))return arguments.length>1?new We(r,e):new We(r);if(!lBe(r))throw new TypeError(bBe("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(t=mBe({},wBe),arguments.length>1&&(i=SBe(t,e),i))throw i;return xs("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),l6.call(this,t),f6(this,"_destroyed",!1),$i(this,"_objectMode",t.objectMode),$i(this,"_sep",t.sep),$i(this,"_iter",t.iter),$i(this,"_siter",t.siter),f6(this,"_i",0),$i(this,"_prng",yBe(r,t)),$i(this,"PRNG",this._prng.PRNG),this}hBe(We,l6);wd(We.prototype,"seed",OBe);wd(We.prototype,"seedLength",EBe);pBe(We.prototype,"state",LBe,RBe);wd(We.prototype,"stateLength",_Be);wd(We.prototype,"byteLength",NBe);$i(We.prototype,"_read",PBe);$i(We.prototype,"destroy",TBe);c6.exports=We});var h6=s(function(Knr,m6){"use strict";var jBe=require("@stdlib/assert/is-plain-object"),MBe=require("@stdlib/object/assign"),xBe=require("@stdlib/string/format"),ABe=Sd();function GBe(r,e){var t;if(arguments.length>1){if(t=e,!jBe(t))throw new TypeError(xBe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=MBe({},e)}else t={};return t.objectMode=!0,new ABe(r,t)}m6.exports=GBe});var S6=s(function(ear,w6){"use strict";var VBe=require("@stdlib/assert/is-positive-number").isPrimitive,p6=require("@stdlib/assert/is-plain-object"),y6=require("@stdlib/object/assign"),q6=require("@stdlib/string/format"),b6=Sd();function FBe(r,e){var t,i,n;if(t=arguments.length,t>1){if(!p6(e))throw new TypeError(q6("invalid argument. Options argument must be an object. Value: `%s`.",e));n=u,i=y6({},e)}else if(t===1)if(VBe(r))n=u,i={};else{if(!p6(r))throw new TypeError(q6("invalid argument. Options argument must be an object. Value: `%s`.",r));i=y6({},r),n=a}else i={},n=a;return n;function a(o){return new b6(o,i)}function u(){return new b6(r,i)}}w6.exports=FBe});var _6=s(function(rar,E6){"use strict";var O6=require("@stdlib/utils/define-nonenumerable-read-only-property"),oh=Sd(),WBe=h6(),IBe=S6();O6(oh,"objectMode",WBe);O6(oh,"factory",IBe);E6.exports=oh});var N6=s(function(tar,kBe){kBe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var P6=s(function(iar,R6){"use strict";var zBe=require("@stdlib/assert/is-plain-object"),jr=require("@stdlib/assert/has-own-property"),JBe=require("@stdlib/assert/is-boolean").isPrimitive,UBe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,L6=require("@stdlib/assert/is-string").isPrimitive,CBe=require("@stdlib/assert/is-positive-integer").isPrimitive,BBe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,na=require("@stdlib/string/format");function DBe(r,e){return zBe(e)?jr(e,"sep")&&(r.sep=e.sep,!L6(r.sep))?new TypeError(na("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):jr(e,"objectMode")&&(r.objectMode=e.objectMode,!JBe(r.objectMode))?new TypeError(na("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):jr(e,"encoding")&&(r.encoding=e.encoding,!L6(r.encoding)&&r.encoding!==null)?new TypeError(na("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):jr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!UBe(r.highWaterMark))?new TypeError(na("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):jr(e,"iter")&&(r.iter=e.iter,!BBe(r.iter))?new TypeError(na("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):jr(e,"siter")&&(r.siter=e.siter,!CBe(r.siter))?new TypeError(na("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(jr(e,"prng")&&(r.prng=e.prng),jr(e,"seed")&&(r.seed=e.seed),jr(e,"state")&&(r.state=e.state),jr(e,"copy")&&(r.copy=e.copy),null):new TypeError(na("invalid argument. Options argument must be an object. Value: `%s`.",e))}R6.exports=DBe});var j6=s(function(nar,T6){"use strict";var XBe=require("debug"),YBe=XBe("random:streams:t");T6.exports=YBe});var Ed=s(function(aar,G6){"use strict";var A6=require("readable-stream").Readable,HBe=require("@stdlib/assert/is-positive-number").isPrimitive,ZBe=require("@stdlib/assert/is-error"),QBe=require("@stdlib/object/assign"),$Be=require("@stdlib/utils/inherit"),M6=require("@stdlib/utils/define-nonenumerable-property"),Ki=require("@stdlib/utils/define-nonenumerable-read-only-property"),Od=require("@stdlib/utils/define-read-only-accessor"),KBe=require("@stdlib/utils/define-read-write-accessor"),e9e=Da().factory,x6=require("@stdlib/buffer/from-string"),r9e=require("@stdlib/utils/next-tick"),t9e=require("@stdlib/string/format"),i9e=N6(),n9e=P6(),As=j6();function a9e(){return this._prng.seed}function s9e(){return this._prng.seedLength}function u9e(){return this._prng.stateLength}function o9e(){return this._prng.byteLength}function v9e(){return this._prng.state}function g9e(r){this._prng.state=r}function f9e(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return As("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),As("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=x6(e):e=x6(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function d9e(r){var e;if(this._destroyed)return As("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,r9e(t),this;function t(){r&&(As("Stream was destroyed due to an error. Error: %s.",ZBe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),As("Closing the stream..."),e.emit("close")}}function Ie(r,e){var t,i;if(!(this instanceof Ie))return arguments.length>1?new Ie(r,e):new Ie(r);if(!HBe(r))throw new TypeError(t9e("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(t=QBe({},i9e),arguments.length>1&&(i=n9e(t,e),i))throw i;return As("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),A6.call(this,t),M6(this,"_destroyed",!1),Ki(this,"_objectMode",t.objectMode),Ki(this,"_sep",t.sep),Ki(this,"_iter",t.iter),Ki(this,"_siter",t.siter),M6(this,"_i",0),Ki(this,"_prng",e9e(r,t)),Ki(this,"PRNG",this._prng.PRNG),this}$Be(Ie,A6);Od(Ie.prototype,"seed",a9e);Od(Ie.prototype,"seedLength",s9e);KBe(Ie.prototype,"state",v9e,g9e);Od(Ie.prototype,"stateLength",u9e);Od(Ie.prototype,"byteLength",o9e);Ki(Ie.prototype,"_read",f9e);Ki(Ie.prototype,"destroy",d9e);G6.exports=Ie});var F6=s(function(sar,V6){"use strict";var l9e=require("@stdlib/assert/is-plain-object"),c9e=require("@stdlib/object/assign"),m9e=require("@stdlib/string/format"),h9e=Ed();function p9e(r,e){var t;if(arguments.length>1){if(t=e,!l9e(t))throw new TypeError(m9e("invalid argument. Options argument must be an object. Value: `%s`.",t));t=c9e({},e)}else t={};return t.objectMode=!0,new h9e(r,t)}V6.exports=p9e});var U6=s(function(uar,J6){"use strict";var y9e=require("@stdlib/assert/is-positive-number").isPrimitive,W6=require("@stdlib/assert/is-plain-object"),I6=require("@stdlib/object/assign"),k6=require("@stdlib/string/format"),z6=Ed();function q9e(r,e){var t,i,n;if(t=arguments.length,t>1){if(!W6(e))throw new TypeError(k6("invalid argument. Options argument must be an object. Value: `%s`.",e));n=u,i=I6({},e)}else if(t===1)if(y9e(r))n=u,i={};else{if(!W6(r))throw new TypeError(k6("invalid argument. Options argument must be an object. Value: `%s`.",r));i=I6({},r),n=a}else i={},n=a;return n;function a(o){return new z6(o,i)}function u(){return new z6(r,i)}}J6.exports=q9e});var D6=s(function(oar,B6){"use strict";var C6=require("@stdlib/utils/define-nonenumerable-read-only-property"),vh=Ed(),b9e=F6(),w9e=U6();C6(vh,"objectMode",b9e);C6(vh,"factory",w9e);B6.exports=vh});var X6=s(function(gar,S9e){S9e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var Z6=s(function(far,H6){"use strict";var O9e=require("@stdlib/assert/is-plain-object"),Mr=require("@stdlib/assert/has-own-property"),E9e=require("@stdlib/assert/is-boolean").isPrimitive,_9e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,Y6=require("@stdlib/assert/is-string").isPrimitive,N9e=require("@stdlib/assert/is-positive-integer").isPrimitive,L9e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,aa=require("@stdlib/string/format");function R9e(r,e){return O9e(e)?Mr(e,"sep")&&(r.sep=e.sep,!Y6(r.sep))?new TypeError(aa("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Mr(e,"objectMode")&&(r.objectMode=e.objectMode,!E9e(r.objectMode))?new TypeError(aa("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Mr(e,"encoding")&&(r.encoding=e.encoding,!Y6(r.encoding)&&r.encoding!==null)?new TypeError(aa("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Mr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!_9e(r.highWaterMark))?new TypeError(aa("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Mr(e,"iter")&&(r.iter=e.iter,!L9e(r.iter))?new TypeError(aa("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Mr(e,"siter")&&(r.siter=e.siter,!N9e(r.siter))?new TypeError(aa("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(Mr(e,"prng")&&(r.prng=e.prng),Mr(e,"seed")&&(r.seed=e.seed),Mr(e,"state")&&(r.state=e.state),Mr(e,"copy")&&(r.copy=e.copy),null):new TypeError(aa("invalid argument. Options argument must be an object. Value: `%s`.",e))}H6.exports=R9e});var $6=s(function(dar,Q6){"use strict";var P9e=require("debug"),T9e=P9e("random:streams:triangular");Q6.exports=T9e});var Ld=s(function(lar,t4){"use strict";var r4=require("readable-stream").Readable,gh=require("@stdlib/assert/is-number").isPrimitive,fh=require("@stdlib/math/base/assert/is-nan"),j9e=require("@stdlib/assert/is-error"),M9e=require("@stdlib/object/assign"),x9e=require("@stdlib/utils/inherit"),K6=require("@stdlib/utils/define-nonenumerable-property"),en=require("@stdlib/utils/define-nonenumerable-read-only-property"),Nd=require("@stdlib/utils/define-read-only-accessor"),A9e=require("@stdlib/utils/define-read-write-accessor"),G9e=Xa().factory,e4=require("@stdlib/buffer/from-string"),V9e=require("@stdlib/utils/next-tick"),_d=require("@stdlib/string/format"),F9e=X6(),W9e=Z6(),Gs=$6();function I9e(){return this._prng.seed}function k9e(){return this._prng.seedLength}function z9e(){return this._prng.stateLength}function J9e(){return this._prng.byteLength}function U9e(){return this._prng.state}function C9e(r){this._prng.state=r}function B9e(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Gs("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Gs("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=e4(e):e=e4(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function D9e(r){var e;if(this._destroyed)return Gs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,V9e(t),this;function t(){r&&(Gs("Stream was destroyed due to an error. Error: %s.",j9e(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Gs("Closing the stream..."),e.emit("close")}}function ke(r,e,t,i){var n,a;if(!(this instanceof ke))return arguments.length>3?new ke(r,e,t,i):new ke(r,e,t);if(!gh(r)||fh(r))throw new TypeError(_d("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!gh(e)||fh(e))throw new TypeError(_d("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e));if(!gh(t)||fh(t))throw new TypeError(_d("invalid argument. Third argument must be a number and not NaN. Value: `%s`.",t));if(!(r<=t&&t<=e))throw new RangeError(_d("invalid arguments. Parameters must satisfy the following condition: %s. a: `%f`. b: `%f`. c: `%f`.","a <= c <= b",r,e,t));if(n=M9e({},F9e),arguments.length>3&&(a=W9e(n,i),a))throw a;return Gs("Creating a readable stream configured with the following options: %s.",JSON.stringify(n)),r4.call(this,n),K6(this,"_destroyed",!1),en(this,"_objectMode",n.objectMode),en(this,"_sep",n.sep),en(this,"_iter",n.iter),en(this,"_siter",n.siter),K6(this,"_i",0),en(this,"_prng",G9e(r,e,t,n)),en(this,"PRNG",this._prng.PRNG),this}x9e(ke,r4);Nd(ke.prototype,"seed",I9e);Nd(ke.prototype,"seedLength",k9e);A9e(ke.prototype,"state",U9e,C9e);Nd(ke.prototype,"stateLength",z9e);Nd(ke.prototype,"byteLength",J9e);en(ke.prototype,"_read",B9e);en(ke.prototype,"destroy",D9e);t4.exports=ke});var n4=s(function(car,i4){"use strict";var X9e=require("@stdlib/assert/is-plain-object"),Y9e=require("@stdlib/object/assign"),H9e=require("@stdlib/string/format"),Z9e=Ld();function Q9e(r,e,t,i){var n;if(arguments.length>3){if(n=i,!X9e(n))throw new TypeError(H9e("invalid argument. Options argument must be an object. Value: `%s`.",n));n=Y9e({},i)}else n={};return n.objectMode=!0,new Z9e(r,e,t,n)}i4.exports=Q9e});var g4=s(function(mar,v4){"use strict";var a4=require("@stdlib/assert/is-plain-object"),s4=require("@stdlib/object/assign"),u4=require("@stdlib/string/format"),o4=Ld();function $9e(r,e,t,i){var n,a,u;if(n=arguments.length,n===1){if(!a4(r))throw new TypeError(u4("invalid argument. Options argument must be an object. Value: `%s`.",r));a=s4({},r)}else if(n>3){if(!a4(i))throw new TypeError(u4("invalid argument. Options argument must be an object. Value: `%s`.",i));a=s4({},i)}else a={};return n<3?u=o:u=v,u;function o(g,c,l){return new o4(g,c,l,a)}function v(){return new o4(r,e,t,a)}}v4.exports=$9e});var l4=s(function(har,d4){"use strict";var f4=require("@stdlib/utils/define-nonenumerable-read-only-property"),dh=Ld(),K9e=n4(),eDe=g4();f4(dh,"objectMode",K9e);f4(dh,"factory",eDe);d4.exports=dh});var c4=s(function(par,rDe){rDe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var p4=s(function(yar,h4){"use strict";var tDe=require("@stdlib/assert/is-plain-object"),xr=require("@stdlib/assert/has-own-property"),iDe=require("@stdlib/assert/is-boolean").isPrimitive,nDe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,m4=require("@stdlib/assert/is-string").isPrimitive,aDe=require("@stdlib/assert/is-positive-integer").isPrimitive,sDe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,sa=require("@stdlib/string/format");function uDe(r,e){return tDe(e)?xr(e,"sep")&&(r.sep=e.sep,!m4(r.sep))?new TypeError(sa("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):xr(e,"objectMode")&&(r.objectMode=e.objectMode,!iDe(r.objectMode))?new TypeError(sa("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):xr(e,"encoding")&&(r.encoding=e.encoding,!m4(r.encoding)&&r.encoding!==null)?new TypeError(sa("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):xr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!nDe(r.highWaterMark))?new TypeError(sa("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):xr(e,"iter")&&(r.iter=e.iter,!sDe(r.iter))?new TypeError(sa("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):xr(e,"siter")&&(r.siter=e.siter,!aDe(r.siter))?new TypeError(sa("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(xr(e,"prng")&&(r.prng=e.prng),xr(e,"seed")&&(r.seed=e.seed),xr(e,"state")&&(r.state=e.state),xr(e,"copy")&&(r.copy=e.copy),null):new TypeError(sa("invalid argument. Options argument must be an object. Value: `%s`.",e))}h4.exports=uDe});var q4=s(function(qar,y4){"use strict";var oDe=require("debug"),vDe=oDe("random:streams:uniform");y4.exports=vDe});var Pd=s(function(bar,_4){"use strict";var E4=require("readable-stream").Readable,b4=require("@stdlib/assert/is-number").isPrimitive,w4=require("@stdlib/math/base/assert/is-nan"),gDe=require("@stdlib/assert/is-error"),fDe=require("@stdlib/object/assign"),dDe=require("@stdlib/utils/inherit"),S4=require("@stdlib/utils/define-nonenumerable-property"),rn=require("@stdlib/utils/define-nonenumerable-read-only-property"),Rd=require("@stdlib/utils/define-read-only-accessor"),lDe=require("@stdlib/utils/define-read-write-accessor"),cDe=yn().factory,O4=require("@stdlib/buffer/from-string"),mDe=require("@stdlib/utils/next-tick"),lh=require("@stdlib/string/format"),hDe=c4(),pDe=p4(),Vs=q4();function yDe(){return this._prng.seed}function qDe(){return this._prng.seedLength}function bDe(){return this._prng.stateLength}function wDe(){return this._prng.byteLength}function SDe(){return this._prng.state}function ODe(r){this._prng.state=r}function EDe(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Vs("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Vs("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=O4(e):e=O4(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function _De(r){var e;if(this._destroyed)return Vs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,mDe(t),this;function t(){r&&(Vs("Stream was destroyed due to an error. Error: %s.",gDe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Vs("Closing the stream..."),e.emit("close")}}function ze(r,e,t){var i,n;if(!(this instanceof ze))return arguments.length>2?new ze(r,e,t):new ze(r,e);if(!b4(r)||w4(r))throw new TypeError(lh("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!b4(e)||w4(e))throw new TypeError(lh("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e));if(r>=e)throw new RangeError(lh("invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.",r,e));if(i=fDe({},hDe),arguments.length>2&&(n=pDe(i,t),n))throw n;return Vs("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),E4.call(this,i),S4(this,"_destroyed",!1),rn(this,"_objectMode",i.objectMode),rn(this,"_sep",i.sep),rn(this,"_iter",i.iter),rn(this,"_siter",i.siter),S4(this,"_i",0),rn(this,"_prng",cDe(r,e,i)),rn(this,"PRNG",this._prng.PRNG),this}dDe(ze,E4);Rd(ze.prototype,"seed",yDe);Rd(ze.prototype,"seedLength",qDe);lDe(ze.prototype,"state",SDe,ODe);Rd(ze.prototype,"stateLength",bDe);Rd(ze.prototype,"byteLength",wDe);rn(ze.prototype,"_read",EDe);rn(ze.prototype,"destroy",_De);_4.exports=ze});var L4=s(function(war,N4){"use strict";var NDe=require("@stdlib/assert/is-plain-object"),LDe=require("@stdlib/object/assign"),RDe=require("@stdlib/string/format"),PDe=Pd();function TDe(r,e,t){var i;if(arguments.length>2){if(i=t,!NDe(i))throw new TypeError(RDe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=LDe({},t)}else i={};return i.objectMode=!0,new PDe(r,e,i)}N4.exports=TDe});var x4=s(function(Sar,M4){"use strict";var R4=require("@stdlib/assert/is-plain-object"),P4=require("@stdlib/object/assign"),T4=require("@stdlib/string/format"),j4=Pd();function jDe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!R4(r))throw new TypeError(T4("invalid argument. Options argument must be an object. Value: `%s`.",r));n=P4({},r)}else if(i>2){if(!R4(t))throw new TypeError(T4("invalid argument. Options argument must be an object. Value: `%s`.",t));n=P4({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new j4(v,g,n)}function o(){return new j4(r,e,n)}}M4.exports=jDe});var V4=s(function(Oar,G4){"use strict";var A4=require("@stdlib/utils/define-nonenumerable-read-only-property"),ch=Pd(),MDe=L4(),xDe=x4();A4(ch,"objectMode",MDe);A4(ch,"factory",xDe);G4.exports=ch});var F4=s(function(Ear,ADe){ADe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var k4=s(function(_ar,I4){"use strict";var GDe=require("@stdlib/assert/is-plain-object"),Ar=require("@stdlib/assert/has-own-property"),VDe=require("@stdlib/assert/is-boolean").isPrimitive,FDe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,W4=require("@stdlib/assert/is-string").isPrimitive,WDe=require("@stdlib/assert/is-positive-integer").isPrimitive,IDe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,ua=require("@stdlib/string/format");function kDe(r,e){return GDe(e)?Ar(e,"sep")&&(r.sep=e.sep,!W4(r.sep))?new TypeError(ua("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Ar(e,"objectMode")&&(r.objectMode=e.objectMode,!VDe(r.objectMode))?new TypeError(ua("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Ar(e,"encoding")&&(r.encoding=e.encoding,!W4(r.encoding)&&r.encoding!==null)?new TypeError(ua("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Ar(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!FDe(r.highWaterMark))?new TypeError(ua("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Ar(e,"iter")&&(r.iter=e.iter,!IDe(r.iter))?new TypeError(ua("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Ar(e,"siter")&&(r.siter=e.siter,!WDe(r.siter))?new TypeError(ua("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(Ar(e,"prng")&&(r.prng=e.prng),Ar(e,"seed")&&(r.seed=e.seed),Ar(e,"state")&&(r.state=e.state),Ar(e,"copy")&&(r.copy=e.copy),null):new TypeError(ua("invalid argument. Options argument must be an object. Value: `%s`.",e))}I4.exports=kDe});var J4=s(function(Nar,z4){"use strict";var zDe=require("debug"),JDe=zDe("random:streams:weibull");z4.exports=JDe});var jd=s(function(Lar,Y4){"use strict";var X4=require("readable-stream").Readable,U4=require("@stdlib/assert/is-positive-number").isPrimitive,UDe=require("@stdlib/assert/is-error"),CDe=require("@stdlib/object/assign"),BDe=require("@stdlib/utils/inherit"),C4=require("@stdlib/utils/define-nonenumerable-property"),tn=require("@stdlib/utils/define-nonenumerable-read-only-property"),Td=require("@stdlib/utils/define-read-only-accessor"),DDe=require("@stdlib/utils/define-read-write-accessor"),XDe=qn().factory,B4=require("@stdlib/buffer/from-string"),D4=require("@stdlib/string/format"),YDe=require("@stdlib/utils/next-tick"),HDe=F4(),ZDe=k4(),Fs=J4();function QDe(){return this._prng.seed}function $De(){return this._prng.seedLength}function KDe(){return this._prng.stateLength}function e8e(){return this._prng.byteLength}function r8e(){return this._prng.state}function t8e(r){this._prng.state=r}function i8e(){var r,e;if(!this._destroyed)for(r=!0;r;){if(this._i+=1,this._i>this._iter)return Fs("Finished generating pseudorandom numbers."),this.push(null);e=this._prng(),Fs("Generated a new pseudorandom number. Value: %d. Iter: %d.",e,this._i),this._objectMode===!1&&(e=e.toString(),this._i===1?e=B4(e):e=B4(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function n8e(r){var e;if(this._destroyed)return Fs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,YDe(t),this;function t(){r&&(Fs("Stream was destroyed due to an error. Error: %s.",UDe(r)?r.message:JSON.stringify(r)),e.emit("error",r)),Fs("Closing the stream..."),e.emit("close")}}function Je(r,e,t){var i,n;if(!(this instanceof Je))return arguments.length>2?new Je(r,e,t):new Je(r,e);if(!U4(r))throw new TypeError(D4("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!U4(e))throw new TypeError(D4("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=CDe({},HDe),arguments.length>2&&(n=ZDe(i,t),n))throw n;return Fs("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),X4.call(this,i),C4(this,"_destroyed",!1),tn(this,"_objectMode",i.objectMode),tn(this,"_sep",i.sep),tn(this,"_iter",i.iter),tn(this,"_siter",i.siter),C4(this,"_i",0),tn(this,"_prng",XDe(r,e,i)),tn(this,"PRNG",this._prng.PRNG),this}BDe(Je,X4);Td(Je.prototype,"seed",QDe);Td(Je.prototype,"seedLength",$De);DDe(Je.prototype,"state",r8e,t8e);Td(Je.prototype,"stateLength",KDe);Td(Je.prototype,"byteLength",e8e);tn(Je.prototype,"_read",i8e);tn(Je.prototype,"destroy",n8e);Y4.exports=Je});var Z4=s(function(Rar,H4){"use strict";var a8e=require("@stdlib/assert/is-plain-object"),s8e=require("@stdlib/object/assign"),u8e=require("@stdlib/string/format"),o8e=jd();function v8e(r,e,t){var i;if(arguments.length>2){if(i=t,!a8e(i))throw new TypeError(u8e("invalid argument. Options argument must be an object. Value: `%s`.",i));i=s8e({},t)}else i={};return i.objectMode=!0,new o8e(r,e,i)}H4.exports=v8e});var tH=s(function(Par,rH){"use strict";var Q4=require("@stdlib/assert/is-plain-object"),$4=require("@stdlib/object/assign"),K4=require("@stdlib/string/format"),eH=jd();function g8e(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!Q4(r))throw new TypeError(K4("invalid argument. Options argument must be an object. Value: `%s`.",r));n=$4({},r)}else if(i>2){if(!Q4(t))throw new TypeError(K4("invalid argument. Options argument must be an object. Value: `%s`.",t));n=$4({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new eH(v,g,n)}function o(){return new eH(r,e,n)}}rH.exports=g8e});var aH=s(function(Tar,nH){"use strict";var iH=require("@stdlib/utils/define-nonenumerable-read-only-property"),mh=jd(),f8e=Z4(),d8e=tH();iH(mh,"objectMode",f8e);iH(mh,"factory",d8e);nH.exports=mh});var uH=s(function(jar,sH){"use strict";var P=require("@stdlib/utils/define-read-only-property"),L={};P(L,"arcsine",Lk());P(L,"bernoulli",Yk());P(L,"beta",pz());P(L,"betaprime",kz());P(L,"binomial",o3());P(L,"boxMuller",_3());P(L,"cauchy",X3());P(L,"chi",cJ());P(L,"chisquare",GJ());P(L,"cosine",iU());P(L,"discreteUniform",_U());P(L,"erlang",XU());P(L,"exponential",cC());P(L,"f",FC());P(L,"frechet",aB());P(L,"gamma",RB());P(L,"geometric",HB());P(L,"gumbel",p9());P(L,"hypergeometric",W9());P(L,"improvedZiggurat",rD());P(L,"invgamma",ED());P(L,"kumaraswamy",XD());P(L,"laplace",m8());P(L,"levy",F8());P(L,"logistic",aX());P(L,"lognormal",LX());P(L,"minstd",BX());P(L,"minstdShuffle",v7());P(L,"mt19937",L7());P(L,"negativeBinomial",H7());P(L,"normal",p5());P(L,"pareto1",k5());P(L,"poisson",uY());P(L,"randi",EY());P(L,"randn",zY());P(L,"randu",n6());P(L,"rayleigh",_6());P(L,"t",D6());P(L,"triangular",l4());P(L,"uniform",V4());P(L,"weibull",aH());sH.exports=L});var ph=s(function(Mar,vH){"use strict";var oH=require("@stdlib/array/base/assert/is-accessor-array"),hh=an();function l8e(r,e,t,i,n,a,u,o){var v,g,c;if(v={arity:0,fcn:null},u){if(e===0&&n===0)return oH(r)?g=r.get(t):g=r[t],oH(i)?c=i.get(a):c=i[a],v.fcn=hh.factory(g,c,o),v;v.fcn=hh.factory(o)}else v.fcn=hh;return v.arity+=2,v}vH.exports=l8e});var fH=s(function(xar,gH){"use strict";var c8e=require("@stdlib/strided/base/nullary"),m8e=require("@stdlib/strided/base/binary"),h8e=ph();function p8e(r,e,t,i,n,a,u,o){var v=h8e(e,t,0,i,n,0,arguments.length>7,o);return v.arity===0?(c8e([a],[r],[u],v.fcn),a):(m8e([e,i,a],[r],[t,n,u],v.fcn),a)}gH.exports=p8e});var lH=s(function(Aar,dH){"use strict";var y8e=require("@stdlib/strided/base/nullary").ndarray,q8e=require("@stdlib/strided/base/binary").ndarray,b8e=ph();function w8e(r,e,t,i,n,a,u,o,v,g,c){var l=b8e(e,t,i,n,a,u,arguments.length>10,c);return l.arity===0?(y8e([o],[r],[v],[g],l.fcn),o):(q8e([e,n,o],[r],[t,a,v],[i,u,g],l.fcn),o)}dH.exports=w8e});var hH=s(function(Gar,mH){"use strict";var S8e=require("@stdlib/utils/define-nonenumerable-read-only-property"),cH=fH(),O8e=lH();S8e(cH,"ndarray",O8e);mH.exports=cH});var bH=s(function(Var,qH){"use strict";var pH=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Md=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Ws=require("@stdlib/utils/define-nonenumerable-read-only-property"),E8e=require("@stdlib/assert/is-function"),_8e=require("@stdlib/assert/is-method-in"),N8e=require("@stdlib/assert/is-plain-object"),L8e=require("@stdlib/utils/constant-function"),R8e=require("@stdlib/utils/noop"),yH=require("@stdlib/strided/base/unary"),yh=require("@stdlib/string/format");function P8e(r){if(!E8e(r))throw new TypeError(yh("invalid argument. First argument must be a function. Value: `%s`.",r));if(!_8e(r,"factory"))throw new TypeError(yh("invalid argument. First argument must have a `%s` method.","factory"));return e;function e(){var t,i;if(arguments.length>0){if(i=arguments[0],!N8e(i))throw new TypeError(yh("invalid argument. Options argument must be an object. Value: `%s`.",i));t=r.factory(i)}else i={},t=r;return i&&i.prng?(Ws(n,"seed",null),Ws(n,"seedLength",null),pH(n,"state",L8e(null),R8e),Ws(n,"stateLength",null),Ws(n,"byteLength",null)):(Md(n,"seed",u),Md(n,"seedLength",o),pH(n,"state",c,l),Md(n,"stateLength",v),Md(n,"byteLength",g)),Ws(n,"PRNG",t.PRNG),Ws(n,"ndarray",a),n;function n(m,h,p,d,f){return yH([h,d],[m],[p,f],t),d}function a(m,h,p,d,f,y,q){return yH.ndarray([h,f],[m],[p,y],[d,q],t),f}function u(){return n.PRNG.seed}function o(){return n.PRNG.seedLength}function v(){return n.PRNG.stateLength}function g(){return n.PRNG.byteLength}function c(){return n.PRNG.state}function l(m){n.PRNG.state=m}}}qH.exports=P8e});var oa=s(function(Far,wH){"use strict";var T8e=bH();wH.exports=T8e});var qh=s(function(War,SH){"use strict";var j8e=oa(),M8e=sn(),x8e=j8e(M8e);SH.exports=x8e});var EH=s(function(Iar,OH){"use strict";var A8e=qh(),G8e=A8e();OH.exports=G8e});var LH=s(function(kar,NH){"use strict";var V8e=require("@stdlib/utils/define-nonenumerable-read-only-property"),_H=EH(),F8e=qh();V8e(_H,"factory",F8e);NH.exports=_H});var wh=s(function(zar,PH){"use strict";var RH=require("@stdlib/array/base/assert/is-accessor-array"),bh=on();function W8e(r,e,t,i,n,a,u,o){var v,g,c;if(v={arity:0,fcn:null},u){if(e===0&&n===0)return RH(r)?g=r.get(t):g=r[t],RH(i)?c=i.get(a):c=i[a],v.fcn=bh.factory(g,c,o),v;v.fcn=bh.factory(o)}else v.fcn=bh;return v.arity+=2,v}PH.exports=W8e});var jH=s(function(Jar,TH){"use strict";var I8e=require("@stdlib/strided/base/nullary"),k8e=require("@stdlib/strided/base/binary"),z8e=wh();function J8e(r,e,t,i,n,a,u,o){var v=z8e(e,t,0,i,n,0,arguments.length>7,o);return v.arity===0?(I8e([a],[r],[u],v.fcn),a):(k8e([e,i,a],[r],[t,n,u],v.fcn),a)}TH.exports=J8e});var xH=s(function(Uar,MH){"use strict";var U8e=require("@stdlib/strided/base/nullary").ndarray,C8e=require("@stdlib/strided/base/binary").ndarray,B8e=wh();function D8e(r,e,t,i,n,a,u,o,v,g,c){var l=B8e(e,t,i,n,a,u,arguments.length>10,c);return l.arity===0?(U8e([o],[r],[v],[g],l.fcn),o):(C8e([e,n,o],[r],[t,a,v],[i,u,g],l.fcn),o)}MH.exports=D8e});var VH=s(function(Car,GH){"use strict";var X8e=require("@stdlib/utils/define-nonenumerable-read-only-property"),AH=jH(),Y8e=xH();X8e(AH,"ndarray",Y8e);GH.exports=AH});var Oh=s(function(Bar,WH){"use strict";var FH=require("@stdlib/array/base/assert/is-accessor-array"),Sh=vn();function H8e(r,e,t,i,n,a,u,o){var v,g,c;if(v={arity:0,fcn:null},u){if(e===0&&n===0)return FH(r)?g=r.get(t):g=r[t],FH(i)?c=i.get(a):c=i[a],v.fcn=Sh.factory(g,c,o),v;v.fcn=Sh.factory(o)}else v.fcn=Sh;return v.arity+=2,v}WH.exports=H8e});var kH=s(function(Dar,IH){"use strict";var Z8e=require("@stdlib/strided/base/nullary"),Q8e=require("@stdlib/strided/base/binary"),$8e=Oh();function K8e(r,e,t,i,n,a,u,o){var v=$8e(e,t,0,i,n,0,arguments.length>7,o);return v.arity===0?(Z8e([a],[r],[u],v.fcn),a):(Q8e([e,i,a],[r],[t,n,u],v.fcn),a)}IH.exports=K8e});var JH=s(function(Xar,zH){"use strict";var eXe=require("@stdlib/strided/base/nullary").ndarray,rXe=require("@stdlib/strided/base/binary").ndarray,tXe=Oh();function iXe(r,e,t,i,n,a,u,o,v,g,c){var l=tXe(e,t,i,n,a,u,arguments.length>10,c);return l.arity===0?(eXe([o],[r],[v],[g],l.fcn),o):(rXe([e,n,o],[r],[t,a,v],[i,u,g],l.fcn),o)}zH.exports=iXe});var BH=s(function(Yar,CH){"use strict";var nXe=require("@stdlib/utils/define-nonenumerable-read-only-property"),UH=kH(),aXe=JH();nXe(UH,"ndarray",aXe);CH.exports=UH});var Eh=s(function(Har,DH){"use strict";var sXe=oa(),uXe=gn(),oXe=sXe(uXe);DH.exports=oXe});var YH=s(function(Zar,XH){"use strict";var vXe=Eh(),gXe=vXe();XH.exports=gXe});var QH=s(function(Qar,ZH){"use strict";var fXe=require("@stdlib/utils/define-nonenumerable-read-only-property"),HH=YH(),dXe=Eh();fXe(HH,"factory",dXe);ZH.exports=HH});var _h=s(function($ar,$H){"use strict";var lXe=oa(),cXe=Xe(),mXe=lXe(cXe);$H.exports=mXe});var eZ=s(function(Kar,KH){"use strict";var hXe=_h(),pXe=hXe();KH.exports=pXe});var iZ=s(function(esr,tZ){"use strict";var yXe=require("@stdlib/utils/define-nonenumerable-read-only-property"),rZ=eZ(),qXe=_h();yXe(rZ,"factory",qXe);tZ.exports=rZ});var Lh=s(function(rsr,aZ){"use strict";var nZ=require("@stdlib/array/base/assert/is-accessor-array"),Nh=fn();function bXe(r,e,t,i,n,a,u,o){var v,g,c;if(v={arity:0,fcn:null},u){if(e===0&&n===0)return nZ(r)?g=r.get(t):g=r[t],nZ(i)?c=i.get(a):c=i[a],v.fcn=Nh.factory(g,c,o),v;v.fcn=Nh.factory(o)}else v.fcn=Nh;return v.arity+=2,v}aZ.exports=bXe});var uZ=s(function(tsr,sZ){"use strict";var wXe=require("@stdlib/strided/base/nullary"),SXe=require("@stdlib/strided/base/binary"),OXe=Lh();function EXe(r,e,t,i,n,a,u,o){var v=OXe(e,t,0,i,n,0,arguments.length>7,o);return v.arity===0?(wXe([a],[r],[u],v.fcn),a):(SXe([e,i,a],[r],[t,n,u],v.fcn),a)}sZ.exports=EXe});var vZ=s(function(isr,oZ){"use strict";var _Xe=require("@stdlib/strided/base/nullary").ndarray,NXe=require("@stdlib/strided/base/binary").ndarray,LXe=Lh();function RXe(r,e,t,i,n,a,u,o,v,g,c){var l=LXe(e,t,i,n,a,u,arguments.length>10,c);return l.arity===0?(_Xe([o],[r],[v],[g],l.fcn),o):(NXe([e,n,o],[r],[t,a,v],[i,u,g],l.fcn),o)}oZ.exports=RXe});var dZ=s(function(nsr,fZ){"use strict";var PXe=require("@stdlib/utils/define-nonenumerable-read-only-property"),gZ=uZ(),TXe=vZ();PXe(gZ,"ndarray",TXe);fZ.exports=gZ});var Ph=s(function(asr,cZ){"use strict";var lZ=require("@stdlib/array/base/assert/is-accessor-array"),Rh=dn();function jXe(r,e,t,i,n,a,u,o){var v,g,c;if(v={arity:0,fcn:null},u){if(e===0&&n===0)return lZ(r)?g=r.get(t):g=r[t],lZ(i)?c=i.get(a):c=i[a],v.fcn=Rh.factory(g,c,o),v;v.fcn=Rh.factory(o)}else v.fcn=Rh;return v.arity+=2,v}cZ.exports=jXe});var hZ=s(function(ssr,mZ){"use strict";var MXe=require("@stdlib/strided/base/nullary"),xXe=require("@stdlib/strided/base/binary"),AXe=Ph();function GXe(r,e,t,i,n,a,u,o){var v=AXe(e,t,0,i,n,0,arguments.length>7,o);return v.arity===0?(MXe([a],[r],[u],v.fcn),a):(xXe([e,i,a],[r],[t,n,u],v.fcn),a)}mZ.exports=GXe});var yZ=s(function(usr,pZ){"use strict";var VXe=require("@stdlib/strided/base/nullary").ndarray,FXe=require("@stdlib/strided/base/binary").ndarray,WXe=Ph();function IXe(r,e,t,i,n,a,u,o,v,g,c){var l=WXe(e,t,i,n,a,u,arguments.length>10,c);return l.arity===0?(VXe([o],[r],[v],[g],l.fcn),o):(FXe([e,n,o],[r],[t,a,v],[i,u,g],l.fcn),o)}pZ.exports=IXe});var wZ=s(function(osr,bZ){"use strict";var kXe=require("@stdlib/utils/define-nonenumerable-read-only-property"),qZ=hZ(),zXe=yZ();kXe(qZ,"ndarray",zXe);bZ.exports=qZ});var Th=s(function(vsr,SZ){"use strict";var JXe=oa(),UXe=ln(),CXe=JXe(UXe);SZ.exports=CXe});var EZ=s(function(gsr,OZ){"use strict";var BXe=Th(),DXe=BXe();OZ.exports=DXe});var LZ=s(function(fsr,NZ){"use strict";var XXe=require("@stdlib/utils/define-nonenumerable-read-only-property"),_Z=EZ(),YXe=Th();XXe(_Z,"factory",YXe);NZ.exports=_Z});var Mh=s(function(dsr,PZ){"use strict";var RZ=require("@stdlib/array/base/assert/is-accessor-array"),jh=Ce();function HXe(r,e,t,i,n,a,u,o){var v,g,c;if(v={arity:0,fcn:null},u){if(e===0&&n===0)return RZ(r)?g=r.get(t):g=r[t],RZ(i)?c=i.get(a):c=i[a],v.fcn=jh.factory(g,c,o),v;v.fcn=jh.factory(o)}else v.fcn=jh;return v.arity+=2,v}PZ.exports=HXe});var jZ=s(function(lsr,TZ){"use strict";var ZXe=require("@stdlib/strided/base/nullary"),QXe=require("@stdlib/strided/base/binary"),$Xe=Mh();function KXe(r,e,t,i,n,a,u,o){var v=$Xe(e,t,0,i,n,0,arguments.length>7,o);return v.arity===0?(ZXe([a],[r],[u],v.fcn),a):(QXe([e,i,a],[r],[t,n,u],v.fcn),a)}TZ.exports=KXe});var xZ=s(function(csr,MZ){"use strict";var e7e=require("@stdlib/strided/base/nullary").ndarray,r7e=require("@stdlib/strided/base/binary").ndarray,t7e=Mh();function i7e(r,e,t,i,n,a,u,o,v,g,c){var l=t7e(e,t,i,n,a,u,arguments.length>10,c);return l.arity===0?(e7e([o],[r],[v],[g],l.fcn),o):(r7e([e,n,o],[r],[t,a,v],[i,u,g],l.fcn),o)}MZ.exports=i7e});var VZ=s(function(msr,GZ){"use strict";var n7e=require("@stdlib/utils/define-nonenumerable-read-only-property"),AZ=jZ(),a7e=xZ();n7e(AZ,"ndarray",a7e);GZ.exports=AZ});var xh=s(function(hsr,FZ){"use strict";var s7e=oa(),u7e=cn(),o7e=s7e(u7e);FZ.exports=o7e});var IZ=s(function(psr,WZ){"use strict";var v7e=xh(),g7e=v7e();WZ.exports=g7e});var JZ=s(function(ysr,zZ){"use strict";var f7e=require("@stdlib/utils/define-nonenumerable-read-only-property"),kZ=IZ(),d7e=xh();f7e(kZ,"factory",d7e);zZ.exports=kZ});var Gh=s(function(qsr,CZ){"use strict";var UZ=require("@stdlib/array/base/assert/is-accessor-array"),Ah=mn();function l7e(r,e,t,i,n,a,u,o){var v,g,c;if(v={arity:0,fcn:null},u){if(e===0&&n===0)return UZ(r)?g=r.get(t):g=r[t],UZ(i)?c=i.get(a):c=i[a],v.fcn=Ah.factory(g,c,o),v;v.fcn=Ah.factory(o)}else v.fcn=Ah;return v.arity+=2,v}CZ.exports=l7e});var DZ=s(function(bsr,BZ){"use strict";var c7e=require("@stdlib/strided/base/nullary"),m7e=require("@stdlib/strided/base/binary"),h7e=Gh();function p7e(r,e,t,i,n,a,u,o){var v=h7e(e,t,0,i,n,0,arguments.length>7,o);return v.arity===0?(c7e([a],[r],[u],v.fcn),a):(m7e([e,i,a],[r],[t,n,u],v.fcn),a)}BZ.exports=p7e});var YZ=s(function(wsr,XZ){"use strict";var y7e=require("@stdlib/strided/base/nullary").ndarray,q7e=require("@stdlib/strided/base/binary").ndarray,b7e=Gh();function w7e(r,e,t,i,n,a,u,o,v,g,c){var l=b7e(e,t,i,n,a,u,arguments.length>10,c);return l.arity===0?(y7e([o],[r],[v],[g],l.fcn),o):(q7e([e,n,o],[r],[t,a,v],[i,u,g],l.fcn),o)}XZ.exports=w7e});var QZ=s(function(Ssr,ZZ){"use strict";var S7e=require("@stdlib/utils/define-nonenumerable-read-only-property"),HZ=DZ(),O7e=YZ();S7e(HZ,"ndarray",O7e);ZZ.exports=HZ});var Fh=s(function(Osr,KZ){"use strict";var $Z=require("@stdlib/array/base/assert/is-accessor-array"),Vh=hn();function E7e(r,e,t,i,n,a,u,o){var v,g,c;if(v={arity:0,fcn:null},u){if(e===0&&n===0)return $Z(r)?g=r.get(t):g=r[t],$Z(i)?c=i.get(a):c=i[a],v.fcn=Vh.factory(g,c,o),v;v.fcn=Vh.factory(o)}else v.fcn=Vh;return v.arity+=2,v}KZ.exports=E7e});var rQ=s(function(Esr,eQ){"use strict";var _7e=require("@stdlib/strided/base/nullary"),N7e=require("@stdlib/strided/base/binary"),L7e=Fh();function R7e(r,e,t,i,n,a,u,o){var v=L7e(e,t,0,i,n,0,arguments.length>7,o);return v.arity===0?(_7e([a],[r],[u],v.fcn),a):(N7e([e,i,a],[r],[t,n,u],v.fcn),a)}eQ.exports=R7e});var iQ=s(function(_sr,tQ){"use strict";var P7e=require("@stdlib/strided/base/nullary").ndarray,T7e=require("@stdlib/strided/base/binary").ndarray,j7e=Fh();function M7e(r,e,t,i,n,a,u,o,v,g,c){var l=j7e(e,t,i,n,a,u,arguments.length>10,c);return l.arity===0?(P7e([o],[r],[v],[g],l.fcn),o):(T7e([e,n,o],[r],[t,a,v],[i,u,g],l.fcn),o)}tQ.exports=M7e});var sQ=s(function(Nsr,aQ){"use strict";var x7e=require("@stdlib/utils/define-nonenumerable-read-only-property"),nQ=rQ(),A7e=iQ();x7e(nQ,"ndarray",A7e);aQ.exports=nQ});var vQ=s(function(Lsr,oQ){"use strict";var G7e=require("@stdlib/strided/base/nullary"),uQ=$();function V7e(r,e,t,i){var n;return arguments.length>3?n=uQ.factory(i):n=uQ,G7e([e],[r],[t],n),e}oQ.exports=V7e});var dQ=s(function(Rsr,fQ){"use strict";var F7e=require("@stdlib/strided/base/nullary").ndarray,gQ=$();function W7e(r,e,t,i,n){var a;return arguments.length>4?a=gQ.factory(n):a=gQ,F7e([e],[r],[t],[i],a),e}fQ.exports=W7e});var mQ=s(function(Psr,cQ){"use strict";var I7e=require("@stdlib/strided/base/nullary"),lQ=$();function k7e(r,e,t,i){var n;return arguments.length>3?n=lQ.factory(i):n=lQ,I7e([e],[r],[t],n.normalized),e}cQ.exports=k7e});var yQ=s(function(Tsr,pQ){"use strict";var z7e=require("@stdlib/strided/base/nullary").ndarray,hQ=$();function J7e(r,e,t,i,n){var a;return arguments.length>4?a=hQ.factory(n):a=hQ,z7e([e],[r],[t],[i],a.normalized),e}pQ.exports=J7e});var wQ=s(function(jsr,bQ){"use strict";var Wh=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ih=vQ(),U7e=dQ(),qQ=mQ(),C7e=yQ();Wh(Ih,"ndarray",U7e);Wh(Ih,"normalized",qQ);Wh(qQ,"ndarray",C7e);bQ.exports=Ih});var EQ=s(function(Msr,OQ){"use strict";var B7e=require("@stdlib/strided/base/nullary"),SQ=ee();function D7e(r,e,t,i){var n;return arguments.length>3?n=SQ.factory(i):n=SQ,B7e([e],[r],[t],n),e}OQ.exports=D7e});var LQ=s(function(xsr,NQ){"use strict";var X7e=require("@stdlib/strided/base/nullary").ndarray,_Q=ee();function Y7e(r,e,t,i,n){var a;return arguments.length>4?a=_Q.factory(n):a=_Q,X7e([e],[r],[t],[i],a),e}NQ.exports=Y7e});var TQ=s(function(Asr,PQ){"use strict";var H7e=require("@stdlib/strided/base/nullary"),RQ=ee();function Z7e(r,e,t,i){var n;return arguments.length>3?n=RQ.factory(i):n=RQ,H7e([e],[r],[t],n.normalized),e}PQ.exports=Z7e});var xQ=s(function(Gsr,MQ){"use strict";var Q7e=require("@stdlib/strided/base/nullary").ndarray,jQ=ee();function $7e(r,e,t,i,n){var a;return arguments.length>4?a=jQ.factory(n):a=jQ,Q7e([e],[r],[t],[i],a.normalized),e}MQ.exports=$7e});var VQ=s(function(Vsr,GQ){"use strict";var kh=require("@stdlib/utils/define-nonenumerable-read-only-property"),zh=EQ(),K7e=LQ(),AQ=TQ(),e5e=xQ();kh(zh,"ndarray",K7e);kh(zh,"normalized",AQ);kh(AQ,"ndarray",e5e);GQ.exports=zh});var IQ=s(function(Fsr,WQ){"use strict";var r5e=require("@stdlib/strided/base/nullary"),FQ=T();function t5e(r,e,t,i){var n;return arguments.length>3?n=FQ.factory(i):n=FQ,r5e([e],[r],[t],n),e}WQ.exports=t5e});var JQ=s(function(Wsr,zQ){"use strict";var i5e=require("@stdlib/strided/base/nullary").ndarray,kQ=T();function n5e(r,e,t,i,n){var a;return arguments.length>4?a=kQ.factory(n):a=kQ,i5e([e],[r],[t],[i],a),e}zQ.exports=n5e});var BQ=s(function(Isr,CQ){"use strict";var a5e=require("@stdlib/strided/base/nullary"),UQ=T();function s5e(r,e,t,i){var n;return arguments.length>3?n=UQ.factory(i):n=UQ,a5e([e],[r],[t],n.normalized),e}CQ.exports=s5e});var YQ=s(function(ksr,XQ){"use strict";var u5e=require("@stdlib/strided/base/nullary").ndarray,DQ=T();function o5e(r,e,t,i,n){var a;return arguments.length>4?a=DQ.factory(n):a=DQ,u5e([e],[r],[t],[i],a.normalized),e}XQ.exports=o5e});var QQ=s(function(zsr,ZQ){"use strict";var Jh=require("@stdlib/utils/define-nonenumerable-read-only-property"),Uh=IQ(),v5e=JQ(),HQ=BQ(),g5e=YQ();Jh(Uh,"ndarray",v5e);Jh(Uh,"normalized",HQ);Jh(HQ,"ndarray",g5e);ZQ.exports=Uh});var Bh=s(function(Jsr,KQ){"use strict";var $Q=require("@stdlib/array/base/assert/is-accessor-array"),Ch=pn();function f5e(r,e,t,i,n,a,u,o){var v,g,c;if(v={arity:0,fcn:null},u){if(e===0&&n===0)return $Q(r)?g=r.get(t):g=r[t],$Q(i)?c=i.get(a):c=i[a],v.fcn=Ch.factory(g,c,o),v;v.fcn=Ch.factory(o)}else v.fcn=Ch;return v.arity+=2,v}KQ.exports=f5e});var r$=s(function(Usr,e$){"use strict";var d5e=require("@stdlib/strided/base/nullary"),l5e=require("@stdlib/strided/base/binary"),c5e=Bh();function m5e(r,e,t,i,n,a,u,o){var v=c5e(e,t,0,i,n,0,arguments.length>7,o);return v.arity===0?(d5e([a],[r],[u],v.fcn),a):(l5e([e,i,a],[r],[t,n,u],v.fcn),a)}e$.exports=m5e});var i$=s(function(Csr,t$){"use strict";var h5e=require("@stdlib/strided/base/nullary").ndarray,p5e=require("@stdlib/strided/base/binary").ndarray,y5e=Bh();function q5e(r,e,t,i,n,a,u,o,v,g,c){var l=y5e(e,t,i,n,a,u,arguments.length>10,c);return l.arity===0?(h5e([o],[r],[v],[g],l.fcn),o):(p5e([e,n,o],[r],[t,a,v],[i,u,g],l.fcn),o)}t$.exports=q5e});var s$=s(function(Bsr,a$){"use strict";var b5e=require("@stdlib/utils/define-nonenumerable-read-only-property"),n$=r$(),w5e=i$();b5e(n$,"ndarray",w5e);a$.exports=n$});var Dh=s(function(Dsr,u$){"use strict";var S5e=oa(),O5e=Rt(),E5e=S5e(O5e);u$.exports=E5e});var v$=s(function(Xsr,o$){"use strict";var _5e=Dh(),N5e=_5e();o$.exports=N5e});var d$=s(function(Ysr,f$){"use strict";var L5e=require("@stdlib/utils/define-nonenumerable-read-only-property"),g$=v$(),R5e=Dh();L5e(g$,"factory",R5e);f$.exports=g$});var m$=s(function(Hsr,c$){"use strict";var P5e=require("@stdlib/strided/base/nullary"),l$=jt();function T5e(r,e,t,i){var n;return arguments.length>3?n=l$.factory(i):n=l$,P5e([e],[r],[t],n),e}c$.exports=T5e});var y$=s(function(Zsr,p$){"use strict";var j5e=require("@stdlib/strided/base/nullary").ndarray,h$=jt();function M5e(r,e,t,i,n){var a;return arguments.length>4?a=h$.factory(n):a=h$,j5e([e],[r],[t],[i],a),e}p$.exports=M5e});var w$=s(function(Qsr,b$){"use strict";var x5e=require("@stdlib/utils/define-nonenumerable-read-only-property"),q$=m$(),A5e=y$();x5e(q$,"ndarray",A5e);b$.exports=q$});var Yh=s(function($sr,O$){"use strict";var S$=require("@stdlib/array/base/assert/is-accessor-array"),Xh=yn();function G5e(r,e,t,i,n,a,u,o){var v,g,c;if(v={arity:0,fcn:null},u){if(e===0&&n===0)return S$(r)?g=r.get(t):g=r[t],S$(i)?c=i.get(a):c=i[a],v.fcn=Xh.factory(g,c,o),v;v.fcn=Xh.factory(o)}else v.fcn=Xh;return v.arity+=2,v}O$.exports=G5e});var _$=s(function(Ksr,E$){"use strict";var V5e=require("@stdlib/strided/base/nullary"),F5e=require("@stdlib/strided/base/binary"),W5e=Yh();function I5e(r,e,t,i,n,a,u,o){var v=W5e(e,t,0,i,n,0,arguments.length>7,o);return v.arity===0?(V5e([a],[r],[u],v.fcn),a):(F5e([e,i,a],[r],[t,n,u],v.fcn),a)}E$.exports=I5e});var L$=s(function(eur,N$){"use strict";var k5e=require("@stdlib/strided/base/nullary").ndarray,z5e=require("@stdlib/strided/base/binary").ndarray,J5e=Yh();function U5e(r,e,t,i,n,a,u,o,v,g,c){var l=J5e(e,t,i,n,a,u,arguments.length>10,c);return l.arity===0?(k5e([o],[r],[v],[g],l.fcn),o):(z5e([e,n,o],[r],[t,a,v],[i,u,g],l.fcn),o)}N$.exports=U5e});var T$=s(function(rur,P$){"use strict";var C5e=require("@stdlib/utils/define-nonenumerable-read-only-property"),R$=_$(),B5e=L$();C5e(R$,"ndarray",B5e);P$.exports=R$});var Zh=s(function(tur,M$){"use strict";var j$=require("@stdlib/array/base/assert/is-accessor-array"),Hh=qn();function D5e(r,e,t,i,n,a,u,o){var v,g,c;if(v={arity:0,fcn:null},u){if(e===0&&n===0)return j$(r)?g=r.get(t):g=r[t],j$(i)?c=i.get(a):c=i[a],v.fcn=Hh.factory(g,c,o),v;v.fcn=Hh.factory(o)}else v.fcn=Hh;return v.arity+=2,v}M$.exports=D5e});var A$=s(function(iur,x$){"use strict";var X5e=require("@stdlib/strided/base/nullary"),Y5e=require("@stdlib/strided/base/binary"),H5e=Zh();function Z5e(r,e,t,i,n,a,u,o){var v=H5e(e,t,0,i,n,0,arguments.length>7,o);return v.arity===0?(X5e([a],[r],[u],v.fcn),a):(Y5e([e,i,a],[r],[t,n,u],v.fcn),a)}x$.exports=Z5e});var V$=s(function(nur,G$){"use strict";var Q5e=require("@stdlib/strided/base/nullary").ndarray,$5e=require("@stdlib/strided/base/binary").ndarray,K5e=Zh();function eYe(r,e,t,i,n,a,u,o,v,g,c){var l=K5e(e,t,i,n,a,u,arguments.length>10,c);return l.arity===0?(Q5e([o],[r],[v],[g],l.fcn),o):($5e([e,n,o],[r],[t,a,v],[i,u,g],l.fcn),o)}G$.exports=eYe});var I$=s(function(aur,W$){"use strict";var rYe=require("@stdlib/utils/define-nonenumerable-read-only-property"),F$=A$(),tYe=V$();rYe(F$,"ndarray",tYe);W$.exports=F$});var z$=s(function(sur,k$){"use strict";var k=require("@stdlib/utils/define-read-only-property"),I={};k(I,"arcsine",hH());k(I,"bernoulli",LH());k(I,"beta",VH());k(I,"betaprime",BH());k(I,"chi",QH());k(I,"chisquare",iZ());k(I,"cosine",dZ());k(I,"discreteUniform",wZ());k(I,"exponential",LZ());k(I,"gamma",VZ());k(I,"geometric",JZ());k(I,"invgamma",QZ());k(I,"lognormal",sQ());k(I,"minstd",wQ());k(I,"minstdShuffle",VQ());k(I,"mt19937",QQ());k(I,"normal",s$());k(I,"poisson",d$());k(I,"randu",w$());k(I,"uniform",T$());k(I,"weibull",I$());k$.exports=I});var va=require("@stdlib/utils/define-read-only-property"),nn={};va(nn,"array",qx());va(nn,"base",g1());va(nn,"iterators",bI());va(nn,"sample",CI());va(nn,"shuffle",nk());va(nn,"streams",uH());va(nn,"strided",z$());module.exports=nn; /** * @license Apache-2.0 * diff --git a/dist/index.js.map b/dist/index.js.map index 033feae3..706b4b5b 100644 --- a/dist/index.js.map +++ b/dist/index.js.map @@ -1,7 +1,7 @@ { "version": 3, - "sources": ["../array/tools/binary/lib/validate.js", "../array/tools/binary/lib/main.js", "../array/tools/binary/lib/index.js", "../array/tools/nullary/lib/validate.js", "../array/tools/nullary/lib/main.js", "../array/tools/nullary/lib/index.js", "../array/tools/binary-factory/lib/main.js", "../array/tools/binary-factory/lib/index.js", "../base/mt19937/lib/rand_uint32.js", "../base/mt19937/lib/factory.js", "../base/mt19937/lib/main.js", "../base/mt19937/lib/index.js", "../base/arcsine/lib/validate.js", "../base/arcsine/lib/arcsine.js", "../base/arcsine/lib/factory.js", "../base/arcsine/lib/main.js", "../base/arcsine/lib/index.js", "../array/arcsine/lib/factory.js", "../array/arcsine/lib/main.js", "../array/arcsine/lib/index.js", "../array/tools/unary/lib/validate.js", "../array/tools/unary/lib/main.js", "../array/tools/unary/lib/index.js", "../array/tools/unary-factory/lib/main.js", "../array/tools/unary-factory/lib/index.js", "../base/bernoulli/lib/factory.js", "../base/bernoulli/lib/main.js", "../base/bernoulli/lib/index.js", "../array/bernoulli/lib/factory.js", "../array/bernoulli/lib/main.js", "../array/bernoulli/lib/index.js", "../base/improved-ziggurat/lib/coords_array.js", "../base/improved-ziggurat/lib/ratio_array.js", "../base/improved-ziggurat/lib/sample_tail.js", "../base/improved-ziggurat/lib/improved_ziggurat.js", "../base/improved-ziggurat/lib/factory.js", "../base/improved-ziggurat/lib/main.js", "../base/improved-ziggurat/lib/index.js", "../base/beta/lib/validate.js", "../base/beta/lib/standard_gamma.js", "../base/beta/lib/sample1.js", "../base/beta/lib/sample2.js", "../base/beta/lib/sample3.js", "../base/beta/lib/beta.js", "../base/beta/lib/factory.js", "../base/beta/lib/main.js", "../base/beta/lib/index.js", "../array/beta/lib/factory.js", "../array/beta/lib/main.js", "../array/beta/lib/index.js", "../base/gamma/lib/validate.js", "../base/gamma/lib/gamma.js", "../base/gamma/lib/factory.js", "../base/gamma/lib/main.js", "../base/gamma/lib/index.js", "../base/betaprime/lib/validate.js", "../base/betaprime/lib/betaprime.js", "../base/betaprime/lib/factory.js", "../base/betaprime/lib/main.js", "../base/betaprime/lib/index.js", "../array/betaprime/lib/factory.js", "../array/betaprime/lib/main.js", "../array/betaprime/lib/index.js", "../base/binomial/lib/validate.js", "../base/binomial/lib/sample1.js", "../base/binomial/lib/correction.js", "../base/binomial/lib/sample2.js", "../base/binomial/lib/binomial.js", "../base/binomial/lib/factory.js", "../base/binomial/lib/main.js", "../base/binomial/lib/index.js", "../array/binomial/lib/factory.js", "../array/binomial/lib/main.js", "../array/binomial/lib/index.js", "../base/cauchy/lib/validate.js", "../base/cauchy/lib/cauchy.js", "../base/cauchy/lib/factory.js", "../base/cauchy/lib/main.js", "../base/cauchy/lib/index.js", "../array/cauchy/lib/factory.js", "../array/cauchy/lib/main.js", "../array/cauchy/lib/index.js", "../base/chisquare/lib/factory.js", "../base/chisquare/lib/main.js", "../base/chisquare/lib/index.js", "../base/chi/lib/factory.js", "../base/chi/lib/main.js", "../base/chi/lib/index.js", "../array/chi/lib/factory.js", "../array/chi/lib/main.js", "../array/chi/lib/index.js", "../array/chisquare/lib/factory.js", "../array/chisquare/lib/main.js", "../array/chisquare/lib/index.js", "../base/cosine/lib/validate.js", "../base/cosine/lib/cosine.js", "../base/cosine/lib/factory.js", "../base/cosine/lib/main.js", "../base/cosine/lib/index.js", "../array/cosine/lib/factory.js", "../array/cosine/lib/main.js", "../array/cosine/lib/index.js", "../base/discrete-uniform/lib/validate.js", "../base/discrete-uniform/lib/discrete_uniform.js", "../base/discrete-uniform/lib/factory.js", "../base/discrete-uniform/lib/main.js", "../base/discrete-uniform/lib/index.js", "../array/discrete-uniform/lib/factory.js", "../array/discrete-uniform/lib/main.js", "../array/discrete-uniform/lib/index.js", "../base/erlang/lib/validate.js", "../base/erlang/lib/erlang.js", "../base/erlang/lib/factory.js", "../base/erlang/lib/main.js", "../base/erlang/lib/index.js", "../array/erlang/lib/factory.js", "../array/erlang/lib/main.js", "../array/erlang/lib/index.js", "../base/exponential/lib/exponential.js", "../base/exponential/lib/factory.js", "../base/exponential/lib/main.js", "../base/exponential/lib/index.js", "../array/exponential/lib/factory.js", "../array/exponential/lib/main.js", "../array/exponential/lib/index.js", "../base/f/lib/validate.js", "../base/f/lib/f.js", "../base/f/lib/factory.js", "../base/f/lib/main.js", "../base/f/lib/index.js", "../array/f/lib/factory.js", "../array/f/lib/main.js", "../array/f/lib/index.js", "../array/tools/ternary/lib/validate.js", "../array/tools/ternary/lib/main.js", "../array/tools/ternary/lib/index.js", "../array/tools/ternary-factory/lib/main.js", "../array/tools/ternary-factory/lib/index.js", "../base/frechet/lib/validate.js", "../base/frechet/lib/frechet.js", "../base/frechet/lib/factory.js", "../base/frechet/lib/main.js", "../base/frechet/lib/index.js", "../array/frechet/lib/factory.js", "../array/frechet/lib/main.js", "../array/frechet/lib/index.js", "../array/gamma/lib/factory.js", "../array/gamma/lib/main.js", "../array/gamma/lib/index.js", "../base/geometric/lib/geometric.js", "../base/geometric/lib/factory.js", "../base/geometric/lib/main.js", "../base/geometric/lib/index.js", "../array/geometric/lib/factory.js", "../array/geometric/lib/main.js", "../array/geometric/lib/index.js", "../base/gumbel/lib/validate.js", "../base/gumbel/lib/gumbel.js", "../base/gumbel/lib/factory.js", "../base/gumbel/lib/main.js", "../base/gumbel/lib/index.js", "../array/gumbel/lib/factory.js", "../array/gumbel/lib/main.js", "../array/gumbel/lib/index.js", "../base/hypergeometric/lib/validate.js", "../base/hypergeometric/lib/hin.js", "../base/hypergeometric/lib/hypergeometric.js", "../base/hypergeometric/lib/factory.js", "../base/hypergeometric/lib/main.js", "../base/hypergeometric/lib/index.js", "../array/hypergeometric/lib/factory.js", "../array/hypergeometric/lib/main.js", "../array/hypergeometric/lib/index.js", "../base/invgamma/lib/validate.js", "../base/invgamma/lib/factory.js", "../base/invgamma/lib/main.js", "../base/invgamma/lib/index.js", "../array/invgamma/lib/factory.js", "../array/invgamma/lib/main.js", "../array/invgamma/lib/index.js", "../base/kumaraswamy/lib/validate.js", "../base/kumaraswamy/lib/kumaraswamy.js", "../base/kumaraswamy/lib/factory.js", "../base/kumaraswamy/lib/main.js", "../base/kumaraswamy/lib/index.js", "../array/kumaraswamy/lib/factory.js", "../array/kumaraswamy/lib/main.js", "../array/kumaraswamy/lib/index.js", "../base/laplace/lib/validate.js", "../base/laplace/lib/laplace.js", "../base/laplace/lib/factory.js", "../base/laplace/lib/main.js", "../base/laplace/lib/index.js", "../array/laplace/lib/factory.js", "../array/laplace/lib/main.js", "../array/laplace/lib/index.js", "../base/levy/lib/validate.js", "../base/levy/lib/levy.js", "../base/levy/lib/factory.js", "../base/levy/lib/main.js", "../base/levy/lib/index.js", "../array/levy/lib/factory.js", "../array/levy/lib/main.js", "../array/levy/lib/index.js", "../base/logistic/lib/validate.js", "../base/logistic/lib/logistic.js", "../base/logistic/lib/factory.js", "../base/logistic/lib/main.js", "../base/logistic/lib/index.js", "../array/logistic/lib/factory.js", "../array/logistic/lib/main.js", "../array/logistic/lib/index.js", "../base/lognormal/lib/validate.js", "../base/lognormal/lib/lognormal.js", "../base/lognormal/lib/factory.js", "../base/lognormal/lib/main.js", "../base/lognormal/lib/index.js", "../array/lognormal/lib/factory.js", "../array/lognormal/lib/main.js", "../array/lognormal/lib/index.js", "../base/minstd/lib/rand_int32.js", "../base/minstd/lib/factory.js", "../base/minstd/lib/main.js", "../base/minstd/lib/index.js", "../array/minstd/lib/defaults.json", "../array/minstd/lib/validate.js", "../array/minstd/lib/factory.js", "../array/minstd/lib/main.js", "../array/minstd/lib/index.js", "../base/minstd-shuffle/lib/create_table.js", "../base/minstd-shuffle/lib/rand_int32.js", "../base/minstd-shuffle/lib/factory.js", "../base/minstd-shuffle/lib/main.js", "../base/minstd-shuffle/lib/index.js", "../array/minstd-shuffle/lib/defaults.json", "../array/minstd-shuffle/lib/validate.js", "../array/minstd-shuffle/lib/factory.js", "../array/minstd-shuffle/lib/main.js", "../array/minstd-shuffle/lib/index.js", "../array/mt19937/lib/defaults.json", "../array/mt19937/lib/validate.js", "../array/mt19937/lib/factory.js", "../array/mt19937/lib/main.js", "../array/mt19937/lib/index.js", "../base/poisson/lib/knuth.js", "../base/poisson/lib/rejection.js", "../base/poisson/lib/poisson.js", "../base/poisson/lib/factory.js", "../base/poisson/lib/main.js", "../base/poisson/lib/index.js", "../base/negative-binomial/lib/validate.js", "../base/negative-binomial/lib/factory.js", "../base/negative-binomial/lib/main.js", "../base/negative-binomial/lib/index.js", "../array/negative-binomial/lib/factory.js", "../array/negative-binomial/lib/main.js", "../array/negative-binomial/lib/index.js", "../base/normal/lib/validate.js", "../base/normal/lib/normal.js", "../base/normal/lib/factory.js", "../base/normal/lib/main.js", "../base/normal/lib/index.js", "../array/normal/lib/factory.js", "../array/normal/lib/main.js", "../array/normal/lib/index.js", "../base/pareto-type1/lib/validate.js", "../base/pareto-type1/lib/pareto.js", "../base/pareto-type1/lib/factory.js", "../base/pareto-type1/lib/main.js", "../base/pareto-type1/lib/index.js", "../array/pareto-type1/lib/factory.js", "../array/pareto-type1/lib/main.js", "../array/pareto-type1/lib/index.js", "../array/poisson/lib/factory.js", "../array/poisson/lib/main.js", "../array/poisson/lib/index.js", "../base/randu/lib/defaults.json", "../base/randu/lib/prngs.js", "../base/randu/lib/factory.js", "../base/randu/lib/main.js", "../base/randu/lib/index.js", "../array/randu/lib/defaults.json", "../array/randu/lib/validate.js", "../array/randu/lib/factory.js", "../array/randu/lib/main.js", "../array/randu/lib/index.js", "../base/rayleigh/lib/rayleigh.js", "../base/rayleigh/lib/factory.js", "../base/rayleigh/lib/main.js", "../base/rayleigh/lib/index.js", "../array/rayleigh/lib/factory.js", "../array/rayleigh/lib/main.js", "../array/rayleigh/lib/index.js", "../base/t/lib/factory.js", "../base/t/lib/main.js", "../base/t/lib/index.js", "../array/t/lib/factory.js", "../array/t/lib/main.js", "../array/t/lib/index.js", "../base/triangular/lib/validate.js", "../base/triangular/lib/triangular.js", "../base/triangular/lib/factory.js", "../base/triangular/lib/main.js", "../base/triangular/lib/index.js", "../array/triangular/lib/factory.js", "../array/triangular/lib/main.js", "../array/triangular/lib/index.js", "../base/uniform/lib/validate.js", "../base/uniform/lib/uniform.js", "../base/uniform/lib/factory.js", "../base/uniform/lib/main.js", "../base/uniform/lib/index.js", "../array/uniform/lib/factory.js", "../array/uniform/lib/main.js", "../array/uniform/lib/index.js", "../base/weibull/lib/validate.js", "../base/weibull/lib/weibull.js", "../base/weibull/lib/factory.js", "../base/weibull/lib/main.js", "../base/weibull/lib/index.js", "../array/weibull/lib/factory.js", "../array/weibull/lib/main.js", "../array/weibull/lib/index.js", "../array/lib/index.js", "../base/box-muller/lib/randn.js", "../base/box-muller/lib/min.js", "../base/box-muller/lib/max.js", "../base/box-muller/lib/factory.js", "../base/box-muller/lib/main.js", "../base/box-muller/lib/index.js", "../base/randi/lib/defaults.json", "../base/randi/lib/prngs.js", "../base/randi/lib/factory.js", "../base/randi/lib/main.js", "../base/randi/lib/index.js", "../base/randn/lib/defaults.json", "../base/randn/lib/prngs.js", "../base/randn/lib/factory.js", "../base/randn/lib/main.js", "../base/randn/lib/index.js", "../base/reviver/lib/prngs.js", "../base/reviver/lib/main.js", "../base/reviver/lib/index.js", "../base/lib/index.js", "../iter/arcsine/lib/main.js", "../iter/arcsine/lib/index.js", "../iter/bernoulli/lib/main.js", "../iter/bernoulli/lib/index.js", "../iter/beta/lib/main.js", "../iter/beta/lib/index.js", "../iter/betaprime/lib/main.js", "../iter/betaprime/lib/index.js", "../iter/binomial/lib/main.js", "../iter/binomial/lib/index.js", "../iter/box-muller/lib/main.js", "../iter/box-muller/lib/index.js", "../iter/cauchy/lib/main.js", "../iter/cauchy/lib/index.js", "../iter/chi/lib/main.js", "../iter/chi/lib/index.js", "../iter/chisquare/lib/main.js", "../iter/chisquare/lib/index.js", "../iter/cosine/lib/main.js", "../iter/cosine/lib/index.js", "../iter/discrete-uniform/lib/main.js", "../iter/discrete-uniform/lib/index.js", "../iter/erlang/lib/main.js", "../iter/erlang/lib/index.js", "../iter/exponential/lib/main.js", "../iter/exponential/lib/index.js", "../iter/f/lib/main.js", "../iter/f/lib/index.js", "../iter/frechet/lib/main.js", "../iter/frechet/lib/index.js", "../iter/gamma/lib/main.js", "../iter/gamma/lib/index.js", "../iter/geometric/lib/main.js", "../iter/geometric/lib/index.js", "../iter/gumbel/lib/main.js", "../iter/gumbel/lib/index.js", "../iter/hypergeometric/lib/main.js", "../iter/hypergeometric/lib/index.js", "../iter/improved-ziggurat/lib/main.js", "../iter/improved-ziggurat/lib/index.js", "../iter/invgamma/lib/main.js", "../iter/invgamma/lib/index.js", "../iter/kumaraswamy/lib/main.js", "../iter/kumaraswamy/lib/index.js", "../iter/laplace/lib/main.js", "../iter/laplace/lib/index.js", "../iter/levy/lib/main.js", "../iter/levy/lib/index.js", "../iter/logistic/lib/main.js", "../iter/logistic/lib/index.js", "../iter/lognormal/lib/main.js", "../iter/lognormal/lib/index.js", "../iter/minstd/lib/main.js", "../iter/minstd/lib/index.js", "../iter/minstd-shuffle/lib/main.js", "../iter/minstd-shuffle/lib/index.js", "../iter/mt19937/lib/main.js", "../iter/mt19937/lib/index.js", "../iter/negative-binomial/lib/main.js", "../iter/negative-binomial/lib/index.js", "../iter/normal/lib/main.js", "../iter/normal/lib/index.js", "../iter/pareto-type1/lib/main.js", "../iter/pareto-type1/lib/index.js", "../iter/poisson/lib/main.js", "../iter/poisson/lib/index.js", "../iter/randi/lib/main.js", "../iter/randi/lib/index.js", "../iter/randn/lib/main.js", "../iter/randn/lib/index.js", "../iter/randu/lib/main.js", "../iter/randu/lib/index.js", "../iter/rayleigh/lib/main.js", "../iter/rayleigh/lib/index.js", "../iter/t/lib/main.js", "../iter/t/lib/index.js", "../iter/triangular/lib/main.js", "../iter/triangular/lib/index.js", "../iter/uniform/lib/main.js", "../iter/uniform/lib/index.js", "../iter/weibull/lib/main.js", "../iter/weibull/lib/index.js", "../iter/lib/index.js", "../sample/lib/discrete_uniform.js", "../sample/lib/renormalizing.js", "../sample/lib/fisher_yates.js", "../sample/lib/vose.js", "../sample/lib/defaults.json", "../sample/lib/validate.js", "../sample/lib/factory.js", "../sample/lib/main.js", "../sample/lib/index.js", "../shuffle/lib/defaults.json", "../shuffle/lib/validate.js", "../shuffle/lib/factory.js", "../shuffle/lib/main.js", "../shuffle/lib/index.js", "../streams/arcsine/lib/defaults.json", "../streams/arcsine/lib/validate.js", "../streams/arcsine/lib/debug.js", "../streams/arcsine/lib/main.js", "../streams/arcsine/lib/object_mode.js", "../streams/arcsine/lib/factory.js", "../streams/arcsine/lib/index.js", "../streams/bernoulli/lib/defaults.json", "../streams/bernoulli/lib/validate.js", "../streams/bernoulli/lib/debug.js", "../streams/bernoulli/lib/main.js", "../streams/bernoulli/lib/object_mode.js", "../streams/bernoulli/lib/factory.js", "../streams/bernoulli/lib/index.js", "../streams/beta/lib/defaults.json", "../streams/beta/lib/validate.js", "../streams/beta/lib/debug.js", "../streams/beta/lib/main.js", "../streams/beta/lib/object_mode.js", "../streams/beta/lib/factory.js", "../streams/beta/lib/index.js", "../streams/betaprime/lib/defaults.json", "../streams/betaprime/lib/validate.js", "../streams/betaprime/lib/debug.js", "../streams/betaprime/lib/main.js", "../streams/betaprime/lib/object_mode.js", "../streams/betaprime/lib/factory.js", "../streams/betaprime/lib/index.js", "../streams/binomial/lib/defaults.json", "../streams/binomial/lib/validate.js", "../streams/binomial/lib/debug.js", "../streams/binomial/lib/main.js", "../streams/binomial/lib/object_mode.js", "../streams/binomial/lib/factory.js", "../streams/binomial/lib/index.js", "../streams/box-muller/lib/defaults.json", "../streams/box-muller/lib/validate.js", "../streams/box-muller/lib/debug.js", "../streams/box-muller/lib/main.js", "../streams/box-muller/lib/object_mode.js", "../streams/box-muller/lib/factory.js", "../streams/box-muller/lib/index.js", "../streams/cauchy/lib/defaults.json", "../streams/cauchy/lib/validate.js", "../streams/cauchy/lib/debug.js", "../streams/cauchy/lib/main.js", "../streams/cauchy/lib/object_mode.js", "../streams/cauchy/lib/factory.js", "../streams/cauchy/lib/index.js", "../streams/chi/lib/defaults.json", "../streams/chi/lib/validate.js", "../streams/chi/lib/debug.js", "../streams/chi/lib/main.js", "../streams/chi/lib/object_mode.js", "../streams/chi/lib/factory.js", "../streams/chi/lib/index.js", "../streams/chisquare/lib/defaults.json", "../streams/chisquare/lib/validate.js", "../streams/chisquare/lib/debug.js", "../streams/chisquare/lib/main.js", "../streams/chisquare/lib/object_mode.js", "../streams/chisquare/lib/factory.js", "../streams/chisquare/lib/index.js", "../streams/cosine/lib/defaults.json", "../streams/cosine/lib/validate.js", "../streams/cosine/lib/debug.js", "../streams/cosine/lib/main.js", "../streams/cosine/lib/object_mode.js", "../streams/cosine/lib/factory.js", "../streams/cosine/lib/index.js", "../streams/discrete-uniform/lib/defaults.json", "../streams/discrete-uniform/lib/validate.js", "../streams/discrete-uniform/lib/debug.js", "../streams/discrete-uniform/lib/main.js", "../streams/discrete-uniform/lib/object_mode.js", "../streams/discrete-uniform/lib/factory.js", "../streams/discrete-uniform/lib/index.js", "../streams/erlang/lib/defaults.json", "../streams/erlang/lib/validate.js", "../streams/erlang/lib/debug.js", "../streams/erlang/lib/main.js", "../streams/erlang/lib/object_mode.js", "../streams/erlang/lib/factory.js", "../streams/erlang/lib/index.js", "../streams/exponential/lib/defaults.json", "../streams/exponential/lib/validate.js", "../streams/exponential/lib/debug.js", "../streams/exponential/lib/main.js", "../streams/exponential/lib/object_mode.js", "../streams/exponential/lib/factory.js", "../streams/exponential/lib/index.js", "../streams/f/lib/defaults.json", "../streams/f/lib/validate.js", "../streams/f/lib/debug.js", "../streams/f/lib/main.js", "../streams/f/lib/object_mode.js", "../streams/f/lib/factory.js", "../streams/f/lib/index.js", "../streams/frechet/lib/defaults.json", "../streams/frechet/lib/validate.js", "../streams/frechet/lib/debug.js", "../streams/frechet/lib/main.js", "../streams/frechet/lib/object_mode.js", "../streams/frechet/lib/factory.js", "../streams/frechet/lib/index.js", "../streams/gamma/lib/defaults.json", "../streams/gamma/lib/validate.js", "../streams/gamma/lib/debug.js", "../streams/gamma/lib/main.js", "../streams/gamma/lib/object_mode.js", "../streams/gamma/lib/factory.js", "../streams/gamma/lib/index.js", "../streams/geometric/lib/defaults.json", "../streams/geometric/lib/validate.js", "../streams/geometric/lib/debug.js", "../streams/geometric/lib/main.js", "../streams/geometric/lib/object_mode.js", "../streams/geometric/lib/factory.js", "../streams/geometric/lib/index.js", "../streams/gumbel/lib/defaults.json", "../streams/gumbel/lib/validate.js", "../streams/gumbel/lib/debug.js", "../streams/gumbel/lib/main.js", "../streams/gumbel/lib/object_mode.js", "../streams/gumbel/lib/factory.js", "../streams/gumbel/lib/index.js", "../streams/hypergeometric/lib/defaults.json", "../streams/hypergeometric/lib/validate.js", "../streams/hypergeometric/lib/debug.js", "../streams/hypergeometric/lib/main.js", "../streams/hypergeometric/lib/object_mode.js", "../streams/hypergeometric/lib/factory.js", "../streams/hypergeometric/lib/index.js", "../streams/improved-ziggurat/lib/defaults.json", "../streams/improved-ziggurat/lib/validate.js", "../streams/improved-ziggurat/lib/debug.js", "../streams/improved-ziggurat/lib/main.js", "../streams/improved-ziggurat/lib/object_mode.js", "../streams/improved-ziggurat/lib/factory.js", "../streams/improved-ziggurat/lib/index.js", "../streams/invgamma/lib/defaults.json", "../streams/invgamma/lib/validate.js", "../streams/invgamma/lib/debug.js", "../streams/invgamma/lib/main.js", "../streams/invgamma/lib/object_mode.js", "../streams/invgamma/lib/factory.js", "../streams/invgamma/lib/index.js", "../streams/kumaraswamy/lib/defaults.json", "../streams/kumaraswamy/lib/validate.js", "../streams/kumaraswamy/lib/debug.js", "../streams/kumaraswamy/lib/main.js", "../streams/kumaraswamy/lib/object_mode.js", "../streams/kumaraswamy/lib/factory.js", "../streams/kumaraswamy/lib/index.js", "../streams/laplace/lib/defaults.json", "../streams/laplace/lib/validate.js", "../streams/laplace/lib/debug.js", "../streams/laplace/lib/main.js", "../streams/laplace/lib/object_mode.js", "../streams/laplace/lib/factory.js", "../streams/laplace/lib/index.js", "../streams/levy/lib/defaults.json", "../streams/levy/lib/validate.js", "../streams/levy/lib/debug.js", "../streams/levy/lib/main.js", "../streams/levy/lib/object_mode.js", "../streams/levy/lib/factory.js", "../streams/levy/lib/index.js", "../streams/logistic/lib/defaults.json", "../streams/logistic/lib/validate.js", "../streams/logistic/lib/debug.js", "../streams/logistic/lib/main.js", "../streams/logistic/lib/object_mode.js", "../streams/logistic/lib/factory.js", "../streams/logistic/lib/index.js", "../streams/lognormal/lib/defaults.json", "../streams/lognormal/lib/validate.js", "../streams/lognormal/lib/debug.js", "../streams/lognormal/lib/main.js", "../streams/lognormal/lib/object_mode.js", "../streams/lognormal/lib/factory.js", "../streams/lognormal/lib/index.js", "../streams/minstd/lib/defaults.json", "../streams/minstd/lib/validate.js", "../streams/minstd/lib/debug.js", "../streams/minstd/lib/main.js", "../streams/minstd/lib/object_mode.js", "../streams/minstd/lib/factory.js", "../streams/minstd/lib/index.js", "../streams/minstd-shuffle/lib/defaults.json", "../streams/minstd-shuffle/lib/validate.js", "../streams/minstd-shuffle/lib/debug.js", "../streams/minstd-shuffle/lib/main.js", "../streams/minstd-shuffle/lib/object_mode.js", "../streams/minstd-shuffle/lib/factory.js", "../streams/minstd-shuffle/lib/index.js", "../streams/mt19937/lib/defaults.json", "../streams/mt19937/lib/validate.js", "../streams/mt19937/lib/debug.js", "../streams/mt19937/lib/main.js", "../streams/mt19937/lib/object_mode.js", "../streams/mt19937/lib/factory.js", "../streams/mt19937/lib/index.js", "../streams/negative-binomial/lib/defaults.json", "../streams/negative-binomial/lib/validate.js", "../streams/negative-binomial/lib/debug.js", "../streams/negative-binomial/lib/main.js", "../streams/negative-binomial/lib/object_mode.js", "../streams/negative-binomial/lib/factory.js", "../streams/negative-binomial/lib/index.js", "../streams/normal/lib/defaults.json", "../streams/normal/lib/validate.js", "../streams/normal/lib/debug.js", "../streams/normal/lib/main.js", "../streams/normal/lib/object_mode.js", "../streams/normal/lib/factory.js", "../streams/normal/lib/index.js", "../streams/pareto-type1/lib/defaults.json", "../streams/pareto-type1/lib/validate.js", "../streams/pareto-type1/lib/debug.js", "../streams/pareto-type1/lib/main.js", "../streams/pareto-type1/lib/object_mode.js", "../streams/pareto-type1/lib/factory.js", "../streams/pareto-type1/lib/index.js", "../streams/poisson/lib/defaults.json", "../streams/poisson/lib/validate.js", "../streams/poisson/lib/debug.js", "../streams/poisson/lib/main.js", "../streams/poisson/lib/object_mode.js", "../streams/poisson/lib/factory.js", "../streams/poisson/lib/index.js", "../streams/randi/lib/defaults.json", "../streams/randi/lib/validate.js", "../streams/randi/lib/debug.js", "../streams/randi/lib/main.js", "../streams/randi/lib/object_mode.js", "../streams/randi/lib/factory.js", "../streams/randi/lib/index.js", "../streams/randn/lib/defaults.json", "../streams/randn/lib/validate.js", "../streams/randn/lib/debug.js", "../streams/randn/lib/main.js", "../streams/randn/lib/object_mode.js", "../streams/randn/lib/factory.js", "../streams/randn/lib/index.js", "../streams/randu/lib/defaults.json", "../streams/randu/lib/validate.js", "../streams/randu/lib/debug.js", "../streams/randu/lib/main.js", "../streams/randu/lib/object_mode.js", "../streams/randu/lib/factory.js", "../streams/randu/lib/index.js", "../streams/rayleigh/lib/defaults.json", "../streams/rayleigh/lib/validate.js", "../streams/rayleigh/lib/debug.js", "../streams/rayleigh/lib/main.js", "../streams/rayleigh/lib/object_mode.js", "../streams/rayleigh/lib/factory.js", "../streams/rayleigh/lib/index.js", "../streams/t/lib/defaults.json", "../streams/t/lib/validate.js", "../streams/t/lib/debug.js", "../streams/t/lib/main.js", "../streams/t/lib/object_mode.js", "../streams/t/lib/factory.js", "../streams/t/lib/index.js", "../streams/triangular/lib/defaults.json", "../streams/triangular/lib/validate.js", "../streams/triangular/lib/debug.js", "../streams/triangular/lib/main.js", "../streams/triangular/lib/object_mode.js", "../streams/triangular/lib/factory.js", "../streams/triangular/lib/index.js", "../streams/uniform/lib/defaults.json", "../streams/uniform/lib/validate.js", "../streams/uniform/lib/debug.js", "../streams/uniform/lib/main.js", "../streams/uniform/lib/object_mode.js", "../streams/uniform/lib/factory.js", "../streams/uniform/lib/index.js", "../streams/weibull/lib/defaults.json", "../streams/weibull/lib/validate.js", "../streams/weibull/lib/debug.js", "../streams/weibull/lib/main.js", "../streams/weibull/lib/object_mode.js", "../streams/weibull/lib/factory.js", "../streams/weibull/lib/index.js", "../streams/lib/index.js", "../strided/arcsine/lib/prng.js", "../strided/arcsine/lib/main.js", "../strided/arcsine/lib/ndarray.js", "../strided/arcsine/lib/index.js", "../strided/tools/unary-factory/lib/main.js", "../strided/tools/unary-factory/lib/index.js", "../strided/bernoulli/lib/factory.js", "../strided/bernoulli/lib/main.js", "../strided/bernoulli/lib/index.js", "../strided/beta/lib/prng.js", "../strided/beta/lib/main.js", "../strided/beta/lib/ndarray.js", "../strided/beta/lib/index.js", "../strided/betaprime/lib/prng.js", "../strided/betaprime/lib/main.js", "../strided/betaprime/lib/ndarray.js", "../strided/betaprime/lib/index.js", "../strided/chi/lib/factory.js", "../strided/chi/lib/main.js", "../strided/chi/lib/index.js", "../strided/chisquare/lib/factory.js", "../strided/chisquare/lib/main.js", "../strided/chisquare/lib/index.js", "../strided/cosine/lib/prng.js", "../strided/cosine/lib/main.js", "../strided/cosine/lib/ndarray.js", "../strided/cosine/lib/index.js", "../strided/discrete-uniform/lib/prng.js", "../strided/discrete-uniform/lib/main.js", "../strided/discrete-uniform/lib/ndarray.js", "../strided/discrete-uniform/lib/index.js", "../strided/exponential/lib/factory.js", "../strided/exponential/lib/main.js", "../strided/exponential/lib/index.js", "../strided/gamma/lib/prng.js", "../strided/gamma/lib/main.js", "../strided/gamma/lib/ndarray.js", "../strided/gamma/lib/index.js", "../strided/geometric/lib/factory.js", "../strided/geometric/lib/main.js", "../strided/geometric/lib/index.js", "../strided/invgamma/lib/prng.js", "../strided/invgamma/lib/main.js", "../strided/invgamma/lib/ndarray.js", "../strided/invgamma/lib/index.js", "../strided/lognormal/lib/prng.js", "../strided/lognormal/lib/main.js", "../strided/lognormal/lib/ndarray.js", "../strided/lognormal/lib/index.js", "../strided/minstd/lib/main.js", "../strided/minstd/lib/ndarray.js", "../strided/minstd/lib/normalized.js", "../strided/minstd/lib/normalized.ndarray.js", "../strided/minstd/lib/index.js", "../strided/minstd-shuffle/lib/main.js", "../strided/minstd-shuffle/lib/ndarray.js", "../strided/minstd-shuffle/lib/normalized.js", "../strided/minstd-shuffle/lib/normalized.ndarray.js", "../strided/minstd-shuffle/lib/index.js", "../strided/mt19937/lib/main.js", "../strided/mt19937/lib/ndarray.js", "../strided/mt19937/lib/normalized.js", "../strided/mt19937/lib/normalized.ndarray.js", "../strided/mt19937/lib/index.js", "../strided/normal/lib/prng.js", "../strided/normal/lib/main.js", "../strided/normal/lib/ndarray.js", "../strided/normal/lib/index.js", "../strided/randu/lib/main.js", "../strided/randu/lib/ndarray.js", "../strided/randu/lib/index.js", "../strided/uniform/lib/prng.js", "../strided/uniform/lib/main.js", "../strided/uniform/lib/ndarray.js", "../strided/uniform/lib/index.js", "../strided/weibull/lib/prng.js", "../strided/weibull/lib/main.js", "../strided/weibull/lib/ndarray.js", "../strided/weibull/lib/index.js", "../strided/lib/index.js", "../lib/index.js"], - "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar contains = require( '@stdlib/array/base/assert/contains' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Array} dtypes - list of supported output data types\n* @param {Options} options - function options\n* @param {string} [options.dtype] - output array data type\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var options = {\n* 'dtype': 'float64'\n* };\n* var err = validate( opts, dtypes, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, dtypes, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'dtype' ) ) {\n\t\topts.dtype = options.dtype;\n\t\tif ( !contains( dtypes, opts.dtype ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', dtypes.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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/* eslint-disable no-restricted-syntax, no-invalid-this */\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isStringArray = require( '@stdlib/assert/is-string-array' ).primitives;\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar contains = require( '@stdlib/array/base/assert/contains' );\nvar filledBy = require( '@stdlib/array/base/filled-by' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar ctors = require( '@stdlib/array/ctors' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Constructor for creating arrays filled with pseudorandom values drawn from a binary PRNG.\n*\n* @constructor\n* @param {Function} prng - binary pseudorandom value generator\n* @param {StringArray} dtypes - list of supported output data types\n* @param {string} dtype - default output data type\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} second argument must be an array of strings\n* @throws {TypeError} third argument must be a supported data type\n* @returns {Random} instance\n*\n* @example\n* var arcsine = require( '@stdlib/random/base/arcsine' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var defaultDType = 'float64';\n*\n* var rand = new Random( arcsine, dtypes, defaultDType );\n*\n* var v = rand.generate( 10, 2.0, 5.0 );\n* // returns \n*/\nfunction Random( prng, dtypes, dtype ) {\n\tif ( !( this instanceof Random ) ) {\n\t\treturn new Random( prng, dtypes, dtype );\n\t}\n\tif ( !isFunction( prng ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', prng ) );\n\t}\n\t// TODO: tighten this up by actually validating that `dtypes` contains only recognized/supported dtype strings\n\tif ( !isStringArray( dtypes ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an array of strings. Value: `%s`.', dtypes ) );\n\t}\n\t// Require that the default output array data type be a member of the list of supported output array data types...\n\tif ( !contains( dtypes, dtype ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a supported data type. Value: `%s`.', dtype ) );\n\t}\n\tthis._prng = prng;\n\tthis._dtypes = dtypes;\n\tthis._dtype = dtype;\n\treturn this;\n}\n\n/**\n* Returns an array filled with pseudorandom values drawn from a binary PRNG.\n*\n* @name generate\n* @memberof Random.prototype\n* @type {Function}\n* @param {NonNegativeInteger} len - number of elements\n* @param {*} param1 - first PRNG parameter\n* @param {*} param2 - second PRNG parameter\n* @param {Options} [options] - function options\n* @param {string} [options.dtype] - array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {Collection} output array\n*\n* @example\n* var arcsine = require( '@stdlib/random/base/arcsine' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var defaultDType = 'float64';\n*\n* var rand = new Random( arcsine, dtypes, defaultDType );\n*\n* var v = rand.generate( 10, 2.0, 5.0 );\n* // returns \n*/\nsetReadOnly( Random.prototype, 'generate', function generate( len, param1, param2, options ) {\n\tvar ctor;\n\tvar opts;\n\tvar prng;\n\tvar out;\n\tvar err;\n\tvar dt;\n\tif ( !isNonNegativeInteger( len ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t}\n\topts = {};\n\tif ( arguments.length > 3 ) {\n\t\terr = validate( opts, this._dtypes, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// NOTE: we could alternatively use the PRNG factory function to create a nullary PRNG function which applies parameters for each invocation; however, this would impose a one-time cost which is likely to be rather expensive when generating small arrays. The decision made here avoids this cost, despite a small cost due to repeatedly validating parameters for each generated pseudorandom value. Additionally, the current implementation has the added benefit that it mirrors the underlying PRNG where invalid parameters result in, e.g., a return value of `NaN` (however, realization of this benefit depends on the output array being a floating-point array).\n\tprng = this._prng;\n\tdt = opts.dtype || this._dtype;\n\tif ( dt === 'generic' ) {\n\t\treturn filledBy( len, wrapper );\n\t}\n\tctor = ctors( dt );\n\tout = new ctor( len );\n\tbinary( [ [ param1 ], [ param2 ], out ], [ len ], [ 0, 0, 1 ], prng );\n\treturn out;\n\n\t/**\n\t* Applies parameters to a pseudorandom value generator function.\n\t*\n\t* @private\n\t* @returns {*} pseudorandom value\n\t*/\n\tfunction wrapper() {\n\t\treturn prng( param1, param2 );\n\t}\n});\n\n/**\n* Fills an array with pseudorandom values drawn from a binary PRNG.\n*\n* @name assign\n* @memberof Random.prototype\n* @type {Function}\n* @param {*} param1 - first PRNG parameter\n* @param {*} param2 - second PRNG parameter\n* @param {Collection} out - output array\n* @throws {TypeError} third argument must be a collection\n* @returns {Collection} output array\n*\n* @example\n* var arcsine = require( '@stdlib/random/base/arcsine' );\n* var zeros = require( '@stdlib/array/zeros' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var defaultDType = 'float64';\n*\n* var rand = new Random( arcsine, dtypes, defaultDType );\n*\n* var out = zeros( 10, 'float64' );\n* // returns \n*\n* var v = rand.assign( 2.0, 5.0, out );\n* // returns \n*\n* var bool = ( v === out );\n* // returns true\n*/\nsetReadOnly( Random.prototype, 'assign', function assign( param1, param2, out ) {\n\tif ( !isCollection( out ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be an array-like object. Value: `%s`.', out ) );\n\t}\n\t// NOTE: we could alternatively use the PRNG factory function to create a nullary PRNG function which applies parameters for each invocation; however, this would impose a one-time cost which is likely to be rather expensive when filling small arrays. The decision made here avoids this cost, despite a small cost due to repeatedly validating parameters for each generated pseudorandom value. Additionally, the current implementation has the added benefit that it mirrors the underlying PRNG where invalid parameters result in, e.g., a return value of `NaN` (however, realization of this benefit depends on the output array being a floating-point array).\n\tbinary( [ [ param1 ], [ param2 ], out ], [ out.length ], [ 0, 0, 1 ], this._prng ); // eslint-disable-line max-len\n\treturn out;\n});\n\n\n// EXPORTS //\n\nmodule.exports = Random;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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* Constructor for creating arrays filled with pseudorandom values drawn from a binary PRNG.\n*\n* @module @stdlib/random/array/tools/binary\n*\n* @example\n* var arcsine = require( '@stdlib/random/base/arcsine' );\n* var Random = require( '@stdlib/random/array/tools/binary' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var defaultDType = 'float64';\n*\n* var rand = new Random( arcsine, dtypes, defaultDType );\n*\n* var v = rand.generate( 10, 2.0, 5.0 );\n* // returns \n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar contains = require( '@stdlib/array/base/assert/contains' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Array} dtypes - list of supported output data types\n* @param {Options} options - function options\n* @param {string} [options.dtype] - output array data type\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var options = {\n* 'dtype': 'float64'\n* };\n* var err = validate( opts, dtypes, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, dtypes, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'dtype' ) ) {\n\t\topts.dtype = options.dtype;\n\t\tif ( !contains( dtypes, opts.dtype ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', dtypes.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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/* eslint-disable no-restricted-syntax, no-invalid-this */\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isStringArray = require( '@stdlib/assert/is-string-array' ).primitives;\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar contains = require( '@stdlib/array/base/assert/contains' );\nvar filledBy = require( '@stdlib/array/base/filled-by' );\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar ctors = require( '@stdlib/array/ctors' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Constructor for creating arrays filled with pseudorandom values drawn from a nullary PRNG.\n*\n* @constructor\n* @param {Function} prng - nullary pseudorandom value generator\n* @param {StringArray} dtypes - list of supported output data types\n* @param {string} dtype - default output data type\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} second argument must be an array of strings\n* @throws {TypeError} third argument must be a supported data type\n* @returns {Random} instance\n*\n* @example\n* var exponential = require( '@stdlib/random/base/exponential' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var defaultDType = 'float64';\n*\n* var rand = new Random( exponential.factory( 2.0 ), dtypes, defaultDType );\n*\n* var v = rand.generate( 10 );\n* // returns \n*/\nfunction Random( prng, dtypes, dtype ) {\n\tif ( !( this instanceof Random ) ) {\n\t\treturn new Random( prng, dtypes, dtype );\n\t}\n\tif ( !isFunction( prng ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', prng ) );\n\t}\n\t// TODO: tighten this up by actually validating that `dtypes` contains only recognized/supported dtype strings\n\tif ( !isStringArray( dtypes ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an array of strings. Value: `%s`.', dtypes ) );\n\t}\n\t// Require that the default output array data type be a member of the list of supported output array data types...\n\tif ( !contains( dtypes, dtype ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a supported data type. Value: `%s`.', dtype ) );\n\t}\n\tthis._prng = prng;\n\tthis._dtypes = dtypes;\n\tthis._dtype = dtype;\n\treturn this;\n}\n\n/**\n* Returns an array filled with pseudorandom values drawn from a nullary PRNG.\n*\n* @name generate\n* @memberof Random.prototype\n* @type {Function}\n* @param {NonNegativeInteger} len - number of elements\n* @param {Options} [options] - function options\n* @param {string} [options.dtype] - array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {Collection} output array\n*\n* @example\n* var exponential = require( '@stdlib/random/base/exponential' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var defaultDType = 'float64';\n*\n* var rand = new Random( exponential.factory( 2.0 ), dtypes, defaultDType );\n*\n* var v = rand.generate( 10 );\n* // returns \n*/\nsetReadOnly( Random.prototype, 'generate', function generate( len, options ) {\n\tvar ctor;\n\tvar opts;\n\tvar out;\n\tvar err;\n\tvar dt;\n\tif ( !isNonNegativeInteger( len ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t}\n\topts = {};\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, this._dtypes, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\tdt = opts.dtype || this._dtype;\n\tif ( dt === 'generic' ) {\n\t\treturn filledBy( len, this._prng );\n\t}\n\tctor = ctors( dt );\n\tout = new ctor( len );\n\tnullary( [ out ], [ len ], [ 1 ], this._prng );\n\treturn out;\n});\n\n/**\n* Fills an array with pseudorandom values drawn from a nullary PRNG.\n*\n* @name assign\n* @memberof Random.prototype\n* @type {Function}\n* @param {Collection} out - output array\n* @throws {TypeError} first argument must be a collection\n* @returns {Collection} output array\n*\n* @example\n* var exponential = require( '@stdlib/random/base/exponential' );\n* var zeros = require( '@stdlib/array/zeros' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var defaultDType = 'float64';\n*\n* var rand = new Random( exponential.factory( 2.0 ), dtypes, defaultDType );\n*\n* var out = zeros( 10, 'float64' );\n* // returns \n*\n* var v = rand.assign( out );\n* // returns \n*\n* var bool = ( v === out );\n* // returns true\n*/\nsetReadOnly( Random.prototype, 'assign', function assign( out ) {\n\tif ( !isCollection( out ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object. Value: `%s`.', out ) );\n\t}\n\tnullary( [ out ], [ out.length ], [ 1 ], this._prng );\n\treturn out;\n});\n\n\n// EXPORTS //\n\nmodule.exports = Random;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Constructor for creating arrays filled with pseudorandom values drawn from a nullary PRNG.\n*\n* @module @stdlib/random/array/tools/nullary\n*\n* @example\n* var exponential = require( '@stdlib/random/base/exponential' );\n* var Random = require( '@stdlib/random/array/tools/nullary' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var defaultDType = 'float64';\n*\n* var rand = new Random( exponential.factory( 2.0 ), dtypes, defaultDType );\n*\n* var v = rand.generate( 10 );\n* // returns \n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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 setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar isStringArray = require( '@stdlib/assert/is-string-array' ).primitives;\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isMethodIn = require( '@stdlib/assert/is-method-in' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar contains = require( '@stdlib/array/base/assert/contains' ).factory;\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar BinaryRandom = require( './../../../../array/tools/binary' );\nvar NullaryRandom = require( './../../../../array/tools/nullary' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a factory function for generating pseudorandom values drawn from a binary PRNG.\n*\n* @param {Function} prng - binary pseudorandom value generator\n* @param {Function} prng.factory - method which returns a new binary pseudorandom value generator\n* @param {StringArray} dtypes - list of supported output array data types\n* @param {string} dtype - default output array data type\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} first argument must have a `factory` method\n* @throws {TypeError} second argument must be an array of strings\n* @throws {TypeError} third argument must be a supported output array data type\n* @returns {Function} function which returns a function for creating arrays\n*\n* @example\n* var arcsine = require( '@stdlib/random/base/arcsine' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n*\n* var factory = createFactory( arcsine, dtypes, 'float64' );\n* // returns \n*\n* var random = factory();\n* // returns \n*\n* var x = random( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arcsine = require( '@stdlib/random/base/arcsine' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n*\n* var factory = createFactory( arcsine, dtypes, 'float64' );\n* // returns \n*\n* var random = factory();\n* // returns \n*\n* var x = random( 10, 2.0, 5.0, {\n* 'dtype': 'float32'\n* });\n* // returns \n*/\nfunction createFactory( prng, dtypes, dtype ) {\n\tvar isValidDataType;\n\tif ( !isFunction( prng ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', prng ) );\n\t}\n\tif ( !isMethodIn( prng, 'factory' ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must have a `%s` method.', 'factory' ) );\n\t}\n\t// TODO: tighten this up by actually validating that `dtypes` contains only recognized/supported dtype strings\n\tif ( !isStringArray( dtypes ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must an array of strings. Value: `%s`.', dtypes ) );\n\t}\n\t// Require that the default output array data type be a member of the list of supported output array data types...\n\tif ( !contains( dtypes, dtype ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a supported data type. Value: `%s`.', dtype ) );\n\t}\n\tisValidDataType = contains( dtypes );\n\treturn factory;\n\n\t/**\n\t* Returns a function for generating pseudorandom values drawn from a PRNG.\n\t*\n\t* @private\n\t* @param {*} [param1] - first PRNG parameter\n\t* @param {*} [param2] - second PRNG parameter\n\t* @param {Options} [options] - function options\n\t* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n\t* @param {*} [options.seed] - pseudorandom value generator seed\n\t* @param {*} [options.state] - pseudorandom value generator state\n\t* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom value generator state\n\t* @param {string} [options.dtype] - default output array data type\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {Function} function for creating arrays\n\t*/\n\tfunction factory() {\n\t\tvar Random;\n\t\tvar random;\n\t\tvar param1;\n\t\tvar param2;\n\t\tvar assign;\n\t\tvar nargs;\n\t\tvar base;\n\t\tvar opts;\n\t\tvar rand;\n\t\tvar dt;\n\n\t\tnargs = arguments.length;\n\t\tif ( nargs < 1 ) { // e.g., factory()\n\t\t\topts = {};\n\t\t\tbase = prng;\n\t\t\trand = rand1;\n\t\t} else if ( nargs === 1 ) { // e.g., factory( {} )\n\t\t\topts = arguments[ 0 ];\n\t\t\tbase = prng.factory( opts );\n\t\t\trand = rand1;\n\t\t} else if ( nargs === 2 ) { // e.g., factory( param1, param2 )\n\t\t\tparam1 = arguments[ 0 ];\n\t\t\tparam2 = arguments[ 1 ];\n\t\t\topts = {};\n\t\t\tbase = prng.factory( param1, param2 );\n\t\t\trand = rand2;\n\t\t} else { // e.g., factory( param1, param2, {} )\n\t\t\tparam1 = arguments[ 0 ];\n\t\t\tparam2 = arguments[ 1 ];\n\t\t\topts = arguments[ 2 ];\n\t\t\tbase = prng.factory( param1, param2, opts );\n\t\t\trand = rand2;\n\t\t}\n\t\tif ( hasOwnProp( opts, 'dtype' ) ) {\n\t\t\tdt = opts.dtype;\n\t\t\tif ( !isValidDataType( dt ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', dtypes.join( '\", \"' ), dt ) );\n\t\t\t}\n\t\t} else {\n\t\t\tdt = dtype;\n\t\t}\n\t\tif ( rand === rand1 ) {\n\t\t\tassign = assign1;\n\t\t\tRandom = BinaryRandom;\n\t\t} else {\n\t\t\tassign = assign2;\n\t\t\tRandom = NullaryRandom;\n\t\t}\n\t\trandom = new Random( base, dtypes, dt );\n\t\tif ( opts && opts.prng ) {\n\t\t\tsetReadOnly( rand, 'seed', null );\n\t\t\tsetReadOnly( rand, 'seedLength', null );\n\t\t\tsetReadWriteAccessor( rand, 'state', constantFunction( null ), noop );\n\t\t\tsetReadOnly( rand, 'stateLength', null );\n\t\t\tsetReadOnly( rand, 'byteLength', null );\n\t\t} else {\n\t\t\tsetReadOnlyAccessor( rand, 'seed', getSeed );\n\t\t\tsetReadOnlyAccessor( rand, 'seedLength', getSeedLength );\n\t\t\tsetReadWriteAccessor( rand, 'state', getState, setState );\n\t\t\tsetReadOnlyAccessor( rand, 'stateLength', getStateLength );\n\t\t\tsetReadOnlyAccessor( rand, 'byteLength', getStateSize );\n\t\t}\n\t\tsetReadOnly( rand, 'PRNG', base.PRNG );\n\t\tsetReadOnly( rand, 'assign', assign );\n\t\treturn rand;\n\n\t\t/**\n\t\t* Returns an array of pseudorandom values drawn from a PRNG.\n\t\t*\n\t\t* @private\n\t\t* @param {NonNegativeInteger} len - output array length\n\t\t* @param {*} param1 - first PRNG parameter\n\t\t* @param {*} param2 - second PRNG parameter\n\t\t* @param {Options} [options] - function options\n\t\t* @param {string} [options.dtype] - output array data type\n\t\t* @throws {TypeError} first argument must be a nonnegative integer\n\t\t* @throws {TypeError} options argument must be an object\n\t\t* @throws {TypeError} must provide valid options\n\t\t* @returns {Collection} output array\n\t\t*/\n\t\tfunction rand1( len, param1, param2, options ) {\n\t\t\tif ( arguments.length < 4 ) {\n\t\t\t\treturn random.generate( len, param1, param2 );\n\t\t\t}\n\t\t\treturn random.generate( len, param1, param2, options );\n\t\t}\n\n\t\t/**\n\t\t* Returns an array of pseudorandom values drawn from a PRNG.\n\t\t*\n\t\t* @private\n\t\t* @param {NonNegativeInteger} len - output array length\n\t\t* @param {Options} [options] - function options\n\t\t* @param {string} [options.dtype] - output array data type\n\t\t* @throws {TypeError} first argument must be a nonnegative integer\n\t\t* @throws {TypeError} options argument must be an object\n\t\t* @throws {TypeError} must provide valid options\n\t\t* @returns {Collection} output array\n\t\t*/\n\t\tfunction rand2( len, options ) {\n\t\t\tif ( arguments.length < 2 ) {\n\t\t\t\treturn random.generate( len );\n\t\t\t}\n\t\t\treturn random.generate( len, options );\n\t\t}\n\n\t\t/**\n\t\t* Fills an array with pseudorandom values drawn from a PRNG.\n\t\t*\n\t\t* @private\n\t\t* @param {*} param1 - first PRNG parameter\n\t\t* @param {*} param2 - second PRNG parameter\n\t\t* @param {Collection} out - output array\n\t\t* @throws {TypeError} third argument must be a collection\n\t\t* @returns {Collection} output array\n\t\t*/\n\t\tfunction assign1( param1, param2, out ) {\n\t\t\treturn random.assign( param1, param2, out );\n\t\t}\n\n\t\t/**\n\t\t* Fills an array with pseudorandom values drawn from a PRNG.\n\t\t*\n\t\t* @private\n\t\t* @param {Collection} out - output array\n\t\t* @throws {TypeError} first argument must be a collection\n\t\t* @returns {Collection} output array\n\t\t*/\n\t\tfunction assign2( out ) {\n\t\t\treturn random.assign( out );\n\t\t}\n\n\t\t/**\n\t\t* Returns the PRNG seed.\n\t\t*\n\t\t* @private\n\t\t* @returns {*} seed\n\t\t*/\n\t\tfunction getSeed() {\n\t\t\treturn rand.PRNG.seed;\n\t\t}\n\n\t\t/**\n\t\t* Returns the PRNG seed length.\n\t\t*\n\t\t* @private\n\t\t* @returns {PositiveInteger} seed length\n\t\t*/\n\t\tfunction getSeedLength() {\n\t\t\treturn rand.PRNG.seedLength;\n\t\t}\n\n\t\t/**\n\t\t* Returns the PRNG state length.\n\t\t*\n\t\t* @private\n\t\t* @returns {PositiveInteger} state length\n\t\t*/\n\t\tfunction getStateLength() {\n\t\t\treturn rand.PRNG.stateLength;\n\t\t}\n\n\t\t/**\n\t\t* Returns the PRNG state size (in bytes).\n\t\t*\n\t\t* @private\n\t\t* @returns {PositiveInteger} state size (in bytes)\n\t\t*/\n\t\tfunction getStateSize() {\n\t\t\treturn rand.PRNG.byteLength;\n\t\t}\n\n\t\t/**\n\t\t* Returns the current pseudorandom number generator state.\n\t\t*\n\t\t* @private\n\t\t* @returns {*} current state\n\t\t*/\n\t\tfunction getState() {\n\t\t\treturn rand.PRNG.state;\n\t\t}\n\n\t\t/**\n\t\t* Sets the pseudorandom number generator state.\n\t\t*\n\t\t* @private\n\t\t* @param {*} s - generator state\n\t\t* @throws {Error} must provide a valid state\n\t\t*/\n\t\tfunction setState( s ) {\n\t\t\trand.PRNG.state = s;\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = createFactory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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* Create a factory function for generating pseudorandom values drawn from a binary PRNG.\n*\n* @module @stdlib/random/array/tools/binary-factory\n*\n* @example\n* var arcsine = require( '@stdlib/random/base/arcsine' );\n* var binaryFactory = require( '@stdlib/random/array/tools/binary-factory' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n*\n* var factory = binaryFactory( arcsine, dtypes, 'float64' );\n* // returns \n*\n* var random = factory();\n* // returns \n*\n* var x = random( 10, 2.0, 5.0 );\n* // returns \n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 \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 \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 \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 \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). .\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 \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 \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", "/**\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 isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar isnan = require( '@stdlib/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Validates values provided for minimum and maximum support.\n*\n* @private\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( a, b ) {\n\tif ( !isNumber( a ) || isnan( a ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', a ) );\n\t}\n\tif ( !isNumber( b ) || isnan( b ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a number and not NaN. Value: `%s`.', b ) );\n\t}\n\tif ( a >= b ) {\n\t\treturn new RangeError( format( 'invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.', a, b ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 pow = require( '@stdlib/math/base/special/pow' );\nvar sin = require( '@stdlib/math/base/special/sin' );\nvar HALF_PI = require( '@stdlib/constants/float64/half-pi' );\n\n\n// MAIN //\n\n/**\n* Returns an arcsine distributed pseudorandom number with minimum support `a` and maximum support `b`.\n*\n* @private\n* @param {PRNG} rand - pseudorandom number generator\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @returns {number} pseudorandom number\n*/\nfunction arcsine( rand, a, b ) {\n\treturn a + ( pow( sin( HALF_PI*rand() ), 2.0 ) * ( b-a ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = arcsine;\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 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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar arcsine0 = require( './arcsine.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating arcsine distributed random numbers.\n*\n* @param {number} [a] - minimum support\n* @param {number} [b] - maximum support\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {RangeError} `a` must be less than `b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var arcsine = factory( 0.0, 1.0 );\n*\n* var v = arcsine();\n* // returns \n*\n* @example\n* var arcsine = factory( -3.0, -1.0, {\n* 'seed': 297\n* });\n* var v = arcsine();\n* // returns \n*/\nfunction factory() {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar a;\n\tvar b;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\ta = arguments[ 0 ];\n\t\tb = arguments[ 1 ];\n\t\terr = validate( a, b );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( a === void 0 ) {\n\t\tprng = arcsine2;\n\t} else {\n\t\tprng = arcsine1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'arcsine' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\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 = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( a === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ a, b ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a arcsine distributed pseudorandom number with minimum support `a` and maximum support `b`.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = arcsine1();\n\t* // returns \n\t*/\n\tfunction arcsine1() {\n\t\treturn arcsine0( rand, a, b );\n\t}\n\n\t/**\n\t* Returns an arcsine distributed pseudorandom number with minimum support `a` and maximum support `b`.\n\t*\n\t* @private\n\t* @param {number} a - minimum support\n\t* @param {number} b - maximum support\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = arcsine2( 0.0, 1.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = arcsine2( 1.0, 0.0 );\n\t* // returns NaN\n\t*/\n\tfunction arcsine2( a, b ) {\n\t\tif (\n\t\t\tisnan( a ) ||\n\t\t\tisnan( b ) ||\n\t\t\ta >= b\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn arcsine0( rand, a, b );\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' );\n\n\n// MAIN //\n\n/**\n* Returns an arcsine distributed pseudorandom number with minimum support `a` and maximum support `b`.\n*\n* @name arcsine\n* @type {PRNG}\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = arcsine( 0.0, 1.0 );\n* // returns \n*/\nvar arcsine = factory();\n\n\n// EXPORTS //\n\nmodule.exports = arcsine;\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* Arcsine distribution pseudorandom numbers.\n*\n* @module @stdlib/random/base/arcsine\n*\n* @example\n* var arcsine = require( '@stdlib/random/base/arcsine' );\n*\n* var v = arcsine( 0.0, 1.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/arcsine' ).factory;\n*\n* var arcsine = factory( -5.0, 5.0, {\n* 'seed': 297\n* });\n*\n* var v = arcsine();\n* // returns \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", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 binaryFactory = require( './../../../array/tools/binary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/arcsine' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from an arcsine distribution.\n*\n* @name factory\n* @type {Function}\n* @param {number} [a] - minimum support\n* @param {number} [b] - maximum support\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var arcsine = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = arcsine( 10 );\n* // returns \n*\n* @example\n* var arcsine = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = arcsine( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = binaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from an arcsine distribution.\n*\n* @name arcsine\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = arcsine( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = arcsine( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar arcsine = factory();\n\n\n// EXPORTS //\n\nmodule.exports = arcsine;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create an array containing pseudorandom numbers drawn from an arcsine distribution.\n*\n* @module @stdlib/random/array/arcsine\n*\n* @example\n* var arcsine = require( '@stdlib/random/array/arcsine' );\n*\n* var arr = arcsine( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arcsine = require( '@stdlib/random/array/arcsine' );\n*\n* var arr = arcsine( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var arcsine = require( '@stdlib/random/array/arcsine' );\n*\n* var rand = arcsine.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var arcsine = require( '@stdlib/random/array/arcsine' );\n*\n* var rand = arcsine.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar contains = require( '@stdlib/array/base/assert/contains' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Array} dtypes - list of supported output data types\n* @param {Options} options - function options\n* @param {string} [options.dtype] - output array data type\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var options = {\n* 'dtype': 'float64'\n* };\n* var err = validate( opts, dtypes, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, dtypes, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'dtype' ) ) {\n\t\topts.dtype = options.dtype;\n\t\tif ( !contains( dtypes, opts.dtype ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', dtypes.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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/* eslint-disable no-restricted-syntax, no-invalid-this */\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isStringArray = require( '@stdlib/assert/is-string-array' ).primitives;\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar contains = require( '@stdlib/array/base/assert/contains' );\nvar filledBy = require( '@stdlib/array/base/filled-by' );\nvar unary = require( '@stdlib/strided/base/unary' );\nvar ctors = require( '@stdlib/array/ctors' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Constructor for creating arrays filled with pseudorandom values drawn from a unary PRNG.\n*\n* @constructor\n* @param {Function} prng - unary pseudorandom value generator\n* @param {StringArray} dtypes - list of supported output data types\n* @param {string} dtype - default output data type\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} second argument must be an array of strings\n* @throws {TypeError} third argument must be a supported data type\n* @returns {Random} instance\n*\n* @example\n* var exponential = require( '@stdlib/random/base/exponential' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var defaultDType = 'float64';\n*\n* var rand = new Random( exponential, dtypes, defaultDType );\n*\n* var v = rand.generate( 10, 2.0 );\n* // returns \n*/\nfunction Random( prng, dtypes, dtype ) {\n\tif ( !( this instanceof Random ) ) {\n\t\treturn new Random( prng, dtypes, dtype );\n\t}\n\tif ( !isFunction( prng ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', prng ) );\n\t}\n\t// TODO: tighten this up by actually validating that `dtypes` contains only recognized/supported dtype strings\n\tif ( !isStringArray( dtypes ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an array of strings. Value: `%s`.', dtypes ) );\n\t}\n\t// Require that the default output array data type be a member of the list of supported output array data types...\n\tif ( !contains( dtypes, dtype ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a supported data type. Value: `%s`.', dtype ) );\n\t}\n\tthis._prng = prng;\n\tthis._dtypes = dtypes;\n\tthis._dtype = dtype;\n\treturn this;\n}\n\n/**\n* Returns an array filled with pseudorandom values drawn from a unary PRNG.\n*\n* @name generate\n* @memberof Random.prototype\n* @type {Function}\n* @param {NonNegativeInteger} len - number of elements\n* @param {*} param1 - PRNG parameter\n* @param {Options} [options] - function options\n* @param {string} [options.dtype] - array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {Collection} output array\n*\n* @example\n* var exponential = require( '@stdlib/random/base/exponential' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var defaultDType = 'float64';\n*\n* var rand = new Random( exponential, dtypes, defaultDType );\n*\n* var v = rand.generate( 10, 2.0 );\n* // returns \n*/\nsetReadOnly( Random.prototype, 'generate', function generate( len, param1, options ) {\n\tvar ctor;\n\tvar opts;\n\tvar prng;\n\tvar out;\n\tvar err;\n\tvar dt;\n\tif ( !isNonNegativeInteger( len ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t}\n\topts = {};\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, this._dtypes, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// NOTE: we could alternatively use the PRNG factory function to create a nullary PRNG function which applies parameters for each invocation; however, this would impose a one-time cost which is likely to be rather expensive when generating small arrays. The decision made here avoids this cost, despite a small cost due to repeatedly validating parameters for each generated pseudorandom value. Additionally, the current implementation has the added benefit that it mirrors the underlying PRNG where invalid parameters result in, e.g., a return value of `NaN` (however, realization of this benefit depends on the output array being a floating-point array).\n\tprng = this._prng;\n\tdt = opts.dtype || this._dtype;\n\tif ( dt === 'generic' ) {\n\t\treturn filledBy( len, wrapper );\n\t}\n\tctor = ctors( dt );\n\tout = new ctor( len );\n\tunary( [ [ param1 ], out ], [ len ], [ 0, 1 ], prng );\n\treturn out;\n\n\t/**\n\t* Applies parameters to a pseudorandom value generator function.\n\t*\n\t* @private\n\t* @returns {*} pseudorandom value\n\t*/\n\tfunction wrapper() {\n\t\treturn prng( param1 );\n\t}\n});\n\n/**\n* Fills an array with pseudorandom values drawn from a unary PRNG.\n*\n* @name assign\n* @memberof Random.prototype\n* @type {Function}\n* @param {*} param1 - PRNG parameter\n* @param {Collection} out - output array\n* @throws {TypeError} second argument must be a collection\n* @returns {Collection} output array\n*\n* @example\n* var exponential = require( '@stdlib/random/base/exponential' );\n* var zeros = require( '@stdlib/array/zeros' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var defaultDType = 'float64';\n*\n* var rand = new Random( exponential, dtypes, defaultDType );\n*\n* var out = zeros( 10, 'float64' );\n* // returns \n*\n* var v = rand.assign( 2.0, out );\n* // returns \n*\n* var bool = ( v === out );\n* // returns true\n*/\nsetReadOnly( Random.prototype, 'assign', function assign( param1, out ) {\n\tif ( !isCollection( out ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an array-like object. Value: `%s`.', out ) );\n\t}\n\t// NOTE: we could alternatively use the PRNG factory function to create a nullary PRNG function which applies parameters for each invocation; however, this would impose a one-time cost which is likely to be rather expensive when filling small arrays. The decision made here avoids this cost, despite a small cost due to repeatedly validating parameters for each generated pseudorandom value. Additionally, the current implementation has the added benefit that it mirrors the underlying PRNG where invalid parameters result in, e.g., a return value of `NaN` (however, realization of this benefit depends on the output array being a floating-point array).\n\tunary( [ [ param1 ], out ], [ out.length ], [ 0, 1 ], this._prng );\n\treturn out;\n});\n\n\n// EXPORTS //\n\nmodule.exports = Random;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Constructor for creating arrays filled with pseudorandom values drawn from a unary PRNG.\n*\n* @module @stdlib/random/array/tools/unary\n*\n* @example\n* var exponential = require( '@stdlib/random/base/exponential' );\n* var Random = require( '@stdlib/random/array/tools/unary' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var defaultDType = 'float64';\n*\n* var rand = new Random( exponential, dtypes, defaultDType );\n*\n* var v = rand.generate( 10, 2.0 );\n* // returns \n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar isStringArray = require( '@stdlib/assert/is-string-array' ).primitives;\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isMethodIn = require( '@stdlib/assert/is-method-in' );\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar contains = require( '@stdlib/array/base/assert/contains' ).factory;\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar UnaryRandom = require( './../../../../array/tools/unary' );\nvar NullaryRandom = require( './../../../../array/tools/nullary' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a factory function for generating pseudorandom values drawn from a unary PRNG.\n*\n* @param {Function} prng - unary pseudorandom value generator\n* @param {Function} prng.factory - method which returns a new unary pseudorandom value generator\n* @param {StringArray} dtypes - list of supported output array data types\n* @param {string} dtype - default output array data type\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} first argument must have a `factory` method\n* @throws {TypeError} second argument must be an array of strings\n* @throws {TypeError} third argument must be a supported output array data type\n* @returns {Function} function which returns a function for creating arrays\n*\n* @example\n* var exponential = require( '@stdlib/random/base/exponential' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n*\n* var factory = createFactory( exponential, dtypes, 'float64' );\n* // returns \n*\n* var random = factory();\n* // returns \n*\n* var x = random( 10, 2.0 );\n* // returns \n*\n* @example\n* var exponential = require( '@stdlib/random/base/exponential' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n*\n* var factory = createFactory( exponential, dtypes, 'float64' );\n* // returns \n*\n* var random = factory();\n* // returns \n*\n* var x = random( 10, 2.0, {\n* 'dtype': 'float32'\n* });\n* // returns \n*/\nfunction createFactory( prng, dtypes, dtype ) {\n\tvar isValidDataType;\n\tif ( !isFunction( prng ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', prng ) );\n\t}\n\tif ( !isMethodIn( prng, 'factory' ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must have a `%s` method.', 'factory' ) );\n\t}\n\t// TODO: tighten this up by actually validating that `dtypes` contains only recognized/supported dtype strings\n\tif ( !isStringArray( dtypes ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must an array of strings. Value: `%s`.', dtypes ) );\n\t}\n\t// Require that the default output array data type be a member of the list of supported output array data types...\n\tif ( !contains( dtypes, dtype ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a supported data type. Value: `%s`.', dtype ) );\n\t}\n\tisValidDataType = contains( dtypes );\n\treturn factory;\n\n\t/**\n\t* Returns a function for generating pseudorandom values drawn from a PRNG.\n\t*\n\t* @private\n\t* @param {*} [param1] - PRNG parameter\n\t* @param {Options} [options] - function options\n\t* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n\t* @param {*} [options.seed] - pseudorandom value generator seed\n\t* @param {*} [options.state] - pseudorandom value generator state\n\t* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom value generator state\n\t* @param {string} [options.dtype] - default output array data type\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {Function} function for creating arrays\n\t*/\n\tfunction factory() {\n\t\tvar Random;\n\t\tvar random;\n\t\tvar param1;\n\t\tvar assign;\n\t\tvar nargs;\n\t\tvar base;\n\t\tvar opts;\n\t\tvar rand;\n\t\tvar dt;\n\n\t\tnargs = arguments.length;\n\t\tif ( nargs < 1 ) { // e.g., factory()\n\t\t\topts = {};\n\t\t\tbase = prng;\n\t\t\trand = rand1;\n\t\t} else if ( nargs > 1 ) { // e.g., factory( param1, {} )\n\t\t\tparam1 = arguments[ 0 ];\n\t\t\topts = arguments[ 1 ];\n\t\t\tbase = prng.factory( param1, opts );\n\t\t\trand = rand2;\n\t\t} else if ( isPlainObject( arguments[ 0 ] ) ) { // e.g., factory( {} )\n\t\t\topts = arguments[ 0 ];\n\t\t\tbase = prng.factory( opts );\n\t\t\trand = rand1;\n\t\t} else { // e.g., factory( param1 )\n\t\t\tparam1 = arguments[ 0 ];\n\t\t\topts = {};\n\t\t\tbase = prng.factory( param1 );\n\t\t\trand = rand2;\n\t\t}\n\t\tif ( hasOwnProp( opts, 'dtype' ) ) {\n\t\t\tdt = opts.dtype;\n\t\t\tif ( !isValidDataType( dt ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', dtypes.join( '\", \"' ), dt ) );\n\t\t\t}\n\t\t} else {\n\t\t\tdt = dtype;\n\t\t}\n\t\tif ( rand === rand1 ) {\n\t\t\tassign = assign1;\n\t\t\tRandom = UnaryRandom;\n\t\t} else {\n\t\t\tassign = assign2;\n\t\t\tRandom = NullaryRandom;\n\t\t}\n\t\trandom = new Random( base, dtypes, dt );\n\t\tif ( opts && opts.prng ) {\n\t\t\tsetReadOnly( rand, 'seed', null );\n\t\t\tsetReadOnly( rand, 'seedLength', null );\n\t\t\tsetReadWriteAccessor( rand, 'state', constantFunction( null ), noop );\n\t\t\tsetReadOnly( rand, 'stateLength', null );\n\t\t\tsetReadOnly( rand, 'byteLength', null );\n\t\t} else {\n\t\t\tsetReadOnlyAccessor( rand, 'seed', getSeed );\n\t\t\tsetReadOnlyAccessor( rand, 'seedLength', getSeedLength );\n\t\t\tsetReadWriteAccessor( rand, 'state', getState, setState );\n\t\t\tsetReadOnlyAccessor( rand, 'stateLength', getStateLength );\n\t\t\tsetReadOnlyAccessor( rand, 'byteLength', getStateSize );\n\t\t}\n\t\tsetReadOnly( rand, 'PRNG', base.PRNG );\n\t\tsetReadOnly( rand, 'assign', assign );\n\t\treturn rand;\n\n\t\t/**\n\t\t* Returns an array of pseudorandom values drawn from a PRNG.\n\t\t*\n\t\t* @private\n\t\t* @param {NonNegativeInteger} len - output array length\n\t\t* @param {*} param1 - PRNG parameter\n\t\t* @param {Options} [options] - function options\n\t\t* @param {string} [options.dtype] - output array data type\n\t\t* @throws {TypeError} first argument must be a nonnegative integer\n\t\t* @throws {TypeError} options argument must be an object\n\t\t* @throws {TypeError} must provide valid options\n\t\t* @returns {Collection} output array\n\t\t*/\n\t\tfunction rand1( len, param1, options ) {\n\t\t\tif ( arguments.length < 3 ) {\n\t\t\t\treturn random.generate( len, param1 );\n\t\t\t}\n\t\t\treturn random.generate( len, param1, options );\n\t\t}\n\n\t\t/**\n\t\t* Returns an array of pseudorandom values drawn from a PRNG.\n\t\t*\n\t\t* @private\n\t\t* @param {NonNegativeInteger} len - output array length\n\t\t* @param {Options} [options] - function options\n\t\t* @param {string} [options.dtype] - output array data type\n\t\t* @throws {TypeError} first argument must be a nonnegative integer\n\t\t* @throws {TypeError} options argument must be an object\n\t\t* @throws {TypeError} must provide valid options\n\t\t* @returns {Collection} output array\n\t\t*/\n\t\tfunction rand2( len, options ) {\n\t\t\tif ( arguments.length < 2 ) {\n\t\t\t\treturn random.generate( len );\n\t\t\t}\n\t\t\treturn random.generate( len, options );\n\t\t}\n\n\t\t/**\n\t\t* Fills an array with pseudorandom values drawn from a PRNG.\n\t\t*\n\t\t* @private\n\t\t* @param {*} param1 - PRNG parameter\n\t\t* @param {Collection} out - output array\n\t\t* @throws {TypeError} second argument must be a collection\n\t\t* @returns {Collection} output array\n\t\t*/\n\t\tfunction assign1( param1, out ) {\n\t\t\treturn random.assign( param1, out );\n\t\t}\n\n\t\t/**\n\t\t* Fills an array with pseudorandom values drawn from a PRNG.\n\t\t*\n\t\t* @private\n\t\t* @param {Collection} out - output array\n\t\t* @throws {TypeError} first argument must be a collection\n\t\t* @returns {Collection} output array\n\t\t*/\n\t\tfunction assign2( out ) {\n\t\t\treturn random.assign( out );\n\t\t}\n\n\t\t/**\n\t\t* Returns the PRNG seed.\n\t\t*\n\t\t* @private\n\t\t* @returns {*} seed\n\t\t*/\n\t\tfunction getSeed() {\n\t\t\treturn rand.PRNG.seed;\n\t\t}\n\n\t\t/**\n\t\t* Returns the PRNG seed length.\n\t\t*\n\t\t* @private\n\t\t* @returns {PositiveInteger} seed length\n\t\t*/\n\t\tfunction getSeedLength() {\n\t\t\treturn rand.PRNG.seedLength;\n\t\t}\n\n\t\t/**\n\t\t* Returns the PRNG state length.\n\t\t*\n\t\t* @private\n\t\t* @returns {PositiveInteger} state length\n\t\t*/\n\t\tfunction getStateLength() {\n\t\t\treturn rand.PRNG.stateLength;\n\t\t}\n\n\t\t/**\n\t\t* Returns the PRNG state size (in bytes).\n\t\t*\n\t\t* @private\n\t\t* @returns {PositiveInteger} state size (in bytes)\n\t\t*/\n\t\tfunction getStateSize() {\n\t\t\treturn rand.PRNG.byteLength;\n\t\t}\n\n\t\t/**\n\t\t* Returns the current pseudorandom number generator state.\n\t\t*\n\t\t* @private\n\t\t* @returns {*} current state\n\t\t*/\n\t\tfunction getState() {\n\t\t\treturn rand.PRNG.state;\n\t\t}\n\n\t\t/**\n\t\t* Sets the pseudorandom number generator state.\n\t\t*\n\t\t* @private\n\t\t* @param {*} s - generator state\n\t\t* @throws {Error} must provide a valid state\n\t\t*/\n\t\tfunction setState( s ) {\n\t\t\trand.PRNG.state = s;\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = createFactory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create a factory function for generating pseudorandom values drawn from a unary PRNG.\n*\n* @module @stdlib/random/array/tools/unary-factory\n*\n* @example\n* var exponential = require( '@stdlib/random/base/exponential' );\n* var unaryFactory = require( '@stdlib/random/array/tools/unary-factory' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n*\n* var factory = unaryFactory( exponential, dtypes, 'float64' );\n* // returns \n*\n* var random = factory();\n* // returns \n*\n* var x = random( 10, 2.0 );\n* // returns \n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar isProbability = require( '@stdlib/assert/is-probability' ).isPrimitive;\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating Bernoulli distributed random numbers.\n*\n* @param {Probability} [p] - success probability\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} `p` must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var bernoulli = factory( 0.5 );\n* var v = bernoulli();\n* // returns \n*\n* @example\n* var bernoulli = factory( 0.8, {\n* 'seed': 297\n* });\n* var v = bernoulli();\n* // returns \n*\n* @example\n* var bernoulli = factory();\n* var v = bernoulli( 0.5 );\n* // returns \n*/\nfunction factory() {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar p;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if (\n\t\targuments.length === 1 &&\n\t\tisObject( arguments[ 0 ] )\n\t) {\n\t\topts = arguments[ 0 ];\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tp = arguments[ 0 ];\n\t\tif ( !isProbability( p ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a probability. Value: `%s`.', p ) );\n\t\t}\n\t\tif ( arguments.length > 1 ) {\n\t\t\topts = arguments[ 1 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( p === void 0 ) {\n\t\tprng = bernoulli2;\n\t} else {\n\t\tprng = bernoulli1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'bernoulli' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\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 = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( p === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ p ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Bernoulli distribution with bound parameter `p`.\n\t*\n\t* @private\n\t* @returns {NonNegativeInteger} pseudorandom number\n\t*\n\t* @example\n\t* var v = bernoulli1();\n\t* // returns \n\t*/\n\tfunction bernoulli1() {\n\t\treturn ( rand() <= p ) ? 1 : 0;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Bernoulli distribution with parameter `p`.\n\t*\n\t* @private\n\t* @param {Probability} p - success probability\n\t* @returns {NonNegativeInteger} pseudorandom number\n\t*\n\t* @example\n\t* var v = bernoulli2( 0.5 );\n\t* // returns \n\t*/\n\tfunction bernoulli2( p ) {\n\t\tif (\n\t\t\tisnan( p ) ||\n\t\t\tp < 0.0 ||\n\t\t\tp > 1.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn ( rand() <= p ) ? 1 : 0;\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' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom random number drawn from a Bernoulli distribution with parameter `p`.\n*\n* @name bernoulli\n* @type {PRNG}\n* @param {Probability} p - success probability\n* @returns {NonNegativeInteger} pseudorandom number\n*\n* @example\n* var v = bernoulli( 0.5 );\n* // returns \n*\n* @example\n* var v = bernoulli( 3.14 );\n* // returns NaN\n*\n* @example\n* var v = bernoulli( -1.0 );\n* // returns NaN\n*\n* @example\n* var v = bernoulli( NaN );\n* // returns NaN\n*/\nvar bernoulli = factory();\n\n\n// EXPORTS //\n\nmodule.exports = bernoulli;\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* Bernoulli distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/bernoulli\n*\n* @example\n* var bernoulli = require( '@stdlib/random/base/bernoulli' );\n*\n* var v = bernoulli( 0.5 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/bernoulli' ).factory;\n*\n* var bernoulli = factory( 0.3, {\n* 'seed': 297\n* });\n*\n* var v = bernoulli();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/bernoulli' ).factory;\n*\n* var bernoulli = factory({\n* 'seed': 297\n* });\n*\n* var v = bernoulli( 0.5 );\n* // returns \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", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 unaryFactory = require( './../../../array/tools/unary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/bernoulli' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a Bernoulli distribution.\n*\n* @name factory\n* @type {Function}\n* @param {Probability} [p] - success probability\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `p` must be a probability (i.e., a number on the interval [0,1])\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var bernoulli = factory( 0.5 );\n* // returns \n*\n* var arr = bernoulli( 10 );\n* // returns \n*\n* @example\n* var bernoulli = factory( 0.5 );\n* // returns \n*\n* var arr = bernoulli( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = unaryFactory( base, DTYPES, defaults.get( 'dtypes.real' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a Bernoulli distribution.\n*\n* @name bernoulli\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {Probability} p - success probability\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = bernoulli( 10, 0.5 );\n* // returns \n*\n* @example\n* var arr = bernoulli( 10, 0.5, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar bernoulli = factory();\n\n\n// EXPORTS //\n\nmodule.exports = bernoulli;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create an array containing pseudorandom numbers drawn from a Bernoulli distribution.\n*\n* @module @stdlib/random/array/bernoulli\n*\n* @example\n* var bernoulli = require( '@stdlib/random/array/bernoulli' );\n*\n* var arr = bernoulli( 10, 0.5 );\n* // returns \n*\n* @example\n* var bernoulli = require( '@stdlib/random/array/bernoulli' );\n*\n* var arr = bernoulli( 10, 0.5, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var bernoulli = require( '@stdlib/random/array/bernoulli' );\n*\n* var rand = bernoulli.factory( 0.5 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var bernoulli = require( '@stdlib/random/array/bernoulli' );\n*\n* var rand = bernoulli.factory( 0.5 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\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 sqrt = require( '@stdlib/math/base/special/sqrt' );\nvar exp = require( '@stdlib/math/base/special/exp' );\nvar ln = require( '@stdlib/math/base/special/ln' );\n\n\n// VARIABLES //\n\n// (R*phi(R) + Pr(X>=R))*sqrt(2\\pi)\nvar V = 9.91256303526217e-3;\n\n\n// MAIN //\n\n/**\n* Returns an array containing coordinates such that each rectangle has the same area.\n*\n* @private\n* @param {PositiveInteger} N - number of rectangles\n* @param {number} rTail - start of right tail\n* @returns {NumberArray} coordinate array\n*\n* @example\n* var X = coordsArray( 128, 3.44 );\n* // returns \n*/\nfunction coordsArray( N, rTail ) {\n\tvar X;\n\tvar f;\n\tvar i;\n\n\tf = exp( -0.5 * rTail * rTail );\n\n\tX = [];\n\tX.push( V/f ); // bottom block: V / f(R)\n\tX.push( rTail );\n\tfor ( i = 2; i < N; i++ ) {\n\t\tX[ i ] = sqrt( -2.0 * ln( ( V/X[i-1] ) + f ) );\n\t\tf = exp( -0.5 * X[ i ] * X[ i ] );\n\t}\n\tX.push( 0.0 );\n\treturn X;\n}\n\n\n// EXPORTS //\n\nmodule.exports = coordsArray;\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// MAIN //\n\n/**\n* Returns an array containing the ratio of each pair of consecutive elements in order: `X[ i+1 ] / X[ i ]`.\n*\n* @private\n* @param {NumberArray} X - input array\n* @returns {NumberArray} ratio array\n*\n* @example\n* var R = ratioArray( [ 1.0, 2.0, 5.0 ] );\n* // returns [ 2.0, 2.5 ]\n*/\nfunction ratioArray( X ) {\n\tvar R;\n\tvar i;\n\n\tR = [];\n\tfor ( i = 0; i < X.length-1; i++ ) {\n\t\tR.push( X[ i+1 ] / X[ i ] );\n\t}\n\treturn R;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ratioArray;\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 ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Transforms the tail of the normal distribution to the unit interval and then uses rejection technique to generate standard normal variable.\n*\n* ## References\n*\n* - Marsaglia, George. 1964. \"Generating a Variable from the Tail of the Normal Distribution.\" _Technometrics_ 6 (1): 101\u20132. doi:[10.1080/00401706.1964.10490150](http://dx.doi.org/10.1080/00401706.1964.10490150).\n*\n* @private\n* @param {PRNG} rand - pseudorandom number generator\n* @param {number} rTail - start value of the right tail\n* @param {boolean} isNegative - boolean indicating which side to evaluate\n* @returns {number} standard normal variable\n*/\nfunction sampleTail( rand, rTail, isNegative ) {\n\tvar x;\n\tvar y;\n\tdo {\n\t\tx = ln( rand() ) / rTail;\n\t\ty = ln( rand() );\n\t} while ( -2.0*y < x*x );\n\treturn ( isNegative ) ? x-rTail : rTail-x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sampleTail;\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 abs = require( '@stdlib/math/base/special/abs' );\nvar exp = require( '@stdlib/math/base/special/exp' );\nvar coordsArray = require( './coords_array.js' );\nvar ratioArray = require( './ratio_array.js' );\nvar sampleTail = require( './sample_tail.js' );\n\n\n// VARIABLES //\n\n// Number of blocks:\nvar NUM_BLOCKS = 128;\n\n// Start of right tail (R):\nvar START_RIGHT_TAIL = 3.442619855899;\n\n// `X` holds coordinates, such that each rectangle has same area:\nvar X = coordsArray( NUM_BLOCKS, START_RIGHT_TAIL );\n\n// `R` holds `X[ i+1 ] / X[ i ]`:\nvar R = ratioArray( X );\n\n// 127 => 0x7F => 00000000000000000000000001111111\nvar LAST_7_BITS_MASK = 127|0; // asm type annotation\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator which implements the improved Ziggurat algorithm for generating normally distributed pseudorandom numbers.\n*\n* @private\n* @param {PRNG} randu - PRNG for generating uniformly distributed numbers\n* @param {PRNG} randi - PRNG for generating uniformly distributed integers\n* @returns {number} pseudorandom number\n*/\nfunction wrap( randu, randi ) {\n\treturn randn;\n\n\t/**\n\t* Generates a normally distributed pseudorandom number.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var r = randn();\n\t* // returns \n\t*/\n\tfunction randn() {\n\t\tvar f0;\n\t\tvar f1;\n\t\tvar x2;\n\t\tvar x;\n\t\tvar u;\n\t\tvar i;\n\t\tvar j;\n\t\twhile ( true ) {\n\t\t\tu = ( 2.0*randu() ) - 1.0;\n\t\t\ti = randi() & LAST_7_BITS_MASK;\n\n\t\t\t// First try the rectangular boxes...\n\t\t\tif ( abs( u ) < R[ i ] ) {\n\t\t\t\treturn u * X[ i ];\n\t\t\t}\n\t\t\t// If bottom box, sample from the tail...\n\t\t\tif ( i === 0 ) {\n\t\t\t\treturn sampleTail( randu, START_RIGHT_TAIL, u < 0.0 );\n\t\t\t}\n\t\t\t// Is this a sample from the wedges?\n\t\t\tx = u * X[ i ];\n\t\t\tx2 = x * x;\n\t\t\tj = i + 1;\n\t\t\tf0 = exp( -0.5 * ( (X[ i ]*X[ i ]) - x2 ) );\n\t\t\tf1 = exp( -0.5 * ( (X[ j ]*X[ j ]) - x2 ) );\n\t\t\tif ( f1 + (randu()*(f0-f1)) < 1.0 ) {\n\t\t\t\treturn x;\n\t\t\t}\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = wrap;\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 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 isFunction = require( '@stdlib/assert/is-function' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isUint32Array = require( '@stdlib/assert/is-uint32array' );\nvar mt19937 = require( './../../../base/mt19937' ).factory;\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar floor = require( '@stdlib/math/base/special/floor' );\nvar UINT32_MAX = require( '@stdlib/constants/uint32/max' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar improvedZiggurat = require( './improved_ziggurat.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator which implements the improved Ziggurat method to generate normally distributed pseudorandom numbers.\n*\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} must provide an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var randn = factory();\n*\n* var r = randn();\n* // returns \n*\n* @example\n* // Return a seeded PRNG:\n* var randn = factory({\n* 'seed': 12345\n* });\n*\n* var r = randn();\n* // returns \n*/\nfunction factory( options ) {\n\tvar randu;\n\tvar randi;\n\tvar randn;\n\tvar opts;\n\n\topts = {\n\t\t'copy': true\n\t};\n\tif ( arguments.length ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide 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, 'prng' ) ) {\n\t\t\tif ( !isFunction( options.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', options.prng ) );\n\t\t\t}\n\t\t\trandu = options.prng;\n\t\t}\n\t\t// If provided a PRNG, ignore the `state` option, as we don't support getting or setting PRNG state.\n\t\telse if ( hasOwnProp( options, 'state' ) ) {\n\t\t\topts.state = options.state;\n\t\t\tif ( !isUint32Array( options.state ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a Uint32Array. Option: `%s`.', 'state', options.state ) );\n\t\t\t}\n\t\t}\n\t\t// If provided a PRNG, ignore the `seed` option, as a `seed`, by itself, is insufficient to guarantee reproducibility. If provided a state, ignore the `seed` option, as a PRNG state should contain seed information.\n\t\telse if ( hasOwnProp( options, 'seed' ) ) {\n\t\t\topts.seed = options.seed;\n\t\t\tif ( options.seed === void 0 ) {\n\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', options.seed ) );\n\t\t\t}\n\t\t}\n\t}\n\tif ( opts.state === void 0 ) {\n\t\tif ( randu === void 0 ) {\n\t\t\trandi = mt19937( opts );\n\t\t\trandu = randi.normalized;\n\t\t} else {\n\t\t\trandi = mt19937({\n\t\t\t\t'seed': floor( 1.0 + ( UINT32_MAX*randu() ) ), // allows seeding via an externally seeded PRNG\n\t\t\t\t'copy': opts.copy\n\t\t\t});\n\t\t\topts.seed = null;\n\t\t}\n\t} else {\n\t\trandi = mt19937( opts );\n\t\trandu = randi.normalized;\n\t}\n\trandn = improvedZiggurat( randu, randi );\n\n\tsetReadOnly( randn, 'NAME', 'improved-ziggurat' );\n\tif ( opts.seed === null ) {\n\t\tsetReadOnly( randn, 'seed', null );\n\t\tsetReadOnly( randn, 'seedLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( randn, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( randn, 'seedLength', getSeedLength );\n\t}\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( options && options.prng ) {\n\t\tsetReadWriteAccessor( randn, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( randn, 'stateLength', null );\n\t\tsetReadOnly( randn, 'byteLength', null );\n\t\tsetReadOnly( randn, 'toJSON', constantFunction( null ) );\n\t} else {\n\t\tsetReadWriteAccessor( randn, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( randn, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( randn, 'byteLength', getStateSize );\n\t\tsetReadOnly( randn, 'toJSON', toJSON );\n\t}\n\tsetReadOnly( randn, 'PRNG', randu );\n\n\treturn randn;\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\treturn randi.seed;\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 randi.seedLength;\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 randi.stateLength;\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 randi.byteLength;\n\t}\n\n\t/**\n\t* Returns the current PRNG state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn randi.state;\n\t}\n\n\t/**\n\t* Sets the PRNG state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trandi.state = s;\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 = randn.NAME;\n\t\tout.state = typedarray2json( randi.state );\n\t\tout.params = [];\n\t\treturn out;\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' );\n\n\n// MAIN //\n\n/**\n* Generates a standard normally distributed random number.\n*\n* ## Method\n*\n* The basic Ziggurat method works as follows:\n*\n* ```tex\n* x_{C-1}(r) \\left[ f(0) - f\\left( x_{C-1}(r) \\right) \\right] - V(r) = 0\n* ```\n*\n* where\n*\n* ```tex\n* V(r) = r \\; f(r) + \\int_r^\\infty \\; f(x) \\; dx\n* ```\n*\n* and \\\\( r \\\\) denotes the right-most \\\\( x_1 \\\\).\n*\n* - We then use the following rejection algorithm:\n*\n* - Draw a box \\\\( B_i \\\\) at random with probability \\\\( \\tfrac{1}{C} \\\\).\n* - Draw a random number from the box as \\\\( z = U_0 x_i \\\\) for \\\\( i > 0 \\\\) and \\\\( z = U_0 V / f(x_1) \\\\).\n* - If \\\\( z < x_{i+1} \\\\), accept \\\\( z \\\\).\n* - If \\\\( i = 0 \\\\), accept a \\\\( v \\\\) by transforming the tail of the normal distribution to the unit interval and then use rejection technique by Marsaglia, G. (1964) to generate a standard normal variable. Otherwise, if \\\\( i > 0 \\\\) and \\\\( U_1 \\left[ f(x_i) - f(x_{i+1})\\right] < f(z) - f(x_{i+1}) \\\\) accept \\\\( z \\\\).\n* - Go back to the first step.\n*\n* - The improved version by Doornik (2005) changes step four in order to correct a deficiency of the original Ziggurat algorithm. The updated version requires the generation of two random numbers, a uniform variable drawn from \\\\( U(-1,1) \\\\) and the last seven bits of a random integer.\n*\n* ## References\n*\n* - Doornik, Jurgen A. 2005. \"An Improved Ziggurat Method to Generate Normal Random Samples.\" .\n* - Marsaglia, George, and Wai Wan Tsang. 2000. \"The Ziggurat Method for Generating Random Variables.\" _Journal of Statistical Software_ 5 (1): 1\u20137. doi:[10.18637/jss.v005.i08](http://dx.doi.org/10.18637/jss.v005.i08).\n* - Marsaglia, George. 1964. \"Generating a Variable from the Tail of the Normal Distribution.\" _Technometrics_ 6 (1): 101\u20132. doi:[10.1080/00401706.1964.10490150](http://dx.doi.org/10.1080/00401706.1964.10490150).\n*\n* @name randn\n* @type {PRNG}\n* @returns {number} pseudorandom number\n*\n* @example\n* var r = randn();\n* // returns \n*/\nvar randn = factory();\n\n\n// EXPORTS //\n\nmodule.exports = randn;\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* Normally distributed pseudorandom numbers using the improved Ziggurat method.\n*\n* @module @stdlib/random/base/improved-ziggurat\n*\n* @example\n* var randn = require( '@stdlib/random/base/improved-ziggurat' );\n*\n* var r = randn();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/improved-ziggurat' ).factory;\n*\n* var randn = factory({\n* 'seed': 12345\n* });\n*\n* var r = randn();\n* // returns \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", "/**\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 isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( alpha, beta ) {\n\tif ( !isPositive( alpha ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositive( beta ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 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 ln = require( '@stdlib/math/base/special/ln' );\nvar sqrt = require( '@stdlib/math/base/special/sqrt' );\nvar pow = require( '@stdlib/math/base/special/pow' );\n\n\n// VARIABLES //\n\nvar ONE_THIRD = 1.0 / 3.0;\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a gamma distribution with rate parameter equal to 1.0 and shape parameter equal to `alpha`.\n*\n* @private\n* @param {PRNG} randu - PRNG for uniformly distributed numbers\n* @param {PRNG} randn - PRNG for standard normally distributed numbers\n* @param {PositiveNumber} alpha - shape parameter\n* @returns {PositiveNumber} pseudorandom number\n*/\nfunction standardGamma( randu, randn, alpha ) {\n\tvar flg;\n\tvar x2;\n\tvar v0;\n\tvar v1;\n\tvar c;\n\tvar d;\n\tvar x;\n\tvar s;\n\tvar u;\n\tvar v;\n\n\tif ( alpha < 1.0 ) {\n\t\td = alpha + 1.0 - ONE_THIRD;\n\t\tc = 1.0 / sqrt( 9.0*d );\n\t\ts = pow( randu(), 1.0/alpha );\n\t} else {\n\t\td = alpha - ONE_THIRD;\n\t\tc = 1.0 / sqrt( 9.0*d );\n\t\ts = 1.0;\n\t}\n\tflg = true;\n\twhile ( flg ) {\n\t\tdo {\n\t\t\tx = randn();\n\t\t\tv = 1.0 + (c*x);\n\t\t} while ( v <= 0.0 );\n\t\tv *= v * v;\n\t\tx2 = x * x;\n\t\tv0 = 1.0 - (0.331*x2*x2);\n\t\tv1 = (0.5*x2) + (d*( 1.0-v+ln(v) ));\n\t\tu = randu();\n\t\tif ( u < v0 || ln( u ) < v1 ) {\n\t\t\tflg = false;\n\t\t}\n\t}\n\treturn d * v * s;\n}\n\n\n// EXPORTS //\n\nmodule.exports = standardGamma;\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 pow = require( '@stdlib/math/base/special/pow' );\nvar ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Handles case where `alpha` and `beta` are equal and greater than `1.5`.\n*\n* @private\n* @param {PRNG} randu - PRNG for uniformly distributed numbers\n* @param {PRNG} randn - PRNG for normally distributed numbers\n* @param {PositiveNumber} alpha - first shape parameter\n* @returns {Probability} pseudorandom number\n*/\nfunction sample( randu, randn, alpha ) {\n\tvar flg;\n\tvar s4;\n\tvar A;\n\tvar s;\n\tvar t;\n\tvar u;\n\tvar x;\n\tvar y;\n\n\tA = alpha - 1.0;\n\tt = pow( A+A, 0.5 );\n\n\tflg = true;\n\twhile ( flg === true ) {\n\t\ts = randn();\n\t\tx = 0.5 * ( 1.0+(s/t) );\n\t\tif ( x >= 0.0 && x <= 1.0 ) {\n\t\t\tu = randu();\n\t\t\ts4 = pow( s, 4.0 );\n\t\t\ty = (8.0*alpha) - 12.0;\n\t\t\ty = 1.0 - (s4 / y);\n\t\t\tif ( u <= y ) {\n\t\t\t\tflg = false;\n\t\t\t} else {\n\t\t\t\ty += 0.5 * pow( s4/((8.0*alpha)-8.0), 2.0 );\n\t\t\t\tif ( u < y ) {\n\t\t\t\t\ty = A * ln( 4.0*x*(1.0-x) );\n\t\t\t\t\ty += s*s / 2.0;\n\t\t\t\t\tif ( y >= ln( u ) ) {\n\t\t\t\t\t\tflg = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sample;\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 pow = require( '@stdlib/math/base/special/pow' );\nvar ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Handles case where both `alpha` and `beta` are greater than `1.0`.\n*\n* @private\n* @param {PRNG} randu - PRNG for uniformly distributed numbers\n* @param {PRNG} randn - PRNG for normally distributed numbers\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @returns {Probability} pseudorandom number\n*/\nfunction sample( randu, randn, alpha, beta ) {\n\tvar sigma;\n\tvar flg;\n\tvar mu;\n\tvar A;\n\tvar B;\n\tvar C;\n\tvar L;\n\tvar s;\n\tvar u;\n\tvar x;\n\tvar y;\n\n\tA = alpha - 1.0;\n\tB = beta - 1.0;\n\tC = A + B;\n\tL = C * ln( C );\n\tmu = A / C;\n\tsigma = 0.5 / pow( C, 0.5 );\n\n\tflg = true;\n\twhile ( flg === true ) {\n\t\ts = randn();\n\t\tx = mu + (s*sigma);\n\t\tif ( x >= 0.0 && x <= 1.0 ) {\n\t\t\tu = randu();\n\t\t\ty = A * ln( x/A );\n\t\t\ty += B * ln((1.0-x) / B);\n\t\t\ty += L + (0.5*s*s);\n\t\t\tif ( y >= ln( u ) ) {\n\t\t\t\tflg = false;\n\t\t\t}\n\t\t}\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sample;\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 exp = require( '@stdlib/math/base/special/exp' );\nvar pow = require( '@stdlib/math/base/special/pow' );\nvar ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Handles general case.\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @returns {Probability} pseudorandom number\n*/\nfunction sample( rand, alpha, beta ) {\n\tvar lx;\n\tvar ly;\n\tvar xy;\n\tvar u;\n\tvar v;\n\tvar x;\n\tvar y;\n\twhile ( true ) {\n\t\tu = rand();\n\t\tv = rand();\n\t\tx = pow( u, 1.0/alpha );\n\t\ty = pow( v, 1.0/beta );\n\t\txy = x + y;\n\t\tif ( xy <= 1.0 ) {\n\t\t\tif ( xy > 0.0 ) {\n\t\t\t\treturn x / ( xy );\n\t\t\t}\n\t\t\tlx = ln( u ) / alpha;\n\t\t\tly = ln( v ) / beta;\n\t\t\tif ( lx > ly ) {\n\t\t\t\tly -= lx;\n\t\t\t\tlx = 0.0;\n\t\t\t} else {\n\t\t\t\tlx -= ly;\n\t\t\t\tly = 0.0;\n\t\t\t}\n\t\t\treturn exp( lx - ln( exp(lx) + exp(ly) ) );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = sample;\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 standardGamma = require( './standard_gamma.js' );\nvar sample1 = require( './sample1.js' );\nvar sample2 = require( './sample2.js' );\nvar sample3 = require( './sample3.js' );\n\n\n// MAIN //\n\n/**\n* Returns a random number drawn from a beta distribution.\n*\n* @private\n* @param {PRNG} randu - pseudorandom number generator for uniformly distributed numbers\n* @param {PRNG} randn - pseudorandom number generator for normally distributed numbers\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @returns {Probability} pseudorandom number\n*/\nfunction sample( randu, randn, alpha, beta ) {\n\tvar ga;\n\tvar gb;\n\tif ( alpha === beta && alpha > 1.5 ) {\n\t\treturn sample1( randu, randn, alpha );\n\t}\n\tif ( alpha > 1.0 && beta > 1.0 ) {\n\t\treturn sample2( randu, randn, alpha, beta );\n\t}\n\tif ( alpha < 1.0 && beta < 1.0 ) {\n\t\treturn sample3( randu, alpha, beta );\n\t}\n\t// General case of using two gamma random variates:\n\tga = standardGamma( randu, randn, alpha );\n\tgb = standardGamma( randu, randn, beta );\n\treturn ga / ( ga + gb );\n}\n\n\n// EXPORTS //\n\nmodule.exports = sample;\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 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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randn = require( './../../../base/improved-ziggurat' ).factory;\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar gcopy = require( '@stdlib/blas/base/gcopy' );\nvar Uint32Array = require( '@stdlib/array/uint32' );\nvar isUint32Array = require( '@stdlib/assert/is-uint32array' );\nvar assign = require( '@stdlib/object/assign' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar beta0 = require( './beta.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating beta distributed random numbers.\n*\n* @param {PositiveNumber} [alpha] - first shape parameter\n* @param {PositiveNumber} [beta] - second shape parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var beta = factory( 2.0, 1.0 );\n* var v = beta();\n* // returns \n*\n* @example\n* var beta = factory( 2.0, 2.0, {\n* 'seed': 297\n* });\n* var v = beta();\n* // returns \n*/\nfunction factory() {\n\tvar STATE;\n\tvar rnorm;\n\tvar alpha;\n\tvar beta;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar FLG;\n\tvar err;\n\n\tFLG = true;\n\tif ( arguments.length === 0 ) {\n\t\topts = {\n\t\t\t'copy': false\n\t\t};\n\t\trand = randu( opts );\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'copy' ) && !isBoolean( opts.copy ) ) {\n\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', opts.copy ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\tif ( hasOwnProp( opts, 'state' ) && !isUint32Array( opts.state ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a Uint32Array. Option: `%s`.', 'state', opts.state ) );\n\t\t\t}\n\t\t\topts = assign( {}, opts );\n\t\t\tif ( opts.copy === false ) {\n\t\t\t\tFLG = false;\n\t\t\t} else if ( opts.state ) {\n\t\t\t\topts.state = gcopy( opts.state.length, opts.state, 1, new Uint32Array( opts.state.length ), 1 ); // eslint-disable-line max-len\n\t\t\t}\n\t\t\topts.copy = false;\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\talpha = arguments[ 0 ];\n\t\tbeta = arguments[ 1 ];\n\t\terr = validate( alpha, beta );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'copy' ) && !isBoolean( opts.copy ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', opts.copy ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\tif ( hasOwnProp( opts, 'state' ) && !isUint32Array( opts.state ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a Uint32Array. Option: `%s`.', 'state', opts.state ) );\n\t\t\t\t}\n\t\t\t\topts = assign( {}, opts );\n\t\t\t\tif ( opts.copy === false ) {\n\t\t\t\t\tFLG = false;\n\t\t\t\t} else if ( opts.state ) {\n\t\t\t\t\topts.state = gcopy( opts.state.length, opts.state, 1, new Uint32Array( opts.state.length ), 1 ); // eslint-disable-line max-len\n\t\t\t\t}\n\t\t\t\topts.copy = false;\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\topts = {\n\t\t\t\t'copy': false\n\t\t\t};\n\t\t\trand = randu( opts );\n\t\t}\n\t}\n\tif ( opts && opts.prng ) {\n\t\trnorm = randn({\n\t\t\t'prng': opts.prng\n\t\t});\n\t} else {\n\t\tif ( opts.state ) {\n\t\t\tSTATE = opts.state;\n\t\t} else {\n\t\t\tSTATE = rand.state;\n\t\t\trand.state = STATE; // updates the underlying PRNG to point to a shared state\n\t\t}\n\t\trnorm = randn({\n\t\t\t'state': STATE,\n\t\t\t'copy': false\n\t\t});\n\t}\n\tif ( alpha === void 0 ) {\n\t\tprng = beta2;\n\t} else {\n\t\tprng = beta1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'beta' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\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\tif ( !isUint32Array( s ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a Uint32Array. Value: `%s`.', s ) );\n\t\t}\n\t\tif ( FLG ) {\n\t\t\ts = gcopy( s.length, s, 1, new Uint32Array( s.length ), 1 );\n\t\t}\n\t\trand.state = s;\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 = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( alpha === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ alpha, beta ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a random number drawn from a beta distribution with bound parameter values.\n\t*\n\t* @private\n\t* @returns {Probability} pseudorandom number\n\t*\n\t* @example\n\t* var v = beta1();\n\t* // returns \n\t*/\n\tfunction beta1() {\n\t\treturn beta0( rand, rnorm, alpha, beta );\n\t}\n\n\t/**\n\t* Returns a random number drawn from a beta distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} alpha - first shape parameter\n\t* @param {PositiveNumber} beta - second shape parameter\n\t* @returns {Probability} pseudorandom number\n\t*\n\t* @example\n\t* var v = beta2( 2.0, 3.0 );\n\t* // returns \n\t*/\n\tfunction beta2( alpha, beta ) {\n\t\tif (\n\t\t\tisnan( alpha ) ||\n\t\t\tisnan( beta ) ||\n\t\t\talpha <= 0.0 ||\n\t\t\tbeta <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn beta0( rand, rnorm, alpha, beta );\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' );\n\n\n// MAIN //\n\n/**\n* Generates a beta distributed random number.\n*\n* ## References\n*\n* - Ahrens, J.H., and U. Dieter. 1974. \"Computer methods for sampling from gamma, beta, poisson and bionomial distributions.\" _Computing_ 12 (3): 223\u201346. doi:[10.1007/BF02293108](http://dx.doi.org/10.1007/BF02293108).\n* - J\u00F6hnk, M.D. 1964. \"Erzeugung von Betaverteilten Und Gammaverteilten Zufallszahlen.\" _Metrika_ 8: 5\u201315. .\n*\n* @name beta\n* @type {PRNG}\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @returns {Probability} pseudorandom number\n*\n* @example\n* var r = beta( 2.0, 5.0 );\n* // returns \n*\n* @example\n* var r = beta( -2.0, 5.0 );\n* // returns NaN\n*/\nvar beta = factory();\n\n\n// EXPORTS //\n\nmodule.exports = beta;\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* Beta distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/beta\n*\n* @example\n* var beta = require( '@stdlib/random/base/beta' );\n*\n* var v = beta( 2.0, 3.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/beta' ).factory;\n*\n* var beta = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = beta();\n* // returns \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", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 binaryFactory = require( './../../../array/tools/binary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/beta' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a beta distribution.\n*\n* @name factory\n* @type {Function}\n* @param {PositiveNumber} [alpha] - first shape parameter\n* @param {PositiveNumber} [beta] - second shape parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var beta = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = beta( 10 );\n* // returns \n*\n* @example\n* var beta = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = beta( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = binaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a beta distribution.\n*\n* @name beta\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = beta( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = beta( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar beta = factory();\n\n\n// EXPORTS //\n\nmodule.exports = beta;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create an array containing pseudorandom numbers drawn from a beta distribution.\n*\n* @module @stdlib/random/array/beta\n*\n* @example\n* var beta = require( '@stdlib/random/array/beta' );\n*\n* var arr = beta( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var beta = require( '@stdlib/random/array/beta' );\n*\n* var arr = beta( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var beta = require( '@stdlib/random/array/beta' );\n*\n* var rand = beta.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var beta = require( '@stdlib/random/array/beta' );\n*\n* var rand = beta.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\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 isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - rate parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( alpha, beta ) {\n\tif ( !isPositive( alpha ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositive( beta ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a gamma distribution.\n*\n* @private\n* @param {PRNG} randu - PRNG for uniformly distributed numbers\n* @param {PRNG} randn - PRNG for standard normally distributed numbers\n* @param {PositiveNumber} beta - rate parameter\n* @param {PositiveNumber} d - `alpha + 2/3` or `alpha - 1/3`\n* @param {PositiveNumber} c - `1.0 / sqrt( 9.0*d )`\n* @returns {PositiveNumber} pseudorandom number\n*/\nfunction gamma( randu, randn, beta, d, c ) {\n\tvar flg;\n\tvar x2;\n\tvar v0;\n\tvar v1;\n\tvar x;\n\tvar u;\n\tvar v;\n\n\tflg = true;\n\twhile ( flg ) {\n\t\tdo {\n\t\t\tx = randn();\n\t\t\tv = 1.0 + (c*x);\n\t\t} while ( v <= 0.0 );\n\t\tv *= v * v;\n\t\tx2 = x * x;\n\t\tv0 = 1.0 - (0.331*x2*x2);\n\t\tv1 = (0.5*x2) + (d*( 1.0-v+ln(v) ));\n\t\tu = randu();\n\t\tif ( u < v0 || ln( u ) < v1 ) {\n\t\t\tflg = false;\n\t\t}\n\t}\n\treturn (1.0/beta) * d * v;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gamma;\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 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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar isUint32Array = require( '@stdlib/assert/is-uint32array' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randn = require( './../../../base/improved-ziggurat' ).factory;\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar sqrt = require( '@stdlib/math/base/special/sqrt' );\nvar pow = require( '@stdlib/math/base/special/pow' );\nvar gcopy = require( '@stdlib/blas/base/gcopy' );\nvar Uint32Array = require( '@stdlib/array/uint32' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar gamma0 = require( './gamma.js' );\n\n\n// VARIABLES //\n\nvar ONE_THIRD = 1.0 / 3.0;\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating gamma distributed random numbers.\n*\n* @param {PositiveNumber} [alpha] - shape parameter\n* @param {PositiveNumber} [beta] - rate parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var gamma = factory( 2.0, 1.0 );\n* var v = gamma();\n* // returns \n*\n* @example\n* var gamma = factory( 2.0, 2.0, {\n* 'seed': 297\n* });\n* var v = gamma();\n* // returns \n*/\nfunction factory() {\n\tvar STATE;\n\tvar alpha;\n\tvar rnorm;\n\tvar beta;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar FLG;\n\tvar err;\n\tvar c;\n\tvar d;\n\n\tFLG = true;\n\tif ( arguments.length === 0 ) {\n\t\topts = {\n\t\t\t'copy': false\n\t\t};\n\t\trand = randu( opts );\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'copy' ) && !isBoolean( opts.copy ) ) {\n\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', opts.copy ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\tif ( hasOwnProp( opts, 'state' ) && !isUint32Array( opts.state ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a Uint32Array. Option: `%s`.', 'state', opts.state ) );\n\t\t\t}\n\t\t\topts = assign( {}, opts );\n\t\t\tif ( opts.copy === false ) {\n\t\t\t\tFLG = false;\n\t\t\t} else if ( opts.state ) {\n\t\t\t\topts.state = gcopy( opts.state.length, opts.state, 1, new Uint32Array( opts.state.length ), 1 ); // eslint-disable-line max-len\n\t\t\t}\n\t\t\topts.copy = false;\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\talpha = arguments[ 0 ];\n\t\tbeta = arguments[ 1 ];\n\t\terr = validate( alpha, beta );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'copy' ) && !isBoolean( opts.copy ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', opts.copy ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\tif ( hasOwnProp( opts, 'state' ) && !isUint32Array( opts.state ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a Uint32Array. Option: `%s`.', 'state', opts.state ) );\n\t\t\t\t}\n\t\t\t\topts = assign( {}, opts );\n\t\t\t\tif ( opts.copy === false ) {\n\t\t\t\t\tFLG = false;\n\t\t\t\t} else if ( opts.state ) {\n\t\t\t\t\topts.state = gcopy( opts.state.length, opts.state, 1, new Uint32Array( opts.state.length ), 1 ); // eslint-disable-line max-len\n\t\t\t\t}\n\t\t\t\topts.copy = false;\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\topts = {\n\t\t\t\t'copy': false\n\t\t\t};\n\t\t\trand = randu( opts );\n\t\t}\n\t}\n\tif ( opts && opts.prng ) {\n\t\trnorm = randn({\n\t\t\t'prng': opts.prng\n\t\t});\n\t} else {\n\t\tif ( opts.state ) {\n\t\t\tSTATE = opts.state;\n\t\t} else {\n\t\t\tSTATE = rand.state;\n\t\t\trand.state = STATE; // updates the underlying PRNG to point to a shared state\n\t\t}\n\t\trnorm = randn({\n\t\t\t'state': STATE,\n\t\t\t'copy': false\n\t\t});\n\t}\n\tif ( alpha === void 0 ) {\n\t\tprng = gamma2;\n\t} else {\n\t\tif ( alpha >= 1.0 ) {\n\t\t\tprng = gamma1a;\n\t\t\td = alpha - ONE_THIRD;\n\t\t} else {\n\t\t\tprng = gamma1b;\n\t\t\td = alpha + 1.0 - ONE_THIRD;\n\t\t}\n\t\tc = 1.0 / sqrt( 9.0*d );\n\t}\n\tsetReadOnly( prng, 'NAME', 'gamma' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\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\tif ( !isUint32Array( s ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a Uint32Array. Value: `%s`.', s ) );\n\t\t}\n\t\tif ( FLG ) {\n\t\t\ts = gcopy( s.length, s, 1, new Uint32Array( s.length ), 1 );\n\t\t}\n\t\trand.state = s;\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 = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( alpha === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ alpha, beta ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a gamma distribution with bound parameters when `alpha >= 1`.\n\t*\n\t* @private\n\t* @returns {PositiveNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = gamma1a();\n\t* // returns \n\t*/\n\tfunction gamma1a() {\n\t\treturn gamma0( rand, rnorm, beta, d, c );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a gamma distribution with bound parameters when `alpha < 1`.\n\t*\n\t* @private\n\t* @returns {PositiveNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = gamma1b();\n\t* // returns \n\t*/\n\tfunction gamma1b() {\n\t\treturn gamma0( rand, rnorm, beta, d, c ) * pow( rand(), 1.0/alpha );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a gamma distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} alpha - shape parameter\n\t* @param {PositiveNumber} beta - rate parameter\n\t* @returns {PositiveNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = gamma2( 2.0, 4.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = gamma2( 3.0, 0.0 );\n\t* // returns NaN\n\t*\n\t* @example\n\t* var v = gamma2( 0.0, 2.0 );\n\t* // returns NaN\n\t*\n\t* @example\n\t* var v = gamma2( NaN, NaN );\n\t* // returns NaN\n\t*/\n\tfunction gamma2( alpha, beta ) {\n\t\tvar c;\n\t\tvar d;\n\t\tif (\n\t\t\tisnan( alpha ) ||\n\t\t\tisnan( beta ) ||\n\t\t\talpha <= 0.0 ||\n\t\t\tbeta <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\tif ( alpha < 1.0 ) {\n\t\t\td = alpha + 1.0 - ONE_THIRD;\n\t\t\tc = 1.0 / sqrt( 9.0*d );\n\t\t\treturn gamma0( rand, rnorm, beta, d, c ) * pow( rand(), 1.0/alpha );\n\t\t}\n\t\td = alpha - ONE_THIRD;\n\t\tc = 1.0 / sqrt( 9.0*d );\n\t\treturn gamma0( rand, rnorm, beta, d, c );\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' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a gamma distribution.\n*\n* ## References\n*\n* - Marsaglia, George, and Wai Wan Tsang. 2000. \"A Simple Method for Generating Gamma Variables.\" _ACM Transactions on Mathematical Software_ 26 (3). New York, NY, USA: ACM: 363\u201372. doi:[10.1145/358407.358414](http://dx.doi.org/10.1145/358407.358414).\n*\n* @name gamma\n* @type {PRNG}\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - rate parameter\n* @returns {PositiveNumber} pseudorandom number\n*\n* @example\n* var v = gamma( 2.0, 4.0 );\n* // returns \n*\n* @example\n* var v = gamma( -2.0, 4.0 );\n* // returns NaN\n*/\nvar gamma = factory();\n\n\n// EXPORTS //\n\nmodule.exports = gamma;\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* Gamma distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/gamma\n*\n* @example\n* var gamma = require( '@stdlib/random/base/gamma' );\n*\n* var v = gamma( 2.0, 3.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/gamma' ).factory;\n*\n* var gamma = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = gamma();\n* // returns \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", "/**\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 isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( alpha, beta ) {\n\tif ( !isPositive( alpha ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositive( beta ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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// MAIN //\n\n/**\n* Returns a random number drawn from a beta prime distribution.\n*\n* @private\n* @param {PRNG} rgamma - pseudorandom number generator for gamma distributed numbers\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @returns {PositiveNumber} pseudorandom number\n*/\nfunction sample( rgamma, alpha, beta ) {\n\treturn rgamma( alpha, 1.0 ) / rgamma( beta, 1.0 );\n}\n\n\n// EXPORTS //\n\nmodule.exports = sample;\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 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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar gammaFactory = require( './../../../base/gamma' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar betaprime0 = require( './betaprime.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating beta prime distributed random numbers.\n*\n* @param {PositiveNumber} [alpha] - first shape parameter\n* @param {PositiveNumber} [beta] - second shape parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var betaprime = factory( 2.0, 1.0 );\n* var v = betaprime();\n* // returns \n*\n* @example\n* var betaprime = factory( 2.0, 2.0, {\n* 'seed': 297\n* });\n* var v = betaprime();\n* // returns \n*/\nfunction factory() {\n\tvar rgamma;\n\tvar alpha;\n\tvar beta;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\n\tif ( arguments.length === 0 ) {\n\t\trgamma = gammaFactory();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\trgamma = gammaFactory( opts );\n\t} else {\n\t\talpha = arguments[ 0 ];\n\t\tbeta = arguments[ 1 ];\n\t\terr = validate( alpha, beta );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\trgamma = gammaFactory( opts );\n\t\t} else {\n\t\t\trgamma = gammaFactory();\n\t\t}\n\t}\n\tif ( alpha === void 0 ) {\n\t\tprng = betaprime2;\n\t} else {\n\t\tprng = betaprime1;\n\t}\n\trand = rgamma.PRNG;\n\n\tsetReadOnly( prng, 'NAME', 'betaprime' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t}\n\tsetReadOnly( prng, 'PRNG', rand );\n\treturn prng;\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\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 = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( alpha === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ alpha, beta ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a random number drawn from a beta prime distribution with bound parameter values.\n\t*\n\t* @private\n\t* @returns {PositiveNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = betaprime1();\n\t* // returns \n\t*/\n\tfunction betaprime1() {\n\t\treturn betaprime0( rgamma, alpha, beta );\n\t}\n\n\t/**\n\t* Returns a random number drawn from a beta prime distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} alpha - first shape parameter\n\t* @param {PositiveNumber} beta - second shape parameter\n\t* @returns {PositiveNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = betaprime2( 2.0, 3.0 );\n\t* // returns \n\t*/\n\tfunction betaprime2( alpha, beta ) {\n\t\tif (\n\t\t\tisnan( alpha ) ||\n\t\t\tisnan( beta ) ||\n\t\t\talpha <= 0.0 ||\n\t\t\tbeta <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn betaprime0( rgamma, alpha, beta );\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' );\n\n\n// MAIN //\n\n/**\n* Generates a beta prime distributed random number.\n*\n* @name betaprime\n* @type {PRNG}\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @returns {PositiveNumber} pseudorandom number\n*\n* @example\n* var r = betaprime( 2.0, 5.0 );\n* // returns \n*\n* @example\n* var r = betaprime( -2.0, 5.0 );\n* // returns NaN\n*/\nvar betaprime = factory();\n\n\n// EXPORTS //\n\nmodule.exports = betaprime;\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* Beta prime distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/betaprime\n*\n* @example\n* var betaprime = require( '@stdlib/random/base/betaprime' );\n*\n* var v = betaprime( 2.0, 3.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/betaprime' ).factory;\n*\n* var betaprime = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = betaprime();\n* // returns \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", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 binaryFactory = require( './../../../array/tools/binary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/betaprime' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a beta prime distribution.\n*\n* @name factory\n* @type {Function}\n* @param {PositiveNumber} [alpha] - first shape parameter\n* @param {PositiveNumber} [beta] - second shape parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var betaprime = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = betaprime( 10 );\n* // returns \n*\n* @example\n* var betaprime = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = betaprime( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = binaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a beta prime distribution.\n*\n* @name betaprime\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = betaprime( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = betaprime( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar betaprime = factory();\n\n\n// EXPORTS //\n\nmodule.exports = betaprime;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create an array containing pseudorandom numbers drawn from a beta prime distribution.\n*\n* @module @stdlib/random/array/betaprime\n*\n* @example\n* var betaprime = require( '@stdlib/random/array/betaprime' );\n*\n* var arr = betaprime( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var betaprime = require( '@stdlib/random/array/betaprime' );\n*\n* var arr = betaprime( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var betaprime = require( '@stdlib/random/array/betaprime' );\n*\n* var rand = betaprime.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var betaprime = require( '@stdlib/random/array/betaprime' );\n*\n* var rand = betaprime.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\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 isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isProbability = require( '@stdlib/assert/is-probability' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {PositiveInteger} n - number of trials\n* @param {Probability} p - success probability\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 10, 0.5 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( n, p ) {\n\tif ( !isPositiveInteger( n ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a positive integer. Value: `%s`.', p ) );\n\t}\n\tif ( !isProbability( p ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a probability. Value: `%s`.', p ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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* Generates a binomially distributed pseudorandom number by computing the sum of Bernoulli random variables.\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {PositiveInteger} n - number of trials\n* @param {Probability} p - success probability\n* @returns {NonNegativeInteger} pseudorandom number\n*/\nfunction sample( rand, n, p ) {\n\tvar sum = 0;\n\tvar i;\n\tfor ( i = 0; i < n; i++ ) {\n\t\tif ( rand() <= p ) {\n\t\t\tsum += 1;\n\t\t}\n\t}\n\treturn sum;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sample;\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 pow = require( '@stdlib/math/base/special/pow' );\n\n\n// VARIABLES //\n\nvar ONE_12 = 1.0 / 12.0;\nvar ONE_360 = 1.0 / 360.0;\nvar ONE_1260 = 1.0 / 1260.0;\n\n\n// MAIN //\n\n/**\n* Returns a correction for Stirling's approximation.\n*\n* @private\n* @param {NonNegativeInteger} k - input argument\n* @returns {number} correction term\n*\n* @example\n* var c = correction( 0 );\n* // returns 0.08106146679532726\n*/\nfunction correction( k ) {\n\tvar v;\n\tswitch ( k ) {\n\tcase 0:\n\t\treturn 0.08106146679532726;\n\tcase 1:\n\t\treturn 0.04134069595540929;\n\tcase 2:\n\t\treturn 0.02767792568499834;\n\tcase 3:\n\t\treturn 0.02079067210376509;\n\tcase 4:\n\t\treturn 0.01664469118982119;\n\tcase 5:\n\t\treturn 0.01387612882307075;\n\tcase 6:\n\t\treturn 0.01189670994589177;\n\tcase 7:\n\t\treturn 0.01041126526197209;\n\tcase 8:\n\t\treturn 0.009255462182712733;\n\tcase 9:\n\t\treturn 0.008330563433362871;\n\tdefault:\n\t\tk += 1;\n\t\tv = pow( k, 2 );\n\t\treturn (ONE_12 - ((ONE_360 - (ONE_1260/v)) / v)) / k;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = correction;\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 floor = require( '@stdlib/math/base/special/floor' );\nvar sign = require( '@stdlib/math/base/special/signum' );\nvar sqrt = require( '@stdlib/math/base/special/sqrt' );\nvar abs = require( '@stdlib/math/base/special/abs' );\nvar ln = require( '@stdlib/math/base/special/ln' );\nvar correction = require( './correction.js' );\n\n\n// VARIABLES //\n\nvar ONE_SIXTH = 1.0 / 6.0;\n\n\n// MAIN //\n\n/**\n* Generates a binomially distributed pseudorandom number.\n*\n* ## References\n*\n* - H\u00F6rmann, Wolfgang. 1993. \"The generation of binomial random variates.\" _Journal of Statistical Computation and Simulation_ 46 (1-2): 101\u201310. doi:[10.1080/00949659308811496][@hormann:1993a].\n*\n* [@hormann:1993a]: http://dx.doi.org/10.1080/00949659308811496\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {PositiveInteger} n - number of trials\n* @param {Probability} p - success probability\n* @returns {NonNegativeInteger} pseudorandom number\n*/\nfunction sample( rand, n, p ) {\n\tvar alpha;\n\tvar urvr;\n\tvar snpq;\n\tvar npq;\n\tvar rho;\n\tvar tmp;\n\tvar nm;\n\tvar nr;\n\tvar us;\n\tvar km;\n\tvar nk;\n\tvar vr;\n\tvar a;\n\tvar b;\n\tvar c;\n\tvar f;\n\tvar h;\n\tvar i;\n\tvar k;\n\tvar m;\n\tvar q;\n\tvar r;\n\tvar t;\n\tvar u;\n\tvar v;\n\tvar x;\n\n\tm = floor( (n + 1) * p );\n\tnm = n - m + 1;\n\n\tq = 1.0 - p;\n\n\tr = p / q;\n\tnr = (n + 1) * r;\n\n\tnpq = n * p * q;\n\tsnpq = sqrt( npq );\n\n\tb = 1.15 + (2.53 * snpq);\n\ta = -0.0873 + (0.0248*b) + (0.01*p);\n\tc = (n*p) + 0.5;\n\n\talpha = (2.83 + (5.1/b)) * snpq;\n\n\tvr = 0.92 - (4.2/b);\n\turvr = 0.86 * vr;\n\n\th = (m + 0.5) * ln( (m+1) / (r*nm) );\n\th += correction( m ) + correction( n-m );\n\n\twhile ( true ) {\n\t\tv = rand();\n\t\tif ( v <= urvr ) {\n\t\t\tu = (v/vr) - 0.43;\n\t\t\tr = (u * ( (2.0*a / (0.5 - abs(u))) + b )) + c;\n\t\t\treturn floor( r );\n\t\t}\n\t\tif ( v >= vr ) {\n\t\t\tu = rand() - 0.5;\n\t\t} else {\n\t\t\tu = (v/vr) - 0.93;\n\t\t\tu = (sign( u ) * 0.5) - u;\n\t\t\tv = vr * rand();\n\t\t}\n\t\tus = 0.5 - abs(u);\n\t\tk = floor( (u * ( (2.0*a/us) + b )) + c );\n\t\tif ( k < 0 || k > n ) {\n\t\t\t// Try again...\n\t\t\tcontinue;\n\t\t}\n\t\tv = v * alpha / ( (a/(us*us)) + b );\n\t\tkm = abs( k - m );\n\t\tif ( km > 15 ) {\n\t\t\tv = ln( v );\n\t\t\trho = km / npq;\n\t\t\ttmp = ( (km/3) + 0.625 ) * km;\n\t\t\ttmp += ONE_SIXTH;\n\t\t\ttmp /= npq;\n\t\t\trho *= tmp + 0.5;\n\t\t\tt = -(km * km) / (2.0 * npq);\n\t\t\tif ( v < t - rho ) {\n\t\t\t\treturn k;\n\t\t\t}\n\t\t\tif ( v <= t + rho ) {\n\t\t\t\tnk = n - k + 1;\n\t\t\t\tx = h + ( (n+1)*ln( nm/nk ) );\n\t\t\t\tx += (k+0.5) * ln( nk*r/(k+1) );\n\t\t\t\tx += -(correction( k ) + correction( n-k ));\n\t\t\t\tif ( v <= x ) {\n\t\t\t\t\treturn k;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tf = 1.0;\n\t\t\tif ( m < k ) {\n\t\t\t\tfor ( i = m; i <= k; i++ ) {\n\t\t\t\t\tf *= (nr/i) - r;\n\t\t\t\t}\n\t\t\t} else if ( m > k ) {\n\t\t\t\tfor ( i = k; i <= m; i++ ) {\n\t\t\t\t\tv *= (nr/i) - r;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( v <= f ) {\n\t\t\t\treturn k;\n\t\t\t}\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = sample;\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 sample1 = require( './sample1.js' );\nvar sample2 = require( './sample2.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a binomial distribution.\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {PositiveInteger} n - number of trials\n* @param {Probability} p - probability of success\n* @returns {NonNegativeInteger} pseudorandom number\n*/\nfunction sample( rand, n, p ) {\n\tif ( p > 0.5 ) {\n\t\treturn n - sample( rand, n, 1.0-p );\n\t}\n\tif ( n*p < 10.0 ) {\n\t\treturn sample1( rand, n, p );\n\t}\n\treturn sample2( rand, n, p );\n}\n\n\n// EXPORTS //\n\nmodule.exports = sample;\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 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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isPositiveInteger = require( '@stdlib/math/base/assert/is-positive-integer' );\nvar isProbability = require( '@stdlib/math/base/assert/is-probability' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar binomial0 = require( './binomial.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating binomially distributed random numbers.\n*\n* @param {PositiveInteger} [n] - number of trials\n* @param {Probability} [p] - success probability\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} `n` must be a positive integer\n* @throws {TypeError} `p` must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var binomial = factory( 17, 0.5 );\n* var v = binomial();\n* // returns \n*\n* @example\n* var binomial = factory( 8, 0.8, {\n* 'seed': 297\n* });\n* var v = binomial();\n* // returns \n*\n* @example\n* var binomial = factory();\n* var v = binomial( 20, 0.5 );\n* // returns \n*/\nfunction factory() {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar n;\n\tvar p;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tn = arguments[ 0 ];\n\t\tp = arguments[ 1 ];\n\t\terr = validate( n, p );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( n === void 0 ) {\n\t\tprng = binomial2;\n\t}\n\telse {\n\t\tprng = binomial1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'binomial' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\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 = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( n === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ n, p ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a random number drawn from a binomial distribution with bound parameter values.\n\t*\n\t* @private\n\t* @returns {NonNegativeInteger} pseudorandom number\n\t*\n\t* @example\n\t* var r = binomial1();\n\t* // returns \n\t*/\n\tfunction binomial1() {\n\t\treturn binomial0( rand, n, p );\n\t}\n\n\t/**\n\t* Returns a random number drawn from a binomial distribution.\n\t*\n\t* @private\n\t* @param {PositiveInteger} n - number of trials\n\t* @param {Probability} p - success probability\n\t* @returns {NonNegativeInteger} pseudorandom number\n\t*\n\t* @example\n\t* var r = binomial2( 20, 0.8 );\n\t* // returns \n\t*/\n\tfunction binomial2( n, p ) {\n\t\tif (\n\t\t\tisnan( n ) ||\n\t\t\tisnan( p ) ||\n\t\t\t!isPositiveInteger( n ) ||\n\t\t\t!isProbability( p )\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn binomial0( rand, n, p );\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' );\n\n\n// MAIN //\n\n/**\n* Generates a binomially distributed random number.\n*\n* ## Method\n*\n* - For \\\\(np < 10\\\\), the function generates Bernoulli random variates and returns their sum.\n* - For \\\\(np \\geq 10\\\\), the function uses the [BTRD algorithm][@hormann:1993a].\n*\n* ## References\n*\n* - H\u00F6rmann, Wolfgang. 1993. \"The generation of binomial random variates.\" _Journal of Statistical Computation and Simulation_ 46 (1-2): 101\u201310. doi:[10.1080/00949659308811496][@hormann:1993a].\n*\n* [@hormann:1993a]: http://dx.doi.org/10.1080/00949659308811496\n*\n* @name binomial\n* @type {PRNG}\n* @param {PositiveInteger} n - number of trials\n* @param {Probability} p - success probability\n* @throws {TypeError} `n` must be a positive integer\n* @throws {TypeError} `p` must be a probability\n* @returns {NonNegativeInteger} pseudorandom number\n*\n* @example\n* var r = binomial( 20, 0.8 );\n* // returns \n*/\nvar binomial = factory();\n\n\n// EXPORTS //\n\nmodule.exports = binomial;\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* Binomial distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/binomial\n*\n* @example\n* var binomial = require( '@stdlib/random/base/binomial' );\n*\n* var v = binomial( 20, 0.4 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/binomial' ).factory;\n*\n* var binomial = factory( 90, 0.8, {\n* 'seed': 297\n* });\n*\n* var v = binomial();\n* // returns \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", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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 binaryFactory = require( './../../../array/tools/binary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/binomial' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a binomial distribution.\n*\n* @name factory\n* @type {Function}\n* @param {PositiveInteger} [n] - number of trials\n* @param {Probability} [p] - success probability\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `n` must be a positive integer\n* @throws {TypeError} `p` must be a probability (i.e., a number on the interval [0,1])\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var binomial = factory( 17, 0.5 );\n* // returns \n*\n* var arr = binomial( 10 );\n* // returns \n*\n* @example\n* var binomial = factory( 17, 0.5 );\n* // returns \n*\n* var arr = binomial( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = binaryFactory( base, DTYPES, defaults.get( 'dtypes.real' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a binomial distribution.\n*\n* @name binomial\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {PositiveInteger} n - number of trials\n* @param {Probability} p - success probability\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = binomial( 10, 17, 0.5 );\n* // returns \n*\n* @example\n* var arr = binomial( 10, 17, 0.5, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar binomial = factory();\n\n\n// EXPORTS //\n\nmodule.exports = binomial;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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* Create an array containing pseudorandom numbers drawn from a binomial distribution.\n*\n* @module @stdlib/random/array/binomial\n*\n* @example\n* var binomial = require( '@stdlib/random/array/binomial' );\n*\n* var arr = binomial( 10, 17, 0.5 );\n* // returns \n*\n* @example\n* var binomial = require( '@stdlib/random/array/binomial' );\n*\n* var arr = binomial( 10, 17, 0.5, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var binomial = require( '@stdlib/random/array/binomial' );\n*\n* var rand = binomial.factory( 17, 0.5 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var binomial = require( '@stdlib/random/array/binomial' );\n*\n* var rand = binomial.factory( 17, 0.5 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\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 isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar isnan = require( '@stdlib/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {number} x0 - location parameter\n* @param {PositiveNumber} gamma - scale parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.5 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( x0, gamma ) {\n\tif ( !isNumber( x0 ) || isnan( x0 ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', x0 ) );\n\t}\n\tif ( !isPositive( gamma ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', gamma ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 tan = require( '@stdlib/math/base/special/tan' );\nvar PI = require( '@stdlib/constants/float64/pi' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Cauchy distribution.\n*\n* @private\n* @param {PRNG} randn - PRNG for normally distributed numbers\n* @param {number} x0 - location parameter\n* @param {PositiveNumber} gamma - scale parameter\n* @returns {number} pseudorandom number\n*/\nfunction cauchy( randn, x0, gamma ) {\n\treturn x0 + ( gamma*tan( PI*( randn()-0.5 ) ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = cauchy;\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 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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar randn = require( './../../../base/improved-ziggurat' ).factory;\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar cauchy0 = require( './cauchy.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating random numbers from a Cauchy distribution.\n*\n* @param {number} [x0] - location parameter\n* @param {PositiveNumber} [gamma] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} `x0` must be a number\n* @throws {TypeError} `gamma` argument must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var cauchy = factory( 0.0, 1.0 );\n* var v = cauchy();\n* // returns \n*\n* @example\n* var cauchy = factory( -3.0, 0.5, {\n* 'seed': 297\n* });\n* var v = cauchy();\n* // returns \n*/\nfunction factory() {\n\tvar gamma;\n\tvar rnorm;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar x0;\n\n\tif ( arguments.length === 0 ) {\n\t\trnorm = randn();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trnorm = randn({\n\t\t\t\t'prng': opts.prng\n\t\t\t});\n\t\t} else {\n\t\t\trnorm = randn( opts );\n\t\t}\n\t} else {\n\t\tx0 = arguments[ 0 ];\n\t\tgamma = arguments[ 1 ];\n\t\terr = validate( x0, gamma );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trnorm = randn({\n\t\t\t\t\t'prng': opts.prng\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\trnorm = randn( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trnorm = randn();\n\t\t}\n\t}\n\tif ( x0 === void 0 ) {\n\t\tprng = cauchy2;\n\t} else {\n\t\tprng = cauchy1;\n\t}\n\trand = rnorm.PRNG;\n\n\tsetReadOnly( prng, 'NAME', 'cauchy' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t}\n\tsetReadOnly( prng, 'PRNG', rand );\n\treturn prng;\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\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 = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( x0 === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ x0, gamma ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns pseudorandom number drawn from a Cauchy distribution with bound parameters `x0` and `gamma`.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = cauchy1();\n\t* // returns \n\t*/\n\tfunction cauchy1() {\n\t\treturn cauchy0( rnorm, x0, gamma );\n\t}\n\n\t/**\n\t* Returns pseudorandom number drawn from a Cauchy distribution.\n\t*\n\t* @private\n\t* @param {number} x0 - location parameter\n\t* @param {PositiveNumber} gamma - scale parameter\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = cauchy2( 0.0, 2.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var r = cauchy2( 1.0, -1.5 );\n\t* // returns NaN\n\t*/\n\tfunction cauchy2( x0, gamma ) {\n\t\tif (\n\t\t\tisnan( x0 ) ||\n\t\t\tisnan( gamma ) ||\n\t\t\tgamma <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn cauchy0( rnorm, x0, gamma );\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' );\n\n\n// MAIN //\n\n/**\n* Returns pseudorandom number drawn from a Cauchy distribution.\n*\n* @name cauchy\n* @type {PRNG}\n* @param {number} x0 - location parameter\n* @param {PositiveNumber} gamma - scale parameter\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = cauchy( 0.0, 2.0 );\n* // returns \n*\n* @example\n* var v = cauchy( 0.0, -1.0 );\n* // returns NaN\n*/\nvar cauchy = factory();\n\n\n// EXPORTS //\n\nmodule.exports = cauchy;\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* Cauchy distribution pseudorandom numbers.\n*\n* @module @stdlib/random/base/cauchy\n*\n* @example\n* var cauchy = require( '@stdlib/random/base/cauchy' );\n*\n* var v = cauchy( 0.5, 1.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/cauchy' ).factory;\n*\n* var cauchy = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = cauchy();\n* // returns \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", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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 binaryFactory = require( './../../../array/tools/binary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/cauchy' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a Cauchy distribution.\n*\n* @name factory\n* @type {Function}\n* @param {number} [x0] - location parameter\n* @param {PositiveNumber} [gamma] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `x0` must be a number\n* @throws {TypeError} `gamma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var cauchy = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = cauchy( 10 );\n* // returns \n*\n* @example\n* var cauchy = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = cauchy( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = binaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a Cauchy distribution.\n*\n* @name cauchy\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {number} x0 - location parameter\n* @param {PositiveNumber} gamma - scale parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = cauchy( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = cauchy( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar cauchy = factory();\n\n\n// EXPORTS //\n\nmodule.exports = cauchy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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* Create an array containing pseudorandom numbers drawn from a Cauchy distribution.\n*\n* @module @stdlib/random/array/cauchy\n*\n* @example\n* var cauchy = require( '@stdlib/random/array/cauchy' );\n*\n* var arr = cauchy( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var cauchy = require( '@stdlib/random/array/cauchy' );\n*\n* var arr = cauchy( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var cauchy = require( '@stdlib/random/array/cauchy' );\n*\n* var rand = cauchy.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var cauchy = require( '@stdlib/random/array/cauchy' );\n*\n* var rand = cauchy.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\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 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 isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar gamma = require( './../../../base/gamma' ).factory;\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating chi-square distributed random numbers.\n*\n* @param {PositiveNumber} [k] - degrees of freedom\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} `k` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var chisquare = factory( 2 );\n* var v = chisquare();\n* // returns \n*\n* @example\n* var chisquare = factory( 2, {\n* 'seed': 297\n* });\n* var v = chisquare();\n* // returns \n*/\nfunction factory() {\n\tvar rgamma;\n\tvar rand;\n\tvar opts;\n\tvar prng;\n\tvar k;\n\tif ( arguments.length === 0 ) {\n\t\trgamma = gamma();\n\t} else if (\n\t\targuments.length === 1 &&\n\t\tisObject( arguments[ 0 ] )\n\t) {\n\t\topts = arguments[ 0 ];\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trgamma = gamma({\n\t\t\t\t'prng': opts.prng\n\t\t\t});\n\t\t} else {\n\t\t\trgamma = gamma( opts );\n\t\t}\n\t} else {\n\t\tk = arguments[ 0 ];\n\t\tif ( !isPositive( k ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', k ) );\n\t\t}\n\t\tif ( arguments.length > 1 ) {\n\t\t\topts = arguments[ 1 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trgamma = gamma( k/2.0, 0.5, {\n\t\t\t\t\t'prng': opts.prng\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\trgamma = gamma( k/2.0, 0.5, opts );\n\t\t\t}\n\t\t} else {\n\t\t\trgamma = gamma( k/2.0, 0.5 );\n\t\t}\n\t}\n\tif ( k === void 0 ) {\n\t\tprng = chisquare2;\n\t} else {\n\t\tprng = chisquare1;\n\t}\n\trand = rgamma.PRNG;\n\n\tsetReadOnly( prng, 'NAME', 'chisquare' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t}\n\tsetReadOnly( prng, 'PRNG', rand );\n\treturn prng;\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\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 = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( k === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ k ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a random number drawn from a chi-square distribution with bound `k`.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = chisquare1();\n\t* // returns \n\t*/\n\tfunction chisquare1() {\n\t\treturn rgamma();\n\t}\n\n\t/**\n\t* Returns a random number drawn from a chi-square distribution with degrees of freedom `k`.\n\t*\n\t* @private\n\t* @param {PositiveNumber} k - degrees of freedom\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = chisquare2( 2 );\n\t* // returns \n\t*/\n\tfunction chisquare2( k ) {\n\t\tif (\n\t\t\tisnan( k ) ||\n\t\t\tk <= 0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn rgamma( k/2.0, 0.5 );\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' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a chi-square distribution with degrees of freedom `k`.\n*\n* @function chisquare\n* @type {PRNG}\n* @param {PositiveNumber} k - degrees of freedom\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = chisquare( 2 );\n* // returns \n*\n* @example\n* var v = chisquare( 0 );\n* // returns NaN\n*\n* @example\n* var v = chisquare( NaN );\n* // returns NaN\n*/\nvar chisquare = factory();\n\n\n// EXPORTS //\n\nmodule.exports = chisquare;\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* Chi-square distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/chisquare\n*\n* @example\n* var chisquare = require( '@stdlib/random/base/chisquare' );\n*\n* var v = chisquare( 6 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/chisquare' ).factory;\n*\n* var chisquare = factory( 3, {\n* 'seed': 297\n* });\n*\n* var v = chisquare();\n* // returns \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", "/**\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 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 isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar chisquare = require( './../../../base/chisquare' ).factory;\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar sqrt = require( '@stdlib/math/base/special/sqrt' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating chi distributed random numbers.\n*\n* @param {PositiveNumber} [k] - degrees of freedom\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} `k` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var chi = factory( 2 );\n* var v = chi();\n* // returns \n*\n* @example\n* var chi = factory( 2, {\n* 'seed': 297\n* });\n* var v = chi();\n* // returns \n*/\nfunction factory() {\n\tvar rchisq;\n\tvar rand;\n\tvar opts;\n\tvar prng;\n\tvar k;\n\tif ( arguments.length === 0 ) {\n\t\trchisq = chisquare();\n\t} else if (\n\t\targuments.length === 1 &&\n\t\tisObject( arguments[ 0 ] )\n\t) {\n\t\topts = arguments[ 0 ];\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trchisq = chisquare({\n\t\t\t\t'prng': opts.prng\n\t\t\t});\n\t\t} else {\n\t\t\trchisq = chisquare( opts );\n\t\t}\n\t} else {\n\t\tk = arguments[ 0 ];\n\t\tif ( !isPositive( k ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', k ) );\n\t\t}\n\t\tif ( arguments.length > 1 ) {\n\t\t\topts = arguments[ 1 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trchisq = chisquare( k, {\n\t\t\t\t\t'prng': opts.prng\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\trchisq = chisquare( k, opts );\n\t\t\t}\n\t\t} else {\n\t\t\trchisq = chisquare( k );\n\t\t}\n\t}\n\tif ( k === void 0 ) {\n\t\tprng = chi2;\n\t} else {\n\t\tprng = chi1;\n\t}\n\trand = rchisq.PRNG;\n\n\tsetReadOnly( prng, 'NAME', 'chi' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t}\n\tsetReadOnly( prng, 'PRNG', rand );\n\treturn prng;\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\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 = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( k === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ k ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a random number drawn from a chi distribution with bound `k`.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = chi1();\n\t* // returns \n\t*/\n\tfunction chi1() {\n\t\treturn sqrt( rchisq() );\n\t}\n\n\t/**\n\t* Returns a random number drawn from a chi distribution with degrees of freedom `k`.\n\t*\n\t* @private\n\t* @param {PositiveNumber} k - degrees of freedom\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = chi2( 2 );\n\t* // returns \n\t*/\n\tfunction chi2( k ) {\n\t\tif (\n\t\t\tisnan( k ) ||\n\t\t\tk <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn sqrt( rchisq( k ) );\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' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a chi distribution with degrees of freedom `k`.\n*\n* @name chi\n* @type {PRNG}\n* @param {PositiveNumber} k - degrees of freedom\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = chi( 2 );\n* // returns \n*\n* @example\n* var v = chi( 0 );\n* // returns NaN\n*\n* @example\n* var v = chi( NaN );\n* // returns NaN\n*/\nvar chi = factory();\n\n\n// EXPORTS //\n\nmodule.exports = chi;\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* Chi distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/chi\n*\n* @example\n* var chi = require( '@stdlib/random/base/chi' );\n*\n* var v = chi( 6 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/chi' ).factory;\n*\n* var chi = factory( 3, {\n* 'seed': 297\n* });\n*\n* var v = chi();\n* // returns \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", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 unaryFactory = require( './../../../array/tools/unary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/chi' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a chi distribution.\n*\n* @name factory\n* @type {Function}\n* @param {PositiveNumber} [k] - degrees of freedom\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `k` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var chi = factory( 2.0 );\n* // returns \n*\n* var arr = chi( 10 );\n* // returns \n*\n* @example\n* var chi = factory( 2.0 );\n* // returns \n*\n* var arr = chi( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = unaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a chi distribution.\n*\n* @name chi\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {PositiveNumber} k - degrees of freedom\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = chi( 10, 2.0 );\n* // returns \n*\n* @example\n* var arr = chi( 10, 2.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar chi = factory();\n\n\n// EXPORTS //\n\nmodule.exports = chi;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create an array containing pseudorandom numbers drawn from a chi distribution.\n*\n* @module @stdlib/random/array/chi\n*\n* @example\n* var chi = require( '@stdlib/random/array/chi' );\n*\n* var arr = chi( 10, 2.0 );\n* // returns \n*\n* @example\n* var chi = require( '@stdlib/random/array/chi' );\n*\n* var arr = chi( 10, 2.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var chi = require( '@stdlib/random/array/chi' );\n*\n* var rand = chi.factory( 2.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var chi = require( '@stdlib/random/array/chi' );\n*\n* var rand = chi.factory( 2.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 unaryFactory = require( './../../../array/tools/unary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/chisquare' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a chi-square distribution.\n*\n* @name factory\n* @type {Function}\n* @param {PositiveNumber} [k] - degrees of freedom\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `k` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var chisquare = factory( 2.0 );\n* // returns \n*\n* var arr = chisquare( 10 );\n* // returns \n*\n* @example\n* var chisquare = factory( 2.0 );\n* // returns \n*\n* var arr = chisquare( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = unaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a chi-square distribution.\n*\n* @name chisquare\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {PositiveNumber} k - degrees of freedom\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = chisquare( 10, 2.0 );\n* // returns \n*\n* @example\n* var arr = chisquare( 10, 2.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar chisquare = factory();\n\n\n// EXPORTS //\n\nmodule.exports = chisquare;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create an array containing pseudorandom numbers drawn from a chi-square distribution.\n*\n* @module @stdlib/random/array/chisquare\n*\n* @example\n* var chisquare = require( '@stdlib/random/array/chisquare' );\n*\n* var arr = chisquare( 10, 2.0 );\n* // returns \n*\n* @example\n* var chisquare = require( '@stdlib/random/array/chisquare' );\n*\n* var arr = chisquare( 10, 2.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var chisquare = require( '@stdlib/random/array/chisquare' );\n*\n* var rand = chisquare.factory( 2.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var chisquare = require( '@stdlib/random/array/chisquare' );\n*\n* var rand = chisquare.factory( 2.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\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 isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar isnan = require( '@stdlib/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {number} mu - location parameter\n* @param {PositiveNumber} s - scale parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( mu, s ) {\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( s ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', s ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 quantile = require( '@stdlib/stats/base/dists/cosine/quantile' );\n\n\n// MAIN //\n\n/**\n* Returns pseudorandom number drawn from a raised cosine distribution using inverse transform sampling.\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {number} mu - mean\n* @param {PositiveNumber} s - scale parameter\n* @returns {number} pseudorandom number\n*/\nfunction sample( rand, mu, s ) {\n\treturn quantile( rand(), mu, s );\n}\n\n\n// EXPORTS //\n\nmodule.exports = sample;\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 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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar cosine0 = require( './cosine.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating random numbers from a raised cosine distribution.\n*\n* @param {number} [mu] - mean parameter\n* @param {PositiveNumber} [s] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} `mu` must be a number\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var cosine = factory( 0.0, 1.0 );\n* var v = cosine();\n* // returns \n*\n* @example\n* var cosine = factory( -3.0, 0.5, {\n* 'seed': 297\n* });\n* var v = cosine();\n* // returns \n*/\nfunction factory() {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar mu;\n\tvar s;\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tmu = arguments[ 0 ];\n\t\ts = arguments[ 1 ];\n\t\terr = validate( mu, s );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( mu === void 0 ) {\n\t\tprng = cosine2;\n\t} else {\n\t\tprng = cosine1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'cosine' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\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 = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( mu === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ mu, s ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a raised cosine distribution with bound parameters.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = cosine1();\n\t* // returns \n\t*/\n\tfunction cosine1() {\n\t\treturn cosine0( rand, mu, s );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a raised cosine distribution.\n\t*\n\t* @private\n\t* @param {number} mu - mean\n\t* @param {PositiveNumber} s - scale parameter\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = cosine2( 0.0, 2.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = cosine2( 0.0, -1.0 );\n\t* // returns NaN\n\t*/\n\tfunction cosine2( mu, s ) {\n\t\tif (\n\t\t\tisnan( mu ) ||\n\t\t\tisnan( s ) ||\n\t\t\ts <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn cosine0( rand, mu, s );\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' );\n\n\n// MAIN //\n\n/**\n* Returns pseudorandom number drawn from a raised cosine distribution.\n*\n* @name cosine\n* @type {PRNG}\n* @param {number} mu - mean\n* @param {PositiveNumber} s - scale parameter\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = cosine( 0.0, 2.0 );\n* // returns \n*\n* @example\n* var v = cosine( 0.0, -1.0 );\n* // returns NaN\n*/\nvar cosine = factory();\n\n\n// EXPORTS //\n\nmodule.exports = cosine;\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* Raised cosine distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/cosine\n*\n* @example\n* var cosine = require( '@stdlib/random/base/cosine' );\n*\n* var v = cosine( 0.5, 1.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/cosine' ).factory;\n* var cosine = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = cosine();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/cosine' ).factory;\n* var cosine = factory({\n* 'seed': 297\n* });\n*\n* var v = cosine( 3.0, 2.0 );\n* // returns \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", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 binaryFactory = require( './../../../array/tools/binary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/cosine' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a raised cosine distribution.\n*\n* @name factory\n* @type {Function}\n* @param {number} [mu] - mean\n* @param {PositiveNumber} [s] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var cosine = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = cosine( 10 );\n* // returns \n*\n* @example\n* var cosine = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = cosine( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = binaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a raised cosine distribution.\n*\n* @name cosine\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {number} mu - mean\n* @param {PositiveNumber} s - scale parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = cosine( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = cosine( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar cosine = factory();\n\n\n// EXPORTS //\n\nmodule.exports = cosine;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create an array containing pseudorandom numbers drawn from a raised cosine distribution.\n*\n* @module @stdlib/random/array/cosine\n*\n* @example\n* var cosine = require( '@stdlib/random/array/cosine' );\n*\n* var arr = cosine( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var cosine = require( '@stdlib/random/array/cosine' );\n*\n* var arr = cosine( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var cosine = require( '@stdlib/random/array/cosine' );\n*\n* var rand = cosine.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var cosine = require( '@stdlib/random/array/cosine' );\n*\n* var rand = cosine.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\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 isInteger = require( '@stdlib/assert/is-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar isnan = require( '@stdlib/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Validates values provided for minimum and maximum support.\n*\n* @private\n* @param {integer} a - minimum support\n* @param {integer} b - maximum support\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1, 20 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( a, b ) {\n\tif ( !isInteger( a ) || isnan( a ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be an integer and not NaN. Value: `%s`.', a ) );\n\t}\n\tif ( !isInteger( b ) || isnan( b ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be an integer and not NaN. Value: `%s`.', b ) );\n\t}\n\tif ( a > b ) {\n\t\treturn new RangeError( format( 'invalid argument. Minimum support must be less than or equal to maximum support. Value: `[%d, %d]`.', a, b ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 [Boost library]{http://www.boost.org/doc/libs/1_65_1/doc/html/boost/random/uniform_int_distribution.html}. The implementation has been modified for JavaScript.\n*\n* ```text\n* (C) Copyright John Maddock 2006.\n* (C) Copyright Steven Watanabe 2011.\n*\n* Use, modification and distribution are subject to the\n* Boost Software License, Version 1.0. (See accompanying file\n* LICENSE or copy at http://www.boost.org/LICENSE_1_0.txt)\n* ```\n*/\n\n'use strict';\n\n// MODULES //\n\nvar MAX_SAFE_INTEGER = require( '@stdlib/constants/float64/max-safe-integer' );\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a discrete uniform distribution with minimum support `a` and maximum support `b`.\n*\n* @private\n* @param {PRNG} rand - pseudorandom number generator which outputs integer values\n* @param {integer} a - minimum support\n* @param {integer} b - maximum support\n* @returns {integer} pseudorandom number\n*/\nfunction discreteUniform( rand, a, b ) {\n\tvar result;\n\tvar RANGE;\n\tvar range;\n\tvar limit;\n\tvar bsize;\n\tvar mult;\n\tvar MIN;\n\tvar MAX;\n\tvar inc;\n\n\trange = b - a;\n\tif ( range === 0 ) {\n\t\treturn a;\n\t}\n\tMIN = rand.MIN;\n\tMAX = rand.MAX;\n\tRANGE = MAX - MIN;\n\tif ( RANGE === range ) {\n\t\treturn ( rand()-MIN ) + a;\n\t}\n\tif ( RANGE < range ) {\n\t\tlimit = 0;\n\t\twhile ( true ) {\n\t\t\t// Avoid overflow...\n\t\t\tif ( range === MAX_SAFE_INTEGER ) { // in JavaScript, we only explicitly have doubles\n\t\t\t\tlimit = floor( range / (RANGE+1) );\n\t\t\t\tif ( range%(RANGE+1) === RANGE ) { // e.g., 5%(2+1) == 2\n\t\t\t\t\tlimit += 1;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tlimit = floor( (range+1) / (RANGE+1) );\n\t\t\t}\n\t\t\t// We consider `result` as expressed base `(RANGE+1)`:\n\t\t\tresult = 0;\n\n\t\t\t// For every power of `(RANGE+1)`, we determine a random factor:\n\t\t\tmult = 1;\n\n\t\t\t// Loop invariants: result < mult && mult <= range\n\t\t\twhile ( mult <= limit ) {\n\t\t\t\t// Note: see first and second post-conditions.\n\t\t\t\tresult += (rand() - MIN) * mult;\n\n\t\t\t\t// Equivalent to (mult * (RANGE+1)) == range+1, but avoids overflow...\n\t\t\t\tif ( mult*RANGE === range-mult+1 ) {\n\t\t\t\t\t// The destination range is an integer power of the generator's range...\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t\t// Note: see third post-condition.\n\t\t\t\tmult *= RANGE + 1;\n\t\t\t}\n\t\t\t// range/mult < RANGE+1 (no endless loop)\n\t\t\tinc = discreteUniform( rand, 0, floor( range/mult ) );\n\t\t\tif ( inc > MAX_SAFE_INTEGER/mult ) {\n\t\t\t\t// The multiplication would overflow, so reject immediately...\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tinc *= mult;\n\t\t\tresult += inc;\n\n\t\t\t// NOTE: if we were working with unsigned integers, we would need to check that `result` is NOT less than `inc`, as unsigned integers wrap on overflow. In which case, we would need to reject.\n\n\t\t\tif ( result > range ) {\n\t\t\t\t// Result is too big, so reject...\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\treturn result + a;\n\t\t}\n\t}\n\t// Case: RANGE > range\n\n\t// When determining the bucket size, avoid overflow...\n\tif ( RANGE === MAX_SAFE_INTEGER ) { // in JavaScript, we only explicitly have doubles\n\t\tbsize = floor( RANGE / (range+1) );\n\t\tif ( RANGE%(range+1) === range ) { // e.g., 5%(2+1) == 2\n\t\t\tbsize += 1;\n\t\t}\n\t} else {\n\t\tbsize = floor( (RANGE+1) / (range+1) );\n\t}\n\twhile ( true ) {\n\t\tresult = rand() - MIN;\n\t\tresult = floor( result / bsize );\n\t\tif ( result <= range ) {\n\t\t\treturn result + a;\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = discreteUniform;\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 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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randi = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isInteger = require( '@stdlib/math/base/assert/is-integer' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar discreteUniform0 = require( './discrete_uniform.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating random numbers draw from a discrete uniform distribution.\n*\n* @param {integer} [a] - minimum support\n* @param {integer} [b] - maximum support\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom integers\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} `a` must be an integer\n* @throws {TypeError} `b` must be an integer\n* @throws {RangeError} `a` must be less than or equal to `b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} provided PRNG must have a valid `MIN` property\n* @throws {TypeError} provided PRNG must have a valid `MAX` property\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var discreteUniform = factory( 1, 10 );\n* var v = discreteUniform();\n* // returns \n*\n* @example\n* var discreteUniform = factory( -30, -1, {\n* 'seed': 297\n* });\n* var v = discreteUniform();\n* // returns \n*/\nfunction factory() {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar a;\n\tvar b;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randi();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t\tif ( !isInteger( rand.MIN ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must have a `MIN` property specifying the minimum possible pseudorandom integer value.', 'prng' ) );\n\t\t\t}\n\t\t\tif ( !isInteger( rand.MAX ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must have a `MAX` property specifying the maximum possible pseudorandom integer value.', 'prng' ) );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randi( opts );\n\t\t}\n\t} else {\n\t\ta = arguments[ 0 ];\n\t\tb = arguments[ 1 ];\n\t\terr = validate( a, b );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t\tif ( !isInteger( rand.MIN ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must have a `MIN` property specifying the minimum possible pseudorandom integer value.', 'prng' ) );\n\t\t\t\t}\n\t\t\t\tif ( !isInteger( rand.MAX ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must have a `MAX` property specifying the maximum possible pseudorandom integer value.', 'prng' ) );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\trand = randi( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randi();\n\t\t}\n\t}\n\tif ( a === void 0 ) {\n\t\tprng = discreteUniform2;\n\t} else {\n\t\tprng = discreteUniform1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'discrete-uniform' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t}\n\treturn prng;\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\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 = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( a === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ a, b ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a discrete uniform distribution with minimum support `a` and maximum support `b`.\n\t*\n\t* @private\n\t* @returns {integer} pseudorandom number\n\t*\n\t* @example\n\t* var v = discreteUniform1();\n\t* // returns \n\t*/\n\tfunction discreteUniform1() {\n\t\treturn discreteUniform0( rand, a, b );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a discrete uniform distribution with minimum support `a` and maximum support `b`.\n\t*\n\t* @private\n\t* @param {integer} a - minimum support\n\t* @param {integer} b - maximum support\n\t* @returns {integer} pseudorandom number\n\t*\n\t* @example\n\t* var v = discreteUniform2( 1, 10 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = discreteUniform2( 1, 0 );\n\t* // returns NaN\n\t*/\n\tfunction discreteUniform2( a, b ) {\n\t\tif (\n\t\t\tisnan( a ) ||\n\t\t\tisnan( b ) ||\n\t\t\t!isInteger( a ) ||\n\t\t\t!isInteger( b ) ||\n\t\t\ta > b\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn discreteUniform0( rand, a, b );\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' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a discrete uniform distribution with minimum support `a` and maximum support `b`.\n*\n* ## Method\n*\n* - Let \\\\( R \\\\) be a pseudorandom generator (PRNG) which yields integers on the interval \\\\( \\[ A, B ] \\\\).\n*\n* - If \\\\( a = b \\\\), then \\\\( rv = a \\\\).\n*\n* - Let \\\\( r1 = b - a \\\\) and \\\\( r2 = B - A \\\\). If \\\\( r2 = r1 \\\\) (likely a rare occurrence), then\n*\n* ```tex\n* rv = ( R() - B ) + a\n* ```\n*\n* where, for real integer types, operation order is important in order to avoid overflow.\n*\n* - If \\\\( r2 < r1 \\\\), use rejection sampling to map random variates from \\\\( R \\\\) to a larger domain (e.g., \\\\( {0,1,2,3} \\rightarrow {0,1,2,3,4} \\\\)). For real integer types (and floating-point integer values), we must take extra care to avoid overflow. During sampling, the following conditions will hold:\n*\n* - First, consider the post-condition: \\\\( \\textrm{result} \\leq r2 \\\\), thus avoiding overflow.\n*\n* - Begin with definition of \\\\( \\textrm{limit} \\\\)\n*\n* ```tex\n* \\textrm{limit} = \\lfloor{\\frac{r2+1}{r1+1}\\rfloor\n* ```\n*\n* thus,\n*\n* ```tex\n* \\textrm{limit}\\ \\cdot (r1+1) \\leq r2+1\n* ```\n*\n* - Let \\\\( m \\\\) be a random factor where the loop condition is defined as\n*\n* ```tex\n* m \\leq \\textrm{limit}\n* ```\n*\n* - Let \\\\( \\textrm{result} \\\\) be the generator output, which is expressed base \\\\( r2+1 \\\\) and obeys the loop invariant \\\\( \\textrm{result} < m \\\\).\n*\n* - Let \\\\( rv \\\\) be a realization of the PRNG. Then,\n*\n* ```tex\n* rv-A \\leq r1\n* ```\n*\n* and, by the loop condition, \\\\( m \\leq \\textrm{limit} \\\\).\n*\n* - Therefore,\n*\n* ```tex\n* m \\cdot (rv - A + 1) \\leq r2+1\n* ```\n*\n* - Rearranging terms,\n*\n* ```tex\n* m + m \\cdot (rv - A) \\leq r2+1\n* ```\n*\n* - Since \\\\( \\textrm{result} < m \\\\),\n*\n* ```tex\n* \\textrm{result} + m \\cdot (rv - A) < r2+1\n* ```\n*\n* - Next, consider the post-condition: \\\\( \\textrm{result} < m \\cdot (r2+1) \\\\).\n*\n* - Since \\\\( \\textrm{result} < m \\\\) and \\\\( rv - A \\leq r1 \\\\),\n*\n* ```tex\n* \\textrm{result} + m \\cdot (rv - A) < m + m \\cdot (rv - A)\n* ```\n*\n* - Therefore,\n*\n* ```tex\n* \\textrm{result} + m \\cdot (rv - A) < m + m \\cdot r1\n* ```\n*\n* - Therefore,\n*\n* ```tex\n* \\textrm{result} + m \\cdot (rv - A) < m \\cdot (r1+1)\n* ```\n*\n* - Next, consider the post-condition: \\\\( m \\leq r2 \\\\).\n*\n* - According to the definition of \\\\( \\textrm{limit} \\\\) and the loop condition \\\\( m \\leq \\textrm{limit} \\\\),\n*\n* ```tex\n* m \\cdot (r1+1) \\leq r2+1\n* ```\n*\n* - If \\\\( r2 \\\\) is **not** an integer power of the generator range \\\\( r1 \\\\), i.e.,\n*\n* ```tex\n* m \\cdot (r1+1) \\neq r2+1\n* ```\n*\n* then\n*\n* ```tex\n* m \\cdot (r1+1) < r2+1\n* ```\n*\n* - Thus, \\\\( \\textrm{result} < m \\\\).\n*\n* - Next, consider the post-condition: \\\\( r2/m < r1+1 \\\\).\n*\n* - To show this is true, let us try to prove its opposite. Given the loop condition \\\\( m > \\textrm{limit} \\\\), assume\n*\n* ```tex\n* r2/m > r1+1\n* ```\n*\n* - Accordingly,\n*\n* ```tex\n* r2 \\geq m \\cdot (r1+1)\n* ```\n*\n* - Hence,\n*\n* ```tex\n* r2+1 > m \\cdot (r1+1)\n* ```\n*\n* - Using the loop condition,\n*\n* ```tex\n* r2+1 > (\\textrm{limit}+1) \\cdot (r1+1)\n* ```\n*\n* - Rearranging terms,\n*\n* ```tex\n* \\frac{r2+1}{r1+1} > \\textrm{limit} + 1\n* ```\n*\n* - Hence,\n*\n* ```tex\n* \\textrm{limit} < \\lfloor{\\frac{r2+1}{r1+1}} \\rfloor\n* ```\n*\n* - But the definition of \\\\( \\textrm{limit} \\\\) is\n*\n* ```tex\n* \\textrm{limit} = \\lfloor{\\frac{r2+1}{r1+1}}\n* ```\n*\n* - Thus, our assumption cannot be true, providing the post-condition by reductio ad absurdum.\n*\n* - Next, consider the post-condition\n*\n* ```tex\n* r2 \\leq \\frac{r2}{m} \\cdot m + (m - 1)\n* ```\n*\n* - Recall the identity\n*\n* ```tex\n* r2 = \\frac{r2}{m} \\cdot m + r2 \\mod m\n* ```\n*\n* - By the definition of the modulus\n*\n* ```tex\n* r2 \\mod m < m\n* ```\n*\n* - Therefore,\n*\n* ```tex\n* r2 < \\frac{r2}{m} \\cdot m + m\n* ```\n*\n* - Hence,\n*\n* ```tex\n* r2 \\leq \\frac{r2}{m} \\cdot m + (m - 1)\n* ```\n*\n* At this point, the maximum value \\\\( \\textrm{result} \\\\) is \\\\( m-1 \\\\). Hence, we can generate numbers that can be at least as large as \\\\( r2 \\\\), but we must be careful to avoid overflow during addition and in the sampling rejection. Anything which overflows is larger than \\\\( r2 \\\\) and can thus be rejected.\n*\n* - If \\\\( r1 > r2 \\\\), use rejection sampling to map random variates from \\\\( R \\\\) to a smaller domain (e.g., \\\\( {0,1,2,3,4} \\rightarrow {0,1,2,3} \\\\)) by defining \"buckets\" in which multiple random variates in \\\\( R \\\\) map to a single random variate in the smaller domain. We are safe in adding 1 to \\\\( r2 \\\\); however, we need to be careful to not cause overflow when adding 1 to \\\\( r1 \\\\).\n*\n* @name discreteUniform\n* @type {PRNG}\n* @param {integer} a - minimum support\n* @param {integer} b - maximum support\n* @returns {integer} pseudorandom number\n*\n* @example\n* var v = discreteUniform( 1, 10 );\n* // returns \n*/\nvar discreteUniform = factory();\n\n\n// EXPORTS //\n\nmodule.exports = discreteUniform;\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* Discrete uniform distribution pseudorandom numbers.\n*\n* @module @stdlib/random/base/discrete-uniform\n*\n* @example\n* var discreteUniform = require( '@stdlib/random/base/discrete-uniform' );\n*\n* var v = discreteUniform( 1, 10 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/discrete-uniform' ).factory;\n* var discreteUniform = factory( -5, 5, {\n* 'seed': 297\n* });\n*\n* var v = discreteUniform();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/discrete-uniform' ).factory;\n* var discreteUniform = factory({\n* 'seed': 297\n* });\n*\n* var v = discreteUniform( -5, 5 );\n* // returns \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", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 binaryFactory = require( './../../../array/tools/binary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/discrete-uniform' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a discrete uniform distribution.\n*\n* @name factory\n* @type {Function}\n* @param {integer} [a] - minimum support\n* @param {integer} [b] - maximum support\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `a` must be an integer\n* @throws {TypeError} `b` must be an integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var discreteUniform = factory( -10, 10 );\n* // returns \n*\n* var arr = discreteUniform( 10 );\n* // returns \n*\n* @example\n* var discreteUniform = factory( -10, 10 );\n* // returns \n*\n* var arr = discreteUniform( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = binaryFactory( base, DTYPES, defaults.get( 'dtypes.real' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a discrete uniform distribution.\n*\n* @name discreteUniform\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {integer} a - minimum support\n* @param {integer} b - maximum support\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = discreteUniform( 10, -10, 10 );\n* // returns \n*\n* @example\n* var arr = discreteUniform( 10, -10, 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar discreteUniform = factory();\n\n\n// EXPORTS //\n\nmodule.exports = discreteUniform;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create an array containing pseudorandom numbers drawn from a discrete uniform distribution.\n*\n* @module @stdlib/random/array/discrete-uniform\n*\n* @example\n* var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );\n*\n* var arr = discreteUniform( 10, -10, 10 );\n* // returns \n*\n* @example\n* var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );\n*\n* var arr = discreteUniform( 10, -10, 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );\n*\n* var rand = discreteUniform.factory( -10, 10 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );\n*\n* var rand = discreteUniform.factory( -10, 10 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\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 isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {PositiveInteger} k - shape parameter\n* @param {PositiveNumber} lambda - rate parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1, 2.5 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( k, lambda ) {\n\tif ( !isPositiveInteger( k ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a positive integer. Value: `%s`.', k ) );\n\t}\n\tif ( !isPositive( lambda ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', lambda ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from an Erlang distribution.\n*\n* @private\n* @param {PRNG} rand - PRNG for generating uniformly distributed numbers\n* @param {PositiveInteger} k - shape parameter\n* @param {PositiveNumber} lambda - rate parameter\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = erlang();\n* // returns \n*/\nfunction erlang( rand, k, lambda ) {\n\tvar prod;\n\tvar i;\n\tprod = 1.0;\n\tfor ( i = 0; i < k; i++ ) {\n\t\tprod *= rand();\n\t}\n\treturn -(1.0/lambda) * ln( prod );\n}\n\n\n// EXPORTS //\n\nmodule.exports = erlang;\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 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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isPositiveInteger = require( '@stdlib/math/base/assert/is-positive-integer' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar erlang0 = require( './erlang.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating Erlang distributed random numbers.\n*\n* @param {PositiveInteger} [k] - shape parameter\n* @param {PositiveNumber} [lambda] - rate parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} `k` must be a positive integer\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var erlang = factory( 2, 1.0 );\n* var v = erlang();\n* // returns \n*\n* @example\n* var erlang = factory( 2, 2.0, {\n* 'seed': 297\n* });\n* var v = erlang();\n* // returns \n*/\nfunction factory() {\n\tvar lambda;\n\tvar rand;\n\tvar opts;\n\tvar prng;\n\tvar err;\n\tvar k;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tk = arguments[ 0 ];\n\t\tlambda = arguments[ 1 ];\n\t\terr = validate( k, lambda );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( k === void 0 ) {\n\t\tprng = erlang2;\n\t} else {\n\t\tprng = erlang1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'erlang' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\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 = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( k === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ k, lambda ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from an Erlang distribution with bound parameters.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = erlang1();\n\t* // returns \n\t*/\n\tfunction erlang1() {\n\t\treturn erlang0( rand, k, lambda );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from an Erlang distribution.\n\t*\n\t* @private\n\t* @param {PositiveInteger} k - shape parameter\n\t* @param {PositiveNumber} lambda - rate parameter\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = erlang2( 2, 1.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = erlang2( NaN, 1.0 );\n\t* // returns NaN\n\t*\n\t* v = erlang2( 2, NaN );\n\t* // returns NaN\n\t*\n\t* v = erlang2( 3.14, 1.0 );\n\t* // returns NaN\n\t*\n\t* v = erlang2( 2, 0.0 );\n\t* // returns NaN\n\t*/\n\tfunction erlang2( k, lambda ) {\n\t\tif (\n\t\t\tisnan( k ) ||\n\t\t\tisnan( lambda ) ||\n\t\t\t!isPositiveInteger( k ) ||\n\t\t\tlambda <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn erlang0( rand, k, lambda );\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' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from an Erlang distribution.\n*\n* @name erlang\n* @type {PRNG}\n* @param {PositiveInteger} k - shape parameter\n* @param {PositiveNumber} lambda - rate parameter\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = erlang( 2, 1.0 );\n* // returns \n*\n* @example\n* var v = erlang( NaN, 1.0 );\n* // returns NaN\n*\n* v = erlang( 2, NaN );\n* // returns NaN\n*\n* v = erlang( 3.14, 1.0 );\n* // returns NaN\n*\n* v = erlang( 3, 0.0 );\n* // returns NaN\n*/\nvar erlang = factory();\n\n\n// EXPORTS //\n\nmodule.exports = erlang;\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* Erlang distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/erlang\n*\n* @example\n* var erlang = require( '@stdlib/random/base/erlang' );\n*\n* var v = erlang( 3, 2.5 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/erlang' ).factory;\n*\n* var erlang = factory( 8, 5.9, {\n* 'seed': 297\n* });\n*\n* var v = erlang();\n* // returns \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", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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 binaryFactory = require( './../../../array/tools/binary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/erlang' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from an Erlang distribution.\n*\n* @name factory\n* @type {Function}\n* @param {PositiveInteger} [k] - shape parameter\n* @param {PositiveNumber} [lambda] - rate parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `k` must be a positive integer\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var erlang = factory( 2, 5.0 );\n* // returns \n*\n* var arr = erlang( 10 );\n* // returns \n*\n* @example\n* var erlang = factory( 2, 5.0 );\n* // returns \n*\n* var arr = erlang( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = binaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from an Erlang distribution.\n*\n* @name erlang\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {PositiveInteger} k - shape parameter\n* @param {PositiveNumber} lambda - rate parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = erlang( 10, 2, 5.0 );\n* // returns \n*\n* @example\n* var arr = erlang( 10, 2, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar erlang = factory();\n\n\n// EXPORTS //\n\nmodule.exports = erlang;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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* Create an array containing pseudorandom numbers drawn from an Erlang distribution.\n*\n* @module @stdlib/random/array/erlang\n*\n* @example\n* var erlang = require( '@stdlib/random/array/erlang' );\n*\n* var arr = erlang( 10, 2, 5.0 );\n* // returns \n*\n* @example\n* var erlang = require( '@stdlib/random/array/erlang' );\n*\n* var arr = erlang( 10, 2, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var erlang = require( '@stdlib/random/array/erlang' );\n*\n* var rand = erlang.factory( 2, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var erlang = require( '@stdlib/random/array/erlang' );\n*\n* var rand = erlang.factory( 2, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\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 ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from an exponential distribution.\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {PositiveNumber} lambda - rate parameter\n* @returns {NonNegativeNumber} pseudorandom number\n*/\nfunction exponential( rand, lambda ) {\n\treturn -ln( 1.0 - rand() ) / lambda;\n}\n\n\n// EXPORTS //\n\nmodule.exports = exponential;\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 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 isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar exponential0 = require( './exponential.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating exponentially distributed random numbers.\n*\n* @param {PositiveNumber} [lambda] - rate parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var exponential = factory( 0.5 );\n* var v = exponential();\n* // returns \n*\n* @example\n* var exponential = factory( 0.8, {\n* 'seed': 297\n* });\n* var v = exponential();\n* // returns ~3.735\n*\n* @example\n* var exponential = factory();\n* var v = exponential( 0.5 );\n* // returns \n*/\nfunction factory() {\n\tvar lambda;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if (\n\t\targuments.length === 1 &&\n\t\tisObject( arguments[ 0 ] )\n\t) {\n\t\topts = arguments[ 0 ];\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tlambda = arguments[ 0 ];\n\t\tif ( !isPositive( lambda ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', lambda ) );\n\t\t}\n\t\tif ( arguments.length > 1 ) {\n\t\t\topts = arguments[ 1 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( lambda === void 0 ) {\n\t\tprng = exponential2;\n\t} else {\n\t\tprng = exponential1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'exponential' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\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 = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( lambda === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ lambda ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from an exponential distribution with bound parameter `lambda`.\n\t*\n\t* @private\n\t* @returns {NonNegativeNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = exponential1();\n\t* // returns \n\t*/\n\tfunction exponential1() {\n\t\treturn exponential0( rand, lambda );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from an exponential distribution with parameter `lambda`.\n\t*\n\t* @private\n\t* @param {PositiveNumber} lambda - rate parameter\n\t* @returns {NonNegativeNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = exponential2( 4.8 );\n\t* // returns \n\t*/\n\tfunction exponential2( lambda ) {\n\t\tif (\n\t\t\tisnan( lambda ) ||\n\t\t\tlambda <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn exponential0( rand, lambda );\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' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from an exponential distribution with parameter `lambda`.\n*\n* @name exponential\n* @type {PRNG}\n* @param {PositiveNumber} lambda - rate parameter\n* @returns {NonNegativeNumber} pseudorandom number\n*\n* @example\n* var v = exponential( 4.8 );\n* // returns \n*\n* @example\n* var v = exponential( 0.0 );\n* // returns NaN\n*\n* @example\n* var v = exponential( NaN );\n* // returns NaN\n*/\nvar exponential = factory();\n\n\n// EXPORTS //\n\nmodule.exports = exponential;\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* Exponentially distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/exponential\n*\n* @example\n* var exponential = require( '@stdlib/random/base/exponential' );\n*\n* var v = exponential( 4.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/exponential' ).factory;\n*\n* var exponential = factory( 4.0, {\n* 'seed': 297\n* });\n*\n* var v = exponential();\n* // returns \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", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 unaryFactory = require( './../../../array/tools/unary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/exponential' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from an exponential distribution.\n*\n* @name factory\n* @type {Function}\n* @param {PositiveNumber} [lambda] - rate parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var exponential = factory( 2.0 );\n* // returns \n*\n* var arr = exponential( 10 );\n* // returns \n*\n* @example\n* var exponential = factory( 2.0 );\n* // returns \n*\n* var arr = exponential( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = unaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from an exponential distribution.\n*\n* @name exponential\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {PositiveNumber} lambda - rate parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = exponential( 10, 2.0 );\n* // returns \n*\n* @example\n* var arr = exponential( 10, 2.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar exponential = factory();\n\n\n// EXPORTS //\n\nmodule.exports = exponential;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create an array containing pseudorandom numbers drawn from an exponential distribution.\n*\n* @module @stdlib/random/array/exponential\n*\n* @example\n* var exponential = require( '@stdlib/random/array/exponential' );\n*\n* var arr = exponential( 10, 2.0 );\n* // returns \n*\n* @example\n* var exponential = require( '@stdlib/random/array/exponential' );\n*\n* var arr = exponential( 10, 2.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var exponential = require( '@stdlib/random/array/exponential' );\n*\n* var rand = exponential.factory( 2.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var exponential = require( '@stdlib/random/array/exponential' );\n*\n* var rand = exponential.factory( 2.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\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 isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {PositiveNumber} d1 - degrees of freedom\n* @param {PositiveNumber} d2 - degrees of freedom\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( d1, d2 ) {\n\tif ( !isPositive( d1 ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', d1 ) );\n\t}\n\tif ( !isPositive( d2 ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', d2 ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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* Returns a pseudorandom number from an F distribution with parameters `d1` and `d2`.\n*\n* @private\n* @param {PRNG} rchisq - PRNG for chi-square distributed numbers\n* @param {PositiveNumber} d1 - degrees of freedom\n* @param {PositiveNumber} d2 - degrees of freedom\n* @returns {NonNegativeNumber} pseudorandom number\n*/\nfunction f( rchisq, d1, d2 ) {\n\tvar x1 = rchisq( d1 ) / d1;\n\tvar x2 = rchisq( d2 ) / d2;\n\treturn x1 / x2;\n}\n\n\n// EXPORTS //\n\nmodule.exports = f;\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 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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar chisquare = require( './../../../base/chisquare' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar f0 = require( './f.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating F distributed random numbers.\n*\n* @param {PositiveNumber} [d1] - degrees of freedom\n* @param {PositiveNumber} [d2] - degrees of freedom\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} `d1` must be a positive number\n* @throws {TypeError} `d2` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var f = factory( 1.0, 2.0 );\n* var v = f();\n* // returns \n*\n* @example\n* var f = factory( 0.5, 3.0, {\n* 'seed': 297\n* });\n* var v = f();\n* // returns \n*/\nfunction factory() {\n\tvar rchisq;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar d1;\n\tvar d2;\n\n\tif ( arguments.length === 0 ) {\n\t\trchisq = chisquare();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trchisq = chisquare({\n\t\t\t\t'prng': opts.prng\n\t\t\t});\n\t\t} else {\n\t\t\trchisq = chisquare( opts );\n\t\t}\n\t} else {\n\t\td1 = arguments[ 0 ];\n\t\td2 = arguments[ 1 ];\n\t\terr = validate( d1, d2 );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trchisq = chisquare({\n\t\t\t\t\t'prng': opts.prng\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\trchisq = chisquare( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trchisq = chisquare();\n\t\t}\n\t}\n\tif ( d1 === void 0 ) {\n\t\tprng = f2;\n\t} else {\n\t\tprng = f1;\n\t}\n\trand = rchisq.PRNG;\n\n\tsetReadOnly( prng, 'NAME', 'f' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t}\n\tsetReadOnly( prng, 'PRNG', rand );\n\treturn prng;\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\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 = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( d1 === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ d1, d2 ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number from an F distribution with bound parameters.\n\t*\n\t* @private\n\t* @returns {NonNegativeNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = f1();\n\t* // returns \n\t*/\n\tfunction f1() {\n\t\treturn f0( rchisq, d1, d2 );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number from an F distribution with parameters `d1` and `d2`.\n\t*\n\t* @private\n\t* @param {PositiveNumber} d1 - degrees of freedom\n\t* @param {PositiveNumber} d2 - degrees of freedom\n\t* @returns {NonNegativeNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = f2( 3.0, 2.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = f2( 3.0, 0.0 );\n\t* // returns NaN\n\t*\n\t* @example\n\t* var v = f2( 0.0, 2.0 );\n\t* // returns NaN\n\t*\n\t* @example\n\t* var v = f2( NaN, NaN );\n\t* // returns NaN\n\t*/\n\tfunction f2( d1, d2 ) {\n\t\tif (\n\t\t\tisnan( d1 ) ||\n\t\t\tisnan( d2 ) ||\n\t\t\td1 <= 0.0 ||\n\t\t\td2 <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn f0( rchisq, d1, d2 );\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' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number from an F distribution with parameters `d1` and `d2`.\n*\n* @name f\n* @type {PRNG}\n* @param {PositiveNumber} d1 - degrees of freedom\n* @param {PositiveNumber} d2 - degrees of freedom\n* @returns {NonNegativeNumber} pseudorandom number\n*\n* @example\n* var v = f( 3.0, 2.0 );\n* // returns \n*\n* @example\n* var r = f( -2.0, 5.0 );\n* // returns NaN\n*/\nvar f = factory();\n\n\n// EXPORTS //\n\nmodule.exports = f;\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* F distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/f\n*\n* @example\n* var f = require( '@stdlib/random/base/f' );\n*\n* var v = f( 5.0, 3.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/f' ).factory;\n*\n* var f = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = f();\n* // returns \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", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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 binaryFactory = require( './../../../array/tools/binary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/f' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from an F distribution.\n*\n* @name factory\n* @type {Function}\n* @param {PositiveNumber} [d1] - degrees of freedom\n* @param {PositiveNumber} [d2] - degrees of freedom\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `d1` must be a positive number\n* @throws {TypeError} `d2` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var f = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = f( 10 );\n* // returns \n*\n* @example\n* var f = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = f( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = binaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from an F distribution.\n*\n* @name f\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {PositiveNumber} d1 - degrees of freedom\n* @param {PositiveNumber} d2 - degrees of freedom\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = f( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = f( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar f = factory();\n\n\n// EXPORTS //\n\nmodule.exports = f;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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* Create an array containing pseudorandom numbers drawn from an F distribution.\n*\n* @module @stdlib/random/array/f\n*\n* @example\n* var f = require( '@stdlib/random/array/f' );\n*\n* var arr = f( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var f = require( '@stdlib/random/array/f' );\n*\n* var arr = f( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var f = require( '@stdlib/random/array/f' );\n*\n* var rand = f.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var f = require( '@stdlib/random/array/f' );\n*\n* var rand = f.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar contains = require( '@stdlib/array/base/assert/contains' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Array} dtypes - list of supported output data types\n* @param {Options} options - function options\n* @param {string} [options.dtype] - output array data type\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var options = {\n* 'dtype': 'float64'\n* };\n* var err = validate( opts, dtypes, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, dtypes, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'dtype' ) ) {\n\t\topts.dtype = options.dtype;\n\t\tif ( !contains( dtypes, opts.dtype ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', dtypes.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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/* eslint-disable no-restricted-syntax, no-invalid-this */\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isStringArray = require( '@stdlib/assert/is-string-array' ).primitives;\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar contains = require( '@stdlib/array/base/assert/contains' );\nvar filledBy = require( '@stdlib/array/base/filled-by' );\nvar ternary = require( '@stdlib/strided/base/ternary' );\nvar ctors = require( '@stdlib/array/ctors' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Constructor for creating arrays filled with pseudorandom values drawn from a ternary PRNG.\n*\n* @constructor\n* @param {Function} prng - ternary pseudorandom value generator\n* @param {StringArray} dtypes - list of supported output data types\n* @param {string} dtype - default output data type\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} second argument must be an array of strings\n* @throws {TypeError} third argument must be a supported data type\n* @returns {Random} instance\n*\n* @example\n* var triangular = require( '@stdlib/random/base/triangular' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var defaultDType = 'float64';\n*\n* var rand = new Random( triangular, dtypes, defaultDType );\n*\n* var v = rand.generate( 10, 2.0, 5.0, 3.33 );\n* // returns \n*/\nfunction Random( prng, dtypes, dtype ) {\n\tif ( !( this instanceof Random ) ) {\n\t\treturn new Random( prng, dtypes, dtype );\n\t}\n\tif ( !isFunction( prng ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', prng ) );\n\t}\n\t// TODO: tighten this up by actually validating that `dtypes` contains only recognized/supported dtype strings\n\tif ( !isStringArray( dtypes ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an array of strings. Value: `%s`.', dtypes ) );\n\t}\n\t// Require that the default output array data type be a member of the list of supported output array data types...\n\tif ( !contains( dtypes, dtype ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a supported data type. Value: `%s`.', dtype ) );\n\t}\n\tthis._prng = prng;\n\tthis._dtypes = dtypes;\n\tthis._dtype = dtype;\n\treturn this;\n}\n\n/**\n* Returns an array filled with pseudorandom values drawn from a ternary PRNG.\n*\n* @name generate\n* @memberof Random.prototype\n* @type {Function}\n* @param {NonNegativeInteger} len - number of elements\n* @param {*} param1 - first PRNG parameter\n* @param {*} param2 - second PRNG parameter\n* @param {*} param3 - third PRNG parameter\n* @param {Options} [options] - function options\n* @param {string} [options.dtype] - array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {Collection} output array\n*\n* @example\n* var triangular = require( '@stdlib/random/base/triangular' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var defaultDType = 'float64';\n*\n* var rand = new Random( triangular, dtypes, defaultDType );\n*\n* var v = rand.generate( 10, 2.0, 5.0, 3.33 );\n* // returns \n*/\nsetReadOnly( Random.prototype, 'generate', function generate( len, param1, param2, param3, options ) {\n\tvar ctor;\n\tvar opts;\n\tvar prng;\n\tvar out;\n\tvar err;\n\tvar dt;\n\tif ( !isNonNegativeInteger( len ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t}\n\topts = {};\n\tif ( arguments.length > 4 ) {\n\t\terr = validate( opts, this._dtypes, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// NOTE: we could alternatively use the PRNG factory function to create a nullary PRNG function which applies parameters for each invocation; however, this would impose a one-time cost which is likely to be rather expensive when generating small arrays. The decision made here avoids this cost, despite a small cost due to repeatedly validating parameters for each generated pseudorandom value. Additionally, the current implementation has the added benefit that it mirrors the underlying PRNG where invalid parameters result in, e.g., a return value of `NaN` (however, realization of this benefit depends on the output array being a floating-point array).\n\tprng = this._prng;\n\tdt = opts.dtype || this._dtype;\n\tif ( dt === 'generic' ) {\n\t\treturn filledBy( len, wrapper );\n\t}\n\tctor = ctors( dt );\n\tout = new ctor( len );\n\tternary( [ [ param1 ], [ param2 ], [ param3 ], out ], [ len ], [ 0, 0, 0, 1 ], prng ); // eslint-disable-line max-len\n\treturn out;\n\n\t/**\n\t* Applies parameters to a pseudorandom value generator function.\n\t*\n\t* @private\n\t* @returns {*} pseudorandom value\n\t*/\n\tfunction wrapper() {\n\t\treturn prng( param1, param2, param3 );\n\t}\n});\n\n/**\n* Fills an array with pseudorandom values drawn from a ternary PRNG.\n*\n* @name assign\n* @memberof Random.prototype\n* @type {Function}\n* @param {*} param1 - first PRNG parameter\n* @param {*} param2 - second PRNG parameter\n* @param {*} param3 - third PRNG parameter\n* @param {Collection} out - output array\n* @throws {TypeError} fourth argument must be a collection\n* @returns {Collection} output array\n*\n* @example\n* var triangular = require( '@stdlib/random/base/triangular' );\n* var zeros = require( '@stdlib/array/zeros' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var defaultDType = 'float64';\n*\n* var rand = new Random( triangular, dtypes, defaultDType );\n*\n* var out = zeros( 10, 'float64' );\n* // returns \n*\n* var v = rand.assign( 2.0, 5.0, 3.33, out );\n* // returns \n*\n* var bool = ( v === out );\n* // returns true\n*/\nsetReadOnly( Random.prototype, 'assign', function assign( param1, param2, param3, out ) {\n\tif ( !isCollection( out ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be an array-like object. Value: `%s`.', out ) );\n\t}\n\t// NOTE: we could alternatively use the PRNG factory function to create a nullary PRNG function which applies parameters for each invocation; however, this would impose a one-time cost which is likely to be rather expensive when filling small arrays. The decision made here avoids this cost, despite a small cost due to repeatedly validating parameters for each generated pseudorandom value. Additionally, the current implementation has the added benefit that it mirrors the underlying PRNG where invalid parameters result in, e.g., a return value of `NaN` (however, realization of this benefit depends on the output array being a floating-point array).\n\tternary( [ [ param1 ], [ param2 ], [ param3 ], out ], [ out.length ], [ 0, 0, 0, 1 ], this._prng ); // eslint-disable-line max-len\n\treturn out;\n});\n\n\n// EXPORTS //\n\nmodule.exports = Random;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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* Constructor for creating arrays filled with pseudorandom values drawn from a ternary PRNG.\n*\n* @module @stdlib/random/array/tools/ternary\n*\n* @example\n* var triangular = require( '@stdlib/random/base/triangular' );\n* var Random = require( '@stdlib/random/array/tools/ternary' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var defaultDType = 'float64';\n*\n* var rand = new Random( triangular, dtypes, defaultDType );\n*\n* var v = rand.generate( 10, 2.0, 5.0, 3.33 );\n* // returns \n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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 setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar isStringArray = require( '@stdlib/assert/is-string-array' ).primitives;\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isMethodIn = require( '@stdlib/assert/is-method-in' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar contains = require( '@stdlib/array/base/assert/contains' ).factory;\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar TernaryRandom = require( './../../../../array/tools/ternary' );\nvar NullaryRandom = require( './../../../../array/tools/nullary' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a factory function for generating pseudorandom values drawn from a ternary PRNG.\n*\n* @param {Function} prng - ternary pseudorandom value generator\n* @param {Function} prng.factory - method which returns a new ternary pseudorandom value generator\n* @param {StringArray} dtypes - list of supported output array data types\n* @param {string} dtype - default output array data type\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} first argument must have a `factory` method\n* @throws {TypeError} second argument must be an array of strings\n* @throws {TypeError} third argument must be a supported output array data type\n* @returns {Function} function which returns a function for creating arrays\n*\n* @example\n* var triangular = require( '@stdlib/random/base/triangular' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n*\n* var factory = createFactory( triangular, dtypes, 'float64' );\n* // returns \n*\n* var random = factory();\n* // returns \n*\n* var x = random( 10, 2.0, 5.0, 3.33 );\n* // returns \n*\n* @example\n* var triangular = require( '@stdlib/random/base/triangular' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n*\n* var factory = createFactory( triangular, dtypes, 'float64' );\n* // returns \n*\n* var random = factory();\n* // returns \n*\n* var x = random( 10, 2.0, 5.0, 3.33, {\n* 'dtype': 'float32'\n* });\n* // returns \n*/\nfunction createFactory( prng, dtypes, dtype ) {\n\tvar isValidDataType;\n\tif ( !isFunction( prng ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', prng ) );\n\t}\n\tif ( !isMethodIn( prng, 'factory' ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must have a `%s` method.', 'factory' ) );\n\t}\n\t// TODO: tighten this up by actually validating that `dtypes` contains only recognized/supported dtype strings\n\tif ( !isStringArray( dtypes ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must an array of strings. Value: `%s`.', dtypes ) );\n\t}\n\t// Require that the default output array data type be a member of the list of supported output array data types...\n\tif ( !contains( dtypes, dtype ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a supported data type. Value: `%s`.', dtype ) );\n\t}\n\tisValidDataType = contains( dtypes );\n\treturn factory;\n\n\t/**\n\t* Returns a function for generating pseudorandom values drawn from a PRNG.\n\t*\n\t* @private\n\t* @param {*} [param1] - first PRNG parameter\n\t* @param {*} [param2] - second PRNG parameter\n\t* @param {*} [param3] - third PRNG parameter\n\t* @param {Options} [options] - function options\n\t* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n\t* @param {*} [options.seed] - pseudorandom value generator seed\n\t* @param {*} [options.state] - pseudorandom value generator state\n\t* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom value generator state\n\t* @param {string} [options.dtype] - default output array data type\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {Function} function for creating arrays\n\t*/\n\tfunction factory() {\n\t\tvar Random;\n\t\tvar random;\n\t\tvar param1;\n\t\tvar param2;\n\t\tvar param3;\n\t\tvar assign;\n\t\tvar nargs;\n\t\tvar base;\n\t\tvar opts;\n\t\tvar rand;\n\t\tvar dt;\n\n\t\tnargs = arguments.length;\n\t\tif ( nargs < 1 ) { // e.g., factory()\n\t\t\topts = {};\n\t\t\tbase = prng;\n\t\t\trand = rand1;\n\t\t} else if ( nargs === 1 ) { // e.g., factory( {} )\n\t\t\topts = arguments[ 0 ];\n\t\t\tbase = prng.factory( opts );\n\t\t\trand = rand1;\n\t\t} else if ( nargs === 3 ) { // e.g., factory( param1, param2, param3 )\n\t\t\tparam1 = arguments[ 0 ];\n\t\t\tparam2 = arguments[ 1 ];\n\t\t\tparam3 = arguments[ 2 ];\n\t\t\topts = {};\n\t\t\tbase = prng.factory( param1, param2, param3 );\n\t\t\trand = rand2;\n\t\t} else { // e.g., factory( param1, param2, param3, {} )\n\t\t\tparam1 = arguments[ 0 ];\n\t\t\tparam2 = arguments[ 1 ];\n\t\t\tparam3 = arguments[ 2 ];\n\t\t\topts = arguments[ 3 ];\n\t\t\tbase = prng.factory( param1, param2, param3, opts );\n\t\t\trand = rand2;\n\t\t}\n\t\tif ( hasOwnProp( opts, 'dtype' ) ) {\n\t\t\tdt = opts.dtype;\n\t\t\tif ( !isValidDataType( dt ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', dtypes.join( '\", \"' ), dt ) );\n\t\t\t}\n\t\t} else {\n\t\t\tdt = dtype;\n\t\t}\n\t\tif ( rand === rand1 ) {\n\t\t\tassign = assign1;\n\t\t\tRandom = TernaryRandom;\n\t\t} else {\n\t\t\tassign = assign2;\n\t\t\tRandom = NullaryRandom;\n\t\t}\n\t\trandom = new Random( base, dtypes, dt );\n\t\tif ( opts && opts.prng ) {\n\t\t\tsetReadOnly( rand, 'seed', null );\n\t\t\tsetReadOnly( rand, 'seedLength', null );\n\t\t\tsetReadWriteAccessor( rand, 'state', constantFunction( null ), noop );\n\t\t\tsetReadOnly( rand, 'stateLength', null );\n\t\t\tsetReadOnly( rand, 'byteLength', null );\n\t\t} else {\n\t\t\tsetReadOnlyAccessor( rand, 'seed', getSeed );\n\t\t\tsetReadOnlyAccessor( rand, 'seedLength', getSeedLength );\n\t\t\tsetReadWriteAccessor( rand, 'state', getState, setState );\n\t\t\tsetReadOnlyAccessor( rand, 'stateLength', getStateLength );\n\t\t\tsetReadOnlyAccessor( rand, 'byteLength', getStateSize );\n\t\t}\n\t\tsetReadOnly( rand, 'PRNG', base.PRNG );\n\t\tsetReadOnly( rand, 'assign', assign );\n\t\treturn rand;\n\n\t\t/**\n\t\t* Returns an array of pseudorandom values drawn from a PRNG.\n\t\t*\n\t\t* @private\n\t\t* @param {NonNegativeInteger} len - output array length\n\t\t* @param {*} param1 - first PRNG parameter\n\t\t* @param {*} param2 - second PRNG parameter\n\t\t* @param {*} param3 - third PRNG parameter\n\t\t* @param {Options} [options] - function options\n\t\t* @param {string} [options.dtype] - output array data type\n\t\t* @throws {TypeError} first argument must be a nonnegative integer\n\t\t* @throws {TypeError} options argument must be an object\n\t\t* @throws {TypeError} must provide valid options\n\t\t* @returns {Collection} output array\n\t\t*/\n\t\tfunction rand1( len, param1, param2, param3, options ) {\n\t\t\tif ( arguments.length < 5 ) {\n\t\t\t\treturn random.generate( len, param1, param2, param3 );\n\t\t\t}\n\t\t\treturn random.generate( len, param1, param2, param3, options );\n\t\t}\n\n\t\t/**\n\t\t* Returns an array of pseudorandom values drawn from a PRNG.\n\t\t*\n\t\t* @private\n\t\t* @param {NonNegativeInteger} len - output array length\n\t\t* @param {Options} [options] - function options\n\t\t* @param {string} [options.dtype] - output array data type\n\t\t* @throws {TypeError} first argument must be a nonnegative integer\n\t\t* @throws {TypeError} options argument must be an object\n\t\t* @throws {TypeError} must provide valid options\n\t\t* @returns {Collection} output array\n\t\t*/\n\t\tfunction rand2( len, options ) {\n\t\t\tif ( arguments.length < 2 ) {\n\t\t\t\treturn random.generate( len );\n\t\t\t}\n\t\t\treturn random.generate( len, options );\n\t\t}\n\n\t\t/**\n\t\t* Fills an array with pseudorandom values drawn from a PRNG.\n\t\t*\n\t\t* @private\n\t\t* @param {*} param1 - first PRNG parameter\n\t\t* @param {*} param2 - second PRNG parameter\n\t\t* @param {*} param3 - third PRNG parameter\n\t\t* @param {Collection} out - output array\n\t\t* @throws {TypeError} third argument must be a collection\n\t\t* @returns {Collection} output array\n\t\t*/\n\t\tfunction assign1( param1, param2, param3, out ) {\n\t\t\treturn random.assign( param1, param2, param3, out );\n\t\t}\n\n\t\t/**\n\t\t* Fills an array with pseudorandom values drawn from a PRNG.\n\t\t*\n\t\t* @private\n\t\t* @param {Collection} out - output array\n\t\t* @throws {TypeError} first argument must be a collection\n\t\t* @returns {Collection} output array\n\t\t*/\n\t\tfunction assign2( out ) {\n\t\t\treturn random.assign( out );\n\t\t}\n\n\t\t/**\n\t\t* Returns the PRNG seed.\n\t\t*\n\t\t* @private\n\t\t* @returns {*} seed\n\t\t*/\n\t\tfunction getSeed() {\n\t\t\treturn rand.PRNG.seed;\n\t\t}\n\n\t\t/**\n\t\t* Returns the PRNG seed length.\n\t\t*\n\t\t* @private\n\t\t* @returns {PositiveInteger} seed length\n\t\t*/\n\t\tfunction getSeedLength() {\n\t\t\treturn rand.PRNG.seedLength;\n\t\t}\n\n\t\t/**\n\t\t* Returns the PRNG state length.\n\t\t*\n\t\t* @private\n\t\t* @returns {PositiveInteger} state length\n\t\t*/\n\t\tfunction getStateLength() {\n\t\t\treturn rand.PRNG.stateLength;\n\t\t}\n\n\t\t/**\n\t\t* Returns the PRNG state size (in bytes).\n\t\t*\n\t\t* @private\n\t\t* @returns {PositiveInteger} state size (in bytes)\n\t\t*/\n\t\tfunction getStateSize() {\n\t\t\treturn rand.PRNG.byteLength;\n\t\t}\n\n\t\t/**\n\t\t* Returns the current pseudorandom number generator state.\n\t\t*\n\t\t* @private\n\t\t* @returns {*} current state\n\t\t*/\n\t\tfunction getState() {\n\t\t\treturn rand.PRNG.state;\n\t\t}\n\n\t\t/**\n\t\t* Sets the pseudorandom number generator state.\n\t\t*\n\t\t* @private\n\t\t* @param {*} s - generator state\n\t\t* @throws {Error} must provide a valid state\n\t\t*/\n\t\tfunction setState( s ) {\n\t\t\trand.PRNG.state = s;\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = createFactory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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* Create a factory function for generating pseudorandom values drawn from a ternary PRNG.\n*\n* @module @stdlib/random/array/tools/ternary-factory\n*\n* @example\n* var triangular = require( '@stdlib/random/base/triangular' );\n* var ternaryFactory = require( '@stdlib/random/array/tools/ternary-factory' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n*\n* var factory = ternaryFactory( triangular, dtypes, 'float64' );\n* // returns \n*\n* var random = factory();\n* // returns \n*\n* var x = random( 10, 2.0, 5.0, 3.33 );\n* // returns \n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/assert/is-nan' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} s - scale parameter\n* @param {number} m - location parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0, 1.3 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( alpha, s, m ) {\n\tif ( !isPositiveNumber( alpha ) || isnan( alpha ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a positive number and not NaN. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositiveNumber( s ) || isnan( s ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number and not NaN. Value: `%s`.', s ) );\n\t}\n\tif ( !isNumber( m ) || isnan( m ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Third argument must be a number and not NaN. Value: `%s`.', m ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 pow = require( '@stdlib/math/base/special/pow' );\nvar ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Fr\u00E9chet distribution with shape `alpha`, scale `s`, and location `m`.\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} s - scale parameter\n* @param {number} m - location parameter\n* @returns {number} pseudorandom number\n*/\nfunction frechet( rand, alpha, s, m ) {\n\treturn m + ( s * ( pow( -ln( rand() ), -1.0/alpha ) ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = frechet;\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 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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar frechet0 = require( './frechet.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating random numbers drawn from a Fr\u00E9chet distribution.\n*\n* @param {PositiveNumber} [alpha] - shape parameter\n* @param {PositiveNumber} [s] - scale parameter\n* @param {number} [m] - location parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} `alpha` must be a positive number\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} `m` must be a number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var frechet = factory( 1.0, 1.0, 0.8 );\n* var v = frechet();\n* // returns \n*\n* @example\n* var frechet = factory( 1.0, 1.0, -2.0, {\n* 'seed': 297\n* });\n* var v = frechet();\n* // returns \n*/\nfunction factory() {\n\tvar alpha;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar s;\n\tvar m;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\talpha = arguments[ 0 ];\n\t\ts = arguments[ 1 ];\n\t\tm = arguments[ 2 ];\n\t\terr = validate( alpha, s, m );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 3 ) {\n\t\t\topts = arguments[ 3 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( alpha === void 0 ) {\n\t\tprng = frechet2;\n\t} else {\n\t\tprng = frechet1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'frechet' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\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 = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( alpha === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ alpha, s, m ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Fr\u00E9chet distribution with bound parameters.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = frechet1();\n\t* // returns \n\t*/\n\tfunction frechet1() {\n\t\treturn frechet0( rand, alpha, s, m );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Fr\u00E9chet distribution with shape `alpha`, scale `s`, and location `m`.\n\t*\n\t* @private\n\t* @param {PositiveNumber} alpha - shape parameter\n\t* @param {PositiveNumber} s - scale parameter\n\t* @param {number} m - location parameter\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = frechet2( 2.0, 1.0, 0.5 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = frechet2( 1.0, 1.0, 0.5 );\n\t* // returns NaN\n\t*\n\t* @example\n\t* var v = frechet2( 1.0, 2.0, NaN );\n\t* // returns NaN\n\t*/\n\tfunction frechet2( alpha, s, m ) {\n\t\tif (\n\t\t\tisnan( alpha ) ||\n\t\t\tisnan( s ) ||\n\t\t\tisnan( m ) ||\n\t\t\talpha <= 0.0 ||\n\t\t\ts <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn frechet0( rand, alpha, s, m );\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' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Fr\u00E9chet distribution with shape `alpha`, scale `s`, and location `m`.\n*\n* @name frechet\n* @type {PRNG}\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} s - scale parameter\n* @param {number} m - location parameter\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = frechet( 1.0, 1.0, 0.5 );\n* // returns \n*/\nvar frechet = factory();\n\n\n// EXPORTS //\n\nmodule.exports = frechet;\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* Fr\u00E9chet distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/frechet\n*\n* @example\n* var frechet = require( '@stdlib/random/base/frechet' );\n*\n* var v = frechet( 10.0, 10.0, 7.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/frechet' ).factory;\n*\n* var frechet = factory( 5.0, 5.0, 3.0, {\n* 'seed': 643361677\n* });\n*\n* var v = frechet();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/frechet' ).factory;\n*\n* var frechet = factory({\n* 'seed': 643361677\n* });\n*\n* var v = frechet( 5.0, 5.0, 3.0 );\n* // returns \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", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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 ternaryFactory = require( './../../../array/tools/ternary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/frechet' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a Fr\u00E9chet distribution.\n*\n* @name factory\n* @type {Function}\n* @param {PositiveNumber} [alpha] - shape parameter\n* @param {PositiveNumber} [s] - scale parameter\n* @param {number} [m] - location parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} `m` must be a number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var frechet = factory( 2.0, 5.0, 3.0 );\n* // returns \n*\n* var arr = frechet( 10 );\n* // returns \n*\n* @example\n* var frechet = factory( 2.0, 5.0, 3.0 );\n* // returns \n*\n* var arr = frechet( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = ternaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a Fr\u00E9chet distribution.\n*\n* @name frechet\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} s - scale parameter\n* @param {number} m - location parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = frechet( 10, 2.0, 5.0, 3.0 );\n* // returns \n*\n* @example\n* var arr = frechet( 10, 2.0, 5.0, 3.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar frechet = factory();\n\n\n// EXPORTS //\n\nmodule.exports = frechet;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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* Create an array containing pseudorandom numbers drawn from a Fr\u00E9chet distribution.\n*\n* @module @stdlib/random/array/frechet\n*\n* @example\n* var frechet = require( '@stdlib/random/array/frechet' );\n*\n* var arr = frechet( 10, 2.0, 5.0, 3.0 );\n* // returns \n*\n* @example\n* var frechet = require( '@stdlib/random/array/frechet' );\n*\n* var arr = frechet( 10, 2.0, 5.0, 3.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var frechet = require( '@stdlib/random/array/frechet' );\n*\n* var rand = frechet.factory( 2.0, 5.0, 3.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var frechet = require( '@stdlib/random/array/frechet' );\n*\n* var rand = frechet.factory( 2.0, 5.0, 3.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 binaryFactory = require( './../../../array/tools/binary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/gamma' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a gamma distribution.\n*\n* @name factory\n* @type {Function}\n* @param {PositiveNumber} [alpha] - shape parameter\n* @param {PositiveNumber} [beta] - rate parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var gamma = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = gamma( 10 );\n* // returns \n*\n* @example\n* var gamma = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = gamma( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = binaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a gamma distribution.\n*\n* @name gamma\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - rate parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = gamma( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = gamma( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar gamma = factory();\n\n\n// EXPORTS //\n\nmodule.exports = gamma;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create an array containing pseudorandom numbers drawn from a gamma distribution.\n*\n* @module @stdlib/random/array/gamma\n*\n* @example\n* var gamma = require( '@stdlib/random/array/gamma' );\n*\n* var arr = gamma( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var gamma = require( '@stdlib/random/array/gamma' );\n*\n* var arr = gamma( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var gamma = require( '@stdlib/random/array/gamma' );\n*\n* var rand = gamma.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var gamma = require( '@stdlib/random/array/gamma' );\n*\n* var rand = gamma.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\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 floor = require( '@stdlib/math/base/special/floor' );\nvar ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a geometric distribution.\n*\n* ## Proof\n*\n* Consider\n*\n* ```tex\n* N = \\left \\lfloor \\ln (U) / \\ln (1-p) \\right \\rfloor\n* ```\n*\n* where \\\\( U \\\\) is uniform on the interval \\\\((0,1)\\\\). Accordingly, \\\\(N\\\\) must be a nonnegative integer, and, for every \\\\( n \\geq 0\\\\), the event \\\\(A_n = \\left \\{ N = n \\right \\}\\\\) is\n*\n* ```tex\n* A_n = \\left \\{(n+1) \\ln (1-p) < \\ln (U) \\leq n \\ln (1-p) \\right \\}\n* ```\n*\n* where \\\\(\\ln (1-p) < 0\\\\). Thus,\n*\n* ```tex\n* A_n = \\left \\{(1-p)^{n+1} < U \\leq (1-p)^n \\right \\}\n* ```\n*\n* For every \\\\(u < v\\\\) on the interval \\\\((0,1)\\\\),\n*\n* ```tex\n* P\\left \\[u < U \\leq v\\right \\] = v - u\n* ```\n*\n* Hence,\n*\n* ```tex\n* P\\left \\[N = n \\right \\] = P\\left \\[A_n\\right \\] = (1-p)^n - (1-p)^{n+1} = (1-p)^n(1-(1-p)) = p(1-p)^n\n* ```\n*\n* which proves that \\\\(N\\\\) is a geometric random variable.\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {Probability} p - success probability\n* @returns {NonNegativeInteger} pseudorandom number\n*/\nfunction geometric( rand, p ) {\n\tvar u = rand();\n\tif ( u === 0.0 ) {\n\t\t// Drawing random variates from a PRNG (with period > 1) is effectively sampling without replacement. Thus, should not be possible to draw `0` twice in a row.\n\t\tu = rand();\n\t}\n\treturn floor( ln( u ) / ln( 1.0-p ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = geometric;\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 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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar isProbability = require( '@stdlib/assert/is-probability' ).isPrimitive;\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar geometric0 = require( './geometric.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating geometric distributed random numbers.\n*\n* @param {Probability} [p] - success probability\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} `p` must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var geometric = factory( 0.5 );\n* var v = geometric();\n* // returns \n*\n* @example\n* var geometric = factory( 0.8, {\n* 'seed': 297\n* });\n* var v = geometric();\n* // returns \n*\n* @example\n* var geometric = factory();\n* var v = geometric( 0.5 );\n* // returns \n*/\nfunction factory() {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar p;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if (\n\t\targuments.length === 1 &&\n\t\tisObject( arguments[ 0 ] )\n\t) {\n\t\topts = arguments[ 0 ];\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tp = arguments[ 0 ];\n\t\tif ( !isProbability( p ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a probability. Value: `%s`.', p ) );\n\t\t}\n\t\tif ( arguments.length > 1 ) {\n\t\t\topts = arguments[ 1 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( p === void 0 ) {\n\t\tprng = geometric2;\n\t} else {\n\t\tprng = geometric1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'geometric' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\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 = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( p === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ p ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a geometric distribution with bound parameter `p`.\n\t*\n\t* @private\n\t* @returns {NonNegativeInteger} pseudorandom number\n\t*\n\t* @example\n\t* var v = geometric1();\n\t* // returns \n\t*/\n\tfunction geometric1() {\n\t\treturn geometric0( rand, p );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a geometric distribution with parameter `p`.\n\t*\n\t* @private\n\t* @param {Probability} p - success probability\n\t* @returns {NonNegativeInteger} pseudorandom number\n\t*\n\t* @example\n\t* var v = geometric2( 0.5 );\n\t* // returns \n\t*/\n\tfunction geometric2( p ) {\n\t\tif (\n\t\t\tisnan( p ) ||\n\t\t\tp < 0.0 ||\n\t\t\tp > 1.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn geometric0( rand, p );\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' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom random number drawn from a geometric distribution with parameter `p`.\n*\n* @name geometric\n* @type {PRNG}\n* @param {Probability} p - success probability\n* @returns {NonNegativeInteger} pseudorandom number\n*\n* @example\n* var v = geometric( 0.5 );\n* // returns \n*\n* @example\n* var v = geometric( 3.14 );\n* // returns NaN\n*\n* @example\n* var v = geometric( -1.0 );\n* // returns NaN\n*\n* @example\n* var v = geometric( NaN );\n* // returns NaN\n*/\nvar geometric = factory();\n\n\n// EXPORTS //\n\nmodule.exports = geometric;\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* Geometric distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/geometric\n*\n* @example\n* var geometric = require( '@stdlib/random/base/geometric' );\n*\n* var v = geometric( 0.5 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/geometric' ).factory;\n*\n* var geometric = factory( 0.3, {\n* 'seed': 297\n* });\n*\n* var v = geometric();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/geometric' ).factory;\n*\n* var geometric = factory({\n* 'seed': 297\n* });\n*\n* var v = geometric( 0.5 );\n* // returns \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", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 unaryFactory = require( './../../../array/tools/unary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/geometric' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a geometric distribution.\n*\n* @name factory\n* @type {Function}\n* @param {Probability} [p] - success probability\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `p` must be a probability (i.e., a number on the interval [0,1])\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var geometric = factory( 0.01 );\n* // returns \n*\n* var arr = geometric( 10 );\n* // returns \n*\n* @example\n* var geometric = factory( 0.01 );\n* // returns \n*\n* var arr = geometric( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = unaryFactory( base, DTYPES, defaults.get( 'dtypes.real' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a geometric distribution.\n*\n* @name geometric\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {Probability} p - success probability\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = geometric( 10, 0.01 );\n* // returns \n*\n* @example\n* var arr = geometric( 10, 0.01, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar geometric = factory();\n\n\n// EXPORTS //\n\nmodule.exports = geometric;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create an array containing pseudorandom numbers drawn from a geometric distribution.\n*\n* @module @stdlib/random/array/geometric\n*\n* @example\n* var geometric = require( '@stdlib/random/array/geometric' );\n*\n* var arr = geometric( 10, 0.01 );\n* // returns \n*\n* @example\n* var geometric = require( '@stdlib/random/array/geometric' );\n*\n* var arr = geometric( 10, 0.01, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var geometric = require( '@stdlib/random/array/geometric' );\n*\n* var rand = geometric.factory( 0.01 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var geometric = require( '@stdlib/random/array/geometric' );\n*\n* var rand = geometric.factory( 0.01 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\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 isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar isnan = require( '@stdlib/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {number} mu - mean\n* @param {PositiveNumber} beta - shape parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( mu, beta ) {\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( beta ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Returns pseudorandom number drawn from a Gumbel distribution.\n*\n* @private\n* @param {PRNG} rand - PRNG for generating uniformly distributed numbers\n* @param {number} mu - mean\n* @param {PositiveNumber} beta - scale parameter\n* @returns {number} pseudorandom number\n*/\nfunction gumbel( rand, mu, beta ) {\n\treturn mu - ( beta*ln( -ln( rand() ) ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = gumbel;\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 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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar gumbel0 = require( './gumbel.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating random numbers from a Gumbel distribution.\n*\n* @param {number} [mu] - mean\n* @param {PositiveNumber} [beta] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} `mu` must be a number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var gumbel = factory( 0.0, 1.0 );\n* var v = gumbel();\n* // returns \n*\n* @example\n* var gumbel = factory( -3.0, 0.5, {\n* 'seed': 297\n* });\n* var v = gumbel();\n* // returns \n*/\nfunction factory() {\n\tvar beta;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar mu;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tmu = arguments[ 0 ];\n\t\tbeta = arguments[ 1 ];\n\t\terr = validate( mu, beta );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( mu === void 0 ) {\n\t\tprng = gumbel2;\n\t} else {\n\t\tprng = gumbel1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'gumbel' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\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 = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( mu === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ mu, beta ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns pseudorandom number drawn from a Gumbel distribution with bound parameters.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = gumbel1();\n\t* // returns \n\t*/\n\tfunction gumbel1() {\n\t\treturn gumbel0( rand, mu, beta );\n\t}\n\n\t/**\n\t* Returns pseudorandom number drawn from a Gumbel distribution.\n\t*\n\t* @private\n\t* @param {number} mu - mean\n\t* @param {PositiveNumber} beta - scale parameter\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = gumbel2( 0.0, 2.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = gumbel2( 0.0, -1.0 );\n\t* // returns NaN\n\t*/\n\tfunction gumbel2( mu, beta ) {\n\t\tif (\n\t\t\tisnan( mu ) ||\n\t\t\tisnan( beta ) ||\n\t\t\tbeta <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn gumbel0( rand, mu, beta );\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' );\n\n\n// MAIN //\n\n/**\n* Returns pseudorandom number drawn from a Gumbel distribution.\n*\n* @name gumbel\n* @type {PRNG}\n* @param {number} mu - mean\n* @param {PositiveNumber} beta - scale parameter\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = gumbel( 0.0, 2.0 );\n* // returns \n*\n* @example\n* var v = gumbel( 0.0, -1.0 );\n* // returns NaN\n*/\nvar gumbel = factory();\n\n\n// EXPORTS //\n\nmodule.exports = gumbel;\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* Gumbel distribution pseudorandom numbers.\n*\n* @module @stdlib/random/base/gumbel\n*\n* @example\n* var gumbel = require( '@stdlib/random/base/gumbel' );\n*\n* var v = gumbel( 0.5, 1.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/gumbel' ).factory;\n*\n* var gumbel = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = gumbel();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/gumbel' ).factory;\n*\n* var gumbel = factory({\n* 'seed': 297\n* });\n*\n* var v = gumbel( 2.0, 2.0 );\n* // returns \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", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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 binaryFactory = require( './../../../array/tools/binary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/gumbel' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a Gumbel distribution.\n*\n* @name factory\n* @type {Function}\n* @param {number} [mu] - mean\n* @param {PositiveNumber} [beta] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var gumbel = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = gumbel( 10 );\n* // returns \n*\n* @example\n* var gumbel = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = gumbel( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = binaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a Gumbel distribution.\n*\n* @name gumbel\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {number} mu - mean\n* @param {PositiveNumber} beta - scale parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = gumbel( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = gumbel( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar gumbel = factory();\n\n\n// EXPORTS //\n\nmodule.exports = gumbel;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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* Create an array containing pseudorandom numbers drawn from a Gumbel distribution.\n*\n* @module @stdlib/random/array/gumbel\n*\n* @example\n* var gumbel = require( '@stdlib/random/array/gumbel' );\n*\n* var arr = gumbel( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var gumbel = require( '@stdlib/random/array/gumbel' );\n*\n* var arr = gumbel( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var gumbel = require( '@stdlib/random/array/gumbel' );\n*\n* var rand = gumbel.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var gumbel = require( '@stdlib/random/array/gumbel' );\n*\n* var rand = gumbel.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\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 isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {NonNegativeInteger} N - population size\n* @param {NonNegativeInteger} K - subpopulation size\n* @param {NonNegativeInteger} n - number of draws\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1, 2, 3 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( N, K, n ) {\n\tif ( !isNonNegativeInteger( N ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', N ) );\n\t}\n\tif ( !isNonNegativeInteger( K ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a nonnegative integer. Value: `%s`.', K ) );\n\t}\n\tif ( !isNonNegativeInteger( n ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Third argument must be a nonnegative integer. Value: `%s`.', n ) );\n\t}\n\tif ( n > N ) {\n\t\treturn new RangeError( format( 'invalid argument. Third argument must be less than or equal to the first argument. Value: `%u`.', n ) );\n\t}\n\tif ( K > N ) {\n\t\treturn new RangeError( format( 'invalid argument. Second argument must be less than or equal to the first argument. Value: `%u`.', K ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 factorial = require( '@stdlib/math/base/special/factorial' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a hypergeometric distribution using the HIN algorithm, which is based on an inverse transformation method.\n*\n* ## References\n*\n* - Fishman, George S. 1973. _Concepts and methods in discrete event digital simulation_. A Wiley-Interscience Publication. New York, NY, USA: Wiley.\n* - Kachitvichyanukul, Voratas., and Burce Schmeiser. 1985. \"Computer generation of hypergeometric random variates.\" _Journal of Statistical Computation and Simulation_ 22 (2): 127\u201345. doi:[10.1080/00949658508810839][@kachitvichyanukul:1985].\n*\n* [@kachitvichyanukul:1985]: http://dx.doi.org/10.1080/00949658508810839\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {NonNegativeInteger} n1 - number of successes in population\n* @param {NonNegativeInteger} n2 - number of failures in population\n* @param {NonNegativeInteger} k - number of draws\n* @returns {NonNegativeInteger} pseudorandom number\n*/\nfunction hin( rand, n1, n2, k ) {\n\tvar p;\n\tvar u;\n\tvar x;\n\tif ( k < n2 ) {\n\t\tp = ( factorial( n2 ) * factorial( n1 + n2 - k ) ) /\n\t\t\t( factorial( n1 + n2 ) * factorial( n2 - k ) );\n\t\tx = 0;\n\t} else {\n\t\tp = ( factorial( n1 ) * factorial( k ) ) /\n\t\t\t( factorial( k - n2 ) * factorial( n1 + n2 ) );\n\t\tx = k - n2;\n\t}\n\tu = rand();\n\twhile ( u > p ) {\n\t\tu -= p;\n\t\tp *= ( n1 - x ) * ( k - x ) / ( ( x + 1 ) * ( n2 - k + 1 + x ) );\n\t\tx += 1;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = hin;\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 hin = require( './hin.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a hypergeometric distribution.\n*\n* ## References\n*\n* - Kachitvichyanukul, Voratas., and Burce Schmeiser. 1985. \"Computer generation of hypergeometric random variates.\" _Journal of Statistical Computation and Simulation_ 22 (2): 127\u201345. doi:[10.1080/00949658508810839][@kachitvichyanukul:1985].\n*\n* [@kachitvichyanukul:1985]: http://dx.doi.org/10.1080/00949658508810839\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {NonNegativeInteger} N - population size\n* @param {NonNegativeInteger} K - subpopulation size\n* @param {NonNegativeInteger} n - number of draws\n* @returns {NonNegativeInteger} pseudorandom number\n*/\nfunction hypergeometric( rand, N, K, n ) {\n\tvar n1;\n\tvar n2;\n\tvar k;\n\tvar x;\n\n\tif ( n > N/2 ) {\n\t\tk = N - n;\n\t\tif ( 2*K <= N ) {\n\t\t\tn1 = K;\n\t\t\tn2 = N - K;\n\t\t\tx = hin( rand, n1, n2, k );\n\t\t\treturn K - x;\n\t\t}\n\t\tn2 = K;\n\t\tn1 = N - K;\n\t\tx = hin( rand, n1, n2, k );\n\t\treturn n - N + K + x;\n\t}\n\tk = n;\n\tif ( 2*K <= N ) {\n\t\tn1 = K;\n\t\tn2 = N - K;\n\t\tx = hin( rand, n1, n2, k );\n\t\treturn x;\n\t}\n\tn1 = N - K;\n\tn2 = K;\n\tx = hin( rand, n1, n2, k );\n\treturn n - x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = hypergeometric;\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 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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isNonNegativeInteger = require( '@stdlib/math/base/assert/is-nonnegative-integer' );\nvar PINF = require( '@stdlib/constants/float64/pinf' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar hypergeometric0 = require( './hypergeometric.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating hypergeometric distributed random numbers.\n*\n* @param {NonNegativeInteger} [N] - population size\n* @param {NonNegativeInteger} [K] - subpopulation size\n* @param {NonNegativeInteger} [n] - number of draws\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} `N` must be a nonnegative integer\n* @throws {TypeError} `K` must be a nonnegative integer\n* @throws {TypeError} `n` must be a nonnegative integer\n* @throws {RangeError} `n` must be less than or equal to `N`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var hypergeometric = factory( 5, 3, 2 );\n* var v = hypergeometric();\n* // returns \n*\n* @example\n* var hypergeometric = factory( 10, 10, 10, {\n* 'seed': 297\n* });\n* var v = hypergeometric();\n* // returns \n*\n* @example\n* var hypergeometric = factory();\n* var v = hypergeometric( 5, 3, 2 );\n* // returns \n*/\nfunction factory() {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar N;\n\tvar K;\n\tvar n;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tN = arguments[ 0 ];\n\t\tK = arguments[ 1 ];\n\t\tn = arguments[ 2 ];\n\t\terr = validate( N, K, n );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 3 ) {\n\t\t\topts = arguments[ 3 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( N === void 0 ) {\n\t\tprng = hypergeometric2;\n\t} else {\n\t\tprng = hypergeometric1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'hypergeometric' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\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 = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( N === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ N, K, n ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a random number drawn from a hypergeometric distribution with bound parameters.\n\t*\n\t* @private\n\t* @returns {NonNegativeInteger} pseudorandom number\n\t*\n\t* @example\n\t* var v = hypergeometric1();\n\t* // returns \n\t*/\n\tfunction hypergeometric1() {\n\t\treturn hypergeometric0( rand, N, K, n );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a hypergeometric distribution.\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} N - population size\n\t* @param {NonNegativeInteger} K - subpopulation size\n\t* @param {NonNegativeInteger} n - number of draws\n\t* @returns {NonNegativeInteger} pseudorandom number\n\t*\n\t* @example\n\t* var v = hypergeometric2( 5, 3, 2 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = hypergeometric2( NaN, NaN, NaN );\n\t* // returns NaN\n\t*\n\t* @example\n\t* var v = hypergeometric2( 5.21, 3.14, 2.76 );\n\t* // returns NaN\n\t*/\n\tfunction hypergeometric2( N, K, n ) {\n\t\tif (\n\t\t\tN === PINF ||\n\t\t\tK === PINF ||\n\t\t\t!isNonNegativeInteger( N ) ||\n\t\t\t!isNonNegativeInteger( K ) ||\n\t\t\t!isNonNegativeInteger( n ) ||\n\t\t\tn > N\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn hypergeometric0( rand, N, K, n );\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' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a hypergeometric distribution.\n*\n* @name hypergeometric\n* @type {PRNG}\n* @param {NonNegativeInteger} N - population size\n* @param {NonNegativeInteger} K - subpopulation size\n* @param {NonNegativeInteger} n - number of draws\n* @returns {NonNegativeInteger} pseudorandom number\n*\n* @example\n* var v = hypergeometric( 5, 3, 2 );\n* // returns \n*\n* @example\n* var v = hypergeometric( -5, 3, 2 );\n* // returns NaN\n*\n* @example\n* var v = hypergeometric( 5, 3.14, 2 );\n* // returns NaN\n*\n* @example\n* var v = hypergeometric( 5, 3, 1.5 );\n* // returns NaN\n*\n* @example\n* var v = hypergeometric( NaN, NaN, NaN );\n* // returns NaN\n*/\nvar hypergeometric = factory();\n\n\n// EXPORTS //\n\nmodule.exports = hypergeometric;\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* Hypergeometric distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/hypergeometric\n*\n* @example\n* var hypergeometric = require( '@stdlib/random/base/hypergeometric' );\n*\n* var v = hypergeometric( 10, 10, 10 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/hypergeometric' ).factory;\n* var hypergeometric = factory( 5, 3, 2, {\n* 'seed': 297\n* });\n*\n* var v = hypergeometric();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/hypergeometric' ).factory;\n* var hypergeometric = factory();\n*\n* var v = hypergeometric( 10, 2, 2 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/hypergeometric' ).factory;\n* var hypergeometric = factory({\n* 'seed': 297\n* });\n*\n* var v = hypergeometric( 5, 3, 2 );\n* // returns \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", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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 ternaryFactory = require( './../../../array/tools/ternary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/hypergeometric' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a hypergeometric distribution.\n*\n* @name factory\n* @type {Function}\n* @param {NonNegativeInteger} [N] - population size\n* @param {NonNegativeInteger} [K] - subpopulation size\n* @param {NonNegativeInteger} [n] - number of draws\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `N` must be a nonnegative integer\n* @throws {TypeError} `K` must be a nonnegative integer\n* @throws {TypeError} `n` must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var hypergeometric = factory( 20, 10, 7 );\n* // returns \n*\n* var arr = hypergeometric( 10 );\n* // returns \n*\n* @example\n* var hypergeometric = factory( 20, 10, 7 );\n* // returns \n*\n* var arr = hypergeometric( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = ternaryFactory( base, DTYPES, defaults.get( 'dtypes.real' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a hypergeometric distribution.\n*\n* @name hypergeometric\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {NonNegativeInteger} N - population size\n* @param {NonNegativeInteger} K - subpopulation size\n* @param {NonNegativeInteger} n - number of draws\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = hypergeometric( 10, 20, 10, 7 );\n* // returns \n*\n* @example\n* var arr = hypergeometric( 10, 20, 10, 7, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar hypergeometric = factory();\n\n\n// EXPORTS //\n\nmodule.exports = hypergeometric;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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* Create an array containing pseudorandom numbers drawn from a hypergeometric distribution.\n*\n* @module @stdlib/random/array/hypergeometric\n*\n* @example\n* var hypergeometric = require( '@stdlib/random/array/hypergeometric' );\n*\n* var arr = hypergeometric( 10, 20, 10, 7 );\n* // returns \n*\n* @example\n* var hypergeometric = require( '@stdlib/random/array/hypergeometric' );\n*\n* var arr = hypergeometric( 10, 20, 10, 7, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var hypergeometric = require( '@stdlib/random/array/hypergeometric' );\n*\n* var rand = hypergeometric.factory( 20, 10, 7 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var hypergeometric = require( '@stdlib/random/array/hypergeometric' );\n*\n* var rand = hypergeometric.factory( 20, 10, 7 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\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 isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - scale parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( alpha, beta ) {\n\tif ( !isPositive( alpha ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositive( beta ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar gamma = require( './../../../base/gamma' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating inverse gamma distributed random numbers.\n*\n* @param {PositiveNumber} [alpha] - shape parameter\n* @param {PositiveNumber} [beta] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var invgamma = factory( 2.0, 1.0 );\n* var v = invgamma();\n* // returns \n*\n* @example\n* var invgamma = factory( 2.0, 2.0, {\n* 'seed': 297\n* });\n* var v = invgamma();\n* // returns \n*/\nfunction factory() {\n\tvar rgamma;\n\tvar alpha;\n\tvar beta;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\n\tif ( arguments.length === 0 ) {\n\t\trgamma = gamma();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trgamma = gamma({\n\t\t\t\t'prng': opts.prng\n\t\t\t});\n\t\t} else {\n\t\t\trgamma = gamma( opts );\n\t\t}\n\t} else {\n\t\talpha = arguments[ 0 ];\n\t\tbeta = arguments[ 1 ];\n\t\terr = validate( alpha, beta );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trgamma = gamma( alpha, beta, {\n\t\t\t\t\t'prng': opts.prng\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\trgamma = gamma( alpha, beta, opts );\n\t\t\t}\n\t\t} else {\n\t\t\trgamma = gamma( alpha, beta );\n\t\t}\n\t}\n\tif ( alpha === void 0 ) {\n\t\tprng = invgamma2;\n\t} else {\n\t\tprng = invgamma1;\n\t}\n\trand = rgamma.PRNG;\n\n\tsetReadOnly( prng, 'NAME', 'invgamma' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t}\n\tsetReadOnly( prng, 'PRNG', rand );\n\treturn prng;\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\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 = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( alpha === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ alpha, beta ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from an inverse gamma distribution.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = invgamma1();\n\t* // returns \n\t*/\n\tfunction invgamma1() {\n\t\treturn 1.0 / rgamma();\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from an inverse gamma distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} alpha - shape parameter\n\t* @param {PositiveNumber} beta - scale parameter\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = invgamma2( 2.0, 1.0 );\n\t* // returns \n\t*/\n\tfunction invgamma2( alpha, beta ) {\n\t\tif (\n\t\t\tisnan( alpha ) ||\n\t\t\tisnan( beta ) ||\n\t\t\talpha <= 0.0 ||\n\t\t\tbeta <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn 1.0 / rgamma( alpha, beta );\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' );\n\n\n// MAIN //\n\n/**\n* Returns a random number drawn from an inverse gamma distribution.\n*\n* ## Method\n*\n* When\n*\n* ```tex\n* X \\sim \\operatorname{Gamma}( \\alpha, \\beta )\n* ```\n*\n* then\n*\n* ```tex\n* \\frac{1}{X} \\sim \\operatorname{InvGamma}\\left( \\alpha, \\tfrac{1}{beta} \\right)\n* ```\n*\n* Hence, to generate a draw from an inverse gamma distribution with parameters \\\\( \\alpha \\\\) and \\\\( \\beta \\\\), sample `X` from a \\\\( \\operatorname{Gamma}\\left( \\alpha, \\tfrac{1}{\\beta} \\right) \\\\) distribution and return `1/X`.\n*\n* @name invgamma\n* @type {PRNG}\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - scale parameter\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = invgamma( 2.0, 1.0 );\n* // returns \n*\n* @example\n* var v = invgamma( -2.0, 5.0 );\n* // returns NaN\n*/\nvar invgamma = factory();\n\n\n// EXPORTS //\n\nmodule.exports = invgamma;\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* Inverse gamma distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/invgamma\n*\n* @example\n* var invgamma = require( '@stdlib/random/base/invgamma' );\n*\n* var v = invgamma( 2.0, 3.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/invgamma' ).factory;\n* var invgamma = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = invgamma();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/invgamma' ).factory;\n* var invgamma = factory({\n* 'seed': 297\n* });\n*\n* var v = invgamma( 3.0, 2.0 );\n* // returns \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", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 binaryFactory = require( './../../../array/tools/binary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/invgamma' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from an inverse gamma distribution.\n*\n* @name factory\n* @type {Function}\n* @param {PositiveNumber} [alpha] - shape parameter\n* @param {PositiveNumber} [beta] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var invgamma = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = invgamma( 10 );\n* // returns \n*\n* @example\n* var invgamma = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = invgamma( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = binaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from an inverse gamma distribution.\n*\n* @name invgamma\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - scale parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = invgamma( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = invgamma( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar invgamma = factory();\n\n\n// EXPORTS //\n\nmodule.exports = invgamma;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create an array containing pseudorandom numbers drawn from an inverse gamma distribution.\n*\n* @module @stdlib/random/array/invgamma\n*\n* @example\n* var invgamma = require( '@stdlib/random/array/invgamma' );\n*\n* var arr = invgamma( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var invgamma = require( '@stdlib/random/array/invgamma' );\n*\n* var arr = invgamma( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var invgamma = require( '@stdlib/random/array/invgamma' );\n*\n* var rand = invgamma.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var invgamma = require( '@stdlib/random/array/invgamma' );\n*\n* var rand = invgamma.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\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 isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {PositiveNumber} a - first shape parameter\n* @param {PositiveNumber} b - second shape parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( a, b ) {\n\tif ( !isPositive( a ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', a ) );\n\t}\n\tif ( !isPositive( b ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', b ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 pow = require( '@stdlib/math/base/special/pow' );\n\n\n// MAIN //\n\n/**\n* Returns a random number drawn from Kumaraswamy's double bounded distribution.\n*\n* @private\n* @param {PRNG} rand - pseudorandom number generator for uniformly distributed numbers\n* @param {PositiveNumber} a - first shape parameter\n* @param {PositiveNumber} b - second shape parameter\n* @returns {Probability} pseudorandom number\n*/\nfunction sample( rand, a, b ) {\n\tvar u = rand();\n\treturn pow( 1.0 - pow( 1.0-u, 1.0/b ), 1.0/a );\n}\n\n\n// EXPORTS //\n\nmodule.exports = sample;\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 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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar kumaraswamy0 = require( './kumaraswamy.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating Kumaraswamy's double bounded distributed random numbers.\n*\n* @param {PositiveNumber} [a] - first shape parameter\n* @param {PositiveNumber} [b] - second shape parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} `a` must be a positive number\n* @throws {TypeError} `b` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var kumaraswamy = factory( 2.0, 1.0 );\n* var v = kumaraswamy();\n* // returns \n*\n* @example\n* var kumaraswamy = factory( 2.0, 2.0, {\n* 'seed': 297\n* });\n* var v = kumaraswamy();\n* // returns \n*/\nfunction factory() {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar a;\n\tvar b;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\ta = arguments[ 0 ];\n\t\tb = arguments[ 1 ];\n\t\terr = validate( a, b );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( a === void 0 ) {\n\t\tprng = kumaraswamy2;\n\t} else {\n\t\tprng = kumaraswamy1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'kumaraswamy' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\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 = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( a === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ a, b ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a random number drawn from a Kumaraswamy's double bounded distribution with bound parameter values.\n\t*\n\t* @private\n\t* @returns {Probability} pseudorandom number\n\t*\n\t* @example\n\t* var v = beta1();\n\t* // returns \n\t*/\n\tfunction kumaraswamy1() {\n\t\treturn kumaraswamy0( rand, a, b );\n\t}\n\n\t/**\n\t* Returns a random number drawn from a Kumaraswamy's double bounded distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} a - first shape parameter\n\t* @param {PositiveNumber} b - second shape parameter\n\t* @returns {Probability} pseudorandom number\n\t*\n\t* @example\n\t* var v = kumaraswamy2( 2.0, 3.0 );\n\t* // returns \n\t*/\n\tfunction kumaraswamy2( a, b ) {\n\t\tif (\n\t\t\tisnan( a ) ||\n\t\t\tisnan( b ) ||\n\t\t\ta <= 0.0 ||\n\t\t\tb <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn kumaraswamy0( rand, a, b );\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' );\n\n\n// MAIN //\n\n/**\n* Generates a Kumaraswamy's double bounded distributed random number.\n*\n* @name kumaraswamy\n* @type {PRNG}\n* @param {PositiveNumber} a - first shape parameter\n* @param {PositiveNumber} b - second shape parameter\n* @returns {Probability} pseudorandom number\n*\n* @example\n* var r = kumaraswamy( 2.0, 5.0 );\n* // returns \n*\n* @example\n* var r = kumaraswamy( -2.0, 5.0 );\n* // returns NaN\n*/\nvar kumaraswamy = factory();\n\n\n// EXPORTS //\n\nmodule.exports = kumaraswamy;\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* Kumaraswamy's double bounded distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/kumaraswamy\n*\n* @example\n* var kumaraswamy = require( '@stdlib/random/base/kumaraswamy' );\n*\n* var v = kumaraswamy( 2.0, 3.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/kumaraswamy' ).factory;\n*\n* var kumaraswamy = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = kumaraswamy();\n* // returns \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", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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 binaryFactory = require( './../../../array/tools/binary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/kumaraswamy' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from Kumaraswamy's double bounded distribution.\n*\n* @name factory\n* @type {Function}\n* @param {PositiveNumber} [a] - first shape parameter\n* @param {PositiveNumber} [b] - second shape parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `a` must be a positive number\n* @throws {TypeError} `b` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var kumaraswamy = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = kumaraswamy( 10 );\n* // returns \n*\n* @example\n* var kumaraswamy = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = kumaraswamy( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = binaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from Kumaraswamy's double bounded distribution.\n*\n* @name kumaraswamy\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {PositiveNumber} a - first shape parameter\n* @param {PositiveNumber} b - second shape parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = kumaraswamy( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = kumaraswamy( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar kumaraswamy = factory();\n\n\n// EXPORTS //\n\nmodule.exports = kumaraswamy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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* Create an array containing pseudorandom numbers drawn from Kumaraswamy's double bounded distribution.\n*\n* @module @stdlib/random/array/kumaraswamy\n*\n* @example\n* var kumaraswamy = require( '@stdlib/random/array/kumaraswamy' );\n*\n* var arr = kumaraswamy( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var kumaraswamy = require( '@stdlib/random/array/kumaraswamy' );\n*\n* var arr = kumaraswamy( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var kumaraswamy = require( '@stdlib/random/array/kumaraswamy' );\n*\n* var rand = kumaraswamy.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var kumaraswamy = require( '@stdlib/random/array/kumaraswamy' );\n*\n* var rand = kumaraswamy.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\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 isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar isnan = require( '@stdlib/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {number} mu - mean\n* @param {PositiveNumber} b - scale parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( mu, b ) {\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( b ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', b ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 sign = require( '@stdlib/math/base/special/signum' );\nvar abs = require( '@stdlib/math/base/special/abs' );\nvar ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Laplace (double exponential) distribution.\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {number} mu - mean\n* @param {PositiveNumber} b - scale parameter\n* @returns {number} pseudorandom number\n*/\nfunction laplace( rand, mu, b ) {\n\tvar u = rand() - 0.5;\n\treturn mu - ( b*sign( u )*ln( 1.0 - (2.0*abs(u)) ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = laplace;\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 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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar laplace0 = require( './laplace.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating random numbers from a Laplace (double exponential) distribution.\n*\n* @param {number} [mu] - mean\n* @param {PositiveNumber} [b] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} `mu` must be a number\n* @throws {TypeError} `b` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var laplace = factory( 0.0, 1.0 );\n* var v = laplace();\n* // returns \n*\n* @example\n* var laplace = factory( -3.0, 0.5, {\n* 'seed': 297\n* });\n* var v = laplace();\n* // returns \n*/\nfunction factory() {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar mu;\n\tvar b;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tmu = arguments[ 0 ];\n\t\tb = arguments[ 1 ];\n\t\terr = validate( mu, b );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( mu === void 0 ) {\n\t\tprng = laplace2;\n\t} else {\n\t\tprng = laplace1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'laplace' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\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 = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( mu === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ mu, b ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Laplace (double exponential) distribution with bound parameters.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = laplace1();\n\t* // returns \n\t*/\n\tfunction laplace1() {\n\t\treturn laplace0( rand, mu, b );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Laplace (double exponential) distribution.\n\t*\n\t* @private\n\t* @param {number} mu - mean\n\t* @param {PositiveNumber} b - scale parameter\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = laplace2( 0.0, 2.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = laplace2( 0.0, -1.0 );\n\t* // returns NaN\n\t*/\n\tfunction laplace2( mu, b ) {\n\t\tif (\n\t\t\tisnan( mu ) ||\n\t\t\tisnan( b ) ||\n\t\t\tb <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn laplace0( rand, mu, b );\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' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Laplace (double exponential) distribution.\n*\n* @name laplace\n* @type {PRNG}\n* @param {number} mu - mean\n* @param {PositiveNumber} b - scale parameter\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = laplace( 0.0, 2.0 );\n* // returns \n*\n* @example\n* var v = laplace( 0.0, -1.0 );\n* // returns NaN\n*/\nvar laplace = factory();\n\n\n// EXPORTS //\n\nmodule.exports = laplace;\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* Laplace (double exponential) distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/laplace\n*\n* @example\n* var laplace = require( '@stdlib/random/base/laplace' );\n*\n* var v = laplace( 0.5, 1.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/laplace' ).factory;\n* var laplace = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = laplace();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/laplace' ).factory;\n* var laplace = factory({\n* 'seed': 297\n* });\n*\n* var v = laplace( 3.0, 2.0 );\n* // returns \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", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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 binaryFactory = require( './../../../array/tools/binary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/laplace' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a Laplace (double exponential) distribution.\n*\n* @name factory\n* @type {Function}\n* @param {number} [mu] - mean\n* @param {PositiveNumber} [b] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `b` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var laplace = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = laplace( 10 );\n* // returns \n*\n* @example\n* var laplace = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = laplace( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = binaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a Laplace (double exponential) distribution.\n*\n* @name laplace\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {number} mu - mean\n* @param {PositiveNumber} b - scale parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = laplace( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = laplace( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar laplace = factory();\n\n\n// EXPORTS //\n\nmodule.exports = laplace;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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* Create an array containing pseudorandom numbers drawn from a Laplace (double exponential) distribution.\n*\n* @module @stdlib/random/array/laplace\n*\n* @example\n* var laplace = require( '@stdlib/random/array/laplace' );\n*\n* var arr = laplace( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var laplace = require( '@stdlib/random/array/laplace' );\n*\n* var arr = laplace( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var laplace = require( '@stdlib/random/array/laplace' );\n*\n* var rand = laplace.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var laplace = require( '@stdlib/random/array/laplace' );\n*\n* var rand = laplace.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\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 isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar isnan = require( '@stdlib/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {number} mu - mean\n* @param {PositiveNumber} c - scale parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( mu, c ) {\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( c ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', c ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 normalQuantile = require( '@stdlib/stats/base/dists/normal/quantile' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a L\u00E9vy distribution.\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {number} mu - location parameter\n* @param {PositiveNumber} c - scale parameter\n* @returns {number} pseudorandom number\n*/\nfunction levy( rand, mu, c ) {\n\tvar z = normalQuantile( 1.0 - ( rand() / 2.0 ), 0.0, 1.0 );\n\treturn mu + ( c / ( z*z ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = levy;\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 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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar levy0 = require( './levy.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating random numbers from a L\u00E9vy distribution.\n*\n* @param {number} [mu] - location parameter\n* @param {PositiveNumber} [c] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} `mu` must be a number\n* @throws {TypeError} `c` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var levy = factory( 0.0, 1.0 );\n* var v = levy();\n* // returns \n*\n* @example\n* var levy = factory( -3.0, 0.5, {\n* 'seed': 297\n* });\n* var v = levy();\n* // returns \n*/\nfunction factory() {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar mu;\n\tvar c;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tmu = arguments[ 0 ];\n\t\tc = arguments[ 1 ];\n\t\terr = validate( mu, c );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( mu === void 0 ) {\n\t\tprng = levy2;\n\t} else {\n\t\tprng = levy1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'levy' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\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 = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( mu === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ mu, c ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a L\u00E9vy distribution with bound parameters.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = levy1();\n\t* // returns \n\t*/\n\tfunction levy1() {\n\t\treturn levy0( rand, mu, c );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a L\u00E9vy distribution.\n\t*\n\t* @private\n\t* @param {number} mu - location parameter\n\t* @param {PositiveNumber} c - scale parameter\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = levy2( 0.0, 2.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = levy2( 0.0, -1.0 );\n\t* // returns NaN\n\t*/\n\tfunction levy2( mu, c ) {\n\t\tif (\n\t\t\tisnan( mu ) ||\n\t\t\tisnan( c ) ||\n\t\t\tc <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn levy0( rand, mu, c );\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' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a L\u00E9vy distribution.\n*\n* @name levy\n* @type {PRNG}\n* @param {number} mu - location parameter\n* @param {PositiveNumber} c - scale parameter\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = levy( 0.0, 2.0 );\n* // returns \n*\n* @example\n* var v = levy( 0.0, -1.0 );\n* // returns NaN\n*/\nvar levy = factory();\n\n\n// EXPORTS //\n\nmodule.exports = levy;\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* L\u00E9vy distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/levy\n*\n* @example\n* var levy = require( '@stdlib/random/base/levy' );\n*\n* var v = levy( 0.5, 1.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/levy' ).factory;\n* var levy = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = levy();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/levy' ).factory;\n* var levy = factory({\n* 'seed': 297\n* });\n*\n* var v = levy( 3.0, 2.0 );\n* // returns \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", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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 binaryFactory = require( './../../../array/tools/binary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/levy' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a L\u00E9vy distribution.\n*\n* @name factory\n* @type {Function}\n* @param {number} [mu] - location parameter\n* @param {PositiveNumber} [c] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `c` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var levy = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = levy( 10 );\n* // returns \n*\n* @example\n* var levy = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = levy( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = binaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a L\u00E9vy distribution.\n*\n* @name levy\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {number} mu - location parameter\n* @param {PositiveNumber} c - scale parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = levy( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = levy( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar levy = factory();\n\n\n// EXPORTS //\n\nmodule.exports = levy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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* Create an array containing pseudorandom numbers drawn from a L\u00E9vy distribution.\n*\n* @module @stdlib/random/array/levy\n*\n* @example\n* var levy = require( '@stdlib/random/array/levy' );\n*\n* var arr = levy( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var levy = require( '@stdlib/random/array/levy' );\n*\n* var arr = levy( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var levy = require( '@stdlib/random/array/levy' );\n*\n* var rand = levy.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var levy = require( '@stdlib/random/array/levy' );\n*\n* var rand = levy.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\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 isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isnan = require( '@stdlib/assert/is-nan' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {number} mu - mean\n* @param {PositiveNumber} s - scale parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( mu, s ) {\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( s ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', s ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Returns pseudorandom number drawn from a logistic distribution.\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {number} mu - mean\n* @param {PositiveNumber} s - scale parameter\n* @returns {number} pseudorandom number\n*/\nfunction logistic( rand, mu, s ) {\n\tvar u = rand();\n\treturn mu + ( s*ln( u / (1.0-u) ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = logistic;\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 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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar logistic0 = require( './logistic.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating random numbers from a logistic distribution.\n*\n* @param {number} [mu] - mean parameter\n* @param {PositiveNumber} [s] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} `mu` must be a number\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var logistic = factory( 0.0, 1.0 );\n*\n* var v = logistic();\n* // returns \n*\n* @example\n* var logistic = factory( -3.0, 0.5, {\n* 'seed': 297\n* });\n* var v = logistic();\n* // returns \n*/\nfunction factory() {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar mu;\n\tvar s;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tmu = arguments[ 0 ];\n\t\ts = arguments[ 1 ];\n\t\terr = validate( mu, s );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( mu === void 0 ) {\n\t\tprng = logistic2;\n\t} else {\n\t\tprng = logistic1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'logistic' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\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 = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( mu === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ mu, s ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns pseudorandom number drawn from a logistic distribution with bound parameters.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = logistic1();\n\t* // returns \n\t*/\n\tfunction logistic1() {\n\t\treturn logistic0( rand, mu, s );\n\t}\n\n\t/**\n\t* Returns pseudorandom number drawn from a logistic distribution.\n\t*\n\t* @private\n\t* @param {number} mu - mean\n\t* @param {PositiveNumber} s - scale parameter\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = logistic2( 0.0, 2.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = logistic2( 0.0, -1.0 );\n\t* // returns NaN\n\t*/\n\tfunction logistic2( mu, s ) {\n\t\tif (\n\t\t\tisnan( mu ) ||\n\t\t\tisnan( s ) ||\n\t\t\ts <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn logistic0( rand, mu, s );\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' );\n\n\n// MAIN //\n\n/**\n* Returns pseudorandom number drawn from a logistic distribution.\n*\n* @name logistic\n* @type {PRNG}\n* @param {number} mu - mean\n* @param {PositiveNumber} s - scale parameter\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = logistic( 0.0, 2.0 );\n* // returns \n*\n* @example\n* var v = logistic( 0.0, -1.0 );\n* // returns NaN\n*/\nvar logistic = factory();\n\n\n// EXPORTS //\n\nmodule.exports = logistic;\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* Logistic distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/logistic\n*\n* @example\n* var logistic = require( '@stdlib/random/base/logistic' );\n*\n* var v = logistic( 0.5, 1.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/logistic' ).factory;\n* var logistic = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = logistic();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/logistic' ).factory;\n* var logistic = factory({\n* 'seed': 297\n* });\n*\n* var v = logistic( 3.0, 2.0 );\n* // returns \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", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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 binaryFactory = require( './../../../array/tools/binary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/logistic' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a logistic distribution.\n*\n* @name factory\n* @type {Function}\n* @param {number} [mu] - mean parameter\n* @param {PositiveNumber} [s] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var logistic = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = logistic( 10 );\n* // returns \n*\n* @example\n* var logistic = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = logistic( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = binaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a logistic distribution.\n*\n* @name logistic\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {number} mu - mean parameter\n* @param {PositiveNumber} s - scale parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = logistic( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = logistic( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar logistic = factory();\n\n\n// EXPORTS //\n\nmodule.exports = logistic;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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* Create an array containing pseudorandom numbers drawn from a logistic distribution.\n*\n* @module @stdlib/random/array/logistic\n*\n* @example\n* var logistic = require( '@stdlib/random/array/logistic' );\n*\n* var arr = logistic( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var logistic = require( '@stdlib/random/array/logistic' );\n*\n* var arr = logistic( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var logistic = require( '@stdlib/random/array/logistic' );\n*\n* var rand = logistic.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var logistic = require( '@stdlib/random/array/logistic' );\n*\n* var rand = logistic.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\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 isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar isnan = require( '@stdlib/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {number} mu - location parameter\n* @param {PositiveNumber} sigma - scale paramter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( mu, sigma ) {\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( sigma ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', sigma ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 exp = require( '@stdlib/math/base/special/exp' );\n\n\n// MAIN //\n\n/**\n* Returns a log-normally distributed pseudorandom number.\n*\n* @private\n* @param {PRNG} randn - PRNG for standard normally distributed numbers\n* @param {number} mu - location parameter\n* @param {PositiveNumber} sigma - scale parameter\n* @returns {PositiveNumber} pseudorandom number\n*/\nfunction lognormal( randn, mu, sigma ) {\n\treturn exp( mu + (sigma*randn()) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = lognormal;\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 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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randn = require( './../../../base/improved-ziggurat' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar lognormal0 = require( './lognormal.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating random numbers from a lognormal distribution.\n*\n* @param {number} [mu] - location parameter\n* @param {PositiveNumber} [sigma] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} `mu` must be a number\n* @throws {TypeError} `sigma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var lognormal = factory( 0.0, 1.0 );\n*\n* var v = lognormal();\n* // returns \n*\n* @example\n* var lognormal = factory( -3.0, 0.5, {\n* 'seed': 297\n* });\n* var v = lognormal();\n* // returns \n*/\nfunction factory() {\n\tvar sigma;\n\tvar rnorm;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar mu;\n\n\tif ( arguments.length === 0 ) {\n\t\trnorm = randn();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trnorm = randn({\n\t\t\t\t'prng': opts.prng\n\t\t\t});\n\t\t} else {\n\t\t\trnorm = randn( opts );\n\t\t}\n\t} else {\n\t\tmu = arguments[ 0 ];\n\t\tsigma = arguments[ 1 ];\n\t\terr = validate( mu, sigma );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trnorm = randn({\n\t\t\t\t\t'prng': opts.prng\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\trnorm = randn( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trnorm = randn();\n\t\t}\n\t}\n\tif ( mu === void 0 ) {\n\t\tprng = lognormal2;\n\t} else {\n\t\tprng = lognormal1;\n\t}\n\trand = rnorm.PRNG;\n\n\tsetReadOnly( prng, 'NAME', 'lognormal' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t}\n\tsetReadOnly( prng, 'PRNG', rand );\n\treturn prng;\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\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 = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( mu === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ mu, sigma ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a log-normally distributed pseudorandom number with bound parameters `mu` and `sigma`.\n\t*\n\t* @private\n\t* @returns {PositiveNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = lognormal1();\n\t* // returns \n\t*/\n\tfunction lognormal1() {\n\t\treturn lognormal0( rnorm, mu, sigma );\n\t}\n\n\t/**\n\t* Returns a log-normally distributed pseudorandom number with parameters `mu` and `sigma`.\n\t*\n\t* @private\n\t* @param {number} mu - location parameter\n\t* @param {PositiveNumber} sigma - scale parameter\n\t* @returns {PositiveNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = lognormal2( -2.0, 4.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = lognormal2( 0.0, -1.0 );\n\t* // returns NaN\n\t*/\n\tfunction lognormal2( mu, sigma ) {\n\t\tif (\n\t\t\tisnan( mu ) ||\n\t\t\tisnan( sigma ) ||\n\t\t\tsigma <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn lognormal0( rnorm, mu, sigma );\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' );\n\n\n// MAIN //\n\n/**\n* Returns a log-normally distributed pseudorandom number with parameters `mu` and `sigma`.\n*\n* @name lognormal\n* @type {PRNG}\n* @param {number} mu - location parameter\n* @param {PositiveNumber} sigma - scale parameter\n* @returns {PositiveNumber} pseudorandom number\n*\n* @example\n* var v = lognormal( -2.0, 4.0 );\n* // returns \n*\n* @example\n* var v = lognormal( 0.0, -1.0 );\n* // returns NaN\n*/\nvar lognormal = factory();\n\n\n// EXPORTS //\n\nmodule.exports = lognormal;\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* Log-normal distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/lognormal\n*\n* @example\n* var lognormal = require( '@stdlib/random/base/lognormal' );\n*\n* var v = lognormal( 0.0, 1.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/lognormal' ).factory;\n* var lognormal = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = lognormal();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/lognormal' ).factory;\n* var lognormal = factory({\n* 'seed': 297\n* });\n*\n* var v = lognormal( 3.0, 2.0 );\n* // returns \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", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 binaryFactory = require( './../../../array/tools/binary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/lognormal' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a lognormal distribution.\n*\n* @name factory\n* @type {Function}\n* @param {number} [mu] - location parameter\n* @param {PositiveNumber} [sigma] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `sigma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var lognormal = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = lognormal( 10 );\n* // returns \n*\n* @example\n* var lognormal = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = lognormal( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = binaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a lognormal distribution.\n*\n* @name lognormal\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {number} mu - location parameter\n* @param {PositiveNumber} sigma - scale parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = lognormal( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = lognormal( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar lognormal = factory();\n\n\n// EXPORTS //\n\nmodule.exports = lognormal;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create an array containing pseudorandom numbers drawn from a lognormal distribution.\n*\n* @module @stdlib/random/array/lognormal\n*\n* @example\n* var lognormal = require( '@stdlib/random/array/lognormal' );\n*\n* var arr = lognormal( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var lognormal = require( '@stdlib/random/array/lognormal' );\n*\n* var arr = lognormal( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var lognormal = require( '@stdlib/random/array/lognormal' );\n*\n* var rand = lognormal.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var lognormal = require( '@stdlib/random/array/lognormal' );\n*\n* var rand = lognormal.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\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 INT32_MAX = require( '@stdlib/constants/int32/max' );\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// VARIABLES //\n\nvar MAX = INT32_MAX - 1;\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom integer on the interval \\\\([1, 2^{31}-1)\\\\).\n*\n* @private\n* @returns {PositiveInteger} pseudorandom integer\n*\n* @example\n* var v = randint32();\n* // returns \n*/\nfunction randint32() {\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 = randint32;\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/* eslint-disable max-len */\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 isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isInt32Array = require( '@stdlib/assert/is-int32array' );\nvar format = require( '@stdlib/string/format' );\nvar INT32_MAX = require( '@stdlib/constants/int32/max' );\nvar Int32Array = require( '@stdlib/array/int32' );\nvar gcopy = require( '@stdlib/blas/base/gcopy' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar randint32 = require( './rand_int32.js' );\n\n\n// VARIABLES //\n\nvar NORMALIZATION_CONSTANT = (INT32_MAX - 1)|0; // asm type annotation\nvar MAX_SEED = (INT32_MAX - 1)|0; // asm type annotation\nvar A = 16807|0; // asm type annotation\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 = 2; // state, 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 | seed_length | ...seed |\n\n// Define the index offset of the seed section in the state array:\nvar SEED_SECTION_OFFSET = 4; // | version | num_sections | state_length | ...state | seed_length | ...seed |\n\n// Define the length of the \"fixed\" length portion of the state array:\nvar STATE_FIXED_LENGTH = 5; // 1 (version) + 1 (num_sections) + 1 (state_length) + 1 (state) + 1 (seed_length)\n\n\n// FUNCTIONS //\n\n/**\n* Verifies state array integrity.\n*\n* @private\n* @param {Int32Array} 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 `1`...\n\tif ( state[ STATE_SECTION_OFFSET ] !== 1 ) {\n\t\treturn new RangeError( format( 'invalid %s. State array has an incompatible state length. Expected: `%u`. Actual: `%u`.', s1, 1, state[ STATE_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// MAIN //\n\n/**\n* Returns a linear congruential pseudorandom number generator (LCG) based on Park and Miller.\n*\n* @param {Options} [options] - options\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [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 the maximum signed 32-bit integer or an array-like object containing integers less than the maximum signed 32-bit integer\n* @throws {RangeError} a numeric seed must be a positive integer less than the maximum signed 32-bit integer\n* @throws {TypeError} state must be an `Int32Array`\n* @throws {Error} must provide a valid state\n* @throws {TypeError} `copy` option must be a boolean\n* @returns {PRNG} LCG PRNG\n*\n* @example\n* var minstd = factory();\n*\n* var v = minstd();\n* // returns \n*\n* @example\n* // Return a seeded LCG:\n* var minstd = factory({\n* 'seed': 1234\n* });\n*\n* var v = minstd();\n* // returns 20739838\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 ( !isInt32Array( state ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be an Int32Array. 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 Int32Array( 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 Int32Array( STATE.buffer, STATE.byteOffset+((STATE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), 1 );\n\n\t\t\t// Create a seed \"view\":\n\t\t\tseed = new Int32Array( 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 the maximum signed 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 ) && seed.length > 0 ) {\n\t\t\t\t\tslen = seed.length;\n\t\t\t\t\tSTATE = new Int32Array( 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 ] = 1;\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 Int32Array( STATE.buffer, STATE.byteOffset+((STATE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), 1 );\n\n\t\t\t\t\t// Create a seed \"view\":\n\t\t\t\t\tseed = new Int32Array( 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[ 0 ] = seed[ 0 ];\n\t\t\t\t} else {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be either a positive integer less than the maximum signed 32-bit integer or an array-like object containing integer values less than the maximum signed 32-bit integer. Option: `%s`.', 'seed', seed ) );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tseed = randint32()|0; // asm type annotation\n\t\t\t}\n\t\t}\n\t} else {\n\t\tseed = randint32()|0; // asm type annotation\n\t}\n\tif ( state === void 0 ) {\n\t\tSTATE = new Int32Array( 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 ] = 1;\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 Int32Array( STATE.buffer, STATE.byteOffset+((STATE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), 1 );\n\n\t\t// Create a seed \"view\":\n\t\tseed = new Int32Array( 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[ 0 ] = seed[ 0 ];\n\t}\n\tsetReadOnly( minstd, 'NAME', 'minstd' );\n\tsetReadOnlyAccessor( minstd, 'seed', getSeed );\n\tsetReadOnlyAccessor( minstd, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( minstd, 'state', getState, setState );\n\tsetReadOnlyAccessor( minstd, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( minstd, 'byteLength', getStateSize );\n\tsetReadOnly( minstd, 'toJSON', toJSON );\n\tsetReadOnly( minstd, 'MIN', 1 );\n\tsetReadOnly( minstd, 'MAX', INT32_MAX-1 );\n\tsetReadOnly( minstd, 'normalized', normalized );\n\n\tsetReadOnly( normalized, 'NAME', minstd.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', (minstd.MIN-1.0) / NORMALIZATION_CONSTANT );\n\tsetReadOnly( normalized, 'MAX', (minstd.MAX-1.0) / NORMALIZATION_CONSTANT );\n\n\treturn minstd;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMINSTD} seed\n\t*/\n\tfunction getSeed() {\n\t\tvar len = STATE[ SEED_SECTION_OFFSET ];\n\t\treturn gcopy( len, seed, 1, new Int32Array( 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 `2` sections:\n\t*\n\t* 0. preamble (version + number of sections)\n\t* 1. internal PRNG state\n\t* 2. 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., `2`).\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 {PRNGStateMINSTD} current state\n\t*/\n\tfunction getState() {\n\t\tvar len = STATE.length;\n\t\treturn gcopy( len, STATE, 1, new Int32Array( 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 {PRNGStateMINSTD} s - generator state\n\t* @throws {TypeError} must provide an `Int32Array`\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\tvar err;\n\t\tif ( !isInt32Array( s ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide an Int32Array. 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 Int32Array( 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 Int32Array( STATE.buffer, STATE.byteOffset+((STATE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), 1 );\n\n\t\t// Create a new seed \"view\":\n\t\tseed = new Int32Array( 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 = minstd.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 \\\\( [1,2^{31}-1) \\\\).\n\t*\n\t* @private\n\t* @returns {integer32} pseudorandom integer\n\t*/\n\tfunction minstd() {\n\t\tvar s = state[ 0 ]|0; // asm type annotation\n\t\ts = ( (A*s)%INT32_MAX )|0; // asm type annotation\n\t\tstate[ 0 ] = s;\n\t\treturn s|0; // asm type annotation\n\t}\n\n\t/**\n\t* Generates a pseudorandom number on the interval \\\\( [0,1) \\\\).\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*/\n\tfunction normalized() {\n\t\treturn (minstd()-1) / 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 randint32 = require( './rand_int32.js' );\n\n\n// MAIN //\n\n/**\n* Generates a pseudorandom integer on the interval \\\\( [1,2^{31}-1) \\\\).\n*\n* ## Method\n*\n* Linear congruential generators (LCGs) use the recurrence relation\n*\n* ```tex\n* X_{n+1} = ( a \\cdot X_n + c ) \\operatorname{mod}(m)\n* ```\n*\n* where the modulus \\\\( m \\\\) is a prime number or power of a prime number and \\\\( a \\\\) is a primitive root modulo \\\\( m \\\\).\n*\n* \n*\n* For an LCG to be a Lehmer RNG, the seed \\\\( X_0 \\\\) must be coprime to \\\\( m \\\\).\n*\n* \n*\n* In this implementation, the constants \\\\( a \\\\), \\\\( c \\\\), and \\\\( m \\\\) have the values\n*\n* ```tex\n* \\begin{align*}\n* a &= 7^5 = 16807 \\\\\n* c &= 0 \\\\\n* m &= 2^{31} - 1 = 2147483647\n* \\end{align*}\n* ```\n*\n* \n*\n* The constant \\\\( m \\\\) is a Mersenne prime (modulo \\\\(31\\\\)).\n*\n* \n*\n* \n*\n* The constant \\\\( a \\\\) is a primitive root (modulo \\\\(31\\\\)).\n*\n* \n*\n* Accordingly, the maximum possible product is\n*\n* ```tex\n* 16807 \\cdot (m - 1) \\approx 2^{46}\n* ```\n*\n* The values for \\\\( a \\\\), \\\\( c \\\\), and \\\\( m \\\\) are taken from Park and Miller, \"Random Number Generators: Good Ones Are Hard To Find\". Park's and Miller's article is also the basis for a recipe in the second edition of _Numerical Recipes in C_.\n*\n*\n* ## Notes\n*\n* - The generator has a period of approximately \\\\(2.1\\mbox{e}9\\\\) (see [Numerical Recipes in C, 2nd Edition](#references), p. 279).\n*\n*\n* ## References\n*\n* - Park, S. K., and K. W. Miller. 1988. \"Random Number Generators: Good Ones Are Hard to Find.\" _Communications of the ACM_ 31 (10). New York, NY, USA: ACM: 1192\u20131201. doi:[10.1145/63039.63042](http://dx.doi.org/10.1145/63039.63042).\n* - Press, William H., Brian P. Flannery, Saul A. Teukolsky, and William T. Vetterling. 1992. _Numerical Recipes in C: The Art of Scientific Computing, Second Edition_. Cambridge University Press.\n*\n*\n* @function minstd\n* @type {PRNG}\n* @returns {PositiveInteger} pseudorandom integer\n*\n* @example\n* var v = minstd();\n* // returns \n*/\nvar minstd = factory({\n\t'seed': randint32()\n});\n\n\n// EXPORTS //\n\nmodule.exports = minstd;\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 linear congruential pseudorandom number generator (LCG) based on Park and Miller.\n*\n* @module @stdlib/random/base/minstd\n*\n* @example\n* var minstd = require( '@stdlib/random/base/minstd' );\n*\n* var v = minstd();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/minstd' ).factory;\n*\n* var minstd = factory({\n* 'seed': 1234\n* });\n*\n* var v = minstd();\n* // returns 20739838\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", "{\n\t\"idtype\": \"float64\",\n \"ndtype\": \"float64\"\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 fdtypes = require( '@stdlib/array/typed-real-float-dtypes' );\nvar rdtypes = require( '@stdlib/array/typed-real-dtypes' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar RDTYPES = rdtypes();\nvar FDTYPES = fdtypes();\nRDTYPES.push( 'generic' );\nFDTYPES.push( 'generic' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* ## Notes\n*\n* - Validation modes:\n*\n* - `0`: factory validation\n* - `1`: integer PRNG validation\n* - `2`: normalized PRNG validation\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.dtype] - output array data type\n* @param {string} [options.idtype] - output array data type when generating integers\n* @param {string} [options.rdtype] - output array data type when generating normalized numbers\n* @param {integer} mode - validation mode\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'dtype': 'float64'\n* };\n* var err = validate( opts, options, 0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options, mode ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( mode === 0 ) {\n\t\tif ( hasOwnProp( options, 'idtype' ) ) {\n\t\t\topts.idtype = options.idtype;\n\t\t\tif ( RDTYPES.indexOf( opts.idtype ) < 0 ) {\n\t\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'idtype', RDTYPES.join( '\", \"' ), opts.idtype ) );\n\t\t\t}\n\t\t}\n\t\tif ( hasOwnProp( options, 'ndtype' ) ) {\n\t\t\topts.ndtype = options.ndtype;\n\t\t\tif ( FDTYPES.indexOf( opts.ndtype ) < 0 ) {\n\t\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'ndtype', FDTYPES.join( '\", \"' ), opts.ndtype ) );\n\t\t\t}\n\t\t}\n\t} else if ( mode === 1 && hasOwnProp( options, 'dtype' ) ) {\n\t\topts.dtype = options.dtype;\n\t\tif ( RDTYPES.indexOf( opts.dtype ) < 0 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', RDTYPES.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t} else if ( hasOwnProp( options, 'dtype' ) ) { // mode === 2\n\t\topts.dtype = options.dtype;\n\t\tif ( FDTYPES.indexOf( opts.dtype ) < 0 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', FDTYPES.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\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 base = require( './../../../base/minstd' );\nvar ctors = require( '@stdlib/array/typed-real-ctors' );\nvar filledBy = require( '@stdlib/array/base/filled-by' );\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar format = require( '@stdlib/string/format' );\nvar defaults = require( './defaults.json' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers generated using a linear congruential pseudorandom number generator (LCG).\n*\n* @param {Options} [options] - function options\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.idtype=\"float64\"] - default data type when generating integers\n* @param {string} [options.ndtype=\"float64\"] - default data type when generating normalized numbers\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var minstd = factory();\n* // returns \n*\n* var arr = minstd( 10 );\n* // returns \n*\n* @example\n* var minstd = factory();\n* // returns \n*\n* var arr = minstd( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var minstd = factory();\n* // returns \n*\n* var arr = minstd.normalized( 10 );\n* // returns \n*/\nfunction factory() {\n\tvar options;\n\tvar nargs;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\n\topts = {\n\t\t'idtype': defaults.idtype,\n\t\t'ndtype': defaults.ndtype\n\t};\n\n\tnargs = arguments.length;\n\trand = minstd;\n\tif ( nargs === 0 ) {\n\t\tprng = base;\n\t} else if ( nargs === 1 ) {\n\t\toptions = arguments[ 0 ];\n\t\tprng = base.factory( options );\n\t\terr = validate( opts, options, 0 );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\tsetReadOnlyAccessor( rand, 'seed', getSeed );\n\tsetReadOnlyAccessor( rand, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( rand, 'state', getState, setState );\n\tsetReadOnlyAccessor( rand, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( rand, 'byteLength', getStateSize );\n\tsetReadOnly( rand, 'PRNG', prng );\n\tsetReadOnly( rand, 'normalized', normalized );\n\treturn rand;\n\n\t/**\n\t* Returns an array containing pseudorandom integers on the interval `[1, 2147483646]`.\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction minstd( len, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 1 ) {\n\t\t\terr = validate( o, options, 1 );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tdt = o.dtype || opts.idtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, prng );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tnullary( [ out ], [ len ], [ 1 ], prng );\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns an array containing pseudorandom numbers on the interval `[0, 1)`.\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction normalized( len, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 1 ) {\n\t\t\terr = validate( o, options, 2 );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tdt = o.dtype || opts.ndtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, prng.normalized );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tnullary( [ out ], [ len ], [ 1 ], prng.normalized );\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {Int32Array} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {Int32Array} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {Int32Array} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom integers on the interval `[1, 2147483646]`.\n*\n* @name minstd\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = minstd( 10 );\n* // returns \n*\n* @example\n* var arr = minstd.normalized( 10 );\n* // returns \n*\n* @example\n* var arr = minstd( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar minstd = factory();\n\n\n// EXPORTS //\n\nmodule.exports = minstd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create an array containing pseudorandom numbers generated using a linear congruential pseudorandom number generator (LCG).\n*\n* @module @stdlib/random/array/minstd\n*\n* @example\n* var minstd = require( '@stdlib/random/array/minstd' );\n*\n* var arr = minstd( 10 );\n* // returns \n*\n* @example\n* var minstd = require( '@stdlib/random/array/minstd' );\n*\n* var arr = minstd( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var minstd = require( '@stdlib/random/array/minstd' );\n*\n* var arr = minstd.normalized( 10 );\n* // returns \n*\n* @example\n* var minstd = require( '@stdlib/random/array/minstd' );\n*\n* var arr = minstd.normalized( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var minstd = require( '@stdlib/random/array/minstd' );\n*\n* var rand = minstd.factory();\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var minstd = require( '@stdlib/random/array/minstd' );\n*\n* var rand = minstd.factory();\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"normalized\": \"main.normalized\" }\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 isnan = require( '@stdlib/math/base/assert/is-nan' );\n\n\n// VARIABLES //\n\nvar NUM_WARMUPS = 8;\n\n\n// MAIN //\n\n/**\n* Initializes a shuffle table.\n*\n* @private\n* @param {PRNG} rand - pseudorandom number generator\n* @param {Int32Array} table - table\n* @param {PositiveInteger} N - table size\n* @throws {Error} PRNG returned `NaN`\n* @returns {NumberArray} shuffle table\n*/\nfunction createTable( rand, table, N ) {\n\tvar v;\n\tvar i;\n\n\t// \"warm-up\" the PRNG...\n\tfor ( i = 0; i < NUM_WARMUPS; i++ ) {\n\t\tv = rand();\n\n\t\t// Prevent the above loop from being discarded by the compiler...\n\t\tif ( isnan( v ) ) {\n\t\t\tthrow new Error( 'unexpected error. PRNG returned NaN.' );\n\t\t}\n\t}\n\t// Initialize the shuffle table...\n\tfor ( i = N-1; i >= 0; i-- ) {\n\t\ttable[ i ] = rand();\n\t}\n\treturn table;\n}\n\n\n// EXPORTS //\n\nmodule.exports = createTable;\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 INT32_MAX = require( '@stdlib/constants/int32/max' );\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// VARIABLES //\n\nvar MAX = INT32_MAX - 1;\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom integer on the interval \\\\([1, 2^{31}-1)\\\\).\n*\n* @private\n* @returns {PositiveInteger} pseudorandom integer\n*\n* @example\n* var v = randint32();\n* // returns \n*/\nfunction randint32() {\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 = randint32;\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/* eslint-disable max-len */\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 isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isInt32Array = require( '@stdlib/assert/is-int32array' );\nvar gcopy = require( '@stdlib/blas/base/gcopy' );\nvar floor = require( '@stdlib/math/base/special/floor' );\nvar Int32Array = require( '@stdlib/array/int32' );\nvar INT32_MAX = require( '@stdlib/constants/int32/max' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar createTable = require( './create_table.js' );\nvar randint32 = require( './rand_int32.js' );\n\n\n// VARIABLES //\n\nvar NORMALIZATION_CONSTANT = (INT32_MAX - 1)|0; // asm type annotation\nvar MAX_SEED = (INT32_MAX - 1)|0; // asm type annotation\nvar A = 16807|0; // asm type annotation\n\n// Define the number of elements in the shuffle table:\nvar TABLE_LENGTH = 32;\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; // table, other, seed\n\n// Define the index offset of the \"table\" section in the state array:\nvar TABLE_SECTION_OFFSET = 2; // | version | num_sections | table_length | ...table | other_length | shuffle_state | prng_state | seed_length | ...seed |\n\n// Define the index offset of the \"state\" section in the state array:\nvar STATE_SECTION_OFFSET = TABLE_LENGTH + 3; // | version | num_sections | table_length | ...table | state_length | shuffle_state | prng_state | seed_length | ...seed |\n\n// Define the index offset of the seed section in the state array:\nvar SEED_SECTION_OFFSET = TABLE_LENGTH + 6; // | version | num_sections | table_length | ...table | state_length | shuffle_state | prng_state | seed_length | ...seed |\n\n// Define the length of the \"fixed\" length portion of the state array:\nvar STATE_FIXED_LENGTH = TABLE_LENGTH + 7; // 1 (version) + 1 (num_sections) + 1 (table_length) + TABLE_LENGTH (table) + 1 (state_length) + 1 (shuffle_state) + 1 (prng_state) + 1 (seed_length)\n\n// Define the indices for the shuffle table and PRNG states:\nvar SHUFFLE_STATE = STATE_SECTION_OFFSET + 1;\nvar PRNG_STATE = STATE_SECTION_OFFSET + 2;\n\n\n// FUNCTIONS //\n\n/**\n* Verifies state array integrity.\n*\n* @private\n* @param {Int32Array} 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 \"table\" section must equal `TABLE_LENGTH`...\n\tif ( state[ TABLE_SECTION_OFFSET ] !== TABLE_LENGTH ) {\n\t\treturn new RangeError( format( 'invalid %s. State array has an incompatible table length. Expected: `%s`. Actual: `%s`.', s1, TABLE_LENGTH, state[ TABLE_SECTION_OFFSET ] ) );\n\t}\n\t// The length of the \"state\" section must equal `2`...\n\tif ( state[ STATE_SECTION_OFFSET ] !== 2 ) {\n\t\treturn new RangeError( format( 'invalid %s. State array has an incompatible state length. Expected: `%u`. Actual: `%u`.', s1, 2, state[ STATE_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// MAIN //\n\n/**\n* Returns a linear congruential pseudorandom number generator (LCG) whose output is shuffled.\n*\n* @param {Options} [options] - options\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [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 the maximum signed 32-bit integer or an array-like object containing integers less than the maximum signed 32-bit integer\n* @throws {RangeError} a numeric seed must be a positive integer less than the maximum signed 32-bit integer\n* @throws {TypeError} state must be an `Int32Array`\n* @throws {Error} must provide a valid state\n* @throws {TypeError} `copy` option must be a boolean\n* @returns {PRNG} shuffled LCG PRNG\n*\n* @example\n* var minstd = factory();\n*\n* var v = minstd();\n* // returns \n*\n* @example\n* // Return a seeded LCG:\n* var minstd = factory({\n* 'seed': 1234\n* });\n*\n* var v = minstd();\n* // returns 1421600654\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 ( !isInt32Array( state ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be an Int32Array. 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 Int32Array( state.length );\n\t\t\t\tgcopy( state.length, state, 1, STATE, 1 );\n\t\t\t}\n\t\t\t// Create a state (table) \"view\":\n\t\t\tstate = new Int32Array( STATE.buffer, STATE.byteOffset+((TABLE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), TABLE_LENGTH );\n\n\t\t\t// Create a seed \"view\":\n\t\t\tseed = new Int32Array( 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 the maximum signed 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 ) && seed.length > 0 ) {\n\t\t\t\t\tslen = seed.length;\n\t\t\t\t\tSTATE = new Int32Array( 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[ TABLE_SECTION_OFFSET ] = TABLE_LENGTH;\n\t\t\t\t\tSTATE[ STATE_SECTION_OFFSET ] = 2;\n\t\t\t\t\tSTATE[ PRNG_STATE ] = seed[ 0 ];\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 (table) \"view\":\n\t\t\t\t\tstate = new Int32Array( STATE.buffer, STATE.byteOffset+((TABLE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), TABLE_LENGTH );\n\n\t\t\t\t\t// Create a seed \"view\":\n\t\t\t\t\tseed = new Int32Array( 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 = createTable( minstd, state, TABLE_LENGTH );\n\t\t\t\t\tSTATE[ SHUFFLE_STATE ] = state[ 0 ];\n\t\t\t\t} else {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be either a positive integer less than the maximum signed 32-bit integer or an array-like object containing integer values less than the maximum signed 32-bit integer. Option: `%s`.', 'seed', seed ) );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tseed = randint32()|0; // asm type annotation\n\t\t\t}\n\t\t}\n\t} else {\n\t\tseed = randint32()|0; // asm type annotation\n\t}\n\tif ( state === void 0 ) {\n\t\tSTATE = new Int32Array( 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[ TABLE_SECTION_OFFSET ] = TABLE_LENGTH;\n\t\tSTATE[ STATE_SECTION_OFFSET ] = 2;\n\t\tSTATE[ PRNG_STATE ] = seed;\n\t\tSTATE[ SEED_SECTION_OFFSET ] = 1;\n\t\tSTATE[ SEED_SECTION_OFFSET+1 ] = seed;\n\n\t\t// Create a state (table) \"view\":\n\t\tstate = new Int32Array( STATE.buffer, STATE.byteOffset+((TABLE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), TABLE_LENGTH );\n\n\t\t// Create a seed \"view\":\n\t\tseed = new Int32Array( 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 = createTable( minstd, state, TABLE_LENGTH );\n\t\tSTATE[ SHUFFLE_STATE ] = state[ 0 ];\n\t}\n\tsetReadOnly( minstdShuffle, 'NAME', 'minstd-shuffle' );\n\tsetReadOnlyAccessor( minstdShuffle, 'seed', getSeed );\n\tsetReadOnlyAccessor( minstdShuffle, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( minstdShuffle, 'state', getState, setState );\n\tsetReadOnlyAccessor( minstdShuffle, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( minstdShuffle, 'byteLength', getStateSize );\n\tsetReadOnly( minstdShuffle, 'toJSON', toJSON );\n\tsetReadOnly( minstdShuffle, 'MIN', 1 );\n\tsetReadOnly( minstdShuffle, 'MAX', INT32_MAX-1 );\n\tsetReadOnly( minstdShuffle, 'normalized', normalized );\n\n\tsetReadOnly( normalized, 'NAME', minstdShuffle.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', (minstdShuffle.MIN-1.0) / NORMALIZATION_CONSTANT );\n\tsetReadOnly( normalized, 'MAX', (minstdShuffle.MAX-1.0) / NORMALIZATION_CONSTANT );\n\n\treturn minstdShuffle;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMINSTD} seed\n\t*/\n\tfunction getSeed() {\n\t\tvar len = STATE[ SEED_SECTION_OFFSET ];\n\t\treturn gcopy( len, seed, 1, new Int32Array( 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. shuffle table\n\t* 2. internal PRNG state\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 {PRNGStateMINSTD} current state\n\t*/\n\tfunction getState() {\n\t\tvar len = STATE.length;\n\t\treturn gcopy( len, STATE, 1, new Int32Array( 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 {PRNGStateMINSTD} s - generator state\n\t* @throws {TypeError} must provide an `Int32Array`\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\tvar err;\n\t\tif ( !isInt32Array( s ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide an Int32Array. 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 Int32Array( 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 (table) \"view\":\n\t\tstate = new Int32Array( STATE.buffer, STATE.byteOffset+((TABLE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), TABLE_LENGTH );\n\n\t\t// Create a new seed \"view\":\n\t\tseed = new Int32Array( 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 = minstdShuffle.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 \\\\( [1,2^{31}-1) \\\\).\n\t*\n\t* @private\n\t* @returns {integer32} pseudorandom integer\n\t*/\n\tfunction minstd() {\n\t\tvar s = STATE[ PRNG_STATE ]|0; // asm type annotation\n\t\ts = ( (A*s)%INT32_MAX )|0; // asm type annotation\n\t\tSTATE[ PRNG_STATE ] = s;\n\t\treturn s|0; // asm type annotation\n\t}\n\n\t/**\n\t* Generates a pseudorandom integer on the interval \\\\( [1,2^{31}-1) \\\\).\n\t*\n\t* @private\n\t* @returns {integer32} pseudorandom integer\n\t*\n\t* @example\n\t* var v = minstd();\n\t* // returns \n\t*/\n\tfunction minstdShuffle() {\n\t\tvar s;\n\t\tvar i;\n\n\t\ts = STATE[ SHUFFLE_STATE ];\n\t\ti = floor( TABLE_LENGTH * (s/INT32_MAX) );\n\n\t\t// Pull a state from the table:\n\t\ts = state[ i ];\n\n\t\t// Update the PRNG state:\n\t\tSTATE[ SHUFFLE_STATE ] = s;\n\n\t\t// Replace the pulled state:\n\t\tstate[ i ] = minstd();\n\n\t\treturn s;\n\t}\n\n\t/**\n\t* Generates a pseudorandom number on the interval \\\\( [0,1) \\\\).\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = normalized();\n\t* // returns \n\t*/\n\tfunction normalized() {\n\t\treturn (minstdShuffle()-1) / 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 randint32 = require( './rand_int32.js' );\n\n\n// MAIN //\n\n/**\n* Generates a pseudorandom integer on the interval \\\\( [1,2^{31}-1) \\\\).\n*\n* ## Method\n*\n* Linear congruential generators (LCGs) use the recurrence relation\n*\n* ```tex\n* X_{n+1} = ( a \\cdot X_n + c ) \\operatorname{mod}(m)\n* ```\n*\n* where the modulus \\\\( m \\\\) is a prime number or power of a prime number and \\\\( a \\\\) is a primitive root modulo \\\\( m \\\\).\n*\n* \n*\n* For an LCG to be a Lehmer RNG, the seed \\\\( X_0 \\\\) must be coprime to \\\\( m \\\\).\n*\n* \n*\n* In this implementation, the constants \\\\( a \\\\), \\\\( c \\\\), and \\\\( m \\\\) have the values\n*\n* ```tex\n* \\begin{align*}\n* a &= 7^5 = 16807 \\\\\n* c &= 0 \\\\\n* m &= 2^{31} - 1 = 2147483647\n* \\end{align*}\n* ```\n*\n* \n*\n* The constant \\\\( m \\\\) is a Mersenne prime (modulo \\\\(31\\\\)).\n*\n* \n*\n* \n*\n* The constant \\\\( a \\\\) is a primitive root (modulo \\\\(31\\\\)).\n*\n* \n*\n* Accordingly, the maximum possible product is\n*\n* ```tex\n* 16807 \\cdot (m - 1) \\approx 2^{46}\n* ```\n*\n* The values for \\\\( a \\\\), \\\\( c \\\\), and \\\\( m \\\\) are taken from Park and Miller, \"Random Number Generators: Good Ones Are Hard To Find\". Park's and Miller's article is also the basis for a recipe in the second edition of _Numerical Recipes in C_.\n*\n* This implementation subsequently shuffles the output of a linear congruential pseudorandom number generator (LCG) using a shuffle table in accordance with the Bays-Durham algorithm.\n*\n* ## Notes\n*\n* - The generator has a period of approximately \\\\(2.1\\mbox{e}9\\\\) (see [Numerical Recipes in C, 2nd Edition](#references), p. 279).\n*\n* ## References\n*\n* - Bays, Carter, and S. D. Durham. 1976. \"Improving a Poor Random Number Generator.\" _ACM Transactions on Mathematical Software_ 2 (1). New York, NY, USA: ACM: 59\u201364. doi:[10.1145/355666.355670](http://dx.doi.org/10.1145/355666.355670).\n* - Herzog, T.N., and G. Lord. 2002. _Applications of Monte Carlo Methods to Finance and Insurance_. ACTEX Publications. [https://books.google.com/books?id=vC7I\\\\\\_gdX-A0C](https://books.google.com/books?id=vC7I\\_gdX-A0C).\n* - Press, William H., Brian P. Flannery, Saul A. Teukolsky, and William T. Vetterling. 1992. _Numerical Recipes in C: The Art of Scientific Computing, Second Edition_. Cambridge University Press.\n*\n* @function minstd\n* @type {PRNG}\n* @returns {PositiveInteger} pseudorandom integer\n*\n* @example\n* var v = minstd();\n* // returns \n*/\nvar minstd = factory({\n\t'seed': randint32()\n});\n\n\n// EXPORTS //\n\nmodule.exports = minstd;\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 linear congruential pseudorandom number generator (LCG) whose output is shuffled.\n*\n* @module @stdlib/random/base/minstd-shuffle\n*\n* @example\n* var minstd = require( '@stdlib/random/base/minstd-shuffle' );\n*\n* var v = minstd();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/minstd-shuffle' ).factory;\n*\n* var minstd = factory({\n* 'seed': 1234\n* });\n*\n* var v = minstd();\n* // returns 1421600654\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", "{\n\t\"idtype\": \"float64\",\n \"ndtype\": \"float64\"\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 fdtypes = require( '@stdlib/array/typed-real-float-dtypes' );\nvar rdtypes = require( '@stdlib/array/typed-real-dtypes' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar RDTYPES = rdtypes();\nvar FDTYPES = fdtypes();\nRDTYPES.push( 'generic' );\nFDTYPES.push( 'generic' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* ## Notes\n*\n* - Validation modes:\n*\n* - `0`: factory validation\n* - `1`: integer PRNG validation\n* - `2`: normalized PRNG validation\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.dtype] - output array data type\n* @param {string} [options.idtype] - output array data type when generating integers\n* @param {string} [options.rdtype] - output array data type when generating normalized numbers\n* @param {integer} mode - validation mode\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'dtype': 'float64'\n* };\n* var err = validate( opts, options, 0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options, mode ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( mode === 0 ) {\n\t\tif ( hasOwnProp( options, 'idtype' ) ) {\n\t\t\topts.idtype = options.idtype;\n\t\t\tif ( RDTYPES.indexOf( opts.idtype ) < 0 ) {\n\t\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'idtype', RDTYPES.join( '\", \"' ), opts.idtype ) );\n\t\t\t}\n\t\t}\n\t\tif ( hasOwnProp( options, 'ndtype' ) ) {\n\t\t\topts.ndtype = options.ndtype;\n\t\t\tif ( FDTYPES.indexOf( opts.ndtype ) < 0 ) {\n\t\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'ndtype', FDTYPES.join( '\", \"' ), opts.ndtype ) );\n\t\t\t}\n\t\t}\n\t} else if ( mode === 1 && hasOwnProp( options, 'dtype' ) ) {\n\t\topts.dtype = options.dtype;\n\t\tif ( RDTYPES.indexOf( opts.dtype ) < 0 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', RDTYPES.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t} else if ( hasOwnProp( options, 'dtype' ) ) { // mode === 2\n\t\topts.dtype = options.dtype;\n\t\tif ( FDTYPES.indexOf( opts.dtype ) < 0 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', FDTYPES.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\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 base = require( './../../../base/minstd-shuffle' );\nvar ctors = require( '@stdlib/array/typed-real-ctors' );\nvar filledBy = require( '@stdlib/array/base/filled-by' );\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar format = require( '@stdlib/string/format' );\nvar defaults = require( './defaults.json' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers generated using a linear congruential pseudorandom number generator (LCG) whose output is shuffled.\n*\n* @param {Options} [options] - function options\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.idtype=\"float64\"] - default data type when generating integers\n* @param {string} [options.ndtype=\"float64\"] - default data type when generating normalized numbers\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var minstd = factory();\n* // returns \n*\n* var arr = minstd( 10 );\n* // returns \n*\n* @example\n* var minstd = factory();\n* // returns \n*\n* var arr = minstd( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var minstd = factory();\n* // returns \n*\n* var arr = minstd.normalized( 10 );\n* // returns \n*/\nfunction factory() {\n\tvar options;\n\tvar nargs;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\n\topts = {\n\t\t'idtype': defaults.idtype,\n\t\t'ndtype': defaults.ndtype\n\t};\n\n\tnargs = arguments.length;\n\trand = minstd;\n\tif ( nargs === 0 ) {\n\t\tprng = base;\n\t} else if ( nargs === 1 ) {\n\t\toptions = arguments[ 0 ];\n\t\tprng = base.factory( options );\n\t\terr = validate( opts, options, 0 );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\tsetReadOnlyAccessor( rand, 'seed', getSeed );\n\tsetReadOnlyAccessor( rand, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( rand, 'state', getState, setState );\n\tsetReadOnlyAccessor( rand, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( rand, 'byteLength', getStateSize );\n\tsetReadOnly( rand, 'PRNG', prng );\n\tsetReadOnly( rand, 'normalized', normalized );\n\treturn rand;\n\n\t/**\n\t* Returns an array containing pseudorandom integers on the interval `[1, 2147483646]`.\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction minstd( len, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 1 ) {\n\t\t\terr = validate( o, options, 1 );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tdt = o.dtype || opts.idtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, prng );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tnullary( [ out ], [ len ], [ 1 ], prng );\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns an array containing pseudorandom numbers on the interval `[0, 1)`.\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction normalized( len, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 1 ) {\n\t\t\terr = validate( o, options, 2 );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tdt = o.dtype || opts.ndtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, prng.normalized );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tnullary( [ out ], [ len ], [ 1 ], prng.normalized );\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {Int32Array} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {Int32Array} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {Int32Array} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom integers on the interval `[1, 2147483646]`.\n*\n* @name minstd\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = minstd( 10 );\n* // returns \n*\n* @example\n* var arr = minstd.normalized( 10 );\n* // returns \n*\n* @example\n* var arr = minstd( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar minstd = factory();\n\n\n// EXPORTS //\n\nmodule.exports = minstd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create an array containing pseudorandom numbers generated using a linear congruential pseudorandom number generator (LCG) whose output is shuffled.\n*\n* @module @stdlib/random/array/minstd-shuffle\n*\n* @example\n* var minstd = require( '@stdlib/random/array/minstd-shuffle' );\n*\n* var arr = minstd( 10 );\n* // returns \n*\n* @example\n* var minstd = require( '@stdlib/random/array/minstd-shuffle' );\n*\n* var arr = minstd( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var minstd = require( '@stdlib/random/array/minstd-shuffle' );\n*\n* var arr = minstd.normalized( 10 );\n* // returns \n*\n* @example\n* var minstd = require( '@stdlib/random/array/minstd-shuffle' );\n*\n* var arr = minstd.normalized( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var minstd = require( '@stdlib/random/array/minstd-shuffle' );\n*\n* var rand = minstd.factory();\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var minstd = require( '@stdlib/random/array/minstd-shuffle' );\n*\n* var rand = minstd.factory();\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"normalized\": \"main.normalized\" }\n", "{\n\t\"idtype\": \"float64\",\n \"ndtype\": \"float64\"\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 fdtypes = require( '@stdlib/array/typed-real-float-dtypes' );\nvar rdtypes = require( '@stdlib/array/typed-real-dtypes' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar RDTYPES = rdtypes();\nvar FDTYPES = fdtypes();\nRDTYPES.push( 'generic' );\nFDTYPES.push( 'generic' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* ## Notes\n*\n* - Validation modes:\n*\n* - `0`: factory validation\n* - `1`: integer PRNG validation\n* - `2`: normalized PRNG validation\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.dtype] - output array data type\n* @param {string} [options.idtype] - output array data type when generating integers\n* @param {string} [options.rdtype] - output array data type when generating normalized numbers\n* @param {integer} mode - validation mode\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'dtype': 'float64'\n* };\n* var err = validate( opts, options, 0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options, mode ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( mode === 0 ) {\n\t\tif ( hasOwnProp( options, 'idtype' ) ) {\n\t\t\topts.idtype = options.idtype;\n\t\t\tif ( RDTYPES.indexOf( opts.idtype ) < 0 ) {\n\t\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'idtype', RDTYPES.join( '\", \"' ), opts.idtype ) );\n\t\t\t}\n\t\t}\n\t\tif ( hasOwnProp( options, 'ndtype' ) ) {\n\t\t\topts.ndtype = options.ndtype;\n\t\t\tif ( FDTYPES.indexOf( opts.ndtype ) < 0 ) {\n\t\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'ndtype', FDTYPES.join( '\", \"' ), opts.ndtype ) );\n\t\t\t}\n\t\t}\n\t} else if ( mode === 1 && hasOwnProp( options, 'dtype' ) ) {\n\t\topts.dtype = options.dtype;\n\t\tif ( RDTYPES.indexOf( opts.dtype ) < 0 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', RDTYPES.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t} else if ( hasOwnProp( options, 'dtype' ) ) { // mode === 2\n\t\topts.dtype = options.dtype;\n\t\tif ( FDTYPES.indexOf( opts.dtype ) < 0 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', FDTYPES.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\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 base = require( './../../../base/mt19937' );\nvar ctors = require( '@stdlib/array/typed-real-ctors' );\nvar filledBy = require( '@stdlib/array/base/filled-by' );\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar format = require( '@stdlib/string/format' );\nvar defaults = require( './defaults.json' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers generated using a 32-bit Mersenne Twister pseudorandom number generator.\n*\n* @param {Options} [options] - function 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* @param {string} [options.idtype=\"float64\"] - default data type when generating integers\n* @param {string} [options.ndtype=\"float64\"] - default data type when generating normalized numbers\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var mt19937 = factory();\n* // returns \n*\n* var arr = mt19937( 10 );\n* // returns \n*\n* @example\n* var mt19937 = factory();\n* // returns \n*\n* var arr = mt19937( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var mt19937 = factory();\n* // returns \n*\n* var arr = mt19937.normalized( 10 );\n* // returns \n*/\nfunction factory() {\n\tvar options;\n\tvar nargs;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\n\topts = {\n\t\t'idtype': defaults.idtype,\n\t\t'ndtype': defaults.ndtype\n\t};\n\n\tnargs = arguments.length;\n\trand = mt19937;\n\tif ( nargs === 0 ) {\n\t\tprng = base;\n\t} else if ( nargs === 1 ) {\n\t\toptions = arguments[ 0 ];\n\t\tprng = base.factory( options );\n\t\terr = validate( opts, options, 0 );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\tsetReadOnlyAccessor( rand, 'seed', getSeed );\n\tsetReadOnlyAccessor( rand, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( rand, 'state', getState, setState );\n\tsetReadOnlyAccessor( rand, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( rand, 'byteLength', getStateSize );\n\tsetReadOnly( rand, 'PRNG', prng );\n\tsetReadOnly( rand, 'normalized', normalized );\n\treturn rand;\n\n\t/**\n\t* Returns an array containing pseudorandom integers on the interval `[0, 4294967295]`.\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction mt19937( len, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 1 ) {\n\t\t\terr = validate( o, options, 1 );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tdt = o.dtype || opts.idtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, prng );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tnullary( [ out ], [ len ], [ 1 ], prng );\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns an array containing pseudorandom numbers on the interval `[0, 1)` with 53-bit precision.\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction normalized( len, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 1 ) {\n\t\t\terr = validate( o, options, 2 );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tdt = o.dtype || opts.ndtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, prng.normalized );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tnullary( [ out ], [ len ], [ 1 ], prng.normalized );\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {Uint32Array} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {Uint32Array} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {Uint32Array} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom integers on the interval `[0, 4294967295]`.\n*\n* @name mt19937\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = mt19937( 10 );\n* // returns \n*\n* @example\n* var arr = mt19937.normalized( 10 );\n* // returns \n*\n* @example\n* var arr = mt19937( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar mt19937 = factory();\n\n\n// EXPORTS //\n\nmodule.exports = mt19937;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create an array containing pseudorandom numbers generated using a 32-bit Mersenne Twister pseudorandom number generator.\n*\n* @module @stdlib/random/array/mt19937\n*\n* @example\n* var mt19937 = require( '@stdlib/random/array/mt19937' );\n*\n* var arr = mt19937( 10 );\n* // returns \n*\n* @example\n* var mt19937 = require( '@stdlib/random/array/mt19937' );\n*\n* var arr = mt19937( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var mt19937 = require( '@stdlib/random/array/mt19937' );\n*\n* var arr = mt19937.normalized( 10 );\n* // returns \n*\n* @example\n* var mt19937 = require( '@stdlib/random/array/mt19937' );\n*\n* var arr = mt19937.normalized( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var mt19937 = require( '@stdlib/random/array/mt19937' );\n*\n* var rand = mt19937.factory();\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var mt19937 = require( '@stdlib/random/array/mt19937' );\n*\n* var rand = mt19937.factory();\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"normalized\": \"main.normalized\" }\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 exp = require( '@stdlib/math/base/special/exp' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Poisson distribution.\n*\n* ## Notes\n*\n* - Appropriate for \\\\(lambda < 30\\\\).\n*\n* ## References\n*\n* - Knuth, Donald E. 1997. _The Art of Computer Programming, Volume 2 (3rd Ed.): Seminumerical Algorithms_. Boston, MA, USA: Addison-Wesley Longman Publishing Co., Inc.\n*\n* @private\n* @param {PRNG} rand - PRNG for generating uniformly distributed numbers\n* @param {PositiveNumber} lambda - mean\n* @returns {NonNegativeInteger} pseudorandom number\n*/\nfunction poisson( rand, lambda ) {\n\tvar p = rand();\n\tvar k = 1;\n\twhile ( p > exp( -lambda ) ) {\n\t\tk += 1;\n\t\tp *= rand();\n\t}\n\treturn k - 1;\n}\n\n\n// EXPORTS //\n\nmodule.exports = poisson;\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 factorialln = require( '@stdlib/math/base/special/factorialln' );\nvar floor = require( '@stdlib/math/base/special/floor' );\nvar sign = require( '@stdlib/math/base/special/signum' );\nvar sqrt = require( '@stdlib/math/base/special/sqrt' );\nvar abs = require( '@stdlib/math/base/special/abs' );\nvar ln = require( '@stdlib/math/base/special/ln' );\nvar LN_SQRT_TWO_PI = require( '@stdlib/constants/float64/ln-sqrt-two-pi' );\n\n\n// VARIABLES //\n\nvar ONE_12 = 1.0 / 12.0;\nvar ONE_360 = 1.0 / 360.0;\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Poisson distribution with parameter `lambda`.\n*\n* ## References\n*\n* - H\u00F6rmann, W. 1993. \"The transformed rejection method for generating Poisson random variables.\" _Insurance: Mathematics and Economics_ 12 (1): 39\u201345. doi:[10.1016/0167-6687(93)90997-4][@hormann:1993b].\n*\n* [@hormann:1993b]: http://dx.doi.org/10.1016/0167-6687(93)90997-4\n*\n* @private\n* @param {PRNG} rand - PRNG for generating uniformly distributed numbers\n* @param {PositiveNumber} lambda - mean\n* @returns {NonNegativeInteger} pseudorandom number\n*/\nfunction poisson( rand, lambda ) {\n\tvar slambda;\n\tvar ainv;\n\tvar urvr;\n\tvar us;\n\tvar vr;\n\tvar a;\n\tvar b;\n\tvar k;\n\tvar u;\n\tvar v;\n\n\tslambda = sqrt( lambda );\n\n\tb = (2.53*slambda) + 0.931;\n\ta = (0.02483*b) - 0.059;\n\n\tainv = (1.1328/(b-3.4)) + 1.1239;\n\tvr = (-3.6224/(b-2.0)) + 0.9277;\n\turvr = 0.86 * vr;\n\n\twhile ( true ) {\n\t\tv = rand();\n\t\tif ( v <= urvr ) {\n\t\t\tu = (v / vr) - 0.43;\n\t\t\tu *= (2.0*a / (0.5-abs(u))) + b;\n\t\t\tu += lambda + 0.445;\n\t\t\treturn floor( u );\n\t\t}\n\t\tif ( v >= vr ) {\n\t\t\tu = rand() - 0.5;\n\t\t} else {\n\t\t\tu = (v / vr) - 0.93;\n\t\t\tu = (sign( u )*0.5) - u;\n\t\t\tv = vr * rand();\n\t\t}\n\t\tus = 0.5 - abs( u );\n\t\tif (\n\t\t\tus >= 0.013 ||\n\t\t\tus >= v\n\t\t) {\n\t\t\tk = floor( (((2.0*a/us) + b)*u) + lambda + 0.445 );\n\t\t\tv *= ainv / ( (a/(us*us)) + b );\n\t\t\tu = (k+0.5) * ln( lambda/k );\n\t\t\tu += -lambda - LN_SQRT_TWO_PI + k;\n\t\t\tu -= ( ONE_12 - (ONE_360/(k*k)) ) / k;\n\t\t\tif (\n\t\t\t\tk >= 10 &&\n\t\t\t\tu >= ln( v*slambda )\n\t\t\t) {\n\t\t\t\treturn k;\n\t\t\t}\n\t\t\tu = (k*ln( lambda )) - lambda - factorialln( k );\n\t\t\tif (\n\t\t\t\tk >= 0 &&\n\t\t\t\tk <= 9 &&\n\t\t\t\tu >= ln( v )\n\t\t\t) {\n\t\t\t\treturn k;\n\t\t\t}\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = poisson;\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 knuth = require( './knuth.js' );\nvar rejection = require( './rejection.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Poisson distribution with parameter `lambda`.\n*\n* @private\n* @param {PRNG} rand - PRNG for generating uniformly distributed numbers\n* @param {PositiveNumber} lambda - mean\n* @returns {NonNegativeInteger} pseudorandom number\n*/\nfunction poisson( rand, lambda ) {\n\tif ( lambda < 30.0 ) {\n\t\treturn knuth( rand, lambda );\n\t}\n\treturn rejection( rand, lambda );\n}\n\n\n// EXPORTS //\n\nmodule.exports = poisson;\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 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 isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar poisson0 = require( './poisson.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating Poisson distributed random numbers.\n*\n* @param {PositiveNumber} [lambda] - mean\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var poisson = factory( 5.0 );\n* var v = poisson();\n* // returns \n*\n* @example\n* var poisson = factory( 8.0, {\n* 'seed': 297\n* });\n* var v = poisson();\n* // returns \n*\n* @example\n* var poisson = factory();\n* var v = poisson( 0.5 );\n* // returns \n*/\nfunction factory() {\n\tvar lambda;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if (\n\t\targuments.length === 1 &&\n\t\tisObject( arguments[ 0 ] )\n\t) {\n\t\topts = arguments[ 0 ];\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tlambda = arguments[ 0 ];\n\t\tif ( !isPositive( lambda ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', lambda ) );\n\t\t}\n\t\tif ( arguments.length > 1 ) {\n\t\t\topts = arguments[ 1 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( lambda === void 0 ) {\n\t\tprng = poisson2;\n\t} else {\n\t\tprng = poisson1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'poisson' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\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 = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( lambda === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ lambda ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Poisson distribution.\n\t*\n\t* @private\n\t* @returns {NonNegativeInteger} pseudorandom number\n\t*\n\t* @example\n\t* var v = poisson1();\n\t* // returns \n\t*/\n\tfunction poisson1() {\n\t\treturn poisson0( rand, lambda );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Poisson distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} lambda - mean\n\t* @returns {NonNegativeInteger} pseudorandom number\n\t*\n\t* @example\n\t* var v = poisson2( 0.5 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = poisson2( NaN );\n\t* // returns NaN\n\t*\n\t* @example\n\t* var v = poisson2( -1.0 );\n\t* // returns NaN\n\t*/\n\tfunction poisson2( lambda ) {\n\t\tif (\n\t\t\tisnan( lambda ) ||\n\t\t\tlambda <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn poisson0( rand, lambda );\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' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Poisson distribution with parameter `lambda`.\n*\n* ## Method\n*\n* - When \\\\(\\lambda < 30\\\\), use Knuth's method.\n* - When \\\\(lambda \\geq 30\\\\), use transformed rejection method as Knuth's method does not scale well with \\\\(\\lambda\\\\).\n*\n* ## References\n*\n* - Knuth, Donald E. 1997. _The Art of Computer Programming, Volume 2 (3rd Ed.): Seminumerical Algorithms_. Boston, MA, USA: Addison-Wesley Longman Publishing Co., Inc.\n* - H\u00F6rmann, W. 1993. \"The transformed rejection method for generating Poisson random variables.\" _Insurance: Mathematics and Economics_ 12 (1): 39\u201345. doi:[10.1016/0167-6687(93)90997-4][@hormann:1993b].\n*\n* [@hormann:1993b]: http://dx.doi.org/10.1016/0167-6687(93)90997-4\n*\n* @name poisson\n* @type {PRNG}\n* @param {PositiveNumber} lambda - mean\n* @returns {NonNegativeInteger} pseudorandom number\n*\n* @example\n* var v = poisson( 0.5 );\n* // returns \n*\n* @example\n* var v = poisson( 0.0 );\n* // returns NaN\n*\n* @example\n* var v = poisson( NaN );\n* // returns NaN\n*/\nvar poisson = factory();\n\n\n// EXPORTS //\n\nmodule.exports = poisson;\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* Poisson distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/poisson\n*\n* @example\n* var poisson = require( '@stdlib/random/base/poisson' );\n*\n* var v = poisson( 4.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/poisson' ).factory;\n* var poisson = factory( 4.0, {\n* 'seed': 297\n* });\n*\n* var v = poisson();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/poisson' ).factory;\n* var poisson = factory({\n* 'seed': 297\n* });\n*\n* var v = poisson( 3.0 );\n* // returns \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", "/**\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 isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar isnan = require( '@stdlib/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {PositiveNumber} r - number of successes until experiment is stopped\n* @param {number} p - success probability\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 10, 0.5 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( r, p ) {\n\tif ( !isPositive( r ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', r ) );\n\t}\n\tif ( !isNumber( p ) || isnan( p ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a number and not NaN. Value: `%s`.', p ) );\n\t}\n\tif ( p <= 0.0 || p >= 1.0 ) {\n\t\treturn new RangeError( format( 'invalid argument. Second argument must be on the interval: (0, 1). Value: `%f`.', p ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 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 isUint32Array = require( '@stdlib/assert/is-uint32array' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar poisson = require( './../../../base/poisson' ).factory;\nvar gamma = require( './../../../base/gamma' ).factory;\nvar gcopy = require( '@stdlib/blas/base/gcopy' );\nvar Uint32Array = require( '@stdlib/array/uint32' );\nvar assign = require( '@stdlib/object/assign' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating negative binomial distributed random numbers.\n*\n* @param {PositiveNumber} [r] - number of successes until experiment is stopped\n* @param {number} [p] - success probability\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} `r` must be a positive number\n* @throws {TypeError} `p` must be number\n* @throws {RangeError} `p` must be a number on the interval `(0,1)`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var negativeBinomial = factory( 10, 0.5 );\n*\n* var v = negativeBinomial();\n* // returns \n*\n* @example\n* var negativeBinomial = factory( 10, 0.8, {\n* 'seed': 297\n* });\n*\n* var v = negativeBinomial();\n* // returns \n*\n* @example\n* var negativeBinomial = factory();\n*\n* var v = negativeBinomial( 10, 0.5 );\n* // returns \n*/\nfunction factory() {\n\tvar rgamma;\n\tvar STATE;\n\tvar rpois;\n\tvar opts;\n\tvar prng;\n\tvar rand;\n\tvar FLG;\n\tvar err;\n\tvar p;\n\tvar r;\n\n\tFLG = true;\n\tif ( arguments.length === 0 ) {\n\t\topts = {\n\t\t\t'copy': false\n\t\t};\n\t\trpois = poisson( opts );\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'copy' ) && !isBoolean( opts.copy ) ) {\n\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', opts.copy ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trpois = poisson({\n\t\t\t\t'prng': opts.prng\n\t\t\t});\n\t\t} else {\n\t\t\tif ( hasOwnProp( opts, 'state' ) && !isUint32Array( opts.state ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a Uint32Array. Option: `%s`.', 'state', opts.state ) );\n\t\t\t}\n\t\t\topts = assign( {}, opts );\n\t\t\tif ( opts.copy === false ) {\n\t\t\t\tFLG = false;\n\t\t\t} else if ( opts.state ) {\n\t\t\t\topts.state = gcopy( opts.state.length, opts.state, 1, new Uint32Array( opts.state.length ), 1 ); // eslint-disable-line max-len\n\t\t\t}\n\t\t\topts.copy = false;\n\t\t\trpois = poisson( opts );\n\t\t}\n\t} else {\n\t\tr = arguments[ 0 ];\n\t\tp = arguments[ 1 ];\n\t\terr = validate( r, p );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'copy' ) && !isBoolean( opts.copy ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', opts.copy ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trpois = poisson({\n\t\t\t\t\t'prng': opts.prng\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tif ( hasOwnProp( opts, 'state' ) && !isUint32Array( opts.state ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a Uint32Array. Option: `%s`.', 'state', opts.state ) );\n\t\t\t\t}\n\t\t\t\topts = assign( {}, opts );\n\t\t\t\tif ( opts.copy === false ) {\n\t\t\t\t\tFLG = false;\n\t\t\t\t} else if ( opts.state ) {\n\t\t\t\t\topts.state = gcopy( opts.state.length, opts.state, 1, new Uint32Array( opts.state.length ), 1 ); // eslint-disable-line max-len\n\t\t\t\t}\n\t\t\t\topts.copy = false;\n\t\t\t\trpois = poisson( opts );\n\t\t\t}\n\t\t} else {\n\t\t\topts = {\n\t\t\t\t'copy': false\n\t\t\t};\n\t\t\trpois = poisson( opts );\n\t\t}\n\t}\n\tif ( opts && opts.prng ) {\n\t\tif ( r === void 0 ) {\n\t\t\trgamma = gamma({\n\t\t\t\t'prng': opts.prng\n\t\t\t});\n\t\t} else {\n\t\t\trgamma = gamma( r, p/(1-p), {\n\t\t\t\t'prng': opts.prng\n\t\t\t});\n\t\t}\n\t} else {\n\t\tif ( opts.state ) {\n\t\t\tSTATE = opts.state;\n\t\t} else {\n\t\t\tSTATE = rpois.state;\n\t\t\trpois.state = STATE; // updates the underlying PRNG to point to a shared state\n\t\t}\n\t\tif ( r === void 0 ) {\n\t\t\trgamma = gamma({\n\t\t\t\t'state': STATE,\n\t\t\t\t'copy': false\n\t\t\t});\n\t\t} else {\n\t\t\trgamma = gamma( r, p/(1-p), {\n\t\t\t\t'state': STATE,\n\t\t\t\t'copy': false\n\t\t\t});\n\t\t}\n\t}\n\tif ( r === void 0 ) {\n\t\tprng = negativeBinomial2;\n\t} else {\n\t\tprng = negativeBinomial1;\n\t}\n\trand = rpois.PRNG;\n\n\tsetReadOnly( prng, 'NAME', 'negative-binomial' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t}\n\tsetReadOnly( prng, 'PRNG', rand );\n\treturn prng;\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\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\tif ( !isUint32Array( s ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a Uint32Array. Value: `%s`.', s ) );\n\t\t}\n\t\tif ( FLG ) {\n\t\t\ts = gcopy( s.length, s, 1, new Uint32Array( s.length ), 1 );\n\t\t}\n\t\trand.state = s;\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 = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( r === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ r, p ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a negative binomial distribution with bound parameters `r` and `p`.\n\t*\n\t* @private\n\t* @returns {NonNegativeInteger} pseudorandom number\n\t*\n\t* @example\n\t* var v = negativeBinomial1();\n\t* // returns \n\t*/\n\tfunction negativeBinomial1() {\n\t\treturn rpois( rgamma() );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a negative binomial distribution with parameters `r` and `p`.\n\t*\n\t* @private\n\t* @param {PositiveNumber} r - number of successes until experiment is stopped\n\t* @param {number} p - success probability\n\t* @returns {NonNegativeInteger} pseudorandom number\n\t*\n\t* @example\n\t* var v = negativeBinomial2( 10, 0.5 );\n\t* // returns \n\t*/\n\tfunction negativeBinomial2( r, p ) {\n\t\tif (\n\t\t\tisnan( r ) ||\n\t\t\tisnan( p ) ||\n\t\t\tp <= 0.0 ||\n\t\t\tp >= 1.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn rpois( rgamma( r, p/(1-p) ) );\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' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a negative binomial distribution.\n*\n* @name negativeBinomial\n* @type {PRNG}\n* @param {PositiveNumber} r - number of successes until experiment is stopped\n* @param {number} p - success probability\n* @returns {NonNegativeInteger} pseudorandom number\n*\n* @example\n* var v = negativeBinomial( 10, 0.5 );\n* // returns \n*/\nvar negativeBinomial = factory();\n\n\n// EXPORTS //\n\nmodule.exports = negativeBinomial;\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* Negative binomial distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/negative-binomial\n*\n* @example\n* var negativeBinomial = require( '@stdlib/random/base/negative-binomial' );\n*\n* var v = negativeBinomial( 20, 0.5 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/negative-binomial' ).factory;\n* var negativeBinomial = factory( 10, 0.3, {\n* 'seed': 297\n* });\n*\n* var v = negativeBinomial();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/negative-binomial' ).factory;\n* var negativeBinomial = factory({\n* 'seed': 297\n* });\n*\n* var v = negativeBinomial( 10, 0.67 );\n* // returns \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", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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 binaryFactory = require( './../../../array/tools/binary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/negative-binomial' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a negative binomial distribution.\n*\n* @name factory\n* @type {Function}\n* @param {PositiveNumber} [r] - number of successes until experiment is stopped\n* @param {Probability} [p] - success probability\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `r` must be a positive number\n* @throws {TypeError} `p` must be a probability (i.e., a number on the interval [0,1])\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var negativeBinomial = factory( 10, 0.5 );\n* // returns \n*\n* var arr = negativeBinomial( 10 );\n* // returns \n*\n* @example\n* var negativeBinomial = factory( 10, 0.5 );\n* // returns \n*\n* var arr = negativeBinomial( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = binaryFactory( base, DTYPES, defaults.get( 'dtypes.real' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a negative binomial distribution.\n*\n* @name negativeBinomial\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {PositiveNumber} r - number of successes until experiment is stopped\n* @param {Probability} p - success probability\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = negativeBinomial( 10, 10, 0.5 );\n* // returns \n*\n* @example\n* var arr = negativeBinomial( 10, 10, 0.5, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar negativeBinomial = factory();\n\n\n// EXPORTS //\n\nmodule.exports = negativeBinomial;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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* Create an array containing pseudorandom numbers drawn from a negative binomial distribution.\n*\n* @module @stdlib/random/array/negative-binomial\n*\n* @example\n* var negativeBinomial = require( '@stdlib/random/array/negative-binomial' );\n*\n* var arr = negativeBinomial( 10, 10, 0.5 );\n* // returns \n*\n* @example\n* var negativeBinomial = require( '@stdlib/random/array/negative-binomial' );\n*\n* var arr = negativeBinomial( 10, 10, 0.5, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var negativeBinomial = require( '@stdlib/random/array/negative-binomial' );\n*\n* var rand = negativeBinomial.factory( 10, 0.5 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var negativeBinomial = require( '@stdlib/random/array/negative-binomial' );\n*\n* var rand = negativeBinomial.factory( 10, 0.5 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\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 isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar isnan = require( '@stdlib/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {number} mu - mean\n* @param {PositiveNumber} sigma - standard deviation\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( mu, sigma ) {\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( sigma ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', sigma ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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* Returns a pseudorandom number from a normal distribution with parameters `mu` and `sigma`.\n*\n* @private\n* @param {PRNG} rand - pseudorandom number generator\n* @param {number} mu - mean\n* @param {PositiveNumber} sigma - standard deviation\n* @returns {number} pseudorandom number\n*/\nfunction normal( rand, mu, sigma ) {\n\treturn mu + (sigma*rand());\n}\n\n\n// EXPORTS //\n\nmodule.exports = normal;\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 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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randn = require( './../../../base/improved-ziggurat' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar normal0 = require( './normal.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating normally distributed random numbers.\n*\n* @param {number} [mu] - mean\n* @param {PositiveNumber} [sigma] - standard deviation\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} `mu` must be a number\n* @throws {TypeError} `sigma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var normal = factory( 0.0, 1.0 );\n* var v = normal();\n* // returns \n*\n* @example\n* var normal = factory( -3.0, 0.5, {\n* 'seed': 297\n* });\n* var v = normal();\n* // returns \n*/\nfunction factory() {\n\tvar sigma;\n\tvar rnorm;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar mu;\n\n\tif ( arguments.length === 0 ) {\n\t\trnorm = randn();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trnorm = randn({\n\t\t\t\t'prng': opts.prng\n\t\t\t});\n\t\t} else {\n\t\t\trnorm = randn( opts );\n\t\t}\n\t} else {\n\t\tmu = arguments[ 0 ];\n\t\tsigma = arguments[ 1 ];\n\t\terr = validate( mu, sigma );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trnorm = randn({\n\t\t\t\t\t'prng': opts.prng\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\trnorm = randn( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trnorm = randn();\n\t\t}\n\t}\n\tif ( mu === void 0 ) {\n\t\tprng = normal2;\n\t} else {\n\t\tprng = normal1;\n\t}\n\trand = rnorm.PRNG;\n\n\tsetReadOnly( prng, 'NAME', 'normal' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t}\n\tsetReadOnly( prng, 'PRNG', rand );\n\treturn prng;\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\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 = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( mu === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ mu, sigma ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number from a normal distribution with bound parameters `mu` and `sigma`.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = normal1();\n\t* // returns \n\t*/\n\tfunction normal1() {\n\t\treturn normal0( rnorm, mu, sigma );\n\t}\n\n\t/**\n\t* Returns a normally distributed pseudorandom number with mean `mu` and standard deviation `sigma`.\n\t*\n\t* @private\n\t* @param {number} mu - mean\n\t* @param {PositiveNumber} sigma - standard deviation\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = normal2( 0.0, 1.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = normal2( 0.0, -1.0 );\n\t* // returns NaN\n\t*/\n\tfunction normal2( mu, sigma ) {\n\t\tif (\n\t\t\tisnan( mu ) ||\n\t\t\tisnan( sigma ) ||\n\t\t\tsigma <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn normal0( rnorm, mu, sigma );\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' );\n\n\n// MAIN //\n\n/**\n* Returns a normally distributed pseudorandom number with mean `mu` and standard deviation `sigma`.\n*\n* @name normal\n* @type {PRNG}\n* @param {number} mu - mean\n* @param {PositiveNumber} sigma - standard deviation\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = normal( 0.0, 1.0 );\n* // returns \n*\n* @example\n* var v = normal( 0.0, -1.0 );\n* // returns NaN\n*/\nvar normal = factory();\n\n\n// EXPORTS //\n\nmodule.exports = normal;\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* Normally distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/normal\n*\n* @example\n* var normal = require( '@stdlib/random/base/normal' );\n*\n* var v = normal( 0.0, 1.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/normal' ).factory;\n* var normal = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = normal();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/normal' ).factory;\n* var normal = factory({\n* 'seed': 297\n* });\n*\n* var v = normal( -3.0, 2.0 );\n* // returns \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", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 binaryFactory = require( './../../../array/tools/binary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/normal' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a normal distribution.\n*\n* @name factory\n* @type {Function}\n* @param {number} [mu] - mean\n* @param {PositiveNumber} [sigma] - standard deviation\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `sigma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var normal = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = normal( 10 );\n* // returns \n*\n* @example\n* var normal = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = normal( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = binaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a normal distribution.\n*\n* @name normal\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {number} mu - mean\n* @param {PositiveNumber} sigma - standard deviation\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = normal( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = normal( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar normal = factory();\n\n\n// EXPORTS //\n\nmodule.exports = normal;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create an array containing pseudorandom numbers drawn from a normal distribution.\n*\n* @module @stdlib/random/array/normal\n*\n* @example\n* var normal = require( '@stdlib/random/array/normal' );\n*\n* var arr = normal( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var normal = require( '@stdlib/random/array/normal' );\n*\n* var arr = normal( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var normal = require( '@stdlib/random/array/normal' );\n*\n* var rand = normal.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var normal = require( '@stdlib/random/array/normal' );\n*\n* var rand = normal.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\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 isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - scale parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( alpha, beta ) {\n\tif ( !isPositive( alpha ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositive( beta ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 pow = require( '@stdlib/math/base/special/pow' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Pareto (Type I) distribution.\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - scale parameter\n* @returns {NonNegativeNumber} pseudorandom number\n*/\nfunction pareto( rand, alpha, beta ) {\n\treturn beta / pow( rand(), 1.0/alpha );\n}\n\n\n// EXPORTS //\n\nmodule.exports = pareto;\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 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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar pareto0 = require( './pareto.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating Pareto (Type I) distributed random numbers.\n*\n* @param {PositiveNumber} [alpha] - shape parameter\n* @param {PositiveNumber} [beta] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var pareto1 = factory( 2.0, 1.0 );\n*\n* var v = pareto1();\n* // returns \n*\n* @example\n* var pareto1 = factory( 2.0, 2.0, {\n* 'seed': 297\n* });\n* var v = pareto1();\n* // returns \n*/\nfunction factory() {\n\tvar alpha;\n\tvar beta;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\talpha = arguments[ 0 ];\n\t\tbeta = arguments[ 1 ];\n\t\terr = validate( alpha, beta );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( alpha === void 0 ) {\n\t\tprng = pareto2;\n\t} else {\n\t\tprng = pareto1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'pareto-type1' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\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 = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( alpha === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ alpha, beta ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Pareto (Type I) distribution with bound parameters.\n\t*\n\t* @private\n\t* @returns {NonNegativeNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = pareto1();\n\t* // returns \n\t*/\n\tfunction pareto1() {\n\t\treturn pareto0( rand, alpha, beta );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Pareto (Type I) distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} alpha - shape parameter\n\t* @param {PositiveNumber} beta - scale parameter\n\t* @returns {NonNegativeNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = pareto2( 2.0, 3.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = pareto2( 3.0, 0.0 );\n\t* // returns NaN\n\t*\n\t* @example\n\t* var v = pareto2( 0.0, 2.0 );\n\t* // returns NaN\n\t*\n\t* @example\n\t* var v = pareto2( NaN, NaN );\n\t* // returns NaN\n\t*/\n\tfunction pareto2( alpha, beta ) {\n\t\tif (\n\t\t\tisnan( alpha ) ||\n\t\t\tisnan( beta ) ||\n\t\t\talpha <= 0.0 ||\n\t\t\tbeta <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn pareto0( rand, alpha, beta );\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' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Pareto (Type I) distribution.\n*\n* @name pareto1\n* @type {PRNG}\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - scale parameter\n* @returns {NonNegativeNumber} pseudorandom number\n*\n* @example\n* var v = pareto1( 2.0, 3.0 );\n* // returns \n*\n* @example\n* var v = pareto1( -2.0, 3.0 );\n* // returns NaN\n*/\nvar pareto1 = factory();\n\n\n// EXPORTS //\n\nmodule.exports = pareto1;\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* Pareto (Type I) distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/pareto-type1\n*\n* @example\n* var pareto1 = require( '@stdlib/random/base/pareto-type1' );\n*\n* var v = pareto1( 2.0, 3.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/pareto-type1' ).factory;\n* var pareto1 = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = pareto1();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/pareto-type1' ).factory;\n* var pareto1 = factory({\n* 'seed': 297\n* });\n*\n* var v = pareto1( 3.0, 2.0 );\n* // returns \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", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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 binaryFactory = require( './../../../array/tools/binary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/pareto-type1' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a Pareto (Type I) distribution.\n*\n* @name factory\n* @type {Function}\n* @param {PositiveNumber} [alpha] - shape parameter\n* @param {PositiveNumber} [beta] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var pareto1 = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = pareto1( 10 );\n* // returns \n*\n* @example\n* var pareto1 = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = pareto1( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = binaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a Pareto (Type I) distribution.\n*\n* @name pareto1\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - scale parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = pareto1( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = pareto1( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar pareto1 = factory();\n\n\n// EXPORTS //\n\nmodule.exports = pareto1;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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* Create an array containing pseudorandom numbers drawn from a Pareto (Type I) distribution.\n*\n* @module @stdlib/random/array/pareto-type1\n*\n* @example\n* var pareto1 = require( '@stdlib/random/array/pareto-type1' );\n*\n* var arr = pareto1( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var pareto1 = require( '@stdlib/random/array/pareto-type1' );\n*\n* var arr = pareto1( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var pareto1 = require( '@stdlib/random/array/pareto-type1' );\n*\n* var rand = pareto1.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var pareto1 = require( '@stdlib/random/array/pareto-type1' );\n*\n* var rand = pareto1.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 unaryFactory = require( './../../../array/tools/unary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/poisson' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a Poisson distribution.\n*\n* @name factory\n* @type {Function}\n* @param {PositiveNumber} [lambda] - mean parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var poisson = factory( 2.0 );\n* // returns \n*\n* var arr = poisson( 10 );\n* // returns \n*\n* @example\n* var poisson = factory( 2.0 );\n* // returns \n*\n* var arr = poisson( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = unaryFactory( base, DTYPES, defaults.get( 'dtypes.real' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a Poisson distribution.\n*\n* @name poisson\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {PositiveNumber} lambda - mean parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = poisson( 10, 2.0 );\n* // returns \n*\n* @example\n* var arr = poisson( 10, 2.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar poisson = factory();\n\n\n// EXPORTS //\n\nmodule.exports = poisson;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create an array containing pseudorandom numbers drawn from a Poisson distribution.\n*\n* @module @stdlib/random/array/poisson\n*\n* @example\n* var poisson = require( '@stdlib/random/array/poisson' );\n*\n* var arr = poisson( 10, 2.0 );\n* // returns \n*\n* @example\n* var poisson = require( '@stdlib/random/array/poisson' );\n*\n* var arr = poisson( 10, 2.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var poisson = require( '@stdlib/random/array/poisson' );\n*\n* var rand = poisson.factory( 2.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var poisson = require( '@stdlib/random/array/poisson' );\n*\n* var rand = poisson.factory( 2.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\n", "{\n\t\"name\": \"mt19937\",\n\t\"copy\": true\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'use strict';\n\n// MODULES //\n\nvar minstd = require( './../../../base/minstd' );\nvar minstdShuffle = require( './../../../base/minstd-shuffle' );\nvar mt19937 = require( './../../../base/mt19937' );\n\n\n// MAIN //\n\nvar prngs = {};\n\nprngs[ 'minstd' ] = minstd;\nprngs[ 'minstd-shuffle' ] = minstdShuffle;\nprngs[ 'mt19937' ] = mt19937;\n\n\n// EXPORTS //\n\nmodule.exports = prngs;\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 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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar defaults = require( './defaults.json' );\nvar PRNGS = require( './prngs.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating uniformly distributed random numbers on the interval \\\\( [0,1) \\\\).\n*\n* @param {Options} [options] - function options\n* @param {string} [options.name='mt19937'] - name of pseudorandom number generator\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [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} must provide an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide the name of a supported pseudorandom number generator\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var uniform = factory();\n* var v = uniform();\n* // returns \n*\n* @example\n* var uniform = factory({\n* 'name': 'minstd'\n* });\n* var v = uniform();\n* // returns \n*\n* @example\n* var uniform = factory({\n* 'seed': 12345\n* });\n* var v = uniform();\n* // returns \n*\n* @example\n* var uniform = factory({\n* 'name': 'minstd',\n* 'seed': 12345\n* });\n* var v = uniform();\n* // returns \n*/\nfunction factory( options ) {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\n\topts = {\n\t\t'name': defaults.name,\n\t\t'copy': defaults.copy\n\t};\n\tif ( arguments.length ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide an object. Value: `%s`.', options ) );\n\t\t}\n\t\tif ( hasOwnProp( options, 'name' ) ) {\n\t\t\topts.name = options.name;\n\t\t}\n\t\tif ( hasOwnProp( options, 'state' ) ) {\n\t\t\topts.state = options.state;\n\t\t\tif ( opts.state === void 0 ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option cannot be undefined. Option: `%s`.', 'state', opts.state ) );\n\t\t\t}\n\t\t} else if ( hasOwnProp( options, 'seed' ) ) {\n\t\t\topts.seed = options.seed;\n\t\t\tif ( opts.seed === void 0 ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option cannot be undefined. Option: `%s`.', 'seed', opts.seed ) );\n\t\t\t}\n\t\t}\n\t\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\t\topts.copy = options.copy;\n\t\t\tif ( !isBoolean( opts.copy ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', opts.copy ) );\n\t\t\t}\n\t\t}\n\t}\n\tprng = PRNGS[ opts.name ];\n\tif ( prng === void 0 ) {\n\t\tthrow new Error( format( 'invalid option. Unrecognized/unsupported PRNG. Option: `%s`.', opts.name ) );\n\t}\n\tif ( opts.state === void 0 ) {\n\t\tif ( opts.seed === void 0 ) {\n\t\t\trand = prng.factory();\n\t\t} else {\n\t\t\trand = prng.factory({\n\t\t\t\t'seed': opts.seed\n\t\t\t});\n\t\t}\n\t} else {\n\t\trand = prng.factory({\n\t\t\t'state': opts.state,\n\t\t\t'copy': opts.copy\n\t\t});\n\t}\n\tsetReadOnly( uniform, 'NAME', 'randu' );\n\tsetReadOnlyAccessor( uniform, 'seed', getSeed );\n\tsetReadOnlyAccessor( uniform, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( uniform, 'state', getState, setState );\n\tsetReadOnlyAccessor( uniform, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( uniform, 'byteLength', getStateSize );\n\tsetReadOnly( uniform, 'toJSON', toJSON );\n\tsetReadOnly( uniform, 'PRNG', rand );\n\tsetReadOnly( uniform, 'MIN', rand.normalized.MIN );\n\tsetReadOnly( uniform, 'MAX', rand.normalized.MAX );\n\n\treturn uniform;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {*} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {*} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {*} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\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 = uniform.NAME + '-' + rand.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tout.params = [];\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a uniformly distributed pseudorandom number on the interval \\\\( [0,1) \\\\).\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = uniform();\n\t* // returns \n\t*/\n\tfunction uniform() {\n\t\treturn rand.normalized();\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' );\n\n\n// MAIN //\n\n/**\n* Returns a uniformly distributed random number on the interval \\\\( [0,1) \\\\).\n*\n* @name randu\n* @type {PRNG}\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = randu();\n* // returns \n*/\nvar randu = factory();\n\n\n// EXPORTS //\n\nmodule.exports = randu;\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* Uniformly distributed pseudorandom numbers on the interval \\\\( [0,1) \\\\).\n*\n* @module @stdlib/random/base/randu\n*\n* @example\n* var randu = require( '@stdlib/random/base/randu' );\n*\n* var v = randu();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/randu' ).factory;\n*\n* var randu = factory({\n* 'name': 'minstd',\n* 'seed': 12345\n* });\n*\n* var v = randu();\n* // returns \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", "{\n\t\"dtype\": \"float64\"\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 dtypes = require( '@stdlib/array/typed-real-float-dtypes' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes();\nDTYPES.push( 'generic' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.dtype] - output array data type\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'dtype': 'float64'\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'dtype' ) ) {\n\t\topts.dtype = options.dtype;\n\t\tif ( DTYPES.indexOf( opts.dtype ) < 0 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', DTYPES.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\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 base = require( './../../../base/randu' );\nvar ctors = require( '@stdlib/array/typed-real-float-ctors' );\nvar filledBy = require( '@stdlib/array/base/filled-by' );\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar format = require( '@stdlib/string/format' );\nvar defaults = require( './defaults.json' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing uniformly distributed pseudorandom numbers between `0` and `1`.\n*\n* @param {Options} [options] - function options\n* @param {string} [options.name='mt19937'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var randu = factory();\n* // returns \n*\n* var arr = randu( 10 );\n* // returns \n*\n* @example\n* var randu = factory();\n* // returns \n*\n* var arr = randu( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nfunction factory() {\n\tvar options;\n\tvar nargs;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\n\topts = {\n\t\t'dtype': defaults.dtype\n\t};\n\n\tnargs = arguments.length;\n\trand = randu;\n\tif ( nargs === 0 ) {\n\t\tprng = base;\n\t} else if ( nargs === 1 ) {\n\t\toptions = arguments[ 0 ];\n\t\tprng = base.factory( options );\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\tsetReadOnlyAccessor( rand, 'seed', getSeed );\n\tsetReadOnlyAccessor( rand, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( rand, 'state', getState, setState );\n\tsetReadOnlyAccessor( rand, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( rand, 'byteLength', getStateSize );\n\tsetReadOnly( rand, 'PRNG', prng.PRNG );\n\treturn rand;\n\n\t/**\n\t* Returns an array containing pseudorandom numbers drawn from a randu distribution.\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction randu( len, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 1 ) {\n\t\t\terr = validate( o, options );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tdt = o.dtype || opts.dtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, prng );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tnullary( [ out ], [ len ], [ 1 ], prng );\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {*} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {*} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {*} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing uniformly distributed pseudorandom numbers between `0` and `1`.\n*\n* @name randu\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = randu( 10 );\n* // returns \n*\n* @example\n* var arr = randu( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar randu = factory();\n\n\n// EXPORTS //\n\nmodule.exports = randu;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create an array containing uniformly distributed pseudorandom numbers between `0` and `1`.\n*\n* @module @stdlib/random/array/randu\n*\n* @example\n* var randu = require( '@stdlib/random/array/randu' );\n*\n* var arr = randu( 10 );\n* // returns \n*\n* @example\n* var randu = require( '@stdlib/random/array/randu' );\n*\n* var arr = randu( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var randu = require( '@stdlib/random/array/randu' );\n*\n* var rand = randu.factory();\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var randu = require( '@stdlib/random/array/randu' );\n*\n* var rand = randu.factory();\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.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 sqrt = require( '@stdlib/math/base/special/sqrt' );\nvar ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number from a Rayleigh distribution with scale parameter `sigma`.\n*\n* @private\n* @param {PRNG} rand - PRNG for generating uniformly distributed numbers\n* @param {PositiveNumber} sigma - scale parameter\n* @returns {NonNegativeNumber} pseudorandom number\n*/\nfunction rayleigh( rand, sigma ) {\n\treturn sigma * sqrt( -2.0*ln( rand() ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = rayleigh;\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 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 isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar rayleigh0 = require( './rayleigh.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating Rayleigh distributed random numbers.\n*\n* @param {PositiveNumber} [sigma] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} `sigma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var rayleigh = factory( 1.0 );\n*\n* var v = rayleigh();\n* // returns \n*\n* @example\n* var rayleigh = factory( 0.5, {\n* 'seed': 297\n* });\n* var v = rayleigh();\n* // returns \n*\n* @example\n* var rayleigh = factory();\n* var v = rayleigh( 0.5 );\n* // returns \n*/\nfunction factory() {\n\tvar sigma;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if (\n\t\targuments.length === 1 &&\n\t\tisObject( arguments[ 0 ] )\n\t) {\n\t\topts = arguments[ 0 ];\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tsigma = arguments[ 0 ];\n\t\tif ( !isPositive( sigma ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', sigma ) );\n\t\t}\n\t\tif ( arguments.length > 1 ) {\n\t\t\topts = arguments[ 1 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( sigma === void 0 ) {\n\t\tprng = rayleigh2;\n\t} else {\n\t\tprng = rayleigh1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'rayleigh' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\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 = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( sigma === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ sigma ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number from a Rayleigh distribution with bound scale parameter `sigma`.\n\t*\n\t* @private\n\t* @returns {NonNegativeNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = rayleigh1();\n\t* // returns \n\t*/\n\tfunction rayleigh1() {\n\t\treturn rayleigh0( rand, sigma );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number from a Rayleigh distribution with scale parameter `sigma`.\n\t*\n\t* @private\n\t* @param {PositiveNumber} sigma - scale parameter\n\t* @returns {NonNegativeNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = rayleigh2( 3.0 );\n\t* // returns \n\t*/\n\tfunction rayleigh2( sigma ) {\n\t\tif (\n\t\t\tisnan( sigma ) ||\n\t\t\tsigma <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn rayleigh0( rand, sigma );\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' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Rayleigh distribution with scale parameter `sigma`.\n*\n* @name rayleigh\n* @type {Function}\n* @param {PositiveNumber} sigma - scale parameter\n* @returns {NonNegativeNumber} pseudorandom number\n*\n* @example\n* var v = rayleigh( 3.0 );\n* // returns \n*\n* @example\n* var v = rayleigh( 0.0 );\n* // returns NaN\n*\n* @example\n* var v = rayleigh( NaN );\n* // returns NaN\n*/\nvar rayleigh = factory();\n\n\n// EXPORTS //\n\nmodule.exports = rayleigh;\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* Rayleigh distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/rayleigh\n*\n* @example\n* var rayleigh = require( '@stdlib/random/base/rayleigh' );\n*\n* var v = rayleigh( 2.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/rayleigh' ).factory;\n* var rayleigh = factory( 3.0, {\n* 'seed': 297\n* });\n*\n* var v = rayleigh();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/rayleigh' ).factory;\n* var rayleigh = factory({\n* 'seed': 297\n* });\n*\n* var v = rayleigh( 2.0 );\n* // returns \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", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 unaryFactory = require( './../../../array/tools/unary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/rayleigh' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a Rayleigh distribution.\n*\n* @name factory\n* @type {Function}\n* @param {PositiveNumber} [sigma] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `sigma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var rayleigh = factory( 2.0 );\n* // returns \n*\n* var arr = rayleigh( 10 );\n* // returns \n*\n* @example\n* var rayleigh = factory( 2.0 );\n* // returns \n*\n* var arr = rayleigh( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = unaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a Rayleigh distribution.\n*\n* @name rayleigh\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {PositiveNumber} sigma - scale parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = rayleigh( 10, 2.0 );\n* // returns \n*\n* @example\n* var arr = rayleigh( 10, 2.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar rayleigh = factory();\n\n\n// EXPORTS //\n\nmodule.exports = rayleigh;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create an array containing pseudorandom numbers drawn from a Rayleigh distribution.\n*\n* @module @stdlib/random/array/rayleigh\n*\n* @example\n* var rayleigh = require( '@stdlib/random/array/rayleigh' );\n*\n* var arr = rayleigh( 10, 2.0 );\n* // returns \n*\n* @example\n* var rayleigh = require( '@stdlib/random/array/rayleigh' );\n*\n* var arr = rayleigh( 10, 2.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var rayleigh = require( '@stdlib/random/array/rayleigh' );\n*\n* var rand = rayleigh.factory( 2.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var rayleigh = require( '@stdlib/random/array/rayleigh' );\n*\n* var rand = rayleigh.factory( 2.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\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 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 isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isUint32Array = require( '@stdlib/assert/is-uint32array' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar chisquare = require( './../../../base/chisquare' ).factory;\nvar randn = require( './../../../base/improved-ziggurat' ).factory;\nvar gcopy = require( '@stdlib/blas/base/gcopy' );\nvar Uint32Array = require( '@stdlib/array/uint32' );\nvar assign = require( '@stdlib/object/assign' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar sqrt = require( '@stdlib/math/base/special/sqrt' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating t-distributed random numbers.\n*\n* @param {PositiveNumber} [v] - degrees of freedom\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} `v` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var t = factory( 1.0 );\n*\n* var v = t();\n* // returns \n*\n* @example\n* var t = factory( 0.5, {\n* 'seed': 297\n* });\n* var v = t();\n* // returns \n*\n* @example\n* var t = factory();\n* var v = t( 0.5 );\n* // returns \n*/\nfunction factory() {\n\tvar rchisq;\n\tvar STATE;\n\tvar rnorm;\n\tvar rand;\n\tvar opts;\n\tvar prng;\n\tvar FLG;\n\tvar v;\n\n\tFLG = true;\n\tif ( arguments.length === 0 ) {\n\t\topts = {\n\t\t\t'copy': false\n\t\t};\n\t\trnorm = randn( opts );\n\t} else if ( arguments.length === 1 ) {\n\t\tif ( isObject( arguments[ 0 ] ) ) {\n\t\t\topts = arguments[ 0 ];\n\t\t\tif ( hasOwnProp( opts, 'copy' ) && !isBoolean( opts.copy ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', opts.copy ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trnorm = randn({\n\t\t\t\t\t'prng': opts.prng\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tif ( hasOwnProp( opts, 'state' ) && !isUint32Array( opts.state ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a Uint32Array. Option: `%s`.', 'state', opts.state ) );\n\t\t\t\t}\n\t\t\t\topts = assign( {}, opts );\n\t\t\t\tif ( opts.copy === false ) {\n\t\t\t\t\tFLG = false;\n\t\t\t\t} else if ( opts.state ) {\n\t\t\t\t\topts.state = gcopy( opts.state.length, opts.state, 1, new Uint32Array( opts.state.length ), 1 ); // eslint-disable-line max-len\n\t\t\t\t}\n\t\t\t\topts.copy = false;\n\t\t\t\trnorm = randn( opts );\n\t\t\t}\n\t\t} else {\n\t\t\tv = arguments[ 0 ];\n\t\t\tif ( !isPositive( v ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number or an options object. Value: `%s`.', v ) );\n\t\t\t}\n\t\t\topts = {\n\t\t\t\t'copy': false\n\t\t\t};\n\t\t\trnorm = randn( opts );\n\t\t}\n\t} else {\n\t\tv = arguments[ 0 ];\n\t\tif ( !isPositive( v ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', v ) );\n\t\t}\n\t\topts = arguments[ 1 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'copy' ) && !isBoolean( opts.copy ) ) {\n\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', opts.copy ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trnorm = randn({\n\t\t\t\t'prng': opts.prng\n\t\t\t});\n\t\t} else {\n\t\t\tif ( hasOwnProp( opts, 'state' ) && !isUint32Array( opts.state ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a Uint32Array. Option: `%s`.', 'state', opts.state ) );\n\t\t\t}\n\t\t\topts = assign( {}, opts );\n\t\t\tif ( opts.copy === false ) {\n\t\t\t\tFLG = false;\n\t\t\t} else if ( opts.state ) {\n\t\t\t\topts.state = gcopy( opts.state.length, opts.state, 1, new Uint32Array( opts.state.length ), 1 ); // eslint-disable-line max-len\n\t\t\t}\n\t\t\topts.copy = false;\n\t\t\trnorm = randn( opts );\n\t\t}\n\t}\n\tif ( opts && opts.prng ) {\n\t\tif ( v === void 0 ) {\n\t\t\trchisq = chisquare({\n\t\t\t\t'prng': opts.prng\n\t\t\t});\n\t\t} else {\n\t\t\trchisq = chisquare( v, {\n\t\t\t\t'prng': opts.prng\n\t\t\t});\n\t\t}\n\t} else {\n\t\tif ( opts.state ) {\n\t\t\tSTATE = opts.state;\n\t\t} else {\n\t\t\tSTATE = rnorm.state;\n\t\t\trnorm.state = STATE; // updates the underlying PRNG to point to a shared state\n\t\t}\n\t\tif ( v === void 0 ) {\n\t\t\trchisq = chisquare({\n\t\t\t\t'state': STATE,\n\t\t\t\t'copy': false\n\t\t\t});\n\t\t} else {\n\t\t\trchisq = chisquare( v, {\n\t\t\t\t'state': STATE,\n\t\t\t\t'copy': false\n\t\t\t});\n\t\t}\n\t}\n\tif ( v === void 0 ) {\n\t\tprng = t2;\n\t} else {\n\t\tprng = t1;\n\t}\n\trand = rnorm.PRNG;\n\n\tsetReadOnly( prng, 'NAME', 't' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t}\n\tsetReadOnly( prng, 'PRNG', rand );\n\treturn prng;\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\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\tif ( !isUint32Array( s ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a Uint32Array. Value: `%s`.', s ) );\n\t\t}\n\t\tif ( FLG ) {\n\t\t\ts = gcopy( s.length, s, 1, new Uint32Array( s.length ), 1 );\n\t\t}\n\t\trand.state = s;\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 = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( v === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ v ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Student's t-distribution with bound degrees of freedom `v`.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = t1();\n\t* // returns \n\t*/\n\tfunction t1() {\n\t\treturn rnorm() / sqrt( rchisq() / v );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Student's t-distribution with degrees of freedom `v`.\n\t*\n\t* @private\n\t* @param {PositiveNumber} v - degrees of freedom\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = t2( 3.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = t2( 0.0 );\n\t* // returns NaN\n\t*\n\t* @example\n\t* var v = t2( -1.5 );\n\t* // returns NaN\n\t*/\n\tfunction t2( v ) {\n\t\tif (\n\t\t\tisnan( v ) ||\n\t\t\tv <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn rnorm() / sqrt( rchisq( v ) / v );\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' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Student's t-distribution with degrees of freedom `v`.\n*\n* @name t\n* @type {PRNG}\n* @param {PositiveNumber} v - degrees of freedom\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = t( 3.0 );\n* // returns \n*\n* @example\n* var v = t( 0.0 );\n* // returns NaN\n*\n* @example\n* var v = t( NaN );\n* // returns NaN\n*/\nvar t = factory();\n\n\n// EXPORTS //\n\nmodule.exports = t;\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* Student's t-distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/t\n*\n* @example\n* var t = require( '@stdlib/random/base/t' );\n*\n* var v = t( 2.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/t' ).factory;\n* var t = factory( 3.0, {\n* 'seed': 297\n* });\n*\n* var v = t();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/t' ).factory;\n* var t = factory({\n* 'seed': 297\n* });\n*\n* var v = t( 2.0 );\n* // returns \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", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 unaryFactory = require( './../../../array/tools/unary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/t' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a Student's t-distribution.\n*\n* @name factory\n* @type {Function}\n* @param {PositiveNumber} [v] - degrees of freedom\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `v` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var t = factory( 2.0 );\n* // returns \n*\n* var arr = t( 10 );\n* // returns \n*\n* @example\n* var t = factory( 2.0 );\n* // returns \n*\n* var arr = t( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = unaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a Student's t-distribution.\n*\n* @name t\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {PositiveNumber} v - degrees of freedom\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = t( 10, 2.0 );\n* // returns \n*\n* @example\n* var arr = t( 10, 2.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar t = factory();\n\n\n// EXPORTS //\n\nmodule.exports = t;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create an array containing pseudorandom numbers drawn from a Student's t-distribution.\n*\n* @module @stdlib/random/array/t\n*\n* @example\n* var t = require( '@stdlib/random/array/t' );\n*\n* var arr = t( 10, 2.0 );\n* // returns \n*\n* @example\n* var t = require( '@stdlib/random/array/t' );\n*\n* var arr = t( 10, 2.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var t = require( '@stdlib/random/array/t' );\n*\n* var rand = t.factory( 2.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var t = require( '@stdlib/random/array/t' );\n*\n* var rand = t.factory( 2.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\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 isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar isnan = require( '@stdlib/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {number} c - mode\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0, 1.3 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( a, b, c ) {\n\tif ( !isNumber( a ) || isnan( a ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', a ) );\n\t}\n\tif ( !isNumber( b ) || isnan( b ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a number and not NaN. Value: `%s`.', b ) );\n\t}\n\tif ( !isNumber( c ) || isnan( c ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Third argument must be a number and not NaN. Value: `%s`.', c ) );\n\t}\n\tif ( !(a <= c && c <= b) ) {\n\t\treturn new RangeError( format( 'invalid arguments. Parameters must satisfy the following condition: %s. a: `%f`. b: `%f`. c: `%f`.', 'a <= c <= b', a, b, c ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 sqrt = require( '@stdlib/math/base/special/sqrt' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a triangular distribution with minimum support `a`, maximum support `b` and mode `c`.\n*\n* @private\n* @param {PRNG} rand - PRNG for generating uniformly distributed numbers\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {number} c - mode\n* @returns {number} pseudorandom number\n*/\nfunction triangular( rand, a, b, c ) {\n\tvar fc;\n\tvar x;\n\tvar u;\n\tfc = (c - a) / (b - a);\n\tu = rand();\n\tif ( u < fc ) {\n\t\tx = (b - a) * (c - a);\n\t\treturn a + sqrt( x * u );\n\t}\n\tx = (b - a) * (b - c);\n\treturn b - sqrt( x * (1.0 - u) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = triangular;\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 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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar triangular0 = require( './triangular.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating random numbers drawn from a triangular distribution.\n*\n* @param {number} [a] - minimum support\n* @param {number} [b] - maximum support\n* @param {number} [c] - mode\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {TypeError} `c` must be a number\n* @throws {RangeError} arguments must satisfy `a <= c <= b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var triangular = factory( 0.0, 1.0, 0.8 );\n*\n* var v = triangular();\n* // returns \n*\n* @example\n* var triangular = factory( -3.0, -1.0, -2.0, {\n* 'seed': 297\n* });\n* var v = triangular();\n* // returns \n*/\nfunction factory() {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar a;\n\tvar b;\n\tvar c;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\ta = arguments[ 0 ];\n\t\tb = arguments[ 1 ];\n\t\tc = arguments[ 2 ];\n\t\terr = validate( a, b, c );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 3 ) {\n\t\t\topts = arguments[ 3 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( a === void 0 ) {\n\t\tprng = triangular2;\n\t} else {\n\t\tprng = triangular1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'triangular' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\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 = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( a === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ a, b, c ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a triangular distribution with bound parameters.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = triangular1();\n\t* // returns \n\t*/\n\tfunction triangular1() {\n\t\treturn triangular0( rand, a, b, c );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a triangular distribution with minimum support `a`, maximum support `b`, and mode `c`.\n\t*\n\t* @private\n\t* @param {number} a - minimum support\n\t* @param {number} b - maximum support\n\t* @param {number} c - mode\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = triangular2( 0.0, 1.0, 0.5 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = triangular2( 1.0, 0.0, 0.5 );\n\t* // returns NaN\n\t*\n\t* @example\n\t* var v = triangular2( 1.0, 2.0, NaN );\n\t* // returns NaN\n\t*/\n\tfunction triangular2( a, b, c ) {\n\t\tif (\n\t\t\tisnan( a ) ||\n\t\t\tisnan( b ) ||\n\t\t\tisnan( c ) ||\n\t\t\t!(a <= c && c <= b)\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn triangular0( rand, a, b, c );\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' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a triangular distribution with minimum support `a`, maximum support `b`, and mode `c`.\n*\n* @name triangular\n* @type {PRNG}\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {number} c - mode\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = triangular( 0.0, 1.0, 0.5 );\n* // returns \n*/\nvar triangular = factory();\n\n\n// EXPORTS //\n\nmodule.exports = triangular;\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* Triangular distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/triangular\n*\n* @example\n* var triangular = require( '@stdlib/random/base/triangular' );\n*\n* var v = triangular( 0.0, 10.0, 7.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/triangular' ).factory;\n* var triangular = factory( -5.0, 5.0, 3.0, {\n* 'seed': 297\n* });\n*\n* var v = triangular();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/triangular' ).factory;\n* var triangular = factory({\n* 'seed': 297\n* });\n*\n* var v = triangular( -5.0, 5.0, 3.0 );\n* // returns \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", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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 ternaryFactory = require( './../../../array/tools/ternary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/triangular' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a triangular distribution.\n*\n* @name factory\n* @type {Function}\n* @param {number} [a] - minimum support\n* @param {number} [b] - maximum support\n* @param {number} [c] - mode\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {TypeError} `c` must be a number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var triangular = factory( 2.0, 5.0, 3.0 );\n* // returns \n*\n* var arr = triangular( 10 );\n* // returns \n*\n* @example\n* var triangular = factory( 2.0, 5.0, 3.0 );\n* // returns \n*\n* var arr = triangular( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = ternaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a triangular distribution.\n*\n* @name triangular\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {number} c - mode\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = triangular( 10, 2.0, 5.0, 3.0 );\n* // returns \n*\n* @example\n* var arr = triangular( 10, 2.0, 5.0, 3.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar triangular = factory();\n\n\n// EXPORTS //\n\nmodule.exports = triangular;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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* Create an array containing pseudorandom numbers drawn from a triangular distribution.\n*\n* @module @stdlib/random/array/triangular\n*\n* @example\n* var triangular = require( '@stdlib/random/array/triangular' );\n*\n* var arr = triangular( 10, 2.0, 5.0, 3.0 );\n* // returns \n*\n* @example\n* var triangular = require( '@stdlib/random/array/triangular' );\n*\n* var arr = triangular( 10, 2.0, 5.0, 3.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var triangular = require( '@stdlib/random/array/triangular' );\n*\n* var rand = triangular.factory( 2.0, 5.0, 3.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var triangular = require( '@stdlib/random/array/triangular' );\n*\n* var rand = triangular.factory( 2.0, 5.0, 3.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\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 isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar isnan = require( '@stdlib/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Validates values provided for minimum and maximum support.\n*\n* @private\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( a, b ) {\n\tif ( !isNumber( a ) || isnan( a ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', a ) );\n\t}\n\tif ( !isNumber( b ) || isnan( b ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a number and not NaN. Value: `%s`.', b ) );\n\t}\n\tif ( a >= b ) {\n\t\treturn new RangeError( format( 'invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.', a, b ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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* Returns a uniformly distributed pseudorandom number with minimum support `a` and maximum support `b`.\n*\n* @private\n* @param {PRNG} rand - pseudorandom number generator\n* @param {number} a - minimum support (inclusive)\n* @param {number} b - maximum support (exclusive)\n* @returns {number} pseudorandom number\n*/\nfunction uniform( rand, a, b ) {\n\tvar r = rand();\n\treturn ( b*r ) + ( (1.0-r)*a ); // equivalent to (b-a)*r + a\n}\n\n\n// EXPORTS //\n\nmodule.exports = uniform;\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 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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar uniform0 = require( './uniform.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating uniformly distributed random numbers.\n*\n* @param {number} [a] - minimum support (inclusive)\n* @param {number} [b] - maximum support (exclusive)\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {RangeError} `a` must be less than `b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var uniform = factory( 0.0, 1.0 );\n*\n* var v = uniform();\n* // returns \n*\n* @example\n* var uniform = factory( -3.0, -1.0, {\n* 'seed': 297\n* });\n* var v = uniform();\n* // returns \n*/\nfunction factory() {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar a;\n\tvar b;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\ta = arguments[ 0 ];\n\t\tb = arguments[ 1 ];\n\t\terr = validate( a, b );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( a === void 0 ) {\n\t\tprng = uniform2;\n\t} else {\n\t\tprng = uniform1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'uniform' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\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 = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( a === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ a, b ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a uniformly distributed pseudorandom number with minimum support `a` and maximum support `b`.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = uniform1();\n\t* // returns \n\t*/\n\tfunction uniform1() {\n\t\treturn uniform0( rand, a, b );\n\t}\n\n\t/**\n\t* Returns a uniformly distributed pseudorandom number with minimum support `a` and maximum support `b`.\n\t*\n\t* @private\n\t* @param {number} a - minimum support (inclusive)\n\t* @param {number} b - maximum support (exclusive)\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = uniform2( 0.0, 1.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = uniform2( 1.0, 0.0 );\n\t* // returns NaN\n\t*/\n\tfunction uniform2( a, b ) {\n\t\tif (\n\t\t\tisnan( a ) ||\n\t\t\tisnan( b ) ||\n\t\t\ta >= b\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn uniform0( rand, a, b );\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' );\n\n\n// MAIN //\n\n/**\n* Returns a uniformly distributed pseudorandom number with minimum support `a` and maximum support `b`.\n*\n* @name uniform\n* @type {PRNG}\n* @param {number} a - minimum support (inclusive)\n* @param {number} b - maximum support (exclusive)\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = uniform( 0.0, 1.0 );\n* // returns \n*/\nvar uniform = factory();\n\n\n// EXPORTS //\n\nmodule.exports = uniform;\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* Uniform distribution pseudorandom numbers.\n*\n* @module @stdlib/random/base/uniform\n*\n* @example\n* var uniform = require( '@stdlib/random/base/uniform' );\n*\n* var v = uniform( 0.0, 1.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/uniform' ).factory;\n* var uniform = factory( -5.0, 5.0, {\n* 'seed': 297\n* });\n*\n* var v = uniform();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/uniform' ).factory;\n* var uniform = factory({\n* 'seed': 297\n* });\n*\n* var v = uniform( -5.0, 5.0 );\n* // returns \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", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 binaryFactory = require( './../../../array/tools/binary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/uniform' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a continuous uniform distribution.\n*\n* @name factory\n* @type {Function}\n* @param {number} [a] - minimum support\n* @param {number} [b] - maximum support\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var uniform = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = uniform( 10 );\n* // returns \n*\n* @example\n* var uniform = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = uniform( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = binaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a continuous uniform distribution.\n*\n* @name uniform\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = uniform( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = uniform( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar uniform = factory();\n\n\n// EXPORTS //\n\nmodule.exports = uniform;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create an array containing pseudorandom numbers drawn from a continuous uniform distribution.\n*\n* @module @stdlib/random/array/uniform\n*\n* @example\n* var uniform = require( '@stdlib/random/array/uniform' );\n*\n* var arr = uniform( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var uniform = require( '@stdlib/random/array/uniform' );\n*\n* var arr = uniform( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var uniform = require( '@stdlib/random/array/uniform' );\n*\n* var rand = uniform.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var uniform = require( '@stdlib/random/array/uniform' );\n*\n* var rand = uniform.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\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 isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {PositiveNumber} k - scale parameter\n* @param {PositiveNumber} lambda - shape parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( k, lambda ) {\n\tif ( !isPositive( k ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Scale parameter must be a positive number. Value: `%s`.', k ) );\n\t}\n\tif ( !isPositive( lambda ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Shape parameter must be a positive number. Value: `%s`.', lambda ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 pow = require( '@stdlib/math/base/special/pow' );\nvar ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Weibull distribution.\n*\n* @private\n* @param {PRNG} rand - PRNG for generating uniformly distributed numbers\n* @param {PositiveNumber} k - scale parameter\n* @param {PositiveNumber} lambda - shape parameter\n* @returns {NonNegativeNumber} pseudorandom number\n*/\nfunction weibull( rand, k, lambda ) {\n\treturn lambda * pow( -ln( 1.0-rand() ), 1.0/k );\n}\n\n\n// EXPORTS //\n\nmodule.exports = weibull;\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 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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar weibull0 = require( './weibull.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating Weibull distributed random numbers.\n*\n* @param {PositiveNumber} [k] - scale parameter\n* @param {PositiveNumber} [lambda] - shape parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} `k` must be a positive number\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var weibull = factory( 2.0, 1.0 );\n*\n* var v = weibull();\n* // returns \n*\n* @example\n* var weibull = factory( 2.0, 2.0, {\n* 'seed': 297\n* });\n* var v = weibull();\n* // returns \n*/\nfunction factory() {\n\tvar lambda;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar k;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tk = arguments[ 0 ];\n\t\tlambda = arguments[ 1 ];\n\t\terr = validate( lambda, k );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( lambda === void 0 ) {\n\t\tprng = weibull2;\n\t} else {\n\t\tprng = weibull1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'weibull' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\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 = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( k === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ k, lambda ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Weibull distribution.\n\t*\n\t* @private\n\t* @returns {NonNegativeNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = weibull1();\n\t* // returns \n\t*/\n\tfunction weibull1() {\n\t\treturn weibull0( rand, k, lambda );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Weibull distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} k - scale parameter\n\t* @param {PositiveNumber} lambda - shape parameter\n\t* @returns {NonNegativeNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = weibull2( 2.0, 1.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = weibull2( 3.0, 0.0 );\n\t* // returns NaN\n\t*\n\t* @example\n\t* var v = weibull2( 0.0, 2.0 );\n\t* // returns NaN\n\t*\n\t* @example\n\t* var v = weibull2( NaN, NaN );\n\t* // returns NaN\n\t*/\n\tfunction weibull2( k, lambda ) {\n\t\tif (\n\t\t\tisnan( k ) ||\n\t\t\tisnan( lambda ) ||\n\t\t\tk <= 0.0 ||\n\t\t\tlambda <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn weibull0( rand, k, lambda );\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' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Weibull distribution.\n*\n* @name weibull\n* @type {PRNG}\n* @param {PositiveNumber} k - scale parameter\n* @param {PositiveNumber} lambda - shape parameter\n* @returns {NonNegativeNumber} pseudorandom number\n*\n* @example\n* var v = weibull( 2.0, 3.0 );\n* // returns \n*\n* @example\n* var v = weibull( -2.0, 3.0 );\n* // returns NaN\n*/\nvar weibull = factory();\n\n\n// EXPORTS //\n\nmodule.exports = weibull;\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* Weibull distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/weibull\n*\n* @example\n* var weibull = require( '@stdlib/random/base/weibull' );\n*\n* var v = weibull( 2.0, 3.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/weibull' ).factory;\n* var weibull = factory( 2.0, 3.0, {\n* 'seed': 297\n* });\n*\n* var v = weibull();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/weibull' ).factory;\n* var weibull = factory({\n* 'seed': 297\n* });\n*\n* var v = weibull( 2.0, 3.0 );\n* // returns \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", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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 binaryFactory = require( './../../../array/tools/binary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/weibull' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a Weibull distribution.\n*\n* @name factory\n* @type {Function}\n* @param {PositiveNumber} [k] - scale parameter\n* @param {PositiveNumber} [lambda] - shape parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `k` must be a positive number\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var weibull = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = weibull( 10 );\n* // returns \n*\n* @example\n* var weibull = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = weibull( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = binaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a Weibull distribution.\n*\n* @name weibull\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {PositiveNumber} k - scale parameter\n* @param {PositiveNumber} lambda - shape parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = weibull( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = weibull( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar weibull = factory();\n\n\n// EXPORTS //\n\nmodule.exports = weibull;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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* Create an array containing pseudorandom numbers drawn from a Weibull distribution.\n*\n* @module @stdlib/random/array/weibull\n*\n* @example\n* var weibull = require( '@stdlib/random/array/weibull' );\n*\n* var arr = weibull( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var weibull = require( '@stdlib/random/array/weibull' );\n*\n* var arr = weibull( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var weibull = require( '@stdlib/random/array/weibull' );\n*\n* var rand = weibull.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var weibull = require( '@stdlib/random/array/weibull' );\n*\n* var rand = weibull.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-read-only-property' );\n\n\n// MAIN //\n\n/**\n* Top-level namespace.\n*\n* @namespace ns\n*/\nvar ns = {};\n\n/**\n* @name arcsine\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/arcsine}\n*/\nsetReadOnly( ns, 'arcsine', require( './../../array/arcsine' ) );\n\n/**\n* @name bernoulli\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/bernoulli}\n*/\nsetReadOnly( ns, 'bernoulli', require( './../../array/bernoulli' ) );\n\n/**\n* @name beta\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/beta}\n*/\nsetReadOnly( ns, 'beta', require( './../../array/beta' ) );\n\n/**\n* @name betaprime\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/betaprime}\n*/\nsetReadOnly( ns, 'betaprime', require( './../../array/betaprime' ) );\n\n/**\n* @name binomial\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/binomial}\n*/\nsetReadOnly( ns, 'binomial', require( './../../array/binomial' ) );\n\n/**\n* @name cauchy\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/cauchy}\n*/\nsetReadOnly( ns, 'cauchy', require( './../../array/cauchy' ) );\n\n/**\n* @name chi\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/chi}\n*/\nsetReadOnly( ns, 'chi', require( './../../array/chi' ) );\n\n/**\n* @name chisquare\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/chisquare}\n*/\nsetReadOnly( ns, 'chisquare', require( './../../array/chisquare' ) );\n\n/**\n* @name cosine\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/cosine}\n*/\nsetReadOnly( ns, 'cosine', require( './../../array/cosine' ) );\n\n/**\n* @name discreteUniform\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/discrete-uniform}\n*/\nsetReadOnly( ns, 'discreteUniform', require( './../../array/discrete-uniform' ) );\n\n/**\n* @name erlang\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/erlang}\n*/\nsetReadOnly( ns, 'erlang', require( './../../array/erlang' ) );\n\n/**\n* @name exponential\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/exponential}\n*/\nsetReadOnly( ns, 'exponential', require( './../../array/exponential' ) );\n\n/**\n* @name f\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/f}\n*/\nsetReadOnly( ns, 'f', require( './../../array/f' ) );\n\n/**\n* @name frechet\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/frechet}\n*/\nsetReadOnly( ns, 'frechet', require( './../../array/frechet' ) );\n\n/**\n* @name gamma\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/gamma}\n*/\nsetReadOnly( ns, 'gamma', require( './../../array/gamma' ) );\n\n/**\n* @name geometric\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/geometric}\n*/\nsetReadOnly( ns, 'geometric', require( './../../array/geometric' ) );\n\n/**\n* @name gumbel\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/gumbel}\n*/\nsetReadOnly( ns, 'gumbel', require( './../../array/gumbel' ) );\n\n/**\n* @name hypergeometric\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/hypergeometric}\n*/\nsetReadOnly( ns, 'hypergeometric', require( './../../array/hypergeometric' ) );\n\n/**\n* @name invgamma\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/invgamma}\n*/\nsetReadOnly( ns, 'invgamma', require( './../../array/invgamma' ) );\n\n/**\n* @name kumaraswamy\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/kumaraswamy}\n*/\nsetReadOnly( ns, 'kumaraswamy', require( './../../array/kumaraswamy' ) );\n\n/**\n* @name laplace\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/laplace}\n*/\nsetReadOnly( ns, 'laplace', require( './../../array/laplace' ) );\n\n/**\n* @name levy\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/levy}\n*/\nsetReadOnly( ns, 'levy', require( './../../array/levy' ) );\n\n/**\n* @name logistic\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/logistic}\n*/\nsetReadOnly( ns, 'logistic', require( './../../array/logistic' ) );\n\n/**\n* @name lognormal\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/lognormal}\n*/\nsetReadOnly( ns, 'lognormal', require( './../../array/lognormal' ) );\n\n/**\n* @name minstd\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/minstd}\n*/\nsetReadOnly( ns, 'minstd', require( './../../array/minstd' ) );\n\n/**\n* @name minstdShuffle\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/minstd-shuffle}\n*/\nsetReadOnly( ns, 'minstdShuffle', require( './../../array/minstd-shuffle' ) );\n\n/**\n* @name mt19937\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/mt19937}\n*/\nsetReadOnly( ns, 'mt19937', require( './../../array/mt19937' ) );\n\n/**\n* @name negativeBinomial\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/negative-binomial}\n*/\nsetReadOnly( ns, 'negativeBinomial', require( './../../array/negative-binomial' ) );\n\n/**\n* @name normal\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/normal}\n*/\nsetReadOnly( ns, 'normal', require( './../../array/normal' ) );\n\n/**\n* @name pareto1\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/pareto-type1}\n*/\nsetReadOnly( ns, 'pareto1', require( './../../array/pareto-type1' ) );\n\n/**\n* @name poisson\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/poisson}\n*/\nsetReadOnly( ns, 'poisson', require( './../../array/poisson' ) );\n\n/**\n* @name randu\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/randu}\n*/\nsetReadOnly( ns, 'randu', require( './../../array/randu' ) );\n\n/**\n* @name rayleigh\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/rayleigh}\n*/\nsetReadOnly( ns, 'rayleigh', require( './../../array/rayleigh' ) );\n\n/**\n* @name t\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/t}\n*/\nsetReadOnly( ns, 't', require( './../../array/t' ) );\n\n/**\n* @name triangular\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/triangular}\n*/\nsetReadOnly( ns, 'triangular', require( './../../array/triangular' ) );\n\n/**\n* @name uniform\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/uniform}\n*/\nsetReadOnly( ns, 'uniform', require( './../../array/uniform' ) );\n\n/**\n* @name weibull\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/weibull}\n*/\nsetReadOnly( ns, 'weibull', require( './../../array/weibull' ) );\n\n\n// EXPORTS //\n\nmodule.exports = ns;\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 sqrt = require( '@stdlib/math/base/special/sqrt' );\nvar ln = require( '@stdlib/math/base/special/ln' );\nvar sin = require( '@stdlib/math/base/special/sin' );\nvar cos = require( '@stdlib/math/base/special/cos' );\nvar TWO_PI = require( '@stdlib/constants/float64/two-pi' );\n\n\n// MAIN //\n\n/**\n* Returns a function for generating standard normally distributed pseudorandom numbers using the Box-Muller algorithm.\n*\n* @private\n* @param {PRNG} rand - PRNG which returns standard uniformly distributed numbers\n* @returns {PRNG} PRNG\n*/\nfunction wrap( rand ) {\n\tvar flg;\n\tvar r;\n\n\t// Flag indicating whether to generate new normal random variates or return a cached normal random variate:\n\tflg = true;\n\n\treturn randn;\n\n\t/**\n\t* Generates a standard normally distributed pseudorandom number.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var r = randn();\n\t* // returns \n\t*/\n\tfunction randn() {\n\t\tvar u1;\n\t\tvar u2;\n\t\tvar a;\n\t\tvar b;\n\t\tif ( flg ) {\n\t\t\t// Note: if `u1` is `0`, the natural log blows up, so we keep trying until we get a non-zero rand. Rarely should we need more than one iteration.\n\t\t\tdo {\n\t\t\t\tu1 = rand();\n\t\t\t\tu2 = rand();\n\t\t\t} while (\n\t\t\t\tu1 === 0.0\n\t\t\t);\n\t\t\ta = sqrt( -2.0 * ln(u1) );\n\t\t\tb = TWO_PI * u2;\n\t\t\tr = a * cos( b ); // cache for next call\n\t\t\tflg = false;\n\t\t\treturn a * sin( b );\n\t\t}\n\t\tflg = true;\n\t\treturn r;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = wrap;\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 sqrt = require( '@stdlib/math/base/special/sqrt' );\nvar ln = require( '@stdlib/math/base/special/ln' );\nvar cos = require( '@stdlib/math/base/special/cos' );\nvar PI = require( '@stdlib/constants/float64/pi' );\n\n\n// VARIABLES //\n\nvar COS_PI = cos( PI ); // -1\n\n\n// MAIN //\n\n/**\n* Returns the minimum possible normally distributed pseudorandom number.\n*\n* @private\n* @param {number} min - minimum possible uniformly distributed pseudorandom number\n* @returns {number} minimum possible number\n*/\nfunction getMin( min ) {\n\tvar a = sqrt( -2.0 * ln( min ) );\n\treturn a * COS_PI;\n}\n\n\n// EXPORTS //\n\nmodule.exports = getMin;\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 sqrt = require( '@stdlib/math/base/special/sqrt' );\nvar ln = require( '@stdlib/math/base/special/ln' );\nvar cos = require( '@stdlib/math/base/special/cos' );\nvar TWO_PI = require( '@stdlib/constants/float64/two-pi' );\n\n\n// MAIN //\n\n/**\n* Returns the maximum possible normally distributed pseudorandom number.\n*\n* @private\n* @param {number} min - minimum possible uniformly distributed pseudorandom number\n* @returns {number} maximum possible number\n*/\nfunction getMax( min ) {\n\tvar a = sqrt( -2.0 * ln( min ) );\n\tvar b = TWO_PI * min;\n\treturn a * cos( b );\n}\n\n\n// EXPORTS //\n\nmodule.exports = getMax;\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 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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isUint32Array = require( '@stdlib/assert/is-uint32array' );\nvar mt19937 = require( './../../../base/mt19937' ).factory;\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar randn0 = require( './randn.js' );\nvar getMin = require( './min.js' );\nvar getMax = require( './max.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator which implements the Box-Muller transform to generate standard normally distributed pseudorandom numbers.\n*\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} must provide an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var randn = factory();\n*\n* var r = randn();\n* // returns \n*\n* @example\n* // Return a seeded PRNG:\n* var randn = factory({\n* 'seed': 12345\n* });\n*\n* var r = randn();\n* // returns \n*/\nfunction factory( options ) {\n\tvar randu;\n\tvar randn;\n\tvar rand;\n\tvar opts;\n\n\topts = {\n\t\t'copy': true\n\t};\n\tif ( arguments.length ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide 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, 'prng' ) ) {\n\t\t\tif ( !isFunction( options.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', options.prng ) );\n\t\t\t}\n\t\t\trandu = options.prng;\n\t\t}\n\t\t// If provided a PRNG, ignore the `state` option, as we don't support getting or setting PRNG state.\n\t\telse if ( hasOwnProp( options, 'state' ) ) {\n\t\t\topts.state = options.state;\n\t\t\tif ( !isUint32Array( options.state ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a Uint32Array. Option: `%s`.', 'state', options.state ) );\n\t\t\t}\n\t\t}\n\t\t// If provided a PRNG, ignore the `seed` option, as a `seed`, by itself, is insufficient to guarantee reproducibility. If provided a state, ignore the `seed` option, as a PRNG state should contain seed information.\n\t\telse if ( hasOwnProp( options, 'seed' ) ) {\n\t\t\topts.seed = options.seed;\n\t\t\tif ( options.seed === void 0 ) {\n\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', options.seed ) );\n\t\t\t}\n\t\t}\n\t}\n\tif ( opts.state === void 0 ) {\n\t\tif ( randu === void 0 ) {\n\t\t\trand = mt19937( opts );\n\t\t\trandu = rand.normalized;\n\t\t} else {\n\t\t\topts.seed = null;\n\t\t}\n\t} else {\n\t\trand = mt19937( opts );\n\t\trandu = rand.normalized;\n\t}\n\trandn = randn0( randu );\n\n\tsetReadOnly( randn, 'NAME', 'box-muller' );\n\tif ( opts.seed === null ) {\n\t\tsetReadOnly( randn, 'seed', null );\n\t\tsetReadOnly( randn, 'seedLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( randn, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( randn, 'seedLength', getSeedLength );\n\t}\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( options && options.prng ) {\n\t\tsetReadWriteAccessor( randn, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( randn, 'stateLength', null );\n\t\tsetReadOnly( randn, 'byteLength', null );\n\t\tsetReadOnly( randn, 'toJSON', constantFunction( null ) );\n\t} else {\n\t\tsetReadWriteAccessor( randn, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( randn, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( randn, 'byteLength', getStateSize );\n\t\tsetReadOnly( randn, 'toJSON', toJSON );\n\t}\n\tsetReadOnly( randn, 'PRNG', randu );\n\n\tif ( hasOwnProp( randu, 'MIN' ) ) {\n\t\tsetReadOnly( randn, 'MIN', getMin( randu.MIN ) );\n\t\tsetReadOnly( randn, 'MAX', getMax( randu.MIN ) );\n\t} else {\n\t\tsetReadOnly( randn, 'MIN', null );\n\t\tsetReadOnly( randn, 'MAX', null );\n\t}\n\n\treturn randn;\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\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 = randn.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tout.params = [];\n\t\treturn out;\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' );\n\n\n// MAIN //\n\n/**\n* Generates a standard normally distributed random number.\n*\n* ## Method\n*\n* - Given two independent uniformly distributed random variables \\\\( U_1 \\\\) and \\\\( U_2 \\\\) in the interval \\\\( [0,1) \\\\), let\n*\n* ``` tex\n* \\begin{align*}\n* Z_1 &= R \\cos(\\theta) = \\sqrt{-2 \\ln(U_1)} \\cos(2\\pi U_2) \\\\\n* Z_2 &= R \\sin(\\theta) = \\sqrt{-2 \\ln(U_1)} \\sin(2\\pi U_2)\n* \\end{align*}\n* ```\n*\n* where \\\\( Z_1 \\\\) and \\\\( Z_2 \\\\) are independent random variables with a standard normal distribution.\n*\n* - As two uniform random variates are mapped to two standard normal random variates, one of the random variates is cached and returned upon the following invocation.\n*\n* ## Notes\n*\n* - The minimum and maximum pseudorandom numbers which can be generated are dependent on the number of bits an underlying uniform pseudorandom number generator (PRNG) uses. For instance, if a PRNG uses \\\\( 32 \\\\) bits, the smallest non-zero number that can be generated is \\\\( 2^{-32}). When \\\\( U_1 \\\\) equals this value and \\\\( U_2 \\\\) equals \\\\( 0 \\\\),\n*\n* ``` tex\n* r = \\sqrt{-2\\ln(2^{-32})} \\cos(2\\pi) \\approx 6.66\n* ```\n*\n* which means that the algorithm cannot produce random variates more than \\\\( 6.66 \\\\) standard deviations from the mean.\n*\n* \n*\n* This corresponds to a \\\\( 2.74 \\times 10^{-11} \\\\) loss due to tail truncation.\n*\n* \n*\n* ## References\n*\n* - Box, G. E. P., and Mervin E. Muller. 1958. \"A Note on the Generation of Random Normal Deviates.\" _The Annals of Mathematical Statistics_ 29 (2). The Institute of Mathematical Statistics: 610\u201311. doi:[10.1214/aoms/1177706645](http://dx.doi.org/10.1214/aoms/1177706645).\n* - Bell, James R. 1968. \"Algorithm 334: Normal Random Deviates.\" _Communications of the ACM_ 11 (7). New York, NY, USA: ACM: 498. doi:[10.1145/363397.363547](http://dx.doi.org/10.1145/363397.363547).\n* - Knop, R. 1969. \"Remark on Algorithm 334 \\[G5]: Normal Random Deviates.\" _Communications of the ACM_ 12 (5). New York, NY, USA: ACM: 281. doi:[10.1145/362946.362996](http://dx.doi.org/10.1145/362946.362996).\n* - Marsaglia, G., and T. A. Bray. 1964. \"A Convenient Method for Generating Normal Variables.\" _SIAM Review_ 6 (3). Society for Industrial; Applied Mathematics: 260\u201364. doi:[10.1137/1006063](http://dx.doi.org/10.1137/1006063).\n* - Thomas, David B., Wayne Luk, Philip H.W. Leong, and John D. Villasenor. 2007. \"Gaussian Random Number Generators.\" _ACM Computing Surveys_ 39 (4). New York, NY, USA: ACM. doi:[10.1145/1287620.1287622](http://dx.doi.org/10.1145/1287620.1287622).\n*\n* @name randn\n* @type {PRNG}\n* @returns {number} pseudorandom number\n*\n* @example\n* var r = randn();\n* // returns \n*/\nvar randn = factory();\n\n\n// EXPORTS //\n\nmodule.exports = randn;\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* Normally distributed pseudorandom numbers using the Box-Muller transform.\n*\n* @module @stdlib/random/base/box-muller\n*\n* @example\n* var randn = require( '@stdlib/random/base/box-muller' );\n*\n* var r = randn();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/box-muller' ).factory;\n*\n* var randn = factory({\n* 'seed': 12345\n* });\n*\n* var r = randn();\n* // returns \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", "{\n\t\"name\": \"mt19937\",\n\t\"copy\": true\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'use strict';\n\n// MODULES //\n\nvar minstd = require( './../../../base/minstd' );\nvar minstdShuffle = require( './../../../base/minstd-shuffle' );\nvar mt19937 = require( './../../../base/mt19937' );\n\n\n// MAIN //\n\nvar prngs = {};\n\nprngs[ 'minstd' ] = minstd;\nprngs[ 'minstd-shuffle' ] = minstdShuffle;\nprngs[ 'mt19937' ] = mt19937;\n\n\n// EXPORTS //\n\nmodule.exports = prngs;\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 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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar defaults = require( './defaults.json' );\nvar PRNGS = require( './prngs.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating random numbers having integer values.\n*\n* @param {Options} [options] - function options\n* @param {string} [options.name='mt19937'] - name of pseudorandom number generator\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [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} must provide an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide the name of a supported pseudorandom number generator\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var randi = factory();\n* var v = randi();\n* // returns \n*\n* @example\n* var randi = factory({\n* 'name': 'minstd'\n* });\n* var v = randi();\n* // returns \n*\n* @example\n* var randi = factory({\n* 'seed': 12345\n* });\n* var v = randi();\n* // returns \n*\n* @example\n* var randi = factory({\n* 'name': 'minstd',\n* 'seed': 12345\n* });\n* var v = randi();\n* // returns \n*/\nfunction factory( options ) {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\n\topts = {\n\t\t'name': defaults.name,\n\t\t'copy': defaults.copy\n\t};\n\tif ( arguments.length ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide an object. Value: `%s`.', options ) );\n\t\t}\n\t\tif ( hasOwnProp( options, 'name' ) ) {\n\t\t\topts.name = options.name;\n\t\t}\n\t\tif ( hasOwnProp( options, 'state' ) ) {\n\t\t\topts.state = options.state;\n\t\t\tif ( opts.state === void 0 ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option cannot be undefined. Option: `%s`.', 'state', opts.state ) );\n\t\t\t}\n\t\t} else if ( hasOwnProp( options, 'seed' ) ) {\n\t\t\topts.seed = options.seed;\n\t\t\tif ( opts.seed === void 0 ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option cannot be undefined. Option: `%s`.', 'seed', opts.seed ) );\n\t\t\t}\n\t\t}\n\t\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\t\topts.copy = options.copy;\n\t\t\tif ( !isBoolean( opts.copy ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', opts.copy ) );\n\t\t\t}\n\t\t}\n\t}\n\tprng = PRNGS[ opts.name ];\n\tif ( prng === void 0 ) {\n\t\tthrow new Error( format( 'invalid option. Unrecognized/unsupported PRNG. Option: `%s`.', opts.name ) );\n\t}\n\tif ( opts.state === void 0 ) {\n\t\tif ( opts.seed === void 0 ) {\n\t\t\trand = prng.factory();\n\t\t} else {\n\t\t\trand = prng.factory({\n\t\t\t\t'seed': opts.seed\n\t\t\t});\n\t\t}\n\t} else {\n\t\trand = prng.factory({\n\t\t\t'state': opts.state,\n\t\t\t'copy': opts.copy\n\t\t});\n\t}\n\tsetReadOnly( randi, 'NAME', 'randi' );\n\tsetReadOnlyAccessor( randi, 'seed', getSeed );\n\tsetReadOnlyAccessor( randi, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( randi, 'state', getState, setState );\n\tsetReadOnlyAccessor( randi, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( randi, 'byteLength', getStateSize );\n\tsetReadOnly( randi, 'toJSON', toJSON );\n\tsetReadOnly( randi, 'PRNG', rand );\n\tsetReadOnly( randi, 'MIN', rand.MIN );\n\tsetReadOnly( randi, 'MAX', rand.MAX );\n\n\treturn randi;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {*} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {*} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {*} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\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 = randi.NAME + '-' + rand.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tout.params = [];\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number having an integer value.\n\t*\n\t* @private\n\t* @returns {integer} pseudorandom number\n\t*\n\t* @example\n\t* var v = randi();\n\t* // returns \n\t*/\n\tfunction randi() {\n\t\treturn rand();\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' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number having an integer value.\n*\n* @name randi\n* @type {PRNG}\n* @returns {integer} pseudorandom number\n*\n* @example\n* var v = randi();\n* // returns \n*/\nvar randi = factory();\n\n\n// EXPORTS //\n\nmodule.exports = randi;\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* Pseudorandom numbers having integer values.\n*\n* @module @stdlib/random/base/randi\n*\n* @example\n* var randi = require( '@stdlib/random/base/randi' );\n*\n* var v = randi();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/randi' ).factory;\n*\n* var randi = factory({\n* 'name': 'minstd',\n* 'seed': 12345\n* });\n*\n* var v = randi();\n* // returns \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", "{\n\t\"name\": \"improved-ziggurat\",\n\t\"copy\": true\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'use strict';\n\n// MODULES //\n\nvar boxMuller = require( './../../../base/box-muller' );\nvar improvedZiggurat = require( './../../../base/improved-ziggurat' );\n\n\n// MAIN //\n\nvar prngs = {};\n\nprngs[ 'box-muller' ] = boxMuller;\nprngs[ 'improved-ziggurat' ] = improvedZiggurat;\n\n\n// EXPORTS //\n\nmodule.exports = prngs;\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 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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar format = require( '@stdlib/string/format' );\nvar noop = require( '@stdlib/utils/noop' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar defaults = require( './defaults.json' );\nvar PRNGS = require( './prngs.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for numbers from a standard normal distribution.\n*\n* @param {Options} [options] - function options\n* @param {string} [options.name='improved-ziggurat'] - name of pseudorandom number generator\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [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} must provide an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide the name of a supported pseudorandom number generator\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var randn = factory();\n*\n* var v = randn();\n* // returns \n*\n* @example\n* var randn = factory({\n* 'name': 'box-muller'\n* });\n* var v = randn();\n* // returns \n*\n* @example\n* var randn = factory({\n* 'seed': 12345\n* });\n* var v = randn();\n* // returns \n*\n* @example\n* var randn = factory({\n* 'name': 'box-muller',\n* 'seed': 12345\n* });\n* var v = randn();\n* // returns \n*/\nfunction factory( options ) {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\n\topts = {\n\t\t'name': defaults.name,\n\t\t'copy': defaults.copy\n\t};\n\tif ( arguments.length ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide an object. Value: `%s`.', options ) );\n\t\t}\n\t\tif ( hasOwnProp( options, 'name' ) ) {\n\t\t\topts.name = options.name;\n\t\t}\n\t\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\t\topts.prng = options.prng;\n\t\t\tif ( opts.prng === void 0 ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option cannot be undefined. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t} else if ( hasOwnProp( options, 'state' ) ) {\n\t\t\topts.state = options.state;\n\t\t\tif ( opts.state === void 0 ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option cannot be undefined. Option: `%s`.', 'state', opts.state ) );\n\t\t\t}\n\t\t} else if ( hasOwnProp( options, 'seed' ) ) {\n\t\t\topts.seed = options.seed;\n\t\t\tif ( opts.seed === void 0 ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option cannot be undefined. Option: `%s`.', 'seed', opts.seed ) );\n\t\t\t}\n\t\t}\n\t\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\t\topts.copy = options.copy;\n\t\t\tif ( !isBoolean( opts.copy ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', opts.copy ) );\n\t\t\t}\n\t\t}\n\t}\n\tprng = PRNGS[ opts.name ];\n\tif ( prng === void 0 ) {\n\t\tthrow new Error( format( 'invalid option. Unrecognized/unsupported PRNG. Option: `%s`.', opts.name ) );\n\t}\n\tif ( opts.prng === void 0 ) {\n\t\tif ( opts.state === void 0 ) {\n\t\t\tif ( opts.seed === void 0 ) {\n\t\t\t\trand = prng.factory();\n\t\t\t} else {\n\t\t\t\trand = prng.factory({\n\t\t\t\t\t'seed': opts.seed\n\t\t\t\t});\n\t\t\t}\n\t\t} else {\n\t\t\trand = prng.factory({\n\t\t\t\t'state': opts.state,\n\t\t\t\t'copy': opts.copy\n\t\t\t});\n\t\t}\n\t} else {\n\t\trand = prng.factory({\n\t\t\t'prng': opts.prng\n\t\t});\n\t}\n\tsetReadOnly( normal, 'NAME', 'randn' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts.prng ) {\n\t\tsetReadOnly( normal, 'seed', null );\n\t\tsetReadOnly( normal, 'seedLength', null );\n\t\tsetReadWriteAccessor( normal, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( normal, 'stateLength', null );\n\t\tsetReadOnly( normal, 'byteLength', null );\n\t\tsetReadOnly( normal, 'toJSON', constantFunction( null ) );\n\t} else {\n\t\tsetReadOnlyAccessor( normal, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( normal, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( normal, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( normal, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( normal, 'byteLength', getStateSize );\n\t\tsetReadOnly( normal, 'toJSON', toJSON );\n\t}\n\tsetReadOnly( normal, 'PRNG', rand.PRNG );\n\treturn normal;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {*} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {*} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {*} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\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 = normal.NAME + '-' + rand.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tout.params = [];\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a standard normal distribution.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = normal();\n\t* // returns \n\t*/\n\tfunction normal() {\n\t\treturn rand();\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' );\n\n\n// MAIN //\n\n/**\n* Returns a standard normal random number.\n*\n* @name normal\n* @type {PRNG}\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = normal();\n* // returns \n*/\nvar normal = factory();\n\n\n// EXPORTS //\n\nmodule.exports = normal;\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* Standard normal pseudorandom numbers.\n*\n* @module @stdlib/random/base/randn\n*\n* @example\n* var randn = require( '@stdlib/random/base/randn' );\n*\n* var v = randn();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/randn' ).factory;\n*\n* var randn = factory({\n* 'name': 'box-muller',\n* 'seed': 12345\n* });\n*\n* var v = randn();\n* // returns \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", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 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// This file is generated using `scripts/build.js`.\n\n'use strict';\n\n// MODULES //\n\nvar prng0 = require( './../../../base/arcsine' );\nvar prng1 = require( './../../../base/bernoulli' );\nvar prng2 = require( './../../../base/beta' );\nvar prng3 = require( './../../../base/betaprime' );\nvar prng4 = require( './../../../base/binomial' );\nvar prng5 = require( './../../../base/box-muller' );\nvar prng6 = require( './../../../base/cauchy' );\nvar prng7 = require( './../../../base/chi' );\nvar prng8 = require( './../../../base/chisquare' );\nvar prng9 = require( './../../../base/cosine' );\nvar prng10 = require( './../../../base/discrete-uniform' );\nvar prng11 = require( './../../../base/erlang' );\nvar prng12 = require( './../../../base/exponential' );\nvar prng13 = require( './../../../base/f' );\nvar prng14 = require( './../../../base/frechet' );\nvar prng15 = require( './../../../base/gamma' );\nvar prng16 = require( './../../../base/geometric' );\nvar prng17 = require( './../../../base/gumbel' );\nvar prng18 = require( './../../../base/hypergeometric' );\nvar prng19 = require( './../../../base/improved-ziggurat' );\nvar prng20 = require( './../../../base/invgamma' );\nvar prng21 = require( './../../../base/kumaraswamy' );\nvar prng22 = require( './../../../base/laplace' );\nvar prng23 = require( './../../../base/levy' );\nvar prng24 = require( './../../../base/logistic' );\nvar prng25 = require( './../../../base/lognormal' );\nvar prng26 = require( './../../../base/minstd' );\nvar prng27 = require( './../../../base/minstd-shuffle' );\nvar prng28 = require( './../../../base/mt19937' );\nvar prng29 = require( './../../../base/negative-binomial' );\nvar prng30 = require( './../../../base/normal' );\nvar prng31 = require( './../../../base/pareto-type1' );\nvar prng32 = require( './../../../base/poisson' );\nvar prng33 = require( './../../../base/randi' );\nvar prng34 = require( './../../../base/randn' );\nvar prng35 = require( './../../../base/randu' );\nvar prng36 = require( './../../../base/rayleigh' );\nvar prng37 = require( './../../../base/t' );\nvar prng38 = require( './../../../base/triangular' );\nvar prng39 = require( './../../../base/uniform' );\nvar prng40 = require( './../../../base/weibull' );\n\n\n// MAIN //\n\nvar prngs = {};\nprngs[ 'arcsine' ] = prng0.factory;\nprngs[ 'bernoulli' ] = prng1.factory;\nprngs[ 'beta' ] = prng2.factory;\nprngs[ 'betaprime' ] = prng3.factory;\nprngs[ 'binomial' ] = prng4.factory;\nprngs[ 'box-muller' ] = prng5.factory;\nprngs[ 'cauchy' ] = prng6.factory;\nprngs[ 'chi' ] = prng7.factory;\nprngs[ 'chisquare' ] = prng8.factory;\nprngs[ 'cosine' ] = prng9.factory;\nprngs[ 'discrete-uniform' ] = prng10.factory;\nprngs[ 'erlang' ] = prng11.factory;\nprngs[ 'exponential' ] = prng12.factory;\nprngs[ 'f' ] = prng13.factory;\nprngs[ 'frechet' ] = prng14.factory;\nprngs[ 'gamma' ] = prng15.factory;\nprngs[ 'geometric' ] = prng16.factory;\nprngs[ 'gumbel' ] = prng17.factory;\nprngs[ 'hypergeometric' ] = prng18.factory;\nprngs[ 'improved-ziggurat' ] = prng19.factory;\nprngs[ 'invgamma' ] = prng20.factory;\nprngs[ 'kumaraswamy' ] = prng21.factory;\nprngs[ 'laplace' ] = prng22.factory;\nprngs[ 'levy' ] = prng23.factory;\nprngs[ 'logistic' ] = prng24.factory;\nprngs[ 'lognormal' ] = prng25.factory;\nprngs[ 'minstd' ] = prng26.factory;\nprngs[ 'minstd-shuffle' ] = prng27.factory;\nprngs[ 'mt19937' ] = prng28.factory;\nprngs[ 'negative-binomial' ] = prng29.factory;\nprngs[ 'normal' ] = prng30.factory;\nprngs[ 'pareto-type1' ] = prng31.factory;\nprngs[ 'poisson' ] = prng32.factory;\nprngs[ 'randi' ] = prng33.factory;\nprngs[ 'randn' ] = prng34.factory;\nprngs[ 'randu' ] = prng35.factory;\nprngs[ 'rayleigh' ] = prng36.factory;\nprngs[ 't' ] = prng37.factory;\nprngs[ 'triangular' ] = prng38.factory;\nprngs[ 'uniform' ] = prng39.factory;\nprngs[ 'weibull' ] = prng40.factory;\n\n\n// EXPORTS //\n\nmodule.exports = prngs;\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 isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isArray = require( '@stdlib/assert/is-array' );\nvar contains = require( '@stdlib/assert/contains' );\nvar Int32Array = require( '@stdlib/array/int32' );\nvar Uint32Array = require( '@stdlib/array/uint32' );\nvar table = require( './prngs.js' );\n\n\n// VARIABLES //\n\nvar TYPED_ARRAY_CTORS = {\n\t'Int32Array': Int32Array,\n\t'Uint32Array': Uint32Array\n};\nvar PRNG_WRAPPERS = [ 'randi', 'randn', 'randu' ];\n\n\n// MAIN //\n\n/**\n* Revives a JSON-serialized pseudorandom number generator.\n*\n* @param {string} key - key\n* @param {*} value - value\n* @returns {(*|Function)} value or PRNG\n*\n* @example\n* var parseJSON = require( '@stdlib/utils/parse-json' );\n* var mt19937 = require( '@stdlib/random/base/mt19937' );\n*\n* var str = JSON.stringify( mt19937 );\n* var rand = parseJSON( str, reviveBasePRNG );\n* // returns \n*/\nfunction reviveBasePRNG( key, value ) {\n\tvar factory;\n\tvar opts;\n\tvar args;\n\tvar ctor;\n\tvar tmp;\n\tif (\n\t\tvalue &&\n\t\tvalue.type === 'PRNG' &&\n\t\tisString( value.name ) &&\n\t\tisObject( value.state ) &&\n\t\tisArray( value.params ) &&\n\t\tisString( value.state.type ) &&\n\t\tisArray( value.state.data )\n\t) {\n\t\topts = {};\n\t\tfactory = table[ value.name ];\n\t\tif ( factory === void 0 ) {\n\t\t\ttmp = value.name.split( '-' );\n\t\t\tif ( contains( PRNG_WRAPPERS, tmp[ 0 ] ) ) {\n\t\t\t\tfactory = table[ tmp[ 0 ] ];\n\t\t\t\topts.name = tmp.slice( 1 ).join( '-' );\n\t\t\t}\n\t\t}\n\t\tif ( factory ) {\n\t\t\tctor = TYPED_ARRAY_CTORS[ value.state.type ];\n\t\t\tif ( ctor ) {\n\t\t\t\topts.state = new ctor( value.state.data );\n\n\t\t\t\targs = value.params.slice();\n\t\t\t\targs.push( opts );\n\n\t\t\t\ttry {\n\t\t\t\t\treturn factory.apply( null, args );\n\t\t\t\t} catch ( error ) { // eslint-disable-line no-unused-vars\n\t\t\t\t\t// Return the original JSON value...\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn value;\n}\n\n\n// EXPORTS //\n\nmodule.exports = reviveBasePRNG;\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* Revive a JSON-serialized pseudorandom generator.\n*\n* @module @stdlib/random/base/reviver\n*\n* @example\n* var parseJSON = require( '@stdlib/utils/parse-json' );\n* var mt19937 = require( '@stdlib/random/base/mt19937' );\n* var reviveBasePRNG = require( '@stdlib/random/base/reviver' );\n*\n* var str = JSON.stringify( mt19937 );\n* var rand = parseJSON( str, reviveBasePRNG );\n* // returns \n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-read-only-property' );\n\n\n// MAIN //\n\n/**\n* Top-level namespace.\n*\n* @namespace random\n*/\nvar random = {};\n\n/**\n* @name arcsine\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/arcsine}\n*/\nsetReadOnly( random, 'arcsine', require( './../../base/arcsine' ) );\n\n/**\n* @name bernoulli\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/bernoulli}\n*/\nsetReadOnly( random, 'bernoulli', require( './../../base/bernoulli' ) );\n\n/**\n* @name beta\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/beta}\n*/\nsetReadOnly( random, 'beta', require( './../../base/beta' ) );\n\n/**\n* @name betaprime\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/betaprime}\n*/\nsetReadOnly( random, 'betaprime', require( './../../base/betaprime' ) );\n\n/**\n* @name binomial\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/binomial}\n*/\nsetReadOnly( random, 'binomial', require( './../../base/binomial' ) );\n\n/**\n* @name boxMuller\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/box-muller}\n*/\nsetReadOnly( random, 'boxMuller', require( './../../base/box-muller' ) );\n\n/**\n* @name cauchy\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/cauchy}\n*/\nsetReadOnly( random, 'cauchy', require( './../../base/cauchy' ) );\n\n/**\n* @name chi\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/chi}\n*/\nsetReadOnly( random, 'chi', require( './../../base/chi' ) );\n\n/**\n* @name chisquare\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/chisquare}\n*/\nsetReadOnly( random, 'chisquare', require( './../../base/chisquare' ) );\n\n/**\n* @name cosine\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/cosine}\n*/\nsetReadOnly( random, 'cosine', require( './../../base/cosine' ) );\n\n/**\n* @name discreteUniform\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/discrete-uniform}\n*/\nsetReadOnly( random, 'discreteUniform', require( './../../base/discrete-uniform' ) );\n\n/**\n* @name erlang\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/erlang}\n*/\nsetReadOnly( random, 'erlang', require( './../../base/erlang' ) );\n\n/**\n* @name exponential\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/exponential}\n*/\nsetReadOnly( random, 'exponential', require( './../../base/exponential' ) );\n\n/**\n* @name f\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/f}\n*/\nsetReadOnly( random, 'f', require( './../../base/f' ) );\n\n/**\n* @name frechet\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/frechet}\n*/\nsetReadOnly( random, 'frechet', require( './../../base/frechet' ) );\n\n/**\n* @name gamma\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/gamma}\n*/\nsetReadOnly( random, 'gamma', require( './../../base/gamma' ) );\n\n/**\n* @name geometric\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/geometric}\n*/\nsetReadOnly( random, 'geometric', require( './../../base/geometric' ) );\n\n/**\n* @name gumbel\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/gumbel}\n*/\nsetReadOnly( random, 'gumbel', require( './../../base/gumbel' ) );\n\n/**\n* @name hypergeometric\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/hypergeometric}\n*/\n\nsetReadOnly( random, 'hypergeometric', require( './../../base/hypergeometric' ) );\n\n/**\n* @name improvedZiggurat\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/improved-ziggurat}\n*/\nsetReadOnly( random, 'improvedZiggurat', require( './../../base/improved-ziggurat' ) );\n\n/**\n* @name invgamma\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/invgamma}\n*/\nsetReadOnly( random, 'invgamma', require( './../../base/invgamma' ) );\n\n/**\n* @name kumaraswamy\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/kumaraswamy}\n*/\nsetReadOnly( random, 'kumaraswamy', require( './../../base/kumaraswamy' ) );\n\n/**\n* @name laplace\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/laplace}\n*/\nsetReadOnly( random, 'laplace', require( './../../base/laplace' ) );\n\n/**\n* @name levy\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/levy}\n*/\nsetReadOnly( random, 'levy', require( './../../base/levy' ) );\n\n/**\n* @name logistic\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/logistic}\n*/\nsetReadOnly( random, 'logistic', require( './../../base/logistic' ) );\n\n/**\n* @name lognormal\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/lognormal}\n*/\nsetReadOnly( random, 'lognormal', require( './../../base/lognormal' ) );\n\n/**\n* @name minstd\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/minstd}\n*/\nsetReadOnly( random, 'minstd', require( './../../base/minstd' ) );\n\n/**\n* @name minstdShuffle\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/minstd-shuffle}\n*/\nsetReadOnly( random, 'minstdShuffle', require( './../../base/minstd-shuffle' ) );\n\n/**\n* @name mt19937\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/mt19937}\n*/\nsetReadOnly( random, 'mt19937', require( './../../base/mt19937' ) );\n\n/**\n* @name negativeBinomial\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/negative-binomial}\n*/\nsetReadOnly( random, 'negativeBinomial', require( './../../base/negative-binomial' ) );\n\n/**\n* @name normal\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/normal}\n*/\nsetReadOnly( random, 'normal', require( './../../base/normal' ) );\n\n/**\n* @name pareto1\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/pareto-type1}\n*/\nsetReadOnly( random, 'pareto1', require( './../../base/pareto-type1' ) );\n\n/**\n* @name poisson\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/poisson}\n*/\nsetReadOnly( random, 'poisson', require( './../../base/poisson' ) );\n\n/**\n* @name randi\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/randi}\n*/\nsetReadOnly( random, 'randi', require( './../../base/randi' ) );\n\n/**\n* @name randn\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/randn}\n*/\nsetReadOnly( random, 'randn', require( './../../base/randn' ) );\n\n/**\n* @name randu\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/randu}\n*/\nsetReadOnly( random, 'randu', require( './../../base/randu' ) );\n\n/**\n* @name rayleigh\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/rayleigh}\n*/\nsetReadOnly( random, 'rayleigh', require( './../../base/rayleigh' ) );\n\n/**\n* @name reviveBasePRNG\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/reviver}\n*/\nsetReadOnly( random, 'reviveBasePRNG', require( './../../base/reviver' ) );\n\n/**\n* @name t\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/t}\n*/\nsetReadOnly( random, 't', require( './../../base/t' ) );\n\n/**\n* @name triangular\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/triangular}\n*/\nsetReadOnly( random, 'triangular', require( './../../base/triangular' ) );\n\n/**\n* @name uniform\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/uniform}\n*/\nsetReadOnly( random, 'uniform', require( './../../base/uniform' ) );\n\n/**\n* @name weibull\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/weibull}\n*/\nsetReadOnly( random, 'weibull', require( './../../base/weibull' ) );\n\n\n// EXPORTS //\n\nmodule.exports = random;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rarcsine = require( './../../../base/arcsine' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from an arcsine distribution.\n*\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {RangeError} `a` must be less than `b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( a, b, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isNumber( a ) || isnan( a ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', a ) );\n\t}\n\tif ( !isNumber( b ) || isnan( b ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a number and not NaN. Value: `%s`.', b ) );\n\t}\n\tif ( a >= b ) {\n\t\tthrow new RangeError( format( 'invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.', a, b ) );\n\t}\n\tif ( arguments.length > 2 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rarcsine( a, b, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rarcsine( a, b );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( a, b, opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from an arcsine distribution.\n*\n* @module @stdlib/random/iter/arcsine\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/arcsine' );\n*\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isProbability = require( '@stdlib/assert/is-probability' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rbern = require( './../../../base/bernoulli' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a Bernoulli distribution.\n*\n* @param {Probability} p - success probability\n* @param {Options} [options] - function options\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} first argument must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 0.3 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( p, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isProbability( p ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a probability. Value: `%s`.', p ) );\n\t}\n\tif ( arguments.length > 1 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rbern( p, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rbern( p );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( p, opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from a Bernoulli distribution.\n*\n* @module @stdlib/random/iter/bernoulli\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/bernoulli' );\n*\n* var iter = iterator( 0.3 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rbeta = require( './../../../base/beta' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a beta distribution.\n*\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( alpha, beta, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositiveNumber( alpha ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositiveNumber( beta ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\tif ( arguments.length > 2 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rbeta( alpha, beta, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rbeta( alpha, beta );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( alpha, beta, opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from a beta distribution.\n*\n* @module @stdlib/random/iter/beta\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/beta' );\n*\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rbetaprime = require( './../../../base/betaprime' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a beta prime distribution.\n*\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( alpha, beta, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositiveNumber( alpha ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositiveNumber( beta ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\tif ( arguments.length > 2 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rbetaprime( alpha, beta, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rbetaprime( alpha, beta );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( alpha, beta, opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from a beta prime distribution.\n*\n* @module @stdlib/random/iter/betaprime\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/betaprime' );\n*\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isProbability = require( '@stdlib/assert/is-probability' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rbinom = require( './../../../base/binomial' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a binomial distribution.\n*\n* @param {PositiveInteger} n - number of trials\n* @param {Probability} p - success probability\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} first argument must be a positive integer\n* @throws {TypeError} second argument must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 8, 0.3 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( n, p, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositiveInteger( n ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive integer. Value: `%s`.', n ) );\n\t}\n\tif ( !isProbability( p ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a probability. Value: `%s`.', p ) );\n\t}\n\tif ( arguments.length > 2 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rbinom( n, p, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rbinom( n, p );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( n, p, opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from a binomial distribution.\n*\n* @module @stdlib/random/iter/binomial\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/binomial' );\n*\n* var iter = iterator( 10, 0.3 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rnorm = require( './../../../base/box-muller' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a standard normal distribution using the Box-Muller transform.\n*\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\n\tif ( arguments.length > 0 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rnorm( opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rnorm();\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from a standard normal distribution using the Box-Muller transform.\n*\n* @module @stdlib/random/iter/box-muller\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/box-muller' );\n*\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rcauchy = require( './../../../base/cauchy' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a Cauchy distribution.\n*\n* @param {number} x0 - location parameter\n* @param {PositiveNumber} gamma - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `x0` must be a number\n* @throws {TypeError} `gamma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( x0, gamma, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isNumber( x0 ) || isnan( x0 ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', x0 ) );\n\t}\n\tif ( !isPositive( gamma ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', gamma ) );\n\t}\n\tif ( arguments.length > 2 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rcauchy( x0, gamma, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rcauchy( x0, gamma );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( x0, gamma, opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from a Cauchy distribution.\n*\n* @module @stdlib/random/iter/cauchy\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/cauchy' );\n*\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rchi = require( './../../../base/chi' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a chi distribution.\n*\n* @param {PositiveNumber} k - degrees of freedom\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} first argument must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( k, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositive( k ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', k ) );\n\t}\n\tif ( arguments.length > 1 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rchi( k, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rchi( k );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( k, opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from a chi distribution.\n*\n* @module @stdlib/random/iter/chi\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/chi' );\n*\n* var iter = iterator( 1.5 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rchisq = require( './../../../base/chisquare' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a chi-square distribution.\n*\n* @param {PositiveNumber} k - degrees of freedom\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} first argument must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( k, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositive( k ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', k ) );\n\t}\n\tif ( arguments.length > 1 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rchisq( k, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rchisq( k );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( k, opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from a chi-square distribution.\n*\n* @module @stdlib/random/iter/chisquare\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/chisquare' );\n*\n* var iter = iterator( 1.5 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rcosine = require( './../../../base/cosine' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a raised cosine distribution.\n*\n* @param {number} mu - location parameter\n* @param {PositiveNumber} s - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( mu, s, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( s ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', s ) );\n\t}\n\tif ( arguments.length > 2 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rcosine( mu, s, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rcosine( mu, s );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( mu, s, opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from a raised cosine distribution.\n*\n* @module @stdlib/random/iter/cosine\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/cosine' );\n*\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isInteger = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar runif = require( './../../../base/discrete-uniform' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a discrete uniform distribution.\n*\n* @param {integer} a - minimum support\n* @param {integer} b - maximum support\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `a` must be an integer\n* @throws {TypeError} `b` must be an integer\n* @throws {RangeError} `a` must be less than or equal to `b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2, 6 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( a, b, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isInteger( a ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', a ) );\n\t}\n\tif ( !isInteger( b ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', b ) );\n\t}\n\tif ( a > b ) {\n\t\tthrow new RangeError( format( 'invalid argument. Minimum support must be less than or equal to maximum support. Value: `[%d,%d]`.', a, b ) );\n\t}\n\tif ( arguments.length > 2 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = runif( a, b, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = runif( a, b );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( a, b, opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from a discrete uniform distribution.\n*\n* @module @stdlib/random/iter/discrete-uniform\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/discrete-uniform' );\n*\n* var iter = iterator( -1, 2 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rerlang = require( './../../../base/erlang' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from an Erlang distribution.\n*\n* @param {PositiveInteger} k - shape parameter\n* @param {PositiveNumber} lambda - rate parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `k` must be a positive integer\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( k, lambda, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositiveInteger( k ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive integer. Value: `%s`.', k ) );\n\t}\n\tif ( !isPositiveNumber( lambda ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', lambda ) );\n\t}\n\tif ( arguments.length > 2 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rerlang( k, lambda, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rerlang( k, lambda );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( k, lambda, opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from an Erlang distribution.\n*\n* @module @stdlib/random/iter/erlang\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/erlang' );\n*\n* var iter = iterator( 2, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rexp = require( './../../../base/exponential' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from an exponential distribution.\n*\n* @param {PositiveNumber} lambda - rate parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} first argument must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( lambda, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositive( lambda ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', lambda ) );\n\t}\n\tif ( arguments.length > 1 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rexp( lambda, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rexp( lambda );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( lambda, opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from an exponential distribution.\n*\n* @module @stdlib/random/iter/exponential\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/exponential' );\n*\n* var iter = iterator( 1.5 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rf = require( './../../../base/f' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from an F distribution.\n*\n* @param {PositiveNumber} d1 - degrees of freedom\n* @param {PositiveNumber} d2 - degrees of freedom\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `d1` must be a positive number\n* @throws {TypeError} `d2` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( d1, d2, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositiveNumber( d1 ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', d1 ) );\n\t}\n\tif ( !isPositiveNumber( d2 ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', d2 ) );\n\t}\n\tif ( arguments.length > 2 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rf( d1, d2, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rf( d1, d2 );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( d1, d2, opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from an F distribution.\n*\n* @module @stdlib/random/iter/f\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/f' );\n*\n* var iter = iterator( 2.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rfrechet = require( './../../../base/frechet' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a Fr\u00E9chet distribution.\n*\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} s - rate parameter\n* @param {number} m - location parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} `m` must be a number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0, 5.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( alpha, s, m, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositiveNumber( alpha ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositiveNumber( s ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', s ) );\n\t}\n\tif ( !isNumber( m ) || isnan( m ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a number. Value: `%s`.', m ) );\n\t}\n\tif ( arguments.length > 3 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rfrechet( alpha, s, m, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rfrechet( alpha, s, m );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( alpha, s, m, opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from a Fr\u00E9chet distribution.\n*\n* @module @stdlib/random/iter/frechet\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/frechet' );\n*\n* var iter = iterator( 2.0, 5.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rgamma = require( './../../../base/gamma' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a gamma distribution.\n*\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - rate parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( alpha, beta, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositiveNumber( alpha ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositiveNumber( beta ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\tif ( arguments.length > 2 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rgamma( alpha, beta, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rgamma( alpha, beta );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( alpha, beta, opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from a gamma distribution.\n*\n* @module @stdlib/random/iter/gamma\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/gamma' );\n*\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isProbability = require( '@stdlib/assert/is-probability' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rgeom = require( './../../../base/geometric' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a geometric distribution.\n*\n* @param {Probability} p - success probability\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} first argument must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 0.3 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( p, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isProbability( p ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a probability. Value: `%s`.', p ) );\n\t}\n\tif ( arguments.length > 1 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rgeom( p, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rgeom( p );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( p, opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from a geometric distribution.\n*\n* @module @stdlib/random/iter/geometric\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/geometric' );\n*\n* var iter = iterator( 0.3 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rgumbel = require( './../../../base/gumbel' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a Gumbel distribution.\n*\n* @param {number} mu - mean\n* @param {PositiveNumber} beta - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} first argument must be a number\n* @throws {TypeError} second argument must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( mu, beta, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( beta ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\tif ( arguments.length > 2 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rgumbel( mu, beta, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rgumbel( mu, beta );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( mu, beta, opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from a Gumbel distribution.\n*\n* @module @stdlib/random/iter/gumbel\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/gumbel' );\n*\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rhypergeom = require( './../../../base/hypergeometric' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a hypergeometric distribution.\n*\n* @param {NonNegativeInteger} N - population size\n* @param {NonNegativeInteger} K - subpopulation size\n* @param {NonNegativeInteger} n - number of draws\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} second argument must be a nonnegative integer\n* @throws {TypeError} third argument must be a nonnegative integer\n* @throws {RangeError} number of draws must be less than or equal to the population size\n* @throws {RangeError} subpopulation size must be less than or equal to the population size\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 10, 5, 3 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( N, K, n, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isNonNegativeInteger( N ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', N ) );\n\t}\n\tif ( !isNonNegativeInteger( K ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a nonnegative integer. Value: `%s`.', K ) );\n\t}\n\tif ( !isNonNegativeInteger( n ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a nonnegative integer. Value: `%s`.', n ) );\n\t}\n\tif ( n > N ) {\n\t\tthrow new RangeError( format( 'invalid argument. Number of draws must be less than or equal to the population size. Value: `%u`.', n ) );\n\t}\n\tif ( K > N ) {\n\t\tthrow new RangeError( format( 'invalid argument. Subpopulation size must be less than or equal to the population size. Value: `%u`.', K ) );\n\t}\n\tif ( arguments.length > 3 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rhypergeom( N, K, n, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rhypergeom( N, K, n );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( N, K, n, opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from a hypergeometric distribution.\n*\n* @module @stdlib/random/iter/hypergeometric\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/hypergeometric' );\n*\n* var iter = iterator( 10, 5, 6 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rnorm = require( './../../../base/improved-ziggurat' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a standard normal distribution using the Improved Ziggurat algorithm.\n*\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( arguments.length > 0 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rnorm( opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rnorm();\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from a standard normal distribution using the Improved Ziggurat algorithm.\n*\n* @module @stdlib/random/iter/improved-ziggurat\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/improved-ziggurat' );\n*\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rinvgamma = require( './../../../base/invgamma' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from an inverse gamma distribution.\n*\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0, 2.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( alpha, beta, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositiveNumber( alpha ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositiveNumber( beta ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\tif ( arguments.length > 2 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rinvgamma( alpha, beta, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rinvgamma( alpha, beta );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( alpha, beta, opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from an inverse gamma distribution.\n*\n* @module @stdlib/random/iter/invgamma\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/invgamma' );\n*\n* var iter = iterator( 2.0, 2.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rkumaraswamy = require( './../../../base/kumaraswamy' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a Kumaraswamy's double bounded distribution.\n*\n* @param {PositiveNumber} a - first shape parameter\n* @param {PositiveNumber} b - second shape parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `a` must be a positive number\n* @throws {TypeError} `b` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( a, b, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositiveNumber( a ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', a ) );\n\t}\n\tif ( !isPositiveNumber( b ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', b ) );\n\t}\n\tif ( arguments.length > 2 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rkumaraswamy( a, b, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rkumaraswamy( a, b );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( a, b, opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from a Kumaraswamy's double bounded distribution.\n*\n* @module @stdlib/random/iter/kumaraswamy\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/kumaraswamy' );\n*\n* var iter = iterator( 2.0, 1.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rlaplace = require( './../../../base/laplace' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a Laplace (double exponential) distribution.\n*\n* @param {number} mu - mean\n* @param {PositiveNumber} b - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `b` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( mu, b, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( b ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', b ) );\n\t}\n\tif ( arguments.length > 2 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rlaplace( mu, b, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rlaplace( mu, b );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( mu, b, opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from a Laplace (double exponential) distribution.\n*\n* @module @stdlib/random/iter/laplace\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/laplace' );\n*\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rlevy = require( './../../../base/levy' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a L\u00E9vy distribution.\n*\n* @param {number} mu - mean\n* @param {PositiveNumber} c - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `c` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( mu, c, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( c ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', c ) );\n\t}\n\tif ( arguments.length > 2 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rlevy( mu, c, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rlevy( mu, c );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( mu, c, opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from a L\u00E9vy distribution.\n*\n* @module @stdlib/random/iter/levy\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/levy' );\n*\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rlogis = require( './../../../base/logistic' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a logistic distribution.\n*\n* @param {number} mu - mean\n* @param {PositiveNumber} s - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( mu, s, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( s ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', s ) );\n\t}\n\tif ( arguments.length > 2 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rlogis( mu, s, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rlogis( mu, s );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( mu, s, opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from a logistic distribution.\n*\n* @module @stdlib/random/iter/logistic\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/logistic' );\n*\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rlognorm = require( './../../../base/lognormal' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a lognormal distribution.\n*\n* @param {number} mu - location parameter\n* @param {PositiveNumber} sigma - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `sigma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( mu, sigma, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( sigma ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', sigma ) );\n\t}\n\tif ( arguments.length > 2 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rlognorm( mu, sigma, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rlognorm( mu, sigma );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( mu, sigma, opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from a lognormal distribution.\n*\n* @module @stdlib/random/iter/lognormal\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/lognormal' );\n*\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 assign = require( '@stdlib/object/assign' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar minstd = require( './../../../base/minstd' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers via a linear congruential pseudorandom number generator (LCG) based on Park and Miller.\n*\n* @param {Options} [options] - function options\n* @param {boolean} [options.normalized=false] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( arguments.length > 0 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'normalized' ) ) {\n\t\t\tif ( !isBoolean( opts.normalized ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'normalized', opts.normalized ) );\n\t\t\t}\n\t\t}\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = minstd( opts );\n\t\tif ( opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = minstd();\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\tif ( opts.normalized ) {\n\t\trand = rand.normalized;\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMINSTD} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMINSTD} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMINSTD} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for a linear congruential pseudorandom number generator (LCG) based on Park and Miller.\n*\n* @module @stdlib/random/iter/minstd\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/minstd' );\n*\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 assign = require( '@stdlib/object/assign' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar minstd = require( './../../../base/minstd-shuffle' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers via a linear congruential pseudorandom number generator (LCG) whose output is shuffled.\n*\n* @param {Options} [options] - function options\n* @param {boolean} [options.normalized=false] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( arguments.length > 0 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'normalized' ) ) {\n\t\t\tif ( !isBoolean( opts.normalized ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'normalized', opts.normalized ) );\n\t\t\t}\n\t\t}\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = minstd( opts );\n\t\tif ( opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = minstd();\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\tif ( opts.normalized ) {\n\t\trand = rand.normalized;\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMINSTD} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMINSTD} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMINSTD} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for a linear congruential pseudorandom number generator (LCG) whose output is shuffled.\n*\n* @module @stdlib/random/iter/minstd-shuffle\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/minstd-shuffle' );\n*\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 assign = require( '@stdlib/object/assign' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar mt19937 = require( './../../../base/mt19937' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers via a 32-bit Mersenne Twister pseudorandom number generator.\n*\n* @param {Options} [options] - function options\n* @param {boolean} [options.normalized=false] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( arguments.length > 0 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'normalized' ) ) {\n\t\t\tif ( !isBoolean( opts.normalized ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'normalized', opts.normalized ) );\n\t\t\t}\n\t\t}\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = mt19937( opts );\n\t\tif ( opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = mt19937();\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\tif ( opts.normalized ) {\n\t\trand = rand.normalized;\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( opts );\n\t}\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for a 32-bit Mersenne Twister pseudorandom number generator.\n*\n* @module @stdlib/random/iter/mt19937\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/mt19937' );\n*\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isProbability = require( '@stdlib/assert/is-probability' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rnbinom = require( './../../../base/negative-binomial' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a negative binomial distribution.\n*\n* @param {PositiveNumber} r - number of successes until experiment is stopped\n* @param {Probability} p - success probability\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} first argument must be a positive number\n* @throws {TypeError} second argument must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 8, 0.3 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( r, p, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositiveNumber( r ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive integer. Value: `%s`.', r ) );\n\t}\n\tif ( !isProbability( p ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a probability. Value: `%s`.', p ) );\n\t}\n\tif ( arguments.length > 2 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rnbinom( r, p, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rnbinom( r, p );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( r, p, opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from a negative binomial distribution.\n*\n* @module @stdlib/random/iter/negative-binomial\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/negative-binomial' );\n*\n* var iter = iterator( 10, 0.3 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rnorm = require( './../../../base/normal' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a normal distribution.\n*\n* @param {number} mu - mean\n* @param {PositiveNumber} sigma - standard deviation\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `sigma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( mu, sigma, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( sigma ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', sigma ) );\n\t}\n\tif ( arguments.length > 2 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rnorm( mu, sigma, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rnorm( mu, sigma );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( mu, sigma, opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from a normal distribution.\n*\n* @module @stdlib/random/iter/normal\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/normal' );\n*\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rpareto = require( './../../../base/pareto-type1' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a Pareto (Type I) distribution.\n*\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( alpha, beta, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositiveNumber( alpha ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositiveNumber( beta ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\tif ( arguments.length > 2 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rpareto( alpha, beta, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rpareto( alpha, beta );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( alpha, beta, opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from a Pareto (Type I) distribution.\n*\n* @module @stdlib/random/iter/pareto-type1\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/pareto-type1' );\n*\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rpois = require( './../../../base/poisson' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a Poisson distribution.\n*\n* @param {PositiveNumber} lambda - mean\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} first argument must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( lambda, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositive( lambda ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', lambda ) );\n\t}\n\tif ( arguments.length > 1 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rpois( lambda, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rpois( lambda );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( lambda, opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from a Poisson distribution.\n*\n* @module @stdlib/random/iter/poisson\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/poisson' );\n*\n* var iter = iterator( 1.5 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 assign = require( '@stdlib/object/assign' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar randi = require( './../../../base/randi' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers having integer values.\n*\n* @param {Options} [options] - function options\n* @param {string} [options.name='mt19937'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( arguments.length > 0 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = randi( opts );\n\t\tif ( opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = randi();\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {*} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {*} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {*} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers having integer values.\n*\n* @module @stdlib/random/iter/randi\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/randi' );\n*\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar randn = require( './../../../base/randn' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a standard normal distribution.\n*\n* @param {Options} [options] - function options\n* @param {string} [options.name='improved-ziggurat'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( arguments.length > 0 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = randn( opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = randn();\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from a standard normal distribution.\n*\n* @module @stdlib/random/iter/randn\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/randn' );\n*\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 assign = require( '@stdlib/object/assign' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar randu = require( './../../../base/randu' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating uniformly distributed pseudorandom numbers between 0 and 1.\n*\n* @param {Options} [options] - function options\n* @param {string} [options.name='mt19937'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( arguments.length > 0 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = randu( opts );\n\t\tif ( opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = randu();\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {*} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {*} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {*} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating uniformly distributed pseudorandom numbers between 0 and 1.\n*\n* @module @stdlib/random/iter/randu\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/randu' );\n*\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rrayleigh = require( './../../../base/rayleigh' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a Rayleigh distribution.\n*\n* @param {PositiveNumber} sigma - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} first argument must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( sigma, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositive( sigma ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', sigma ) );\n\t}\n\tif ( arguments.length > 1 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rrayleigh( sigma, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rrayleigh( sigma );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( sigma, opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from a Rayleigh distribution.\n*\n* @module @stdlib/random/iter/rayleigh\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/rayleigh' );\n*\n* var iter = iterator( 1.5 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rt = require( './../../../base/t' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a Student's t distribution.\n*\n* @param {PositiveNumber} v - degrees of freedom\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} first argument must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( v, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositive( v ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', v ) );\n\t}\n\tif ( arguments.length > 1 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rt( v, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rt( v );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( v, opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from a Student's t distribution.\n*\n* @module @stdlib/random/iter/t\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/t' );\n*\n* var iter = iterator( 1.5 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rtriangular = require( './../../../base/triangular' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a triangular distribution.\n*\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {number} c - mode\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {RangeError} arguments must satisfy `a <= c <= b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0, 5.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( a, b, c, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isNumber( a ) || isnan( a ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', a ) );\n\t}\n\tif ( !isNumber( b ) || isnan( b ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a number and not NaN. Value: `%s`.', b ) );\n\t}\n\tif ( !isNumber( c ) || isnan( c ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a number and not NaN. Value: `%s`.', c ) );\n\t}\n\tif ( !(a <= c && c <= b) ) {\n\t\tthrow new RangeError( format( 'invalid arguments. Parameters must satisfy the following condition: %s. a: `%f`. b: `%f`. c: `%f`.', 'a <= c <= b', a, b, c ) );\n\t}\n\tif ( arguments.length > 3 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rtriangular( a, b, c, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rtriangular( a, b, c );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( a, b, c, opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from a triangular distribution.\n*\n* @module @stdlib/random/iter/triangular\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/triangular' );\n*\n* var iter = iterator( 2.0, 5.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar runif = require( './../../../base/uniform' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a continuous uniform distribution.\n*\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {RangeError} `a` must be less than `b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( a, b, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isNumber( a ) || isnan( a ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', a ) );\n\t}\n\tif ( !isNumber( b ) || isnan( b ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a number and not NaN. Value: `%s`.', b ) );\n\t}\n\tif ( a >= b ) {\n\t\tthrow new RangeError( format( 'invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.', a, b ) );\n\t}\n\tif ( arguments.length > 2 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = runif( a, b, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = runif( a, b );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( a, b, opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from a continuous uniform distribution.\n*\n* @module @stdlib/random/iter/uniform\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/uniform' );\n*\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rweibull = require( './../../../base/weibull' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a Weibull distribution.\n*\n* @param {PositiveNumber} k - scale parameter\n* @param {PositiveNumber} lambda - shape parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `k` must be a positive number\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( k, lambda, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositiveNumber( k ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', k ) );\n\t}\n\tif ( !isPositiveNumber( lambda ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', lambda ) );\n\t}\n\tif ( arguments.length > 2 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rweibull( k, lambda, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rweibull( k, lambda );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( k, lambda, opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from a Weibull distribution.\n*\n* @module @stdlib/random/iter/weibull\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/weibull' );\n*\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-read-only-property' );\n\n\n// MAIN //\n\n/**\n* Top-level namespace.\n*\n* @namespace ns\n*/\nvar ns = {};\n\n/**\n* @name arcsine\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/arcsine}\n*/\nsetReadOnly( ns, 'arcsine', require( './../../iter/arcsine' ) );\n\n/**\n* @name bernoulli\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/bernoulli}\n*/\nsetReadOnly( ns, 'bernoulli', require( './../../iter/bernoulli' ) );\n\n/**\n* @name beta\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/beta}\n*/\nsetReadOnly( ns, 'beta', require( './../../iter/beta' ) );\n\n/**\n* @name betaprime\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/betaprime}\n*/\nsetReadOnly( ns, 'betaprime', require( './../../iter/betaprime' ) );\n\n/**\n* @name binomial\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/binomial}\n*/\nsetReadOnly( ns, 'binomial', require( './../../iter/binomial' ) );\n\n/**\n* @name boxMuller\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/box-muller}\n*/\nsetReadOnly( ns, 'boxMuller', require( './../../iter/box-muller' ) );\n\n/**\n* @name cauchy\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/cauchy}\n*/\nsetReadOnly( ns, 'cauchy', require( './../../iter/cauchy' ) );\n\n/**\n* @name chi\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/chi}\n*/\nsetReadOnly( ns, 'chi', require( './../../iter/chi' ) );\n\n/**\n* @name chisquare\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/chisquare}\n*/\nsetReadOnly( ns, 'chisquare', require( './../../iter/chisquare' ) );\n\n/**\n* @name cosine\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/cosine}\n*/\nsetReadOnly( ns, 'cosine', require( './../../iter/cosine' ) );\n\n/**\n* @name discreteUniform\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/discrete-uniform}\n*/\nsetReadOnly( ns, 'discreteUniform', require( './../../iter/discrete-uniform' ) );\n\n/**\n* @name erlang\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/erlang}\n*/\nsetReadOnly( ns, 'erlang', require( './../../iter/erlang' ) );\n\n/**\n* @name exponential\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/exponential}\n*/\nsetReadOnly( ns, 'exponential', require( './../../iter/exponential' ) );\n\n/**\n* @name f\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/f}\n*/\nsetReadOnly( ns, 'f', require( './../../iter/f' ) );\n\n/**\n* @name frechet\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/frechet}\n*/\nsetReadOnly( ns, 'frechet', require( './../../iter/frechet' ) );\n\n/**\n* @name gamma\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/gamma}\n*/\nsetReadOnly( ns, 'gamma', require( './../../iter/gamma' ) );\n\n/**\n* @name geometric\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/geometric}\n*/\nsetReadOnly( ns, 'geometric', require( './../../iter/geometric' ) );\n\n/**\n* @name gumbel\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/gumbel}\n*/\nsetReadOnly( ns, 'gumbel', require( './../../iter/gumbel' ) );\n\n/**\n* @name hypergeometric\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/hypergeometric}\n*/\nsetReadOnly( ns, 'hypergeometric', require( './../../iter/hypergeometric' ) );\n\n/**\n* @name improvedZiggurat\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/improved-ziggurat}\n*/\nsetReadOnly( ns, 'improvedZiggurat', require( './../../iter/improved-ziggurat' ) );\n\n/**\n* @name invgamma\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/invgamma}\n*/\nsetReadOnly( ns, 'invgamma', require( './../../iter/invgamma' ) );\n\n/**\n* @name kumaraswamy\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/kumaraswamy}\n*/\nsetReadOnly( ns, 'kumaraswamy', require( './../../iter/kumaraswamy' ) );\n\n/**\n* @name laplace\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/laplace}\n*/\nsetReadOnly( ns, 'laplace', require( './../../iter/laplace' ) );\n\n/**\n* @name levy\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/levy}\n*/\nsetReadOnly( ns, 'levy', require( './../../iter/levy' ) );\n\n/**\n* @name logistic\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/logistic}\n*/\nsetReadOnly( ns, 'logistic', require( './../../iter/logistic' ) );\n\n/**\n* @name lognormal\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/lognormal}\n*/\nsetReadOnly( ns, 'lognormal', require( './../../iter/lognormal' ) );\n\n/**\n* @name minstd\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/minstd}\n*/\nsetReadOnly( ns, 'minstd', require( './../../iter/minstd' ) );\n\n/**\n* @name minstdShuffle\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/minstd-shuffle}\n*/\nsetReadOnly( ns, 'minstdShuffle', require( './../../iter/minstd-shuffle' ) );\n\n/**\n* @name mt19937\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/mt19937}\n*/\nsetReadOnly( ns, 'mt19937', require( './../../iter/mt19937' ) );\n\n/**\n* @name negativeBinomial\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/negative-binomial}\n*/\nsetReadOnly( ns, 'negativeBinomial', require( './../../iter/negative-binomial' ) );\n\n/**\n* @name normal\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/normal}\n*/\nsetReadOnly( ns, 'normal', require( './../../iter/normal' ) );\n\n/**\n* @name pareto1\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/pareto-type1}\n*/\nsetReadOnly( ns, 'pareto1', require( './../../iter/pareto-type1' ) );\n\n/**\n* @name poisson\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/poisson}\n*/\nsetReadOnly( ns, 'poisson', require( './../../iter/poisson' ) );\n\n/**\n* @name randi\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/randi}\n*/\nsetReadOnly( ns, 'randi', require( './../../iter/randi' ) );\n\n/**\n* @name randn\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/randn}\n*/\nsetReadOnly( ns, 'randn', require( './../../iter/randn' ) );\n\n/**\n* @name randu\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/randu}\n*/\nsetReadOnly( ns, 'randu', require( './../../iter/randu' ) );\n\n/**\n* @name rayleigh\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/rayleigh}\n*/\nsetReadOnly( ns, 'rayleigh', require( './../../iter/rayleigh' ) );\n\n/**\n* @name t\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/t}\n*/\nsetReadOnly( ns, 't', require( './../../iter/t' ) );\n\n/**\n* @name triangular\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/triangular}\n*/\nsetReadOnly( ns, 'triangular', require( './../../iter/triangular' ) );\n\n/**\n* @name uniform\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/uniform}\n*/\nsetReadOnly( ns, 'uniform', require( './../../iter/uniform' ) );\n\n/**\n* @name weibull\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/weibull}\n*/\nsetReadOnly( ns, 'weibull', require( './../../iter/weibull' ) );\n\n\n// EXPORTS //\n\nmodule.exports = ns;\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 floor = require( '@stdlib/math/base/special/floor' );\n\n\n// MAIN //\n\n/**\n* Samples from a discrete uniform distribution (equal probabilities and with replacement).\n*\n* @private\n* @param {ArrayLike} x - array-like object from which to sample\n* @param {NonNegativeInteger} size - sample size\n* @param {Function} rand - PRNG for generating uniformly distributed numbers\n* @returns {Array} sample\n*/\nfunction discreteUniform( x, size, rand ) {\n\tvar pos;\n\tvar out;\n\tvar N;\n\tvar i;\n\n\tN = x.length;\n\tout = new Array( size );\n\tfor ( i = 0; i < size; i++ ) {\n\t\tpos = floor( N * rand() );\n\t\tout[ i ] = x[ pos ];\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = discreteUniform;\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* Samples without replacement from a discrete set using custom probabilities.\n*\n* ## Notes\n*\n* - After each draw, the probabilities of the remaining observations are renormalized so that they sum to one.\n*\n* @private\n* @param {ArrayLike} x - array-like object from which to sample\n* @param {NonNegativeInteger} size - sample size\n* @param {Function} rand - PRNG for generating uniformly distributed numbers\n* @param {ProbabilityArray} probabilities - element probabilities\n* @returns {Array} sample\n*/\nfunction renormalizing( x, size, rand, probabilities ) {\n\tvar probs;\n\tvar psum;\n\tvar out;\n\tvar N;\n\tvar i;\n\tvar j;\n\tvar k;\n\tvar u;\n\n\tN = x.length;\n\tprobs = new Array( N );\n\tfor ( i = 0; i < N; i++ ) {\n\t\tprobs[ i ] = probabilities[ i ];\n\t}\n\tout = new Array( size );\n\tfor ( i = 0; i < size; i++ ) {\n\t\tu = rand();\n\t\tpsum = 0;\n\t\tfor ( j = 0; j < N; j++ ) {\n\t\t\tpsum += probs[ j ];\n\t\t\tif ( u < psum ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tfor ( k = 0; k < N; k++ ) {\n\t\t\tif ( k === j ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tprobs[ k ] /= 1.0 - probs[ j ];\n\t\t}\n\t\tprobs[ j ] = 0.0;\n\t\tout[ i ] = x[ j ];\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = renormalizing;\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 floor = require( '@stdlib/math/base/special/floor' );\n\n\n// FUNCTIONS //\n\nvar slice = Array.prototype.slice;\n\n\n// MAIN //\n\n/**\n* Samples uniformly without replacement using the Fisher-Yates shuffle.\n*\n* ## References\n*\n* - Knuth, Donald E. 1997. _The Art of Computer Programming, Volume 2 (3rd Ed.): Seminumerical Algorithms_. Boston, MA, USA: Addison-Wesley Longman Publishing Co., Inc.\n*\n* @private\n* @param {ArrayLike} x - array-like object from which to sample\n* @param {NonNegativeInteger} size - sample size\n* @param {Function} rand - PRNG for generating uniformly distributed numbers\n* @returns {Array} sample\n*/\nfunction fisherYates( x, size, rand ) {\n\tvar tmp;\n\tvar N;\n\tvar i;\n\tvar j;\n\n\tN = x.length;\n\n\t// Note: we skip the first element, as no further swaps are possible given that all other indices are excluded from swapping...\n\tfor ( i = N-1; i > 0; i-- ) {\n\t\t// Generate an integer index on the interval: [0,i]\n\t\tj = floor( rand()*(i+1) );\n\n\t\t// Swap elements:\n\t\ttmp = x[ i ];\n\t\tx[ i ] = x[ j ];\n\t\tx[ j ] = tmp;\n\t}\n\treturn slice.call( x, 0, size );\n}\n\n\n// EXPORTS //\n\nmodule.exports = fisherYates;\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 floor = require( '@stdlib/math/base/special/floor' );\n\n\n// MAIN //\n\n/**\n* Samples with replacement and non-uniform probabilities using Vose's [alias method][alias-method].\n*\n* ## References\n*\n* - Vose, Michael D. 1991. \"A linear algorithm for generating random numbers with a given distribution.\" _IEEE Transactions on Software Engineering_ 17 (9): 972\u201375. doi:[10.1109/32.92917][@vose:1991].\n*\n* [alias-method]: http://keithschwarz.com/darts-dice-coins/\n* [@vose:1991]: https://doi.org/10.1109/32.92917\n*\n* @private\n* @param {ArrayLike} x - array-like object from which to sample\n* @param {NonNegativeInteger} size - sample size\n* @param {Function} rand - PRNG for generating uniformly distributed numbers\n* @param {ProbabilityArray} probabilities - element probabilities\n* @returns {Array} sample\n*/\nfunction vose( x, size, rand, probabilities ) {\n\tvar small;\n\tvar large;\n\tvar probs;\n\tvar alias;\n\tvar out;\n\tvar N;\n\tvar p;\n\tvar g;\n\tvar i;\n\tvar l;\n\n\tprobs = probabilities.slice();\n\tN = x.length;\n\n\tsmall = [];\n\tlarge = [];\n\tfor ( i = 0; i < N; i++ ) {\n\t\tprobs[ i ] *= N;\n\t\tif ( probs[ i ] < 1.0 ) {\n\t\t\tsmall.push( i );\n\t\t} else {\n\t\t\tlarge.push( i );\n\t\t}\n\t}\n\talias = new Array( N );\n\tp = new Array( N );\n\twhile ( small.length !== 0 && large.length !== 0 ) {\n\t\tl = small.shift();\n\t\tg = large.shift();\n\t\tp[ l ] = probs[ l ];\n\t\talias[ l ] = g;\n\t\tprobs[ g ] = probs[ g ] + probs[ l ] - 1.0;\n\t\tif ( probs[ g ] < 1.0 ) {\n\t\t\tsmall.push( g );\n\t\t} else {\n\t\t\tlarge.push( g );\n\t\t}\n\t}\n\tfor ( i = 0; i < large.length; i++ ) {\n\t\tp[ large[ i ] ] = 1.0;\n\t}\n\tfor ( i = 0; i < small.length; i++ ) {\n\t\tp[ small[ i ] ] = 1.0;\n\t}\n\tout = new Array( size );\n\tfor ( i = 0; i < size; i++ ) {\n\t\tl = floor( N*rand() );\n\t\tif ( rand() < p[ l ] ) {\n\t\t\tout[ i ] = x[ l ];\n\t\t} else {\n\t\t\tout[ i ] = x[ alias[ l ] ];\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = vose;\n", "{\n\t\"mutate\": false,\n\t\"replace\": true\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'use strict';\n\n// MODULES //\n\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' );\nvar isUnityProbabilityArray = require( '@stdlib/assert/is-unity-probability-array' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination for validated options\n* @param {Options} options - function options\n* @param {NonNegativeInteger} [options.size] - sample size\n* @param {ProbabilityArray} [options.probs] - element probabilities\n* @param {boolean} [options.replace] - boolean indicating whether to sample with replacement\n* @param {boolean} [options.mutate] - boolean indicating whether to mutate the `pool` when sampling without replacement\n* @returns {(null|Error)} null or an error\n*\n* @example\n* var opts = {};\n* var options = {\n* 'size': 10,\n* 'replace': false,\n* 'mutate': true,\n* 'probs': [ 0.7, 0.3 ]\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'size' ) ) {\n\t\topts.size = options.size;\n\t\tif ( !isNonNegativeInteger( opts.size ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'size', opts.size ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'probs' ) ) {\n\t\topts.probs = options.probs;\n\t\tif ( !isUnityProbabilityArray( opts.probs ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be an array of probabilities that sum to one. Option: `%s`.', 'probs', opts.probs ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'mutate' ) ) {\n\t\topts.mutate = options.mutate;\n\t\tif ( !isBoolean( opts.mutate ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'mutate', opts.mutate ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'replace' ) ) {\n\t\topts.replace = options.replace;\n\t\tif ( !isBoolean( opts.replace ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'replace', opts.replace ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar isArrayLike = require( '@stdlib/assert/is-array-like' );\nvar isTypedArrayLike = require( '@stdlib/assert/is-typed-array-like' );\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar randu = require( './../../base/mt19937' ).factory;\nvar copy = require( '@stdlib/utils/copy' );\nvar discreteUniform = require( './discrete_uniform.js' );\nvar renormalizing = require( './renormalizing.js' );\nvar fisherYates = require( './fisher_yates.js' );\nvar vose = require( './vose.js' );\nvar defaults = require( './defaults.json' );\nvar validate = require( './validate.js' );\n\n\n// FUNCTIONS //\n\nvar slice = Array.prototype.slice;\n\n\n// MAIN //\n\n/**\n* Returns a function to sample elements from an array-like object.\n*\n* @param {(ArrayLike|TypedArrayLike)} [pool] - array-like object from which to sample\n* @param {Options} [options] - function options\n* @param {PositiveInteger} [options.seed] - integer-valued seed\n* @param {NonNegativeInteger} [options.size] - sample size\n* @param {boolean} [options.replace=true] - boolean indicating whether to sample with replacement\n* @param {boolean} [options.mutate=false] - boolean indicating whether to mutate the `pool` when sampling without replacement\n* @throws {TypeError} `pool` must be an array-like object\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {Function} function to sample elements from an array-like object\n*\n* @example\n* var sample = factory({\n* 'seed': 232\n* });\n* var out = sample( 'abcdefg' );\n* // e.g., returns [ 'g', 'd', 'g', 'f', 'c', 'e', 'f' ]\n*\n* @example\n* var sample = factory( [ 1, 2, 3, 4, 5, 6 ], {\n* 'seed': 232,\n* 'size': 2\n* });\n* var out = sample();\n* // e.g., returns [ 6, 4 ]\n*\n* out = sample();\n* // e.g., returns [ 6, 5 ]\n*\n* @example\n* var sample = factory( [ 1, 2, 3, 4, 5, 6 ], {\n* 'seed': 474,\n* 'size': 3,\n* 'mutate': true,\n* 'replace': false\n* });\n* var out = sample();\n* // e.g., returns [ 4, 3, 6 ]\n*\n* out = sample();\n* // e.g., returns [ 1, 5, 2 ]\n*\n* out = sample();\n* // returns null\n*\n* @example\n* var sample = factory( [ 0, 1 ], {\n* 'size': 2\n* });\n*\n* var out = sample();\n* // e.g., returns [ 1, 1 ]\n*\n* out = sample({\n* 'size': 10\n* });\n* // e.g., returns [ 0, 1, 1, 1, 0, 1, 0, 0, 1, 1 ]\n*\n* @example\n* var sample = factory( [ 0, 1 ], {\n* 'size': 2\n* });\n*\n* var out = sample();\n* // e.g., returns [ 1, 1 ]\n*\n* out = sample({\n* 'replace': false\n* });\n* // e.g., returns [ 0, 1 ] or [ 1, 0 ]\n*\n* out = sample();\n* // e.g., returns [ 1, 1 ]\n*\n* @example\n* var sample = factory( [ 0, 1 ], {\n* 'size': 2,\n* 'mutate': true\n* });\n*\n* var out = sample();\n* // e.g., returns [ 1, 1 ]\n*\n* out = sample({\n* 'replace': false\n* });\n* // e.g., returns [ 0, 1 ] or [ 1, 0 ]\n*\n* out = sample();\n* // returns null\n*/\nfunction factory() {\n\tvar config;\n\tvar pool;\n\tvar conf;\n\tvar rand;\n\tvar err;\n\tvar fcn;\n\n\tconf = copy( defaults );\n\tif ( arguments.length === 1 ) {\n\t\tif ( isArrayLike( arguments[ 0 ] ) || isTypedArrayLike( arguments[ 0 ] ) ) { // eslint-disable-line max-len\n\t\t\tpool = arguments[ 0 ];\n\t\t} else {\n\t\t\tconfig = arguments[ 0 ];\n\t\t\terr = validate( conf, config );\n\t\t}\n\t} else if ( arguments.length > 1 ) {\n\t\tpool = arguments[ 0 ];\n\t\tconfig = arguments[ 1 ];\n\t\tif ( !( isArrayLike( pool ) || isTypedArrayLike( pool ) ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. `%s` argument must be array-like. Value: `%s`.', 'pool', pool ) );\n\t\t}\n\t\terr = validate( conf, config );\n\t}\n\tif ( err ) {\n\t\tthrow err;\n\t}\n\tif ( config && config.seed ) {\n\t\trand = randu({\n\t\t\t'seed': config.seed\n\t\t});\n\t} else {\n\t\trand = randu();\n\t}\n\tif ( pool === void 0 ) {\n\t\tfcn = sample1;\n\t} else {\n\t\tif ( isString( pool ) ) {\n\t\t\tpool = pool.split( '' );\n\t\t} else {\n\t\t\tpool = copy( pool );\n\t\t}\n\t\tfcn = sample2;\n\t}\n\tsetReadOnly( fcn, 'seed', rand.seed );\n\tsetReadOnly( fcn, 'PRNG', rand );\n\n\trand = rand.normalized;\n\n\treturn fcn;\n\n\t/**\n\t* Samples elements from an array-like object.\n\t*\n\t* @private\n\t* @param {(ArrayLike|TypedArrayLike)} x - array-like object from which to sample elements\n\t* @param {Options} [options] - function options\n\t* @param {NonNegativeInteger} [options.size] - sample size\n\t* @param {ProbabilityArray} [options.probs] - element probabilities\n\t* @param {boolean} [options.replace=true] - boolean indicating whether to sample with replacement\n\t* @throws {TypeError} first argument must be array-like\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {RangeError} `size` option must be less than or equal to the length of `x` when the `replace` option is `false`\n\t* @returns {Array} sample\n\t*/\n\tfunction sample1( x, options ) {\n\t\tvar replace;\n\t\tvar xcopy;\n\t\tvar probs;\n\t\tvar opts;\n\t\tvar size;\n\t\tvar err;\n\n\t\tif ( !( isArrayLike( x ) || isTypedArrayLike( x ) ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be array-like. Value: `%s`.', x ) );\n\t\t}\n\t\tif ( isString( x ) ) {\n\t\t\tx = x.split( '' );\n\t\t}\n\t\topts = {};\n\t\tif ( arguments.length > 1 ) {\n\t\t\terr = validate( opts, options );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tif ( opts.replace === void 0 ) {\n\t\t\treplace = conf.replace;\n\t\t} else {\n\t\t\treplace = opts.replace;\n\t\t}\n\t\tif ( opts.probs !== void 0 ) {\n\t\t\tprobs = opts.probs;\n\t\t}\n\t\tif ( opts.size ) {\n\t\t\tsize = opts.size;\n\t\t} else if ( conf.size ) {\n\t\t\tsize = conf.size;\n\t\t} else {\n\t\t\tsize = x.length;\n\t\t}\n\t\tif (\n\t\t\treplace === false &&\n\t\t\tsize > x.length\n\t\t) {\n\t\t\tthrow new RangeError( format( 'invalid option. `size` option must be less than or equal to the length of `x` when `replace` is `false`. Option: `%s`.', size ) );\n\t\t}\n\t\t// Custom probabilities...\n\t\tif ( probs ) {\n\t\t\tif ( replace ) {\n\t\t\t\treturn vose( x, size, rand, probs );\n\t\t\t}\n\t\t\treturn renormalizing( x, size, rand, probs );\n\t\t}\n\t\t// All elements equally likely...\n\t\tif ( replace ) {\n\t\t\treturn discreteUniform( x, size, rand );\n\t\t}\n\t\txcopy = slice.call( x );\n\t\treturn fisherYates( xcopy, size, rand );\n\t}\n\n\t/**\n\t* Samples elements from a population.\n\t*\n\t* @private\n\t* @param {Options} [options] - function options\n\t* @param {NonNegativeInteger} [options.size] - sample size\n\t* @param {boolean} [options.replace=true] - boolean indicating whether to sample with replacement\n\t* @param {boolean} [options.mutate=false] - boolean indicating whether to mutate the `pool` when sampling without replacement\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {RangeError} `size` option must be less than or equal to the population when the `replace` option is `false`\n\t* @returns {Array} sample\n\t*/\n\tfunction sample2( options ) {\n\t\tvar replace;\n\t\tvar mutate;\n\t\tvar opts;\n\t\tvar size;\n\t\tvar err;\n\t\tvar out;\n\n\t\tif ( pool.length === 0 ) {\n\t\t\treturn null;\n\t\t}\n\t\topts = {};\n\t\tif ( arguments.length ) {\n\t\t\terr = validate( opts, options );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tif ( opts.mutate === void 0 ) {\n\t\t\tmutate = conf.mutate;\n\t\t} else {\n\t\t\tmutate = opts.mutate;\n\t\t}\n\t\tif ( opts.replace === void 0 ) {\n\t\t\treplace = conf.replace;\n\t\t} else {\n\t\t\treplace = opts.replace;\n\t\t}\n\t\tif ( opts.size ) {\n\t\t\tsize = opts.size;\n\t\t} else if ( conf.size ) {\n\t\t\tsize = conf.size;\n\t\t} else {\n\t\t\tsize = pool.length;\n\t\t}\n\t\tif (\n\t\t\treplace === false &&\n\t\t\tsize > pool.length\n\t\t) {\n\t\t\tthrow new RangeError( format( 'invalid option. `size` option must be less than or equal to the population size when `replace` is `false`. Option: `%s`.', size ) );\n\t\t}\n\t\tif ( replace ) {\n\t\t\treturn discreteUniform( pool, size, rand );\n\t\t}\n\t\tout = fisherYates( pool, size, rand );\n\t\tif ( mutate ) {\n\t\t\t// Remove the sample observations:\n\t\t\tpool = pool.slice( size, pool.length );\n\t\t}\n\t\treturn out;\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' );\n\n\n// MAIN //\n\n/**\n* Samples elements from an array-like object.\n*\n* @name sample\n* @type {Function}\n* @param {ArrayLike} x - array-like object from which to sample\n* @param {Options} [options] - function options\n* @param {NonNegativeInteger} [options.size] - sample size\n* @param {ProbabilityArray} [options.probs] - element probabilities\n* @param {boolean} [options.replace=true] - boolean indicating whether to sample with replacement\n* @throws {TypeError} first argument must be array-like\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {RangeError} `size` option must be less than or equal to the length of `x` when the `replace` option is `false`\n* @returns {Array} sample\n*\n* @example\n* var out = sample( [ 3, null, NaN, 'abc', function(){} ] );\n* // e.g., returns [ 3, 'abc', null, 3, null ]\n*/\nvar sample = factory();\n\n\n// EXPORTS //\n\nmodule.exports = sample;\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* Sample elements from an array-like object.\n*\n* @module @stdlib/random/sample\n*\n* @example\n* var sample = require( '@stdlib/random/sample' );\n*\n* var out = sample( 'abc' );\n* // e.g., returns [ 'a', 'a', 'b' ]\n*\n* out = sample( [ 3, 6, 9 ] );\n* // e.g., returns [ 3, 9, 6 ]\n*\n* var bool = ( out.length === 3 );\n* // returns true\n*\n* @example\n* var sample = require( '@stdlib/random/sample' );\n*\n* var mysample = sample.factory({\n* 'seed': 323\n* });\n* var out = mysample( [ 3, 6, 9 ], {\n* 'size': 10\n* });\n* // e.g., returns [ 3, 9, 3, 3, 3, 6, 3, 3, 3, 6 ]\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", "{\n\t\"copy\": \"shallow\"\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'use strict';\n\n// MODULES //\n\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar indexOf = require( '@stdlib/utils/index-of' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar COPY_OPTIONS = [ 'deep', 'shallow', 'none' ];\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination for validated options\n* @param {Options} options - function options\n* @param {string} [options.copy] - string denoting whether to return a copy (`deep`, `shallow` or `none`)\n* @returns {(null|Error)} null or an error\n*\n* @example\n* var opts = {};\n* var options = {\n* 'copy': 'shallow'\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t\tif ( !isString( opts.copy ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'copy', opts.copy ) );\n\t\t}\n\t\tif ( indexOf( COPY_OPTIONS, opts.copy ) === -1 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'copy', COPY_OPTIONS.join( '\", \"' ), opts.copy ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar isArrayLike = require( '@stdlib/assert/is-array-like' );\nvar isTypedArrayLike = require( '@stdlib/assert/is-typed-array-like' );\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar deepCopy = require( '@stdlib/utils/copy' );\nvar floor = require( '@stdlib/math/base/special/floor' );\nvar randu = require( './../../base/mt19937' ).factory;\nvar format = require( '@stdlib/string/format' );\nvar defaults = require( './defaults.json' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function to create a random permutation of elements from an array-like object.\n*\n* @param {Options} [config] - function options\n* @param {PositiveInteger} [config.seed] - integer-valued seed\n* @param {string} [config.copy=\"shallow\"] - default copy option (`deep`, `shallow` or `none`)\n* @throws {TypeError} options argument must be an object\n* @returns {Function} shuffle function\n*\n* @example\n* var shuffle = factory({\n* 'seed': 249\n* });\n* var data = [ 3, 8, 4, 8 ];\n* var out = shuffle( data );\n* // e.g., returns [ 4, 3, 8, 8 ]\n*/\nfunction factory( config ) {\n\tvar conf;\n\tvar rand;\n\tvar err;\n\n\tconf = deepCopy( defaults );\n\tif ( arguments.length ) {\n\t\terr = validate( conf, config );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\tif ( config && config.seed ) {\n\t\trand = randu({\n\t\t\t'seed': config.seed\n\t\t});\n\t} else {\n\t\trand = randu();\n\t}\n\tsetReadOnly( shuffle, 'seed', rand.seed );\n\tsetReadOnly( shuffle, 'PRNG', rand );\n\n\trand = rand.normalized;\n\n\treturn shuffle;\n\n\t/**\n\t* Returns a random permutation of elements in `arr`.\n\t*\n\t* @private\n\t* @param {(ArrayLike|TypedArrayLike)} arr - array-like object to shuffle\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.copy] - string indicating whether to return a copy (`deep`,`shallow` or `none`)\n\t* @throws {TypeError} first argument must be array-like\n\t* @throws {TypeError} options must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {ArrayLike} the shuffled array-like object\n\t*\n\t* @example\n\t* var data = [ 1, 2, 3 ];\n\t* var out = shuffle( data );\n\t* // e.g., returns [ 3, 1, 2 ]\n\t*\n\t* @example\n\t* var data = [ 1, 2, 3 ];\n\t* var out = shuffle( data, {\n\t* 'copy': 'none'\n\t* });\n\t* var bool = ( data === out );\n\t* // returns true\n\t*/\n\tfunction shuffle( arr, options ) {\n\t\tvar strflg;\n\t\tvar level;\n\t\tvar copy;\n\t\tvar opts;\n\t\tvar err;\n\t\tvar out;\n\t\tvar tmp;\n\t\tvar N;\n\t\tvar i;\n\t\tvar j;\n\n\t\tif ( !( isArrayLike( arr ) || isTypedArrayLike( arr ) ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be array-like. Value: `%s`.', arr ) );\n\t\t}\n\t\tif ( arguments.length > 1 ) {\n\t\t\topts = {};\n\t\t\terr = validate( opts, options );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tcopy = ( opts && opts.copy ) ? opts.copy : conf.copy;\n\n\t\tstrflg = isString( arr );\n\t\tif ( strflg ) {\n\t\t\tarr = arr.split( '' );\n\t\t\tcopy = 'none';\n\t\t}\n\n\t\tlevel = 0;\n\t\tif ( copy === 'shallow' ) {\n\t\t\tlevel += 1;\n\t\t} else if ( copy === 'deep' ) {\n\t\t\tlevel += 2;\n\t\t}\n\t\tN = arr.length;\n\t\tout = deepCopy( arr, level );\n\n\t\t// Note: we skip the first element, as no further swaps are possible given that all other indices are excluded from swapping...\n\t\tfor ( i = N - 1; i > 0; i-- ) {\n\t\t\t// Generate an integer index on the interval [0,i]:\n\t\t\tj = floor( rand() * (i+1.0) );\n\n\t\t\t// Swap elements:\n\t\t\ttmp = out[ i ];\n\t\t\tout[ i ] = out[ j ];\n\t\t\tout[ j ] = tmp;\n\t\t}\n\n\t\tif ( strflg ) {\n\t\t\tout = arr.join( '' );\n\t\t}\n\t\treturn out;\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' );\n\n\n// MAIN //\n\n/**\n* Returns a random permutation of elements in `arr`.\n*\n* @name shuffle\n* @type {Function}\n* @param {ArrayLike} arr - array-like object to shuffle\n* @param {Options} [options] - function options\n* @param {string} [options.copy=\"shallow\"] - string indicating whether to return a copy (`deep`,`shallow` or `none`)\n* @throws {TypeError} options must be an object\n* @throws {TypeError} must provide valid options\n* @returns {ArrayLike} the shuffled array-like object\n*\n* @example\n* var data = [ 1, 2, 3 ];\n* var out = shuffle( data );\n* // e.g., returns [ 3, 1, 2 ]\n*\n* @example\n* var data = [ 1, 2, 3 ];\n* var out = shuffle( data, {\n* 'copy': 'none'\n* });\n* var bool = ( data === out );\n* // returns true\n*/\nvar shuffle = factory();\n\n\n// EXPORTS //\n\nmodule.exports = shuffle;\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* Return a random permutation of elements from an array-like object.\n*\n* @module @stdlib/random/shuffle\n*\n* @example\n* var shuffle = require( '@stdlib/random/shuffle' );\n*\n* var data = [ 1, 2, 3 ];\n* var out = shuffle( data );\n* // e.g., returns [ 3, 1, 2 ]\n*\n* out = shuffle( data, {\n* 'copy': 'none'\n* });\n*\n* var bool = ( data === out );\n* // returns true\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", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:arcsine' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rarcsine = require( './../../../base/arcsine' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from an arcsine distribution.\n*\n* @constructor\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {RangeError} `a` must be less than `b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( a, b, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( a, b, options );\n\t\t}\n\t\treturn new RandomStream( a, b );\n\t}\n\tif ( !isNumber( a ) || isnan( a ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', a ) );\n\t}\n\tif ( !isNumber( b ) || isnan( b ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a number and not NaN. Value: `%s`.', b ) );\n\t}\n\tif ( a >= b ) {\n\t\tthrow new RangeError( format( 'invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.', a, b ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rarcsine( a, b, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar format = require( '@stdlib/string/format' );\nvar assign = require( '@stdlib/object/assign' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from an arcsine distribution.\n*\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {RangeError} `a` must be less than `b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( a, b, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( a, b, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from an arcsine distribution.\n*\n* @param {number} [a] - minimum support\n* @param {number} [b] - maximum support\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( a, b, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( a ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', a ) );\n\t\t}\n\t\topts = assign( {}, a );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from an arcsine distribution.\n\t*\n\t* @private\n\t* @param {number} a - minimum support\n\t* @param {number} b - maximum support\n\t* @throws {TypeError} `a` must be a number\n\t* @throws {TypeError} `b` must be a number\n\t* @throws {RangeError} `a` must be less than `b`\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( a, b ) {\n\t\treturn new RandomStream( a, b, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from an arcsine distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `a` must be a number\n\t* @throws {TypeError} `b` must be a number\n\t* @throws {RangeError} `a` must be less than `b`\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( a, b, opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from an arcsine distribution.\n*\n* @module @stdlib/random/streams/arcsine\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/arcsine' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/arcsine' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/arcsine' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:bernoulli' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isProbability = require( '@stdlib/assert/is-probability' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rbern = require( './../../../base/bernoulli' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a Bernoulli distribution.\n*\n* @constructor\n* @param {Probability} p - success probability\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `p` must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 0.5, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( p, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 1 ) {\n\t\t\treturn new RandomStream( p, options );\n\t\t}\n\t\treturn new RandomStream( p );\n\t}\n\tif ( !isProbability( p ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a probability. Value: `%s`.', p ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rbern( p, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar format = require( '@stdlib/string/format' );\nvar assign = require( '@stdlib/object/assign' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a Bernoulli distribution.\n*\n* @param {Probability} p - success probability\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `p` must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 0.7, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( p, options ) {\n\tvar opts;\n\tif ( arguments.length > 1 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( p, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar isProbability = require( '@stdlib/assert/is-probability' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar assign = require( '@stdlib/object/assign' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a Bernoulli distribution.\n*\n* @param {Probability} [p] - success probability\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 0.3 ) );\n* }\n*/\nfunction factory( p, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs > 1 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\tfcn = createStream2;\n\t\topts = assign( {}, options );\n\t} else if ( nargs === 1 ) {\n\t\tif ( isProbability( p ) ) {\n\t\t\tfcn = createStream2;\n\t\t\topts = {};\n\t\t} else {\n\t\t\tif ( !isPlainObject( p ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', p ) );\n\t\t\t}\n\t\t\topts = assign( {}, p );\n\t\t\tfcn = createStream1;\n\t\t}\n\t} else {\n\t\topts = {};\n\t\tfcn = createStream1;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Bernoulli distribution.\n\t*\n\t* @private\n\t* @param {Probability} p - success probability\n\t* @throws {TypeError} `p` must be a probability\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( p ) {\n\t\treturn new RandomStream( p, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Bernoulli distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `p` must be a probability\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( p, opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from a Bernoulli distribution.\n*\n* @module @stdlib/random/streams/bernoulli\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/bernoulli' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 0.2, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/bernoulli' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 0.2 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/bernoulli' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 0.2, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:beta' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rbeta = require( './../../../base/beta' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a beta distribution.\n*\n* @constructor\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( alpha, beta, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( alpha, beta, options );\n\t\t}\n\t\treturn new RandomStream( alpha, beta );\n\t}\n\tif ( !isPositiveNumber( alpha ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositiveNumber( beta ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rbeta( alpha, beta, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar format = require( '@stdlib/string/format' );\nvar assign = require( '@stdlib/object/assign' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a beta distribution.\n*\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( alpha, beta, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( alpha, beta, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a beta distribution.\n*\n* @param {PositiveNumber} [alpha] - first shape parameter\n* @param {PositiveNumber} [beta] - second shape parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( alpha, beta, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( alpha ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', alpha ) );\n\t\t}\n\t\topts = assign( {}, alpha );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a beta distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} alpha - first shape parameter\n\t* @param {PositiveNumber} beta - second shape parameter\n\t* @throws {TypeError} `alpha` must be a positive number\n\t* @throws {TypeError} `beta` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( alpha, beta ) {\n\t\treturn new RandomStream( alpha, beta, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a beta distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `alpha` must be a positive number\n\t* @throws {TypeError} `beta` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( alpha, beta, opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from a beta distribution.\n*\n* @module @stdlib/random/streams/beta\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/beta' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/beta' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/beta' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:betaprime' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rbetaprime = require( './../../../base/betaprime' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a beta prime distribution.\n*\n* @constructor\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( alpha, beta, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( alpha, beta, options );\n\t\t}\n\t\treturn new RandomStream( alpha, beta );\n\t}\n\tif ( !isPositiveNumber( alpha ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositiveNumber( beta ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rbetaprime( alpha, beta, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar format = require( '@stdlib/string/format' );\nvar assign = require( '@stdlib/object/assign' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a beta prime distribution.\n*\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( alpha, beta, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( alpha, beta, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a beta prime distribution.\n*\n* @param {PositiveNumber} [alpha] - first shape parameter\n* @param {PositiveNumber} [beta] - second shape parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( alpha, beta, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( alpha ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', alpha ) );\n\t\t}\n\t\topts = assign( {}, alpha );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a beta prime distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} alpha - first shape parameter\n\t* @param {PositiveNumber} beta - second shape parameter\n\t* @throws {TypeError} `alpha` must be a positive number\n\t* @throws {TypeError} `beta` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( alpha, beta ) {\n\t\treturn new RandomStream( alpha, beta, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a beta prime distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `alpha` must be a positive number\n\t* @throws {TypeError} `beta` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( alpha, beta, opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from a beta prime distribution.\n*\n* @module @stdlib/random/streams/betaprime\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/betaprime' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/betaprime' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/betaprime' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isPlainObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:binomial' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isProbability = require( '@stdlib/assert/is-probability' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rbinom = require( './../../../base/binomial' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a binomial distribution.\n*\n* @constructor\n* @param {PositiveInteger} n - number of trials\n* @param {Probability} p - success probability\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `n` must be a positive integer\n* @throws {TypeError} `p` must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 20, 0.2, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( n, p, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( n, p, options );\n\t\t}\n\t\treturn new RandomStream( n, p );\n\t}\n\tif ( !isPositiveInteger( n ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive integer. Value: `%s`.', n ) );\n\t}\n\tif ( !isProbability( p ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a probability. Value: `%s`.', p ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rbinom( n, p, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a binomial distribution.\n*\n* @param {PositiveInteger} n - number of trials\n* @param {Probability} p - success probability\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `n` must be a positive integer\n* @throws {TypeError} `p` must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 20, 0.1, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( n, p, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isPlainObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( n, p, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a binomial distribution.\n*\n* @param {PositiveInteger} [n] - number of trials\n* @param {Probability} [p] - second shape parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 20, 0.5 ) );\n* }\n*/\nfunction factory( n, p, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( n ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', n ) );\n\t\t}\n\t\topts = assign( {}, n );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a binomial distribution.\n\t*\n\t* @private\n\t* @param {PositiveInteger} n - number of trials\n\t* @param {Probability} p - success probability\n\t* @throws {TypeError} `n` must be a positive integer\n\t* @throws {TypeError} `p` must be a positive probability\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( n, p ) {\n\t\treturn new RandomStream( n, p, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a binomial distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `n` must be a positive integer\n\t* @throws {TypeError} `p` must be a probability\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( n, p, opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from a binomial distribution.\n*\n* @module @stdlib/random/streams/binomial\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/binomial' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 20, 0.4, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/binomial' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 20, 0.4 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/binomial' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 20, 0.4, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:box-muller' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar randn = require( './../../../base/box-muller' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a standard normal distribution using the Box-Muller transform.\n*\n* @constructor\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 0 ) {\n\t\t\treturn new RandomStream( options );\n\t\t}\n\t\treturn new RandomStream();\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 0 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', randn( opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a standard normal distribution using the Box-Muller transform.\n*\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a standard normal distribution using the Box-Muller transform.\n*\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*/\nfunction factory( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\treturn createStream;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a standard normal distribution using the Box-Muller transform.\n\t*\n\t* @private\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream() {\n\t\treturn new RandomStream( opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from a standard normal distribution using the Box-Muller transform.\n*\n* @module @stdlib/random/streams/box-muller\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/box-muller' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/box-muller' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/box-muller' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:cauchy' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rcauchy = require( './../../../base/cauchy' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a Cauchy distribution.\n*\n* @constructor\n* @param {number} x0 - location parameter\n* @param {PositiveNumber} gamma - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `x0` must be a number\n* @throws {TypeError} `gamma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( x0, gamma, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( x0, gamma, options );\n\t\t}\n\t\treturn new RandomStream( x0, gamma );\n\t}\n\tif ( !isNumber( x0 ) || isnan( x0 ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', x0 ) );\n\t}\n\tif ( !isPositiveNumber( gamma ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', gamma ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rcauchy( x0, gamma, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a Cauchy distribution.\n*\n* @param {number} x0 - location parameter\n* @param {PositiveNumber} gamma - scale parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `gamma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( x0, gamma, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( x0, gamma, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a Cauchy distribution.\n*\n* @param {number} [x0] - location parameter\n* @param {PositiveNumber} [gamma] - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( x0, gamma, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( x0 ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', x0 ) );\n\t\t}\n\t\topts = assign( {}, x0 );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Cauchy distribution.\n\t*\n\t* @private\n\t* @param {number} x0 - location parameter\n\t* @param {PositiveNumber} gamma - scale parameter\n\t* @throws {TypeError} `gamma` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( x0, gamma ) {\n\t\treturn new RandomStream( x0, gamma, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Cauchy distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `gamma` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( x0, gamma, opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from a Cauchy distribution.\n*\n* @module @stdlib/random/streams/cauchy\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/cauchy' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/cauchy' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/cauchy' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:chi' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rchi = require( './../../../base/chi' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a chi distribution.\n*\n* @constructor\n* @param {PositiveNumber} k - degrees of freedom\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `k` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( k, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 1 ) {\n\t\t\treturn new RandomStream( k, options );\n\t\t}\n\t\treturn new RandomStream( k );\n\t}\n\tif ( !isPositiveNumber( k ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', k ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rchi( k, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a chi distribution.\n*\n* @param {PositiveNumber} k - degrees of freedom\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `k` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( k, options ) {\n\tvar opts;\n\tif ( arguments.length > 1 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( k, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a chi distribution.\n*\n* @param {PositiveNumber} [k] - degrees of freedom\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 3.0 ) );\n* }\n*/\nfunction factory( k, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs > 1 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\tfcn = createStream2;\n\t\topts = assign( {}, options );\n\t} else if ( nargs === 1 ) {\n\t\tif ( isPositive( k ) ) {\n\t\t\tfcn = createStream2;\n\t\t\topts = {};\n\t\t} else {\n\t\t\tif ( !isPlainObject( k ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', k ) );\n\t\t\t}\n\t\t\topts = assign( {}, k );\n\t\t\tfcn = createStream1;\n\t\t}\n\t} else {\n\t\topts = {};\n\t\tfcn = createStream1;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a chi distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} k - degrees of freedom\n\t* @throws {TypeError} `k` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( k ) {\n\t\treturn new RandomStream( k, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a chi distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `k` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( k, opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from a chi distribution.\n*\n* @module @stdlib/random/streams/chi\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/chi' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/chi' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/chi' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:chisquare' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rchisquare = require( './../../../base/chisquare' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a chi-square distribution.\n*\n* @constructor\n* @param {PositiveNumber} k - degrees of freedom\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `k` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( k, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 1 ) {\n\t\t\treturn new RandomStream( k, options );\n\t\t}\n\t\treturn new RandomStream( k );\n\t}\n\tif ( !isPositiveNumber( k ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', k ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rchisquare( k, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a chi-square distribution.\n*\n* @param {PositiveNumber} k - degrees of freedom\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `k` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( k, options ) {\n\tvar opts;\n\tif ( arguments.length > 1 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, opts );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( k, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a chi-square distribution.\n*\n* @param {PositiveNumber} [k] - degrees of freedom\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 3.0 ) );\n* }\n*/\nfunction factory( k, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs > 1 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\tfcn = createStream2;\n\t\topts = assign( {}, options);\n\t} else if ( nargs === 1 ) {\n\t\tif ( isPositive( k ) ) {\n\t\t\tfcn = createStream2;\n\t\t\topts = {};\n\t\t} else {\n\t\t\tif ( !isPlainObject( k ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', k ) );\n\t\t\t}\n\t\t\topts = assign( {}, k );\n\t\t\tfcn = createStream1;\n\t\t}\n\t} else {\n\t\topts = {};\n\t\tfcn = createStream1;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a chi-square distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} k - degrees of freedom\n\t* @throws {TypeError} `k` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( k ) {\n\t\treturn new RandomStream( k, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a chi-square distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `k` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( k, opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from a chi-square distribution.\n*\n* @module @stdlib/random/streams/chisquare\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/chisquare' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/chisquare' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/chisquare' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:cosine' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rcosine = require( './../../../base/cosine' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a raised cosine distribution.\n*\n* @constructor\n* @param {number} mu - location parameter\n* @param {PositiveNumber} s - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( mu, s, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( mu, s, options );\n\t\t}\n\t\treturn new RandomStream( mu, s );\n\t}\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositiveNumber( s ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', s ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rcosine( mu, s, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a raised cosine distribution.\n*\n* @param {number} mu - location parameter\n* @param {PositiveNumber} s - scale parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( mu, s, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( mu, s, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a raised cosine distribution.\n*\n* @param {number} [mu] - location parameter\n* @param {PositiveNumber} [s] - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( mu, s, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( mu ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', mu ) );\n\t\t}\n\t\topts = assign( {}, mu );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a raised cosine distribution.\n\t*\n\t* @private\n\t* @param {number} mu - location parameter\n\t* @param {PositiveNumber} s - scale parameter\n\t* @throws {TypeError} `s` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( mu, s ) {\n\t\treturn new RandomStream( mu, s, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a raised cosine distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `s` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( mu, s, opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from a raised cosine distribution.\n*\n* @module @stdlib/random/streams/cosine\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/cosine' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/cosine' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/cosine' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:discrete-uniform' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isInteger = require( '@stdlib/assert/is-integer' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rduniform = require( './../../../base/discrete-uniform' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a discrete uniform distribution.\n*\n* @constructor\n* @param {integer} a - minimum support\n* @param {integer} b - maximum support\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `a` must be an integer\n* @throws {TypeError} `b` must be an integer\n* @throws {RangeError} `a` must be less than or equal to `b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2, 5, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( a, b, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( a, b, options );\n\t\t}\n\t\treturn new RandomStream( a, b );\n\t}\n\tif ( !isInteger( a ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', a ) );\n\t}\n\tif ( !isInteger( b ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', b ) );\n\t}\n\tif ( a > b ) {\n\t\tthrow new RangeError( format( 'invalid argument. Minimum support must be less than or equal to maximum support. Value: `[%d, %d]`.', a, b ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rduniform( a, b, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a discrete uniform distribution.\n*\n* @param {integer} a - minimum support\n* @param {integer} b - maximum support\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `a` must be an integer\n* @throws {TypeError} `b` must be an integer\n* @throws {RangeError} `a` must be less than or equal to `b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2, 5, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( a, b, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( a, b, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a discrete uniform distribution.\n*\n* @param {integer} [a] - minimum support\n* @param {integer} [b] - maximum support\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2, 5 ) );\n* }\n*/\nfunction factory( a, b, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( a ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', a ) );\n\t\t}\n\t\topts = assign( {}, a );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a discrete uniform distribution.\n\t*\n\t* @private\n\t* @param {integer} a - minimum support\n\t* @param {integer} b - maximum support\n\t* @throws {TypeError} `a` must be an integer\n\t* @throws {TypeError} `b` must be an integer\n\t* @throws {RangeError} `a` must be less than or equal to `b`\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( a, b ) {\n\t\treturn new RandomStream( a, b, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a discrete uniform distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `a` must be an integer\n\t* @throws {TypeError} `b` must be an integer\n\t* @throws {RangeError} `a` must be less than or equal to `b`\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( a, b, opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from a discrete uniform distribution.\n*\n* @module @stdlib/random/streams/discrete-uniform\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/discrete-uniform' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2, 5, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/discrete-uniform' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2, 5 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/discrete-uniform' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2, 5, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:erlang' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rerlang = require( './../../../base/erlang' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from an Erlang distribution.\n*\n* @constructor\n* @param {PositiveInteger} k - shape parameter\n* @param {PositiveNumber} lambda - rate parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `k` must be a positive integer\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( k, lambda, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( k, lambda, options );\n\t\t}\n\t\treturn new RandomStream( k, lambda );\n\t}\n\tif ( !isPositiveInteger( k ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive integer. Value: `%s`.', k ) );\n\t}\n\tif ( !isPositiveNumber( lambda ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', lambda ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rerlang( k, lambda, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from an Erlang distribution.\n*\n* @param {PositiveInteger} k - shape parameter\n* @param {PositiveNumber} lambda - rate parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `k` must be a positive integer\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( k, lambda, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( k, lambda, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from an Erlang distribution.\n*\n* @param {PositiveInteger} [k] - shape parameter\n* @param {PositiveNumber} [lambda] - rate parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2, 5.0 ) );\n* }\n*/\nfunction factory( k, lambda, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( k ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', k ) );\n\t\t}\n\t\topts = assign( {}, k );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from an Erlang distribution.\n\t*\n\t* @private\n\t* @param {PositiveInteger} k - shape parameter\n\t* @param {PositiveNumber} lambda - rate parameter\n\t* @throws {TypeError} `k` must be a positive integer\n\t* @throws {TypeError} `lambda` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( k, lambda ) {\n\t\treturn new RandomStream( k, lambda, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from an Erlang distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `k` must be a positive integer\n\t* @throws {TypeError} `lambda` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( k, lambda, opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from an Erlang distribution.\n*\n* @module @stdlib/random/streams/erlang\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/erlang' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/erlang' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/erlang' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:exponential' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rexponential = require( './../../../base/exponential' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from an exponential distribution.\n*\n* @constructor\n* @param {PositiveNumber} lambda - rate parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( lambda, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 1 ) {\n\t\t\treturn new RandomStream( lambda, options );\n\t\t}\n\t\treturn new RandomStream( lambda );\n\t}\n\tif ( !isPositiveNumber( lambda ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', lambda ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rexponential( lambda, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from an exponential distribution.\n*\n* @param {PositiveNumber} lambda - rate parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( lambda, options ) {\n\tvar opts;\n\tif ( arguments.length > 1 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( lambda, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from an exponential distribution.\n*\n* @param {PositiveNumber} [lambda] - rate parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 3.0 ) );\n* }\n*/\nfunction factory( lambda, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs > 1 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\tfcn = createStream2;\n\t\topts = assign( {}, options );\n\t} else if ( nargs === 1 ) {\n\t\tif ( isPositive( lambda ) ) {\n\t\t\tfcn = createStream2;\n\t\t\topts = {};\n\t\t} else {\n\t\t\tif ( !isPlainObject( lambda ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', lambda ) );\n\t\t\t}\n\t\t\topts = assign( {}, lambda );\n\t\t\tfcn = createStream1;\n\t\t}\n\t} else {\n\t\topts = {};\n\t\tfcn = createStream1;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from an exponential distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} lambda - rate parameter\n\t* @throws {TypeError} `lambda` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( lambda ) {\n\t\treturn new RandomStream( lambda, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from an exponential distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `lambda` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( lambda, opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from an exponential distribution.\n*\n* @module @stdlib/random/streams/exponential\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/exponential' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/exponential' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/exponential' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:f' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rf = require( './../../../base/f' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from an F distribution.\n*\n* @constructor\n* @param {PositiveNumber} d1 - degrees of freedom\n* @param {PositiveNumber} d2 - degrees of freedom\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `d1` must be a positive number\n* @throws {TypeError} `d2` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( d1, d2, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( d1, d2, options );\n\t\t}\n\t\treturn new RandomStream( d1, d2 );\n\t}\n\tif ( !isPositiveNumber( d1 ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', d1 ) );\n\t}\n\tif ( !isPositiveNumber( d2 ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', d2 ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rf( d1, d2, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from an F distribution.\n*\n* @param {PositiveNumber} d1 - degrees of freedom\n* @param {PositiveNumber} d2 - degrees of freedom\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `d1` must be a positive number\n* @throws {TypeError} `d2` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( d1, d2, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( d1, d2, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from an F distribution.\n*\n* @param {PositiveNumber} [d1] - degrees of freedom\n* @param {PositiveNumber} [d2] - degrees of freedom\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( d1, d2, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( d1 ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', d1 ) );\n\t\t}\n\t\topts = assign( {}, d1 );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from an F distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} d1 - degrees of freedom\n\t* @param {PositiveNumber} d2 - degrees of freedom\n\t* @throws {TypeError} `d1` must be a positive number\n\t* @throws {TypeError} `d2` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( d1, d2 ) {\n\t\treturn new RandomStream( d1, d2, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from an F distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `d1` must be a positive number\n\t* @throws {TypeError} `d2` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( d1, d2, opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from an F distribution.\n*\n* @module @stdlib/random/streams/f\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/f' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/f' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/f' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:frechet' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' );\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rfrechet = require( './../../../base/frechet' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a Fr\u00E9chet distribution.\n*\n* @constructor\n* @param {PositiveNumber} [alpha] - shape parameter\n* @param {PositiveNumber} [s] - scale parameter\n* @param {number} [m] - location parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} `m` must be a number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, 1.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( alpha, s, m, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 3 ) {\n\t\t\treturn new RandomStream( alpha, s, m, options );\n\t\t}\n\t\treturn new RandomStream( alpha, s, m );\n\t}\n\tif ( !isPositiveNumber( alpha ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number and not NaN. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositiveNumber( s ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number and not NaN. Value: `%s`.', s ) );\n\t}\n\tif ( !isNumber( m ) || isnan( m ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a number. Value: `%s`.', m ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 3 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rfrechet( alpha, s, m, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a Fr\u00E9chet distribution.\n*\n* @param {PositiveNumber} [alpha] - shape parameter\n* @param {PositiveNumber} [s] - scale parameter\n* @param {number} [m] - location parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} `m` must be a number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 5.0, -1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( alpha, s, m, options ) {\n\tvar opts;\n\tif ( arguments.length > 3 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( alpha, s, m, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a Fr\u00E9chet distribution.\n*\n* @param {PositiveNumber} [alpha] - shape parameter\n* @param {PositiveNumber} [s] - scale parameter\n* @param {number} [m] - location parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0, 0.0 ) );\n* }\n*/\nfunction factory( alpha, s, m, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( alpha ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', alpha ) );\n\t\t}\n\t\topts = assign( {}, alpha );\n\t} else if ( nargs > 3 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 3 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Fr\u00E9chet distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} alpha - shape parameter\n\t* @param {PositiveNumber} s - scale parameter\n\t* @param {number} m - location parameter\n\t* @throws {TypeError} `alpha` must be a positive number\n\t* @throws {TypeError} `s` must be a positive number\n\t* @throws {TypeError} `m` must be a number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( alpha, s, m ) {\n\t\treturn new RandomStream( alpha, s, m, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Fr\u00E9chet distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `alpha` must be a positive number\n\t* @throws {TypeError} `s` must be a positive number\n\t* @throws {TypeError} `m` must be a number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( alpha, s, m, opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from a Fr\u00E9chet distribution.\n*\n* @module @stdlib/random/streams/frechet\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/frechet' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 5.0, 3.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/frechet' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0, -2.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/frechet' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 5.0, 0.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:gamma' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rgamma = require( './../../../base/gamma' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a gamma distribution.\n*\n* @constructor\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - rate parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( alpha, beta, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( alpha, beta, options );\n\t\t}\n\t\treturn new RandomStream( alpha, beta );\n\t}\n\tif ( !isPositiveNumber( alpha ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositiveNumber( beta ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rgamma( alpha, beta, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a gamma distribution.\n*\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - rate parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( alpha, beta, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( alpha, beta, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a gamma distribution.\n*\n* @param {PositiveNumber} [alpha] - shape parameter\n* @param {PositiveNumber} [beta] - rate parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( alpha, beta, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( alpha ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', alpha ) );\n\t\t}\n\t\topts = assign( {}, alpha );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a gamma distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} alpha - shape parameter\n\t* @param {PositiveNumber} beta - rate parameter\n\t* @throws {TypeError} `alpha` must be a positive number\n\t* @throws {TypeError} `beta` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( alpha, beta ) {\n\t\treturn new RandomStream( alpha, beta, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a gamma distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `alpha` must be a positive number\n\t* @throws {TypeError} `beta` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( alpha, beta, opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from a gamma distribution.\n*\n* @module @stdlib/random/streams/gamma\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/gamma' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/gamma' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/gamma' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:geometric' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isProbability = require( '@stdlib/assert/is-probability' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rgeom = require( './../../../base/geometric' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a geometric distribution.\n*\n* @constructor\n* @param {Probability} p - success probability\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `p` must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 0.5, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( p, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 1 ) {\n\t\t\treturn new RandomStream( p, options );\n\t\t}\n\t\treturn new RandomStream( p );\n\t}\n\tif ( !isProbability( p ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a probability. Value: `%s`.', p ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rgeom( p, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a geometric distribution.\n*\n* @param {Probability} p - success probability\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `p` must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 0.7, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( p, options ) {\n\tvar opts;\n\tif ( arguments.length > 1 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( p, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isProbability = require( '@stdlib/assert/is-probability' ).isPrimitive;\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a geometric distribution.\n*\n* @param {Probability} [p] - success probability\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 0.3 ) );\n* }\n*/\nfunction factory( p, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs > 1 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\tfcn = createStream2;\n\t\topts = assign( {}, options );\n\t} else if ( nargs === 1 ) {\n\t\tif ( isProbability( p ) ) {\n\t\t\tfcn = createStream2;\n\t\t\topts = {};\n\t\t} else {\n\t\t\tif ( !isPlainObject( p ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', p ) );\n\t\t\t}\n\t\t\topts = assign( {}, p );\n\t\t\tfcn = createStream1;\n\t\t}\n\t} else {\n\t\topts = {};\n\t\tfcn = createStream1;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a geometric distribution.\n\t*\n\t* @private\n\t* @param {Probability} p - success probability\n\t* @throws {TypeError} `p` must be a probability\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( p ) {\n\t\treturn new RandomStream( p, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a geometric distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `p` must be a probability\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( p, opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from a geometric distribution.\n*\n* @module @stdlib/random/streams/geometric\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/geometric' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 0.2, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/geometric' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 0.2 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/geometric' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 0.2, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:gumbel' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rgumbel = require( './../../../base/gumbel' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a Gumbel distribution.\n*\n* @constructor\n* @param {number} mu - mean\n* @param {PositiveNumber} beta - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( mu, beta, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( mu, beta, options );\n\t\t}\n\t\treturn new RandomStream( mu, beta );\n\t}\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositiveNumber( beta ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rgumbel( mu, beta, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a Gumbel distribution.\n*\n* @param {number} mu - mean\n* @param {PositiveNumber} beta - scale parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( mu, beta, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( mu, beta, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a Gumbel distribution.\n*\n* @param {number} [mu] - mean\n* @param {PositiveNumber} [beta] - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( mu, beta, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( mu ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', mu ) );\n\t\t}\n\t\topts = assign( {}, mu );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Gumbel distribution.\n\t*\n\t* @private\n\t* @param {number} mu - mean\n\t* @param {PositiveNumber} beta - scale parameter\n\t* @throws {TypeError} `mu` must be a number\n\t* @throws {TypeError} `beta` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( mu, beta ) {\n\t\treturn new RandomStream( mu, beta, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Gumbel distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `mu` must be a number\n\t* @throws {TypeError} `beta` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( mu, beta, opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from a Gumbel distribution.\n*\n* @module @stdlib/random/streams/gumbel\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/gumbel' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/gumbel' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/gumbel' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:hypergeometric' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rhypergeom = require( './../../../base/hypergeometric' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a hypergeometric distribution.\n*\n* @constructor\n* @param {NonNegativeInteger} [N] - population size\n* @param {NonNegativeInteger} [K] - subpopulation size\n* @param {NonNegativeInteger} [n] - number of draws\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `N` must be a nonnegative integer\n* @throws {TypeError} `K` must be a nonnegative integer\n* @throws {TypeError} `n` must be a nonnegative integer\n* @throws {RangeError} `n` must be less than or equal to `N`\n* @throws {RangeError} `K` must be less than or equal to `N`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 20, 10, 7, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( N, K, n, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 3 ) {\n\t\t\treturn new RandomStream( N, K, n, options );\n\t\t}\n\t\treturn new RandomStream( N, K, n );\n\t}\n\tif ( !isNonNegativeInteger( N ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', N ) );\n\t}\n\tif ( !isNonNegativeInteger( K ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a nonnegative integer. Value: `%s`.', K ) );\n\t}\n\tif ( !isNonNegativeInteger( n ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a nonnegative integer. Value: `%s`.', n ) );\n\t}\n\tif ( n > N ) {\n\t\tthrow new RangeError( 'invalid argument. Third argument must be less than or equal to the first argument.' );\n\t}\n\tif ( K > N ) {\n\t\tthrow new RangeError( 'invalid argument. Second argument must be less than or equal to the first argument.' );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 3 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rhypergeom( N, K, n, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a hypergeometric distribution.\n*\n* @param {NonNegativeInteger} [N] - population size\n* @param {NonNegativeInteger} [K] - subpopulation size\n* @param {NonNegativeInteger} [n] - number of draws\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `N` must be a nonnegative integer\n* @throws {TypeError} `K` must be a nonnegative integer\n* @throws {TypeError} `n` must be a nonnegative integer\n* @throws {RangeError} `n` must be less than or equal to `N`\n* @throws {RangeError} `K` must be less than or equal to `N`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 20, 10, 7, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( N, K, n, options ) {\n\tvar opts;\n\tif ( arguments.length > 3 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( N, K, n, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a hypergeometric distribution.\n*\n* @param {NonNegativeInteger} [N] - population size\n* @param {NonNegativeInteger} [K] - subpopulation size\n* @param {NonNegativeInteger} [n] - number of draws\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 5, 3, 2 ) );\n* }\n*/\nfunction factory( N, K, n, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( N ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', N ) );\n\t\t}\n\t\topts = assign( {}, N );\n\t} else if ( nargs > 3 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 3 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a hypergeometric distribution.\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} N - population size\n\t* @param {NonNegativeInteger} K - subpopulation size\n\t* @param {NonNegativeInteger} n - number of draws\n\t* @throws {TypeError} `N` must be a nonnegative integer\n\t* @throws {TypeError} `K` must be a nonnegative integer\n\t* @throws {TypeError} `n` must be a nonnegative integer\n\t* @throws {RangeError} `n` must be less than or equal to `N`\n\t* @throws {RangeError} `K` must be less than or equal to `N`\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( N, K, n ) {\n\t\treturn new RandomStream( N, K, n, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a hypergeometric distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `N` must be a nonnegative integer\n\t* @throws {TypeError} `K` must be a nonnegative integer\n\t* @throws {TypeError} `n` must be a nonnegative integer\n\t* @throws {RangeError} `n` must be less than or equal to `N`\n\t* @throws {RangeError} `K` must be less than or equal to `N`\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( N, K, n, opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from a hypergeometric distribution.\n*\n* @module @stdlib/random/streams/hypergeometric\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/hypergeometric' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 5, 3, 2, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/hypergeometric' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 5, 3, 2 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/hypergeometric' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 5, 3, 2, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:improved-ziggurat' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar randn = require( './../../../base/improved-ziggurat' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a standard normal distribution using the Improved Ziggurat algorithm.\n*\n* @constructor\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 0 ) {\n\t\t\treturn new RandomStream( options );\n\t\t}\n\t\treturn new RandomStream();\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 0 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', randn( opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a standard normal distribution using the Improved Ziggurat algorithm.\n*\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a standard normal distribution using the Improved Ziggurat algorithm.\n*\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*/\nfunction factory( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\treturn createStream;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a standard normal distribution using the Improved Ziggurat algorithm.\n\t*\n\t* @private\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream() {\n\t\treturn new RandomStream( opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from a standard normal distribution using the Improved Ziggurat algorithm.\n*\n* @module @stdlib/random/streams/improved-ziggurat\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/improved-ziggurat' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/improved-ziggurat' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/improved-ziggurat' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:invgamma' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rinvgamma = require( './../../../base/invgamma' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from an inverse gamma distribution.\n*\n* @constructor\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( alpha, beta, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( alpha, beta, options );\n\t\t}\n\t\treturn new RandomStream( alpha, beta );\n\t}\n\tif ( !isPositiveNumber( alpha ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositiveNumber( beta ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rinvgamma( alpha, beta, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from an inverse gamma distribution.\n*\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - scale parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( alpha, beta, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( alpha, beta, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from an inverse gamma distribution.\n*\n* @param {PositiveNumber} [alpha] - shape parameter\n* @param {PositiveNumber} [beta] - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( alpha, beta, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( alpha ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', alpha ) );\n\t\t}\n\t\topts = assign( {}, alpha );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from an inverse gamma distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} alpha - shape parameter\n\t* @param {PositiveNumber} beta - scale parameter\n\t* @throws {TypeError} `alpha` must be a positive number\n\t* @throws {TypeError} `beta` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( alpha, beta ) {\n\t\treturn new RandomStream( alpha, beta, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from an inverse gamma distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `alpha` must be a positive number\n\t* @throws {TypeError} `beta` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( alpha, beta, opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from an inverse gamma distribution.\n*\n* @module @stdlib/random/streams/invgamma\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/invgamma' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/invgamma' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/invgamma' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:kumaraswamy' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rkumaraswamy = require( './../../../base/kumaraswamy' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a Kumaraswamy's double bounded distribution.\n*\n* @constructor\n* @param {PositiveNumber} a - first shape parameter\n* @param {PositiveNumber} b - second shape parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `a` must be a positive number\n* @throws {TypeError} `b` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( a, b, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( a, b, options );\n\t\t}\n\t\treturn new RandomStream( a, b );\n\t}\n\tif ( !isPositiveNumber( a ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', a ) );\n\t}\n\tif ( !isPositiveNumber( b ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', b ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rkumaraswamy( a, b, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a Kumaraswamy's double bounded distribution.\n*\n* @param {PositiveNumber} a - first shape parameter\n* @param {PositiveNumber} b - second shape parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `a` must be a positive number\n* @throws {TypeError} `b` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( a, b, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( a, b, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a Kumaraswamy's double bounded distribution.\n*\n* @param {PositiveNumber} [a] - first shape parameter\n* @param {PositiveNumber} [b] - second shape parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( a, b, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( a ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', a ) );\n\t\t}\n\t\topts = assign( {}, a );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Kumaraswamy's double bounded distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} a - first shape parameter\n\t* @param {PositiveNumber} b - second shape parameter\n\t* @throws {TypeError} `a` must be a positive number\n\t* @throws {TypeError} `b` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( a, b ) {\n\t\treturn new RandomStream( a, b, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Kumaraswamy's double bounded distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `a` must be a positive number\n\t* @throws {TypeError} `b` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( a, b, opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from a Kumaraswamy's double bounded distribution.\n*\n* @module @stdlib/random/streams/kumaraswamy\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/kumaraswamy' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/kumaraswamy' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/kumaraswamy' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:laplace' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rlaplace = require( './../../../base/laplace' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar format = require( '@stdlib/string/format' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a Laplace (double exponential) distribution.\n*\n* @constructor\n* @param {number} mu - mean\n* @param {PositiveNumber} b - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `b` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( mu, b, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( mu, b, options );\n\t\t}\n\t\treturn new RandomStream( mu, b );\n\t}\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositiveNumber( b ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', b ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rlaplace( mu, b, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a Laplace (double exponential) distribution.\n*\n* @param {number} mu - mean\n* @param {PositiveNumber} b - scale parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `b` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( mu, b, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( mu, b, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a Laplace (double exponential) distribution.\n*\n* @param {number} [mu] - mean\n* @param {PositiveNumber} [b] - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( mu, b, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( mu ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', mu ) );\n\t\t}\n\t\topts = assign( {}, mu );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Laplace (double exponential) distribution.\n\t*\n\t* @private\n\t* @param {number} mu - mean\n\t* @param {PositiveNumber} b - scale parameter\n\t* @throws {TypeError} `mu` must be a number\n\t* @throws {TypeError} `b` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( mu, b ) {\n\t\treturn new RandomStream( mu, b, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Laplace (double exponential) distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `mu` must be a number\n\t* @throws {TypeError} `b` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( mu, b, opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from a Laplace (double exponential) distribution.\n*\n* @module @stdlib/random/streams/laplace\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/laplace' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/laplace' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/laplace' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:levy' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rlevy = require( './../../../base/levy' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a L\u00E9vy distribution.\n*\n* @constructor\n* @param {number} mu - mean\n* @param {PositiveNumber} c - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `c` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( mu, c, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( mu, c, options );\n\t\t}\n\t\treturn new RandomStream( mu, c );\n\t}\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositiveNumber( c ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', c ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rlevy( mu, c, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a L\u00E9vy distribution.\n*\n* @param {number} mu - mean\n* @param {PositiveNumber} c - scale parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `c` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( mu, c, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( mu, c, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a L\u00E9vy distribution.\n*\n* @param {number} [mu] - mean\n* @param {PositiveNumber} [c] - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( mu, c, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( mu ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', mu ) );\n\t\t}\n\t\topts = assign( {}, mu );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a L\u00E9vy distribution.\n\t*\n\t* @private\n\t* @param {number} mu - mean\n\t* @param {PositiveNumber} c - scale parameter\n\t* @throws {TypeError} `mu` must be a number\n\t* @throws {TypeError} `c` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( mu, c ) {\n\t\treturn new RandomStream( mu, c, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a L\u00E9vy distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `mu` must be a number\n\t* @throws {TypeError} `c` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( mu, c, opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from a L\u00E9vy distribution.\n*\n* @module @stdlib/random/streams/levy\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/levy' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/levy' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/levy' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:logistic' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rlogistic = require( './../../../base/logistic' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a logistic distribution.\n*\n* @constructor\n* @param {number} mu - mean\n* @param {PositiveNumber} s - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( mu, s, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( mu, s, options );\n\t\t}\n\t\treturn new RandomStream( mu, s );\n\t}\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositiveNumber( s ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', s ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rlogistic( mu, s, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a logistic distribution.\n*\n* @param {number} mu - mean\n* @param {PositiveNumber} s - scale parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( mu, s, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( mu, s, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a logistic distribution.\n*\n* @param {number} [mu] - mean\n* @param {PositiveNumber} [s] - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( mu, s, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( mu ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', mu ) );\n\t\t}\n\t\topts = assign( {}, mu );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a logistic distribution.\n\t*\n\t* @private\n\t* @param {number} mu - mean\n\t* @param {PositiveNumber} s - scale parameter\n\t* @throws {TypeError} `mu` must be a number\n\t* @throws {TypeError} `s` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( mu, s ) {\n\t\treturn new RandomStream( mu, s, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a logistic distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `mu` must be a number\n\t* @throws {TypeError} `s` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( mu, s, opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from a logistic distribution.\n*\n* @module @stdlib/random/streams/logistic\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/logistic' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/logistic' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/logistic' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:lognormal' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rlognormal = require( './../../../base/lognormal' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a lognormal distribution.\n*\n* @constructor\n* @param {number} mu - location parameter\n* @param {PositiveNumber} sigma - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `sigma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( mu, sigma, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( mu, sigma, options );\n\t\t}\n\t\treturn new RandomStream( mu, sigma );\n\t}\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositiveNumber( sigma ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', sigma ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rlognormal( mu, sigma, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a lognormal distribution.\n*\n* @param {number} mu - location parameter\n* @param {PositiveNumber} sigma - scale parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `sigma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( mu, sigma, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( mu, sigma, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a lognormal distribution.\n*\n* @param {number} [mu] - location parameter\n* @param {PositiveNumber} [sigma] - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( mu, sigma, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( mu ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', mu ) );\n\t\t}\n\t\topts = assign( {}, mu );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a lognormal distribution.\n\t*\n\t* @private\n\t* @param {number} mu - location parameter\n\t* @param {PositiveNumber} sigma - scale parameter\n\t* @throws {TypeError} `mu` must be a number\n\t* @throws {TypeError} `sigma` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( mu, sigma ) {\n\t\treturn new RandomStream( mu, sigma, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a lognormal distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `mu` must be a number\n\t* @throws {TypeError} `sigma` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( mu, sigma, opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from a lognormal distribution.\n*\n* @module @stdlib/random/streams/lognormal\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/lognormal' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 0.0, 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/lognormal' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 0.0, 2.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/lognormal' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 0.0, 2.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308,\n\t\"normalized\": false\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {boolean} [options.normalized] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'normalized' ) ) {\n\t\topts.normalized = options.normalized;\n\t\tif ( !isBoolean( opts.normalized ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'normalized', opts.normalized ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:minstd' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar minstd = require( './../../../base/minstd' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {PRNGSeedMINSTD} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {PositiveInteger} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {PositiveInteger} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {PositiveInteger} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {PRNGStateMINSTD} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMINSTD} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers via a linear congruential pseudorandom number generator (LCG) based on Park and Miller.\n*\n* @constructor\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {boolean} [options.normalized=false] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( options ) {\n\tvar prng;\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 0 ) {\n\t\t\treturn new RandomStream( options );\n\t\t}\n\t\treturn new RandomStream();\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 0 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tprng = minstd( opts );\n\tif ( opts.normalized ) {\n\t\tprng = prng.normalized;\n\t}\n\tsetNonEnumerableReadOnly( this, '_prng', prng );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {PRNGSeedMINSTD}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {PRNGStateMINSTD}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers via a linear congruential pseudorandom number generator (LCG) based on Park and Miller.\n*\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {boolean} [options.normalized=false] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers via a linear congruential pseudorandom number generator (LCG) based on Park and Miller.\n*\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {boolean} [options.normalized=false] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*/\nfunction factory( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\treturn createStream;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers via a linear congruential pseudorandom number generator (LCG) based on Park and Miller.\n\t*\n\t* @private\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream() {\n\t\treturn new RandomStream( opts );\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/**\n* Create a readable stream for generating pseudorandom numbers via a linear congruential pseudorandom number generator (LCG) based on Park and Miller.\n*\n* @module @stdlib/random/streams/minstd\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/minstd' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/minstd' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/minstd' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308,\n\t\"normalized\": false\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {boolean} [options.normalized] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'normalized' ) ) {\n\t\topts.normalized = options.normalized;\n\t\tif ( !isBoolean( opts.normalized ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'normalized', opts.normalized ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:minstd-shuffle' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar minstd = require( './../../../base/minstd-shuffle' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {PRNGSeedMINSTD} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {PositiveInteger} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {PositiveInteger} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {PositiveInteger} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {PRNGStateMINSTD} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMINSTD} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers via a linear congruential pseudorandom number generator (LCG) whose output is shuffled.\n*\n* @constructor\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {boolean} [options.normalized=false] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( options ) {\n\tvar prng;\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 0 ) {\n\t\t\treturn new RandomStream( options );\n\t\t}\n\t\treturn new RandomStream();\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 0 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tprng = minstd( opts );\n\tif ( opts.normalized ) {\n\t\tprng = prng.normalized;\n\t}\n\tsetNonEnumerableReadOnly( this, '_prng', prng );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {PRNGSeedMINSTD}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {PRNGStateMINSTD}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers via a linear congruential pseudorandom number generator (LCG) whose output is shuffled.\n*\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {boolean} [options.normalized=false] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers via a linear congruential pseudorandom number generator (LCG) whose output is shuffled.\n*\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {boolean} [options.normalized=false] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*/\nfunction factory( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\treturn createStream;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers via a linear congruential pseudorandom number generator (LCG) whose output is shuffled.\n\t*\n\t* @private\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream() {\n\t\treturn new RandomStream( opts );\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/**\n* Create a readable stream for generating pseudorandom numbers via a linear congruential pseudorandom number generator (LCG) whose output is shuffled.\n*\n* @module @stdlib/random/streams/minstd-shuffle\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/minstd-shuffle' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/minstd-shuffle' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/minstd-shuffle' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308,\n\t\"normalized\": false\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {boolean} [options.normalized] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'normalized' ) ) {\n\t\topts.normalized = options.normalized;\n\t\tif ( !isBoolean( opts.normalized ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'normalized', opts.normalized ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:mt19937' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar mt19937 = require( './../../../base/mt19937' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {PRNGSeedMT19937} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {PositiveInteger} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {PositiveInteger} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {PositiveInteger} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {PRNGStateMT19937} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers via a 32-bit Mersenne Twister pseudorandom number generator.\n*\n* @constructor\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {boolean} [options.normalized=false] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( options ) {\n\tvar prng;\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 0 ) {\n\t\t\treturn new RandomStream( options );\n\t\t}\n\t\treturn new RandomStream();\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 0 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tprng = mt19937( opts );\n\tif ( opts.normalized ) {\n\t\tprng = prng.normalized;\n\t}\n\tsetNonEnumerableReadOnly( this, '_prng', prng );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {PRNGSeedMT19937}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {PRNGStateMT19937}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers via a 32-bit Mersenne Twister pseudorandom number generator.\n*\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {boolean} [options.normalized=false] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers via a 32-bit Mersenne Twister pseudorandom number generator.\n*\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {boolean} [options.normalized=false] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*/\nfunction factory( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\treturn createStream;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers via a 32-bit Mersenne Twister pseudorandom number generator.\n\t*\n\t* @private\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream() {\n\t\treturn new RandomStream( opts );\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/**\n* Create a readable stream for generating pseudorandom numbers via a 32-bit Mersenne Twister pseudorandom number generator.\n*\n* @module @stdlib/random/streams/mt19937\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/mt19937' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/mt19937' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/mt19937' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isPlainObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:negative-binomial' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isProbability = require( '@stdlib/assert/is-probability' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rnbinom = require( './../../../base/negative-binomial' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a binomial distribution.\n*\n* @constructor\n* @param {PositiveNumber} r - number of successes until experiment is stopped\n* @param {Probability} p - success probability\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `r` must be a positive number\n* @throws {TypeError} `p` must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 20.0, 0.2, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( r, p, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( r, p, options );\n\t\t}\n\t\treturn new RandomStream( r, p );\n\t}\n\tif ( !isPositiveNumber( r ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', r ) );\n\t}\n\tif ( !isProbability( p ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a probability. Value: `%s`.', p ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rnbinom( r, p, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a negative binomial distribution.\n*\n* @param {PositiveNumber} r - number of successes until experiment is stopped\n* @param {Probability} p - success probability\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `r` must be a positive number\n* @throws {TypeError} `p` must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 20.0, 0.1, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( r, p, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isPlainObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( r, p, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a negative binomial distribution.\n*\n* @param {PositiveNumber} [r] - number of successes until experiment is stopped\n* @param {Probability} [p] - second shape parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 20.0, 0.5 ) );\n* }\n*/\nfunction factory( r, p, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( r ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', r ) );\n\t\t}\n\t\topts = assign( {}, r );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a negative binomial distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} r - number of trials\n\t* @param {Probability} p - success probability\n\t* @throws {TypeError} `r` must be a positive number\n\t* @throws {TypeError} `p` must be a positive probability\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( r, p ) {\n\t\treturn new RandomStream( r, p, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a negative binomial distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `r` must be a positive number\n\t* @throws {TypeError} `p` must be a probability\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( r, p, opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from a negative binomial distribution.\n*\n* @module @stdlib/random/streams/negative-binomial\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/negative-binomial' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 20.0, 0.4, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/negative-binomial' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 20.0, 0.4 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/negative-binomial' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 20.0, 0.4, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:normal' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rnorm = require( './../../../base/normal' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a normal distribution.\n*\n* @constructor\n* @param {number} mu - mean\n* @param {PositiveNumber} sigma - standard deviation\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `sigma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( mu, sigma, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( mu, sigma, options );\n\t\t}\n\t\treturn new RandomStream( mu, sigma );\n\t}\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositiveNumber( sigma ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', sigma ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rnorm( mu, sigma, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a normal distribution.\n*\n* @param {number} mu - mean\n* @param {PositiveNumber} sigma - standard deviation\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `sigma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( mu, sigma, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( mu, sigma, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a normal distribution.\n*\n* @param {number} [mu] - mean\n* @param {PositiveNumber} [sigma] - standard deviation\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( mu, sigma, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( mu ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', mu ) );\n\t\t}\n\t\topts = assign( {}, mu );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a normal distribution.\n\t*\n\t* @private\n\t* @param {number} mu - mean\n\t* @param {PositiveNumber} sigma - standard deviation\n\t* @throws {TypeError} `mu` must be a number\n\t* @throws {TypeError} `sigma` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( mu, sigma ) {\n\t\treturn new RandomStream( mu, sigma, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a normal distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `mu` must be a number\n\t* @throws {TypeError} `sigma` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( mu, sigma, opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from a normal distribution.\n*\n* @module @stdlib/random/streams/normal\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/normal' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 0.0, 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/normal' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 0.0, 2.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/normal' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 0.0, 2.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isPlainObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:pareto1' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rpareto1 = require( './../../../base/pareto-type1' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a Pareto (Type I) distribution.\n*\n* @constructor\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( alpha, beta, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( alpha, beta, options );\n\t\t}\n\t\treturn new RandomStream( alpha, beta );\n\t}\n\tif ( !isPositiveNumber( alpha ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositiveNumber( beta ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rpareto1( alpha, beta, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a Pareto (Type I) distribution.\n*\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - scale parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( alpha, beta, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isPlainObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( alpha, beta, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a Pareto (Type I) distribution.\n*\n* @param {PositiveNumber} [alpha] - shape parameter\n* @param {PositiveNumber} [beta] - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( alpha, beta, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( alpha ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', alpha ) );\n\t\t}\n\t\topts = assign( {}, alpha );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Pareto (Type I) distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} alpha - shape parameter\n\t* @param {PositiveNumber} beta - scale parameter\n\t* @throws {TypeError} `alpha` must be a positive number\n\t* @throws {TypeError} `beta` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( alpha, beta ) {\n\t\treturn new RandomStream( alpha, beta, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Pareto (Type I) distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `alpha` must be a positive number\n\t* @throws {TypeError} `beta` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( alpha, beta, opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from a Pareto (Type I) distribution.\n*\n* @module @stdlib/random/streams/pareto-type1\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/pareto-type1' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/pareto-type1' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/pareto-type1' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:poisson' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rpoisson = require( './../../../base/poisson' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar format = require( '@stdlib/string/format' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a Poisson distribution.\n*\n* @constructor\n* @param {PositiveNumber} lambda - mean\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( lambda, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 1 ) {\n\t\t\treturn new RandomStream( lambda, options );\n\t\t}\n\t\treturn new RandomStream( lambda );\n\t}\n\tif ( !isPositiveNumber( lambda ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', lambda ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rpoisson( lambda, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a Poisson distribution.\n*\n* @param {PositiveNumber} lambda - mean\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( lambda, options ) {\n\tvar opts;\n\tif ( arguments.length > 1 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( lambda, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a Poisson distribution.\n*\n* @param {PositiveNumber} [lambda] - mean\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 3.0 ) );\n* }\n*/\nfunction factory( lambda, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs > 1 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\tfcn = createStream2;\n\t\topts = assign( {}, options );\n\t} else if ( nargs === 1 ) {\n\t\tif ( isPositive( lambda ) ) {\n\t\t\tfcn = createStream2;\n\t\t\topts = {};\n\t\t} else {\n\t\t\tif ( !isPlainObject( lambda ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', lambda ) );\n\t\t\t}\n\t\t\topts = assign( {}, lambda );\n\t\t\tfcn = createStream1;\n\t\t}\n\t} else {\n\t\topts = {};\n\t\tfcn = createStream1;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Poisson distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} lambda - mean\n\t* @throws {TypeError} `lambda` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( lambda ) {\n\t\treturn new RandomStream( lambda, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Poisson distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `lambda` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( lambda, opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from a Poisson distribution.\n*\n* @module @stdlib/random/streams/poisson\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/poisson' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/poisson' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/poisson' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308,\n\t\"name\": \"mt19937\"\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {string} [options.name] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'name' ) ) {\n\t\topts.name = options.name;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:randi' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar randi = require( './../../../base/randi' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {*} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {PositiveInteger} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {PositiveInteger} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {PositiveInteger} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {*} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {*} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers having integer values.\n*\n* @constructor\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {string} [options.name='mt19937'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 0 ) {\n\t\t\treturn new RandomStream( options );\n\t\t}\n\t\treturn new RandomStream();\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 0 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', randi( opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {*}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {*}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers having integer values.\n*\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {string} [options.name='mt19937'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers having integer values.\n*\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {string} [options.name='mt19937'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*/\nfunction factory( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\treturn createStream;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers having integer values.\n\t*\n\t* @private\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream() {\n\t\treturn new RandomStream( opts );\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/**\n* Create a readable stream for generating pseudorandom numbers having integer values.\n*\n* @module @stdlib/random/streams/randi\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/randi' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/randi' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/randi' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308,\n\t\"name\": \"improved-ziggurat\"\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {string} [options.name] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'name' ) ) {\n\t\topts.name = options.name;\n\t}\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:randn' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar randn = require( './../../../base/randn' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a standard normal distribution.\n*\n* @constructor\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {string} [options.name='improved-ziggurat'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 0 ) {\n\t\t\treturn new RandomStream( options );\n\t\t}\n\t\treturn new RandomStream();\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 0 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', randn( opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a standard normal distribution.\n*\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {string} [options.name='improved-ziggurat'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a standard normal distribution.\n*\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {string} [options.name='improved-ziggurat'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*/\nfunction factory( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\treturn createStream;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a standard normal distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream() {\n\t\treturn new RandomStream( opts );\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/**\n* Create a readable stream for generating pseudorandom numbers from a standard normal distribution.\n*\n* @module @stdlib/random/streams/randn\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/randn' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/randn' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/randn' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308,\n\t\"name\": \"mt19937\"\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {string} [options.name] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'name' ) ) {\n\t\topts.name = options.name;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:randu' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar randu = require( './../../../base/randu' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {*} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {PositiveInteger} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {PositiveInteger} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {PositiveInteger} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {*} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {*} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of uniformly distributed pseudorandom numbers between `0` and `1`.\n*\n* @constructor\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {string} [options.name='mt19937'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 0 ) {\n\t\t\treturn new RandomStream( options );\n\t\t}\n\t\treturn new RandomStream();\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 0 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', randu( opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {*}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {*}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating uniformly distributed pseudorandom numbers between `0` and `1`.\n*\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {string} [options.name='mt19937'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate uniformly distributed pseudorandom numbers between `0` and `1`.\n*\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {Function} [options.name='mt19937'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*/\nfunction factory( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\treturn createStream;\n\n\t/**\n\t* Returns a readable stream for generating uniformly distributed pseudorandom numbers between `0` and `1`.\n\t*\n\t* @private\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream() {\n\t\treturn new RandomStream( opts );\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/**\n* Create a readable stream for generating uniformly distributed pseudorandom numbers between `0` and `1`.\n*\n* @module @stdlib/random/streams/randu\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/randu' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/randu' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/randu' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:rayleigh' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rrayleigh = require( './../../../base/rayleigh' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a Rayleigh distribution.\n*\n* @constructor\n* @param {PositiveNumber} sigma - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `sigma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( sigma, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 1 ) {\n\t\t\treturn new RandomStream( sigma, options );\n\t\t}\n\t\treturn new RandomStream( sigma );\n\t}\n\tif ( !isPositiveNumber( sigma ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', sigma ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rrayleigh( sigma, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a Rayleigh distribution.\n*\n* @param {PositiveNumber} sigma - scale parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `sigma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( sigma, options ) {\n\tvar opts;\n\tif ( arguments.length > 1 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( sigma, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a Rayleigh distribution.\n*\n* @param {PositiveNumber} [sigma] - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 3.0 ) );\n* }\n*/\nfunction factory( sigma, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs > 1 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\tfcn = createStream2;\n\t\topts = assign( {}, options );\n\t} else if ( nargs === 1 ) {\n\t\tif ( isPositive( sigma ) ) {\n\t\t\tfcn = createStream2;\n\t\t\topts = {};\n\t\t} else {\n\t\t\tif ( !isPlainObject( sigma ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', sigma ) );\n\t\t\t}\n\t\t\topts = assign( {}, sigma );\n\t\t\tfcn = createStream1;\n\t\t}\n\t} else {\n\t\topts = {};\n\t\tfcn = createStream1;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Rayleigh distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} sigma - scale parameter\n\t* @throws {TypeError} `sigma` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( sigma ) {\n\t\treturn new RandomStream( sigma, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Rayleigh distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `sigma` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( sigma, opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from a Rayleigh distribution.\n*\n* @module @stdlib/random/streams/rayleigh\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/rayleigh' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/rayleigh' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/rayleigh' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:t' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rt = require( './../../../base/t' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a Student's t distribution.\n*\n* @constructor\n* @param {PositiveNumber} v - degrees of freedom\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `v` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( v, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 1 ) {\n\t\t\treturn new RandomStream( v, options );\n\t\t}\n\t\treturn new RandomStream( v );\n\t}\n\tif ( !isPositiveNumber( v ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', v ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rt( v, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a Student's t distribution.\n*\n* @param {PositiveNumber} v - degrees of freedom\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `v` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( v, options ) {\n\tvar opts;\n\tif ( arguments.length > 1 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( v, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a Student's t distribution.\n*\n* @param {PositiveNumber} [v] - degrees of freedom\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 3.0 ) );\n* }\n*/\nfunction factory( v, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs > 1 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\tfcn = createStream2;\n\t\topts = assign( {}, options );\n\t} else if ( nargs === 1 ) {\n\t\tif ( isPositive( v ) ) {\n\t\t\tfcn = createStream2;\n\t\t\topts = {};\n\t\t} else {\n\t\t\tif ( !isPlainObject( v ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', v ) );\n\t\t\t}\n\t\t\topts = assign( {}, v );\n\t\t\tfcn = createStream1;\n\t\t}\n\t} else {\n\t\topts = {};\n\t\tfcn = createStream1;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Student's t distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} v - degrees of freedom\n\t* @throws {TypeError} `v` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( v ) {\n\t\treturn new RandomStream( v, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Student's t distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `v` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( v, opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from a Student's t distribution.\n*\n* @module @stdlib/random/streams/t\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/t' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/t' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/t' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:triangular' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rtriang = require( './../../../base/triangular' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a uniform distribution.\n*\n* @constructor\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {number} c - mode\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {TypeError} `c` must be a number\n* @throws {RangeError} arguments must satisfy `a <= c <= b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( a, b, c, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 3 ) {\n\t\t\treturn new RandomStream( a, b, c, options );\n\t\t}\n\t\treturn new RandomStream( a, b, c );\n\t}\n\tif ( !isNumber( a ) || isnan( a ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', a ) );\n\t}\n\tif ( !isNumber( b ) || isnan( b ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a number and not NaN. Value: `%s`.', b ) );\n\t}\n\tif ( !isNumber( c ) || isnan( c ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a number and not NaN. Value: `%s`.', c ) );\n\t}\n\tif ( !(a <= c && c <= b) ) {\n\t\tthrow new RangeError( format( 'invalid arguments. Parameters must satisfy the following condition: %s. a: `%f`. b: `%f`. c: `%f`.', 'a <= c <= b', a, b, c ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 3 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rtriang( a, b, c, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a triangular distribution.\n*\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {number} c - mode\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {TypeError} `c` must be a number\n* @throws {RangeError} arguments must satisfy `a <= c <= b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 5.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( a, b, c, options ) {\n\tvar opts;\n\tif ( arguments.length > 3 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( a, b, c, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a triangular distribution.\n*\n* @param {number} [a] - minimum support\n* @param {number} [b] - maximum support\n* @param {number} [c] - mode\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0, 4.0 ) );\n* }\n*/\nfunction factory( a, b, c, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( a ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', a ) );\n\t\t}\n\t\topts = assign( {}, a );\n\t} else if ( nargs > 3 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 3 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a triangular distribution.\n\t*\n\t* @private\n\t* @param {number} a - minimum support\n\t* @param {number} b - maximum support\n\t* @param {number} c - mode\n\t* @throws {TypeError} `a` must be a number\n\t* @throws {TypeError} `b` must be a number\n\t* @throws {TypeError} `c` must be a number\n\t* @throws {RangeError} arguments must satisfy `a <= c <= b`\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( a, b, c ) {\n\t\treturn new RandomStream( a, b, c, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a triangular distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `a` must be a number\n\t* @throws {TypeError} `b` must be a number\n\t* @throws {TypeError} `c` must be a number\n\t* @throws {RangeError} arguments must satisfy `a <= c <= b`\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( a, b, c, opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from a triangular distribution.\n*\n* @module @stdlib/random/streams/triangular\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/triangular' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 5.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/triangular' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/triangular' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 5.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:uniform' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar runiform = require( './../../../base/uniform' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a uniform distribution.\n*\n* @constructor\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {RangeError} `a` must be less than `b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( a, b, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( a, b, options );\n\t\t}\n\t\treturn new RandomStream( a, b );\n\t}\n\tif ( !isNumber( a ) || isnan( a ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', a ) );\n\t}\n\tif ( !isNumber( b ) || isnan( b ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a number and not NaN. Value: `%s`.', b ) );\n\t}\n\tif ( a >= b ) {\n\t\tthrow new RangeError( format( 'invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.', a, b ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', runiform( a, b, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a uniform distribution.\n*\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {RangeError} `a` must be less than `b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( a, b, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( a, b, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a uniform distribution.\n*\n* @param {number} [a] - minimum support\n* @param {number} [b] - maximum support\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( a, b, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( a ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', a ) );\n\t\t}\n\t\topts = assign( {}, a );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a uniform distribution.\n\t*\n\t* @private\n\t* @param {number} a - minimum support\n\t* @param {number} b - maximum support\n\t* @throws {TypeError} `a` must be a number\n\t* @throws {TypeError} `b` must be a number\n\t* @throws {RangeError} `a` must be less than `b`\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( a, b ) {\n\t\treturn new RandomStream( a, b, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a uniform distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `a` must be a number\n\t* @throws {TypeError} `b` must be a number\n\t* @throws {RangeError} `a` must be less than `b`\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( a, b, opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from a uniform distribution.\n*\n* @module @stdlib/random/streams/uniform\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/uniform' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/uniform' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/uniform' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:weibull' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rweibull = require( './../../../base/weibull' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar format = require( '@stdlib/string/format' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a Weibull distribution.\n*\n* @constructor\n* @param {PositiveNumber} k - scale parameter\n* @param {PositiveNumber} lambda - shape parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `k` must be a positive number\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( k, lambda, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( k, lambda, options );\n\t\t}\n\t\treturn new RandomStream( k, lambda );\n\t}\n\tif ( !isPositiveNumber( k ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', k ) );\n\t}\n\tif ( !isPositiveNumber( lambda ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', lambda ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rweibull( k, lambda, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a Weibull distribution.\n*\n* @param {PositiveNumber} k - scale parameter\n* @param {PositiveNumber} lambda - shape parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `k` must be a positive number\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( k, lambda, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( k, lambda, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a Weibull distribution.\n*\n* @param {PositiveNumber} [k] - scale parameter\n* @param {PositiveNumber} [lambda] - shape parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( k, lambda, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( k ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', k ) );\n\t\t}\n\t\topts = assign( {}, k );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Weibull distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} k - scale parameter\n\t* @param {PositiveNumber} lambda - shape parameter\n\t* @throws {TypeError} `k` must be a positive number\n\t* @throws {TypeError} `lambda` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( k, lambda ) {\n\t\treturn new RandomStream( k, lambda, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Weibull distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `k` must be a positive number\n\t* @throws {TypeError} `lambda` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( k, lambda, opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from a Weibull distribution.\n*\n* @module @stdlib/random/streams/weibull\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/weibull' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/weibull' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/weibull' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-read-only-property' );\n\n\n// MAIN //\n\n/**\n* Top-level namespace.\n*\n* @namespace ns\n*/\nvar ns = {};\n\n/**\n* @name arcsine\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/arcsine}\n*/\nsetReadOnly( ns, 'arcsine', require( './../../streams/arcsine' ) );\n\n/**\n* @name bernoulli\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/bernoulli}\n*/\nsetReadOnly( ns, 'bernoulli', require( './../../streams/bernoulli' ) );\n\n/**\n* @name beta\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/beta}\n*/\nsetReadOnly( ns, 'beta', require( './../../streams/beta' ) );\n\n/**\n* @name betaprime\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/betaprime}\n*/\nsetReadOnly( ns, 'betaprime', require( './../../streams/betaprime' ) );\n\n/**\n* @name binomial\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/binomial}\n*/\nsetReadOnly( ns, 'binomial', require( './../../streams/binomial' ) );\n\n/**\n* @name boxMuller\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/box-muller}\n*/\nsetReadOnly( ns, 'boxMuller', require( './../../streams/box-muller' ) );\n\n/**\n* @name cauchy\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/cauchy}\n*/\nsetReadOnly( ns, 'cauchy', require( './../../streams/cauchy' ) );\n\n/**\n* @name chi\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/chi}\n*/\nsetReadOnly( ns, 'chi', require( './../../streams/chi' ) );\n\n/**\n* @name chisquare\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/chisquare}\n*/\nsetReadOnly( ns, 'chisquare', require( './../../streams/chisquare' ) );\n\n/**\n* @name cosine\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/cosine}\n*/\nsetReadOnly( ns, 'cosine', require( './../../streams/cosine' ) );\n\n/**\n* @name discreteUniform\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/discrete-uniform}\n*/\nsetReadOnly( ns, 'discreteUniform', require( './../../streams/discrete-uniform' ) );\n\n/**\n* @name erlang\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/erlang}\n*/\nsetReadOnly( ns, 'erlang', require( './../../streams/erlang' ) );\n\n/**\n* @name exponential\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/exponential}\n*/\nsetReadOnly( ns, 'exponential', require( './../../streams/exponential' ) );\n\n/**\n* @name f\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/f}\n*/\nsetReadOnly( ns, 'f', require( './../../streams/f' ) );\n\n/**\n* @name frechet\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/frechet}\n*/\nsetReadOnly( ns, 'frechet', require( './../../streams/frechet' ) );\n\n/**\n* @name gamma\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/gamma}\n*/\nsetReadOnly( ns, 'gamma', require( './../../streams/gamma' ) );\n\n/**\n* @name geometric\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/geometric}\n*/\nsetReadOnly( ns, 'geometric', require( './../../streams/geometric' ) );\n\n/**\n* @name gumbel\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/gumbel}\n*/\nsetReadOnly( ns, 'gumbel', require( './../../streams/gumbel' ) );\n\n/**\n* @name hypergeometric\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/hypergeometric}\n*/\nsetReadOnly( ns, 'hypergeometric', require( './../../streams/hypergeometric' ) );\n\n/**\n* @name improvedZiggurat\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/improved-ziggurat}\n*/\nsetReadOnly( ns, 'improvedZiggurat', require( './../../streams/improved-ziggurat' ) );\n\n/**\n* @name invgamma\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/invgamma}\n*/\nsetReadOnly( ns, 'invgamma', require( './../../streams/invgamma' ) );\n\n/**\n* @name kumaraswamy\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/kumaraswamy}\n*/\nsetReadOnly( ns, 'kumaraswamy', require( './../../streams/kumaraswamy' ) );\n\n/**\n* @name laplace\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/laplace}\n*/\nsetReadOnly( ns, 'laplace', require( './../../streams/laplace' ) );\n\n/**\n* @name levy\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/levy}\n*/\nsetReadOnly( ns, 'levy', require( './../../streams/levy' ) );\n\n/**\n* @name logistic\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/logistic}\n*/\nsetReadOnly( ns, 'logistic', require( './../../streams/logistic' ) );\n\n/**\n* @name lognormal\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/lognormal}\n*/\nsetReadOnly( ns, 'lognormal', require( './../../streams/lognormal' ) );\n\n/**\n* @name minstd\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/minstd}\n*/\nsetReadOnly( ns, 'minstd', require( './../../streams/minstd' ) );\n\n/**\n* @name minstdShuffle\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/minstd-shuffle}\n*/\nsetReadOnly( ns, 'minstdShuffle', require( './../../streams/minstd-shuffle' ) );\n\n/**\n* @name mt19937\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/mt19937}\n*/\nsetReadOnly( ns, 'mt19937', require( './../../streams/mt19937' ) );\n\n/**\n* @name negativeBinomial\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/negative-binomial}\n*/\nsetReadOnly( ns, 'negativeBinomial', require( './../../streams/negative-binomial' ) );\n\n/**\n* @name normal\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/normal}\n*/\nsetReadOnly( ns, 'normal', require( './../../streams/normal' ) );\n\n/**\n* @name pareto1\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/pareto-type1}\n*/\nsetReadOnly( ns, 'pareto1', require( './../../streams/pareto-type1' ) );\n\n/**\n* @name poisson\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/poisson}\n*/\nsetReadOnly( ns, 'poisson', require( './../../streams/poisson' ) );\n\n/**\n* @name randi\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/randi}\n*/\nsetReadOnly( ns, 'randi', require( './../../streams/randi' ) );\n\n/**\n* @name randn\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/randn}\n*/\nsetReadOnly( ns, 'randn', require( './../../streams/randn' ) );\n\n/**\n* @name randu\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/randu}\n*/\nsetReadOnly( ns, 'randu', require( './../../streams/randu' ) );\n\n/**\n* @name rayleigh\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/rayleigh}\n*/\nsetReadOnly( ns, 'rayleigh', require( './../../streams/rayleigh' ) );\n\n/**\n* @name t\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/t}\n*/\nsetReadOnly( ns, 't', require( './../../streams/t' ) );\n\n/**\n* @name triangular\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/triangular}\n*/\nsetReadOnly( ns, 'triangular', require( './../../streams/triangular' ) );\n\n/**\n* @name uniform\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/uniform}\n*/\nsetReadOnly( ns, 'uniform', require( './../../streams/uniform' ) );\n\n/**\n* @name weibull\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/weibull}\n*/\nsetReadOnly( ns, 'weibull', require( './../../streams/weibull' ) );\n\n\n// EXPORTS //\n\nmodule.exports = ns;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 isAccessorArray = require( '@stdlib/array/base/assert/is-accessor-array' );\nvar random = require( './../../../base/arcsine' );\n\n\n// MAIN //\n\n/**\n* Returns a function for generating pseudorandom numbers.\n*\n* ## Notes\n*\n* - The returned object has the following properties:\n*\n* - **arity**: number of function parameters.\n* - **fcn**: function for generating pseudorandom numbers.\n*\n* @private\n* @param {Collection} x - first parameter\n* @param {integer} sx - `x` stride length\n* @param {NonNegativeInteger} ox - starting `x` index\n* @param {Collection} y - second parameter\n* @param {integer} sy - `y` stride length\n* @param {NonNegativeInteger} oy - starting `y` index\n* @param {boolean} hasOptions - boolean indicating whether to process an options argument\n* @param {(void|Options)} options - function options\n* @returns {Object} function object\n*/\nfunction clbk( x, sx, ox, y, sy, oy, hasOptions, options ) {\n\tvar out;\n\tvar v1;\n\tvar v2;\n\n\tout = {\n\t\t'arity': 0,\n\t\t'fcn': null\n\t};\n\tif ( hasOptions ) {\n\t\tif ( sx === 0 && sy === 0 ) {\n\t\t\tif ( isAccessorArray( x ) ) {\n\t\t\t\tv1 = x.get( ox );\n\t\t\t} else {\n\t\t\t\tv1 = x[ ox ];\n\t\t\t}\n\t\t\tif ( isAccessorArray( y ) ) {\n\t\t\t\tv2 = y.get( oy );\n\t\t\t} else {\n\t\t\t\tv2 = y[ oy ];\n\t\t\t}\n\t\t\tout.fcn = random.factory( v1, v2, options );\n\t\t\treturn out;\n\t\t}\n\t\tout.fcn = random.factory( options );\n\t} else {\n\t\tout.fcn = random;\n\t}\n\tout.arity += 2;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = clbk;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from an arcsine distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} a - minimum support\n* @param {integer} sa - `a` stride length\n* @param {Collection} b - maximum support\n* @param {integer} sb - `b` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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 {Error} minimum support must be less than maximum support\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* arcsine( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*/\nfunction arcsine( N, a, sa, b, sb, out, so, options ) {\n\tvar rand = prng( a, sa, 0, b, sb, 0, arguments.length > 7, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ a, b, out ], [ N ], [ sa, sb, so ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = arcsine;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar binary = require( '@stdlib/strided/base/binary' ).ndarray;\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from an arcsine distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} a - minimum support\n* @param {integer} sa - `a` stride length\n* @param {NonNegativeInteger} oa - starting `a` index\n* @param {Collection} b - maximum support\n* @param {integer} sb - `b` stride length\n* @param {NonNegativeInteger} ob - starting `b` index\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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 {Error} minimum support must be less than maximum support\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* arcsine( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\nfunction arcsine( N, a, sa, oa, b, sb, ob, out, so, oo, options ) { // eslint-disable-line max-params\n\tvar rand = prng( a, sa, oa, b, sb, ob, arguments.length > 10, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ a, b, out ], [ N ], [ sa, sb, so ], [ oa, ob, oo ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = arcsine;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Fill a strided array with pseudorandom numbers drawn from an arcsine distribution.\n*\n* @module @stdlib/random/strided/arcsine\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var arcsine = require( '@stdlib/random/strided/arcsine' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* arcsine( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var arcsine = require( '@stdlib/random/strided/arcsine' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* arcsine.ndarray( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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 setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isMethodIn = require( '@stdlib/assert/is-method-in' );\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar unary = require( '@stdlib/strided/base/unary' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a factory function for filling strided arrays with pseudorandom values drawn from a unary PRNG.\n*\n* @param {Function} prng - unary pseudorandom value generator\n* @param {Function} prng.factory - method which returns a new unary pseudorandom value generator\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} first argument must have a `factory` method\n* @returns {Function} function which returns a function for filling strided arrays\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var exponential = require( '@stdlib/random/base/exponential' );\n*\n* var factory = createFactory( exponential );\n* // returns \n*\n* var random = factory();\n* // returns \n*\n* var out = new Float64Array( 10 );\n* // returns \n*\n* random( out.length, [ 2.0 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var exponential = require( '@stdlib/random/base/exponential' );\n*\n* var factory = createFactory( exponential );\n* // returns \n*\n* var random = factory();\n* // returns \n*\n* var out = new Float64Array( 10 );\n* // returns \n*\n* random.ndarray( out.length, [ 2.0 ], 0, 0, out, 1, 0 );\n*/\nfunction createFactory( prng ) {\n\tif ( !isFunction( prng ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', prng ) );\n\t}\n\tif ( !isMethodIn( prng, 'factory' ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must have a `%s` method.', 'factory' ) );\n\t}\n\treturn factory;\n\n\t/**\n\t* Returns a function for filling strided arrays with pseudorandom values drawn from a PRNG.\n\t*\n\t* @private\n\t* @param {Options} [options] - function options\n\t* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n\t* @param {*} [options.seed] - pseudorandom value generator seed\n\t* @param {*} [options.state] - pseudorandom value generator state\n\t* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom value generator state\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {Function} function for filling strided arrays\n\t*/\n\tfunction factory() {\n\t\tvar base;\n\t\tvar opts;\n\n\t\tif ( arguments.length > 0 ) {\n\t\t\topts = arguments[ 0 ];\n\t\t\tif ( !isPlainObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tbase = prng.factory( opts );\n\t\t} else {\n\t\t\topts = {};\n\t\t\tbase = prng;\n\t\t}\n\t\tif ( opts && opts.prng ) {\n\t\t\tsetReadOnly( rand, 'seed', null );\n\t\t\tsetReadOnly( rand, 'seedLength', null );\n\t\t\tsetReadWriteAccessor( rand, 'state', constantFunction( null ), noop );\n\t\t\tsetReadOnly( rand, 'stateLength', null );\n\t\t\tsetReadOnly( rand, 'byteLength', null );\n\t\t} else {\n\t\t\tsetReadOnlyAccessor( rand, 'seed', getSeed );\n\t\t\tsetReadOnlyAccessor( rand, 'seedLength', getSeedLength );\n\t\t\tsetReadWriteAccessor( rand, 'state', getState, setState );\n\t\t\tsetReadOnlyAccessor( rand, 'stateLength', getStateLength );\n\t\t\tsetReadOnlyAccessor( rand, 'byteLength', getStateSize );\n\t\t}\n\t\tsetReadOnly( rand, 'PRNG', base.PRNG );\n\t\tsetReadOnly( rand, 'ndarray', ndarray );\n\t\treturn rand;\n\n\t\t/**\n\t\t* Fills a strided array with pseudorandom values drawn from a PRNG.\n\t\t*\n\t\t* @private\n\t\t* @param {NonNegativeInteger} N - number of indexed elements\n\t\t* @param {Collection} param1 - PRNG parameter\n\t\t* @param {integer} sp1 - PRNG parameter stride length\n\t\t* @param {Collection} out - output array\n\t\t* @param {integer} so - output array stride length\n\t\t* @returns {Collection} output array\n\t\t*/\n\t\tfunction rand( N, param1, sp1, out, so ) {\n\t\t\tunary( [ param1, out ], [ N ], [ sp1, so ], base );\n\t\t\treturn out;\n\t\t}\n\n\t\t/**\n\t\t* Fills a strided array with pseudorandom values drawn from a PRNG using alternative indexing semantics.\n\t\t*\n\t\t* @private\n\t\t* @param {NonNegativeInteger} N - number of indexed elements\n\t\t* @param {Collection} param1 - PRNG parameter\n\t\t* @param {integer} sp1 - PRNG parameter stride length\n\t\t* @param {NonNegativeInteger} op1 - PRNG parameter starting index\n\t\t* @param {Collection} out - output array\n\t\t* @param {integer} so - output array stride length\n\t\t* @param {NonNegativeInteger} oo - output array starting index\n\t\t* @returns {Collection} output array\n\t\t*/\n\t\tfunction ndarray( N, param1, sp1, op1, out, so, oo ) {\n\t\t\tunary.ndarray( [ param1, out ], [ N ], [ sp1, so ], [ op1, oo ], base ); // eslint-disable-line max-len\n\t\t\treturn out;\n\t\t}\n\n\t\t/**\n\t\t* Returns the PRNG seed.\n\t\t*\n\t\t* @private\n\t\t* @returns {*} seed\n\t\t*/\n\t\tfunction getSeed() {\n\t\t\treturn rand.PRNG.seed;\n\t\t}\n\n\t\t/**\n\t\t* Returns the PRNG seed length.\n\t\t*\n\t\t* @private\n\t\t* @returns {PositiveInteger} seed length\n\t\t*/\n\t\tfunction getSeedLength() {\n\t\t\treturn rand.PRNG.seedLength;\n\t\t}\n\n\t\t/**\n\t\t* Returns the PRNG state length.\n\t\t*\n\t\t* @private\n\t\t* @returns {PositiveInteger} state length\n\t\t*/\n\t\tfunction getStateLength() {\n\t\t\treturn rand.PRNG.stateLength;\n\t\t}\n\n\t\t/**\n\t\t* Returns the PRNG state size (in bytes).\n\t\t*\n\t\t* @private\n\t\t* @returns {PositiveInteger} state size (in bytes)\n\t\t*/\n\t\tfunction getStateSize() {\n\t\t\treturn rand.PRNG.byteLength;\n\t\t}\n\n\t\t/**\n\t\t* Returns the current pseudorandom number generator state.\n\t\t*\n\t\t* @private\n\t\t* @returns {*} current state\n\t\t*/\n\t\tfunction getState() {\n\t\t\treturn rand.PRNG.state;\n\t\t}\n\n\t\t/**\n\t\t* Sets the pseudorandom number generator state.\n\t\t*\n\t\t* @private\n\t\t* @param {*} s - generator state\n\t\t* @throws {Error} must provide a valid state\n\t\t*/\n\t\tfunction setState( s ) {\n\t\t\trand.PRNG.state = s;\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = createFactory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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* Create a factory function for filling strided arrays with pseudorandom values drawn from a unary PRNG.\n*\n* @module @stdlib/random/strided/tools/unary-factory\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var exponential = require( '@stdlib/random/base/exponential' );\n* var unaryFactory = require( '@stdlib/random/strided/tools/unary-factory' );\n*\n* var factory = createFactory( exponential );\n* // returns \n*\n* var random = factory();\n* // returns \n*\n* var out = new Float64Array( 10 );\n* // returns \n*\n* random( out.length, [ 2.0 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var exponential = require( '@stdlib/random/base/exponential' );\n* var unaryFactory = require( '@stdlib/random/strided/tools/unary-factory' );\n*\n* var factory = createFactory( exponential );\n* // returns \n*\n* var random = factory();\n* // returns \n*\n* var out = new Float64Array( 10 );\n* // returns \n*\n* random.ndarray( out.length, [ 2.0 ], 0, 0, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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 unaryFactory = require( './../../../strided/tools/unary-factory' );\nvar base = require( './../../../base/bernoulli' );\n\n\n// MAIN //\n\n/**\n* Returns a function for filling strided arrays containing pseudorandom numbers drawn from a Bernoulli distribution.\n*\n* @name factory\n* @type {Function}\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for filling strided arrays\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var bernoulli = factory();\n* // returns \n*\n* var out = new Float64Array( 10 );\n* // returns \n*\n* var arr = bernoulli( out.length, [ 0.5 ], 0, out, 1 );\n* // returns \n*\n* var bool = ( arr === out );\n* // returns true\n*/\nvar factory = unaryFactory( base );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a Bernoulli distribution.\n*\n* @name bernoulli\n* @type {Function}\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} p - success probability\n* @param {integer} sp - `p` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* bernoulli( out.length, [ 0.5 ], 0, out, 1 );\n*/\nvar bernoulli = factory();\n\n\n// EXPORTS //\n\nmodule.exports = bernoulli;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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* Fill a strided array with pseudorandom numbers drawn from a Bernoulli distribution.\n*\n* @module @stdlib/random/strided/bernoulli\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var bernoulli = require( '@stdlib/random/strided/bernoulli' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* bernoulli( out.length, [ 0.5 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var bernoulli = require( '@stdlib/random/strided/bernoulli' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* bernoulli.ndarray( out.length, [ 0.5 ], 0, 0, out, 1, 0 );\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\n// exports: { \"factory\": \"main.factory\", \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 isAccessorArray = require( '@stdlib/array/base/assert/is-accessor-array' );\nvar random = require( './../../../base/beta' );\n\n\n// MAIN //\n\n/**\n* Returns a function for generating pseudorandom numbers.\n*\n* ## Notes\n*\n* - The returned object has the following properties:\n*\n* - **arity**: number of function parameters.\n* - **fcn**: function for generating pseudorandom numbers.\n*\n* @private\n* @param {Collection} x - first parameter\n* @param {integer} sx - `x` stride length\n* @param {NonNegativeInteger} ox - starting `x` index\n* @param {Collection} y - second parameter\n* @param {integer} sy - `y` stride length\n* @param {NonNegativeInteger} oy - starting `y` index\n* @param {boolean} hasOptions - boolean indicating whether to process an options argument\n* @param {(void|Options)} options - function options\n* @returns {Object} function object\n*/\nfunction clbk( x, sx, ox, y, sy, oy, hasOptions, options ) {\n\tvar out;\n\tvar v1;\n\tvar v2;\n\n\tout = {\n\t\t'arity': 0,\n\t\t'fcn': null\n\t};\n\tif ( hasOptions ) {\n\t\tif ( sx === 0 && sy === 0 ) {\n\t\t\tif ( isAccessorArray( x ) ) {\n\t\t\t\tv1 = x.get( ox );\n\t\t\t} else {\n\t\t\t\tv1 = x[ ox ];\n\t\t\t}\n\t\t\tif ( isAccessorArray( y ) ) {\n\t\t\t\tv2 = y.get( oy );\n\t\t\t} else {\n\t\t\t\tv2 = y[ oy ];\n\t\t\t}\n\t\t\tout.fcn = random.factory( v1, v2, options );\n\t\t\treturn out;\n\t\t}\n\t\tout.fcn = random.factory( options );\n\t} else {\n\t\tout.fcn = random;\n\t}\n\tout.arity += 2;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = clbk;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a beta distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} alpha - first shape parameter\n* @param {integer} sa - `alpha` stride length\n* @param {Collection} beta - second shape parameter\n* @param {integer} sb - `beta` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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 {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* beta( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*/\nfunction beta( N, alpha, sa, beta, sb, out, so, options ) {\n\tvar rand = prng( alpha, sa, 0, beta, sb, 0, arguments.length > 7, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ alpha, beta, out ], [ N ], [ sa, sb, so ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = beta;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar binary = require( '@stdlib/strided/base/binary' ).ndarray;\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a beta distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} alpha - first shape parameter\n* @param {integer} sa - `alpha` stride length\n* @param {NonNegativeInteger} oa - starting `alpha` index\n* @param {Collection} beta - second shape parameter\n* @param {integer} sb - `beta` stride length\n* @param {NonNegativeInteger} ob - starting `beta` index\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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 {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* beta( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\nfunction beta( N, alpha, sa, oa, beta, sb, ob, out, so, oo, options ) { // eslint-disable-line max-params\n\tvar rand = prng( alpha, sa, oa, beta, sb, ob, arguments.length > 10, options ); // eslint-disable-line max-len\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ alpha, beta, out ], [ N ], [ sa, sb, so ], [ oa, ob, oo ], rand.fcn ); // eslint-disable-line max-len\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = beta;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Fill a strided array with pseudorandom numbers drawn from a beta distribution.\n*\n* @module @stdlib/random/strided/beta\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var beta = require( '@stdlib/random/strided/beta' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* beta( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var beta = require( '@stdlib/random/strided/beta' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* beta.ndarray( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 isAccessorArray = require( '@stdlib/array/base/assert/is-accessor-array' );\nvar random = require( './../../../base/betaprime' );\n\n\n// MAIN //\n\n/**\n* Returns a function for generating pseudorandom numbers.\n*\n* ## Notes\n*\n* - The returned object has the following properties:\n*\n* - **arity**: number of function parameters.\n* - **fcn**: function for generating pseudorandom numbers.\n*\n* @private\n* @param {Collection} x - first parameter\n* @param {integer} sx - `x` stride length\n* @param {NonNegativeInteger} ox - starting `x` index\n* @param {Collection} y - second parameter\n* @param {integer} sy - `y` stride length\n* @param {NonNegativeInteger} oy - starting `y` index\n* @param {boolean} hasOptions - boolean indicating whether to process an options argument\n* @param {(void|Options)} options - function options\n* @returns {Object} function object\n*/\nfunction clbk( x, sx, ox, y, sy, oy, hasOptions, options ) {\n\tvar out;\n\tvar v1;\n\tvar v2;\n\n\tout = {\n\t\t'arity': 0,\n\t\t'fcn': null\n\t};\n\tif ( hasOptions ) {\n\t\tif ( sx === 0 && sy === 0 ) {\n\t\t\tif ( isAccessorArray( x ) ) {\n\t\t\t\tv1 = x.get( ox );\n\t\t\t} else {\n\t\t\t\tv1 = x[ ox ];\n\t\t\t}\n\t\t\tif ( isAccessorArray( y ) ) {\n\t\t\t\tv2 = y.get( oy );\n\t\t\t} else {\n\t\t\t\tv2 = y[ oy ];\n\t\t\t}\n\t\t\tout.fcn = random.factory( v1, v2, options );\n\t\t\treturn out;\n\t\t}\n\t\tout.fcn = random.factory( options );\n\t} else {\n\t\tout.fcn = random;\n\t}\n\tout.arity += 2;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = clbk;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a beta prime distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} alpha - first shape parameter\n* @param {integer} sa - `alpha` stride length\n* @param {Collection} beta - second shape parameter\n* @param {integer} sb - `beta` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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 {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* betaprime( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*/\nfunction betaprime( N, alpha, sa, beta, sb, out, so, options ) {\n\tvar rand = prng( alpha, sa, 0, beta, sb, 0, arguments.length > 7, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ alpha, beta, out ], [ N ], [ sa, sb, so ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = betaprime;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar binary = require( '@stdlib/strided/base/binary' ).ndarray;\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a beta prime distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} alpha - first shape parameter\n* @param {integer} sa - `alpha` stride length\n* @param {NonNegativeInteger} oa - starting `alpha` index\n* @param {Collection} beta - second shape parameter\n* @param {integer} sb - `beta` stride length\n* @param {NonNegativeInteger} ob - starting `beta` index\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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 {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* betaprime( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\nfunction betaprime( N, alpha, sa, oa, beta, sb, ob, out, so, oo, options ) { // eslint-disable-line max-params\n\tvar rand = prng( alpha, sa, oa, beta, sb, ob, arguments.length > 10, options ); // eslint-disable-line max-len\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ alpha, beta, out ], [ N ], [ sa, sb, so ], [ oa, ob, oo ], rand.fcn ); // eslint-disable-line max-len\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = betaprime;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Fill a strided array with pseudorandom numbers drawn from a beta prime distribution.\n*\n* @module @stdlib/random/strided/betaprime\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var betaprime = require( '@stdlib/random/strided/betaprime' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* betaprime( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var betaprime = require( '@stdlib/random/strided/betaprime' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* betaprime.ndarray( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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 unaryFactory = require( './../../../strided/tools/unary-factory' );\nvar base = require( './../../../base/chi' );\n\n\n// MAIN //\n\n/**\n* Returns a function for filling strided arrays containing pseudorandom numbers drawn from a chi distribution.\n*\n* @name factory\n* @type {Function}\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for filling strided arrays\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var chi = factory();\n* // returns \n*\n* var out = new Float64Array( 10 );\n* // returns \n*\n* var arr = chi( out.length, [ 2.0 ], 0, out, 1 );\n* // returns \n*\n* var bool = ( arr === out );\n* // returns true\n*/\nvar factory = unaryFactory( base );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a chi distribution.\n*\n* @name chi\n* @type {Function}\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} k - degrees of freedom\n* @param {integer} sk - `k` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* chi( out.length, [ 2.0 ], 0, out, 1 );\n*/\nvar chi = factory();\n\n\n// EXPORTS //\n\nmodule.exports = chi;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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* Fill a strided array with pseudorandom numbers drawn from a chi distribution.\n*\n* @module @stdlib/random/strided/chi\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var chi = require( '@stdlib/random/strided/chi' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* chi( out.length, [ 2.0 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var chi = require( '@stdlib/random/strided/chi' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* chi.ndarray( out.length, [ 2.0 ], 0, 0, out, 1, 0 );\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\n// exports: { \"factory\": \"main.factory\", \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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 unaryFactory = require( './../../../strided/tools/unary-factory' );\nvar base = require( './../../../base/chisquare' );\n\n\n// MAIN //\n\n/**\n* Returns a function for filling strided arrays containing pseudorandom numbers drawn from a chi-square distribution.\n*\n* @name factory\n* @type {Function}\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for filling strided arrays\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var chisquare = factory();\n* // returns \n*\n* var out = new Float64Array( 10 );\n* // returns \n*\n* var arr = chisquare( out.length, [ 2.0 ], 0, out, 1 );\n* // returns \n*\n* var bool = ( arr === out );\n* // returns true\n*/\nvar factory = unaryFactory( base );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a chi-square distribution.\n*\n* @name chisquare\n* @type {Function}\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} k - degrees of freedom\n* @param {integer} sk - `k` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* chisquare( out.length, [ 2.0 ], 0, out, 1 );\n*/\nvar chisquare = factory();\n\n\n// EXPORTS //\n\nmodule.exports = chisquare;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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* Fill a strided array with pseudorandom numbers drawn from a chi-square distribution.\n*\n* @module @stdlib/random/strided/chisquare\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var chisquare = require( '@stdlib/random/strided/chisquare' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* chisquare( out.length, [ 2.0 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var chisquare = require( '@stdlib/random/strided/chisquare' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* chisquare.ndarray( out.length, [ 2.0 ], 0, 0, out, 1, 0 );\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\n// exports: { \"factory\": \"main.factory\", \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 isAccessorArray = require( '@stdlib/array/base/assert/is-accessor-array' );\nvar random = require( './../../../base/cosine' );\n\n\n// MAIN //\n\n/**\n* Returns a function for generating pseudorandom numbers.\n.\n*\n* ## Notes\n*\n* - The returned object has the following properties:\n*\n* - **arity**: number of function parameters.\n* - **fcn**: function for generating pseudorandom numbers.\n*\n* @private\n* @param {Collection} x - first parameter\n* @param {integer} sx - `x` stride length\n* @param {NonNegativeInteger} ox - starting `x` index\n* @param {Collection} y - second parameter\n* @param {integer} sy - `y` stride length\n* @param {NonNegativeInteger} oy - starting `y` index\n* @param {boolean} hasOptions - boolean indicating whether to process an options argument\n* @param {(void|Options)} options - function options\n* @returns {Object} function object\n*/\nfunction clbk( x, sx, ox, y, sy, oy, hasOptions, options ) {\n\tvar out;\n\tvar v1;\n\tvar v2;\n\n\tout = {\n\t\t'arity': 0,\n\t\t'fcn': null\n\t};\n\tif ( hasOptions ) {\n\t\tif ( sx === 0 && sy === 0 ) {\n\t\t\tif ( isAccessorArray( x ) ) {\n\t\t\t\tv1 = x.get( ox );\n\t\t\t} else {\n\t\t\t\tv1 = x[ ox ];\n\t\t\t}\n\t\t\tif ( isAccessorArray( y ) ) {\n\t\t\t\tv2 = y.get( oy );\n\t\t\t} else {\n\t\t\t\tv2 = y[ oy ];\n\t\t\t}\n\t\t\tout.fcn = random.factory( v1, v2, options );\n\t\t\treturn out;\n\t\t}\n\t\tout.fcn = random.factory( options );\n\t} else {\n\t\tout.fcn = random;\n\t}\n\tout.arity += 2;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = clbk;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a raised cosine distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} mu - mean\n* @param {integer} sm - `mu` stride length\n* @param {Collection} s - scale parameter\n* @param {integer} ss - `s` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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 {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* cosine( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*/\nfunction cosine( N, mu, sm, s, ss, out, so, options ) {\n\tvar rand = prng( mu, sm, 0, s, ss, 0, arguments.length > 7, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ mu, s, out ], [ N ], [ sm, ss, so ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = cosine;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar binary = require( '@stdlib/strided/base/binary' ).ndarray;\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a raised cosine distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} mu - mean\n* @param {integer} sm - `mu` stride length\n* @param {NonNegativeInteger} om - starting `mu` index\n* @param {Collection} s - scale parameter\n* @param {integer} ss - `s` stride length\n* @param {NonNegativeInteger} os - starting `s` index\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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 {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* cosine( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\nfunction cosine( N, mu, sm, om, s, ss, os, out, so, oo, options ) { // eslint-disable-line max-params\n\tvar rand = prng( mu, sm, om, s, ss, os, arguments.length > 10, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ mu, s, out ], [ N ], [ sm, ss, so ], [ om, os, oo ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = cosine;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Fill a strided array with pseudorandom numbers drawn from a raised cosine distribution.\n*\n* @module @stdlib/random/strided/cosine\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var cosine = require( '@stdlib/random/strided/cosine' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* cosine( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var cosine = require( '@stdlib/random/strided/cosine' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* cosine.ndarray( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 isAccessorArray = require( '@stdlib/array/base/assert/is-accessor-array' );\nvar random = require( './../../../base/discrete-uniform' );\n\n\n// MAIN //\n\n/**\n* Returns a function for generating pseudorandom numbers.\n*\n* ## Notes\n*\n* - The returned object has the following properties:\n*\n* - **arity**: number of function parameters.\n* - **fcn**: function for generating pseudorandom numbers.\n*\n* @private\n* @param {Collection} x - first parameter\n* @param {integer} sx - `x` stride length\n* @param {NonNegativeInteger} ox - starting `x` index\n* @param {Collection} y - second parameter\n* @param {integer} sy - `y` stride length\n* @param {NonNegativeInteger} oy - starting `y` index\n* @param {boolean} hasOptions - boolean indicating whether to process an options argument\n* @param {(void|Options)} options - function options\n* @returns {Object} function object\n*/\nfunction clbk( x, sx, ox, y, sy, oy, hasOptions, options ) {\n\tvar out;\n\tvar v1;\n\tvar v2;\n\n\tout = {\n\t\t'arity': 0,\n\t\t'fcn': null\n\t};\n\tif ( hasOptions ) {\n\t\tif ( sx === 0 && sy === 0 ) {\n\t\t\tif ( isAccessorArray( x ) ) {\n\t\t\t\tv1 = x.get( ox );\n\t\t\t} else {\n\t\t\t\tv1 = x[ ox ];\n\t\t\t}\n\t\t\tif ( isAccessorArray( y ) ) {\n\t\t\t\tv2 = y.get( oy );\n\t\t\t} else {\n\t\t\t\tv2 = y[ oy ];\n\t\t\t}\n\t\t\tout.fcn = random.factory( v1, v2, options );\n\t\t\treturn out;\n\t\t}\n\t\tout.fcn = random.factory( options );\n\t} else {\n\t\tout.fcn = random;\n\t}\n\tout.arity += 2;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = clbk;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a discrete uniform distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} a - minimum support\n* @param {integer} sa - `a` stride length\n* @param {Collection} b - maximum support\n* @param {integer} sb - `b` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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 {Error} minimum support must be less than or equal to maximum support\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* discreteUniform( out.length, [ -10 ], 0, [ 10 ], 0, out, 1 );\n*/\nfunction discreteUniform( N, a, sa, b, sb, out, so, options ) {\n\tvar rand = prng( a, sa, 0, b, sb, 0, arguments.length > 7, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ a, b, out ], [ N ], [ sa, sb, so ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = discreteUniform;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar binary = require( '@stdlib/strided/base/binary' ).ndarray;\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a discrete uniform distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} a - minimum support\n* @param {integer} sa - `a` stride length\n* @param {NonNegativeInteger} oa - starting `a` index\n* @param {Collection} b - maximum support\n* @param {integer} sb - `b` stride length\n* @param {NonNegativeInteger} ob - starting `b` index\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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 {Error} minimum support must be less than or equal to maximum support\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* discreteUniform( out.length, [ -10 ], 0, 0, [ 10 ], 0, 0, out, 1, 0 );\n*/\nfunction discreteUniform( N, a, sa, oa, b, sb, ob, out, so, oo, options ) { // eslint-disable-line max-params\n\tvar rand = prng( a, sa, oa, b, sb, ob, arguments.length > 10, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ a, b, out ], [ N ], [ sa, sb, so ], [ oa, ob, oo ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = discreteUniform;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Fill a strided array with pseudorandom numbers drawn from a discrete uniform distribution.\n*\n* @module @stdlib/random/strided/discrete-uniform\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var discreteUniform = require( '@stdlib/random/strided/discrete-uniform' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* discreteUniform( out.length, [ -10 ], 0, [ 10 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var discreteUniform = require( '@stdlib/random/strided/discrete-uniform' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* discreteUniform.ndarray( out.length, [ -10 ], 0, 0, [ 10 ], 0, 0, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 unaryFactory = require( './../../../strided/tools/unary-factory' );\nvar base = require( './../../../base/exponential' );\n\n\n// MAIN //\n\n/**\n* Returns a function for filling strided arrays containing pseudorandom numbers drawn from an exponential distribution.\n*\n* @name factory\n* @type {Function}\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for filling strided arrays\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var exponential = factory();\n* // returns \n*\n* var out = new Float64Array( 10 );\n* // returns \n*\n* var arr = exponential( out.length, [ 2.0 ], 0, out, 1 );\n* // returns \n*\n* var bool = ( arr === out );\n* // returns true\n*/\nvar factory = unaryFactory( base );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from an exponential distribution.\n*\n* @name exponential\n* @type {Function}\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} lambda - rate parameter\n* @param {integer} sl - `lambda` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* exponential( out.length, [ 2.0 ], 0, out, 1 );\n*/\nvar exponential = factory();\n\n\n// EXPORTS //\n\nmodule.exports = exponential;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Fill a strided array with pseudorandom numbers drawn from an exponential distribution.\n*\n* @module @stdlib/random/strided/exponential\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var exponential = require( '@stdlib/random/strided/exponential' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* exponential( out.length, [ 2.0 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var exponential = require( '@stdlib/random/strided/exponential' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* exponential.ndarray( out.length, [ 2.0 ], 0, 0, out, 1, 0 );\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\n// exports: { \"factory\": \"main.factory\", \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 isAccessorArray = require( '@stdlib/array/base/assert/is-accessor-array' );\nvar random = require( './../../../base/gamma' );\n\n\n// MAIN //\n\n/**\n* Returns a function for generating pseudorandom numbers.\n*\n* ## Notes\n*\n* - The returned object has the following properties:\n*\n* - **arity**: number of function parameters.\n* - **fcn**: function for generating pseudorandom numbers.\n*\n* @private\n* @param {Collection} x - first parameter\n* @param {integer} sx - `x` stride length\n* @param {NonNegativeInteger} ox - starting `x` index\n* @param {Collection} y - second parameter\n* @param {integer} sy - `y` stride length\n* @param {NonNegativeInteger} oy - starting `y` index\n* @param {boolean} hasOptions - boolean indicating whether to process an options argument\n* @param {(void|Options)} options - function options\n* @returns {Object} function object\n*/\nfunction clbk( x, sx, ox, y, sy, oy, hasOptions, options ) {\n\tvar out;\n\tvar v1;\n\tvar v2;\n\n\tout = {\n\t\t'arity': 0,\n\t\t'fcn': null\n\t};\n\tif ( hasOptions ) {\n\t\tif ( sx === 0 && sy === 0 ) {\n\t\t\tif ( isAccessorArray( x ) ) {\n\t\t\t\tv1 = x.get( ox );\n\t\t\t} else {\n\t\t\t\tv1 = x[ ox ];\n\t\t\t}\n\t\t\tif ( isAccessorArray( y ) ) {\n\t\t\t\tv2 = y.get( oy );\n\t\t\t} else {\n\t\t\t\tv2 = y[ oy ];\n\t\t\t}\n\t\t\tout.fcn = random.factory( v1, v2, options );\n\t\t\treturn out;\n\t\t}\n\t\tout.fcn = random.factory( options );\n\t} else {\n\t\tout.fcn = random;\n\t}\n\tout.arity += 2;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = clbk;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a gamma distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} alpha - shape parameter\n* @param {integer} sa - `alpha` stride length\n* @param {Collection} beta - rate parameter\n* @param {integer} sb - `beta` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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 {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* gamma( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*/\nfunction gamma( N, alpha, sa, beta, sb, out, so, options ) {\n\tvar rand = prng( alpha, sa, 0, beta, sb, 0, arguments.length > 7, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ alpha, beta, out ], [ N ], [ sa, sb, so ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gamma;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar binary = require( '@stdlib/strided/base/binary' ).ndarray;\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a gamma distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} alpha - shape parameter\n* @param {integer} sa - `alpha` stride length\n* @param {NonNegativeInteger} oa - starting `alpha` index\n* @param {Collection} beta - rate parameter\n* @param {integer} sb - `beta` stride length\n* @param {NonNegativeInteger} ob - starting `beta` index\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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 {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* gamma( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\nfunction gamma( N, alpha, sa, oa, beta, sb, ob, out, so, oo, options ) { // eslint-disable-line max-params\n\tvar rand = prng( alpha, sa, oa, beta, sb, ob, arguments.length > 10, options ); // eslint-disable-line max-len\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ alpha, beta, out ], [ N ], [ sa, sb, so ], [ oa, ob, oo ], rand.fcn ); // eslint-disable-line max-len\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gamma;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Fill a strided array with pseudorandom numbers drawn from a gamma distribution.\n*\n* @module @stdlib/random/strided/gamma\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var gamma = require( '@stdlib/random/strided/gamma' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* gamma( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var gamma = require( '@stdlib/random/strided/gamma' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* gamma.ndarray( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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 unaryFactory = require( './../../../strided/tools/unary-factory' );\nvar base = require( './../../../base/geometric' );\n\n\n// MAIN //\n\n/**\n* Returns a function for filling strided arrays containing pseudorandom numbers drawn from a geometric distribution.\n*\n* @name factory\n* @type {Function}\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for filling strided arrays\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var geometric = factory();\n* // returns \n*\n* var out = new Float64Array( 10 );\n* // returns \n*\n* var arr = geometric( out.length, [ 0.01 ], 0, out, 1 );\n* // returns \n*\n* var bool = ( arr === out );\n* // returns true\n*/\nvar factory = unaryFactory( base );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a geometric distribution.\n*\n* @name geometric\n* @type {Function}\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} p - success probability\n* @param {integer} sp - `p` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* geometric( out.length, [ 0.01 ], 0, out, 1 );\n*/\nvar geometric = factory();\n\n\n// EXPORTS //\n\nmodule.exports = geometric;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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* Fill a strided array with pseudorandom numbers drawn from a geometric distribution.\n*\n* @module @stdlib/random/strided/geometric\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var geometric = require( '@stdlib/random/strided/geometric' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* geometric( out.length, [ 0.01 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var geometric = require( '@stdlib/random/strided/geometric' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* geometric.ndarray( out.length, [ 0.01 ], 0, 0, out, 1, 0 );\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\n// exports: { \"factory\": \"main.factory\", \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 isAccessorArray = require( '@stdlib/array/base/assert/is-accessor-array' );\nvar random = require( './../../../base/invgamma' );\n\n\n// MAIN //\n\n/**\n* Returns a function for generating pseudorandom numbers.\n.\n*\n* ## Notes\n*\n* - The returned object has the following properties:\n*\n* - **arity**: number of function parameters.\n* - **fcn**: function for generating pseudorandom numbers.\n*\n* @private\n* @param {Collection} x - first parameter\n* @param {integer} sx - `x` stride length\n* @param {NonNegativeInteger} ox - starting `x` index\n* @param {Collection} y - second parameter\n* @param {integer} sy - `y` stride length\n* @param {NonNegativeInteger} oy - starting `y` index\n* @param {boolean} hasOptions - boolean indicating whether to process an options argument\n* @param {(void|Options)} options - function options\n* @returns {Object} function object\n*/\nfunction clbk( x, sx, ox, y, sy, oy, hasOptions, options ) {\n\tvar out;\n\tvar v1;\n\tvar v2;\n\n\tout = {\n\t\t'arity': 0,\n\t\t'fcn': null\n\t};\n\tif ( hasOptions ) {\n\t\tif ( sx === 0 && sy === 0 ) {\n\t\t\tif ( isAccessorArray( x ) ) {\n\t\t\t\tv1 = x.get( ox );\n\t\t\t} else {\n\t\t\t\tv1 = x[ ox ];\n\t\t\t}\n\t\t\tif ( isAccessorArray( y ) ) {\n\t\t\t\tv2 = y.get( oy );\n\t\t\t} else {\n\t\t\t\tv2 = y[ oy ];\n\t\t\t}\n\t\t\tout.fcn = random.factory( v1, v2, options );\n\t\t\treturn out;\n\t\t}\n\t\tout.fcn = random.factory( options );\n\t} else {\n\t\tout.fcn = random;\n\t}\n\tout.arity += 2;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = clbk;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from an inverse gamma distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} alpha - shape parameter\n* @param {integer} sa - `alpha` stride length\n* @param {Collection} beta - scale parameter\n* @param {integer} sb - `beta` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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 {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* invgamma( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*/\nfunction invgamma( N, alpha, sa, beta, sb, out, so, options ) {\n\tvar rand = prng( alpha, sa, 0, beta, sb, 0, arguments.length > 7, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ alpha, beta, out ], [ N ], [ sa, sb, so ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = invgamma;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar binary = require( '@stdlib/strided/base/binary' ).ndarray;\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from an inverse gamma distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} alpha - shape parameter\n* @param {integer} sa - `alpha` stride length\n* @param {NonNegativeInteger} oa - starting `alpha` index\n* @param {Collection} beta - scale parameter\n* @param {integer} sb - `beta` stride length\n* @param {NonNegativeInteger} ob - starting `beta` index\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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 {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* invgamma( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\nfunction invgamma( N, alpha, sa, oa, beta, sb, ob, out, so, oo, options ) { // eslint-disable-line max-params\n\tvar rand = prng( alpha, sa, oa, beta, sb, ob, arguments.length > 10, options ); // eslint-disable-line max-len\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ alpha, beta, out ], [ N ], [ sa, sb, so ], [ oa, ob, oo ], rand.fcn ); // eslint-disable-line max-len\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = invgamma;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Fill a strided array with pseudorandom numbers drawn from an inverse gamma distribution.\n*\n* @module @stdlib/random/strided/invgamma\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var invgamma = require( '@stdlib/random/strided/invgamma' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* invgamma( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var invgamma = require( '@stdlib/random/strided/invgamma' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* invgamma.ndarray( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 isAccessorArray = require( '@stdlib/array/base/assert/is-accessor-array' );\nvar random = require( './../../../base/lognormal' );\n\n\n// MAIN //\n\n/**\n* Returns a function for generating pseudorandom numbers.\n*\n* ## Notes\n*\n* - The returned object has the following properties:\n*\n* - **arity**: number of function parameters.\n* - **fcn**: function for generating pseudorandom numbers.\n*\n* @private\n* @param {Collection} x - first parameter\n* @param {integer} sx - `x` stride length\n* @param {NonNegativeInteger} ox - starting `x` index\n* @param {Collection} y - second parameter\n* @param {integer} sy - `y` stride length\n* @param {NonNegativeInteger} oy - starting `y` index\n* @param {boolean} hasOptions - boolean indicating whether to process an options argument\n* @param {(void|Options)} options - function options\n* @returns {Object} function object\n*/\nfunction clbk( x, sx, ox, y, sy, oy, hasOptions, options ) {\n\tvar out;\n\tvar v1;\n\tvar v2;\n\n\tout = {\n\t\t'arity': 0,\n\t\t'fcn': null\n\t};\n\tif ( hasOptions ) {\n\t\tif ( sx === 0 && sy === 0 ) {\n\t\t\tif ( isAccessorArray( x ) ) {\n\t\t\t\tv1 = x.get( ox );\n\t\t\t} else {\n\t\t\t\tv1 = x[ ox ];\n\t\t\t}\n\t\t\tif ( isAccessorArray( y ) ) {\n\t\t\t\tv2 = y.get( oy );\n\t\t\t} else {\n\t\t\t\tv2 = y[ oy ];\n\t\t\t}\n\t\t\tout.fcn = random.factory( v1, v2, options );\n\t\t\treturn out;\n\t\t}\n\t\tout.fcn = random.factory( options );\n\t} else {\n\t\tout.fcn = random;\n\t}\n\tout.arity += 2;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = clbk;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a lognormal distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} mu - location parameter\n* @param {integer} sm - `mu` stride length\n* @param {Collection} sigma - scale parameter\n* @param {integer} ss - `sigma` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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 {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* lognormal( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*/\nfunction lognormal( N, mu, sm, sigma, ss, out, so, options ) {\n\tvar rand = prng( mu, sm, 0, sigma, ss, 0, arguments.length > 7, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ mu, sigma, out ], [ N ], [ sm, ss, so ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = lognormal;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar binary = require( '@stdlib/strided/base/binary' ).ndarray;\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a lognormal distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} mu - location parameter\n* @param {integer} sm - `mu` stride length\n* @param {NonNegativeInteger} om - starting `mu` index\n* @param {Collection} sigma - scale parameter\n* @param {integer} ss - `sigma` stride length\n* @param {NonNegativeInteger} os - starting `sigma` index\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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 {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* lognormal( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\nfunction lognormal( N, mu, sm, om, sigma, ss, os, out, so, oo, options ) { // eslint-disable-line max-params\n\tvar rand = prng( mu, sm, om, sigma, ss, os, arguments.length > 10, options ); // eslint-disable-line max-len\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ mu, sigma, out ], [ N ], [ sm, ss, so ], [ om, os, oo ], rand.fcn ); // eslint-disable-line max-len\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = lognormal;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Fill a strided array with pseudorandom numbers drawn from a lognormal distribution.\n*\n* @module @stdlib/random/strided/lognormal\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var lognormal = require( '@stdlib/random/strided/lognormal' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* lognormal( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var lognormal = require( '@stdlib/random/strided/lognormal' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* lognormal.ndarray( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' );\nvar random = require( './../../../base/minstd' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom integers on the interval `[1, 2147483646]`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [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 {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd( out.length, out, 1 );\n*/\nfunction minstd( N, out, so, options ) {\n\tvar rand;\n\tif ( arguments.length > 3 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], rand );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = minstd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar random = require( './../../../base/minstd' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom integers on the interval `[1, 2147483646]`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [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 {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd( out.length, out, 1, 0 );\n*/\nfunction minstd( N, out, so, oo, options ) {\n\tvar rand;\n\tif ( arguments.length > 4 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], [ oo ], rand );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = minstd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' );\nvar random = require( './../../../base/minstd' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers between `0` and `1`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [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 {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd( out.length, out, 1 );\n*/\nfunction minstd( N, out, so, options ) {\n\tvar rand;\n\tif ( arguments.length > 3 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], rand.normalized );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = minstd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar random = require( './../../../base/minstd' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with uniformly distributed pseudorandom numbers between `0` and `1`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [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 {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd( out.length, out, 1, 0 );\n*/\nfunction minstd( N, out, so, oo, options ) {\n\tvar rand;\n\tif ( arguments.length > 4 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.normalized );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = minstd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Fill a strided array with pseudorandom numbers generated using a linear congruential pseudorandom number generator (LCG).\n*\n* @module @stdlib/random/strided/minstd\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var minstd = require( '@stdlib/random/strided/minstd' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd( out.length, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var minstd = require( '@stdlib/random/strided/minstd' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd.ndarray( out.length, out, 1, 0 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var minstd = require( '@stdlib/random/strided/minstd' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd.normalized( out.length, out, 1 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\nvar normalized = require( './normalized.js' );\nvar ndarrayNormalized = require( './normalized.ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\nsetReadOnly( main, 'normalized', normalized );\nsetReadOnly( normalized, 'ndarray', ndarrayNormalized );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\", \"normalized\": \"main.normalized\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' );\nvar random = require( './../../../base/minstd-shuffle' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom integers on the interval `[1, 2147483646]`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [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 {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd( out.length, out, 1 );\n*/\nfunction minstd( N, out, so, options ) {\n\tvar rand;\n\tif ( arguments.length > 3 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], rand );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = minstd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar random = require( './../../../base/minstd-shuffle' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom integers on the interval `[1, 2147483646]`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [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 {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd( out.length, out, 1, 0 );\n*/\nfunction minstd( N, out, so, oo, options ) {\n\tvar rand;\n\tif ( arguments.length > 4 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], [ oo ], rand );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = minstd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' );\nvar random = require( './../../../base/minstd-shuffle' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers between `0` and `1`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [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 {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd( out.length, out, 1 );\n*/\nfunction minstd( N, out, so, options ) {\n\tvar rand;\n\tif ( arguments.length > 3 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], rand.normalized );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = minstd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar random = require( './../../../base/minstd-shuffle' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with uniformly distributed pseudorandom numbers between `0` and `1`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [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 {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd( out.length, out, 1, 0 );\n*/\nfunction minstd( N, out, so, oo, options ) {\n\tvar rand;\n\tif ( arguments.length > 4 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.normalized );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = minstd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Fill a strided array with pseudorandom numbers generated using a linear congruential pseudorandom number generator (LCG) whose output is shuffled.\n*\n* @module @stdlib/random/strided/minstd-shuffle\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var minstd = require( '@stdlib/random/strided/minstd-shuffle' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd( out.length, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var minstd = require( '@stdlib/random/strided/minstd-shuffle' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd.ndarray( out.length, out, 1, 0 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var minstd = require( '@stdlib/random/strided/minstd-shuffle' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd.normalized( out.length, out, 1 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\nvar normalized = require( './normalized.js' );\nvar ndarrayNormalized = require( './normalized.ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\nsetReadOnly( main, 'normalized', normalized );\nsetReadOnly( normalized, 'ndarray', ndarrayNormalized );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\", \"normalized\": \"main.normalized\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' );\nvar random = require( './../../../base/mt19937' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom integers on the interval `[0, 4294967295]`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function 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 {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* mt19937( out.length, out, 1 );\n*/\nfunction mt19937( N, out, so, options ) {\n\tvar rand;\n\tif ( arguments.length > 3 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], rand );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = mt19937;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar random = require( './../../../base/mt19937' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom integers on the interval `[0, 4294967295]`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function 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 {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* mt19937( out.length, out, 1, 0 );\n*/\nfunction mt19937( N, out, so, oo, options ) {\n\tvar rand;\n\tif ( arguments.length > 4 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], [ oo ], rand );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = mt19937;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' );\nvar random = require( './../../../base/mt19937' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers between `0` and `1`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function 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 {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* mt19937( out.length, out, 1 );\n*/\nfunction mt19937( N, out, so, options ) {\n\tvar rand;\n\tif ( arguments.length > 3 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], rand.normalized );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = mt19937;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar random = require( './../../../base/mt19937' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with uniformly distributed pseudorandom numbers between `0` and `1`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function 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 {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* mt19937( out.length, out, 1, 0 );\n*/\nfunction mt19937( N, out, so, oo, options ) {\n\tvar rand;\n\tif ( arguments.length > 4 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.normalized );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = mt19937;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Fill a strided array with pseudorandom numbers generated using a 32-bit Mersenne Twister pseudorandom number generator.\n*\n* @module @stdlib/random/strided/mt19937\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var mt19937 = require( '@stdlib/random/strided/mt19937' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* mt19937( out.length, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var mt19937 = require( '@stdlib/random/strided/mt19937' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* mt19937.ndarray( out.length, out, 1, 0 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var mt19937 = require( '@stdlib/random/strided/mt19937' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* mt19937.normalized( out.length, out, 1 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\nvar normalized = require( './normalized.js' );\nvar ndarrayNormalized = require( './normalized.ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\nsetReadOnly( main, 'normalized', normalized );\nsetReadOnly( normalized, 'ndarray', ndarrayNormalized );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\", \"normalized\": \"main.normalized\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 isAccessorArray = require( '@stdlib/array/base/assert/is-accessor-array' );\nvar random = require( './../../../base/normal' );\n\n\n// MAIN //\n\n/**\n* Returns a function for generating pseudorandom numbers.\n*\n* ## Notes\n*\n* - The returned object has the following properties:\n*\n* - **arity**: number of function parameters.\n* - **fcn**: function for generating pseudorandom numbers.\n*\n* @private\n* @param {Collection} x - first parameter\n* @param {integer} sx - `x` stride length\n* @param {NonNegativeInteger} ox - starting `x` index\n* @param {Collection} y - second parameter\n* @param {integer} sy - `y` stride length\n* @param {NonNegativeInteger} oy - starting `y` index\n* @param {boolean} hasOptions - boolean indicating whether to process an options argument\n* @param {(void|Options)} options - function options\n* @returns {Object} function object\n*/\nfunction clbk( x, sx, ox, y, sy, oy, hasOptions, options ) {\n\tvar out;\n\tvar v1;\n\tvar v2;\n\n\tout = {\n\t\t'arity': 0,\n\t\t'fcn': null\n\t};\n\tif ( hasOptions ) {\n\t\tif ( sx === 0 && sy === 0 ) {\n\t\t\tif ( isAccessorArray( x ) ) {\n\t\t\t\tv1 = x.get( ox );\n\t\t\t} else {\n\t\t\t\tv1 = x[ ox ];\n\t\t\t}\n\t\t\tif ( isAccessorArray( y ) ) {\n\t\t\t\tv2 = y.get( oy );\n\t\t\t} else {\n\t\t\t\tv2 = y[ oy ];\n\t\t\t}\n\t\t\tout.fcn = random.factory( v1, v2, options );\n\t\t\treturn out;\n\t\t}\n\t\tout.fcn = random.factory( options );\n\t} else {\n\t\tout.fcn = random;\n\t}\n\tout.arity += 2;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = clbk;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a normal distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} mu - mean\n* @param {integer} sm - `mu` stride length\n* @param {Collection} sigma - standard deviation\n* @param {integer} ss - `sigma` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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 {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* normal( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*/\nfunction normal( N, mu, sm, sigma, ss, out, so, options ) {\n\tvar rand = prng( mu, sm, 0, sigma, ss, 0, arguments.length > 7, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ mu, sigma, out ], [ N ], [ sm, ss, so ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = normal;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar binary = require( '@stdlib/strided/base/binary' ).ndarray;\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a normal distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} mu - mean\n* @param {integer} sm - `mu` stride length\n* @param {NonNegativeInteger} om - starting `mu` index\n* @param {Collection} sigma - standard deviation\n* @param {integer} ss - `sigma` stride length\n* @param {NonNegativeInteger} os - starting `sigma` index\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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 {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* normal( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\nfunction normal( N, mu, sm, om, sigma, ss, os, out, so, oo, options ) { // eslint-disable-line max-params\n\tvar rand = prng( mu, sm, om, sigma, ss, os, arguments.length > 10, options ); // eslint-disable-line max-len\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ mu, sigma, out ], [ N ], [ sm, ss, so ], [ om, os, oo ], rand.fcn ); // eslint-disable-line max-len\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = normal;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Fill a strided array with pseudorandom numbers drawn from a normal distribution.\n*\n* @module @stdlib/random/strided/normal\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var normal = require( '@stdlib/random/strided/normal' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* normal( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var normal = require( '@stdlib/random/strided/normal' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* normal.ndarray( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' );\nvar random = require( './../../../base/randu' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with uniformly distributed pseudorandom numbers between `0` and `1`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {string} [options.name='mt19937'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [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 {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* randu( out.length, out, 1 );\n*/\nfunction randu( N, out, so, options ) {\n\tvar rand;\n\tif ( arguments.length > 3 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], rand );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = randu;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar random = require( './../../../base/randu' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with uniformly distributed pseudorandom numbers between `0` and `1`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {string} [options.name='mt19937'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [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 {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* randu( out.length, out, 1, 0 );\n*/\nfunction randu( N, out, so, oo, options ) {\n\tvar rand;\n\tif ( arguments.length > 4 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], [ oo ], rand );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = randu;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Fill a strided array with uniformly distributed pseudorandom numbers between `0` and `1`.\n*\n* @module @stdlib/random/strided/randu\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var randu = require( '@stdlib/random/strided/randu' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* randu( out.length, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var randu = require( '@stdlib/random/strided/randu' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* randu.ndarray( out.length, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 isAccessorArray = require( '@stdlib/array/base/assert/is-accessor-array' );\nvar random = require( './../../../base/uniform' );\n\n\n// MAIN //\n\n/**\n* Returns a function for generating pseudorandom numbers.\n*\n* ## Notes\n*\n* - The returned object has the following properties:\n*\n* - **arity**: number of function parameters.\n* - **fcn**: function for generating pseudorandom numbers.\n*\n* @private\n* @param {Collection} x - first parameter\n* @param {integer} sx - `x` stride length\n* @param {NonNegativeInteger} ox - starting `x` index\n* @param {Collection} y - second parameter\n* @param {integer} sy - `y` stride length\n* @param {NonNegativeInteger} oy - starting `y` index\n* @param {boolean} hasOptions - boolean indicating whether to process an options argument\n* @param {(void|Options)} options - function options\n* @returns {Object} function object\n*/\nfunction clbk( x, sx, ox, y, sy, oy, hasOptions, options ) {\n\tvar out;\n\tvar v1;\n\tvar v2;\n\n\tout = {\n\t\t'arity': 0,\n\t\t'fcn': null\n\t};\n\tif ( hasOptions ) {\n\t\tif ( sx === 0 && sy === 0 ) {\n\t\t\tif ( isAccessorArray( x ) ) {\n\t\t\t\tv1 = x.get( ox );\n\t\t\t} else {\n\t\t\t\tv1 = x[ ox ];\n\t\t\t}\n\t\t\tif ( isAccessorArray( y ) ) {\n\t\t\t\tv2 = y.get( oy );\n\t\t\t} else {\n\t\t\t\tv2 = y[ oy ];\n\t\t\t}\n\t\t\tout.fcn = random.factory( v1, v2, options );\n\t\t\treturn out;\n\t\t}\n\t\tout.fcn = random.factory( options );\n\t} else {\n\t\tout.fcn = random;\n\t}\n\tout.arity += 2;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = clbk;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a continuous uniform distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} a - minimum support\n* @param {integer} sa - `a` stride length\n* @param {Collection} b - maximum support\n* @param {integer} sb - `b` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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 {Error} minimum support must be less than maximum support\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* uniform( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*/\nfunction uniform( N, a, sa, b, sb, out, so, options ) {\n\tvar rand = prng( a, sa, 0, b, sb, 0, arguments.length > 7, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ a, b, out ], [ N ], [ sa, sb, so ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = uniform;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar binary = require( '@stdlib/strided/base/binary' ).ndarray;\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a continuous uniform distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} a - minimum support\n* @param {integer} sa - `a` stride length\n* @param {NonNegativeInteger} oa - starting `a` index\n* @param {Collection} b - maximum support\n* @param {integer} sb - `b` stride length\n* @param {NonNegativeInteger} ob - starting `b` index\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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 {Error} minimum support must be less than maximum support\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* uniform( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\nfunction uniform( N, a, sa, oa, b, sb, ob, out, so, oo, options ) { // eslint-disable-line max-params\n\tvar rand = prng( a, sa, oa, b, sb, ob, arguments.length > 10, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ a, b, out ], [ N ], [ sa, sb, so ], [ oa, ob, oo ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = uniform;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Fill a strided array with pseudorandom numbers drawn from a continuous uniform distribution.\n*\n* @module @stdlib/random/strided/uniform\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var uniform = require( '@stdlib/random/strided/uniform' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* uniform( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var uniform = require( '@stdlib/random/strided/uniform' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* uniform.ndarray( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 isAccessorArray = require( '@stdlib/array/base/assert/is-accessor-array' );\nvar random = require( './../../../base/weibull' );\n\n\n// MAIN //\n\n/**\n* Returns a function for generating pseudorandom numbers.\n*\n* ## Notes\n*\n* - The returned object has the following properties:\n*\n* - **arity**: number of function parameters.\n* - **fcn**: function for generating pseudorandom numbers.\n*\n* @private\n* @param {Collection} x - first parameter\n* @param {integer} sx - `x` stride length\n* @param {NonNegativeInteger} ox - starting `x` index\n* @param {Collection} y - second parameter\n* @param {integer} sy - `y` stride length\n* @param {NonNegativeInteger} oy - starting `y` index\n* @param {boolean} hasOptions - boolean indicating whether to process an options argument\n* @param {(void|Options)} options - function options\n* @returns {Object} function object\n*/\nfunction clbk( x, sx, ox, y, sy, oy, hasOptions, options ) {\n\tvar out;\n\tvar v1;\n\tvar v2;\n\n\tout = {\n\t\t'arity': 0,\n\t\t'fcn': null\n\t};\n\tif ( hasOptions ) {\n\t\tif ( sx === 0 && sy === 0 ) {\n\t\t\tif ( isAccessorArray( x ) ) {\n\t\t\t\tv1 = x.get( ox );\n\t\t\t} else {\n\t\t\t\tv1 = x[ ox ];\n\t\t\t}\n\t\t\tif ( isAccessorArray( y ) ) {\n\t\t\t\tv2 = y.get( oy );\n\t\t\t} else {\n\t\t\t\tv2 = y[ oy ];\n\t\t\t}\n\t\t\tout.fcn = random.factory( v1, v2, options );\n\t\t\treturn out;\n\t\t}\n\t\tout.fcn = random.factory( options );\n\t} else {\n\t\tout.fcn = random;\n\t}\n\tout.arity += 2;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = clbk;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a Weibull distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} k - scale parameter\n* @param {integer} sk - `k` stride length\n* @param {Collection} lambda - shape parameter\n* @param {integer} sl - `lambda` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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 {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* weibull( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*/\nfunction weibull( N, k, sk, lambda, sl, out, so, options ) {\n\tvar rand = prng( k, sk, 0, lambda, sl, 0, arguments.length > 7, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ k, lambda, out ], [ N ], [ sk, sl, so ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = weibull;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar binary = require( '@stdlib/strided/base/binary' ).ndarray;\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a Weibull distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} k - scale parameter\n* @param {integer} sk - `k` stride length\n* @param {NonNegativeInteger} ok - starting `k` index\n* @param {Collection} lambda - shape parameter\n* @param {integer} sl - `lambda` stride length\n* @param {NonNegativeInteger} ol - starting `lambda` index\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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 {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* weibull( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\nfunction weibull( N, k, sk, ok, lambda, sl, ol, out, so, oo, options ) { // eslint-disable-line max-params\n\tvar rand = prng( k, sk, ok, lambda, sl, ol, arguments.length > 10, options ); // eslint-disable-line max-len\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ k, lambda, out ], [ N ], [ sk, sl, so ], [ ok, ol, oo ], rand.fcn ); // eslint-disable-line max-len\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = weibull;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Fill a strided array with pseudorandom numbers drawn from a Weibull distribution.\n*\n* @module @stdlib/random/strided/weibull\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var weibull = require( '@stdlib/random/strided/weibull' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* weibull( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var weibull = require( '@stdlib/random/strided/weibull' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* weibull.ndarray( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-read-only-property' );\n\n\n// MAIN //\n\n/**\n* Top-level namespace.\n*\n* @namespace ns\n*/\nvar ns = {};\n\n/**\n* @name arcsine\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/arcsine}\n*/\nsetReadOnly( ns, 'arcsine', require( './../../strided/arcsine' ) );\n\n/**\n* @name bernoulli\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/bernoulli}\n*/\nsetReadOnly( ns, 'bernoulli', require( './../../strided/bernoulli' ) );\n\n/**\n* @name beta\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/beta}\n*/\nsetReadOnly( ns, 'beta', require( './../../strided/beta' ) );\n\n/**\n* @name betaprime\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/betaprime}\n*/\nsetReadOnly( ns, 'betaprime', require( './../../strided/betaprime' ) );\n\n/**\n* @name chi\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/chi}\n*/\nsetReadOnly( ns, 'chi', require( './../../strided/chi' ) );\n\n/**\n* @name chisquare\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/chisquare}\n*/\nsetReadOnly( ns, 'chisquare', require( './../../strided/chisquare' ) );\n\n/**\n* @name cosine\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/cosine}\n*/\nsetReadOnly( ns, 'cosine', require( './../../strided/cosine' ) );\n\n/**\n* @name discreteUniform\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/discrete-uniform}\n*/\nsetReadOnly( ns, 'discreteUniform', require( './../../strided/discrete-uniform' ) );\n\n/**\n* @name exponential\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/exponential}\n*/\nsetReadOnly( ns, 'exponential', require( './../../strided/exponential' ) );\n\n/**\n* @name gamma\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/gamma}\n*/\nsetReadOnly( ns, 'gamma', require( './../../strided/gamma' ) );\n\n/**\n* @name geometric\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/geometric}\n*/\nsetReadOnly( ns, 'geometric', require( './../../strided/geometric' ) );\n\n/**\n* @name invgamma\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/invgamma}\n*/\nsetReadOnly( ns, 'invgamma', require( './../../strided/invgamma' ) );\n\n/**\n* @name lognormal\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/lognormal}\n*/\nsetReadOnly( ns, 'lognormal', require( './../../strided/lognormal' ) );\n\n/**\n* @name minstd\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/minstd}\n*/\nsetReadOnly( ns, 'minstd', require( './../../strided/minstd' ) );\n\n/**\n* @name minstdShuffle\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/minstd-shuffle}\n*/\nsetReadOnly( ns, 'minstdShuffle', require( './../../strided/minstd-shuffle' ) );\n\n/**\n* @name mt19937\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/mt19937}\n*/\nsetReadOnly( ns, 'mt19937', require( './../../strided/mt19937' ) );\n\n/**\n* @name normal\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/normal}\n*/\nsetReadOnly( ns, 'normal', require( './../../strided/normal' ) );\n\n/**\n* @name randu\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/randu}\n*/\nsetReadOnly( ns, 'randu', require( './../../strided/randu' ) );\n\n/**\n* @name uniform\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/uniform}\n*/\nsetReadOnly( ns, 'uniform', require( './../../strided/uniform' ) );\n\n/**\n* @name weibull\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/weibull}\n*/\nsetReadOnly( ns, 'weibull', require( './../../strided/weibull' ) );\n\n\n// EXPORTS //\n\nmodule.exports = ns;\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* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-read-only-property' );\n\n\n// MAIN //\n\n/**\n* Top-level namespace.\n*\n* @namespace ns\n*/\nvar ns = {};\n\n/**\n* @name array\n* @memberof ns\n* @readonly\n* @type {Namespace}\n* @see {@link module:@stdlib/random/array}\n*/\nsetReadOnly( ns, 'array', require( './../array' ) );\n\n/**\n* @name base\n* @memberof ns\n* @readonly\n* @type {Namespace}\n* @see {@link module:@stdlib/random/base}\n*/\nsetReadOnly( ns, 'base', require( './../base' ) );\n\n/**\n* @name iterators\n* @memberof ns\n* @readonly\n* @type {Namespace}\n* @see {@link module:@stdlib/random/iter}\n*/\nsetReadOnly( ns, 'iterators', require( './../iter' ) );\n\n/**\n* @name sample\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/sample}\n*/\nsetReadOnly( ns, 'sample', require( './../sample' ) );\n\n/**\n* @name shuffle\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/shuffle}\n*/\nsetReadOnly( ns, 'shuffle', require( './../shuffle' ) );\n\n/**\n* @name streams\n* @memberof ns\n* @readonly\n* @type {Namespace}\n* @see {@link module:@stdlib/random/streams}\n*/\nsetReadOnly( ns, 'streams', require( './../streams' ) );\n\n/**\n* @name strided\n* @memberof ns\n* @readonly\n* @type {Namespace}\n* @see {@link module:@stdlib/random/strided}\n*/\nsetReadOnly( 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A0B,EAKtD,OAAO,QAAUA", - "names": ["require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "contains", "format", "validate", "opts", "dtypes", "options", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "isNonNegativeInteger", "isFunction", "isStringArray", "isCollection", "contains", "filledBy", "binary", "ctors", "format", "validate", "Random", "prng", "dtypes", "dtype", "len", "param1", "param2", "options", "ctor", "opts", "out", "err", "dt", "wrapper", "require_lib", "__commonJSMin", "exports", "module", "main", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "contains", "format", "validate", "opts", "dtypes", "options", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "isNonNegativeInteger", "isFunction", "isStringArray", "isCollection", "contains", "filledBy", "nullary", "ctors", "format", "validate", "Random", "prng", "dtypes", "dtype", "len", "options", "ctor", "opts", "out", "err", "dt", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadWriteAccessor", "setReadOnlyAccessor", "setReadOnly", "isStringArray", "isFunction", "isMethodIn", "hasOwnProp", "contains", "constantFunction", "noop", "BinaryRandom", "NullaryRandom", "format", "createFactory", "prng", "dtypes", "dtype", "isValidDataType", "factory", "Random", "random", "param1", "param2", "assign", "nargs", "base", "opts", "rand", "dt", "rand1", "rand2", "assign1", "assign2", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "len", "options", "out", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "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", "M", "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", "initState", "seed", "i", "j", "k", "twist", "w", "factory", "options", "STATE", "opts", "slen", "err", "mt19937", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "normalized", "len", "out", "r", "x", "require_main", "__commonJSMin", "exports", "module", "factory", "randuint32", "mt19937", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isNumber", "format", "isnan", "validate", "a", "b", "require_arcsine", "__commonJSMin", "exports", "module", "pow", "sin", "HALF_PI", "arcsine", "rand", "a", "b", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "typedarray2json", "format", "validate", "arcsine0", "factory", "opts", "rand", "prng", "err", "a", "b", "arcsine2", "arcsine1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "arcsine", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "binaryFactory", "dtypes", "defaults", "base", "DTYPES", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "arcsine", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "contains", "format", "validate", "opts", "dtypes", "options", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "isNonNegativeInteger", "isFunction", "isStringArray", "isCollection", "contains", "filledBy", "unary", "ctors", "format", "validate", "Random", "prng", "dtypes", "dtype", "len", "param1", "options", "ctor", "opts", "out", "err", "dt", "wrapper", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadWriteAccessor", "setReadOnlyAccessor", "setReadOnly", "isStringArray", "isFunction", "isMethodIn", "isPlainObject", "hasOwnProp", "contains", "constantFunction", "noop", "UnaryRandom", "NullaryRandom", "format", "createFactory", "prng", "dtypes", "dtype", "isValidDataType", "factory", "Random", "random", "param1", "assign", "nargs", "base", "opts", "rand", "dt", "rand1", "rand2", "assign1", "assign2", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "len", "options", "out", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isProbability", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "typedarray2json", "format", "factory", "opts", "rand", "prng", "p", "bernoulli2", "bernoulli1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "bernoulli", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "unaryFactory", "dtypes", "defaults", "base", "DTYPES", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "bernoulli", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_coords_array", "__commonJSMin", "exports", "module", "sqrt", "exp", "ln", "V", "coordsArray", "N", "rTail", "X", "f", "i", "require_ratio_array", "__commonJSMin", "exports", "module", "ratioArray", "X", "R", "i", "require_sample_tail", "__commonJSMin", "exports", "module", "ln", "sampleTail", "rand", "rTail", "isNegative", "x", "y", "require_improved_ziggurat", "__commonJSMin", "exports", "module", "abs", "exp", "coordsArray", "ratioArray", "sampleTail", "NUM_BLOCKS", "START_RIGHT_TAIL", "X", "R", "LAST_7_BITS_MASK", "wrap", "randu", "randi", "randn", "f0", "f1", "x2", "x", "u", "i", "j", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isFunction", "isObject", "isBoolean", "hasOwnProp", "isUint32Array", "mt19937", "constantFunction", "noop", "floor", "UINT32_MAX", "typedarray2json", "format", "improvedZiggurat", "factory", "options", "randu", "randi", "randn", "opts", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "randn", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isPositive", "format", "validate", "alpha", "beta", "require_standard_gamma", "__commonJSMin", "exports", "module", "ln", "sqrt", "pow", "ONE_THIRD", "standardGamma", "randu", "randn", "alpha", "flg", "x2", "v0", "v1", "c", "d", "x", "s", "u", "v", "require_sample1", "__commonJSMin", "exports", "module", "pow", "ln", "sample", "randu", "randn", "alpha", "flg", "s4", "A", "s", "t", "u", "x", "y", "require_sample2", "__commonJSMin", "exports", "module", "pow", "ln", "sample", "randu", "randn", "alpha", "beta", "sigma", "flg", "mu", "A", "B", "C", "L", "s", "u", "x", "y", "require_sample3", "__commonJSMin", "exports", "module", "exp", "pow", "ln", "sample", "rand", "alpha", "beta", "lx", "ly", "xy", "v", "x", "y", "require_beta", "__commonJSMin", "exports", "module", "standardGamma", "sample1", "sample2", "sample3", "sample", "randu", "randn", "alpha", "beta", "ga", "gb", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isBoolean", "isFunction", "hasOwnProp", "constantFunction", "noop", "randn", "randu", "isnan", "gcopy", "Uint32Array", "isUint32Array", "assign", "typedarray2json", "format", "validate", "beta0", "factory", "STATE", "rnorm", "alpha", "beta", "opts", "rand", "prng", "FLG", "err", "beta2", "beta1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "beta", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "binaryFactory", "dtypes", "defaults", "base", "DTYPES", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "beta", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isPositive", "format", "validate", "alpha", "beta", "require_gamma", "__commonJSMin", "exports", "module", "ln", "gamma", "randu", "randn", "beta", "d", "c", "flg", "x2", "v0", "v1", "x", "u", "v", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isUint32Array", "isBoolean", "isFunction", "hasOwnProp", "constantFunction", "noop", "randn", "randu", "isnan", "sqrt", "pow", "gcopy", "Uint32Array", "typedarray2json", "assign", "format", "validate", "gamma0", "ONE_THIRD", "factory", "STATE", "alpha", "rnorm", "beta", "opts", "rand", "prng", "FLG", "err", "c", "d", "gamma2", "gamma1a", "gamma1b", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "gamma", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isPositive", "format", "validate", "alpha", "beta", "require_betaprime", "__commonJSMin", "exports", "module", "sample", "rgamma", "alpha", "beta", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "constantFunction", "noop", "gammaFactory", "isnan", "typedarray2json", "format", "validate", "betaprime0", "factory", "rgamma", "alpha", "beta", "opts", "rand", "prng", "err", "betaprime2", "betaprime1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "betaprime", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "binaryFactory", "dtypes", "defaults", "base", "DTYPES", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "betaprime", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isPositiveInteger", "isProbability", "format", "validate", "n", "p", "require_sample1", "__commonJSMin", "exports", "module", "sample", "rand", "n", "p", "sum", "i", "require_correction", "__commonJSMin", "exports", "module", "pow", "ONE_12", "ONE_360", "ONE_1260", "correction", "k", "v", "require_sample2", "__commonJSMin", "exports", "module", "floor", "sign", "sqrt", "abs", "ln", "correction", "ONE_SIXTH", "sample", "rand", "n", "p", "alpha", "urvr", "snpq", "npq", "rho", "tmp", "nm", "nr", "us", "km", "nk", "vr", "a", "b", "c", "f", "h", "i", "k", "m", "q", "r", "t", "u", "v", "x", "require_binomial", "__commonJSMin", "exports", "module", "sample1", "sample2", "sample", "rand", "n", "p", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "isnan", "isPositiveInteger", "isProbability", "randu", "typedarray2json", "format", "validate", "binomial0", "factory", "opts", "rand", "prng", "err", "p", "binomial2", "binomial1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "n", "require_main", "__commonJSMin", "exports", "module", "factory", "binomial", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "binaryFactory", "dtypes", "defaults", "base", "DTYPES", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "binomial", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isNumber", "isPositive", "format", "isnan", "validate", "x0", "gamma", "require_cauchy", "__commonJSMin", "exports", "module", "tan", "PI", "cauchy", "randn", "x0", "gamma", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "isnan", "randn", "typedarray2json", "format", "validate", "cauchy0", "factory", "gamma", "rnorm", "opts", "rand", "prng", "err", "x0", "cauchy2", "cauchy1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "cauchy", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "binaryFactory", "dtypes", "defaults", "base", "DTYPES", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "cauchy", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isPositive", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "isnan", "gamma", "typedarray2json", "format", "factory", "rgamma", "rand", "opts", "prng", "k", "chisquare2", "chisquare1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "chisquare", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isPositive", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "isnan", "chisquare", "typedarray2json", "sqrt", "format", "factory", "rchisq", "rand", "opts", "prng", "k", "chi2", "chi1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "chi", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "unaryFactory", "dtypes", "defaults", "base", "DTYPES", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "chi", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "unaryFactory", "dtypes", "defaults", "base", "DTYPES", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "chisquare", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isNumber", "isPositive", "format", "isnan", "validate", "mu", "s", "require_cosine", "__commonJSMin", "exports", "module", "quantile", "sample", "rand", "mu", "s", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "typedarray2json", "format", "validate", "cosine0", "factory", "opts", "rand", "prng", "err", "mu", "s", "cosine2", "cosine1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "cosine", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "binaryFactory", "dtypes", "defaults", "base", "DTYPES", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "cosine", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isInteger", "format", "isnan", "validate", "a", "b", "require_discrete_uniform", "__commonJSMin", "exports", "module", "MAX_SAFE_INTEGER", "floor", "discreteUniform", "rand", "a", "b", "result", "RANGE", "range", "limit", "bsize", "mult", "MIN", "MAX", "inc", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randi", "isnan", "isInteger", "typedarray2json", "format", "validate", "discreteUniform0", "factory", "opts", "rand", "prng", "err", "a", "b", "discreteUniform2", "discreteUniform1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "discreteUniform", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "binaryFactory", "dtypes", "defaults", "base", "DTYPES", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "discreteUniform", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isPositive", "isPositiveInteger", "format", "validate", "k", "lambda", "require_erlang", "__commonJSMin", "exports", "module", "ln", "erlang", "rand", "k", "lambda", "prod", "i", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "isPositiveInteger", "typedarray2json", "format", "validate", "erlang0", "factory", "lambda", "rand", "opts", "prng", "err", "k", "erlang2", "erlang1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "erlang", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "binaryFactory", "dtypes", "defaults", "base", "DTYPES", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "erlang", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_exponential", "__commonJSMin", "exports", "module", "ln", "exponential", "rand", "lambda", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isPositive", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "typedarray2json", "format", "exponential0", "factory", "lambda", "opts", "rand", "prng", "exponential2", "exponential1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "exponential", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "unaryFactory", "dtypes", "defaults", "base", "DTYPES", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "exponential", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isPositive", "format", "validate", "d1", "d2", "require_f", "__commonJSMin", "exports", "module", "f", "rchisq", "d1", "d2", "x1", "x2", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "chisquare", "isnan", "typedarray2json", "format", "validate", "f0", "factory", "rchisq", "opts", "rand", "prng", "err", "d1", "d2", "f2", "f1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "f", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "binaryFactory", "dtypes", "defaults", "base", "DTYPES", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "f", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "contains", "format", "validate", "opts", "dtypes", "options", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "isNonNegativeInteger", "isFunction", "isStringArray", "isCollection", "contains", "filledBy", "ternary", "ctors", "format", "validate", "Random", "prng", "dtypes", "dtype", "len", "param1", "param2", "param3", "options", "ctor", "opts", "out", "err", "dt", "wrapper", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadWriteAccessor", "setReadOnlyAccessor", "setReadOnly", "isStringArray", "isFunction", "isMethodIn", "hasOwnProp", "contains", "constantFunction", "noop", "TernaryRandom", "NullaryRandom", "format", "createFactory", "prng", "dtypes", "dtype", "isValidDataType", "factory", "Random", "random", "param1", "param2", "param3", "assign", "nargs", "base", "opts", "rand", "dt", "rand1", "rand2", "assign1", "assign2", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "len", "options", "out", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_validate", "__commonJSMin", "exports", "module", "isPositiveNumber", "isNumber", "isnan", "format", "validate", "alpha", "s", "m", "require_frechet", "__commonJSMin", "exports", "module", "pow", "ln", "frechet", "rand", "alpha", "s", "m", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "typedarray2json", "format", "validate", "frechet0", "factory", "alpha", "opts", "rand", "prng", "err", "s", "m", "frechet2", "frechet1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "frechet", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "ternaryFactory", "dtypes", "defaults", "base", "DTYPES", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "frechet", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "binaryFactory", "dtypes", "defaults", "base", "DTYPES", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "gamma", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_geometric", "__commonJSMin", "exports", "module", "floor", "ln", "geometric", "rand", "p", "u", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isProbability", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "typedarray2json", "format", "geometric0", "factory", "opts", "rand", "prng", "p", "geometric2", "geometric1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "geometric", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "unaryFactory", "dtypes", "defaults", "base", "DTYPES", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "geometric", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isNumber", "isPositive", "format", "isnan", "validate", "mu", "beta", "require_gumbel", "__commonJSMin", "exports", "module", "ln", "gumbel", "rand", "mu", "beta", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "typedarray2json", "format", "validate", "gumbel0", "factory", "beta", "opts", "rand", "prng", "err", "mu", "gumbel2", "gumbel1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "gumbel", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "binaryFactory", "dtypes", "defaults", "base", "DTYPES", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "gumbel", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isNonNegativeInteger", "format", "validate", "N", "K", "n", "require_hin", "__commonJSMin", "exports", "module", "factorial", "hin", "rand", "n1", "n2", "k", "p", "u", "x", "require_hypergeometric", "__commonJSMin", "exports", "module", "hin", "hypergeometric", "rand", "N", "K", "n", "n1", "n2", "k", "x", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isNonNegativeInteger", "PINF", "typedarray2json", "format", "validate", "hypergeometric0", "factory", "opts", "rand", "prng", "err", "N", "K", "n", "hypergeometric2", "hypergeometric1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "hypergeometric", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "ternaryFactory", "dtypes", "defaults", "base", "DTYPES", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "hypergeometric", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isPositive", "format", "validate", "alpha", "beta", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "gamma", "isnan", "typedarray2json", "format", "validate", "factory", "rgamma", "alpha", "beta", "opts", "rand", "prng", "err", "invgamma2", "invgamma1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "invgamma", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "binaryFactory", "dtypes", "defaults", "base", "DTYPES", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "invgamma", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isPositive", "format", "validate", "a", "b", "require_kumaraswamy", "__commonJSMin", "exports", "module", "pow", "sample", "rand", "a", "b", "u", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "typedarray2json", "format", "validate", "kumaraswamy0", "factory", "opts", "rand", "prng", "err", "a", "b", "kumaraswamy2", "kumaraswamy1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "kumaraswamy", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "binaryFactory", "dtypes", "defaults", "base", "DTYPES", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "kumaraswamy", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isNumber", "isPositive", "format", "isnan", "validate", "mu", "b", "require_laplace", "__commonJSMin", "exports", "module", "sign", "abs", "ln", "laplace", "rand", "mu", "b", "u", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "typedarray2json", "format", "validate", "laplace0", "factory", "opts", "rand", "prng", "err", "mu", "b", "laplace2", "laplace1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "laplace", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "binaryFactory", "dtypes", "defaults", "base", "DTYPES", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "laplace", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isNumber", "isPositive", "format", "isnan", "validate", "mu", "c", "require_levy", "__commonJSMin", "exports", "module", "normalQuantile", "levy", "rand", "mu", "c", "z", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "typedarray2json", "format", "validate", "levy0", "factory", "opts", "rand", "prng", "err", "mu", "c", "levy2", "levy1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "levy", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "binaryFactory", "dtypes", "defaults", "base", "DTYPES", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "levy", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isNumber", "isPositive", "isnan", "format", "validate", "mu", "s", "require_logistic", "__commonJSMin", "exports", "module", "ln", "logistic", "rand", "mu", "s", "u", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "typedarray2json", "format", "validate", "logistic0", "factory", "opts", "rand", "prng", "err", "mu", "s", "logistic2", "logistic1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "logistic", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "binaryFactory", "dtypes", "defaults", "base", "DTYPES", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "logistic", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isNumber", "isPositive", "format", "isnan", "validate", "mu", "sigma", "require_lognormal", "__commonJSMin", "exports", "module", "exp", "lognormal", "randn", "mu", "sigma", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randn", "isnan", "typedarray2json", "format", "validate", "lognormal0", "factory", "sigma", "rnorm", "opts", "rand", "prng", "err", "mu", "lognormal2", "lognormal1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "lognormal", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "binaryFactory", "dtypes", "defaults", "base", "DTYPES", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "lognormal", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_rand_int32", "__commonJSMin", "exports", "module", "INT32_MAX", "floor", "MAX", "randint32", "v", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "hasOwnProp", "isObject", "isBoolean", "isCollection", "isPositiveInteger", "isInt32Array", "format", "INT32_MAX", "Int32Array", "gcopy", "typedarray2json", "randint32", "NORMALIZATION_CONSTANT", "MAX_SEED", "A", "STATE_ARRAY_VERSION", "NUM_STATE_SECTIONS", "STATE_SECTION_OFFSET", "SEED_SECTION_OFFSET", "STATE_FIXED_LENGTH", "verifyState", "state", "FLG", "s1", "factory", "options", "STATE", "opts", "seed", "slen", "err", "minstd", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "normalized", "len", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "randint32", "minstd", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "fdtypes", "rdtypes", "isObject", "hasOwnProp", "format", "RDTYPES", "FDTYPES", "validate", "opts", "options", "mode", "require_factory", "__commonJSMin", "exports", "module", "isNonNegativeInteger", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "base", "ctors", "filledBy", "nullary", "format", "defaults", "validate", "factory", "options", "nargs", "opts", "rand", "prng", "err", "minstd", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "normalized", "len", "ctor", "out", "dt", "o", "s", "require_main", "__commonJSMin", "exports", "module", "factory", "minstd", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_create_table", "__commonJSMin", "exports", "module", "isnan", "NUM_WARMUPS", "createTable", "rand", "table", "N", "v", "i", "require_rand_int32", "__commonJSMin", "exports", "module", "INT32_MAX", "floor", "MAX", "randint32", "v", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "hasOwnProp", "isObject", "isBoolean", "isCollection", "isPositiveInteger", "isInt32Array", "gcopy", "floor", "Int32Array", "INT32_MAX", "typedarray2json", "format", "createTable", "randint32", "NORMALIZATION_CONSTANT", "MAX_SEED", "A", "TABLE_LENGTH", "STATE_ARRAY_VERSION", "NUM_STATE_SECTIONS", "TABLE_SECTION_OFFSET", "STATE_SECTION_OFFSET", "SEED_SECTION_OFFSET", "STATE_FIXED_LENGTH", "SHUFFLE_STATE", "PRNG_STATE", "verifyState", "state", "FLG", "s1", "factory", "options", "STATE", "opts", "seed", "slen", "err", "minstd", "minstdShuffle", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "normalized", "len", "s", "out", "i", "require_main", "__commonJSMin", "exports", "module", "factory", "randint32", "minstd", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "fdtypes", "rdtypes", "isObject", "hasOwnProp", "format", "RDTYPES", "FDTYPES", "validate", "opts", "options", "mode", "require_factory", "__commonJSMin", "exports", "module", "isNonNegativeInteger", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "base", "ctors", "filledBy", "nullary", "format", "defaults", "validate", "factory", "options", "nargs", "opts", "rand", "prng", "err", "minstd", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "normalized", "len", "ctor", "out", "dt", "o", "s", "require_main", "__commonJSMin", "exports", "module", "factory", "minstd", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "fdtypes", "rdtypes", "isObject", "hasOwnProp", "format", "RDTYPES", "FDTYPES", "validate", "opts", "options", "mode", "require_factory", "__commonJSMin", "exports", "module", "isNonNegativeInteger", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "base", "ctors", "filledBy", "nullary", "format", "defaults", "validate", "factory", "options", "nargs", "opts", "rand", "prng", "err", "mt19937", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "normalized", "len", "ctor", "out", "dt", "o", "s", "require_main", "__commonJSMin", "exports", "module", "factory", "mt19937", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_knuth", "__commonJSMin", "exports", "module", "exp", "poisson", "rand", "lambda", "p", "k", "require_rejection", "__commonJSMin", "exports", "module", "factorialln", "floor", "sign", "sqrt", "abs", "ln", "LN_SQRT_TWO_PI", "ONE_12", "ONE_360", "poisson", "rand", "lambda", "slambda", "ainv", "urvr", "us", "vr", "a", "b", "k", "u", "v", "require_poisson", "__commonJSMin", "exports", "module", "knuth", "rejection", "poisson", "rand", "lambda", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isPositive", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "typedarray2json", "format", "poisson0", "factory", "lambda", "opts", "rand", "prng", "poisson2", "poisson1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "poisson", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isPositive", "isNumber", "format", "isnan", "validate", "p", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "hasOwnProp", "isObject", "isUint32Array", "isBoolean", "isFunction", "constantFunction", "noop", "isnan", "poisson", "gamma", "gcopy", "Uint32Array", "assign", "typedarray2json", "format", "validate", "factory", "rgamma", "STATE", "rpois", "opts", "prng", "rand", "FLG", "err", "p", "r", "negativeBinomial2", "negativeBinomial1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "negativeBinomial", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "binaryFactory", "dtypes", "defaults", "base", "DTYPES", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "negativeBinomial", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isNumber", "isPositive", "format", "isnan", "validate", "mu", "sigma", "require_normal", "__commonJSMin", "exports", "module", "normal", "rand", "mu", "sigma", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randn", "isnan", "typedarray2json", "format", "validate", "normal0", "factory", "sigma", "rnorm", "opts", "rand", "prng", "err", "mu", "normal2", "normal1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "normal", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "binaryFactory", "dtypes", "defaults", "base", "DTYPES", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "normal", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isPositive", "format", "validate", "alpha", "beta", "require_pareto", "__commonJSMin", "exports", "module", "pow", "pareto", "rand", "alpha", "beta", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "typedarray2json", "format", "validate", "pareto0", "factory", "alpha", "beta", "opts", "rand", "prng", "err", "pareto2", "pareto1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "pareto1", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "binaryFactory", "dtypes", "defaults", "base", "DTYPES", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "pareto1", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "unaryFactory", "dtypes", "defaults", "base", "DTYPES", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "poisson", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_prngs", "__commonJSMin", "exports", "module", "minstd", "minstdShuffle", "mt19937", "prngs", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isBoolean", "hasOwnProp", "typedarray2json", "format", "defaults", "PRNGS", "factory", "options", "opts", "rand", "prng", "uniform", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "randu", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "dtypes", "isObject", "hasOwnProp", "format", "DTYPES", "validate", "opts", "options", "require_factory", "__commonJSMin", "exports", "module", "isNonNegativeInteger", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "base", "ctors", "filledBy", "nullary", "format", "defaults", "validate", "factory", "options", "nargs", "opts", "rand", "prng", "err", "randu", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "len", "ctor", "out", "dt", "o", "s", "require_main", "__commonJSMin", "exports", "module", "factory", "randu", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_rayleigh", "__commonJSMin", "exports", "module", "sqrt", "ln", "rayleigh", "rand", "sigma", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isPositive", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "typedarray2json", "format", "rayleigh0", "factory", "sigma", "opts", "rand", "prng", "rayleigh2", "rayleigh1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "rayleigh", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "unaryFactory", "dtypes", "defaults", "base", "DTYPES", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "rayleigh", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "hasOwnProp", "isPositive", "isObject", "isUint32Array", "isBoolean", "isnan", "isFunction", "constantFunction", "noop", "chisquare", "randn", "gcopy", "Uint32Array", "assign", "typedarray2json", "format", "sqrt", "factory", "rchisq", "STATE", "rnorm", "rand", "opts", "prng", "FLG", "v", "t2", "t1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "t", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "unaryFactory", "dtypes", "defaults", "base", "DTYPES", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "t", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isNumber", "format", "isnan", "validate", "a", "b", "c", "require_triangular", "__commonJSMin", "exports", "module", "sqrt", "triangular", "rand", "a", "b", "c", "fc", "x", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "typedarray2json", "format", "validate", "triangular0", "factory", "opts", "rand", "prng", "err", "a", "b", "c", "triangular2", "triangular1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "triangular", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "ternaryFactory", "dtypes", "defaults", "base", "DTYPES", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "triangular", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isNumber", "format", "isnan", "validate", "a", "b", "require_uniform", "__commonJSMin", "exports", "module", "uniform", "rand", "a", "b", "r", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "typedarray2json", "format", "validate", "uniform0", "factory", "opts", "rand", "prng", "err", "a", "b", "uniform2", "uniform1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "uniform", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "binaryFactory", "dtypes", "defaults", "base", "DTYPES", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "uniform", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isPositive", "format", "validate", "k", "lambda", "require_weibull", "__commonJSMin", "exports", "module", "pow", "ln", "weibull", "rand", "k", "lambda", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "typedarray2json", "format", "validate", "weibull0", "factory", "lambda", "opts", "rand", "prng", "err", "k", "weibull2", "weibull1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "weibull", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "binaryFactory", "dtypes", "defaults", "base", "DTYPES", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "weibull", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "ns", "require_randn", "__commonJSMin", "exports", "module", "sqrt", "ln", "sin", "cos", "TWO_PI", "wrap", "rand", "flg", "r", "randn", "u1", "u2", "a", "b", "require_min", "__commonJSMin", "exports", "module", "sqrt", "ln", "cos", "PI", "COS_PI", "getMin", "min", "a", "require_max", "__commonJSMin", "exports", "module", "sqrt", "ln", "cos", "TWO_PI", "getMax", "min", "a", "b", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "isBoolean", "hasOwnProp", "isUint32Array", "mt19937", "constantFunction", "noop", "typedarray2json", "format", "randn0", "getMin", "getMax", "factory", "options", "randu", "randn", "rand", "opts", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "randn", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_prngs", "__commonJSMin", "exports", "module", "minstd", "minstdShuffle", "mt19937", "prngs", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isBoolean", "hasOwnProp", "typedarray2json", "format", "defaults", "PRNGS", "factory", "options", "opts", "rand", "prng", "randi", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "randi", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_prngs", "__commonJSMin", "exports", "module", "boxMuller", "improvedZiggurat", "prngs", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isBoolean", "hasOwnProp", "constantFunction", "format", "noop", "typedarray2json", "defaults", "PRNGS", "factory", "options", "opts", "rand", "prng", "normal", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "normal", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_prngs", "__commonJSMin", "exports", "module", "prng0", "prng1", "prng2", "prng3", "prng4", "prng5", "prng6", "prng7", "prng8", "prng9", "prng10", "prng11", "prng12", "prng13", "prng14", "prng15", "prng16", "prng17", "prng18", "prng19", "prng20", "prng21", "prng22", "prng23", "prng24", "prng25", "prng26", "prng27", "prng28", "prng29", "prng30", "prng31", "prng32", "prng33", "prng34", "prng35", "prng36", "prng37", "prng38", "prng39", "prng40", "prngs", "require_main", "__commonJSMin", "exports", "module", "isString", "isObject", "isArray", "contains", "Int32Array", "Uint32Array", "table", "TYPED_ARRAY_CTORS", "PRNG_WRAPPERS", "reviveBasePRNG", "key", "value", "factory", "opts", "args", "ctor", "tmp", "error", "require_lib", "__commonJSMin", "exports", "module", "main", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "random", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isNumber", "isnan", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rarcsine", "iteratorSymbol", "format", "iterator", "a", "b", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isProbability", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rbern", "iteratorSymbol", "format", "iterator", "p", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isPositiveNumber", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rbeta", "iteratorSymbol", "format", "iterator", "alpha", "beta", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isPositiveNumber", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rbetaprime", "iteratorSymbol", "format", "iterator", "alpha", "beta", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isProbability", "isObject", "isPositiveInteger", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rbinom", "iteratorSymbol", "format", "iterator", "n", "p", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rnorm", "iteratorSymbol", "format", "iterator", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isNumber", "isnan", "isObject", "isNonNegativeInteger", "isPositive", "hasOwnProp", "MAX_VALUE", "rcauchy", "iteratorSymbol", "format", "iterator", "x0", "gamma", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isPositive", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rchi", "iteratorSymbol", "format", "iterator", "k", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isPositive", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rchisq", "iteratorSymbol", "format", "iterator", "k", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isNumber", "isnan", "isObject", "isNonNegativeInteger", "isPositive", "hasOwnProp", "MAX_VALUE", "rcosine", "iteratorSymbol", "format", "iterator", "mu", "s", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isInteger", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "runif", "iteratorSymbol", "format", "iterator", "a", "b", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isPositiveNumber", "isObject", "isNonNegativeInteger", "isPositiveInteger", "hasOwnProp", "MAX_VALUE", "rerlang", "iteratorSymbol", "format", "iterator", "k", "lambda", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isPositive", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rexp", "iteratorSymbol", "format", "iterator", "lambda", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isPositiveNumber", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rf", "iteratorSymbol", "format", "iterator", "d1", "d2", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isPositiveNumber", "isObject", "isNumber", "isnan", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rfrechet", "iteratorSymbol", "format", "iterator", "alpha", "s", "m", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isPositiveNumber", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rgamma", "iteratorSymbol", "format", "iterator", "alpha", "beta", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isProbability", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rgeom", "iteratorSymbol", "format", "iterator", "p", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isNumber", "isnan", "isObject", "isNonNegativeInteger", "isPositive", "hasOwnProp", "MAX_VALUE", "rgumbel", "iteratorSymbol", "format", "iterator", "mu", "beta", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rhypergeom", "iteratorSymbol", "format", "iterator", "N", "K", "n", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rnorm", "iteratorSymbol", "format", "iterator", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isPositiveNumber", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rinvgamma", "iteratorSymbol", "format", "iterator", "alpha", "beta", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isPositiveNumber", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rkumaraswamy", "iteratorSymbol", "format", "iterator", "a", "b", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isNumber", "isnan", "isObject", "isNonNegativeInteger", "isPositive", "hasOwnProp", "MAX_VALUE", "rlaplace", "iteratorSymbol", "format", "iterator", "mu", "b", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isNumber", "isnan", "isObject", "isNonNegativeInteger", "isPositive", "hasOwnProp", "MAX_VALUE", "rlevy", "iteratorSymbol", "format", "iterator", "mu", "c", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isNumber", "isnan", "isObject", "isNonNegativeInteger", "isPositive", "hasOwnProp", "MAX_VALUE", "rlogis", "iteratorSymbol", "format", "iterator", "mu", "s", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isNumber", "isnan", "isObject", "isNonNegativeInteger", "isPositive", "hasOwnProp", "MAX_VALUE", "rlognorm", "iteratorSymbol", "format", "iterator", "mu", "sigma", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "assign", "isObject", "isBoolean", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "minstd", "iteratorSymbol", "format", "iterator", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "assign", "isObject", "isBoolean", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "minstd", "iteratorSymbol", "format", "iterator", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "assign", "isObject", "isBoolean", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "mt19937", "iteratorSymbol", "format", "iterator", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isProbability", "isObject", "isPositiveNumber", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rnbinom", "iteratorSymbol", "format", "iterator", "p", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isNumber", "isnan", "isObject", "isNonNegativeInteger", "isPositive", "hasOwnProp", "MAX_VALUE", "rnorm", "iteratorSymbol", "format", "iterator", "mu", "sigma", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isPositiveNumber", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rpareto", "iteratorSymbol", "format", "iterator", "alpha", "beta", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isPositive", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rpois", "iteratorSymbol", "format", "iterator", "lambda", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "assign", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "randi", "iteratorSymbol", "format", "iterator", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "randn", "iteratorSymbol", "format", "iterator", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "assign", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "randu", "iteratorSymbol", "format", "iterator", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isPositive", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rrayleigh", "iteratorSymbol", "format", "iterator", "sigma", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isPositive", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rt", "iteratorSymbol", "format", "iterator", "v", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isNumber", "isnan", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rtriangular", "iteratorSymbol", "format", "iterator", "a", "b", "c", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isNumber", "isnan", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "runif", "iteratorSymbol", "format", "iterator", "a", "b", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isPositiveNumber", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rweibull", "iteratorSymbol", "format", "iterator", "k", "lambda", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "ns", "require_discrete_uniform", "__commonJSMin", "exports", "module", "floor", "discreteUniform", "x", "size", "rand", "pos", "out", "N", "i", "require_renormalizing", "__commonJSMin", "exports", "module", "renormalizing", "x", "size", "rand", "probabilities", "probs", "psum", "out", "N", "i", "j", "k", "u", "require_fisher_yates", "__commonJSMin", "exports", "module", "floor", "slice", "fisherYates", "x", "size", "rand", "tmp", "N", "i", "j", "require_vose", "__commonJSMin", "exports", "module", "floor", "vose", "x", "size", "rand", "probabilities", "small", "large", "probs", "alias", "out", "N", "p", "g", "i", "l", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isNonNegativeInteger", "isUnityProbabilityArray", "hasOwnProp", "isBoolean", "isObject", "format", "validate", "opts", "options", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "isArrayLike", "isTypedArrayLike", "isString", "format", "randu", "copy", "discreteUniform", "renormalizing", "fisherYates", "vose", "defaults", "validate", "slice", "factory", "config", "pool", "conf", "rand", "err", "fcn", "sample1", "sample2", "x", "options", "replace", "xcopy", "probs", "opts", "size", "mutate", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "sample", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "hasOwnProp", "isString", "isObject", "indexOf", "format", "COPY_OPTIONS", "validate", "opts", "options", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "isArrayLike", "isTypedArrayLike", "isString", "deepCopy", "floor", "randu", "format", "defaults", "validate", "factory", "config", "conf", "rand", "err", "shuffle", "arr", "options", "strflg", "level", "copy", "opts", "out", "tmp", "N", "i", "j", "require_main", "__commonJSMin", "exports", "module", "factory", "shuffle", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isNumber", "isnan", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rarcsine", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "a", "b", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "format", "assign", "RandomStream", "objectMode", "a", "b", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "a", "b", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isProbability", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rbern", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "p", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "format", "assign", "RandomStream", "objectMode", "p", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "isProbability", "format", "assign", "RandomStream", "factory", "p", "options", "nargs", "opts", "fcn", "createStream2", "createStream1", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rbeta", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "alpha", "beta", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "format", "assign", "RandomStream", "objectMode", "alpha", "beta", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "alpha", "beta", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rbetaprime", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "alpha", "beta", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "format", "assign", "RandomStream", "objectMode", "alpha", "beta", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "alpha", "beta", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isPlainObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveInteger", "isProbability", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rbinom", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "n", "p", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "objectMode", "n", "p", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "n", "p", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "randn", "string2buffer", "nextTick", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "options", "opts", "createStream", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isNumber", "isnan", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rcauchy", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "x0", "gamma", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "x0", "gamma", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "x0", "gamma", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rchi", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "k", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "k", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "isPositive", "assign", "format", "RandomStream", "factory", "k", "options", "nargs", "opts", "fcn", "createStream2", "createStream1", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rchisquare", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "k", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "k", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPositive", "isPlainObject", "assign", "format", "RandomStream", "factory", "k", "options", "nargs", "opts", "fcn", "createStream2", "createStream1", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isNumber", "isnan", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rcosine", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "mu", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "mu", "s", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "mu", "s", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isInteger", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rduniform", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "a", "b", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "a", "b", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "a", "b", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveInteger", "isPositiveNumber", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rerlang", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "k", "lambda", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "k", "lambda", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "k", "lambda", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rexponential", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "lambda", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "lambda", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPositive", "isPlainObject", "assign", "format", "RandomStream", "factory", "lambda", "options", "nargs", "opts", "fcn", "createStream2", "createStream1", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rf", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "d1", "d2", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "d1", "d2", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "d1", "d2", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isNumber", "isnan", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rfrechet", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "alpha", "m", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "alpha", "s", "m", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "alpha", "s", "m", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rgamma", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "alpha", "beta", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "alpha", "beta", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "alpha", "beta", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isProbability", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rgeom", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "p", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "p", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isProbability", "isPlainObject", "assign", "format", "RandomStream", "factory", "p", "options", "nargs", "opts", "fcn", "createStream2", "createStream1", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isNumber", "isnan", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rgumbel", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "mu", "beta", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "mu", "beta", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "mu", "beta", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isNonNegativeInteger", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rhypergeom", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "N", "K", "n", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "N", "K", "n", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "N", "K", "n", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "randn", "string2buffer", "nextTick", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "options", "opts", "createStream", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rinvgamma", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "alpha", "beta", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "alpha", "beta", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "alpha", "beta", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rkumaraswamy", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "a", "b", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "a", "b", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "a", "b", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isNumber", "isnan", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rlaplace", "string2buffer", "format", "nextTick", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "mu", "b", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "mu", "b", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "mu", "b", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isNumber", "isnan", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rlevy", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "mu", "c", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "mu", "c", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "mu", "c", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isNumber", "isnan", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rlogistic", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "mu", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "mu", "s", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "mu", "s", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isNumber", "isnan", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rlognormal", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "mu", "sigma", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "mu", "sigma", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "mu", "sigma", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "minstd", "string2buffer", "nextTick", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "options", "prng", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "options", "opts", "createStream", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "minstd", "string2buffer", "nextTick", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "options", "prng", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "options", "opts", "createStream", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "mt19937", "string2buffer", "nextTick", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "options", "prng", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "options", "opts", "createStream", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isPlainObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isProbability", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rnbinom", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "p", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "objectMode", "p", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "p", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "r", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isNumber", "isnan", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rnorm", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "mu", "sigma", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "mu", "sigma", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "mu", "sigma", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isPlainObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rpareto1", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "alpha", "beta", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "objectMode", "alpha", "beta", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "alpha", "beta", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rpoisson", "string2buffer", "format", "nextTick", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "lambda", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "lambda", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPositive", "isPlainObject", "assign", "format", "RandomStream", "factory", "lambda", "options", "nargs", "opts", "fcn", "createStream2", "createStream1", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "randi", "string2buffer", "nextTick", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "options", "opts", "createStream", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "randn", "string2buffer", "nextTick", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "options", "opts", "createStream", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "randu", "string2buffer", "nextTick", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "options", "opts", "createStream", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rrayleigh", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "sigma", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "sigma", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPositive", "isPlainObject", "assign", "format", "RandomStream", "factory", "sigma", "options", "nargs", "opts", "fcn", "createStream2", "createStream1", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rt", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "v", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "v", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPositive", "isPlainObject", "assign", "format", "RandomStream", "factory", "v", "options", "nargs", "opts", "fcn", "createStream2", "createStream1", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isNumber", "isnan", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rtriang", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "a", "b", "c", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "a", "b", "c", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "a", "b", "c", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isNumber", "isnan", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "runiform", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "a", "b", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "a", "b", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "a", "b", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rweibull", "string2buffer", "format", "nextTick", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "k", "lambda", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "k", "lambda", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "k", "lambda", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "ns", "require_prng", "__commonJSMin", "exports", "module", "isAccessorArray", "random", "clbk", "x", "sx", "ox", "y", "sy", "oy", "hasOptions", "options", "out", "v1", "v2", "require_main", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "arcsine", "N", "a", "sa", "b", "sb", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "arcsine", "N", "a", "sa", "oa", "b", "sb", "ob", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_main", "__commonJSMin", "exports", "module", "setReadWriteAccessor", "setReadOnlyAccessor", "setReadOnly", "isFunction", "isMethodIn", "isPlainObject", "constantFunction", "noop", "unary", "format", "createFactory", "prng", "factory", "base", "opts", "rand", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "ndarray", "N", "param1", "sp1", "out", "so", "op1", "oo", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_factory", "__commonJSMin", "exports", "module", "unaryFactory", "base", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "bernoulli", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_prng", "__commonJSMin", "exports", "module", "isAccessorArray", "random", "clbk", "x", "sx", "ox", "y", "sy", "oy", "hasOptions", "options", "out", "v1", "v2", "require_main", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "beta", "N", "alpha", "sa", "sb", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "beta", "N", "alpha", "sa", "oa", "sb", "ob", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_prng", "__commonJSMin", "exports", "module", "isAccessorArray", "random", "clbk", "x", "sx", "ox", "y", "sy", "oy", "hasOptions", "options", "out", "v1", "v2", "require_main", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "betaprime", "N", "alpha", "sa", "beta", "sb", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "betaprime", "N", "alpha", "sa", "oa", "beta", "sb", "ob", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_factory", "__commonJSMin", "exports", "module", "unaryFactory", "base", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "chi", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "unaryFactory", "base", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "chisquare", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_prng", "__commonJSMin", "exports", "module", "isAccessorArray", "random", "clbk", "x", "sx", "ox", "y", "sy", "oy", "hasOptions", "options", "out", "v1", "v2", "require_main", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "cosine", "N", "mu", "sm", "s", "ss", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "cosine", "N", "mu", "sm", "om", "s", "ss", "os", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_prng", "__commonJSMin", "exports", "module", "isAccessorArray", "random", "clbk", "x", "sx", "ox", "y", "sy", "oy", "hasOptions", "options", "out", "v1", "v2", "require_main", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "discreteUniform", "N", "a", "sa", "b", "sb", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "discreteUniform", "N", "a", "sa", "oa", "b", "sb", "ob", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_factory", "__commonJSMin", "exports", "module", "unaryFactory", "base", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "exponential", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_prng", "__commonJSMin", "exports", "module", "isAccessorArray", "random", "clbk", "x", "sx", "ox", "y", "sy", "oy", "hasOptions", "options", "out", "v1", "v2", "require_main", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "gamma", "N", "alpha", "sa", "beta", "sb", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "gamma", "N", "alpha", "sa", "oa", "beta", "sb", "ob", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_factory", "__commonJSMin", "exports", "module", "unaryFactory", "base", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "geometric", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_prng", "__commonJSMin", "exports", "module", "isAccessorArray", "random", "clbk", "x", "sx", "ox", "y", "sy", "oy", "hasOptions", "options", "out", "v1", "v2", "require_main", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "invgamma", "N", "alpha", "sa", "beta", "sb", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "invgamma", "N", "alpha", "sa", "oa", "beta", "sb", "ob", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_prng", "__commonJSMin", "exports", "module", "isAccessorArray", "random", "clbk", "x", "sx", "ox", "y", "sy", "oy", "hasOptions", "options", "out", "v1", "v2", "require_main", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "lognormal", "N", "mu", "sm", "sigma", "ss", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "lognormal", "N", "mu", "sm", "om", "sigma", "ss", "os", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_main", "__commonJSMin", "exports", "module", "nullary", "random", "minstd", "N", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "random", "minstd", "N", "out", "so", "oo", "options", "rand", "require_normalized", "__commonJSMin", "exports", "module", "nullary", "random", "minstd", "N", "out", "so", "options", "rand", "require_normalized_ndarray", "__commonJSMin", "exports", "module", "nullary", "random", "minstd", "N", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "normalized", "ndarrayNormalized", "require_main", "__commonJSMin", "exports", "module", "nullary", "random", "minstd", "N", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "random", "minstd", "N", "out", "so", "oo", "options", "rand", "require_normalized", "__commonJSMin", "exports", "module", "nullary", "random", "minstd", "N", "out", "so", "options", "rand", "require_normalized_ndarray", "__commonJSMin", "exports", "module", "nullary", "random", "minstd", "N", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "normalized", "ndarrayNormalized", "require_main", "__commonJSMin", "exports", "module", "nullary", "random", "mt19937", "N", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "random", "mt19937", "N", "out", "so", "oo", "options", "rand", "require_normalized", "__commonJSMin", "exports", "module", "nullary", "random", "mt19937", "N", "out", "so", "options", "rand", "require_normalized_ndarray", "__commonJSMin", "exports", "module", "nullary", "random", "mt19937", "N", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "normalized", "ndarrayNormalized", "require_prng", "__commonJSMin", "exports", "module", "isAccessorArray", "random", "clbk", "x", "sx", "ox", "y", "sy", "oy", "hasOptions", "options", "out", "v1", "v2", "require_main", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "normal", "N", "mu", "sm", "sigma", "ss", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "normal", "N", "mu", "sm", "om", "sigma", "ss", "os", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_main", "__commonJSMin", "exports", "module", "nullary", "random", "randu", "N", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "random", "randu", "N", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_prng", "__commonJSMin", "exports", "module", "isAccessorArray", "random", "clbk", "x", "sx", "ox", "y", "sy", "oy", "hasOptions", "options", "out", "v1", "v2", "require_main", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "uniform", "N", "a", "sa", "b", "sb", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "uniform", "N", "a", "sa", "oa", "b", "sb", "ob", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_prng", "__commonJSMin", "exports", "module", "isAccessorArray", "random", "clbk", "x", "sx", "ox", "y", "sy", "oy", "hasOptions", "options", "out", "v1", "v2", "require_main", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "weibull", "N", "k", "sk", "lambda", "sl", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "weibull", "N", "k", "sk", "ok", "lambda", "sl", "ol", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "ns", "setReadOnly", "ns"] + "sources": ["../array/tools/binary/lib/validate.js", "../array/tools/binary/lib/main.js", "../array/tools/binary/lib/index.js", "../array/tools/nullary/lib/validate.js", "../array/tools/nullary/lib/main.js", "../array/tools/nullary/lib/index.js", "../array/tools/binary-factory/lib/main.js", "../array/tools/binary-factory/lib/index.js", "../base/mt19937/lib/rand_uint32.js", "../base/mt19937/lib/factory.js", "../base/mt19937/lib/main.js", "../base/mt19937/lib/index.js", "../base/arcsine/lib/validate.js", "../base/arcsine/lib/arcsine.js", "../base/arcsine/lib/factory.js", "../base/arcsine/lib/main.js", "../base/arcsine/lib/index.js", "../array/arcsine/lib/factory.js", "../array/arcsine/lib/main.js", "../array/arcsine/lib/index.js", "../array/tools/unary/lib/validate.js", "../array/tools/unary/lib/main.js", "../array/tools/unary/lib/index.js", "../array/tools/unary-factory/lib/main.js", "../array/tools/unary-factory/lib/index.js", "../base/bernoulli/lib/factory.js", "../base/bernoulli/lib/main.js", "../base/bernoulli/lib/index.js", "../array/bernoulli/lib/factory.js", "../array/bernoulli/lib/main.js", "../array/bernoulli/lib/index.js", "../base/improved-ziggurat/lib/coords_array.js", "../base/improved-ziggurat/lib/ratio_array.js", "../base/improved-ziggurat/lib/sample_tail.js", "../base/improved-ziggurat/lib/improved_ziggurat.js", "../base/improved-ziggurat/lib/factory.js", "../base/improved-ziggurat/lib/main.js", "../base/improved-ziggurat/lib/index.js", "../base/beta/lib/validate.js", "../base/beta/lib/standard_gamma.js", "../base/beta/lib/sample1.js", "../base/beta/lib/sample2.js", "../base/beta/lib/sample3.js", "../base/beta/lib/beta.js", "../base/beta/lib/factory.js", "../base/beta/lib/main.js", "../base/beta/lib/index.js", "../array/beta/lib/factory.js", "../array/beta/lib/main.js", "../array/beta/lib/index.js", "../base/gamma/lib/validate.js", "../base/gamma/lib/gamma.js", "../base/gamma/lib/factory.js", "../base/gamma/lib/main.js", "../base/gamma/lib/index.js", "../base/betaprime/lib/validate.js", "../base/betaprime/lib/betaprime.js", "../base/betaprime/lib/factory.js", "../base/betaprime/lib/main.js", "../base/betaprime/lib/index.js", "../array/betaprime/lib/factory.js", "../array/betaprime/lib/main.js", "../array/betaprime/lib/index.js", "../base/binomial/lib/validate.js", "../base/binomial/lib/sample1.js", "../base/binomial/lib/correction.js", "../base/binomial/lib/sample2.js", "../base/binomial/lib/binomial.js", "../base/binomial/lib/factory.js", "../base/binomial/lib/main.js", "../base/binomial/lib/index.js", "../array/binomial/lib/factory.js", "../array/binomial/lib/main.js", "../array/binomial/lib/index.js", "../base/cauchy/lib/validate.js", "../base/cauchy/lib/cauchy.js", "../base/cauchy/lib/factory.js", "../base/cauchy/lib/main.js", "../base/cauchy/lib/index.js", "../array/cauchy/lib/factory.js", "../array/cauchy/lib/main.js", "../array/cauchy/lib/index.js", "../base/chisquare/lib/factory.js", "../base/chisquare/lib/main.js", "../base/chisquare/lib/index.js", "../base/chi/lib/factory.js", "../base/chi/lib/main.js", "../base/chi/lib/index.js", "../array/chi/lib/factory.js", "../array/chi/lib/main.js", "../array/chi/lib/index.js", "../array/chisquare/lib/factory.js", "../array/chisquare/lib/main.js", "../array/chisquare/lib/index.js", "../base/cosine/lib/validate.js", "../base/cosine/lib/cosine.js", "../base/cosine/lib/factory.js", "../base/cosine/lib/main.js", "../base/cosine/lib/index.js", "../array/cosine/lib/factory.js", "../array/cosine/lib/main.js", "../array/cosine/lib/index.js", "../base/discrete-uniform/lib/validate.js", "../base/discrete-uniform/lib/discrete_uniform.js", "../base/discrete-uniform/lib/factory.js", "../base/discrete-uniform/lib/main.js", "../base/discrete-uniform/lib/index.js", "../array/discrete-uniform/lib/factory.js", "../array/discrete-uniform/lib/main.js", "../array/discrete-uniform/lib/index.js", "../base/erlang/lib/validate.js", "../base/erlang/lib/erlang.js", "../base/erlang/lib/factory.js", "../base/erlang/lib/main.js", "../base/erlang/lib/index.js", "../array/erlang/lib/factory.js", "../array/erlang/lib/main.js", "../array/erlang/lib/index.js", "../base/exponential/lib/exponential.js", "../base/exponential/lib/factory.js", "../base/exponential/lib/main.js", "../base/exponential/lib/index.js", "../array/exponential/lib/factory.js", "../array/exponential/lib/main.js", "../array/exponential/lib/index.js", "../base/f/lib/validate.js", "../base/f/lib/f.js", "../base/f/lib/factory.js", "../base/f/lib/main.js", "../base/f/lib/index.js", "../array/f/lib/factory.js", "../array/f/lib/main.js", "../array/f/lib/index.js", "../array/tools/ternary/lib/validate.js", "../array/tools/ternary/lib/main.js", "../array/tools/ternary/lib/index.js", "../array/tools/ternary-factory/lib/main.js", "../array/tools/ternary-factory/lib/index.js", "../base/frechet/lib/validate.js", "../base/frechet/lib/frechet.js", "../base/frechet/lib/factory.js", "../base/frechet/lib/main.js", "../base/frechet/lib/index.js", "../array/frechet/lib/factory.js", "../array/frechet/lib/main.js", "../array/frechet/lib/index.js", "../array/gamma/lib/factory.js", "../array/gamma/lib/main.js", "../array/gamma/lib/index.js", "../base/geometric/lib/geometric.js", "../base/geometric/lib/factory.js", "../base/geometric/lib/main.js", "../base/geometric/lib/index.js", "../array/geometric/lib/factory.js", "../array/geometric/lib/main.js", "../array/geometric/lib/index.js", "../base/gumbel/lib/validate.js", "../base/gumbel/lib/gumbel.js", "../base/gumbel/lib/factory.js", "../base/gumbel/lib/main.js", "../base/gumbel/lib/index.js", "../array/gumbel/lib/factory.js", "../array/gumbel/lib/main.js", "../array/gumbel/lib/index.js", "../base/hypergeometric/lib/validate.js", "../base/hypergeometric/lib/hin.js", "../base/hypergeometric/lib/hypergeometric.js", "../base/hypergeometric/lib/factory.js", "../base/hypergeometric/lib/main.js", "../base/hypergeometric/lib/index.js", "../array/hypergeometric/lib/factory.js", "../array/hypergeometric/lib/main.js", "../array/hypergeometric/lib/index.js", "../base/invgamma/lib/validate.js", "../base/invgamma/lib/factory.js", "../base/invgamma/lib/main.js", "../base/invgamma/lib/index.js", "../array/invgamma/lib/factory.js", "../array/invgamma/lib/main.js", "../array/invgamma/lib/index.js", "../base/kumaraswamy/lib/validate.js", "../base/kumaraswamy/lib/kumaraswamy.js", "../base/kumaraswamy/lib/factory.js", "../base/kumaraswamy/lib/main.js", "../base/kumaraswamy/lib/index.js", "../array/kumaraswamy/lib/factory.js", "../array/kumaraswamy/lib/main.js", "../array/kumaraswamy/lib/index.js", "../base/laplace/lib/validate.js", "../base/laplace/lib/laplace.js", "../base/laplace/lib/factory.js", "../base/laplace/lib/main.js", "../base/laplace/lib/index.js", "../array/laplace/lib/factory.js", "../array/laplace/lib/main.js", "../array/laplace/lib/index.js", "../base/levy/lib/validate.js", "../base/levy/lib/levy.js", "../base/levy/lib/factory.js", "../base/levy/lib/main.js", "../base/levy/lib/index.js", "../array/levy/lib/factory.js", "../array/levy/lib/main.js", "../array/levy/lib/index.js", "../base/logistic/lib/validate.js", "../base/logistic/lib/logistic.js", "../base/logistic/lib/factory.js", "../base/logistic/lib/main.js", "../base/logistic/lib/index.js", "../array/logistic/lib/factory.js", "../array/logistic/lib/main.js", "../array/logistic/lib/index.js", "../base/lognormal/lib/validate.js", "../base/lognormal/lib/lognormal.js", "../base/lognormal/lib/factory.js", "../base/lognormal/lib/main.js", "../base/lognormal/lib/index.js", "../array/lognormal/lib/factory.js", "../array/lognormal/lib/main.js", "../array/lognormal/lib/index.js", "../base/minstd/lib/rand_int32.js", "../base/minstd/lib/factory.js", "../base/minstd/lib/main.js", "../base/minstd/lib/index.js", "../array/minstd/lib/defaults.json", "../array/minstd/lib/validate.js", "../array/minstd/lib/factory.js", "../array/minstd/lib/main.js", "../array/minstd/lib/index.js", "../base/minstd-shuffle/lib/create_table.js", "../base/minstd-shuffle/lib/rand_int32.js", "../base/minstd-shuffle/lib/factory.js", "../base/minstd-shuffle/lib/main.js", "../base/minstd-shuffle/lib/index.js", "../array/minstd-shuffle/lib/defaults.json", "../array/minstd-shuffle/lib/validate.js", "../array/minstd-shuffle/lib/factory.js", "../array/minstd-shuffle/lib/main.js", "../array/minstd-shuffle/lib/index.js", "../array/mt19937/lib/defaults.json", "../array/mt19937/lib/validate.js", "../array/mt19937/lib/factory.js", "../array/mt19937/lib/main.js", "../array/mt19937/lib/index.js", "../base/poisson/lib/knuth.js", "../base/poisson/lib/rejection.js", "../base/poisson/lib/poisson.js", "../base/poisson/lib/factory.js", "../base/poisson/lib/main.js", "../base/poisson/lib/index.js", "../base/negative-binomial/lib/validate.js", "../base/negative-binomial/lib/factory.js", "../base/negative-binomial/lib/main.js", "../base/negative-binomial/lib/index.js", "../array/negative-binomial/lib/factory.js", "../array/negative-binomial/lib/main.js", "../array/negative-binomial/lib/index.js", "../base/normal/lib/validate.js", "../base/normal/lib/normal.js", "../base/normal/lib/factory.js", "../base/normal/lib/main.js", "../base/normal/lib/index.js", "../array/normal/lib/factory.js", "../array/normal/lib/main.js", "../array/normal/lib/index.js", "../base/pareto-type1/lib/validate.js", "../base/pareto-type1/lib/pareto.js", "../base/pareto-type1/lib/factory.js", "../base/pareto-type1/lib/main.js", "../base/pareto-type1/lib/index.js", "../array/pareto-type1/lib/factory.js", "../array/pareto-type1/lib/main.js", "../array/pareto-type1/lib/index.js", "../array/poisson/lib/factory.js", "../array/poisson/lib/main.js", "../array/poisson/lib/index.js", "../base/randu/lib/defaults.json", "../base/randu/lib/prngs.js", "../base/randu/lib/factory.js", "../base/randu/lib/main.js", "../base/randu/lib/index.js", "../array/randu/lib/defaults.json", "../array/randu/lib/validate.js", "../array/randu/lib/factory.js", "../array/randu/lib/main.js", "../array/randu/lib/index.js", "../base/rayleigh/lib/rayleigh.js", "../base/rayleigh/lib/factory.js", "../base/rayleigh/lib/main.js", "../base/rayleigh/lib/index.js", "../array/rayleigh/lib/factory.js", "../array/rayleigh/lib/main.js", "../array/rayleigh/lib/index.js", "../base/t/lib/factory.js", "../base/t/lib/main.js", "../base/t/lib/index.js", "../array/t/lib/factory.js", "../array/t/lib/main.js", "../array/t/lib/index.js", "../base/triangular/lib/validate.js", "../base/triangular/lib/triangular.js", "../base/triangular/lib/factory.js", "../base/triangular/lib/main.js", "../base/triangular/lib/index.js", "../array/triangular/lib/factory.js", "../array/triangular/lib/main.js", "../array/triangular/lib/index.js", "../base/uniform/lib/validate.js", "../base/uniform/lib/uniform.js", "../base/uniform/lib/factory.js", "../base/uniform/lib/main.js", "../base/uniform/lib/index.js", "../array/uniform/lib/factory.js", "../array/uniform/lib/main.js", "../array/uniform/lib/index.js", "../base/weibull/lib/validate.js", "../base/weibull/lib/weibull.js", "../base/weibull/lib/factory.js", "../base/weibull/lib/main.js", "../base/weibull/lib/index.js", "../array/weibull/lib/factory.js", "../array/weibull/lib/main.js", "../array/weibull/lib/index.js", "../array/lib/index.js", "../base/box-muller/lib/randn.js", "../base/box-muller/lib/min.js", "../base/box-muller/lib/max.js", "../base/box-muller/lib/factory.js", "../base/box-muller/lib/main.js", "../base/box-muller/lib/index.js", "../base/randi/lib/defaults.json", "../base/randi/lib/prngs.js", "../base/randi/lib/factory.js", "../base/randi/lib/main.js", "../base/randi/lib/index.js", "../base/randn/lib/defaults.json", "../base/randn/lib/prngs.js", "../base/randn/lib/factory.js", "../base/randn/lib/main.js", "../base/randn/lib/index.js", "../base/reviver/lib/prngs.js", "../base/reviver/lib/main.js", "../base/reviver/lib/index.js", "../base/lib/index.js", "../iter/arcsine/lib/main.js", "../iter/arcsine/lib/index.js", "../iter/bernoulli/lib/main.js", "../iter/bernoulli/lib/index.js", "../iter/beta/lib/main.js", "../iter/beta/lib/index.js", "../iter/betaprime/lib/main.js", "../iter/betaprime/lib/index.js", "../iter/binomial/lib/main.js", "../iter/binomial/lib/index.js", "../iter/box-muller/lib/main.js", "../iter/box-muller/lib/index.js", "../iter/cauchy/lib/main.js", "../iter/cauchy/lib/index.js", "../iter/chi/lib/main.js", "../iter/chi/lib/index.js", "../iter/chisquare/lib/main.js", "../iter/chisquare/lib/index.js", "../iter/cosine/lib/main.js", "../iter/cosine/lib/index.js", "../iter/discrete-uniform/lib/main.js", "../iter/discrete-uniform/lib/index.js", "../iter/erlang/lib/main.js", "../iter/erlang/lib/index.js", "../iter/exponential/lib/main.js", "../iter/exponential/lib/index.js", "../iter/f/lib/main.js", "../iter/f/lib/index.js", "../iter/frechet/lib/main.js", "../iter/frechet/lib/index.js", "../iter/gamma/lib/main.js", "../iter/gamma/lib/index.js", "../iter/geometric/lib/main.js", "../iter/geometric/lib/index.js", "../iter/gumbel/lib/main.js", "../iter/gumbel/lib/index.js", "../iter/hypergeometric/lib/main.js", "../iter/hypergeometric/lib/index.js", "../iter/improved-ziggurat/lib/main.js", "../iter/improved-ziggurat/lib/index.js", "../iter/invgamma/lib/main.js", "../iter/invgamma/lib/index.js", "../iter/kumaraswamy/lib/main.js", "../iter/kumaraswamy/lib/index.js", "../iter/laplace/lib/main.js", "../iter/laplace/lib/index.js", "../iter/levy/lib/main.js", "../iter/levy/lib/index.js", "../iter/logistic/lib/main.js", "../iter/logistic/lib/index.js", "../iter/lognormal/lib/main.js", "../iter/lognormal/lib/index.js", "../iter/minstd/lib/main.js", "../iter/minstd/lib/index.js", "../iter/minstd-shuffle/lib/main.js", "../iter/minstd-shuffle/lib/index.js", "../iter/mt19937/lib/main.js", "../iter/mt19937/lib/index.js", "../iter/negative-binomial/lib/main.js", "../iter/negative-binomial/lib/index.js", "../iter/normal/lib/main.js", "../iter/normal/lib/index.js", "../iter/pareto-type1/lib/main.js", "../iter/pareto-type1/lib/index.js", "../iter/poisson/lib/main.js", "../iter/poisson/lib/index.js", "../iter/randi/lib/main.js", "../iter/randi/lib/index.js", "../iter/randn/lib/main.js", "../iter/randn/lib/index.js", "../iter/randu/lib/main.js", "../iter/randu/lib/index.js", "../iter/rayleigh/lib/main.js", "../iter/rayleigh/lib/index.js", "../iter/t/lib/main.js", "../iter/t/lib/index.js", "../iter/triangular/lib/main.js", "../iter/triangular/lib/index.js", "../iter/uniform/lib/main.js", "../iter/uniform/lib/index.js", "../iter/weibull/lib/main.js", "../iter/weibull/lib/index.js", "../iter/lib/index.js", "../sample/lib/discrete_uniform.js", "../sample/lib/renormalizing.js", "../sample/lib/fisher_yates.js", "../sample/lib/vose.js", "../sample/lib/defaults.json", "../sample/lib/validate.js", "../sample/lib/factory.js", "../sample/lib/main.js", "../sample/lib/index.js", "../shuffle/lib/defaults.json", "../shuffle/lib/validate.js", "../shuffle/lib/factory.js", "../shuffle/lib/main.js", "../shuffle/lib/index.js", "../streams/arcsine/lib/defaults.json", "../streams/arcsine/lib/validate.js", "../streams/arcsine/lib/debug.js", "../streams/arcsine/lib/main.js", "../streams/arcsine/lib/object_mode.js", "../streams/arcsine/lib/factory.js", "../streams/arcsine/lib/index.js", "../streams/bernoulli/lib/defaults.json", "../streams/bernoulli/lib/validate.js", "../streams/bernoulli/lib/debug.js", "../streams/bernoulli/lib/main.js", "../streams/bernoulli/lib/object_mode.js", "../streams/bernoulli/lib/factory.js", "../streams/bernoulli/lib/index.js", "../streams/beta/lib/defaults.json", "../streams/beta/lib/validate.js", "../streams/beta/lib/debug.js", "../streams/beta/lib/main.js", "../streams/beta/lib/object_mode.js", "../streams/beta/lib/factory.js", "../streams/beta/lib/index.js", "../streams/betaprime/lib/defaults.json", "../streams/betaprime/lib/validate.js", "../streams/betaprime/lib/debug.js", "../streams/betaprime/lib/main.js", "../streams/betaprime/lib/object_mode.js", "../streams/betaprime/lib/factory.js", "../streams/betaprime/lib/index.js", "../streams/binomial/lib/defaults.json", "../streams/binomial/lib/validate.js", "../streams/binomial/lib/debug.js", "../streams/binomial/lib/main.js", "../streams/binomial/lib/object_mode.js", "../streams/binomial/lib/factory.js", "../streams/binomial/lib/index.js", "../streams/box-muller/lib/defaults.json", "../streams/box-muller/lib/validate.js", "../streams/box-muller/lib/debug.js", "../streams/box-muller/lib/main.js", "../streams/box-muller/lib/object_mode.js", "../streams/box-muller/lib/factory.js", "../streams/box-muller/lib/index.js", "../streams/cauchy/lib/defaults.json", "../streams/cauchy/lib/validate.js", "../streams/cauchy/lib/debug.js", "../streams/cauchy/lib/main.js", "../streams/cauchy/lib/object_mode.js", "../streams/cauchy/lib/factory.js", "../streams/cauchy/lib/index.js", "../streams/chi/lib/defaults.json", "../streams/chi/lib/validate.js", "../streams/chi/lib/debug.js", "../streams/chi/lib/main.js", "../streams/chi/lib/object_mode.js", "../streams/chi/lib/factory.js", "../streams/chi/lib/index.js", "../streams/chisquare/lib/defaults.json", "../streams/chisquare/lib/validate.js", "../streams/chisquare/lib/debug.js", "../streams/chisquare/lib/main.js", "../streams/chisquare/lib/object_mode.js", "../streams/chisquare/lib/factory.js", "../streams/chisquare/lib/index.js", "../streams/cosine/lib/defaults.json", "../streams/cosine/lib/validate.js", "../streams/cosine/lib/debug.js", "../streams/cosine/lib/main.js", "../streams/cosine/lib/object_mode.js", "../streams/cosine/lib/factory.js", "../streams/cosine/lib/index.js", "../streams/discrete-uniform/lib/defaults.json", "../streams/discrete-uniform/lib/validate.js", "../streams/discrete-uniform/lib/debug.js", "../streams/discrete-uniform/lib/main.js", "../streams/discrete-uniform/lib/object_mode.js", "../streams/discrete-uniform/lib/factory.js", "../streams/discrete-uniform/lib/index.js", "../streams/erlang/lib/defaults.json", "../streams/erlang/lib/validate.js", "../streams/erlang/lib/debug.js", "../streams/erlang/lib/main.js", "../streams/erlang/lib/object_mode.js", "../streams/erlang/lib/factory.js", "../streams/erlang/lib/index.js", "../streams/exponential/lib/defaults.json", "../streams/exponential/lib/validate.js", "../streams/exponential/lib/debug.js", "../streams/exponential/lib/main.js", "../streams/exponential/lib/object_mode.js", "../streams/exponential/lib/factory.js", "../streams/exponential/lib/index.js", "../streams/f/lib/defaults.json", "../streams/f/lib/validate.js", "../streams/f/lib/debug.js", "../streams/f/lib/main.js", "../streams/f/lib/object_mode.js", "../streams/f/lib/factory.js", "../streams/f/lib/index.js", "../streams/frechet/lib/defaults.json", "../streams/frechet/lib/validate.js", "../streams/frechet/lib/debug.js", "../streams/frechet/lib/main.js", "../streams/frechet/lib/object_mode.js", "../streams/frechet/lib/factory.js", "../streams/frechet/lib/index.js", "../streams/gamma/lib/defaults.json", "../streams/gamma/lib/validate.js", "../streams/gamma/lib/debug.js", "../streams/gamma/lib/main.js", "../streams/gamma/lib/object_mode.js", "../streams/gamma/lib/factory.js", "../streams/gamma/lib/index.js", "../streams/geometric/lib/defaults.json", "../streams/geometric/lib/validate.js", "../streams/geometric/lib/debug.js", "../streams/geometric/lib/main.js", "../streams/geometric/lib/object_mode.js", "../streams/geometric/lib/factory.js", "../streams/geometric/lib/index.js", "../streams/gumbel/lib/defaults.json", "../streams/gumbel/lib/validate.js", "../streams/gumbel/lib/debug.js", "../streams/gumbel/lib/main.js", "../streams/gumbel/lib/object_mode.js", "../streams/gumbel/lib/factory.js", "../streams/gumbel/lib/index.js", "../streams/hypergeometric/lib/defaults.json", "../streams/hypergeometric/lib/validate.js", "../streams/hypergeometric/lib/debug.js", "../streams/hypergeometric/lib/main.js", "../streams/hypergeometric/lib/object_mode.js", "../streams/hypergeometric/lib/factory.js", "../streams/hypergeometric/lib/index.js", "../streams/improved-ziggurat/lib/defaults.json", "../streams/improved-ziggurat/lib/validate.js", "../streams/improved-ziggurat/lib/debug.js", "../streams/improved-ziggurat/lib/main.js", "../streams/improved-ziggurat/lib/object_mode.js", "../streams/improved-ziggurat/lib/factory.js", "../streams/improved-ziggurat/lib/index.js", "../streams/invgamma/lib/defaults.json", "../streams/invgamma/lib/validate.js", "../streams/invgamma/lib/debug.js", "../streams/invgamma/lib/main.js", "../streams/invgamma/lib/object_mode.js", "../streams/invgamma/lib/factory.js", "../streams/invgamma/lib/index.js", "../streams/kumaraswamy/lib/defaults.json", "../streams/kumaraswamy/lib/validate.js", "../streams/kumaraswamy/lib/debug.js", "../streams/kumaraswamy/lib/main.js", "../streams/kumaraswamy/lib/object_mode.js", "../streams/kumaraswamy/lib/factory.js", "../streams/kumaraswamy/lib/index.js", "../streams/laplace/lib/defaults.json", "../streams/laplace/lib/validate.js", "../streams/laplace/lib/debug.js", "../streams/laplace/lib/main.js", "../streams/laplace/lib/object_mode.js", "../streams/laplace/lib/factory.js", "../streams/laplace/lib/index.js", "../streams/levy/lib/defaults.json", "../streams/levy/lib/validate.js", "../streams/levy/lib/debug.js", "../streams/levy/lib/main.js", "../streams/levy/lib/object_mode.js", "../streams/levy/lib/factory.js", "../streams/levy/lib/index.js", "../streams/logistic/lib/defaults.json", "../streams/logistic/lib/validate.js", "../streams/logistic/lib/debug.js", "../streams/logistic/lib/main.js", "../streams/logistic/lib/object_mode.js", "../streams/logistic/lib/factory.js", "../streams/logistic/lib/index.js", "../streams/lognormal/lib/defaults.json", "../streams/lognormal/lib/validate.js", "../streams/lognormal/lib/debug.js", "../streams/lognormal/lib/main.js", "../streams/lognormal/lib/object_mode.js", "../streams/lognormal/lib/factory.js", "../streams/lognormal/lib/index.js", "../streams/minstd/lib/defaults.json", "../streams/minstd/lib/validate.js", "../streams/minstd/lib/debug.js", "../streams/minstd/lib/main.js", "../streams/minstd/lib/object_mode.js", "../streams/minstd/lib/factory.js", "../streams/minstd/lib/index.js", "../streams/minstd-shuffle/lib/defaults.json", "../streams/minstd-shuffle/lib/validate.js", "../streams/minstd-shuffle/lib/debug.js", "../streams/minstd-shuffle/lib/main.js", "../streams/minstd-shuffle/lib/object_mode.js", "../streams/minstd-shuffle/lib/factory.js", "../streams/minstd-shuffle/lib/index.js", "../streams/mt19937/lib/defaults.json", "../streams/mt19937/lib/validate.js", "../streams/mt19937/lib/debug.js", "../streams/mt19937/lib/main.js", "../streams/mt19937/lib/object_mode.js", "../streams/mt19937/lib/factory.js", "../streams/mt19937/lib/index.js", "../streams/negative-binomial/lib/defaults.json", "../streams/negative-binomial/lib/validate.js", "../streams/negative-binomial/lib/debug.js", "../streams/negative-binomial/lib/main.js", "../streams/negative-binomial/lib/object_mode.js", "../streams/negative-binomial/lib/factory.js", "../streams/negative-binomial/lib/index.js", "../streams/normal/lib/defaults.json", "../streams/normal/lib/validate.js", "../streams/normal/lib/debug.js", "../streams/normal/lib/main.js", "../streams/normal/lib/object_mode.js", "../streams/normal/lib/factory.js", "../streams/normal/lib/index.js", "../streams/pareto-type1/lib/defaults.json", "../streams/pareto-type1/lib/validate.js", "../streams/pareto-type1/lib/debug.js", "../streams/pareto-type1/lib/main.js", "../streams/pareto-type1/lib/object_mode.js", "../streams/pareto-type1/lib/factory.js", "../streams/pareto-type1/lib/index.js", "../streams/poisson/lib/defaults.json", "../streams/poisson/lib/validate.js", "../streams/poisson/lib/debug.js", "../streams/poisson/lib/main.js", "../streams/poisson/lib/object_mode.js", "../streams/poisson/lib/factory.js", "../streams/poisson/lib/index.js", "../streams/randi/lib/defaults.json", "../streams/randi/lib/validate.js", "../streams/randi/lib/debug.js", "../streams/randi/lib/main.js", "../streams/randi/lib/object_mode.js", "../streams/randi/lib/factory.js", "../streams/randi/lib/index.js", "../streams/randn/lib/defaults.json", "../streams/randn/lib/validate.js", "../streams/randn/lib/debug.js", "../streams/randn/lib/main.js", "../streams/randn/lib/object_mode.js", "../streams/randn/lib/factory.js", "../streams/randn/lib/index.js", "../streams/randu/lib/defaults.json", "../streams/randu/lib/validate.js", "../streams/randu/lib/debug.js", "../streams/randu/lib/main.js", "../streams/randu/lib/object_mode.js", "../streams/randu/lib/factory.js", "../streams/randu/lib/index.js", "../streams/rayleigh/lib/defaults.json", "../streams/rayleigh/lib/validate.js", "../streams/rayleigh/lib/debug.js", "../streams/rayleigh/lib/main.js", "../streams/rayleigh/lib/object_mode.js", "../streams/rayleigh/lib/factory.js", "../streams/rayleigh/lib/index.js", "../streams/t/lib/defaults.json", "../streams/t/lib/validate.js", "../streams/t/lib/debug.js", "../streams/t/lib/main.js", "../streams/t/lib/object_mode.js", "../streams/t/lib/factory.js", "../streams/t/lib/index.js", "../streams/triangular/lib/defaults.json", "../streams/triangular/lib/validate.js", "../streams/triangular/lib/debug.js", "../streams/triangular/lib/main.js", "../streams/triangular/lib/object_mode.js", "../streams/triangular/lib/factory.js", "../streams/triangular/lib/index.js", "../streams/uniform/lib/defaults.json", "../streams/uniform/lib/validate.js", "../streams/uniform/lib/debug.js", "../streams/uniform/lib/main.js", "../streams/uniform/lib/object_mode.js", "../streams/uniform/lib/factory.js", "../streams/uniform/lib/index.js", "../streams/weibull/lib/defaults.json", "../streams/weibull/lib/validate.js", "../streams/weibull/lib/debug.js", "../streams/weibull/lib/main.js", "../streams/weibull/lib/object_mode.js", "../streams/weibull/lib/factory.js", "../streams/weibull/lib/index.js", "../streams/lib/index.js", "../strided/arcsine/lib/prng.js", "../strided/arcsine/lib/main.js", "../strided/arcsine/lib/ndarray.js", "../strided/arcsine/lib/index.js", "../strided/tools/unary-factory/lib/main.js", "../strided/tools/unary-factory/lib/index.js", "../strided/bernoulli/lib/factory.js", "../strided/bernoulli/lib/main.js", "../strided/bernoulli/lib/index.js", "../strided/beta/lib/prng.js", "../strided/beta/lib/main.js", "../strided/beta/lib/ndarray.js", "../strided/beta/lib/index.js", "../strided/betaprime/lib/prng.js", "../strided/betaprime/lib/main.js", "../strided/betaprime/lib/ndarray.js", "../strided/betaprime/lib/index.js", "../strided/chi/lib/factory.js", "../strided/chi/lib/main.js", "../strided/chi/lib/index.js", "../strided/chisquare/lib/factory.js", "../strided/chisquare/lib/main.js", "../strided/chisquare/lib/index.js", "../strided/cosine/lib/prng.js", "../strided/cosine/lib/main.js", "../strided/cosine/lib/ndarray.js", "../strided/cosine/lib/index.js", "../strided/discrete-uniform/lib/prng.js", "../strided/discrete-uniform/lib/main.js", "../strided/discrete-uniform/lib/ndarray.js", "../strided/discrete-uniform/lib/index.js", "../strided/exponential/lib/factory.js", "../strided/exponential/lib/main.js", "../strided/exponential/lib/index.js", "../strided/gamma/lib/prng.js", "../strided/gamma/lib/main.js", "../strided/gamma/lib/ndarray.js", "../strided/gamma/lib/index.js", "../strided/geometric/lib/factory.js", "../strided/geometric/lib/main.js", "../strided/geometric/lib/index.js", "../strided/invgamma/lib/prng.js", "../strided/invgamma/lib/main.js", "../strided/invgamma/lib/ndarray.js", "../strided/invgamma/lib/index.js", "../strided/lognormal/lib/prng.js", "../strided/lognormal/lib/main.js", "../strided/lognormal/lib/ndarray.js", "../strided/lognormal/lib/index.js", "../strided/minstd/lib/main.js", "../strided/minstd/lib/ndarray.js", "../strided/minstd/lib/normalized.js", "../strided/minstd/lib/normalized.ndarray.js", "../strided/minstd/lib/index.js", "../strided/minstd-shuffle/lib/main.js", "../strided/minstd-shuffle/lib/ndarray.js", "../strided/minstd-shuffle/lib/normalized.js", "../strided/minstd-shuffle/lib/normalized.ndarray.js", "../strided/minstd-shuffle/lib/index.js", "../strided/mt19937/lib/main.js", "../strided/mt19937/lib/ndarray.js", "../strided/mt19937/lib/normalized.js", "../strided/mt19937/lib/normalized.ndarray.js", "../strided/mt19937/lib/index.js", "../strided/normal/lib/prng.js", "../strided/normal/lib/main.js", "../strided/normal/lib/ndarray.js", "../strided/normal/lib/index.js", "../strided/poisson/lib/factory.js", "../strided/poisson/lib/main.js", "../strided/poisson/lib/index.js", "../strided/randu/lib/main.js", "../strided/randu/lib/ndarray.js", "../strided/randu/lib/index.js", "../strided/uniform/lib/prng.js", "../strided/uniform/lib/main.js", "../strided/uniform/lib/ndarray.js", "../strided/uniform/lib/index.js", "../strided/weibull/lib/prng.js", "../strided/weibull/lib/main.js", "../strided/weibull/lib/ndarray.js", "../strided/weibull/lib/index.js", "../strided/lib/index.js", "../lib/index.js"], + "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar contains = require( '@stdlib/array/base/assert/contains' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Array} dtypes - list of supported output data types\n* @param {Options} options - function options\n* @param {string} [options.dtype] - output array data type\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var options = {\n* 'dtype': 'float64'\n* };\n* var err = validate( opts, dtypes, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, dtypes, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'dtype' ) ) {\n\t\topts.dtype = options.dtype;\n\t\tif ( !contains( dtypes, opts.dtype ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', dtypes.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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/* eslint-disable no-restricted-syntax, no-invalid-this */\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isStringArray = require( '@stdlib/assert/is-string-array' ).primitives;\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar contains = require( '@stdlib/array/base/assert/contains' );\nvar filledBy = require( '@stdlib/array/base/filled-by' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar ctors = require( '@stdlib/array/ctors' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Constructor for creating arrays filled with pseudorandom values drawn from a binary PRNG.\n*\n* @constructor\n* @param {Function} prng - binary pseudorandom value generator\n* @param {StringArray} dtypes - list of supported output data types\n* @param {string} dtype - default output data type\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} second argument must be an array of strings\n* @throws {TypeError} third argument must be a supported data type\n* @returns {Random} instance\n*\n* @example\n* var arcsine = require( '@stdlib/random/base/arcsine' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var defaultDType = 'float64';\n*\n* var rand = new Random( arcsine, dtypes, defaultDType );\n*\n* var v = rand.generate( 10, 2.0, 5.0 );\n* // returns \n*/\nfunction Random( prng, dtypes, dtype ) {\n\tif ( !( this instanceof Random ) ) {\n\t\treturn new Random( prng, dtypes, dtype );\n\t}\n\tif ( !isFunction( prng ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', prng ) );\n\t}\n\t// TODO: tighten this up by actually validating that `dtypes` contains only recognized/supported dtype strings\n\tif ( !isStringArray( dtypes ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an array of strings. Value: `%s`.', dtypes ) );\n\t}\n\t// Require that the default output array data type be a member of the list of supported output array data types...\n\tif ( !contains( dtypes, dtype ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a supported data type. Value: `%s`.', dtype ) );\n\t}\n\tthis._prng = prng;\n\tthis._dtypes = dtypes;\n\tthis._dtype = dtype;\n\treturn this;\n}\n\n/**\n* Returns an array filled with pseudorandom values drawn from a binary PRNG.\n*\n* @name generate\n* @memberof Random.prototype\n* @type {Function}\n* @param {NonNegativeInteger} len - number of elements\n* @param {*} param1 - first PRNG parameter\n* @param {*} param2 - second PRNG parameter\n* @param {Options} [options] - function options\n* @param {string} [options.dtype] - array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {Collection} output array\n*\n* @example\n* var arcsine = require( '@stdlib/random/base/arcsine' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var defaultDType = 'float64';\n*\n* var rand = new Random( arcsine, dtypes, defaultDType );\n*\n* var v = rand.generate( 10, 2.0, 5.0 );\n* // returns \n*/\nsetReadOnly( Random.prototype, 'generate', function generate( len, param1, param2, options ) {\n\tvar ctor;\n\tvar opts;\n\tvar prng;\n\tvar out;\n\tvar err;\n\tvar dt;\n\tif ( !isNonNegativeInteger( len ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t}\n\topts = {};\n\tif ( arguments.length > 3 ) {\n\t\terr = validate( opts, this._dtypes, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// NOTE: we could alternatively use the PRNG factory function to create a nullary PRNG function which applies parameters for each invocation; however, this would impose a one-time cost which is likely to be rather expensive when generating small arrays. The decision made here avoids this cost, despite a small cost due to repeatedly validating parameters for each generated pseudorandom value. Additionally, the current implementation has the added benefit that it mirrors the underlying PRNG where invalid parameters result in, e.g., a return value of `NaN` (however, realization of this benefit depends on the output array being a floating-point array).\n\tprng = this._prng;\n\tdt = opts.dtype || this._dtype;\n\tif ( dt === 'generic' ) {\n\t\treturn filledBy( len, wrapper );\n\t}\n\tctor = ctors( dt );\n\tout = new ctor( len );\n\tbinary( [ [ param1 ], [ param2 ], out ], [ len ], [ 0, 0, 1 ], prng );\n\treturn out;\n\n\t/**\n\t* Applies parameters to a pseudorandom value generator function.\n\t*\n\t* @private\n\t* @returns {*} pseudorandom value\n\t*/\n\tfunction wrapper() {\n\t\treturn prng( param1, param2 );\n\t}\n});\n\n/**\n* Fills an array with pseudorandom values drawn from a binary PRNG.\n*\n* @name assign\n* @memberof Random.prototype\n* @type {Function}\n* @param {*} param1 - first PRNG parameter\n* @param {*} param2 - second PRNG parameter\n* @param {Collection} out - output array\n* @throws {TypeError} third argument must be a collection\n* @returns {Collection} output array\n*\n* @example\n* var arcsine = require( '@stdlib/random/base/arcsine' );\n* var zeros = require( '@stdlib/array/zeros' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var defaultDType = 'float64';\n*\n* var rand = new Random( arcsine, dtypes, defaultDType );\n*\n* var out = zeros( 10, 'float64' );\n* // returns \n*\n* var v = rand.assign( 2.0, 5.0, out );\n* // returns \n*\n* var bool = ( v === out );\n* // returns true\n*/\nsetReadOnly( Random.prototype, 'assign', function assign( param1, param2, out ) {\n\tif ( !isCollection( out ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be an array-like object. Value: `%s`.', out ) );\n\t}\n\t// NOTE: we could alternatively use the PRNG factory function to create a nullary PRNG function which applies parameters for each invocation; however, this would impose a one-time cost which is likely to be rather expensive when filling small arrays. The decision made here avoids this cost, despite a small cost due to repeatedly validating parameters for each generated pseudorandom value. Additionally, the current implementation has the added benefit that it mirrors the underlying PRNG where invalid parameters result in, e.g., a return value of `NaN` (however, realization of this benefit depends on the output array being a floating-point array).\n\tbinary( [ [ param1 ], [ param2 ], out ], [ out.length ], [ 0, 0, 1 ], this._prng ); // eslint-disable-line max-len\n\treturn out;\n});\n\n\n// EXPORTS //\n\nmodule.exports = Random;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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* Constructor for creating arrays filled with pseudorandom values drawn from a binary PRNG.\n*\n* @module @stdlib/random/array/tools/binary\n*\n* @example\n* var arcsine = require( '@stdlib/random/base/arcsine' );\n* var Random = require( '@stdlib/random/array/tools/binary' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var defaultDType = 'float64';\n*\n* var rand = new Random( arcsine, dtypes, defaultDType );\n*\n* var v = rand.generate( 10, 2.0, 5.0 );\n* // returns \n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar contains = require( '@stdlib/array/base/assert/contains' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Array} dtypes - list of supported output data types\n* @param {Options} options - function options\n* @param {string} [options.dtype] - output array data type\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var options = {\n* 'dtype': 'float64'\n* };\n* var err = validate( opts, dtypes, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, dtypes, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'dtype' ) ) {\n\t\topts.dtype = options.dtype;\n\t\tif ( !contains( dtypes, opts.dtype ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', dtypes.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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/* eslint-disable no-restricted-syntax, no-invalid-this */\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isStringArray = require( '@stdlib/assert/is-string-array' ).primitives;\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar contains = require( '@stdlib/array/base/assert/contains' );\nvar filledBy = require( '@stdlib/array/base/filled-by' );\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar ctors = require( '@stdlib/array/ctors' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Constructor for creating arrays filled with pseudorandom values drawn from a nullary PRNG.\n*\n* @constructor\n* @param {Function} prng - nullary pseudorandom value generator\n* @param {StringArray} dtypes - list of supported output data types\n* @param {string} dtype - default output data type\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} second argument must be an array of strings\n* @throws {TypeError} third argument must be a supported data type\n* @returns {Random} instance\n*\n* @example\n* var exponential = require( '@stdlib/random/base/exponential' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var defaultDType = 'float64';\n*\n* var rand = new Random( exponential.factory( 2.0 ), dtypes, defaultDType );\n*\n* var v = rand.generate( 10 );\n* // returns \n*/\nfunction Random( prng, dtypes, dtype ) {\n\tif ( !( this instanceof Random ) ) {\n\t\treturn new Random( prng, dtypes, dtype );\n\t}\n\tif ( !isFunction( prng ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', prng ) );\n\t}\n\t// TODO: tighten this up by actually validating that `dtypes` contains only recognized/supported dtype strings\n\tif ( !isStringArray( dtypes ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an array of strings. Value: `%s`.', dtypes ) );\n\t}\n\t// Require that the default output array data type be a member of the list of supported output array data types...\n\tif ( !contains( dtypes, dtype ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a supported data type. Value: `%s`.', dtype ) );\n\t}\n\tthis._prng = prng;\n\tthis._dtypes = dtypes;\n\tthis._dtype = dtype;\n\treturn this;\n}\n\n/**\n* Returns an array filled with pseudorandom values drawn from a nullary PRNG.\n*\n* @name generate\n* @memberof Random.prototype\n* @type {Function}\n* @param {NonNegativeInteger} len - number of elements\n* @param {Options} [options] - function options\n* @param {string} [options.dtype] - array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {Collection} output array\n*\n* @example\n* var exponential = require( '@stdlib/random/base/exponential' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var defaultDType = 'float64';\n*\n* var rand = new Random( exponential.factory( 2.0 ), dtypes, defaultDType );\n*\n* var v = rand.generate( 10 );\n* // returns \n*/\nsetReadOnly( Random.prototype, 'generate', function generate( len, options ) {\n\tvar ctor;\n\tvar opts;\n\tvar out;\n\tvar err;\n\tvar dt;\n\tif ( !isNonNegativeInteger( len ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t}\n\topts = {};\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, this._dtypes, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\tdt = opts.dtype || this._dtype;\n\tif ( dt === 'generic' ) {\n\t\treturn filledBy( len, this._prng );\n\t}\n\tctor = ctors( dt );\n\tout = new ctor( len );\n\tnullary( [ out ], [ len ], [ 1 ], this._prng );\n\treturn out;\n});\n\n/**\n* Fills an array with pseudorandom values drawn from a nullary PRNG.\n*\n* @name assign\n* @memberof Random.prototype\n* @type {Function}\n* @param {Collection} out - output array\n* @throws {TypeError} first argument must be a collection\n* @returns {Collection} output array\n*\n* @example\n* var exponential = require( '@stdlib/random/base/exponential' );\n* var zeros = require( '@stdlib/array/zeros' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var defaultDType = 'float64';\n*\n* var rand = new Random( exponential.factory( 2.0 ), dtypes, defaultDType );\n*\n* var out = zeros( 10, 'float64' );\n* // returns \n*\n* var v = rand.assign( out );\n* // returns \n*\n* var bool = ( v === out );\n* // returns true\n*/\nsetReadOnly( Random.prototype, 'assign', function assign( out ) {\n\tif ( !isCollection( out ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array-like object. Value: `%s`.', out ) );\n\t}\n\tnullary( [ out ], [ out.length ], [ 1 ], this._prng );\n\treturn out;\n});\n\n\n// EXPORTS //\n\nmodule.exports = Random;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Constructor for creating arrays filled with pseudorandom values drawn from a nullary PRNG.\n*\n* @module @stdlib/random/array/tools/nullary\n*\n* @example\n* var exponential = require( '@stdlib/random/base/exponential' );\n* var Random = require( '@stdlib/random/array/tools/nullary' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var defaultDType = 'float64';\n*\n* var rand = new Random( exponential.factory( 2.0 ), dtypes, defaultDType );\n*\n* var v = rand.generate( 10 );\n* // returns \n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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 setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar isStringArray = require( '@stdlib/assert/is-string-array' ).primitives;\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isMethodIn = require( '@stdlib/assert/is-method-in' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar contains = require( '@stdlib/array/base/assert/contains' ).factory;\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar BinaryRandom = require( './../../../../array/tools/binary' );\nvar NullaryRandom = require( './../../../../array/tools/nullary' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a factory function for generating pseudorandom values drawn from a binary PRNG.\n*\n* @param {Function} prng - binary pseudorandom value generator\n* @param {Function} prng.factory - method which returns a new binary pseudorandom value generator\n* @param {StringArray} dtypes - list of supported output array data types\n* @param {string} dtype - default output array data type\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} first argument must have a `factory` method\n* @throws {TypeError} second argument must be an array of strings\n* @throws {TypeError} third argument must be a supported output array data type\n* @returns {Function} function which returns a function for creating arrays\n*\n* @example\n* var arcsine = require( '@stdlib/random/base/arcsine' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n*\n* var factory = createFactory( arcsine, dtypes, 'float64' );\n* // returns \n*\n* var random = factory();\n* // returns \n*\n* var x = random( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arcsine = require( '@stdlib/random/base/arcsine' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n*\n* var factory = createFactory( arcsine, dtypes, 'float64' );\n* // returns \n*\n* var random = factory();\n* // returns \n*\n* var x = random( 10, 2.0, 5.0, {\n* 'dtype': 'float32'\n* });\n* // returns \n*/\nfunction createFactory( prng, dtypes, dtype ) {\n\tvar isValidDataType;\n\tif ( !isFunction( prng ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', prng ) );\n\t}\n\tif ( !isMethodIn( prng, 'factory' ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must have a `%s` method.', 'factory' ) );\n\t}\n\t// TODO: tighten this up by actually validating that `dtypes` contains only recognized/supported dtype strings\n\tif ( !isStringArray( dtypes ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must an array of strings. Value: `%s`.', dtypes ) );\n\t}\n\t// Require that the default output array data type be a member of the list of supported output array data types...\n\tif ( !contains( dtypes, dtype ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a supported data type. Value: `%s`.', dtype ) );\n\t}\n\tisValidDataType = contains( dtypes );\n\treturn factory;\n\n\t/**\n\t* Returns a function for generating pseudorandom values drawn from a PRNG.\n\t*\n\t* @private\n\t* @param {*} [param1] - first PRNG parameter\n\t* @param {*} [param2] - second PRNG parameter\n\t* @param {Options} [options] - function options\n\t* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n\t* @param {*} [options.seed] - pseudorandom value generator seed\n\t* @param {*} [options.state] - pseudorandom value generator state\n\t* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom value generator state\n\t* @param {string} [options.dtype] - default output array data type\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {Function} function for creating arrays\n\t*/\n\tfunction factory() {\n\t\tvar Random;\n\t\tvar random;\n\t\tvar param1;\n\t\tvar param2;\n\t\tvar assign;\n\t\tvar nargs;\n\t\tvar base;\n\t\tvar opts;\n\t\tvar rand;\n\t\tvar dt;\n\n\t\tnargs = arguments.length;\n\t\tif ( nargs < 1 ) { // e.g., factory()\n\t\t\topts = {};\n\t\t\tbase = prng;\n\t\t\trand = rand1;\n\t\t} else if ( nargs === 1 ) { // e.g., factory( {} )\n\t\t\topts = arguments[ 0 ];\n\t\t\tbase = prng.factory( opts );\n\t\t\trand = rand1;\n\t\t} else if ( nargs === 2 ) { // e.g., factory( param1, param2 )\n\t\t\tparam1 = arguments[ 0 ];\n\t\t\tparam2 = arguments[ 1 ];\n\t\t\topts = {};\n\t\t\tbase = prng.factory( param1, param2 );\n\t\t\trand = rand2;\n\t\t} else { // e.g., factory( param1, param2, {} )\n\t\t\tparam1 = arguments[ 0 ];\n\t\t\tparam2 = arguments[ 1 ];\n\t\t\topts = arguments[ 2 ];\n\t\t\tbase = prng.factory( param1, param2, opts );\n\t\t\trand = rand2;\n\t\t}\n\t\tif ( hasOwnProp( opts, 'dtype' ) ) {\n\t\t\tdt = opts.dtype;\n\t\t\tif ( !isValidDataType( dt ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', dtypes.join( '\", \"' ), dt ) );\n\t\t\t}\n\t\t} else {\n\t\t\tdt = dtype;\n\t\t}\n\t\tif ( rand === rand1 ) {\n\t\t\tassign = assign1;\n\t\t\tRandom = BinaryRandom;\n\t\t} else {\n\t\t\tassign = assign2;\n\t\t\tRandom = NullaryRandom;\n\t\t}\n\t\trandom = new Random( base, dtypes, dt );\n\t\tif ( opts && opts.prng ) {\n\t\t\tsetReadOnly( rand, 'seed', null );\n\t\t\tsetReadOnly( rand, 'seedLength', null );\n\t\t\tsetReadWriteAccessor( rand, 'state', constantFunction( null ), noop );\n\t\t\tsetReadOnly( rand, 'stateLength', null );\n\t\t\tsetReadOnly( rand, 'byteLength', null );\n\t\t} else {\n\t\t\tsetReadOnlyAccessor( rand, 'seed', getSeed );\n\t\t\tsetReadOnlyAccessor( rand, 'seedLength', getSeedLength );\n\t\t\tsetReadWriteAccessor( rand, 'state', getState, setState );\n\t\t\tsetReadOnlyAccessor( rand, 'stateLength', getStateLength );\n\t\t\tsetReadOnlyAccessor( rand, 'byteLength', getStateSize );\n\t\t}\n\t\tsetReadOnly( rand, 'PRNG', base.PRNG );\n\t\tsetReadOnly( rand, 'assign', assign );\n\t\treturn rand;\n\n\t\t/**\n\t\t* Returns an array of pseudorandom values drawn from a PRNG.\n\t\t*\n\t\t* @private\n\t\t* @param {NonNegativeInteger} len - output array length\n\t\t* @param {*} param1 - first PRNG parameter\n\t\t* @param {*} param2 - second PRNG parameter\n\t\t* @param {Options} [options] - function options\n\t\t* @param {string} [options.dtype] - output array data type\n\t\t* @throws {TypeError} first argument must be a nonnegative integer\n\t\t* @throws {TypeError} options argument must be an object\n\t\t* @throws {TypeError} must provide valid options\n\t\t* @returns {Collection} output array\n\t\t*/\n\t\tfunction rand1( len, param1, param2, options ) {\n\t\t\tif ( arguments.length < 4 ) {\n\t\t\t\treturn random.generate( len, param1, param2 );\n\t\t\t}\n\t\t\treturn random.generate( len, param1, param2, options );\n\t\t}\n\n\t\t/**\n\t\t* Returns an array of pseudorandom values drawn from a PRNG.\n\t\t*\n\t\t* @private\n\t\t* @param {NonNegativeInteger} len - output array length\n\t\t* @param {Options} [options] - function options\n\t\t* @param {string} [options.dtype] - output array data type\n\t\t* @throws {TypeError} first argument must be a nonnegative integer\n\t\t* @throws {TypeError} options argument must be an object\n\t\t* @throws {TypeError} must provide valid options\n\t\t* @returns {Collection} output array\n\t\t*/\n\t\tfunction rand2( len, options ) {\n\t\t\tif ( arguments.length < 2 ) {\n\t\t\t\treturn random.generate( len );\n\t\t\t}\n\t\t\treturn random.generate( len, options );\n\t\t}\n\n\t\t/**\n\t\t* Fills an array with pseudorandom values drawn from a PRNG.\n\t\t*\n\t\t* @private\n\t\t* @param {*} param1 - first PRNG parameter\n\t\t* @param {*} param2 - second PRNG parameter\n\t\t* @param {Collection} out - output array\n\t\t* @throws {TypeError} third argument must be a collection\n\t\t* @returns {Collection} output array\n\t\t*/\n\t\tfunction assign1( param1, param2, out ) {\n\t\t\treturn random.assign( param1, param2, out );\n\t\t}\n\n\t\t/**\n\t\t* Fills an array with pseudorandom values drawn from a PRNG.\n\t\t*\n\t\t* @private\n\t\t* @param {Collection} out - output array\n\t\t* @throws {TypeError} first argument must be a collection\n\t\t* @returns {Collection} output array\n\t\t*/\n\t\tfunction assign2( out ) {\n\t\t\treturn random.assign( out );\n\t\t}\n\n\t\t/**\n\t\t* Returns the PRNG seed.\n\t\t*\n\t\t* @private\n\t\t* @returns {*} seed\n\t\t*/\n\t\tfunction getSeed() {\n\t\t\treturn rand.PRNG.seed;\n\t\t}\n\n\t\t/**\n\t\t* Returns the PRNG seed length.\n\t\t*\n\t\t* @private\n\t\t* @returns {PositiveInteger} seed length\n\t\t*/\n\t\tfunction getSeedLength() {\n\t\t\treturn rand.PRNG.seedLength;\n\t\t}\n\n\t\t/**\n\t\t* Returns the PRNG state length.\n\t\t*\n\t\t* @private\n\t\t* @returns {PositiveInteger} state length\n\t\t*/\n\t\tfunction getStateLength() {\n\t\t\treturn rand.PRNG.stateLength;\n\t\t}\n\n\t\t/**\n\t\t* Returns the PRNG state size (in bytes).\n\t\t*\n\t\t* @private\n\t\t* @returns {PositiveInteger} state size (in bytes)\n\t\t*/\n\t\tfunction getStateSize() {\n\t\t\treturn rand.PRNG.byteLength;\n\t\t}\n\n\t\t/**\n\t\t* Returns the current pseudorandom number generator state.\n\t\t*\n\t\t* @private\n\t\t* @returns {*} current state\n\t\t*/\n\t\tfunction getState() {\n\t\t\treturn rand.PRNG.state;\n\t\t}\n\n\t\t/**\n\t\t* Sets the pseudorandom number generator state.\n\t\t*\n\t\t* @private\n\t\t* @param {*} s - generator state\n\t\t* @throws {Error} must provide a valid state\n\t\t*/\n\t\tfunction setState( s ) {\n\t\t\trand.PRNG.state = s;\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = createFactory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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* Create a factory function for generating pseudorandom values drawn from a binary PRNG.\n*\n* @module @stdlib/random/array/tools/binary-factory\n*\n* @example\n* var arcsine = require( '@stdlib/random/base/arcsine' );\n* var binaryFactory = require( '@stdlib/random/array/tools/binary-factory' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n*\n* var factory = binaryFactory( arcsine, dtypes, 'float64' );\n* // returns \n*\n* var random = factory();\n* // returns \n*\n* var x = random( 10, 2.0, 5.0 );\n* // returns \n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 \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 \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 \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 \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). .\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 \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 \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", "/**\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 isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar isnan = require( '@stdlib/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Validates values provided for minimum and maximum support.\n*\n* @private\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( a, b ) {\n\tif ( !isNumber( a ) || isnan( a ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', a ) );\n\t}\n\tif ( !isNumber( b ) || isnan( b ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a number and not NaN. Value: `%s`.', b ) );\n\t}\n\tif ( a >= b ) {\n\t\treturn new RangeError( format( 'invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.', a, b ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 pow = require( '@stdlib/math/base/special/pow' );\nvar sin = require( '@stdlib/math/base/special/sin' );\nvar HALF_PI = require( '@stdlib/constants/float64/half-pi' );\n\n\n// MAIN //\n\n/**\n* Returns an arcsine distributed pseudorandom number with minimum support `a` and maximum support `b`.\n*\n* @private\n* @param {PRNG} rand - pseudorandom number generator\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @returns {number} pseudorandom number\n*/\nfunction arcsine( rand, a, b ) {\n\treturn a + ( pow( sin( HALF_PI*rand() ), 2.0 ) * ( b-a ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = arcsine;\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 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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar arcsine0 = require( './arcsine.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating arcsine distributed random numbers.\n*\n* @param {number} [a] - minimum support\n* @param {number} [b] - maximum support\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {RangeError} `a` must be less than `b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var arcsine = factory( 0.0, 1.0 );\n*\n* var v = arcsine();\n* // returns \n*\n* @example\n* var arcsine = factory( -3.0, -1.0, {\n* 'seed': 297\n* });\n* var v = arcsine();\n* // returns \n*/\nfunction factory() {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar a;\n\tvar b;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\ta = arguments[ 0 ];\n\t\tb = arguments[ 1 ];\n\t\terr = validate( a, b );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( a === void 0 ) {\n\t\tprng = arcsine2;\n\t} else {\n\t\tprng = arcsine1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'arcsine' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\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 = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( a === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ a, b ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a arcsine distributed pseudorandom number with minimum support `a` and maximum support `b`.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = arcsine1();\n\t* // returns \n\t*/\n\tfunction arcsine1() {\n\t\treturn arcsine0( rand, a, b );\n\t}\n\n\t/**\n\t* Returns an arcsine distributed pseudorandom number with minimum support `a` and maximum support `b`.\n\t*\n\t* @private\n\t* @param {number} a - minimum support\n\t* @param {number} b - maximum support\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = arcsine2( 0.0, 1.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = arcsine2( 1.0, 0.0 );\n\t* // returns NaN\n\t*/\n\tfunction arcsine2( a, b ) {\n\t\tif (\n\t\t\tisnan( a ) ||\n\t\t\tisnan( b ) ||\n\t\t\ta >= b\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn arcsine0( rand, a, b );\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' );\n\n\n// MAIN //\n\n/**\n* Returns an arcsine distributed pseudorandom number with minimum support `a` and maximum support `b`.\n*\n* @name arcsine\n* @type {PRNG}\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = arcsine( 0.0, 1.0 );\n* // returns \n*/\nvar arcsine = factory();\n\n\n// EXPORTS //\n\nmodule.exports = arcsine;\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* Arcsine distribution pseudorandom numbers.\n*\n* @module @stdlib/random/base/arcsine\n*\n* @example\n* var arcsine = require( '@stdlib/random/base/arcsine' );\n*\n* var v = arcsine( 0.0, 1.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/arcsine' ).factory;\n*\n* var arcsine = factory( -5.0, 5.0, {\n* 'seed': 297\n* });\n*\n* var v = arcsine();\n* // returns \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", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 binaryFactory = require( './../../../array/tools/binary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/arcsine' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from an arcsine distribution.\n*\n* @name factory\n* @type {Function}\n* @param {number} [a] - minimum support\n* @param {number} [b] - maximum support\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var arcsine = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = arcsine( 10 );\n* // returns \n*\n* @example\n* var arcsine = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = arcsine( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = binaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from an arcsine distribution.\n*\n* @name arcsine\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = arcsine( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = arcsine( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar arcsine = factory();\n\n\n// EXPORTS //\n\nmodule.exports = arcsine;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create an array containing pseudorandom numbers drawn from an arcsine distribution.\n*\n* @module @stdlib/random/array/arcsine\n*\n* @example\n* var arcsine = require( '@stdlib/random/array/arcsine' );\n*\n* var arr = arcsine( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arcsine = require( '@stdlib/random/array/arcsine' );\n*\n* var arr = arcsine( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var arcsine = require( '@stdlib/random/array/arcsine' );\n*\n* var rand = arcsine.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var arcsine = require( '@stdlib/random/array/arcsine' );\n*\n* var rand = arcsine.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar contains = require( '@stdlib/array/base/assert/contains' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Array} dtypes - list of supported output data types\n* @param {Options} options - function options\n* @param {string} [options.dtype] - output array data type\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var options = {\n* 'dtype': 'float64'\n* };\n* var err = validate( opts, dtypes, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, dtypes, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'dtype' ) ) {\n\t\topts.dtype = options.dtype;\n\t\tif ( !contains( dtypes, opts.dtype ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', dtypes.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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/* eslint-disable no-restricted-syntax, no-invalid-this */\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isStringArray = require( '@stdlib/assert/is-string-array' ).primitives;\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar contains = require( '@stdlib/array/base/assert/contains' );\nvar filledBy = require( '@stdlib/array/base/filled-by' );\nvar unary = require( '@stdlib/strided/base/unary' );\nvar ctors = require( '@stdlib/array/ctors' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Constructor for creating arrays filled with pseudorandom values drawn from a unary PRNG.\n*\n* @constructor\n* @param {Function} prng - unary pseudorandom value generator\n* @param {StringArray} dtypes - list of supported output data types\n* @param {string} dtype - default output data type\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} second argument must be an array of strings\n* @throws {TypeError} third argument must be a supported data type\n* @returns {Random} instance\n*\n* @example\n* var exponential = require( '@stdlib/random/base/exponential' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var defaultDType = 'float64';\n*\n* var rand = new Random( exponential, dtypes, defaultDType );\n*\n* var v = rand.generate( 10, 2.0 );\n* // returns \n*/\nfunction Random( prng, dtypes, dtype ) {\n\tif ( !( this instanceof Random ) ) {\n\t\treturn new Random( prng, dtypes, dtype );\n\t}\n\tif ( !isFunction( prng ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', prng ) );\n\t}\n\t// TODO: tighten this up by actually validating that `dtypes` contains only recognized/supported dtype strings\n\tif ( !isStringArray( dtypes ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an array of strings. Value: `%s`.', dtypes ) );\n\t}\n\t// Require that the default output array data type be a member of the list of supported output array data types...\n\tif ( !contains( dtypes, dtype ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a supported data type. Value: `%s`.', dtype ) );\n\t}\n\tthis._prng = prng;\n\tthis._dtypes = dtypes;\n\tthis._dtype = dtype;\n\treturn this;\n}\n\n/**\n* Returns an array filled with pseudorandom values drawn from a unary PRNG.\n*\n* @name generate\n* @memberof Random.prototype\n* @type {Function}\n* @param {NonNegativeInteger} len - number of elements\n* @param {*} param1 - PRNG parameter\n* @param {Options} [options] - function options\n* @param {string} [options.dtype] - array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {Collection} output array\n*\n* @example\n* var exponential = require( '@stdlib/random/base/exponential' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var defaultDType = 'float64';\n*\n* var rand = new Random( exponential, dtypes, defaultDType );\n*\n* var v = rand.generate( 10, 2.0 );\n* // returns \n*/\nsetReadOnly( Random.prototype, 'generate', function generate( len, param1, options ) {\n\tvar ctor;\n\tvar opts;\n\tvar prng;\n\tvar out;\n\tvar err;\n\tvar dt;\n\tif ( !isNonNegativeInteger( len ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t}\n\topts = {};\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, this._dtypes, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// NOTE: we could alternatively use the PRNG factory function to create a nullary PRNG function which applies parameters for each invocation; however, this would impose a one-time cost which is likely to be rather expensive when generating small arrays. The decision made here avoids this cost, despite a small cost due to repeatedly validating parameters for each generated pseudorandom value. Additionally, the current implementation has the added benefit that it mirrors the underlying PRNG where invalid parameters result in, e.g., a return value of `NaN` (however, realization of this benefit depends on the output array being a floating-point array).\n\tprng = this._prng;\n\tdt = opts.dtype || this._dtype;\n\tif ( dt === 'generic' ) {\n\t\treturn filledBy( len, wrapper );\n\t}\n\tctor = ctors( dt );\n\tout = new ctor( len );\n\tunary( [ [ param1 ], out ], [ len ], [ 0, 1 ], prng );\n\treturn out;\n\n\t/**\n\t* Applies parameters to a pseudorandom value generator function.\n\t*\n\t* @private\n\t* @returns {*} pseudorandom value\n\t*/\n\tfunction wrapper() {\n\t\treturn prng( param1 );\n\t}\n});\n\n/**\n* Fills an array with pseudorandom values drawn from a unary PRNG.\n*\n* @name assign\n* @memberof Random.prototype\n* @type {Function}\n* @param {*} param1 - PRNG parameter\n* @param {Collection} out - output array\n* @throws {TypeError} second argument must be a collection\n* @returns {Collection} output array\n*\n* @example\n* var exponential = require( '@stdlib/random/base/exponential' );\n* var zeros = require( '@stdlib/array/zeros' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var defaultDType = 'float64';\n*\n* var rand = new Random( exponential, dtypes, defaultDType );\n*\n* var out = zeros( 10, 'float64' );\n* // returns \n*\n* var v = rand.assign( 2.0, out );\n* // returns \n*\n* var bool = ( v === out );\n* // returns true\n*/\nsetReadOnly( Random.prototype, 'assign', function assign( param1, out ) {\n\tif ( !isCollection( out ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an array-like object. Value: `%s`.', out ) );\n\t}\n\t// NOTE: we could alternatively use the PRNG factory function to create a nullary PRNG function which applies parameters for each invocation; however, this would impose a one-time cost which is likely to be rather expensive when filling small arrays. The decision made here avoids this cost, despite a small cost due to repeatedly validating parameters for each generated pseudorandom value. Additionally, the current implementation has the added benefit that it mirrors the underlying PRNG where invalid parameters result in, e.g., a return value of `NaN` (however, realization of this benefit depends on the output array being a floating-point array).\n\tunary( [ [ param1 ], out ], [ out.length ], [ 0, 1 ], this._prng );\n\treturn out;\n});\n\n\n// EXPORTS //\n\nmodule.exports = Random;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Constructor for creating arrays filled with pseudorandom values drawn from a unary PRNG.\n*\n* @module @stdlib/random/array/tools/unary\n*\n* @example\n* var exponential = require( '@stdlib/random/base/exponential' );\n* var Random = require( '@stdlib/random/array/tools/unary' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var defaultDType = 'float64';\n*\n* var rand = new Random( exponential, dtypes, defaultDType );\n*\n* var v = rand.generate( 10, 2.0 );\n* // returns \n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar isStringArray = require( '@stdlib/assert/is-string-array' ).primitives;\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isMethodIn = require( '@stdlib/assert/is-method-in' );\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar contains = require( '@stdlib/array/base/assert/contains' ).factory;\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar UnaryRandom = require( './../../../../array/tools/unary' );\nvar NullaryRandom = require( './../../../../array/tools/nullary' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a factory function for generating pseudorandom values drawn from a unary PRNG.\n*\n* @param {Function} prng - unary pseudorandom value generator\n* @param {Function} prng.factory - method which returns a new unary pseudorandom value generator\n* @param {StringArray} dtypes - list of supported output array data types\n* @param {string} dtype - default output array data type\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} first argument must have a `factory` method\n* @throws {TypeError} second argument must be an array of strings\n* @throws {TypeError} third argument must be a supported output array data type\n* @returns {Function} function which returns a function for creating arrays\n*\n* @example\n* var exponential = require( '@stdlib/random/base/exponential' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n*\n* var factory = createFactory( exponential, dtypes, 'float64' );\n* // returns \n*\n* var random = factory();\n* // returns \n*\n* var x = random( 10, 2.0 );\n* // returns \n*\n* @example\n* var exponential = require( '@stdlib/random/base/exponential' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n*\n* var factory = createFactory( exponential, dtypes, 'float64' );\n* // returns \n*\n* var random = factory();\n* // returns \n*\n* var x = random( 10, 2.0, {\n* 'dtype': 'float32'\n* });\n* // returns \n*/\nfunction createFactory( prng, dtypes, dtype ) {\n\tvar isValidDataType;\n\tif ( !isFunction( prng ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', prng ) );\n\t}\n\tif ( !isMethodIn( prng, 'factory' ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must have a `%s` method.', 'factory' ) );\n\t}\n\t// TODO: tighten this up by actually validating that `dtypes` contains only recognized/supported dtype strings\n\tif ( !isStringArray( dtypes ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must an array of strings. Value: `%s`.', dtypes ) );\n\t}\n\t// Require that the default output array data type be a member of the list of supported output array data types...\n\tif ( !contains( dtypes, dtype ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a supported data type. Value: `%s`.', dtype ) );\n\t}\n\tisValidDataType = contains( dtypes );\n\treturn factory;\n\n\t/**\n\t* Returns a function for generating pseudorandom values drawn from a PRNG.\n\t*\n\t* @private\n\t* @param {*} [param1] - PRNG parameter\n\t* @param {Options} [options] - function options\n\t* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n\t* @param {*} [options.seed] - pseudorandom value generator seed\n\t* @param {*} [options.state] - pseudorandom value generator state\n\t* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom value generator state\n\t* @param {string} [options.dtype] - default output array data type\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {Function} function for creating arrays\n\t*/\n\tfunction factory() {\n\t\tvar Random;\n\t\tvar random;\n\t\tvar param1;\n\t\tvar assign;\n\t\tvar nargs;\n\t\tvar base;\n\t\tvar opts;\n\t\tvar rand;\n\t\tvar dt;\n\n\t\tnargs = arguments.length;\n\t\tif ( nargs < 1 ) { // e.g., factory()\n\t\t\topts = {};\n\t\t\tbase = prng;\n\t\t\trand = rand1;\n\t\t} else if ( nargs > 1 ) { // e.g., factory( param1, {} )\n\t\t\tparam1 = arguments[ 0 ];\n\t\t\topts = arguments[ 1 ];\n\t\t\tbase = prng.factory( param1, opts );\n\t\t\trand = rand2;\n\t\t} else if ( isPlainObject( arguments[ 0 ] ) ) { // e.g., factory( {} )\n\t\t\topts = arguments[ 0 ];\n\t\t\tbase = prng.factory( opts );\n\t\t\trand = rand1;\n\t\t} else { // e.g., factory( param1 )\n\t\t\tparam1 = arguments[ 0 ];\n\t\t\topts = {};\n\t\t\tbase = prng.factory( param1 );\n\t\t\trand = rand2;\n\t\t}\n\t\tif ( hasOwnProp( opts, 'dtype' ) ) {\n\t\t\tdt = opts.dtype;\n\t\t\tif ( !isValidDataType( dt ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', dtypes.join( '\", \"' ), dt ) );\n\t\t\t}\n\t\t} else {\n\t\t\tdt = dtype;\n\t\t}\n\t\tif ( rand === rand1 ) {\n\t\t\tassign = assign1;\n\t\t\tRandom = UnaryRandom;\n\t\t} else {\n\t\t\tassign = assign2;\n\t\t\tRandom = NullaryRandom;\n\t\t}\n\t\trandom = new Random( base, dtypes, dt );\n\t\tif ( opts && opts.prng ) {\n\t\t\tsetReadOnly( rand, 'seed', null );\n\t\t\tsetReadOnly( rand, 'seedLength', null );\n\t\t\tsetReadWriteAccessor( rand, 'state', constantFunction( null ), noop );\n\t\t\tsetReadOnly( rand, 'stateLength', null );\n\t\t\tsetReadOnly( rand, 'byteLength', null );\n\t\t} else {\n\t\t\tsetReadOnlyAccessor( rand, 'seed', getSeed );\n\t\t\tsetReadOnlyAccessor( rand, 'seedLength', getSeedLength );\n\t\t\tsetReadWriteAccessor( rand, 'state', getState, setState );\n\t\t\tsetReadOnlyAccessor( rand, 'stateLength', getStateLength );\n\t\t\tsetReadOnlyAccessor( rand, 'byteLength', getStateSize );\n\t\t}\n\t\tsetReadOnly( rand, 'PRNG', base.PRNG );\n\t\tsetReadOnly( rand, 'assign', assign );\n\t\treturn rand;\n\n\t\t/**\n\t\t* Returns an array of pseudorandom values drawn from a PRNG.\n\t\t*\n\t\t* @private\n\t\t* @param {NonNegativeInteger} len - output array length\n\t\t* @param {*} param1 - PRNG parameter\n\t\t* @param {Options} [options] - function options\n\t\t* @param {string} [options.dtype] - output array data type\n\t\t* @throws {TypeError} first argument must be a nonnegative integer\n\t\t* @throws {TypeError} options argument must be an object\n\t\t* @throws {TypeError} must provide valid options\n\t\t* @returns {Collection} output array\n\t\t*/\n\t\tfunction rand1( len, param1, options ) {\n\t\t\tif ( arguments.length < 3 ) {\n\t\t\t\treturn random.generate( len, param1 );\n\t\t\t}\n\t\t\treturn random.generate( len, param1, options );\n\t\t}\n\n\t\t/**\n\t\t* Returns an array of pseudorandom values drawn from a PRNG.\n\t\t*\n\t\t* @private\n\t\t* @param {NonNegativeInteger} len - output array length\n\t\t* @param {Options} [options] - function options\n\t\t* @param {string} [options.dtype] - output array data type\n\t\t* @throws {TypeError} first argument must be a nonnegative integer\n\t\t* @throws {TypeError} options argument must be an object\n\t\t* @throws {TypeError} must provide valid options\n\t\t* @returns {Collection} output array\n\t\t*/\n\t\tfunction rand2( len, options ) {\n\t\t\tif ( arguments.length < 2 ) {\n\t\t\t\treturn random.generate( len );\n\t\t\t}\n\t\t\treturn random.generate( len, options );\n\t\t}\n\n\t\t/**\n\t\t* Fills an array with pseudorandom values drawn from a PRNG.\n\t\t*\n\t\t* @private\n\t\t* @param {*} param1 - PRNG parameter\n\t\t* @param {Collection} out - output array\n\t\t* @throws {TypeError} second argument must be a collection\n\t\t* @returns {Collection} output array\n\t\t*/\n\t\tfunction assign1( param1, out ) {\n\t\t\treturn random.assign( param1, out );\n\t\t}\n\n\t\t/**\n\t\t* Fills an array with pseudorandom values drawn from a PRNG.\n\t\t*\n\t\t* @private\n\t\t* @param {Collection} out - output array\n\t\t* @throws {TypeError} first argument must be a collection\n\t\t* @returns {Collection} output array\n\t\t*/\n\t\tfunction assign2( out ) {\n\t\t\treturn random.assign( out );\n\t\t}\n\n\t\t/**\n\t\t* Returns the PRNG seed.\n\t\t*\n\t\t* @private\n\t\t* @returns {*} seed\n\t\t*/\n\t\tfunction getSeed() {\n\t\t\treturn rand.PRNG.seed;\n\t\t}\n\n\t\t/**\n\t\t* Returns the PRNG seed length.\n\t\t*\n\t\t* @private\n\t\t* @returns {PositiveInteger} seed length\n\t\t*/\n\t\tfunction getSeedLength() {\n\t\t\treturn rand.PRNG.seedLength;\n\t\t}\n\n\t\t/**\n\t\t* Returns the PRNG state length.\n\t\t*\n\t\t* @private\n\t\t* @returns {PositiveInteger} state length\n\t\t*/\n\t\tfunction getStateLength() {\n\t\t\treturn rand.PRNG.stateLength;\n\t\t}\n\n\t\t/**\n\t\t* Returns the PRNG state size (in bytes).\n\t\t*\n\t\t* @private\n\t\t* @returns {PositiveInteger} state size (in bytes)\n\t\t*/\n\t\tfunction getStateSize() {\n\t\t\treturn rand.PRNG.byteLength;\n\t\t}\n\n\t\t/**\n\t\t* Returns the current pseudorandom number generator state.\n\t\t*\n\t\t* @private\n\t\t* @returns {*} current state\n\t\t*/\n\t\tfunction getState() {\n\t\t\treturn rand.PRNG.state;\n\t\t}\n\n\t\t/**\n\t\t* Sets the pseudorandom number generator state.\n\t\t*\n\t\t* @private\n\t\t* @param {*} s - generator state\n\t\t* @throws {Error} must provide a valid state\n\t\t*/\n\t\tfunction setState( s ) {\n\t\t\trand.PRNG.state = s;\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = createFactory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create a factory function for generating pseudorandom values drawn from a unary PRNG.\n*\n* @module @stdlib/random/array/tools/unary-factory\n*\n* @example\n* var exponential = require( '@stdlib/random/base/exponential' );\n* var unaryFactory = require( '@stdlib/random/array/tools/unary-factory' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n*\n* var factory = unaryFactory( exponential, dtypes, 'float64' );\n* // returns \n*\n* var random = factory();\n* // returns \n*\n* var x = random( 10, 2.0 );\n* // returns \n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar isProbability = require( '@stdlib/assert/is-probability' ).isPrimitive;\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating Bernoulli distributed random numbers.\n*\n* @param {Probability} [p] - success probability\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} `p` must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var bernoulli = factory( 0.5 );\n* var v = bernoulli();\n* // returns \n*\n* @example\n* var bernoulli = factory( 0.8, {\n* 'seed': 297\n* });\n* var v = bernoulli();\n* // returns \n*\n* @example\n* var bernoulli = factory();\n* var v = bernoulli( 0.5 );\n* // returns \n*/\nfunction factory() {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar p;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if (\n\t\targuments.length === 1 &&\n\t\tisObject( arguments[ 0 ] )\n\t) {\n\t\topts = arguments[ 0 ];\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tp = arguments[ 0 ];\n\t\tif ( !isProbability( p ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a probability. Value: `%s`.', p ) );\n\t\t}\n\t\tif ( arguments.length > 1 ) {\n\t\t\topts = arguments[ 1 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( p === void 0 ) {\n\t\tprng = bernoulli2;\n\t} else {\n\t\tprng = bernoulli1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'bernoulli' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\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 = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( p === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ p ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Bernoulli distribution with bound parameter `p`.\n\t*\n\t* @private\n\t* @returns {NonNegativeInteger} pseudorandom number\n\t*\n\t* @example\n\t* var v = bernoulli1();\n\t* // returns \n\t*/\n\tfunction bernoulli1() {\n\t\treturn ( rand() <= p ) ? 1 : 0;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Bernoulli distribution with parameter `p`.\n\t*\n\t* @private\n\t* @param {Probability} p - success probability\n\t* @returns {NonNegativeInteger} pseudorandom number\n\t*\n\t* @example\n\t* var v = bernoulli2( 0.5 );\n\t* // returns \n\t*/\n\tfunction bernoulli2( p ) {\n\t\tif (\n\t\t\tisnan( p ) ||\n\t\t\tp < 0.0 ||\n\t\t\tp > 1.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn ( rand() <= p ) ? 1 : 0;\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' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom random number drawn from a Bernoulli distribution with parameter `p`.\n*\n* @name bernoulli\n* @type {PRNG}\n* @param {Probability} p - success probability\n* @returns {NonNegativeInteger} pseudorandom number\n*\n* @example\n* var v = bernoulli( 0.5 );\n* // returns \n*\n* @example\n* var v = bernoulli( 3.14 );\n* // returns NaN\n*\n* @example\n* var v = bernoulli( -1.0 );\n* // returns NaN\n*\n* @example\n* var v = bernoulli( NaN );\n* // returns NaN\n*/\nvar bernoulli = factory();\n\n\n// EXPORTS //\n\nmodule.exports = bernoulli;\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* Bernoulli distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/bernoulli\n*\n* @example\n* var bernoulli = require( '@stdlib/random/base/bernoulli' );\n*\n* var v = bernoulli( 0.5 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/bernoulli' ).factory;\n*\n* var bernoulli = factory( 0.3, {\n* 'seed': 297\n* });\n*\n* var v = bernoulli();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/bernoulli' ).factory;\n*\n* var bernoulli = factory({\n* 'seed': 297\n* });\n*\n* var v = bernoulli( 0.5 );\n* // returns \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", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 unaryFactory = require( './../../../array/tools/unary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/bernoulli' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a Bernoulli distribution.\n*\n* @name factory\n* @type {Function}\n* @param {Probability} [p] - success probability\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `p` must be a probability (i.e., a number on the interval [0,1])\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var bernoulli = factory( 0.5 );\n* // returns \n*\n* var arr = bernoulli( 10 );\n* // returns \n*\n* @example\n* var bernoulli = factory( 0.5 );\n* // returns \n*\n* var arr = bernoulli( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = unaryFactory( base, DTYPES, defaults.get( 'dtypes.real' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a Bernoulli distribution.\n*\n* @name bernoulli\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {Probability} p - success probability\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = bernoulli( 10, 0.5 );\n* // returns \n*\n* @example\n* var arr = bernoulli( 10, 0.5, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar bernoulli = factory();\n\n\n// EXPORTS //\n\nmodule.exports = bernoulli;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create an array containing pseudorandom numbers drawn from a Bernoulli distribution.\n*\n* @module @stdlib/random/array/bernoulli\n*\n* @example\n* var bernoulli = require( '@stdlib/random/array/bernoulli' );\n*\n* var arr = bernoulli( 10, 0.5 );\n* // returns \n*\n* @example\n* var bernoulli = require( '@stdlib/random/array/bernoulli' );\n*\n* var arr = bernoulli( 10, 0.5, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var bernoulli = require( '@stdlib/random/array/bernoulli' );\n*\n* var rand = bernoulli.factory( 0.5 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var bernoulli = require( '@stdlib/random/array/bernoulli' );\n*\n* var rand = bernoulli.factory( 0.5 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\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 sqrt = require( '@stdlib/math/base/special/sqrt' );\nvar exp = require( '@stdlib/math/base/special/exp' );\nvar ln = require( '@stdlib/math/base/special/ln' );\n\n\n// VARIABLES //\n\n// (R*phi(R) + Pr(X>=R))*sqrt(2\\pi)\nvar V = 9.91256303526217e-3;\n\n\n// MAIN //\n\n/**\n* Returns an array containing coordinates such that each rectangle has the same area.\n*\n* @private\n* @param {PositiveInteger} N - number of rectangles\n* @param {number} rTail - start of right tail\n* @returns {NumberArray} coordinate array\n*\n* @example\n* var X = coordsArray( 128, 3.44 );\n* // returns \n*/\nfunction coordsArray( N, rTail ) {\n\tvar X;\n\tvar f;\n\tvar i;\n\n\tf = exp( -0.5 * rTail * rTail );\n\n\tX = [];\n\tX.push( V/f ); // bottom block: V / f(R)\n\tX.push( rTail );\n\tfor ( i = 2; i < N; i++ ) {\n\t\tX[ i ] = sqrt( -2.0 * ln( ( V/X[i-1] ) + f ) );\n\t\tf = exp( -0.5 * X[ i ] * X[ i ] );\n\t}\n\tX.push( 0.0 );\n\treturn X;\n}\n\n\n// EXPORTS //\n\nmodule.exports = coordsArray;\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// MAIN //\n\n/**\n* Returns an array containing the ratio of each pair of consecutive elements in order: `X[ i+1 ] / X[ i ]`.\n*\n* @private\n* @param {NumberArray} X - input array\n* @returns {NumberArray} ratio array\n*\n* @example\n* var R = ratioArray( [ 1.0, 2.0, 5.0 ] );\n* // returns [ 2.0, 2.5 ]\n*/\nfunction ratioArray( X ) {\n\tvar R;\n\tvar i;\n\n\tR = [];\n\tfor ( i = 0; i < X.length-1; i++ ) {\n\t\tR.push( X[ i+1 ] / X[ i ] );\n\t}\n\treturn R;\n}\n\n\n// EXPORTS //\n\nmodule.exports = ratioArray;\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 ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Transforms the tail of the normal distribution to the unit interval and then uses rejection technique to generate standard normal variable.\n*\n* ## References\n*\n* - Marsaglia, George. 1964. \"Generating a Variable from the Tail of the Normal Distribution.\" _Technometrics_ 6 (1): 101\u20132. doi:[10.1080/00401706.1964.10490150](http://dx.doi.org/10.1080/00401706.1964.10490150).\n*\n* @private\n* @param {PRNG} rand - pseudorandom number generator\n* @param {number} rTail - start value of the right tail\n* @param {boolean} isNegative - boolean indicating which side to evaluate\n* @returns {number} standard normal variable\n*/\nfunction sampleTail( rand, rTail, isNegative ) {\n\tvar x;\n\tvar y;\n\tdo {\n\t\tx = ln( rand() ) / rTail;\n\t\ty = ln( rand() );\n\t} while ( -2.0*y < x*x );\n\treturn ( isNegative ) ? x-rTail : rTail-x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sampleTail;\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 abs = require( '@stdlib/math/base/special/abs' );\nvar exp = require( '@stdlib/math/base/special/exp' );\nvar coordsArray = require( './coords_array.js' );\nvar ratioArray = require( './ratio_array.js' );\nvar sampleTail = require( './sample_tail.js' );\n\n\n// VARIABLES //\n\n// Number of blocks:\nvar NUM_BLOCKS = 128;\n\n// Start of right tail (R):\nvar START_RIGHT_TAIL = 3.442619855899;\n\n// `X` holds coordinates, such that each rectangle has same area:\nvar X = coordsArray( NUM_BLOCKS, START_RIGHT_TAIL );\n\n// `R` holds `X[ i+1 ] / X[ i ]`:\nvar R = ratioArray( X );\n\n// 127 => 0x7F => 00000000000000000000000001111111\nvar LAST_7_BITS_MASK = 127|0; // asm type annotation\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator which implements the improved Ziggurat algorithm for generating normally distributed pseudorandom numbers.\n*\n* @private\n* @param {PRNG} randu - PRNG for generating uniformly distributed numbers\n* @param {PRNG} randi - PRNG for generating uniformly distributed integers\n* @returns {number} pseudorandom number\n*/\nfunction wrap( randu, randi ) {\n\treturn randn;\n\n\t/**\n\t* Generates a normally distributed pseudorandom number.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var r = randn();\n\t* // returns \n\t*/\n\tfunction randn() {\n\t\tvar f0;\n\t\tvar f1;\n\t\tvar x2;\n\t\tvar x;\n\t\tvar u;\n\t\tvar i;\n\t\tvar j;\n\t\twhile ( true ) {\n\t\t\tu = ( 2.0*randu() ) - 1.0;\n\t\t\ti = randi() & LAST_7_BITS_MASK;\n\n\t\t\t// First try the rectangular boxes...\n\t\t\tif ( abs( u ) < R[ i ] ) {\n\t\t\t\treturn u * X[ i ];\n\t\t\t}\n\t\t\t// If bottom box, sample from the tail...\n\t\t\tif ( i === 0 ) {\n\t\t\t\treturn sampleTail( randu, START_RIGHT_TAIL, u < 0.0 );\n\t\t\t}\n\t\t\t// Is this a sample from the wedges?\n\t\t\tx = u * X[ i ];\n\t\t\tx2 = x * x;\n\t\t\tj = i + 1;\n\t\t\tf0 = exp( -0.5 * ( (X[ i ]*X[ i ]) - x2 ) );\n\t\t\tf1 = exp( -0.5 * ( (X[ j ]*X[ j ]) - x2 ) );\n\t\t\tif ( f1 + (randu()*(f0-f1)) < 1.0 ) {\n\t\t\t\treturn x;\n\t\t\t}\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = wrap;\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 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 isFunction = require( '@stdlib/assert/is-function' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isUint32Array = require( '@stdlib/assert/is-uint32array' );\nvar mt19937 = require( './../../../base/mt19937' ).factory;\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar floor = require( '@stdlib/math/base/special/floor' );\nvar UINT32_MAX = require( '@stdlib/constants/uint32/max' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar improvedZiggurat = require( './improved_ziggurat.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator which implements the improved Ziggurat method to generate normally distributed pseudorandom numbers.\n*\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} must provide an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var randn = factory();\n*\n* var r = randn();\n* // returns \n*\n* @example\n* // Return a seeded PRNG:\n* var randn = factory({\n* 'seed': 12345\n* });\n*\n* var r = randn();\n* // returns \n*/\nfunction factory( options ) {\n\tvar randu;\n\tvar randi;\n\tvar randn;\n\tvar opts;\n\n\topts = {\n\t\t'copy': true\n\t};\n\tif ( arguments.length ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide 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, 'prng' ) ) {\n\t\t\tif ( !isFunction( options.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', options.prng ) );\n\t\t\t}\n\t\t\trandu = options.prng;\n\t\t}\n\t\t// If provided a PRNG, ignore the `state` option, as we don't support getting or setting PRNG state.\n\t\telse if ( hasOwnProp( options, 'state' ) ) {\n\t\t\topts.state = options.state;\n\t\t\tif ( !isUint32Array( options.state ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a Uint32Array. Option: `%s`.', 'state', options.state ) );\n\t\t\t}\n\t\t}\n\t\t// If provided a PRNG, ignore the `seed` option, as a `seed`, by itself, is insufficient to guarantee reproducibility. If provided a state, ignore the `seed` option, as a PRNG state should contain seed information.\n\t\telse if ( hasOwnProp( options, 'seed' ) ) {\n\t\t\topts.seed = options.seed;\n\t\t\tif ( options.seed === void 0 ) {\n\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', options.seed ) );\n\t\t\t}\n\t\t}\n\t}\n\tif ( opts.state === void 0 ) {\n\t\tif ( randu === void 0 ) {\n\t\t\trandi = mt19937( opts );\n\t\t\trandu = randi.normalized;\n\t\t} else {\n\t\t\trandi = mt19937({\n\t\t\t\t'seed': floor( 1.0 + ( UINT32_MAX*randu() ) ), // allows seeding via an externally seeded PRNG\n\t\t\t\t'copy': opts.copy\n\t\t\t});\n\t\t\topts.seed = null;\n\t\t}\n\t} else {\n\t\trandi = mt19937( opts );\n\t\trandu = randi.normalized;\n\t}\n\trandn = improvedZiggurat( randu, randi );\n\n\tsetReadOnly( randn, 'NAME', 'improved-ziggurat' );\n\tif ( opts.seed === null ) {\n\t\tsetReadOnly( randn, 'seed', null );\n\t\tsetReadOnly( randn, 'seedLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( randn, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( randn, 'seedLength', getSeedLength );\n\t}\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( options && options.prng ) {\n\t\tsetReadWriteAccessor( randn, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( randn, 'stateLength', null );\n\t\tsetReadOnly( randn, 'byteLength', null );\n\t\tsetReadOnly( randn, 'toJSON', constantFunction( null ) );\n\t} else {\n\t\tsetReadWriteAccessor( randn, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( randn, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( randn, 'byteLength', getStateSize );\n\t\tsetReadOnly( randn, 'toJSON', toJSON );\n\t}\n\tsetReadOnly( randn, 'PRNG', randu );\n\n\treturn randn;\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\treturn randi.seed;\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 randi.seedLength;\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 randi.stateLength;\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 randi.byteLength;\n\t}\n\n\t/**\n\t* Returns the current PRNG state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn randi.state;\n\t}\n\n\t/**\n\t* Sets the PRNG state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trandi.state = s;\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 = randn.NAME;\n\t\tout.state = typedarray2json( randi.state );\n\t\tout.params = [];\n\t\treturn out;\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' );\n\n\n// MAIN //\n\n/**\n* Generates a standard normally distributed random number.\n*\n* ## Method\n*\n* The basic Ziggurat method works as follows:\n*\n* ```tex\n* x_{C-1}(r) \\left[ f(0) - f\\left( x_{C-1}(r) \\right) \\right] - V(r) = 0\n* ```\n*\n* where\n*\n* ```tex\n* V(r) = r \\; f(r) + \\int_r^\\infty \\; f(x) \\; dx\n* ```\n*\n* and \\\\( r \\\\) denotes the right-most \\\\( x_1 \\\\).\n*\n* - We then use the following rejection algorithm:\n*\n* - Draw a box \\\\( B_i \\\\) at random with probability \\\\( \\tfrac{1}{C} \\\\).\n* - Draw a random number from the box as \\\\( z = U_0 x_i \\\\) for \\\\( i > 0 \\\\) and \\\\( z = U_0 V / f(x_1) \\\\).\n* - If \\\\( z < x_{i+1} \\\\), accept \\\\( z \\\\).\n* - If \\\\( i = 0 \\\\), accept a \\\\( v \\\\) by transforming the tail of the normal distribution to the unit interval and then use rejection technique by Marsaglia, G. (1964) to generate a standard normal variable. Otherwise, if \\\\( i > 0 \\\\) and \\\\( U_1 \\left[ f(x_i) - f(x_{i+1})\\right] < f(z) - f(x_{i+1}) \\\\) accept \\\\( z \\\\).\n* - Go back to the first step.\n*\n* - The improved version by Doornik (2005) changes step four in order to correct a deficiency of the original Ziggurat algorithm. The updated version requires the generation of two random numbers, a uniform variable drawn from \\\\( U(-1,1) \\\\) and the last seven bits of a random integer.\n*\n* ## References\n*\n* - Doornik, Jurgen A. 2005. \"An Improved Ziggurat Method to Generate Normal Random Samples.\" .\n* - Marsaglia, George, and Wai Wan Tsang. 2000. \"The Ziggurat Method for Generating Random Variables.\" _Journal of Statistical Software_ 5 (1): 1\u20137. doi:[10.18637/jss.v005.i08](http://dx.doi.org/10.18637/jss.v005.i08).\n* - Marsaglia, George. 1964. \"Generating a Variable from the Tail of the Normal Distribution.\" _Technometrics_ 6 (1): 101\u20132. doi:[10.1080/00401706.1964.10490150](http://dx.doi.org/10.1080/00401706.1964.10490150).\n*\n* @name randn\n* @type {PRNG}\n* @returns {number} pseudorandom number\n*\n* @example\n* var r = randn();\n* // returns \n*/\nvar randn = factory();\n\n\n// EXPORTS //\n\nmodule.exports = randn;\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* Normally distributed pseudorandom numbers using the improved Ziggurat method.\n*\n* @module @stdlib/random/base/improved-ziggurat\n*\n* @example\n* var randn = require( '@stdlib/random/base/improved-ziggurat' );\n*\n* var r = randn();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/improved-ziggurat' ).factory;\n*\n* var randn = factory({\n* 'seed': 12345\n* });\n*\n* var r = randn();\n* // returns \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", "/**\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 isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( alpha, beta ) {\n\tif ( !isPositive( alpha ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositive( beta ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 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 ln = require( '@stdlib/math/base/special/ln' );\nvar sqrt = require( '@stdlib/math/base/special/sqrt' );\nvar pow = require( '@stdlib/math/base/special/pow' );\n\n\n// VARIABLES //\n\nvar ONE_THIRD = 1.0 / 3.0;\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a gamma distribution with rate parameter equal to 1.0 and shape parameter equal to `alpha`.\n*\n* @private\n* @param {PRNG} randu - PRNG for uniformly distributed numbers\n* @param {PRNG} randn - PRNG for standard normally distributed numbers\n* @param {PositiveNumber} alpha - shape parameter\n* @returns {PositiveNumber} pseudorandom number\n*/\nfunction standardGamma( randu, randn, alpha ) {\n\tvar flg;\n\tvar x2;\n\tvar v0;\n\tvar v1;\n\tvar c;\n\tvar d;\n\tvar x;\n\tvar s;\n\tvar u;\n\tvar v;\n\n\tif ( alpha < 1.0 ) {\n\t\td = alpha + 1.0 - ONE_THIRD;\n\t\tc = 1.0 / sqrt( 9.0*d );\n\t\ts = pow( randu(), 1.0/alpha );\n\t} else {\n\t\td = alpha - ONE_THIRD;\n\t\tc = 1.0 / sqrt( 9.0*d );\n\t\ts = 1.0;\n\t}\n\tflg = true;\n\twhile ( flg ) {\n\t\tdo {\n\t\t\tx = randn();\n\t\t\tv = 1.0 + (c*x);\n\t\t} while ( v <= 0.0 );\n\t\tv *= v * v;\n\t\tx2 = x * x;\n\t\tv0 = 1.0 - (0.331*x2*x2);\n\t\tv1 = (0.5*x2) + (d*( 1.0-v+ln(v) ));\n\t\tu = randu();\n\t\tif ( u < v0 || ln( u ) < v1 ) {\n\t\t\tflg = false;\n\t\t}\n\t}\n\treturn d * v * s;\n}\n\n\n// EXPORTS //\n\nmodule.exports = standardGamma;\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 pow = require( '@stdlib/math/base/special/pow' );\nvar ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Handles case where `alpha` and `beta` are equal and greater than `1.5`.\n*\n* @private\n* @param {PRNG} randu - PRNG for uniformly distributed numbers\n* @param {PRNG} randn - PRNG for normally distributed numbers\n* @param {PositiveNumber} alpha - first shape parameter\n* @returns {Probability} pseudorandom number\n*/\nfunction sample( randu, randn, alpha ) {\n\tvar flg;\n\tvar s4;\n\tvar A;\n\tvar s;\n\tvar t;\n\tvar u;\n\tvar x;\n\tvar y;\n\n\tA = alpha - 1.0;\n\tt = pow( A+A, 0.5 );\n\n\tflg = true;\n\twhile ( flg === true ) {\n\t\ts = randn();\n\t\tx = 0.5 * ( 1.0+(s/t) );\n\t\tif ( x >= 0.0 && x <= 1.0 ) {\n\t\t\tu = randu();\n\t\t\ts4 = pow( s, 4.0 );\n\t\t\ty = (8.0*alpha) - 12.0;\n\t\t\ty = 1.0 - (s4 / y);\n\t\t\tif ( u <= y ) {\n\t\t\t\tflg = false;\n\t\t\t} else {\n\t\t\t\ty += 0.5 * pow( s4/((8.0*alpha)-8.0), 2.0 );\n\t\t\t\tif ( u < y ) {\n\t\t\t\t\ty = A * ln( 4.0*x*(1.0-x) );\n\t\t\t\t\ty += s*s / 2.0;\n\t\t\t\t\tif ( y >= ln( u ) ) {\n\t\t\t\t\t\tflg = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sample;\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 pow = require( '@stdlib/math/base/special/pow' );\nvar ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Handles case where both `alpha` and `beta` are greater than `1.0`.\n*\n* @private\n* @param {PRNG} randu - PRNG for uniformly distributed numbers\n* @param {PRNG} randn - PRNG for normally distributed numbers\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @returns {Probability} pseudorandom number\n*/\nfunction sample( randu, randn, alpha, beta ) {\n\tvar sigma;\n\tvar flg;\n\tvar mu;\n\tvar A;\n\tvar B;\n\tvar C;\n\tvar L;\n\tvar s;\n\tvar u;\n\tvar x;\n\tvar y;\n\n\tA = alpha - 1.0;\n\tB = beta - 1.0;\n\tC = A + B;\n\tL = C * ln( C );\n\tmu = A / C;\n\tsigma = 0.5 / pow( C, 0.5 );\n\n\tflg = true;\n\twhile ( flg === true ) {\n\t\ts = randn();\n\t\tx = mu + (s*sigma);\n\t\tif ( x >= 0.0 && x <= 1.0 ) {\n\t\t\tu = randu();\n\t\t\ty = A * ln( x/A );\n\t\t\ty += B * ln((1.0-x) / B);\n\t\t\ty += L + (0.5*s*s);\n\t\t\tif ( y >= ln( u ) ) {\n\t\t\t\tflg = false;\n\t\t\t}\n\t\t}\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sample;\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 exp = require( '@stdlib/math/base/special/exp' );\nvar pow = require( '@stdlib/math/base/special/pow' );\nvar ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Handles general case.\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @returns {Probability} pseudorandom number\n*/\nfunction sample( rand, alpha, beta ) {\n\tvar lx;\n\tvar ly;\n\tvar xy;\n\tvar u;\n\tvar v;\n\tvar x;\n\tvar y;\n\twhile ( true ) {\n\t\tu = rand();\n\t\tv = rand();\n\t\tx = pow( u, 1.0/alpha );\n\t\ty = pow( v, 1.0/beta );\n\t\txy = x + y;\n\t\tif ( xy <= 1.0 ) {\n\t\t\tif ( xy > 0.0 ) {\n\t\t\t\treturn x / ( xy );\n\t\t\t}\n\t\t\tlx = ln( u ) / alpha;\n\t\t\tly = ln( v ) / beta;\n\t\t\tif ( lx > ly ) {\n\t\t\t\tly -= lx;\n\t\t\t\tlx = 0.0;\n\t\t\t} else {\n\t\t\t\tlx -= ly;\n\t\t\t\tly = 0.0;\n\t\t\t}\n\t\t\treturn exp( lx - ln( exp(lx) + exp(ly) ) );\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = sample;\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 standardGamma = require( './standard_gamma.js' );\nvar sample1 = require( './sample1.js' );\nvar sample2 = require( './sample2.js' );\nvar sample3 = require( './sample3.js' );\n\n\n// MAIN //\n\n/**\n* Returns a random number drawn from a beta distribution.\n*\n* @private\n* @param {PRNG} randu - pseudorandom number generator for uniformly distributed numbers\n* @param {PRNG} randn - pseudorandom number generator for normally distributed numbers\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @returns {Probability} pseudorandom number\n*/\nfunction sample( randu, randn, alpha, beta ) {\n\tvar ga;\n\tvar gb;\n\tif ( alpha === beta && alpha > 1.5 ) {\n\t\treturn sample1( randu, randn, alpha );\n\t}\n\tif ( alpha > 1.0 && beta > 1.0 ) {\n\t\treturn sample2( randu, randn, alpha, beta );\n\t}\n\tif ( alpha < 1.0 && beta < 1.0 ) {\n\t\treturn sample3( randu, alpha, beta );\n\t}\n\t// General case of using two gamma random variates:\n\tga = standardGamma( randu, randn, alpha );\n\tgb = standardGamma( randu, randn, beta );\n\treturn ga / ( ga + gb );\n}\n\n\n// EXPORTS //\n\nmodule.exports = sample;\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 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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randn = require( './../../../base/improved-ziggurat' ).factory;\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar gcopy = require( '@stdlib/blas/base/gcopy' );\nvar Uint32Array = require( '@stdlib/array/uint32' );\nvar isUint32Array = require( '@stdlib/assert/is-uint32array' );\nvar assign = require( '@stdlib/object/assign' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar beta0 = require( './beta.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating beta distributed random numbers.\n*\n* @param {PositiveNumber} [alpha] - first shape parameter\n* @param {PositiveNumber} [beta] - second shape parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var beta = factory( 2.0, 1.0 );\n* var v = beta();\n* // returns \n*\n* @example\n* var beta = factory( 2.0, 2.0, {\n* 'seed': 297\n* });\n* var v = beta();\n* // returns \n*/\nfunction factory() {\n\tvar STATE;\n\tvar rnorm;\n\tvar alpha;\n\tvar beta;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar FLG;\n\tvar err;\n\n\tFLG = true;\n\tif ( arguments.length === 0 ) {\n\t\topts = {\n\t\t\t'copy': false\n\t\t};\n\t\trand = randu( opts );\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'copy' ) && !isBoolean( opts.copy ) ) {\n\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', opts.copy ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\tif ( hasOwnProp( opts, 'state' ) && !isUint32Array( opts.state ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a Uint32Array. Option: `%s`.', 'state', opts.state ) );\n\t\t\t}\n\t\t\topts = assign( {}, opts );\n\t\t\tif ( opts.copy === false ) {\n\t\t\t\tFLG = false;\n\t\t\t} else if ( opts.state ) {\n\t\t\t\topts.state = gcopy( opts.state.length, opts.state, 1, new Uint32Array( opts.state.length ), 1 ); // eslint-disable-line max-len\n\t\t\t}\n\t\t\topts.copy = false;\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\talpha = arguments[ 0 ];\n\t\tbeta = arguments[ 1 ];\n\t\terr = validate( alpha, beta );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'copy' ) && !isBoolean( opts.copy ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', opts.copy ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\tif ( hasOwnProp( opts, 'state' ) && !isUint32Array( opts.state ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a Uint32Array. Option: `%s`.', 'state', opts.state ) );\n\t\t\t\t}\n\t\t\t\topts = assign( {}, opts );\n\t\t\t\tif ( opts.copy === false ) {\n\t\t\t\t\tFLG = false;\n\t\t\t\t} else if ( opts.state ) {\n\t\t\t\t\topts.state = gcopy( opts.state.length, opts.state, 1, new Uint32Array( opts.state.length ), 1 ); // eslint-disable-line max-len\n\t\t\t\t}\n\t\t\t\topts.copy = false;\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\topts = {\n\t\t\t\t'copy': false\n\t\t\t};\n\t\t\trand = randu( opts );\n\t\t}\n\t}\n\tif ( opts && opts.prng ) {\n\t\trnorm = randn({\n\t\t\t'prng': opts.prng\n\t\t});\n\t} else {\n\t\tif ( opts.state ) {\n\t\t\tSTATE = opts.state;\n\t\t} else {\n\t\t\tSTATE = rand.state;\n\t\t\trand.state = STATE; // updates the underlying PRNG to point to a shared state\n\t\t}\n\t\trnorm = randn({\n\t\t\t'state': STATE,\n\t\t\t'copy': false\n\t\t});\n\t}\n\tif ( alpha === void 0 ) {\n\t\tprng = beta2;\n\t} else {\n\t\tprng = beta1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'beta' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\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\tif ( !isUint32Array( s ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a Uint32Array. Value: `%s`.', s ) );\n\t\t}\n\t\tif ( FLG ) {\n\t\t\ts = gcopy( s.length, s, 1, new Uint32Array( s.length ), 1 );\n\t\t}\n\t\trand.state = s;\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 = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( alpha === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ alpha, beta ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a random number drawn from a beta distribution with bound parameter values.\n\t*\n\t* @private\n\t* @returns {Probability} pseudorandom number\n\t*\n\t* @example\n\t* var v = beta1();\n\t* // returns \n\t*/\n\tfunction beta1() {\n\t\treturn beta0( rand, rnorm, alpha, beta );\n\t}\n\n\t/**\n\t* Returns a random number drawn from a beta distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} alpha - first shape parameter\n\t* @param {PositiveNumber} beta - second shape parameter\n\t* @returns {Probability} pseudorandom number\n\t*\n\t* @example\n\t* var v = beta2( 2.0, 3.0 );\n\t* // returns \n\t*/\n\tfunction beta2( alpha, beta ) {\n\t\tif (\n\t\t\tisnan( alpha ) ||\n\t\t\tisnan( beta ) ||\n\t\t\talpha <= 0.0 ||\n\t\t\tbeta <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn beta0( rand, rnorm, alpha, beta );\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' );\n\n\n// MAIN //\n\n/**\n* Generates a beta distributed random number.\n*\n* ## References\n*\n* - Ahrens, J.H., and U. Dieter. 1974. \"Computer methods for sampling from gamma, beta, poisson and bionomial distributions.\" _Computing_ 12 (3): 223\u201346. doi:[10.1007/BF02293108](http://dx.doi.org/10.1007/BF02293108).\n* - J\u00F6hnk, M.D. 1964. \"Erzeugung von Betaverteilten Und Gammaverteilten Zufallszahlen.\" _Metrika_ 8: 5\u201315. .\n*\n* @name beta\n* @type {PRNG}\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @returns {Probability} pseudorandom number\n*\n* @example\n* var r = beta( 2.0, 5.0 );\n* // returns \n*\n* @example\n* var r = beta( -2.0, 5.0 );\n* // returns NaN\n*/\nvar beta = factory();\n\n\n// EXPORTS //\n\nmodule.exports = beta;\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* Beta distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/beta\n*\n* @example\n* var beta = require( '@stdlib/random/base/beta' );\n*\n* var v = beta( 2.0, 3.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/beta' ).factory;\n*\n* var beta = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = beta();\n* // returns \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", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 binaryFactory = require( './../../../array/tools/binary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/beta' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a beta distribution.\n*\n* @name factory\n* @type {Function}\n* @param {PositiveNumber} [alpha] - first shape parameter\n* @param {PositiveNumber} [beta] - second shape parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var beta = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = beta( 10 );\n* // returns \n*\n* @example\n* var beta = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = beta( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = binaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a beta distribution.\n*\n* @name beta\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = beta( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = beta( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar beta = factory();\n\n\n// EXPORTS //\n\nmodule.exports = beta;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create an array containing pseudorandom numbers drawn from a beta distribution.\n*\n* @module @stdlib/random/array/beta\n*\n* @example\n* var beta = require( '@stdlib/random/array/beta' );\n*\n* var arr = beta( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var beta = require( '@stdlib/random/array/beta' );\n*\n* var arr = beta( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var beta = require( '@stdlib/random/array/beta' );\n*\n* var rand = beta.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var beta = require( '@stdlib/random/array/beta' );\n*\n* var rand = beta.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\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 isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - rate parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( alpha, beta ) {\n\tif ( !isPositive( alpha ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositive( beta ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a gamma distribution.\n*\n* @private\n* @param {PRNG} randu - PRNG for uniformly distributed numbers\n* @param {PRNG} randn - PRNG for standard normally distributed numbers\n* @param {PositiveNumber} beta - rate parameter\n* @param {PositiveNumber} d - `alpha + 2/3` or `alpha - 1/3`\n* @param {PositiveNumber} c - `1.0 / sqrt( 9.0*d )`\n* @returns {PositiveNumber} pseudorandom number\n*/\nfunction gamma( randu, randn, beta, d, c ) {\n\tvar flg;\n\tvar x2;\n\tvar v0;\n\tvar v1;\n\tvar x;\n\tvar u;\n\tvar v;\n\n\tflg = true;\n\twhile ( flg ) {\n\t\tdo {\n\t\t\tx = randn();\n\t\t\tv = 1.0 + (c*x);\n\t\t} while ( v <= 0.0 );\n\t\tv *= v * v;\n\t\tx2 = x * x;\n\t\tv0 = 1.0 - (0.331*x2*x2);\n\t\tv1 = (0.5*x2) + (d*( 1.0-v+ln(v) ));\n\t\tu = randu();\n\t\tif ( u < v0 || ln( u ) < v1 ) {\n\t\t\tflg = false;\n\t\t}\n\t}\n\treturn (1.0/beta) * d * v;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gamma;\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 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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar isUint32Array = require( '@stdlib/assert/is-uint32array' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randn = require( './../../../base/improved-ziggurat' ).factory;\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar sqrt = require( '@stdlib/math/base/special/sqrt' );\nvar pow = require( '@stdlib/math/base/special/pow' );\nvar gcopy = require( '@stdlib/blas/base/gcopy' );\nvar Uint32Array = require( '@stdlib/array/uint32' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar gamma0 = require( './gamma.js' );\n\n\n// VARIABLES //\n\nvar ONE_THIRD = 1.0 / 3.0;\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating gamma distributed random numbers.\n*\n* @param {PositiveNumber} [alpha] - shape parameter\n* @param {PositiveNumber} [beta] - rate parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var gamma = factory( 2.0, 1.0 );\n* var v = gamma();\n* // returns \n*\n* @example\n* var gamma = factory( 2.0, 2.0, {\n* 'seed': 297\n* });\n* var v = gamma();\n* // returns \n*/\nfunction factory() {\n\tvar STATE;\n\tvar alpha;\n\tvar rnorm;\n\tvar beta;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar FLG;\n\tvar err;\n\tvar c;\n\tvar d;\n\n\tFLG = true;\n\tif ( arguments.length === 0 ) {\n\t\topts = {\n\t\t\t'copy': false\n\t\t};\n\t\trand = randu( opts );\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'copy' ) && !isBoolean( opts.copy ) ) {\n\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', opts.copy ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\tif ( hasOwnProp( opts, 'state' ) && !isUint32Array( opts.state ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a Uint32Array. Option: `%s`.', 'state', opts.state ) );\n\t\t\t}\n\t\t\topts = assign( {}, opts );\n\t\t\tif ( opts.copy === false ) {\n\t\t\t\tFLG = false;\n\t\t\t} else if ( opts.state ) {\n\t\t\t\topts.state = gcopy( opts.state.length, opts.state, 1, new Uint32Array( opts.state.length ), 1 ); // eslint-disable-line max-len\n\t\t\t}\n\t\t\topts.copy = false;\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\talpha = arguments[ 0 ];\n\t\tbeta = arguments[ 1 ];\n\t\terr = validate( alpha, beta );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'copy' ) && !isBoolean( opts.copy ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', opts.copy ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\tif ( hasOwnProp( opts, 'state' ) && !isUint32Array( opts.state ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a Uint32Array. Option: `%s`.', 'state', opts.state ) );\n\t\t\t\t}\n\t\t\t\topts = assign( {}, opts );\n\t\t\t\tif ( opts.copy === false ) {\n\t\t\t\t\tFLG = false;\n\t\t\t\t} else if ( opts.state ) {\n\t\t\t\t\topts.state = gcopy( opts.state.length, opts.state, 1, new Uint32Array( opts.state.length ), 1 ); // eslint-disable-line max-len\n\t\t\t\t}\n\t\t\t\topts.copy = false;\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\topts = {\n\t\t\t\t'copy': false\n\t\t\t};\n\t\t\trand = randu( opts );\n\t\t}\n\t}\n\tif ( opts && opts.prng ) {\n\t\trnorm = randn({\n\t\t\t'prng': opts.prng\n\t\t});\n\t} else {\n\t\tif ( opts.state ) {\n\t\t\tSTATE = opts.state;\n\t\t} else {\n\t\t\tSTATE = rand.state;\n\t\t\trand.state = STATE; // updates the underlying PRNG to point to a shared state\n\t\t}\n\t\trnorm = randn({\n\t\t\t'state': STATE,\n\t\t\t'copy': false\n\t\t});\n\t}\n\tif ( alpha === void 0 ) {\n\t\tprng = gamma2;\n\t} else {\n\t\tif ( alpha >= 1.0 ) {\n\t\t\tprng = gamma1a;\n\t\t\td = alpha - ONE_THIRD;\n\t\t} else {\n\t\t\tprng = gamma1b;\n\t\t\td = alpha + 1.0 - ONE_THIRD;\n\t\t}\n\t\tc = 1.0 / sqrt( 9.0*d );\n\t}\n\tsetReadOnly( prng, 'NAME', 'gamma' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\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\tif ( !isUint32Array( s ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a Uint32Array. Value: `%s`.', s ) );\n\t\t}\n\t\tif ( FLG ) {\n\t\t\ts = gcopy( s.length, s, 1, new Uint32Array( s.length ), 1 );\n\t\t}\n\t\trand.state = s;\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 = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( alpha === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ alpha, beta ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a gamma distribution with bound parameters when `alpha >= 1`.\n\t*\n\t* @private\n\t* @returns {PositiveNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = gamma1a();\n\t* // returns \n\t*/\n\tfunction gamma1a() {\n\t\treturn gamma0( rand, rnorm, beta, d, c );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a gamma distribution with bound parameters when `alpha < 1`.\n\t*\n\t* @private\n\t* @returns {PositiveNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = gamma1b();\n\t* // returns \n\t*/\n\tfunction gamma1b() {\n\t\treturn gamma0( rand, rnorm, beta, d, c ) * pow( rand(), 1.0/alpha );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a gamma distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} alpha - shape parameter\n\t* @param {PositiveNumber} beta - rate parameter\n\t* @returns {PositiveNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = gamma2( 2.0, 4.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = gamma2( 3.0, 0.0 );\n\t* // returns NaN\n\t*\n\t* @example\n\t* var v = gamma2( 0.0, 2.0 );\n\t* // returns NaN\n\t*\n\t* @example\n\t* var v = gamma2( NaN, NaN );\n\t* // returns NaN\n\t*/\n\tfunction gamma2( alpha, beta ) {\n\t\tvar c;\n\t\tvar d;\n\t\tif (\n\t\t\tisnan( alpha ) ||\n\t\t\tisnan( beta ) ||\n\t\t\talpha <= 0.0 ||\n\t\t\tbeta <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\tif ( alpha < 1.0 ) {\n\t\t\td = alpha + 1.0 - ONE_THIRD;\n\t\t\tc = 1.0 / sqrt( 9.0*d );\n\t\t\treturn gamma0( rand, rnorm, beta, d, c ) * pow( rand(), 1.0/alpha );\n\t\t}\n\t\td = alpha - ONE_THIRD;\n\t\tc = 1.0 / sqrt( 9.0*d );\n\t\treturn gamma0( rand, rnorm, beta, d, c );\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' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a gamma distribution.\n*\n* ## References\n*\n* - Marsaglia, George, and Wai Wan Tsang. 2000. \"A Simple Method for Generating Gamma Variables.\" _ACM Transactions on Mathematical Software_ 26 (3). New York, NY, USA: ACM: 363\u201372. doi:[10.1145/358407.358414](http://dx.doi.org/10.1145/358407.358414).\n*\n* @name gamma\n* @type {PRNG}\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - rate parameter\n* @returns {PositiveNumber} pseudorandom number\n*\n* @example\n* var v = gamma( 2.0, 4.0 );\n* // returns \n*\n* @example\n* var v = gamma( -2.0, 4.0 );\n* // returns NaN\n*/\nvar gamma = factory();\n\n\n// EXPORTS //\n\nmodule.exports = gamma;\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* Gamma distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/gamma\n*\n* @example\n* var gamma = require( '@stdlib/random/base/gamma' );\n*\n* var v = gamma( 2.0, 3.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/gamma' ).factory;\n*\n* var gamma = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = gamma();\n* // returns \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", "/**\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 isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( alpha, beta ) {\n\tif ( !isPositive( alpha ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositive( beta ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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// MAIN //\n\n/**\n* Returns a random number drawn from a beta prime distribution.\n*\n* @private\n* @param {PRNG} rgamma - pseudorandom number generator for gamma distributed numbers\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @returns {PositiveNumber} pseudorandom number\n*/\nfunction sample( rgamma, alpha, beta ) {\n\treturn rgamma( alpha, 1.0 ) / rgamma( beta, 1.0 );\n}\n\n\n// EXPORTS //\n\nmodule.exports = sample;\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 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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar gammaFactory = require( './../../../base/gamma' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar betaprime0 = require( './betaprime.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating beta prime distributed random numbers.\n*\n* @param {PositiveNumber} [alpha] - first shape parameter\n* @param {PositiveNumber} [beta] - second shape parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var betaprime = factory( 2.0, 1.0 );\n* var v = betaprime();\n* // returns \n*\n* @example\n* var betaprime = factory( 2.0, 2.0, {\n* 'seed': 297\n* });\n* var v = betaprime();\n* // returns \n*/\nfunction factory() {\n\tvar rgamma;\n\tvar alpha;\n\tvar beta;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\n\tif ( arguments.length === 0 ) {\n\t\trgamma = gammaFactory();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\trgamma = gammaFactory( opts );\n\t} else {\n\t\talpha = arguments[ 0 ];\n\t\tbeta = arguments[ 1 ];\n\t\terr = validate( alpha, beta );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\trgamma = gammaFactory( opts );\n\t\t} else {\n\t\t\trgamma = gammaFactory();\n\t\t}\n\t}\n\tif ( alpha === void 0 ) {\n\t\tprng = betaprime2;\n\t} else {\n\t\tprng = betaprime1;\n\t}\n\trand = rgamma.PRNG;\n\n\tsetReadOnly( prng, 'NAME', 'betaprime' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t}\n\tsetReadOnly( prng, 'PRNG', rand );\n\treturn prng;\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\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 = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( alpha === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ alpha, beta ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a random number drawn from a beta prime distribution with bound parameter values.\n\t*\n\t* @private\n\t* @returns {PositiveNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = betaprime1();\n\t* // returns \n\t*/\n\tfunction betaprime1() {\n\t\treturn betaprime0( rgamma, alpha, beta );\n\t}\n\n\t/**\n\t* Returns a random number drawn from a beta prime distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} alpha - first shape parameter\n\t* @param {PositiveNumber} beta - second shape parameter\n\t* @returns {PositiveNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = betaprime2( 2.0, 3.0 );\n\t* // returns \n\t*/\n\tfunction betaprime2( alpha, beta ) {\n\t\tif (\n\t\t\tisnan( alpha ) ||\n\t\t\tisnan( beta ) ||\n\t\t\talpha <= 0.0 ||\n\t\t\tbeta <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn betaprime0( rgamma, alpha, beta );\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' );\n\n\n// MAIN //\n\n/**\n* Generates a beta prime distributed random number.\n*\n* @name betaprime\n* @type {PRNG}\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @returns {PositiveNumber} pseudorandom number\n*\n* @example\n* var r = betaprime( 2.0, 5.0 );\n* // returns \n*\n* @example\n* var r = betaprime( -2.0, 5.0 );\n* // returns NaN\n*/\nvar betaprime = factory();\n\n\n// EXPORTS //\n\nmodule.exports = betaprime;\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* Beta prime distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/betaprime\n*\n* @example\n* var betaprime = require( '@stdlib/random/base/betaprime' );\n*\n* var v = betaprime( 2.0, 3.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/betaprime' ).factory;\n*\n* var betaprime = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = betaprime();\n* // returns \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", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 binaryFactory = require( './../../../array/tools/binary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/betaprime' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a beta prime distribution.\n*\n* @name factory\n* @type {Function}\n* @param {PositiveNumber} [alpha] - first shape parameter\n* @param {PositiveNumber} [beta] - second shape parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var betaprime = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = betaprime( 10 );\n* // returns \n*\n* @example\n* var betaprime = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = betaprime( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = binaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a beta prime distribution.\n*\n* @name betaprime\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = betaprime( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = betaprime( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar betaprime = factory();\n\n\n// EXPORTS //\n\nmodule.exports = betaprime;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create an array containing pseudorandom numbers drawn from a beta prime distribution.\n*\n* @module @stdlib/random/array/betaprime\n*\n* @example\n* var betaprime = require( '@stdlib/random/array/betaprime' );\n*\n* var arr = betaprime( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var betaprime = require( '@stdlib/random/array/betaprime' );\n*\n* var arr = betaprime( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var betaprime = require( '@stdlib/random/array/betaprime' );\n*\n* var rand = betaprime.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var betaprime = require( '@stdlib/random/array/betaprime' );\n*\n* var rand = betaprime.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\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 isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isProbability = require( '@stdlib/assert/is-probability' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {PositiveInteger} n - number of trials\n* @param {Probability} p - success probability\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 10, 0.5 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( n, p ) {\n\tif ( !isPositiveInteger( n ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a positive integer. Value: `%s`.', p ) );\n\t}\n\tif ( !isProbability( p ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a probability. Value: `%s`.', p ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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* Generates a binomially distributed pseudorandom number by computing the sum of Bernoulli random variables.\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {PositiveInteger} n - number of trials\n* @param {Probability} p - success probability\n* @returns {NonNegativeInteger} pseudorandom number\n*/\nfunction sample( rand, n, p ) {\n\tvar sum = 0;\n\tvar i;\n\tfor ( i = 0; i < n; i++ ) {\n\t\tif ( rand() <= p ) {\n\t\t\tsum += 1;\n\t\t}\n\t}\n\treturn sum;\n}\n\n\n// EXPORTS //\n\nmodule.exports = sample;\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 pow = require( '@stdlib/math/base/special/pow' );\n\n\n// VARIABLES //\n\nvar ONE_12 = 1.0 / 12.0;\nvar ONE_360 = 1.0 / 360.0;\nvar ONE_1260 = 1.0 / 1260.0;\n\n\n// MAIN //\n\n/**\n* Returns a correction for Stirling's approximation.\n*\n* @private\n* @param {NonNegativeInteger} k - input argument\n* @returns {number} correction term\n*\n* @example\n* var c = correction( 0 );\n* // returns 0.08106146679532726\n*/\nfunction correction( k ) {\n\tvar v;\n\tswitch ( k ) {\n\tcase 0:\n\t\treturn 0.08106146679532726;\n\tcase 1:\n\t\treturn 0.04134069595540929;\n\tcase 2:\n\t\treturn 0.02767792568499834;\n\tcase 3:\n\t\treturn 0.02079067210376509;\n\tcase 4:\n\t\treturn 0.01664469118982119;\n\tcase 5:\n\t\treturn 0.01387612882307075;\n\tcase 6:\n\t\treturn 0.01189670994589177;\n\tcase 7:\n\t\treturn 0.01041126526197209;\n\tcase 8:\n\t\treturn 0.009255462182712733;\n\tcase 9:\n\t\treturn 0.008330563433362871;\n\tdefault:\n\t\tk += 1;\n\t\tv = pow( k, 2 );\n\t\treturn (ONE_12 - ((ONE_360 - (ONE_1260/v)) / v)) / k;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = correction;\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 floor = require( '@stdlib/math/base/special/floor' );\nvar sign = require( '@stdlib/math/base/special/signum' );\nvar sqrt = require( '@stdlib/math/base/special/sqrt' );\nvar abs = require( '@stdlib/math/base/special/abs' );\nvar ln = require( '@stdlib/math/base/special/ln' );\nvar correction = require( './correction.js' );\n\n\n// VARIABLES //\n\nvar ONE_SIXTH = 1.0 / 6.0;\n\n\n// MAIN //\n\n/**\n* Generates a binomially distributed pseudorandom number.\n*\n* ## References\n*\n* - H\u00F6rmann, Wolfgang. 1993. \"The generation of binomial random variates.\" _Journal of Statistical Computation and Simulation_ 46 (1-2): 101\u201310. doi:[10.1080/00949659308811496][@hormann:1993a].\n*\n* [@hormann:1993a]: http://dx.doi.org/10.1080/00949659308811496\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {PositiveInteger} n - number of trials\n* @param {Probability} p - success probability\n* @returns {NonNegativeInteger} pseudorandom number\n*/\nfunction sample( rand, n, p ) {\n\tvar alpha;\n\tvar urvr;\n\tvar snpq;\n\tvar npq;\n\tvar rho;\n\tvar tmp;\n\tvar nm;\n\tvar nr;\n\tvar us;\n\tvar km;\n\tvar nk;\n\tvar vr;\n\tvar a;\n\tvar b;\n\tvar c;\n\tvar f;\n\tvar h;\n\tvar i;\n\tvar k;\n\tvar m;\n\tvar q;\n\tvar r;\n\tvar t;\n\tvar u;\n\tvar v;\n\tvar x;\n\n\tm = floor( (n + 1) * p );\n\tnm = n - m + 1;\n\n\tq = 1.0 - p;\n\n\tr = p / q;\n\tnr = (n + 1) * r;\n\n\tnpq = n * p * q;\n\tsnpq = sqrt( npq );\n\n\tb = 1.15 + (2.53 * snpq);\n\ta = -0.0873 + (0.0248*b) + (0.01*p);\n\tc = (n*p) + 0.5;\n\n\talpha = (2.83 + (5.1/b)) * snpq;\n\n\tvr = 0.92 - (4.2/b);\n\turvr = 0.86 * vr;\n\n\th = (m + 0.5) * ln( (m+1) / (r*nm) );\n\th += correction( m ) + correction( n-m );\n\n\twhile ( true ) {\n\t\tv = rand();\n\t\tif ( v <= urvr ) {\n\t\t\tu = (v/vr) - 0.43;\n\t\t\tr = (u * ( (2.0*a / (0.5 - abs(u))) + b )) + c;\n\t\t\treturn floor( r );\n\t\t}\n\t\tif ( v >= vr ) {\n\t\t\tu = rand() - 0.5;\n\t\t} else {\n\t\t\tu = (v/vr) - 0.93;\n\t\t\tu = (sign( u ) * 0.5) - u;\n\t\t\tv = vr * rand();\n\t\t}\n\t\tus = 0.5 - abs(u);\n\t\tk = floor( (u * ( (2.0*a/us) + b )) + c );\n\t\tif ( k < 0 || k > n ) {\n\t\t\t// Try again...\n\t\t\tcontinue;\n\t\t}\n\t\tv = v * alpha / ( (a/(us*us)) + b );\n\t\tkm = abs( k - m );\n\t\tif ( km > 15 ) {\n\t\t\tv = ln( v );\n\t\t\trho = km / npq;\n\t\t\ttmp = ( (km/3) + 0.625 ) * km;\n\t\t\ttmp += ONE_SIXTH;\n\t\t\ttmp /= npq;\n\t\t\trho *= tmp + 0.5;\n\t\t\tt = -(km * km) / (2.0 * npq);\n\t\t\tif ( v < t - rho ) {\n\t\t\t\treturn k;\n\t\t\t}\n\t\t\tif ( v <= t + rho ) {\n\t\t\t\tnk = n - k + 1;\n\t\t\t\tx = h + ( (n+1)*ln( nm/nk ) );\n\t\t\t\tx += (k+0.5) * ln( nk*r/(k+1) );\n\t\t\t\tx += -(correction( k ) + correction( n-k ));\n\t\t\t\tif ( v <= x ) {\n\t\t\t\t\treturn k;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tf = 1.0;\n\t\t\tif ( m < k ) {\n\t\t\t\tfor ( i = m; i <= k; i++ ) {\n\t\t\t\t\tf *= (nr/i) - r;\n\t\t\t\t}\n\t\t\t} else if ( m > k ) {\n\t\t\t\tfor ( i = k; i <= m; i++ ) {\n\t\t\t\t\tv *= (nr/i) - r;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( v <= f ) {\n\t\t\t\treturn k;\n\t\t\t}\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = sample;\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 sample1 = require( './sample1.js' );\nvar sample2 = require( './sample2.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a binomial distribution.\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {PositiveInteger} n - number of trials\n* @param {Probability} p - probability of success\n* @returns {NonNegativeInteger} pseudorandom number\n*/\nfunction sample( rand, n, p ) {\n\tif ( p > 0.5 ) {\n\t\treturn n - sample( rand, n, 1.0-p );\n\t}\n\tif ( n*p < 10.0 ) {\n\t\treturn sample1( rand, n, p );\n\t}\n\treturn sample2( rand, n, p );\n}\n\n\n// EXPORTS //\n\nmodule.exports = sample;\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 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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isPositiveInteger = require( '@stdlib/math/base/assert/is-positive-integer' );\nvar isProbability = require( '@stdlib/math/base/assert/is-probability' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar binomial0 = require( './binomial.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating binomially distributed random numbers.\n*\n* @param {PositiveInteger} [n] - number of trials\n* @param {Probability} [p] - success probability\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} `n` must be a positive integer\n* @throws {TypeError} `p` must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var binomial = factory( 17, 0.5 );\n* var v = binomial();\n* // returns \n*\n* @example\n* var binomial = factory( 8, 0.8, {\n* 'seed': 297\n* });\n* var v = binomial();\n* // returns \n*\n* @example\n* var binomial = factory();\n* var v = binomial( 20, 0.5 );\n* // returns \n*/\nfunction factory() {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar n;\n\tvar p;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tn = arguments[ 0 ];\n\t\tp = arguments[ 1 ];\n\t\terr = validate( n, p );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( n === void 0 ) {\n\t\tprng = binomial2;\n\t}\n\telse {\n\t\tprng = binomial1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'binomial' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\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 = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( n === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ n, p ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a random number drawn from a binomial distribution with bound parameter values.\n\t*\n\t* @private\n\t* @returns {NonNegativeInteger} pseudorandom number\n\t*\n\t* @example\n\t* var r = binomial1();\n\t* // returns \n\t*/\n\tfunction binomial1() {\n\t\treturn binomial0( rand, n, p );\n\t}\n\n\t/**\n\t* Returns a random number drawn from a binomial distribution.\n\t*\n\t* @private\n\t* @param {PositiveInteger} n - number of trials\n\t* @param {Probability} p - success probability\n\t* @returns {NonNegativeInteger} pseudorandom number\n\t*\n\t* @example\n\t* var r = binomial2( 20, 0.8 );\n\t* // returns \n\t*/\n\tfunction binomial2( n, p ) {\n\t\tif (\n\t\t\tisnan( n ) ||\n\t\t\tisnan( p ) ||\n\t\t\t!isPositiveInteger( n ) ||\n\t\t\t!isProbability( p )\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn binomial0( rand, n, p );\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' );\n\n\n// MAIN //\n\n/**\n* Generates a binomially distributed random number.\n*\n* ## Method\n*\n* - For \\\\(np < 10\\\\), the function generates Bernoulli random variates and returns their sum.\n* - For \\\\(np \\geq 10\\\\), the function uses the [BTRD algorithm][@hormann:1993a].\n*\n* ## References\n*\n* - H\u00F6rmann, Wolfgang. 1993. \"The generation of binomial random variates.\" _Journal of Statistical Computation and Simulation_ 46 (1-2): 101\u201310. doi:[10.1080/00949659308811496][@hormann:1993a].\n*\n* [@hormann:1993a]: http://dx.doi.org/10.1080/00949659308811496\n*\n* @name binomial\n* @type {PRNG}\n* @param {PositiveInteger} n - number of trials\n* @param {Probability} p - success probability\n* @throws {TypeError} `n` must be a positive integer\n* @throws {TypeError} `p` must be a probability\n* @returns {NonNegativeInteger} pseudorandom number\n*\n* @example\n* var r = binomial( 20, 0.8 );\n* // returns \n*/\nvar binomial = factory();\n\n\n// EXPORTS //\n\nmodule.exports = binomial;\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* Binomial distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/binomial\n*\n* @example\n* var binomial = require( '@stdlib/random/base/binomial' );\n*\n* var v = binomial( 20, 0.4 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/binomial' ).factory;\n*\n* var binomial = factory( 90, 0.8, {\n* 'seed': 297\n* });\n*\n* var v = binomial();\n* // returns \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", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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 binaryFactory = require( './../../../array/tools/binary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/binomial' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a binomial distribution.\n*\n* @name factory\n* @type {Function}\n* @param {PositiveInteger} [n] - number of trials\n* @param {Probability} [p] - success probability\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `n` must be a positive integer\n* @throws {TypeError} `p` must be a probability (i.e., a number on the interval [0,1])\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var binomial = factory( 17, 0.5 );\n* // returns \n*\n* var arr = binomial( 10 );\n* // returns \n*\n* @example\n* var binomial = factory( 17, 0.5 );\n* // returns \n*\n* var arr = binomial( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = binaryFactory( base, DTYPES, defaults.get( 'dtypes.real' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a binomial distribution.\n*\n* @name binomial\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {PositiveInteger} n - number of trials\n* @param {Probability} p - success probability\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = binomial( 10, 17, 0.5 );\n* // returns \n*\n* @example\n* var arr = binomial( 10, 17, 0.5, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar binomial = factory();\n\n\n// EXPORTS //\n\nmodule.exports = binomial;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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* Create an array containing pseudorandom numbers drawn from a binomial distribution.\n*\n* @module @stdlib/random/array/binomial\n*\n* @example\n* var binomial = require( '@stdlib/random/array/binomial' );\n*\n* var arr = binomial( 10, 17, 0.5 );\n* // returns \n*\n* @example\n* var binomial = require( '@stdlib/random/array/binomial' );\n*\n* var arr = binomial( 10, 17, 0.5, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var binomial = require( '@stdlib/random/array/binomial' );\n*\n* var rand = binomial.factory( 17, 0.5 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var binomial = require( '@stdlib/random/array/binomial' );\n*\n* var rand = binomial.factory( 17, 0.5 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\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 isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar isnan = require( '@stdlib/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {number} x0 - location parameter\n* @param {PositiveNumber} gamma - scale parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.5 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( x0, gamma ) {\n\tif ( !isNumber( x0 ) || isnan( x0 ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', x0 ) );\n\t}\n\tif ( !isPositive( gamma ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', gamma ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 tan = require( '@stdlib/math/base/special/tan' );\nvar PI = require( '@stdlib/constants/float64/pi' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Cauchy distribution.\n*\n* @private\n* @param {PRNG} randn - PRNG for normally distributed numbers\n* @param {number} x0 - location parameter\n* @param {PositiveNumber} gamma - scale parameter\n* @returns {number} pseudorandom number\n*/\nfunction cauchy( randn, x0, gamma ) {\n\treturn x0 + ( gamma*tan( PI*( randn()-0.5 ) ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = cauchy;\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 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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar randn = require( './../../../base/improved-ziggurat' ).factory;\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar cauchy0 = require( './cauchy.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating random numbers from a Cauchy distribution.\n*\n* @param {number} [x0] - location parameter\n* @param {PositiveNumber} [gamma] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} `x0` must be a number\n* @throws {TypeError} `gamma` argument must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var cauchy = factory( 0.0, 1.0 );\n* var v = cauchy();\n* // returns \n*\n* @example\n* var cauchy = factory( -3.0, 0.5, {\n* 'seed': 297\n* });\n* var v = cauchy();\n* // returns \n*/\nfunction factory() {\n\tvar gamma;\n\tvar rnorm;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar x0;\n\n\tif ( arguments.length === 0 ) {\n\t\trnorm = randn();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trnorm = randn({\n\t\t\t\t'prng': opts.prng\n\t\t\t});\n\t\t} else {\n\t\t\trnorm = randn( opts );\n\t\t}\n\t} else {\n\t\tx0 = arguments[ 0 ];\n\t\tgamma = arguments[ 1 ];\n\t\terr = validate( x0, gamma );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trnorm = randn({\n\t\t\t\t\t'prng': opts.prng\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\trnorm = randn( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trnorm = randn();\n\t\t}\n\t}\n\tif ( x0 === void 0 ) {\n\t\tprng = cauchy2;\n\t} else {\n\t\tprng = cauchy1;\n\t}\n\trand = rnorm.PRNG;\n\n\tsetReadOnly( prng, 'NAME', 'cauchy' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t}\n\tsetReadOnly( prng, 'PRNG', rand );\n\treturn prng;\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\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 = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( x0 === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ x0, gamma ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns pseudorandom number drawn from a Cauchy distribution with bound parameters `x0` and `gamma`.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = cauchy1();\n\t* // returns \n\t*/\n\tfunction cauchy1() {\n\t\treturn cauchy0( rnorm, x0, gamma );\n\t}\n\n\t/**\n\t* Returns pseudorandom number drawn from a Cauchy distribution.\n\t*\n\t* @private\n\t* @param {number} x0 - location parameter\n\t* @param {PositiveNumber} gamma - scale parameter\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = cauchy2( 0.0, 2.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var r = cauchy2( 1.0, -1.5 );\n\t* // returns NaN\n\t*/\n\tfunction cauchy2( x0, gamma ) {\n\t\tif (\n\t\t\tisnan( x0 ) ||\n\t\t\tisnan( gamma ) ||\n\t\t\tgamma <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn cauchy0( rnorm, x0, gamma );\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' );\n\n\n// MAIN //\n\n/**\n* Returns pseudorandom number drawn from a Cauchy distribution.\n*\n* @name cauchy\n* @type {PRNG}\n* @param {number} x0 - location parameter\n* @param {PositiveNumber} gamma - scale parameter\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = cauchy( 0.0, 2.0 );\n* // returns \n*\n* @example\n* var v = cauchy( 0.0, -1.0 );\n* // returns NaN\n*/\nvar cauchy = factory();\n\n\n// EXPORTS //\n\nmodule.exports = cauchy;\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* Cauchy distribution pseudorandom numbers.\n*\n* @module @stdlib/random/base/cauchy\n*\n* @example\n* var cauchy = require( '@stdlib/random/base/cauchy' );\n*\n* var v = cauchy( 0.5, 1.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/cauchy' ).factory;\n*\n* var cauchy = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = cauchy();\n* // returns \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", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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 binaryFactory = require( './../../../array/tools/binary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/cauchy' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a Cauchy distribution.\n*\n* @name factory\n* @type {Function}\n* @param {number} [x0] - location parameter\n* @param {PositiveNumber} [gamma] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `x0` must be a number\n* @throws {TypeError} `gamma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var cauchy = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = cauchy( 10 );\n* // returns \n*\n* @example\n* var cauchy = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = cauchy( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = binaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a Cauchy distribution.\n*\n* @name cauchy\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {number} x0 - location parameter\n* @param {PositiveNumber} gamma - scale parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = cauchy( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = cauchy( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar cauchy = factory();\n\n\n// EXPORTS //\n\nmodule.exports = cauchy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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* Create an array containing pseudorandom numbers drawn from a Cauchy distribution.\n*\n* @module @stdlib/random/array/cauchy\n*\n* @example\n* var cauchy = require( '@stdlib/random/array/cauchy' );\n*\n* var arr = cauchy( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var cauchy = require( '@stdlib/random/array/cauchy' );\n*\n* var arr = cauchy( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var cauchy = require( '@stdlib/random/array/cauchy' );\n*\n* var rand = cauchy.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var cauchy = require( '@stdlib/random/array/cauchy' );\n*\n* var rand = cauchy.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\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 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 isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar gamma = require( './../../../base/gamma' ).factory;\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating chi-square distributed random numbers.\n*\n* @param {PositiveNumber} [k] - degrees of freedom\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} `k` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var chisquare = factory( 2 );\n* var v = chisquare();\n* // returns \n*\n* @example\n* var chisquare = factory( 2, {\n* 'seed': 297\n* });\n* var v = chisquare();\n* // returns \n*/\nfunction factory() {\n\tvar rgamma;\n\tvar rand;\n\tvar opts;\n\tvar prng;\n\tvar k;\n\tif ( arguments.length === 0 ) {\n\t\trgamma = gamma();\n\t} else if (\n\t\targuments.length === 1 &&\n\t\tisObject( arguments[ 0 ] )\n\t) {\n\t\topts = arguments[ 0 ];\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trgamma = gamma({\n\t\t\t\t'prng': opts.prng\n\t\t\t});\n\t\t} else {\n\t\t\trgamma = gamma( opts );\n\t\t}\n\t} else {\n\t\tk = arguments[ 0 ];\n\t\tif ( !isPositive( k ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', k ) );\n\t\t}\n\t\tif ( arguments.length > 1 ) {\n\t\t\topts = arguments[ 1 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trgamma = gamma( k/2.0, 0.5, {\n\t\t\t\t\t'prng': opts.prng\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\trgamma = gamma( k/2.0, 0.5, opts );\n\t\t\t}\n\t\t} else {\n\t\t\trgamma = gamma( k/2.0, 0.5 );\n\t\t}\n\t}\n\tif ( k === void 0 ) {\n\t\tprng = chisquare2;\n\t} else {\n\t\tprng = chisquare1;\n\t}\n\trand = rgamma.PRNG;\n\n\tsetReadOnly( prng, 'NAME', 'chisquare' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t}\n\tsetReadOnly( prng, 'PRNG', rand );\n\treturn prng;\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\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 = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( k === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ k ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a random number drawn from a chi-square distribution with bound `k`.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = chisquare1();\n\t* // returns \n\t*/\n\tfunction chisquare1() {\n\t\treturn rgamma();\n\t}\n\n\t/**\n\t* Returns a random number drawn from a chi-square distribution with degrees of freedom `k`.\n\t*\n\t* @private\n\t* @param {PositiveNumber} k - degrees of freedom\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = chisquare2( 2 );\n\t* // returns \n\t*/\n\tfunction chisquare2( k ) {\n\t\tif (\n\t\t\tisnan( k ) ||\n\t\t\tk <= 0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn rgamma( k/2.0, 0.5 );\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' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a chi-square distribution with degrees of freedom `k`.\n*\n* @function chisquare\n* @type {PRNG}\n* @param {PositiveNumber} k - degrees of freedom\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = chisquare( 2 );\n* // returns \n*\n* @example\n* var v = chisquare( 0 );\n* // returns NaN\n*\n* @example\n* var v = chisquare( NaN );\n* // returns NaN\n*/\nvar chisquare = factory();\n\n\n// EXPORTS //\n\nmodule.exports = chisquare;\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* Chi-square distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/chisquare\n*\n* @example\n* var chisquare = require( '@stdlib/random/base/chisquare' );\n*\n* var v = chisquare( 6 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/chisquare' ).factory;\n*\n* var chisquare = factory( 3, {\n* 'seed': 297\n* });\n*\n* var v = chisquare();\n* // returns \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", "/**\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 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 isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar chisquare = require( './../../../base/chisquare' ).factory;\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar sqrt = require( '@stdlib/math/base/special/sqrt' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating chi distributed random numbers.\n*\n* @param {PositiveNumber} [k] - degrees of freedom\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} `k` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var chi = factory( 2 );\n* var v = chi();\n* // returns \n*\n* @example\n* var chi = factory( 2, {\n* 'seed': 297\n* });\n* var v = chi();\n* // returns \n*/\nfunction factory() {\n\tvar rchisq;\n\tvar rand;\n\tvar opts;\n\tvar prng;\n\tvar k;\n\tif ( arguments.length === 0 ) {\n\t\trchisq = chisquare();\n\t} else if (\n\t\targuments.length === 1 &&\n\t\tisObject( arguments[ 0 ] )\n\t) {\n\t\topts = arguments[ 0 ];\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trchisq = chisquare({\n\t\t\t\t'prng': opts.prng\n\t\t\t});\n\t\t} else {\n\t\t\trchisq = chisquare( opts );\n\t\t}\n\t} else {\n\t\tk = arguments[ 0 ];\n\t\tif ( !isPositive( k ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', k ) );\n\t\t}\n\t\tif ( arguments.length > 1 ) {\n\t\t\topts = arguments[ 1 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trchisq = chisquare( k, {\n\t\t\t\t\t'prng': opts.prng\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\trchisq = chisquare( k, opts );\n\t\t\t}\n\t\t} else {\n\t\t\trchisq = chisquare( k );\n\t\t}\n\t}\n\tif ( k === void 0 ) {\n\t\tprng = chi2;\n\t} else {\n\t\tprng = chi1;\n\t}\n\trand = rchisq.PRNG;\n\n\tsetReadOnly( prng, 'NAME', 'chi' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t}\n\tsetReadOnly( prng, 'PRNG', rand );\n\treturn prng;\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\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 = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( k === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ k ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a random number drawn from a chi distribution with bound `k`.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = chi1();\n\t* // returns \n\t*/\n\tfunction chi1() {\n\t\treturn sqrt( rchisq() );\n\t}\n\n\t/**\n\t* Returns a random number drawn from a chi distribution with degrees of freedom `k`.\n\t*\n\t* @private\n\t* @param {PositiveNumber} k - degrees of freedom\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = chi2( 2 );\n\t* // returns \n\t*/\n\tfunction chi2( k ) {\n\t\tif (\n\t\t\tisnan( k ) ||\n\t\t\tk <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn sqrt( rchisq( k ) );\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' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a chi distribution with degrees of freedom `k`.\n*\n* @name chi\n* @type {PRNG}\n* @param {PositiveNumber} k - degrees of freedom\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = chi( 2 );\n* // returns \n*\n* @example\n* var v = chi( 0 );\n* // returns NaN\n*\n* @example\n* var v = chi( NaN );\n* // returns NaN\n*/\nvar chi = factory();\n\n\n// EXPORTS //\n\nmodule.exports = chi;\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* Chi distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/chi\n*\n* @example\n* var chi = require( '@stdlib/random/base/chi' );\n*\n* var v = chi( 6 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/chi' ).factory;\n*\n* var chi = factory( 3, {\n* 'seed': 297\n* });\n*\n* var v = chi();\n* // returns \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", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 unaryFactory = require( './../../../array/tools/unary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/chi' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a chi distribution.\n*\n* @name factory\n* @type {Function}\n* @param {PositiveNumber} [k] - degrees of freedom\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `k` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var chi = factory( 2.0 );\n* // returns \n*\n* var arr = chi( 10 );\n* // returns \n*\n* @example\n* var chi = factory( 2.0 );\n* // returns \n*\n* var arr = chi( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = unaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a chi distribution.\n*\n* @name chi\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {PositiveNumber} k - degrees of freedom\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = chi( 10, 2.0 );\n* // returns \n*\n* @example\n* var arr = chi( 10, 2.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar chi = factory();\n\n\n// EXPORTS //\n\nmodule.exports = chi;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create an array containing pseudorandom numbers drawn from a chi distribution.\n*\n* @module @stdlib/random/array/chi\n*\n* @example\n* var chi = require( '@stdlib/random/array/chi' );\n*\n* var arr = chi( 10, 2.0 );\n* // returns \n*\n* @example\n* var chi = require( '@stdlib/random/array/chi' );\n*\n* var arr = chi( 10, 2.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var chi = require( '@stdlib/random/array/chi' );\n*\n* var rand = chi.factory( 2.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var chi = require( '@stdlib/random/array/chi' );\n*\n* var rand = chi.factory( 2.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 unaryFactory = require( './../../../array/tools/unary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/chisquare' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a chi-square distribution.\n*\n* @name factory\n* @type {Function}\n* @param {PositiveNumber} [k] - degrees of freedom\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `k` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var chisquare = factory( 2.0 );\n* // returns \n*\n* var arr = chisquare( 10 );\n* // returns \n*\n* @example\n* var chisquare = factory( 2.0 );\n* // returns \n*\n* var arr = chisquare( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = unaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a chi-square distribution.\n*\n* @name chisquare\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {PositiveNumber} k - degrees of freedom\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = chisquare( 10, 2.0 );\n* // returns \n*\n* @example\n* var arr = chisquare( 10, 2.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar chisquare = factory();\n\n\n// EXPORTS //\n\nmodule.exports = chisquare;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create an array containing pseudorandom numbers drawn from a chi-square distribution.\n*\n* @module @stdlib/random/array/chisquare\n*\n* @example\n* var chisquare = require( '@stdlib/random/array/chisquare' );\n*\n* var arr = chisquare( 10, 2.0 );\n* // returns \n*\n* @example\n* var chisquare = require( '@stdlib/random/array/chisquare' );\n*\n* var arr = chisquare( 10, 2.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var chisquare = require( '@stdlib/random/array/chisquare' );\n*\n* var rand = chisquare.factory( 2.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var chisquare = require( '@stdlib/random/array/chisquare' );\n*\n* var rand = chisquare.factory( 2.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\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 isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar isnan = require( '@stdlib/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {number} mu - location parameter\n* @param {PositiveNumber} s - scale parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( mu, s ) {\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( s ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', s ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 quantile = require( '@stdlib/stats/base/dists/cosine/quantile' );\n\n\n// MAIN //\n\n/**\n* Returns pseudorandom number drawn from a raised cosine distribution using inverse transform sampling.\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {number} mu - mean\n* @param {PositiveNumber} s - scale parameter\n* @returns {number} pseudorandom number\n*/\nfunction sample( rand, mu, s ) {\n\treturn quantile( rand(), mu, s );\n}\n\n\n// EXPORTS //\n\nmodule.exports = sample;\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 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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar cosine0 = require( './cosine.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating random numbers from a raised cosine distribution.\n*\n* @param {number} [mu] - mean parameter\n* @param {PositiveNumber} [s] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} `mu` must be a number\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var cosine = factory( 0.0, 1.0 );\n* var v = cosine();\n* // returns \n*\n* @example\n* var cosine = factory( -3.0, 0.5, {\n* 'seed': 297\n* });\n* var v = cosine();\n* // returns \n*/\nfunction factory() {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar mu;\n\tvar s;\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tmu = arguments[ 0 ];\n\t\ts = arguments[ 1 ];\n\t\terr = validate( mu, s );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( mu === void 0 ) {\n\t\tprng = cosine2;\n\t} else {\n\t\tprng = cosine1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'cosine' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\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 = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( mu === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ mu, s ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a raised cosine distribution with bound parameters.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = cosine1();\n\t* // returns \n\t*/\n\tfunction cosine1() {\n\t\treturn cosine0( rand, mu, s );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a raised cosine distribution.\n\t*\n\t* @private\n\t* @param {number} mu - mean\n\t* @param {PositiveNumber} s - scale parameter\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = cosine2( 0.0, 2.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = cosine2( 0.0, -1.0 );\n\t* // returns NaN\n\t*/\n\tfunction cosine2( mu, s ) {\n\t\tif (\n\t\t\tisnan( mu ) ||\n\t\t\tisnan( s ) ||\n\t\t\ts <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn cosine0( rand, mu, s );\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' );\n\n\n// MAIN //\n\n/**\n* Returns pseudorandom number drawn from a raised cosine distribution.\n*\n* @name cosine\n* @type {PRNG}\n* @param {number} mu - mean\n* @param {PositiveNumber} s - scale parameter\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = cosine( 0.0, 2.0 );\n* // returns \n*\n* @example\n* var v = cosine( 0.0, -1.0 );\n* // returns NaN\n*/\nvar cosine = factory();\n\n\n// EXPORTS //\n\nmodule.exports = cosine;\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* Raised cosine distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/cosine\n*\n* @example\n* var cosine = require( '@stdlib/random/base/cosine' );\n*\n* var v = cosine( 0.5, 1.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/cosine' ).factory;\n* var cosine = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = cosine();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/cosine' ).factory;\n* var cosine = factory({\n* 'seed': 297\n* });\n*\n* var v = cosine( 3.0, 2.0 );\n* // returns \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", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 binaryFactory = require( './../../../array/tools/binary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/cosine' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a raised cosine distribution.\n*\n* @name factory\n* @type {Function}\n* @param {number} [mu] - mean\n* @param {PositiveNumber} [s] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var cosine = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = cosine( 10 );\n* // returns \n*\n* @example\n* var cosine = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = cosine( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = binaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a raised cosine distribution.\n*\n* @name cosine\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {number} mu - mean\n* @param {PositiveNumber} s - scale parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = cosine( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = cosine( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar cosine = factory();\n\n\n// EXPORTS //\n\nmodule.exports = cosine;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create an array containing pseudorandom numbers drawn from a raised cosine distribution.\n*\n* @module @stdlib/random/array/cosine\n*\n* @example\n* var cosine = require( '@stdlib/random/array/cosine' );\n*\n* var arr = cosine( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var cosine = require( '@stdlib/random/array/cosine' );\n*\n* var arr = cosine( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var cosine = require( '@stdlib/random/array/cosine' );\n*\n* var rand = cosine.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var cosine = require( '@stdlib/random/array/cosine' );\n*\n* var rand = cosine.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\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 isInteger = require( '@stdlib/assert/is-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar isnan = require( '@stdlib/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Validates values provided for minimum and maximum support.\n*\n* @private\n* @param {integer} a - minimum support\n* @param {integer} b - maximum support\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1, 20 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( a, b ) {\n\tif ( !isInteger( a ) || isnan( a ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be an integer and not NaN. Value: `%s`.', a ) );\n\t}\n\tif ( !isInteger( b ) || isnan( b ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be an integer and not NaN. Value: `%s`.', b ) );\n\t}\n\tif ( a > b ) {\n\t\treturn new RangeError( format( 'invalid argument. Minimum support must be less than or equal to maximum support. Value: `[%d, %d]`.', a, b ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 [Boost library]{http://www.boost.org/doc/libs/1_65_1/doc/html/boost/random/uniform_int_distribution.html}. The implementation has been modified for JavaScript.\n*\n* ```text\n* (C) Copyright John Maddock 2006.\n* (C) Copyright Steven Watanabe 2011.\n*\n* Use, modification and distribution are subject to the\n* Boost Software License, Version 1.0. (See accompanying file\n* LICENSE or copy at http://www.boost.org/LICENSE_1_0.txt)\n* ```\n*/\n\n'use strict';\n\n// MODULES //\n\nvar MAX_SAFE_INTEGER = require( '@stdlib/constants/float64/max-safe-integer' );\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a discrete uniform distribution with minimum support `a` and maximum support `b`.\n*\n* @private\n* @param {PRNG} rand - pseudorandom number generator which outputs integer values\n* @param {integer} a - minimum support\n* @param {integer} b - maximum support\n* @returns {integer} pseudorandom number\n*/\nfunction discreteUniform( rand, a, b ) {\n\tvar result;\n\tvar RANGE;\n\tvar range;\n\tvar limit;\n\tvar bsize;\n\tvar mult;\n\tvar MIN;\n\tvar MAX;\n\tvar inc;\n\n\trange = b - a;\n\tif ( range === 0 ) {\n\t\treturn a;\n\t}\n\tMIN = rand.MIN;\n\tMAX = rand.MAX;\n\tRANGE = MAX - MIN;\n\tif ( RANGE === range ) {\n\t\treturn ( rand()-MIN ) + a;\n\t}\n\tif ( RANGE < range ) {\n\t\tlimit = 0;\n\t\twhile ( true ) {\n\t\t\t// Avoid overflow...\n\t\t\tif ( range === MAX_SAFE_INTEGER ) { // in JavaScript, we only explicitly have doubles\n\t\t\t\tlimit = floor( range / (RANGE+1) );\n\t\t\t\tif ( range%(RANGE+1) === RANGE ) { // e.g., 5%(2+1) == 2\n\t\t\t\t\tlimit += 1;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tlimit = floor( (range+1) / (RANGE+1) );\n\t\t\t}\n\t\t\t// We consider `result` as expressed base `(RANGE+1)`:\n\t\t\tresult = 0;\n\n\t\t\t// For every power of `(RANGE+1)`, we determine a random factor:\n\t\t\tmult = 1;\n\n\t\t\t// Loop invariants: result < mult && mult <= range\n\t\t\twhile ( mult <= limit ) {\n\t\t\t\t// Note: see first and second post-conditions.\n\t\t\t\tresult += (rand() - MIN) * mult;\n\n\t\t\t\t// Equivalent to (mult * (RANGE+1)) == range+1, but avoids overflow...\n\t\t\t\tif ( mult*RANGE === range-mult+1 ) {\n\t\t\t\t\t// The destination range is an integer power of the generator's range...\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t\t// Note: see third post-condition.\n\t\t\t\tmult *= RANGE + 1;\n\t\t\t}\n\t\t\t// range/mult < RANGE+1 (no endless loop)\n\t\t\tinc = discreteUniform( rand, 0, floor( range/mult ) );\n\t\t\tif ( inc > MAX_SAFE_INTEGER/mult ) {\n\t\t\t\t// The multiplication would overflow, so reject immediately...\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tinc *= mult;\n\t\t\tresult += inc;\n\n\t\t\t// NOTE: if we were working with unsigned integers, we would need to check that `result` is NOT less than `inc`, as unsigned integers wrap on overflow. In which case, we would need to reject.\n\n\t\t\tif ( result > range ) {\n\t\t\t\t// Result is too big, so reject...\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\treturn result + a;\n\t\t}\n\t}\n\t// Case: RANGE > range\n\n\t// When determining the bucket size, avoid overflow...\n\tif ( RANGE === MAX_SAFE_INTEGER ) { // in JavaScript, we only explicitly have doubles\n\t\tbsize = floor( RANGE / (range+1) );\n\t\tif ( RANGE%(range+1) === range ) { // e.g., 5%(2+1) == 2\n\t\t\tbsize += 1;\n\t\t}\n\t} else {\n\t\tbsize = floor( (RANGE+1) / (range+1) );\n\t}\n\twhile ( true ) {\n\t\tresult = rand() - MIN;\n\t\tresult = floor( result / bsize );\n\t\tif ( result <= range ) {\n\t\t\treturn result + a;\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = discreteUniform;\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 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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randi = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isInteger = require( '@stdlib/math/base/assert/is-integer' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar discreteUniform0 = require( './discrete_uniform.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating random numbers draw from a discrete uniform distribution.\n*\n* @param {integer} [a] - minimum support\n* @param {integer} [b] - maximum support\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom integers\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} `a` must be an integer\n* @throws {TypeError} `b` must be an integer\n* @throws {RangeError} `a` must be less than or equal to `b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} provided PRNG must have a valid `MIN` property\n* @throws {TypeError} provided PRNG must have a valid `MAX` property\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var discreteUniform = factory( 1, 10 );\n* var v = discreteUniform();\n* // returns \n*\n* @example\n* var discreteUniform = factory( -30, -1, {\n* 'seed': 297\n* });\n* var v = discreteUniform();\n* // returns \n*/\nfunction factory() {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar a;\n\tvar b;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randi();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t\tif ( !isInteger( rand.MIN ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must have a `MIN` property specifying the minimum possible pseudorandom integer value.', 'prng' ) );\n\t\t\t}\n\t\t\tif ( !isInteger( rand.MAX ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must have a `MAX` property specifying the maximum possible pseudorandom integer value.', 'prng' ) );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randi( opts );\n\t\t}\n\t} else {\n\t\ta = arguments[ 0 ];\n\t\tb = arguments[ 1 ];\n\t\terr = validate( a, b );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t\tif ( !isInteger( rand.MIN ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must have a `MIN` property specifying the minimum possible pseudorandom integer value.', 'prng' ) );\n\t\t\t\t}\n\t\t\t\tif ( !isInteger( rand.MAX ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must have a `MAX` property specifying the maximum possible pseudorandom integer value.', 'prng' ) );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\trand = randi( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randi();\n\t\t}\n\t}\n\tif ( a === void 0 ) {\n\t\tprng = discreteUniform2;\n\t} else {\n\t\tprng = discreteUniform1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'discrete-uniform' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t}\n\treturn prng;\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\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 = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( a === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ a, b ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a discrete uniform distribution with minimum support `a` and maximum support `b`.\n\t*\n\t* @private\n\t* @returns {integer} pseudorandom number\n\t*\n\t* @example\n\t* var v = discreteUniform1();\n\t* // returns \n\t*/\n\tfunction discreteUniform1() {\n\t\treturn discreteUniform0( rand, a, b );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a discrete uniform distribution with minimum support `a` and maximum support `b`.\n\t*\n\t* @private\n\t* @param {integer} a - minimum support\n\t* @param {integer} b - maximum support\n\t* @returns {integer} pseudorandom number\n\t*\n\t* @example\n\t* var v = discreteUniform2( 1, 10 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = discreteUniform2( 1, 0 );\n\t* // returns NaN\n\t*/\n\tfunction discreteUniform2( a, b ) {\n\t\tif (\n\t\t\tisnan( a ) ||\n\t\t\tisnan( b ) ||\n\t\t\t!isInteger( a ) ||\n\t\t\t!isInteger( b ) ||\n\t\t\ta > b\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn discreteUniform0( rand, a, b );\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' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a discrete uniform distribution with minimum support `a` and maximum support `b`.\n*\n* ## Method\n*\n* - Let \\\\( R \\\\) be a pseudorandom generator (PRNG) which yields integers on the interval \\\\( \\[ A, B ] \\\\).\n*\n* - If \\\\( a = b \\\\), then \\\\( rv = a \\\\).\n*\n* - Let \\\\( r1 = b - a \\\\) and \\\\( r2 = B - A \\\\). If \\\\( r2 = r1 \\\\) (likely a rare occurrence), then\n*\n* ```tex\n* rv = ( R() - B ) + a\n* ```\n*\n* where, for real integer types, operation order is important in order to avoid overflow.\n*\n* - If \\\\( r2 < r1 \\\\), use rejection sampling to map random variates from \\\\( R \\\\) to a larger domain (e.g., \\\\( {0,1,2,3} \\rightarrow {0,1,2,3,4} \\\\)). For real integer types (and floating-point integer values), we must take extra care to avoid overflow. During sampling, the following conditions will hold:\n*\n* - First, consider the post-condition: \\\\( \\textrm{result} \\leq r2 \\\\), thus avoiding overflow.\n*\n* - Begin with definition of \\\\( \\textrm{limit} \\\\)\n*\n* ```tex\n* \\textrm{limit} = \\lfloor{\\frac{r2+1}{r1+1}\\rfloor\n* ```\n*\n* thus,\n*\n* ```tex\n* \\textrm{limit}\\ \\cdot (r1+1) \\leq r2+1\n* ```\n*\n* - Let \\\\( m \\\\) be a random factor where the loop condition is defined as\n*\n* ```tex\n* m \\leq \\textrm{limit}\n* ```\n*\n* - Let \\\\( \\textrm{result} \\\\) be the generator output, which is expressed base \\\\( r2+1 \\\\) and obeys the loop invariant \\\\( \\textrm{result} < m \\\\).\n*\n* - Let \\\\( rv \\\\) be a realization of the PRNG. Then,\n*\n* ```tex\n* rv-A \\leq r1\n* ```\n*\n* and, by the loop condition, \\\\( m \\leq \\textrm{limit} \\\\).\n*\n* - Therefore,\n*\n* ```tex\n* m \\cdot (rv - A + 1) \\leq r2+1\n* ```\n*\n* - Rearranging terms,\n*\n* ```tex\n* m + m \\cdot (rv - A) \\leq r2+1\n* ```\n*\n* - Since \\\\( \\textrm{result} < m \\\\),\n*\n* ```tex\n* \\textrm{result} + m \\cdot (rv - A) < r2+1\n* ```\n*\n* - Next, consider the post-condition: \\\\( \\textrm{result} < m \\cdot (r2+1) \\\\).\n*\n* - Since \\\\( \\textrm{result} < m \\\\) and \\\\( rv - A \\leq r1 \\\\),\n*\n* ```tex\n* \\textrm{result} + m \\cdot (rv - A) < m + m \\cdot (rv - A)\n* ```\n*\n* - Therefore,\n*\n* ```tex\n* \\textrm{result} + m \\cdot (rv - A) < m + m \\cdot r1\n* ```\n*\n* - Therefore,\n*\n* ```tex\n* \\textrm{result} + m \\cdot (rv - A) < m \\cdot (r1+1)\n* ```\n*\n* - Next, consider the post-condition: \\\\( m \\leq r2 \\\\).\n*\n* - According to the definition of \\\\( \\textrm{limit} \\\\) and the loop condition \\\\( m \\leq \\textrm{limit} \\\\),\n*\n* ```tex\n* m \\cdot (r1+1) \\leq r2+1\n* ```\n*\n* - If \\\\( r2 \\\\) is **not** an integer power of the generator range \\\\( r1 \\\\), i.e.,\n*\n* ```tex\n* m \\cdot (r1+1) \\neq r2+1\n* ```\n*\n* then\n*\n* ```tex\n* m \\cdot (r1+1) < r2+1\n* ```\n*\n* - Thus, \\\\( \\textrm{result} < m \\\\).\n*\n* - Next, consider the post-condition: \\\\( r2/m < r1+1 \\\\).\n*\n* - To show this is true, let us try to prove its opposite. Given the loop condition \\\\( m > \\textrm{limit} \\\\), assume\n*\n* ```tex\n* r2/m > r1+1\n* ```\n*\n* - Accordingly,\n*\n* ```tex\n* r2 \\geq m \\cdot (r1+1)\n* ```\n*\n* - Hence,\n*\n* ```tex\n* r2+1 > m \\cdot (r1+1)\n* ```\n*\n* - Using the loop condition,\n*\n* ```tex\n* r2+1 > (\\textrm{limit}+1) \\cdot (r1+1)\n* ```\n*\n* - Rearranging terms,\n*\n* ```tex\n* \\frac{r2+1}{r1+1} > \\textrm{limit} + 1\n* ```\n*\n* - Hence,\n*\n* ```tex\n* \\textrm{limit} < \\lfloor{\\frac{r2+1}{r1+1}} \\rfloor\n* ```\n*\n* - But the definition of \\\\( \\textrm{limit} \\\\) is\n*\n* ```tex\n* \\textrm{limit} = \\lfloor{\\frac{r2+1}{r1+1}}\n* ```\n*\n* - Thus, our assumption cannot be true, providing the post-condition by reductio ad absurdum.\n*\n* - Next, consider the post-condition\n*\n* ```tex\n* r2 \\leq \\frac{r2}{m} \\cdot m + (m - 1)\n* ```\n*\n* - Recall the identity\n*\n* ```tex\n* r2 = \\frac{r2}{m} \\cdot m + r2 \\mod m\n* ```\n*\n* - By the definition of the modulus\n*\n* ```tex\n* r2 \\mod m < m\n* ```\n*\n* - Therefore,\n*\n* ```tex\n* r2 < \\frac{r2}{m} \\cdot m + m\n* ```\n*\n* - Hence,\n*\n* ```tex\n* r2 \\leq \\frac{r2}{m} \\cdot m + (m - 1)\n* ```\n*\n* At this point, the maximum value \\\\( \\textrm{result} \\\\) is \\\\( m-1 \\\\). Hence, we can generate numbers that can be at least as large as \\\\( r2 \\\\), but we must be careful to avoid overflow during addition and in the sampling rejection. Anything which overflows is larger than \\\\( r2 \\\\) and can thus be rejected.\n*\n* - If \\\\( r1 > r2 \\\\), use rejection sampling to map random variates from \\\\( R \\\\) to a smaller domain (e.g., \\\\( {0,1,2,3,4} \\rightarrow {0,1,2,3} \\\\)) by defining \"buckets\" in which multiple random variates in \\\\( R \\\\) map to a single random variate in the smaller domain. We are safe in adding 1 to \\\\( r2 \\\\); however, we need to be careful to not cause overflow when adding 1 to \\\\( r1 \\\\).\n*\n* @name discreteUniform\n* @type {PRNG}\n* @param {integer} a - minimum support\n* @param {integer} b - maximum support\n* @returns {integer} pseudorandom number\n*\n* @example\n* var v = discreteUniform( 1, 10 );\n* // returns \n*/\nvar discreteUniform = factory();\n\n\n// EXPORTS //\n\nmodule.exports = discreteUniform;\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* Discrete uniform distribution pseudorandom numbers.\n*\n* @module @stdlib/random/base/discrete-uniform\n*\n* @example\n* var discreteUniform = require( '@stdlib/random/base/discrete-uniform' );\n*\n* var v = discreteUniform( 1, 10 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/discrete-uniform' ).factory;\n* var discreteUniform = factory( -5, 5, {\n* 'seed': 297\n* });\n*\n* var v = discreteUniform();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/discrete-uniform' ).factory;\n* var discreteUniform = factory({\n* 'seed': 297\n* });\n*\n* var v = discreteUniform( -5, 5 );\n* // returns \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", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 binaryFactory = require( './../../../array/tools/binary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/discrete-uniform' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a discrete uniform distribution.\n*\n* @name factory\n* @type {Function}\n* @param {integer} [a] - minimum support\n* @param {integer} [b] - maximum support\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `a` must be an integer\n* @throws {TypeError} `b` must be an integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var discreteUniform = factory( -10, 10 );\n* // returns \n*\n* var arr = discreteUniform( 10 );\n* // returns \n*\n* @example\n* var discreteUniform = factory( -10, 10 );\n* // returns \n*\n* var arr = discreteUniform( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = binaryFactory( base, DTYPES, defaults.get( 'dtypes.real' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a discrete uniform distribution.\n*\n* @name discreteUniform\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {integer} a - minimum support\n* @param {integer} b - maximum support\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = discreteUniform( 10, -10, 10 );\n* // returns \n*\n* @example\n* var arr = discreteUniform( 10, -10, 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar discreteUniform = factory();\n\n\n// EXPORTS //\n\nmodule.exports = discreteUniform;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create an array containing pseudorandom numbers drawn from a discrete uniform distribution.\n*\n* @module @stdlib/random/array/discrete-uniform\n*\n* @example\n* var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );\n*\n* var arr = discreteUniform( 10, -10, 10 );\n* // returns \n*\n* @example\n* var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );\n*\n* var arr = discreteUniform( 10, -10, 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );\n*\n* var rand = discreteUniform.factory( -10, 10 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );\n*\n* var rand = discreteUniform.factory( -10, 10 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\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 isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {PositiveInteger} k - shape parameter\n* @param {PositiveNumber} lambda - rate parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1, 2.5 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( k, lambda ) {\n\tif ( !isPositiveInteger( k ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a positive integer. Value: `%s`.', k ) );\n\t}\n\tif ( !isPositive( lambda ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', lambda ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from an Erlang distribution.\n*\n* @private\n* @param {PRNG} rand - PRNG for generating uniformly distributed numbers\n* @param {PositiveInteger} k - shape parameter\n* @param {PositiveNumber} lambda - rate parameter\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = erlang();\n* // returns \n*/\nfunction erlang( rand, k, lambda ) {\n\tvar prod;\n\tvar i;\n\tprod = 1.0;\n\tfor ( i = 0; i < k; i++ ) {\n\t\tprod *= rand();\n\t}\n\treturn -(1.0/lambda) * ln( prod );\n}\n\n\n// EXPORTS //\n\nmodule.exports = erlang;\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 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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isPositiveInteger = require( '@stdlib/math/base/assert/is-positive-integer' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar erlang0 = require( './erlang.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating Erlang distributed random numbers.\n*\n* @param {PositiveInteger} [k] - shape parameter\n* @param {PositiveNumber} [lambda] - rate parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} `k` must be a positive integer\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var erlang = factory( 2, 1.0 );\n* var v = erlang();\n* // returns \n*\n* @example\n* var erlang = factory( 2, 2.0, {\n* 'seed': 297\n* });\n* var v = erlang();\n* // returns \n*/\nfunction factory() {\n\tvar lambda;\n\tvar rand;\n\tvar opts;\n\tvar prng;\n\tvar err;\n\tvar k;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tk = arguments[ 0 ];\n\t\tlambda = arguments[ 1 ];\n\t\terr = validate( k, lambda );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( k === void 0 ) {\n\t\tprng = erlang2;\n\t} else {\n\t\tprng = erlang1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'erlang' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\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 = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( k === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ k, lambda ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from an Erlang distribution with bound parameters.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = erlang1();\n\t* // returns \n\t*/\n\tfunction erlang1() {\n\t\treturn erlang0( rand, k, lambda );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from an Erlang distribution.\n\t*\n\t* @private\n\t* @param {PositiveInteger} k - shape parameter\n\t* @param {PositiveNumber} lambda - rate parameter\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = erlang2( 2, 1.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = erlang2( NaN, 1.0 );\n\t* // returns NaN\n\t*\n\t* v = erlang2( 2, NaN );\n\t* // returns NaN\n\t*\n\t* v = erlang2( 3.14, 1.0 );\n\t* // returns NaN\n\t*\n\t* v = erlang2( 2, 0.0 );\n\t* // returns NaN\n\t*/\n\tfunction erlang2( k, lambda ) {\n\t\tif (\n\t\t\tisnan( k ) ||\n\t\t\tisnan( lambda ) ||\n\t\t\t!isPositiveInteger( k ) ||\n\t\t\tlambda <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn erlang0( rand, k, lambda );\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' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from an Erlang distribution.\n*\n* @name erlang\n* @type {PRNG}\n* @param {PositiveInteger} k - shape parameter\n* @param {PositiveNumber} lambda - rate parameter\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = erlang( 2, 1.0 );\n* // returns \n*\n* @example\n* var v = erlang( NaN, 1.0 );\n* // returns NaN\n*\n* v = erlang( 2, NaN );\n* // returns NaN\n*\n* v = erlang( 3.14, 1.0 );\n* // returns NaN\n*\n* v = erlang( 3, 0.0 );\n* // returns NaN\n*/\nvar erlang = factory();\n\n\n// EXPORTS //\n\nmodule.exports = erlang;\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* Erlang distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/erlang\n*\n* @example\n* var erlang = require( '@stdlib/random/base/erlang' );\n*\n* var v = erlang( 3, 2.5 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/erlang' ).factory;\n*\n* var erlang = factory( 8, 5.9, {\n* 'seed': 297\n* });\n*\n* var v = erlang();\n* // returns \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", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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 binaryFactory = require( './../../../array/tools/binary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/erlang' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from an Erlang distribution.\n*\n* @name factory\n* @type {Function}\n* @param {PositiveInteger} [k] - shape parameter\n* @param {PositiveNumber} [lambda] - rate parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `k` must be a positive integer\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var erlang = factory( 2, 5.0 );\n* // returns \n*\n* var arr = erlang( 10 );\n* // returns \n*\n* @example\n* var erlang = factory( 2, 5.0 );\n* // returns \n*\n* var arr = erlang( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = binaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from an Erlang distribution.\n*\n* @name erlang\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {PositiveInteger} k - shape parameter\n* @param {PositiveNumber} lambda - rate parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = erlang( 10, 2, 5.0 );\n* // returns \n*\n* @example\n* var arr = erlang( 10, 2, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar erlang = factory();\n\n\n// EXPORTS //\n\nmodule.exports = erlang;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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* Create an array containing pseudorandom numbers drawn from an Erlang distribution.\n*\n* @module @stdlib/random/array/erlang\n*\n* @example\n* var erlang = require( '@stdlib/random/array/erlang' );\n*\n* var arr = erlang( 10, 2, 5.0 );\n* // returns \n*\n* @example\n* var erlang = require( '@stdlib/random/array/erlang' );\n*\n* var arr = erlang( 10, 2, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var erlang = require( '@stdlib/random/array/erlang' );\n*\n* var rand = erlang.factory( 2, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var erlang = require( '@stdlib/random/array/erlang' );\n*\n* var rand = erlang.factory( 2, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\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 ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from an exponential distribution.\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {PositiveNumber} lambda - rate parameter\n* @returns {NonNegativeNumber} pseudorandom number\n*/\nfunction exponential( rand, lambda ) {\n\treturn -ln( 1.0 - rand() ) / lambda;\n}\n\n\n// EXPORTS //\n\nmodule.exports = exponential;\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 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 isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar exponential0 = require( './exponential.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating exponentially distributed random numbers.\n*\n* @param {PositiveNumber} [lambda] - rate parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var exponential = factory( 0.5 );\n* var v = exponential();\n* // returns \n*\n* @example\n* var exponential = factory( 0.8, {\n* 'seed': 297\n* });\n* var v = exponential();\n* // returns ~3.735\n*\n* @example\n* var exponential = factory();\n* var v = exponential( 0.5 );\n* // returns \n*/\nfunction factory() {\n\tvar lambda;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if (\n\t\targuments.length === 1 &&\n\t\tisObject( arguments[ 0 ] )\n\t) {\n\t\topts = arguments[ 0 ];\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tlambda = arguments[ 0 ];\n\t\tif ( !isPositive( lambda ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', lambda ) );\n\t\t}\n\t\tif ( arguments.length > 1 ) {\n\t\t\topts = arguments[ 1 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( lambda === void 0 ) {\n\t\tprng = exponential2;\n\t} else {\n\t\tprng = exponential1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'exponential' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\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 = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( lambda === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ lambda ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from an exponential distribution with bound parameter `lambda`.\n\t*\n\t* @private\n\t* @returns {NonNegativeNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = exponential1();\n\t* // returns \n\t*/\n\tfunction exponential1() {\n\t\treturn exponential0( rand, lambda );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from an exponential distribution with parameter `lambda`.\n\t*\n\t* @private\n\t* @param {PositiveNumber} lambda - rate parameter\n\t* @returns {NonNegativeNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = exponential2( 4.8 );\n\t* // returns \n\t*/\n\tfunction exponential2( lambda ) {\n\t\tif (\n\t\t\tisnan( lambda ) ||\n\t\t\tlambda <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn exponential0( rand, lambda );\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' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from an exponential distribution with parameter `lambda`.\n*\n* @name exponential\n* @type {PRNG}\n* @param {PositiveNumber} lambda - rate parameter\n* @returns {NonNegativeNumber} pseudorandom number\n*\n* @example\n* var v = exponential( 4.8 );\n* // returns \n*\n* @example\n* var v = exponential( 0.0 );\n* // returns NaN\n*\n* @example\n* var v = exponential( NaN );\n* // returns NaN\n*/\nvar exponential = factory();\n\n\n// EXPORTS //\n\nmodule.exports = exponential;\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* Exponentially distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/exponential\n*\n* @example\n* var exponential = require( '@stdlib/random/base/exponential' );\n*\n* var v = exponential( 4.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/exponential' ).factory;\n*\n* var exponential = factory( 4.0, {\n* 'seed': 297\n* });\n*\n* var v = exponential();\n* // returns \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", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 unaryFactory = require( './../../../array/tools/unary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/exponential' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from an exponential distribution.\n*\n* @name factory\n* @type {Function}\n* @param {PositiveNumber} [lambda] - rate parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var exponential = factory( 2.0 );\n* // returns \n*\n* var arr = exponential( 10 );\n* // returns \n*\n* @example\n* var exponential = factory( 2.0 );\n* // returns \n*\n* var arr = exponential( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = unaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from an exponential distribution.\n*\n* @name exponential\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {PositiveNumber} lambda - rate parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = exponential( 10, 2.0 );\n* // returns \n*\n* @example\n* var arr = exponential( 10, 2.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar exponential = factory();\n\n\n// EXPORTS //\n\nmodule.exports = exponential;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create an array containing pseudorandom numbers drawn from an exponential distribution.\n*\n* @module @stdlib/random/array/exponential\n*\n* @example\n* var exponential = require( '@stdlib/random/array/exponential' );\n*\n* var arr = exponential( 10, 2.0 );\n* // returns \n*\n* @example\n* var exponential = require( '@stdlib/random/array/exponential' );\n*\n* var arr = exponential( 10, 2.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var exponential = require( '@stdlib/random/array/exponential' );\n*\n* var rand = exponential.factory( 2.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var exponential = require( '@stdlib/random/array/exponential' );\n*\n* var rand = exponential.factory( 2.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\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 isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {PositiveNumber} d1 - degrees of freedom\n* @param {PositiveNumber} d2 - degrees of freedom\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( d1, d2 ) {\n\tif ( !isPositive( d1 ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', d1 ) );\n\t}\n\tif ( !isPositive( d2 ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', d2 ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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* Returns a pseudorandom number from an F distribution with parameters `d1` and `d2`.\n*\n* @private\n* @param {PRNG} rchisq - PRNG for chi-square distributed numbers\n* @param {PositiveNumber} d1 - degrees of freedom\n* @param {PositiveNumber} d2 - degrees of freedom\n* @returns {NonNegativeNumber} pseudorandom number\n*/\nfunction f( rchisq, d1, d2 ) {\n\tvar x1 = rchisq( d1 ) / d1;\n\tvar x2 = rchisq( d2 ) / d2;\n\treturn x1 / x2;\n}\n\n\n// EXPORTS //\n\nmodule.exports = f;\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 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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar chisquare = require( './../../../base/chisquare' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar f0 = require( './f.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating F distributed random numbers.\n*\n* @param {PositiveNumber} [d1] - degrees of freedom\n* @param {PositiveNumber} [d2] - degrees of freedom\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} `d1` must be a positive number\n* @throws {TypeError} `d2` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var f = factory( 1.0, 2.0 );\n* var v = f();\n* // returns \n*\n* @example\n* var f = factory( 0.5, 3.0, {\n* 'seed': 297\n* });\n* var v = f();\n* // returns \n*/\nfunction factory() {\n\tvar rchisq;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar d1;\n\tvar d2;\n\n\tif ( arguments.length === 0 ) {\n\t\trchisq = chisquare();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trchisq = chisquare({\n\t\t\t\t'prng': opts.prng\n\t\t\t});\n\t\t} else {\n\t\t\trchisq = chisquare( opts );\n\t\t}\n\t} else {\n\t\td1 = arguments[ 0 ];\n\t\td2 = arguments[ 1 ];\n\t\terr = validate( d1, d2 );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trchisq = chisquare({\n\t\t\t\t\t'prng': opts.prng\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\trchisq = chisquare( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trchisq = chisquare();\n\t\t}\n\t}\n\tif ( d1 === void 0 ) {\n\t\tprng = f2;\n\t} else {\n\t\tprng = f1;\n\t}\n\trand = rchisq.PRNG;\n\n\tsetReadOnly( prng, 'NAME', 'f' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t}\n\tsetReadOnly( prng, 'PRNG', rand );\n\treturn prng;\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\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 = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( d1 === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ d1, d2 ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number from an F distribution with bound parameters.\n\t*\n\t* @private\n\t* @returns {NonNegativeNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = f1();\n\t* // returns \n\t*/\n\tfunction f1() {\n\t\treturn f0( rchisq, d1, d2 );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number from an F distribution with parameters `d1` and `d2`.\n\t*\n\t* @private\n\t* @param {PositiveNumber} d1 - degrees of freedom\n\t* @param {PositiveNumber} d2 - degrees of freedom\n\t* @returns {NonNegativeNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = f2( 3.0, 2.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = f2( 3.0, 0.0 );\n\t* // returns NaN\n\t*\n\t* @example\n\t* var v = f2( 0.0, 2.0 );\n\t* // returns NaN\n\t*\n\t* @example\n\t* var v = f2( NaN, NaN );\n\t* // returns NaN\n\t*/\n\tfunction f2( d1, d2 ) {\n\t\tif (\n\t\t\tisnan( d1 ) ||\n\t\t\tisnan( d2 ) ||\n\t\t\td1 <= 0.0 ||\n\t\t\td2 <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn f0( rchisq, d1, d2 );\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' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number from an F distribution with parameters `d1` and `d2`.\n*\n* @name f\n* @type {PRNG}\n* @param {PositiveNumber} d1 - degrees of freedom\n* @param {PositiveNumber} d2 - degrees of freedom\n* @returns {NonNegativeNumber} pseudorandom number\n*\n* @example\n* var v = f( 3.0, 2.0 );\n* // returns \n*\n* @example\n* var r = f( -2.0, 5.0 );\n* // returns NaN\n*/\nvar f = factory();\n\n\n// EXPORTS //\n\nmodule.exports = f;\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* F distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/f\n*\n* @example\n* var f = require( '@stdlib/random/base/f' );\n*\n* var v = f( 5.0, 3.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/f' ).factory;\n*\n* var f = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = f();\n* // returns \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", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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 binaryFactory = require( './../../../array/tools/binary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/f' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from an F distribution.\n*\n* @name factory\n* @type {Function}\n* @param {PositiveNumber} [d1] - degrees of freedom\n* @param {PositiveNumber} [d2] - degrees of freedom\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `d1` must be a positive number\n* @throws {TypeError} `d2` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var f = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = f( 10 );\n* // returns \n*\n* @example\n* var f = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = f( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = binaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from an F distribution.\n*\n* @name f\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {PositiveNumber} d1 - degrees of freedom\n* @param {PositiveNumber} d2 - degrees of freedom\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = f( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = f( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar f = factory();\n\n\n// EXPORTS //\n\nmodule.exports = f;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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* Create an array containing pseudorandom numbers drawn from an F distribution.\n*\n* @module @stdlib/random/array/f\n*\n* @example\n* var f = require( '@stdlib/random/array/f' );\n*\n* var arr = f( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var f = require( '@stdlib/random/array/f' );\n*\n* var arr = f( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var f = require( '@stdlib/random/array/f' );\n*\n* var rand = f.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var f = require( '@stdlib/random/array/f' );\n*\n* var rand = f.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar contains = require( '@stdlib/array/base/assert/contains' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Array} dtypes - list of supported output data types\n* @param {Options} options - function options\n* @param {string} [options.dtype] - output array data type\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var options = {\n* 'dtype': 'float64'\n* };\n* var err = validate( opts, dtypes, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, dtypes, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'dtype' ) ) {\n\t\topts.dtype = options.dtype;\n\t\tif ( !contains( dtypes, opts.dtype ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', dtypes.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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/* eslint-disable no-restricted-syntax, no-invalid-this */\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isStringArray = require( '@stdlib/assert/is-string-array' ).primitives;\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar contains = require( '@stdlib/array/base/assert/contains' );\nvar filledBy = require( '@stdlib/array/base/filled-by' );\nvar ternary = require( '@stdlib/strided/base/ternary' );\nvar ctors = require( '@stdlib/array/ctors' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Constructor for creating arrays filled with pseudorandom values drawn from a ternary PRNG.\n*\n* @constructor\n* @param {Function} prng - ternary pseudorandom value generator\n* @param {StringArray} dtypes - list of supported output data types\n* @param {string} dtype - default output data type\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} second argument must be an array of strings\n* @throws {TypeError} third argument must be a supported data type\n* @returns {Random} instance\n*\n* @example\n* var triangular = require( '@stdlib/random/base/triangular' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var defaultDType = 'float64';\n*\n* var rand = new Random( triangular, dtypes, defaultDType );\n*\n* var v = rand.generate( 10, 2.0, 5.0, 3.33 );\n* // returns \n*/\nfunction Random( prng, dtypes, dtype ) {\n\tif ( !( this instanceof Random ) ) {\n\t\treturn new Random( prng, dtypes, dtype );\n\t}\n\tif ( !isFunction( prng ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', prng ) );\n\t}\n\t// TODO: tighten this up by actually validating that `dtypes` contains only recognized/supported dtype strings\n\tif ( !isStringArray( dtypes ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an array of strings. Value: `%s`.', dtypes ) );\n\t}\n\t// Require that the default output array data type be a member of the list of supported output array data types...\n\tif ( !contains( dtypes, dtype ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a supported data type. Value: `%s`.', dtype ) );\n\t}\n\tthis._prng = prng;\n\tthis._dtypes = dtypes;\n\tthis._dtype = dtype;\n\treturn this;\n}\n\n/**\n* Returns an array filled with pseudorandom values drawn from a ternary PRNG.\n*\n* @name generate\n* @memberof Random.prototype\n* @type {Function}\n* @param {NonNegativeInteger} len - number of elements\n* @param {*} param1 - first PRNG parameter\n* @param {*} param2 - second PRNG parameter\n* @param {*} param3 - third PRNG parameter\n* @param {Options} [options] - function options\n* @param {string} [options.dtype] - array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {Collection} output array\n*\n* @example\n* var triangular = require( '@stdlib/random/base/triangular' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var defaultDType = 'float64';\n*\n* var rand = new Random( triangular, dtypes, defaultDType );\n*\n* var v = rand.generate( 10, 2.0, 5.0, 3.33 );\n* // returns \n*/\nsetReadOnly( Random.prototype, 'generate', function generate( len, param1, param2, param3, options ) {\n\tvar ctor;\n\tvar opts;\n\tvar prng;\n\tvar out;\n\tvar err;\n\tvar dt;\n\tif ( !isNonNegativeInteger( len ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t}\n\topts = {};\n\tif ( arguments.length > 4 ) {\n\t\terr = validate( opts, this._dtypes, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// NOTE: we could alternatively use the PRNG factory function to create a nullary PRNG function which applies parameters for each invocation; however, this would impose a one-time cost which is likely to be rather expensive when generating small arrays. The decision made here avoids this cost, despite a small cost due to repeatedly validating parameters for each generated pseudorandom value. Additionally, the current implementation has the added benefit that it mirrors the underlying PRNG where invalid parameters result in, e.g., a return value of `NaN` (however, realization of this benefit depends on the output array being a floating-point array).\n\tprng = this._prng;\n\tdt = opts.dtype || this._dtype;\n\tif ( dt === 'generic' ) {\n\t\treturn filledBy( len, wrapper );\n\t}\n\tctor = ctors( dt );\n\tout = new ctor( len );\n\tternary( [ [ param1 ], [ param2 ], [ param3 ], out ], [ len ], [ 0, 0, 0, 1 ], prng ); // eslint-disable-line max-len\n\treturn out;\n\n\t/**\n\t* Applies parameters to a pseudorandom value generator function.\n\t*\n\t* @private\n\t* @returns {*} pseudorandom value\n\t*/\n\tfunction wrapper() {\n\t\treturn prng( param1, param2, param3 );\n\t}\n});\n\n/**\n* Fills an array with pseudorandom values drawn from a ternary PRNG.\n*\n* @name assign\n* @memberof Random.prototype\n* @type {Function}\n* @param {*} param1 - first PRNG parameter\n* @param {*} param2 - second PRNG parameter\n* @param {*} param3 - third PRNG parameter\n* @param {Collection} out - output array\n* @throws {TypeError} fourth argument must be a collection\n* @returns {Collection} output array\n*\n* @example\n* var triangular = require( '@stdlib/random/base/triangular' );\n* var zeros = require( '@stdlib/array/zeros' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var defaultDType = 'float64';\n*\n* var rand = new Random( triangular, dtypes, defaultDType );\n*\n* var out = zeros( 10, 'float64' );\n* // returns \n*\n* var v = rand.assign( 2.0, 5.0, 3.33, out );\n* // returns \n*\n* var bool = ( v === out );\n* // returns true\n*/\nsetReadOnly( Random.prototype, 'assign', function assign( param1, param2, param3, out ) {\n\tif ( !isCollection( out ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be an array-like object. Value: `%s`.', out ) );\n\t}\n\t// NOTE: we could alternatively use the PRNG factory function to create a nullary PRNG function which applies parameters for each invocation; however, this would impose a one-time cost which is likely to be rather expensive when filling small arrays. The decision made here avoids this cost, despite a small cost due to repeatedly validating parameters for each generated pseudorandom value. Additionally, the current implementation has the added benefit that it mirrors the underlying PRNG where invalid parameters result in, e.g., a return value of `NaN` (however, realization of this benefit depends on the output array being a floating-point array).\n\tternary( [ [ param1 ], [ param2 ], [ param3 ], out ], [ out.length ], [ 0, 0, 0, 1 ], this._prng ); // eslint-disable-line max-len\n\treturn out;\n});\n\n\n// EXPORTS //\n\nmodule.exports = Random;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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* Constructor for creating arrays filled with pseudorandom values drawn from a ternary PRNG.\n*\n* @module @stdlib/random/array/tools/ternary\n*\n* @example\n* var triangular = require( '@stdlib/random/base/triangular' );\n* var Random = require( '@stdlib/random/array/tools/ternary' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n* var defaultDType = 'float64';\n*\n* var rand = new Random( triangular, dtypes, defaultDType );\n*\n* var v = rand.generate( 10, 2.0, 5.0, 3.33 );\n* // returns \n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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 setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar isStringArray = require( '@stdlib/assert/is-string-array' ).primitives;\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isMethodIn = require( '@stdlib/assert/is-method-in' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar contains = require( '@stdlib/array/base/assert/contains' ).factory;\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar TernaryRandom = require( './../../../../array/tools/ternary' );\nvar NullaryRandom = require( './../../../../array/tools/nullary' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a factory function for generating pseudorandom values drawn from a ternary PRNG.\n*\n* @param {Function} prng - ternary pseudorandom value generator\n* @param {Function} prng.factory - method which returns a new ternary pseudorandom value generator\n* @param {StringArray} dtypes - list of supported output array data types\n* @param {string} dtype - default output array data type\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} first argument must have a `factory` method\n* @throws {TypeError} second argument must be an array of strings\n* @throws {TypeError} third argument must be a supported output array data type\n* @returns {Function} function which returns a function for creating arrays\n*\n* @example\n* var triangular = require( '@stdlib/random/base/triangular' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n*\n* var factory = createFactory( triangular, dtypes, 'float64' );\n* // returns \n*\n* var random = factory();\n* // returns \n*\n* var x = random( 10, 2.0, 5.0, 3.33 );\n* // returns \n*\n* @example\n* var triangular = require( '@stdlib/random/base/triangular' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n*\n* var factory = createFactory( triangular, dtypes, 'float64' );\n* // returns \n*\n* var random = factory();\n* // returns \n*\n* var x = random( 10, 2.0, 5.0, 3.33, {\n* 'dtype': 'float32'\n* });\n* // returns \n*/\nfunction createFactory( prng, dtypes, dtype ) {\n\tvar isValidDataType;\n\tif ( !isFunction( prng ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', prng ) );\n\t}\n\tif ( !isMethodIn( prng, 'factory' ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must have a `%s` method.', 'factory' ) );\n\t}\n\t// TODO: tighten this up by actually validating that `dtypes` contains only recognized/supported dtype strings\n\tif ( !isStringArray( dtypes ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must an array of strings. Value: `%s`.', dtypes ) );\n\t}\n\t// Require that the default output array data type be a member of the list of supported output array data types...\n\tif ( !contains( dtypes, dtype ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a supported data type. Value: `%s`.', dtype ) );\n\t}\n\tisValidDataType = contains( dtypes );\n\treturn factory;\n\n\t/**\n\t* Returns a function for generating pseudorandom values drawn from a PRNG.\n\t*\n\t* @private\n\t* @param {*} [param1] - first PRNG parameter\n\t* @param {*} [param2] - second PRNG parameter\n\t* @param {*} [param3] - third PRNG parameter\n\t* @param {Options} [options] - function options\n\t* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n\t* @param {*} [options.seed] - pseudorandom value generator seed\n\t* @param {*} [options.state] - pseudorandom value generator state\n\t* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom value generator state\n\t* @param {string} [options.dtype] - default output array data type\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {Function} function for creating arrays\n\t*/\n\tfunction factory() {\n\t\tvar Random;\n\t\tvar random;\n\t\tvar param1;\n\t\tvar param2;\n\t\tvar param3;\n\t\tvar assign;\n\t\tvar nargs;\n\t\tvar base;\n\t\tvar opts;\n\t\tvar rand;\n\t\tvar dt;\n\n\t\tnargs = arguments.length;\n\t\tif ( nargs < 1 ) { // e.g., factory()\n\t\t\topts = {};\n\t\t\tbase = prng;\n\t\t\trand = rand1;\n\t\t} else if ( nargs === 1 ) { // e.g., factory( {} )\n\t\t\topts = arguments[ 0 ];\n\t\t\tbase = prng.factory( opts );\n\t\t\trand = rand1;\n\t\t} else if ( nargs === 3 ) { // e.g., factory( param1, param2, param3 )\n\t\t\tparam1 = arguments[ 0 ];\n\t\t\tparam2 = arguments[ 1 ];\n\t\t\tparam3 = arguments[ 2 ];\n\t\t\topts = {};\n\t\t\tbase = prng.factory( param1, param2, param3 );\n\t\t\trand = rand2;\n\t\t} else { // e.g., factory( param1, param2, param3, {} )\n\t\t\tparam1 = arguments[ 0 ];\n\t\t\tparam2 = arguments[ 1 ];\n\t\t\tparam3 = arguments[ 2 ];\n\t\t\topts = arguments[ 3 ];\n\t\t\tbase = prng.factory( param1, param2, param3, opts );\n\t\t\trand = rand2;\n\t\t}\n\t\tif ( hasOwnProp( opts, 'dtype' ) ) {\n\t\t\tdt = opts.dtype;\n\t\t\tif ( !isValidDataType( dt ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', dtypes.join( '\", \"' ), dt ) );\n\t\t\t}\n\t\t} else {\n\t\t\tdt = dtype;\n\t\t}\n\t\tif ( rand === rand1 ) {\n\t\t\tassign = assign1;\n\t\t\tRandom = TernaryRandom;\n\t\t} else {\n\t\t\tassign = assign2;\n\t\t\tRandom = NullaryRandom;\n\t\t}\n\t\trandom = new Random( base, dtypes, dt );\n\t\tif ( opts && opts.prng ) {\n\t\t\tsetReadOnly( rand, 'seed', null );\n\t\t\tsetReadOnly( rand, 'seedLength', null );\n\t\t\tsetReadWriteAccessor( rand, 'state', constantFunction( null ), noop );\n\t\t\tsetReadOnly( rand, 'stateLength', null );\n\t\t\tsetReadOnly( rand, 'byteLength', null );\n\t\t} else {\n\t\t\tsetReadOnlyAccessor( rand, 'seed', getSeed );\n\t\t\tsetReadOnlyAccessor( rand, 'seedLength', getSeedLength );\n\t\t\tsetReadWriteAccessor( rand, 'state', getState, setState );\n\t\t\tsetReadOnlyAccessor( rand, 'stateLength', getStateLength );\n\t\t\tsetReadOnlyAccessor( rand, 'byteLength', getStateSize );\n\t\t}\n\t\tsetReadOnly( rand, 'PRNG', base.PRNG );\n\t\tsetReadOnly( rand, 'assign', assign );\n\t\treturn rand;\n\n\t\t/**\n\t\t* Returns an array of pseudorandom values drawn from a PRNG.\n\t\t*\n\t\t* @private\n\t\t* @param {NonNegativeInteger} len - output array length\n\t\t* @param {*} param1 - first PRNG parameter\n\t\t* @param {*} param2 - second PRNG parameter\n\t\t* @param {*} param3 - third PRNG parameter\n\t\t* @param {Options} [options] - function options\n\t\t* @param {string} [options.dtype] - output array data type\n\t\t* @throws {TypeError} first argument must be a nonnegative integer\n\t\t* @throws {TypeError} options argument must be an object\n\t\t* @throws {TypeError} must provide valid options\n\t\t* @returns {Collection} output array\n\t\t*/\n\t\tfunction rand1( len, param1, param2, param3, options ) {\n\t\t\tif ( arguments.length < 5 ) {\n\t\t\t\treturn random.generate( len, param1, param2, param3 );\n\t\t\t}\n\t\t\treturn random.generate( len, param1, param2, param3, options );\n\t\t}\n\n\t\t/**\n\t\t* Returns an array of pseudorandom values drawn from a PRNG.\n\t\t*\n\t\t* @private\n\t\t* @param {NonNegativeInteger} len - output array length\n\t\t* @param {Options} [options] - function options\n\t\t* @param {string} [options.dtype] - output array data type\n\t\t* @throws {TypeError} first argument must be a nonnegative integer\n\t\t* @throws {TypeError} options argument must be an object\n\t\t* @throws {TypeError} must provide valid options\n\t\t* @returns {Collection} output array\n\t\t*/\n\t\tfunction rand2( len, options ) {\n\t\t\tif ( arguments.length < 2 ) {\n\t\t\t\treturn random.generate( len );\n\t\t\t}\n\t\t\treturn random.generate( len, options );\n\t\t}\n\n\t\t/**\n\t\t* Fills an array with pseudorandom values drawn from a PRNG.\n\t\t*\n\t\t* @private\n\t\t* @param {*} param1 - first PRNG parameter\n\t\t* @param {*} param2 - second PRNG parameter\n\t\t* @param {*} param3 - third PRNG parameter\n\t\t* @param {Collection} out - output array\n\t\t* @throws {TypeError} third argument must be a collection\n\t\t* @returns {Collection} output array\n\t\t*/\n\t\tfunction assign1( param1, param2, param3, out ) {\n\t\t\treturn random.assign( param1, param2, param3, out );\n\t\t}\n\n\t\t/**\n\t\t* Fills an array with pseudorandom values drawn from a PRNG.\n\t\t*\n\t\t* @private\n\t\t* @param {Collection} out - output array\n\t\t* @throws {TypeError} first argument must be a collection\n\t\t* @returns {Collection} output array\n\t\t*/\n\t\tfunction assign2( out ) {\n\t\t\treturn random.assign( out );\n\t\t}\n\n\t\t/**\n\t\t* Returns the PRNG seed.\n\t\t*\n\t\t* @private\n\t\t* @returns {*} seed\n\t\t*/\n\t\tfunction getSeed() {\n\t\t\treturn rand.PRNG.seed;\n\t\t}\n\n\t\t/**\n\t\t* Returns the PRNG seed length.\n\t\t*\n\t\t* @private\n\t\t* @returns {PositiveInteger} seed length\n\t\t*/\n\t\tfunction getSeedLength() {\n\t\t\treturn rand.PRNG.seedLength;\n\t\t}\n\n\t\t/**\n\t\t* Returns the PRNG state length.\n\t\t*\n\t\t* @private\n\t\t* @returns {PositiveInteger} state length\n\t\t*/\n\t\tfunction getStateLength() {\n\t\t\treturn rand.PRNG.stateLength;\n\t\t}\n\n\t\t/**\n\t\t* Returns the PRNG state size (in bytes).\n\t\t*\n\t\t* @private\n\t\t* @returns {PositiveInteger} state size (in bytes)\n\t\t*/\n\t\tfunction getStateSize() {\n\t\t\treturn rand.PRNG.byteLength;\n\t\t}\n\n\t\t/**\n\t\t* Returns the current pseudorandom number generator state.\n\t\t*\n\t\t* @private\n\t\t* @returns {*} current state\n\t\t*/\n\t\tfunction getState() {\n\t\t\treturn rand.PRNG.state;\n\t\t}\n\n\t\t/**\n\t\t* Sets the pseudorandom number generator state.\n\t\t*\n\t\t* @private\n\t\t* @param {*} s - generator state\n\t\t* @throws {Error} must provide a valid state\n\t\t*/\n\t\tfunction setState( s ) {\n\t\t\trand.PRNG.state = s;\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = createFactory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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* Create a factory function for generating pseudorandom values drawn from a ternary PRNG.\n*\n* @module @stdlib/random/array/tools/ternary-factory\n*\n* @example\n* var triangular = require( '@stdlib/random/base/triangular' );\n* var ternaryFactory = require( '@stdlib/random/array/tools/ternary-factory' );\n*\n* var dtypes = [ 'float64', 'float32', 'generic' ];\n*\n* var factory = ternaryFactory( triangular, dtypes, 'float64' );\n* // returns \n*\n* var random = factory();\n* // returns \n*\n* var x = random( 10, 2.0, 5.0, 3.33 );\n* // returns \n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/assert/is-nan' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} s - scale parameter\n* @param {number} m - location parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0, 1.3 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( alpha, s, m ) {\n\tif ( !isPositiveNumber( alpha ) || isnan( alpha ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a positive number and not NaN. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositiveNumber( s ) || isnan( s ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number and not NaN. Value: `%s`.', s ) );\n\t}\n\tif ( !isNumber( m ) || isnan( m ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Third argument must be a number and not NaN. Value: `%s`.', m ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 pow = require( '@stdlib/math/base/special/pow' );\nvar ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Fr\u00E9chet distribution with shape `alpha`, scale `s`, and location `m`.\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} s - scale parameter\n* @param {number} m - location parameter\n* @returns {number} pseudorandom number\n*/\nfunction frechet( rand, alpha, s, m ) {\n\treturn m + ( s * ( pow( -ln( rand() ), -1.0/alpha ) ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = frechet;\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 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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar frechet0 = require( './frechet.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating random numbers drawn from a Fr\u00E9chet distribution.\n*\n* @param {PositiveNumber} [alpha] - shape parameter\n* @param {PositiveNumber} [s] - scale parameter\n* @param {number} [m] - location parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} `alpha` must be a positive number\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} `m` must be a number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var frechet = factory( 1.0, 1.0, 0.8 );\n* var v = frechet();\n* // returns \n*\n* @example\n* var frechet = factory( 1.0, 1.0, -2.0, {\n* 'seed': 297\n* });\n* var v = frechet();\n* // returns \n*/\nfunction factory() {\n\tvar alpha;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar s;\n\tvar m;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\talpha = arguments[ 0 ];\n\t\ts = arguments[ 1 ];\n\t\tm = arguments[ 2 ];\n\t\terr = validate( alpha, s, m );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 3 ) {\n\t\t\topts = arguments[ 3 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( alpha === void 0 ) {\n\t\tprng = frechet2;\n\t} else {\n\t\tprng = frechet1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'frechet' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\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 = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( alpha === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ alpha, s, m ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Fr\u00E9chet distribution with bound parameters.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = frechet1();\n\t* // returns \n\t*/\n\tfunction frechet1() {\n\t\treturn frechet0( rand, alpha, s, m );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Fr\u00E9chet distribution with shape `alpha`, scale `s`, and location `m`.\n\t*\n\t* @private\n\t* @param {PositiveNumber} alpha - shape parameter\n\t* @param {PositiveNumber} s - scale parameter\n\t* @param {number} m - location parameter\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = frechet2( 2.0, 1.0, 0.5 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = frechet2( 1.0, 1.0, 0.5 );\n\t* // returns NaN\n\t*\n\t* @example\n\t* var v = frechet2( 1.0, 2.0, NaN );\n\t* // returns NaN\n\t*/\n\tfunction frechet2( alpha, s, m ) {\n\t\tif (\n\t\t\tisnan( alpha ) ||\n\t\t\tisnan( s ) ||\n\t\t\tisnan( m ) ||\n\t\t\talpha <= 0.0 ||\n\t\t\ts <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn frechet0( rand, alpha, s, m );\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' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Fr\u00E9chet distribution with shape `alpha`, scale `s`, and location `m`.\n*\n* @name frechet\n* @type {PRNG}\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} s - scale parameter\n* @param {number} m - location parameter\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = frechet( 1.0, 1.0, 0.5 );\n* // returns \n*/\nvar frechet = factory();\n\n\n// EXPORTS //\n\nmodule.exports = frechet;\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* Fr\u00E9chet distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/frechet\n*\n* @example\n* var frechet = require( '@stdlib/random/base/frechet' );\n*\n* var v = frechet( 10.0, 10.0, 7.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/frechet' ).factory;\n*\n* var frechet = factory( 5.0, 5.0, 3.0, {\n* 'seed': 643361677\n* });\n*\n* var v = frechet();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/frechet' ).factory;\n*\n* var frechet = factory({\n* 'seed': 643361677\n* });\n*\n* var v = frechet( 5.0, 5.0, 3.0 );\n* // returns \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", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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 ternaryFactory = require( './../../../array/tools/ternary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/frechet' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a Fr\u00E9chet distribution.\n*\n* @name factory\n* @type {Function}\n* @param {PositiveNumber} [alpha] - shape parameter\n* @param {PositiveNumber} [s] - scale parameter\n* @param {number} [m] - location parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} `m` must be a number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var frechet = factory( 2.0, 5.0, 3.0 );\n* // returns \n*\n* var arr = frechet( 10 );\n* // returns \n*\n* @example\n* var frechet = factory( 2.0, 5.0, 3.0 );\n* // returns \n*\n* var arr = frechet( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = ternaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a Fr\u00E9chet distribution.\n*\n* @name frechet\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} s - scale parameter\n* @param {number} m - location parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = frechet( 10, 2.0, 5.0, 3.0 );\n* // returns \n*\n* @example\n* var arr = frechet( 10, 2.0, 5.0, 3.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar frechet = factory();\n\n\n// EXPORTS //\n\nmodule.exports = frechet;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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* Create an array containing pseudorandom numbers drawn from a Fr\u00E9chet distribution.\n*\n* @module @stdlib/random/array/frechet\n*\n* @example\n* var frechet = require( '@stdlib/random/array/frechet' );\n*\n* var arr = frechet( 10, 2.0, 5.0, 3.0 );\n* // returns \n*\n* @example\n* var frechet = require( '@stdlib/random/array/frechet' );\n*\n* var arr = frechet( 10, 2.0, 5.0, 3.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var frechet = require( '@stdlib/random/array/frechet' );\n*\n* var rand = frechet.factory( 2.0, 5.0, 3.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var frechet = require( '@stdlib/random/array/frechet' );\n*\n* var rand = frechet.factory( 2.0, 5.0, 3.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 binaryFactory = require( './../../../array/tools/binary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/gamma' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a gamma distribution.\n*\n* @name factory\n* @type {Function}\n* @param {PositiveNumber} [alpha] - shape parameter\n* @param {PositiveNumber} [beta] - rate parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var gamma = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = gamma( 10 );\n* // returns \n*\n* @example\n* var gamma = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = gamma( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = binaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a gamma distribution.\n*\n* @name gamma\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - rate parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = gamma( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = gamma( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar gamma = factory();\n\n\n// EXPORTS //\n\nmodule.exports = gamma;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create an array containing pseudorandom numbers drawn from a gamma distribution.\n*\n* @module @stdlib/random/array/gamma\n*\n* @example\n* var gamma = require( '@stdlib/random/array/gamma' );\n*\n* var arr = gamma( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var gamma = require( '@stdlib/random/array/gamma' );\n*\n* var arr = gamma( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var gamma = require( '@stdlib/random/array/gamma' );\n*\n* var rand = gamma.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var gamma = require( '@stdlib/random/array/gamma' );\n*\n* var rand = gamma.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\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 floor = require( '@stdlib/math/base/special/floor' );\nvar ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a geometric distribution.\n*\n* ## Proof\n*\n* Consider\n*\n* ```tex\n* N = \\left \\lfloor \\ln (U) / \\ln (1-p) \\right \\rfloor\n* ```\n*\n* where \\\\( U \\\\) is uniform on the interval \\\\((0,1)\\\\). Accordingly, \\\\(N\\\\) must be a nonnegative integer, and, for every \\\\( n \\geq 0\\\\), the event \\\\(A_n = \\left \\{ N = n \\right \\}\\\\) is\n*\n* ```tex\n* A_n = \\left \\{(n+1) \\ln (1-p) < \\ln (U) \\leq n \\ln (1-p) \\right \\}\n* ```\n*\n* where \\\\(\\ln (1-p) < 0\\\\). Thus,\n*\n* ```tex\n* A_n = \\left \\{(1-p)^{n+1} < U \\leq (1-p)^n \\right \\}\n* ```\n*\n* For every \\\\(u < v\\\\) on the interval \\\\((0,1)\\\\),\n*\n* ```tex\n* P\\left \\[u < U \\leq v\\right \\] = v - u\n* ```\n*\n* Hence,\n*\n* ```tex\n* P\\left \\[N = n \\right \\] = P\\left \\[A_n\\right \\] = (1-p)^n - (1-p)^{n+1} = (1-p)^n(1-(1-p)) = p(1-p)^n\n* ```\n*\n* which proves that \\\\(N\\\\) is a geometric random variable.\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {Probability} p - success probability\n* @returns {NonNegativeInteger} pseudorandom number\n*/\nfunction geometric( rand, p ) {\n\tvar u = rand();\n\tif ( u === 0.0 ) {\n\t\t// Drawing random variates from a PRNG (with period > 1) is effectively sampling without replacement. Thus, should not be possible to draw `0` twice in a row.\n\t\tu = rand();\n\t}\n\treturn floor( ln( u ) / ln( 1.0-p ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = geometric;\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 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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar isProbability = require( '@stdlib/assert/is-probability' ).isPrimitive;\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar geometric0 = require( './geometric.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating geometric distributed random numbers.\n*\n* @param {Probability} [p] - success probability\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} `p` must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var geometric = factory( 0.5 );\n* var v = geometric();\n* // returns \n*\n* @example\n* var geometric = factory( 0.8, {\n* 'seed': 297\n* });\n* var v = geometric();\n* // returns \n*\n* @example\n* var geometric = factory();\n* var v = geometric( 0.5 );\n* // returns \n*/\nfunction factory() {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar p;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if (\n\t\targuments.length === 1 &&\n\t\tisObject( arguments[ 0 ] )\n\t) {\n\t\topts = arguments[ 0 ];\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tp = arguments[ 0 ];\n\t\tif ( !isProbability( p ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a probability. Value: `%s`.', p ) );\n\t\t}\n\t\tif ( arguments.length > 1 ) {\n\t\t\topts = arguments[ 1 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( p === void 0 ) {\n\t\tprng = geometric2;\n\t} else {\n\t\tprng = geometric1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'geometric' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\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 = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( p === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ p ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a geometric distribution with bound parameter `p`.\n\t*\n\t* @private\n\t* @returns {NonNegativeInteger} pseudorandom number\n\t*\n\t* @example\n\t* var v = geometric1();\n\t* // returns \n\t*/\n\tfunction geometric1() {\n\t\treturn geometric0( rand, p );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a geometric distribution with parameter `p`.\n\t*\n\t* @private\n\t* @param {Probability} p - success probability\n\t* @returns {NonNegativeInteger} pseudorandom number\n\t*\n\t* @example\n\t* var v = geometric2( 0.5 );\n\t* // returns \n\t*/\n\tfunction geometric2( p ) {\n\t\tif (\n\t\t\tisnan( p ) ||\n\t\t\tp < 0.0 ||\n\t\t\tp > 1.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn geometric0( rand, p );\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' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom random number drawn from a geometric distribution with parameter `p`.\n*\n* @name geometric\n* @type {PRNG}\n* @param {Probability} p - success probability\n* @returns {NonNegativeInteger} pseudorandom number\n*\n* @example\n* var v = geometric( 0.5 );\n* // returns \n*\n* @example\n* var v = geometric( 3.14 );\n* // returns NaN\n*\n* @example\n* var v = geometric( -1.0 );\n* // returns NaN\n*\n* @example\n* var v = geometric( NaN );\n* // returns NaN\n*/\nvar geometric = factory();\n\n\n// EXPORTS //\n\nmodule.exports = geometric;\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* Geometric distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/geometric\n*\n* @example\n* var geometric = require( '@stdlib/random/base/geometric' );\n*\n* var v = geometric( 0.5 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/geometric' ).factory;\n*\n* var geometric = factory( 0.3, {\n* 'seed': 297\n* });\n*\n* var v = geometric();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/geometric' ).factory;\n*\n* var geometric = factory({\n* 'seed': 297\n* });\n*\n* var v = geometric( 0.5 );\n* // returns \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", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 unaryFactory = require( './../../../array/tools/unary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/geometric' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a geometric distribution.\n*\n* @name factory\n* @type {Function}\n* @param {Probability} [p] - success probability\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `p` must be a probability (i.e., a number on the interval [0,1])\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var geometric = factory( 0.01 );\n* // returns \n*\n* var arr = geometric( 10 );\n* // returns \n*\n* @example\n* var geometric = factory( 0.01 );\n* // returns \n*\n* var arr = geometric( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = unaryFactory( base, DTYPES, defaults.get( 'dtypes.real' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a geometric distribution.\n*\n* @name geometric\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {Probability} p - success probability\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = geometric( 10, 0.01 );\n* // returns \n*\n* @example\n* var arr = geometric( 10, 0.01, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar geometric = factory();\n\n\n// EXPORTS //\n\nmodule.exports = geometric;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create an array containing pseudorandom numbers drawn from a geometric distribution.\n*\n* @module @stdlib/random/array/geometric\n*\n* @example\n* var geometric = require( '@stdlib/random/array/geometric' );\n*\n* var arr = geometric( 10, 0.01 );\n* // returns \n*\n* @example\n* var geometric = require( '@stdlib/random/array/geometric' );\n*\n* var arr = geometric( 10, 0.01, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var geometric = require( '@stdlib/random/array/geometric' );\n*\n* var rand = geometric.factory( 0.01 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var geometric = require( '@stdlib/random/array/geometric' );\n*\n* var rand = geometric.factory( 0.01 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\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 isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar isnan = require( '@stdlib/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {number} mu - mean\n* @param {PositiveNumber} beta - shape parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( mu, beta ) {\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( beta ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Returns pseudorandom number drawn from a Gumbel distribution.\n*\n* @private\n* @param {PRNG} rand - PRNG for generating uniformly distributed numbers\n* @param {number} mu - mean\n* @param {PositiveNumber} beta - scale parameter\n* @returns {number} pseudorandom number\n*/\nfunction gumbel( rand, mu, beta ) {\n\treturn mu - ( beta*ln( -ln( rand() ) ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = gumbel;\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 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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar gumbel0 = require( './gumbel.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating random numbers from a Gumbel distribution.\n*\n* @param {number} [mu] - mean\n* @param {PositiveNumber} [beta] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} `mu` must be a number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var gumbel = factory( 0.0, 1.0 );\n* var v = gumbel();\n* // returns \n*\n* @example\n* var gumbel = factory( -3.0, 0.5, {\n* 'seed': 297\n* });\n* var v = gumbel();\n* // returns \n*/\nfunction factory() {\n\tvar beta;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar mu;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tmu = arguments[ 0 ];\n\t\tbeta = arguments[ 1 ];\n\t\terr = validate( mu, beta );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( mu === void 0 ) {\n\t\tprng = gumbel2;\n\t} else {\n\t\tprng = gumbel1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'gumbel' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\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 = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( mu === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ mu, beta ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns pseudorandom number drawn from a Gumbel distribution with bound parameters.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = gumbel1();\n\t* // returns \n\t*/\n\tfunction gumbel1() {\n\t\treturn gumbel0( rand, mu, beta );\n\t}\n\n\t/**\n\t* Returns pseudorandom number drawn from a Gumbel distribution.\n\t*\n\t* @private\n\t* @param {number} mu - mean\n\t* @param {PositiveNumber} beta - scale parameter\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = gumbel2( 0.0, 2.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = gumbel2( 0.0, -1.0 );\n\t* // returns NaN\n\t*/\n\tfunction gumbel2( mu, beta ) {\n\t\tif (\n\t\t\tisnan( mu ) ||\n\t\t\tisnan( beta ) ||\n\t\t\tbeta <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn gumbel0( rand, mu, beta );\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' );\n\n\n// MAIN //\n\n/**\n* Returns pseudorandom number drawn from a Gumbel distribution.\n*\n* @name gumbel\n* @type {PRNG}\n* @param {number} mu - mean\n* @param {PositiveNumber} beta - scale parameter\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = gumbel( 0.0, 2.0 );\n* // returns \n*\n* @example\n* var v = gumbel( 0.0, -1.0 );\n* // returns NaN\n*/\nvar gumbel = factory();\n\n\n// EXPORTS //\n\nmodule.exports = gumbel;\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* Gumbel distribution pseudorandom numbers.\n*\n* @module @stdlib/random/base/gumbel\n*\n* @example\n* var gumbel = require( '@stdlib/random/base/gumbel' );\n*\n* var v = gumbel( 0.5, 1.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/gumbel' ).factory;\n*\n* var gumbel = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = gumbel();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/gumbel' ).factory;\n*\n* var gumbel = factory({\n* 'seed': 297\n* });\n*\n* var v = gumbel( 2.0, 2.0 );\n* // returns \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", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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 binaryFactory = require( './../../../array/tools/binary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/gumbel' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a Gumbel distribution.\n*\n* @name factory\n* @type {Function}\n* @param {number} [mu] - mean\n* @param {PositiveNumber} [beta] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var gumbel = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = gumbel( 10 );\n* // returns \n*\n* @example\n* var gumbel = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = gumbel( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = binaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a Gumbel distribution.\n*\n* @name gumbel\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {number} mu - mean\n* @param {PositiveNumber} beta - scale parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = gumbel( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = gumbel( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar gumbel = factory();\n\n\n// EXPORTS //\n\nmodule.exports = gumbel;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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* Create an array containing pseudorandom numbers drawn from a Gumbel distribution.\n*\n* @module @stdlib/random/array/gumbel\n*\n* @example\n* var gumbel = require( '@stdlib/random/array/gumbel' );\n*\n* var arr = gumbel( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var gumbel = require( '@stdlib/random/array/gumbel' );\n*\n* var arr = gumbel( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var gumbel = require( '@stdlib/random/array/gumbel' );\n*\n* var rand = gumbel.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var gumbel = require( '@stdlib/random/array/gumbel' );\n*\n* var rand = gumbel.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\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 isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {NonNegativeInteger} N - population size\n* @param {NonNegativeInteger} K - subpopulation size\n* @param {NonNegativeInteger} n - number of draws\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1, 2, 3 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( N, K, n ) {\n\tif ( !isNonNegativeInteger( N ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', N ) );\n\t}\n\tif ( !isNonNegativeInteger( K ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a nonnegative integer. Value: `%s`.', K ) );\n\t}\n\tif ( !isNonNegativeInteger( n ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Third argument must be a nonnegative integer. Value: `%s`.', n ) );\n\t}\n\tif ( n > N ) {\n\t\treturn new RangeError( format( 'invalid argument. Third argument must be less than or equal to the first argument. Value: `%u`.', n ) );\n\t}\n\tif ( K > N ) {\n\t\treturn new RangeError( format( 'invalid argument. Second argument must be less than or equal to the first argument. Value: `%u`.', K ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 factorial = require( '@stdlib/math/base/special/factorial' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a hypergeometric distribution using the HIN algorithm, which is based on an inverse transformation method.\n*\n* ## References\n*\n* - Fishman, George S. 1973. _Concepts and methods in discrete event digital simulation_. A Wiley-Interscience Publication. New York, NY, USA: Wiley.\n* - Kachitvichyanukul, Voratas., and Burce Schmeiser. 1985. \"Computer generation of hypergeometric random variates.\" _Journal of Statistical Computation and Simulation_ 22 (2): 127\u201345. doi:[10.1080/00949658508810839][@kachitvichyanukul:1985].\n*\n* [@kachitvichyanukul:1985]: http://dx.doi.org/10.1080/00949658508810839\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {NonNegativeInteger} n1 - number of successes in population\n* @param {NonNegativeInteger} n2 - number of failures in population\n* @param {NonNegativeInteger} k - number of draws\n* @returns {NonNegativeInteger} pseudorandom number\n*/\nfunction hin( rand, n1, n2, k ) {\n\tvar p;\n\tvar u;\n\tvar x;\n\tif ( k < n2 ) {\n\t\tp = ( factorial( n2 ) * factorial( n1 + n2 - k ) ) /\n\t\t\t( factorial( n1 + n2 ) * factorial( n2 - k ) );\n\t\tx = 0;\n\t} else {\n\t\tp = ( factorial( n1 ) * factorial( k ) ) /\n\t\t\t( factorial( k - n2 ) * factorial( n1 + n2 ) );\n\t\tx = k - n2;\n\t}\n\tu = rand();\n\twhile ( u > p ) {\n\t\tu -= p;\n\t\tp *= ( n1 - x ) * ( k - x ) / ( ( x + 1 ) * ( n2 - k + 1 + x ) );\n\t\tx += 1;\n\t}\n\treturn x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = hin;\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 hin = require( './hin.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a hypergeometric distribution.\n*\n* ## References\n*\n* - Kachitvichyanukul, Voratas., and Burce Schmeiser. 1985. \"Computer generation of hypergeometric random variates.\" _Journal of Statistical Computation and Simulation_ 22 (2): 127\u201345. doi:[10.1080/00949658508810839][@kachitvichyanukul:1985].\n*\n* [@kachitvichyanukul:1985]: http://dx.doi.org/10.1080/00949658508810839\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {NonNegativeInteger} N - population size\n* @param {NonNegativeInteger} K - subpopulation size\n* @param {NonNegativeInteger} n - number of draws\n* @returns {NonNegativeInteger} pseudorandom number\n*/\nfunction hypergeometric( rand, N, K, n ) {\n\tvar n1;\n\tvar n2;\n\tvar k;\n\tvar x;\n\n\tif ( n > N/2 ) {\n\t\tk = N - n;\n\t\tif ( 2*K <= N ) {\n\t\t\tn1 = K;\n\t\t\tn2 = N - K;\n\t\t\tx = hin( rand, n1, n2, k );\n\t\t\treturn K - x;\n\t\t}\n\t\tn2 = K;\n\t\tn1 = N - K;\n\t\tx = hin( rand, n1, n2, k );\n\t\treturn n - N + K + x;\n\t}\n\tk = n;\n\tif ( 2*K <= N ) {\n\t\tn1 = K;\n\t\tn2 = N - K;\n\t\tx = hin( rand, n1, n2, k );\n\t\treturn x;\n\t}\n\tn1 = N - K;\n\tn2 = K;\n\tx = hin( rand, n1, n2, k );\n\treturn n - x;\n}\n\n\n// EXPORTS //\n\nmodule.exports = hypergeometric;\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 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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isNonNegativeInteger = require( '@stdlib/math/base/assert/is-nonnegative-integer' );\nvar PINF = require( '@stdlib/constants/float64/pinf' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar hypergeometric0 = require( './hypergeometric.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating hypergeometric distributed random numbers.\n*\n* @param {NonNegativeInteger} [N] - population size\n* @param {NonNegativeInteger} [K] - subpopulation size\n* @param {NonNegativeInteger} [n] - number of draws\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} `N` must be a nonnegative integer\n* @throws {TypeError} `K` must be a nonnegative integer\n* @throws {TypeError} `n` must be a nonnegative integer\n* @throws {RangeError} `n` must be less than or equal to `N`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var hypergeometric = factory( 5, 3, 2 );\n* var v = hypergeometric();\n* // returns \n*\n* @example\n* var hypergeometric = factory( 10, 10, 10, {\n* 'seed': 297\n* });\n* var v = hypergeometric();\n* // returns \n*\n* @example\n* var hypergeometric = factory();\n* var v = hypergeometric( 5, 3, 2 );\n* // returns \n*/\nfunction factory() {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar N;\n\tvar K;\n\tvar n;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tN = arguments[ 0 ];\n\t\tK = arguments[ 1 ];\n\t\tn = arguments[ 2 ];\n\t\terr = validate( N, K, n );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 3 ) {\n\t\t\topts = arguments[ 3 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( N === void 0 ) {\n\t\tprng = hypergeometric2;\n\t} else {\n\t\tprng = hypergeometric1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'hypergeometric' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\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 = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( N === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ N, K, n ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a random number drawn from a hypergeometric distribution with bound parameters.\n\t*\n\t* @private\n\t* @returns {NonNegativeInteger} pseudorandom number\n\t*\n\t* @example\n\t* var v = hypergeometric1();\n\t* // returns \n\t*/\n\tfunction hypergeometric1() {\n\t\treturn hypergeometric0( rand, N, K, n );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a hypergeometric distribution.\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} N - population size\n\t* @param {NonNegativeInteger} K - subpopulation size\n\t* @param {NonNegativeInteger} n - number of draws\n\t* @returns {NonNegativeInteger} pseudorandom number\n\t*\n\t* @example\n\t* var v = hypergeometric2( 5, 3, 2 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = hypergeometric2( NaN, NaN, NaN );\n\t* // returns NaN\n\t*\n\t* @example\n\t* var v = hypergeometric2( 5.21, 3.14, 2.76 );\n\t* // returns NaN\n\t*/\n\tfunction hypergeometric2( N, K, n ) {\n\t\tif (\n\t\t\tN === PINF ||\n\t\t\tK === PINF ||\n\t\t\t!isNonNegativeInteger( N ) ||\n\t\t\t!isNonNegativeInteger( K ) ||\n\t\t\t!isNonNegativeInteger( n ) ||\n\t\t\tn > N\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn hypergeometric0( rand, N, K, n );\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' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a hypergeometric distribution.\n*\n* @name hypergeometric\n* @type {PRNG}\n* @param {NonNegativeInteger} N - population size\n* @param {NonNegativeInteger} K - subpopulation size\n* @param {NonNegativeInteger} n - number of draws\n* @returns {NonNegativeInteger} pseudorandom number\n*\n* @example\n* var v = hypergeometric( 5, 3, 2 );\n* // returns \n*\n* @example\n* var v = hypergeometric( -5, 3, 2 );\n* // returns NaN\n*\n* @example\n* var v = hypergeometric( 5, 3.14, 2 );\n* // returns NaN\n*\n* @example\n* var v = hypergeometric( 5, 3, 1.5 );\n* // returns NaN\n*\n* @example\n* var v = hypergeometric( NaN, NaN, NaN );\n* // returns NaN\n*/\nvar hypergeometric = factory();\n\n\n// EXPORTS //\n\nmodule.exports = hypergeometric;\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* Hypergeometric distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/hypergeometric\n*\n* @example\n* var hypergeometric = require( '@stdlib/random/base/hypergeometric' );\n*\n* var v = hypergeometric( 10, 10, 10 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/hypergeometric' ).factory;\n* var hypergeometric = factory( 5, 3, 2, {\n* 'seed': 297\n* });\n*\n* var v = hypergeometric();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/hypergeometric' ).factory;\n* var hypergeometric = factory();\n*\n* var v = hypergeometric( 10, 2, 2 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/hypergeometric' ).factory;\n* var hypergeometric = factory({\n* 'seed': 297\n* });\n*\n* var v = hypergeometric( 5, 3, 2 );\n* // returns \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", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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 ternaryFactory = require( './../../../array/tools/ternary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/hypergeometric' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a hypergeometric distribution.\n*\n* @name factory\n* @type {Function}\n* @param {NonNegativeInteger} [N] - population size\n* @param {NonNegativeInteger} [K] - subpopulation size\n* @param {NonNegativeInteger} [n] - number of draws\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `N` must be a nonnegative integer\n* @throws {TypeError} `K` must be a nonnegative integer\n* @throws {TypeError} `n` must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var hypergeometric = factory( 20, 10, 7 );\n* // returns \n*\n* var arr = hypergeometric( 10 );\n* // returns \n*\n* @example\n* var hypergeometric = factory( 20, 10, 7 );\n* // returns \n*\n* var arr = hypergeometric( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = ternaryFactory( base, DTYPES, defaults.get( 'dtypes.real' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a hypergeometric distribution.\n*\n* @name hypergeometric\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {NonNegativeInteger} N - population size\n* @param {NonNegativeInteger} K - subpopulation size\n* @param {NonNegativeInteger} n - number of draws\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = hypergeometric( 10, 20, 10, 7 );\n* // returns \n*\n* @example\n* var arr = hypergeometric( 10, 20, 10, 7, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar hypergeometric = factory();\n\n\n// EXPORTS //\n\nmodule.exports = hypergeometric;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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* Create an array containing pseudorandom numbers drawn from a hypergeometric distribution.\n*\n* @module @stdlib/random/array/hypergeometric\n*\n* @example\n* var hypergeometric = require( '@stdlib/random/array/hypergeometric' );\n*\n* var arr = hypergeometric( 10, 20, 10, 7 );\n* // returns \n*\n* @example\n* var hypergeometric = require( '@stdlib/random/array/hypergeometric' );\n*\n* var arr = hypergeometric( 10, 20, 10, 7, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var hypergeometric = require( '@stdlib/random/array/hypergeometric' );\n*\n* var rand = hypergeometric.factory( 20, 10, 7 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var hypergeometric = require( '@stdlib/random/array/hypergeometric' );\n*\n* var rand = hypergeometric.factory( 20, 10, 7 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\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 isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - scale parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( alpha, beta ) {\n\tif ( !isPositive( alpha ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositive( beta ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar gamma = require( './../../../base/gamma' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating inverse gamma distributed random numbers.\n*\n* @param {PositiveNumber} [alpha] - shape parameter\n* @param {PositiveNumber} [beta] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var invgamma = factory( 2.0, 1.0 );\n* var v = invgamma();\n* // returns \n*\n* @example\n* var invgamma = factory( 2.0, 2.0, {\n* 'seed': 297\n* });\n* var v = invgamma();\n* // returns \n*/\nfunction factory() {\n\tvar rgamma;\n\tvar alpha;\n\tvar beta;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\n\tif ( arguments.length === 0 ) {\n\t\trgamma = gamma();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trgamma = gamma({\n\t\t\t\t'prng': opts.prng\n\t\t\t});\n\t\t} else {\n\t\t\trgamma = gamma( opts );\n\t\t}\n\t} else {\n\t\talpha = arguments[ 0 ];\n\t\tbeta = arguments[ 1 ];\n\t\terr = validate( alpha, beta );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trgamma = gamma( alpha, beta, {\n\t\t\t\t\t'prng': opts.prng\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\trgamma = gamma( alpha, beta, opts );\n\t\t\t}\n\t\t} else {\n\t\t\trgamma = gamma( alpha, beta );\n\t\t}\n\t}\n\tif ( alpha === void 0 ) {\n\t\tprng = invgamma2;\n\t} else {\n\t\tprng = invgamma1;\n\t}\n\trand = rgamma.PRNG;\n\n\tsetReadOnly( prng, 'NAME', 'invgamma' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t}\n\tsetReadOnly( prng, 'PRNG', rand );\n\treturn prng;\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\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 = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( alpha === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ alpha, beta ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from an inverse gamma distribution.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = invgamma1();\n\t* // returns \n\t*/\n\tfunction invgamma1() {\n\t\treturn 1.0 / rgamma();\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from an inverse gamma distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} alpha - shape parameter\n\t* @param {PositiveNumber} beta - scale parameter\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = invgamma2( 2.0, 1.0 );\n\t* // returns \n\t*/\n\tfunction invgamma2( alpha, beta ) {\n\t\tif (\n\t\t\tisnan( alpha ) ||\n\t\t\tisnan( beta ) ||\n\t\t\talpha <= 0.0 ||\n\t\t\tbeta <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn 1.0 / rgamma( alpha, beta );\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' );\n\n\n// MAIN //\n\n/**\n* Returns a random number drawn from an inverse gamma distribution.\n*\n* ## Method\n*\n* When\n*\n* ```tex\n* X \\sim \\operatorname{Gamma}( \\alpha, \\beta )\n* ```\n*\n* then\n*\n* ```tex\n* \\frac{1}{X} \\sim \\operatorname{InvGamma}\\left( \\alpha, \\tfrac{1}{beta} \\right)\n* ```\n*\n* Hence, to generate a draw from an inverse gamma distribution with parameters \\\\( \\alpha \\\\) and \\\\( \\beta \\\\), sample `X` from a \\\\( \\operatorname{Gamma}\\left( \\alpha, \\tfrac{1}{\\beta} \\right) \\\\) distribution and return `1/X`.\n*\n* @name invgamma\n* @type {PRNG}\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - scale parameter\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = invgamma( 2.0, 1.0 );\n* // returns \n*\n* @example\n* var v = invgamma( -2.0, 5.0 );\n* // returns NaN\n*/\nvar invgamma = factory();\n\n\n// EXPORTS //\n\nmodule.exports = invgamma;\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* Inverse gamma distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/invgamma\n*\n* @example\n* var invgamma = require( '@stdlib/random/base/invgamma' );\n*\n* var v = invgamma( 2.0, 3.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/invgamma' ).factory;\n* var invgamma = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = invgamma();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/invgamma' ).factory;\n* var invgamma = factory({\n* 'seed': 297\n* });\n*\n* var v = invgamma( 3.0, 2.0 );\n* // returns \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", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 binaryFactory = require( './../../../array/tools/binary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/invgamma' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from an inverse gamma distribution.\n*\n* @name factory\n* @type {Function}\n* @param {PositiveNumber} [alpha] - shape parameter\n* @param {PositiveNumber} [beta] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var invgamma = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = invgamma( 10 );\n* // returns \n*\n* @example\n* var invgamma = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = invgamma( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = binaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from an inverse gamma distribution.\n*\n* @name invgamma\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - scale parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = invgamma( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = invgamma( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar invgamma = factory();\n\n\n// EXPORTS //\n\nmodule.exports = invgamma;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create an array containing pseudorandom numbers drawn from an inverse gamma distribution.\n*\n* @module @stdlib/random/array/invgamma\n*\n* @example\n* var invgamma = require( '@stdlib/random/array/invgamma' );\n*\n* var arr = invgamma( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var invgamma = require( '@stdlib/random/array/invgamma' );\n*\n* var arr = invgamma( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var invgamma = require( '@stdlib/random/array/invgamma' );\n*\n* var rand = invgamma.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var invgamma = require( '@stdlib/random/array/invgamma' );\n*\n* var rand = invgamma.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\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 isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {PositiveNumber} a - first shape parameter\n* @param {PositiveNumber} b - second shape parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( a, b ) {\n\tif ( !isPositive( a ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', a ) );\n\t}\n\tif ( !isPositive( b ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', b ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 pow = require( '@stdlib/math/base/special/pow' );\n\n\n// MAIN //\n\n/**\n* Returns a random number drawn from Kumaraswamy's double bounded distribution.\n*\n* @private\n* @param {PRNG} rand - pseudorandom number generator for uniformly distributed numbers\n* @param {PositiveNumber} a - first shape parameter\n* @param {PositiveNumber} b - second shape parameter\n* @returns {Probability} pseudorandom number\n*/\nfunction sample( rand, a, b ) {\n\tvar u = rand();\n\treturn pow( 1.0 - pow( 1.0-u, 1.0/b ), 1.0/a );\n}\n\n\n// EXPORTS //\n\nmodule.exports = sample;\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 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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar kumaraswamy0 = require( './kumaraswamy.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating Kumaraswamy's double bounded distributed random numbers.\n*\n* @param {PositiveNumber} [a] - first shape parameter\n* @param {PositiveNumber} [b] - second shape parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} `a` must be a positive number\n* @throws {TypeError} `b` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var kumaraswamy = factory( 2.0, 1.0 );\n* var v = kumaraswamy();\n* // returns \n*\n* @example\n* var kumaraswamy = factory( 2.0, 2.0, {\n* 'seed': 297\n* });\n* var v = kumaraswamy();\n* // returns \n*/\nfunction factory() {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar a;\n\tvar b;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\ta = arguments[ 0 ];\n\t\tb = arguments[ 1 ];\n\t\terr = validate( a, b );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( a === void 0 ) {\n\t\tprng = kumaraswamy2;\n\t} else {\n\t\tprng = kumaraswamy1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'kumaraswamy' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\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 = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( a === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ a, b ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a random number drawn from a Kumaraswamy's double bounded distribution with bound parameter values.\n\t*\n\t* @private\n\t* @returns {Probability} pseudorandom number\n\t*\n\t* @example\n\t* var v = beta1();\n\t* // returns \n\t*/\n\tfunction kumaraswamy1() {\n\t\treturn kumaraswamy0( rand, a, b );\n\t}\n\n\t/**\n\t* Returns a random number drawn from a Kumaraswamy's double bounded distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} a - first shape parameter\n\t* @param {PositiveNumber} b - second shape parameter\n\t* @returns {Probability} pseudorandom number\n\t*\n\t* @example\n\t* var v = kumaraswamy2( 2.0, 3.0 );\n\t* // returns \n\t*/\n\tfunction kumaraswamy2( a, b ) {\n\t\tif (\n\t\t\tisnan( a ) ||\n\t\t\tisnan( b ) ||\n\t\t\ta <= 0.0 ||\n\t\t\tb <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn kumaraswamy0( rand, a, b );\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' );\n\n\n// MAIN //\n\n/**\n* Generates a Kumaraswamy's double bounded distributed random number.\n*\n* @name kumaraswamy\n* @type {PRNG}\n* @param {PositiveNumber} a - first shape parameter\n* @param {PositiveNumber} b - second shape parameter\n* @returns {Probability} pseudorandom number\n*\n* @example\n* var r = kumaraswamy( 2.0, 5.0 );\n* // returns \n*\n* @example\n* var r = kumaraswamy( -2.0, 5.0 );\n* // returns NaN\n*/\nvar kumaraswamy = factory();\n\n\n// EXPORTS //\n\nmodule.exports = kumaraswamy;\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* Kumaraswamy's double bounded distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/kumaraswamy\n*\n* @example\n* var kumaraswamy = require( '@stdlib/random/base/kumaraswamy' );\n*\n* var v = kumaraswamy( 2.0, 3.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/kumaraswamy' ).factory;\n*\n* var kumaraswamy = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = kumaraswamy();\n* // returns \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", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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 binaryFactory = require( './../../../array/tools/binary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/kumaraswamy' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from Kumaraswamy's double bounded distribution.\n*\n* @name factory\n* @type {Function}\n* @param {PositiveNumber} [a] - first shape parameter\n* @param {PositiveNumber} [b] - second shape parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `a` must be a positive number\n* @throws {TypeError} `b` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var kumaraswamy = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = kumaraswamy( 10 );\n* // returns \n*\n* @example\n* var kumaraswamy = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = kumaraswamy( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = binaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from Kumaraswamy's double bounded distribution.\n*\n* @name kumaraswamy\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {PositiveNumber} a - first shape parameter\n* @param {PositiveNumber} b - second shape parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = kumaraswamy( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = kumaraswamy( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar kumaraswamy = factory();\n\n\n// EXPORTS //\n\nmodule.exports = kumaraswamy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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* Create an array containing pseudorandom numbers drawn from Kumaraswamy's double bounded distribution.\n*\n* @module @stdlib/random/array/kumaraswamy\n*\n* @example\n* var kumaraswamy = require( '@stdlib/random/array/kumaraswamy' );\n*\n* var arr = kumaraswamy( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var kumaraswamy = require( '@stdlib/random/array/kumaraswamy' );\n*\n* var arr = kumaraswamy( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var kumaraswamy = require( '@stdlib/random/array/kumaraswamy' );\n*\n* var rand = kumaraswamy.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var kumaraswamy = require( '@stdlib/random/array/kumaraswamy' );\n*\n* var rand = kumaraswamy.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\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 isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar isnan = require( '@stdlib/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {number} mu - mean\n* @param {PositiveNumber} b - scale parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( mu, b ) {\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( b ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', b ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 sign = require( '@stdlib/math/base/special/signum' );\nvar abs = require( '@stdlib/math/base/special/abs' );\nvar ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Laplace (double exponential) distribution.\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {number} mu - mean\n* @param {PositiveNumber} b - scale parameter\n* @returns {number} pseudorandom number\n*/\nfunction laplace( rand, mu, b ) {\n\tvar u = rand() - 0.5;\n\treturn mu - ( b*sign( u )*ln( 1.0 - (2.0*abs(u)) ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = laplace;\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 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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar laplace0 = require( './laplace.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating random numbers from a Laplace (double exponential) distribution.\n*\n* @param {number} [mu] - mean\n* @param {PositiveNumber} [b] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} `mu` must be a number\n* @throws {TypeError} `b` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var laplace = factory( 0.0, 1.0 );\n* var v = laplace();\n* // returns \n*\n* @example\n* var laplace = factory( -3.0, 0.5, {\n* 'seed': 297\n* });\n* var v = laplace();\n* // returns \n*/\nfunction factory() {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar mu;\n\tvar b;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tmu = arguments[ 0 ];\n\t\tb = arguments[ 1 ];\n\t\terr = validate( mu, b );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( mu === void 0 ) {\n\t\tprng = laplace2;\n\t} else {\n\t\tprng = laplace1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'laplace' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\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 = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( mu === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ mu, b ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Laplace (double exponential) distribution with bound parameters.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = laplace1();\n\t* // returns \n\t*/\n\tfunction laplace1() {\n\t\treturn laplace0( rand, mu, b );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Laplace (double exponential) distribution.\n\t*\n\t* @private\n\t* @param {number} mu - mean\n\t* @param {PositiveNumber} b - scale parameter\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = laplace2( 0.0, 2.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = laplace2( 0.0, -1.0 );\n\t* // returns NaN\n\t*/\n\tfunction laplace2( mu, b ) {\n\t\tif (\n\t\t\tisnan( mu ) ||\n\t\t\tisnan( b ) ||\n\t\t\tb <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn laplace0( rand, mu, b );\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' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Laplace (double exponential) distribution.\n*\n* @name laplace\n* @type {PRNG}\n* @param {number} mu - mean\n* @param {PositiveNumber} b - scale parameter\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = laplace( 0.0, 2.0 );\n* // returns \n*\n* @example\n* var v = laplace( 0.0, -1.0 );\n* // returns NaN\n*/\nvar laplace = factory();\n\n\n// EXPORTS //\n\nmodule.exports = laplace;\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* Laplace (double exponential) distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/laplace\n*\n* @example\n* var laplace = require( '@stdlib/random/base/laplace' );\n*\n* var v = laplace( 0.5, 1.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/laplace' ).factory;\n* var laplace = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = laplace();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/laplace' ).factory;\n* var laplace = factory({\n* 'seed': 297\n* });\n*\n* var v = laplace( 3.0, 2.0 );\n* // returns \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", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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 binaryFactory = require( './../../../array/tools/binary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/laplace' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a Laplace (double exponential) distribution.\n*\n* @name factory\n* @type {Function}\n* @param {number} [mu] - mean\n* @param {PositiveNumber} [b] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `b` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var laplace = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = laplace( 10 );\n* // returns \n*\n* @example\n* var laplace = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = laplace( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = binaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a Laplace (double exponential) distribution.\n*\n* @name laplace\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {number} mu - mean\n* @param {PositiveNumber} b - scale parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = laplace( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = laplace( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar laplace = factory();\n\n\n// EXPORTS //\n\nmodule.exports = laplace;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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* Create an array containing pseudorandom numbers drawn from a Laplace (double exponential) distribution.\n*\n* @module @stdlib/random/array/laplace\n*\n* @example\n* var laplace = require( '@stdlib/random/array/laplace' );\n*\n* var arr = laplace( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var laplace = require( '@stdlib/random/array/laplace' );\n*\n* var arr = laplace( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var laplace = require( '@stdlib/random/array/laplace' );\n*\n* var rand = laplace.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var laplace = require( '@stdlib/random/array/laplace' );\n*\n* var rand = laplace.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\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 isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar isnan = require( '@stdlib/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {number} mu - mean\n* @param {PositiveNumber} c - scale parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( mu, c ) {\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( c ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', c ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 normalQuantile = require( '@stdlib/stats/base/dists/normal/quantile' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a L\u00E9vy distribution.\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {number} mu - location parameter\n* @param {PositiveNumber} c - scale parameter\n* @returns {number} pseudorandom number\n*/\nfunction levy( rand, mu, c ) {\n\tvar z = normalQuantile( 1.0 - ( rand() / 2.0 ), 0.0, 1.0 );\n\treturn mu + ( c / ( z*z ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = levy;\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 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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar levy0 = require( './levy.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating random numbers from a L\u00E9vy distribution.\n*\n* @param {number} [mu] - location parameter\n* @param {PositiveNumber} [c] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} `mu` must be a number\n* @throws {TypeError} `c` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var levy = factory( 0.0, 1.0 );\n* var v = levy();\n* // returns \n*\n* @example\n* var levy = factory( -3.0, 0.5, {\n* 'seed': 297\n* });\n* var v = levy();\n* // returns \n*/\nfunction factory() {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar mu;\n\tvar c;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tmu = arguments[ 0 ];\n\t\tc = arguments[ 1 ];\n\t\terr = validate( mu, c );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( mu === void 0 ) {\n\t\tprng = levy2;\n\t} else {\n\t\tprng = levy1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'levy' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\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 = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( mu === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ mu, c ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a L\u00E9vy distribution with bound parameters.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = levy1();\n\t* // returns \n\t*/\n\tfunction levy1() {\n\t\treturn levy0( rand, mu, c );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a L\u00E9vy distribution.\n\t*\n\t* @private\n\t* @param {number} mu - location parameter\n\t* @param {PositiveNumber} c - scale parameter\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = levy2( 0.0, 2.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = levy2( 0.0, -1.0 );\n\t* // returns NaN\n\t*/\n\tfunction levy2( mu, c ) {\n\t\tif (\n\t\t\tisnan( mu ) ||\n\t\t\tisnan( c ) ||\n\t\t\tc <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn levy0( rand, mu, c );\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' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a L\u00E9vy distribution.\n*\n* @name levy\n* @type {PRNG}\n* @param {number} mu - location parameter\n* @param {PositiveNumber} c - scale parameter\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = levy( 0.0, 2.0 );\n* // returns \n*\n* @example\n* var v = levy( 0.0, -1.0 );\n* // returns NaN\n*/\nvar levy = factory();\n\n\n// EXPORTS //\n\nmodule.exports = levy;\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* L\u00E9vy distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/levy\n*\n* @example\n* var levy = require( '@stdlib/random/base/levy' );\n*\n* var v = levy( 0.5, 1.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/levy' ).factory;\n* var levy = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = levy();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/levy' ).factory;\n* var levy = factory({\n* 'seed': 297\n* });\n*\n* var v = levy( 3.0, 2.0 );\n* // returns \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", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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 binaryFactory = require( './../../../array/tools/binary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/levy' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a L\u00E9vy distribution.\n*\n* @name factory\n* @type {Function}\n* @param {number} [mu] - location parameter\n* @param {PositiveNumber} [c] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `c` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var levy = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = levy( 10 );\n* // returns \n*\n* @example\n* var levy = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = levy( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = binaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a L\u00E9vy distribution.\n*\n* @name levy\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {number} mu - location parameter\n* @param {PositiveNumber} c - scale parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = levy( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = levy( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar levy = factory();\n\n\n// EXPORTS //\n\nmodule.exports = levy;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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* Create an array containing pseudorandom numbers drawn from a L\u00E9vy distribution.\n*\n* @module @stdlib/random/array/levy\n*\n* @example\n* var levy = require( '@stdlib/random/array/levy' );\n*\n* var arr = levy( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var levy = require( '@stdlib/random/array/levy' );\n*\n* var arr = levy( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var levy = require( '@stdlib/random/array/levy' );\n*\n* var rand = levy.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var levy = require( '@stdlib/random/array/levy' );\n*\n* var rand = levy.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\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 isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isnan = require( '@stdlib/assert/is-nan' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {number} mu - mean\n* @param {PositiveNumber} s - scale parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( mu, s ) {\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( s ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', s ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Returns pseudorandom number drawn from a logistic distribution.\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {number} mu - mean\n* @param {PositiveNumber} s - scale parameter\n* @returns {number} pseudorandom number\n*/\nfunction logistic( rand, mu, s ) {\n\tvar u = rand();\n\treturn mu + ( s*ln( u / (1.0-u) ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = logistic;\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 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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar logistic0 = require( './logistic.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating random numbers from a logistic distribution.\n*\n* @param {number} [mu] - mean parameter\n* @param {PositiveNumber} [s] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} `mu` must be a number\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var logistic = factory( 0.0, 1.0 );\n*\n* var v = logistic();\n* // returns \n*\n* @example\n* var logistic = factory( -3.0, 0.5, {\n* 'seed': 297\n* });\n* var v = logistic();\n* // returns \n*/\nfunction factory() {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar mu;\n\tvar s;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tmu = arguments[ 0 ];\n\t\ts = arguments[ 1 ];\n\t\terr = validate( mu, s );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( mu === void 0 ) {\n\t\tprng = logistic2;\n\t} else {\n\t\tprng = logistic1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'logistic' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\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 = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( mu === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ mu, s ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns pseudorandom number drawn from a logistic distribution with bound parameters.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = logistic1();\n\t* // returns \n\t*/\n\tfunction logistic1() {\n\t\treturn logistic0( rand, mu, s );\n\t}\n\n\t/**\n\t* Returns pseudorandom number drawn from a logistic distribution.\n\t*\n\t* @private\n\t* @param {number} mu - mean\n\t* @param {PositiveNumber} s - scale parameter\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = logistic2( 0.0, 2.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = logistic2( 0.0, -1.0 );\n\t* // returns NaN\n\t*/\n\tfunction logistic2( mu, s ) {\n\t\tif (\n\t\t\tisnan( mu ) ||\n\t\t\tisnan( s ) ||\n\t\t\ts <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn logistic0( rand, mu, s );\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' );\n\n\n// MAIN //\n\n/**\n* Returns pseudorandom number drawn from a logistic distribution.\n*\n* @name logistic\n* @type {PRNG}\n* @param {number} mu - mean\n* @param {PositiveNumber} s - scale parameter\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = logistic( 0.0, 2.0 );\n* // returns \n*\n* @example\n* var v = logistic( 0.0, -1.0 );\n* // returns NaN\n*/\nvar logistic = factory();\n\n\n// EXPORTS //\n\nmodule.exports = logistic;\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* Logistic distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/logistic\n*\n* @example\n* var logistic = require( '@stdlib/random/base/logistic' );\n*\n* var v = logistic( 0.5, 1.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/logistic' ).factory;\n* var logistic = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = logistic();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/logistic' ).factory;\n* var logistic = factory({\n* 'seed': 297\n* });\n*\n* var v = logistic( 3.0, 2.0 );\n* // returns \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", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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 binaryFactory = require( './../../../array/tools/binary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/logistic' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a logistic distribution.\n*\n* @name factory\n* @type {Function}\n* @param {number} [mu] - mean parameter\n* @param {PositiveNumber} [s] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var logistic = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = logistic( 10 );\n* // returns \n*\n* @example\n* var logistic = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = logistic( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = binaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a logistic distribution.\n*\n* @name logistic\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {number} mu - mean parameter\n* @param {PositiveNumber} s - scale parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = logistic( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = logistic( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar logistic = factory();\n\n\n// EXPORTS //\n\nmodule.exports = logistic;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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* Create an array containing pseudorandom numbers drawn from a logistic distribution.\n*\n* @module @stdlib/random/array/logistic\n*\n* @example\n* var logistic = require( '@stdlib/random/array/logistic' );\n*\n* var arr = logistic( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var logistic = require( '@stdlib/random/array/logistic' );\n*\n* var arr = logistic( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var logistic = require( '@stdlib/random/array/logistic' );\n*\n* var rand = logistic.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var logistic = require( '@stdlib/random/array/logistic' );\n*\n* var rand = logistic.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\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 isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar isnan = require( '@stdlib/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {number} mu - location parameter\n* @param {PositiveNumber} sigma - scale paramter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( mu, sigma ) {\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( sigma ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', sigma ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 exp = require( '@stdlib/math/base/special/exp' );\n\n\n// MAIN //\n\n/**\n* Returns a log-normally distributed pseudorandom number.\n*\n* @private\n* @param {PRNG} randn - PRNG for standard normally distributed numbers\n* @param {number} mu - location parameter\n* @param {PositiveNumber} sigma - scale parameter\n* @returns {PositiveNumber} pseudorandom number\n*/\nfunction lognormal( randn, mu, sigma ) {\n\treturn exp( mu + (sigma*randn()) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = lognormal;\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 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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randn = require( './../../../base/improved-ziggurat' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar lognormal0 = require( './lognormal.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating random numbers from a lognormal distribution.\n*\n* @param {number} [mu] - location parameter\n* @param {PositiveNumber} [sigma] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} `mu` must be a number\n* @throws {TypeError} `sigma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var lognormal = factory( 0.0, 1.0 );\n*\n* var v = lognormal();\n* // returns \n*\n* @example\n* var lognormal = factory( -3.0, 0.5, {\n* 'seed': 297\n* });\n* var v = lognormal();\n* // returns \n*/\nfunction factory() {\n\tvar sigma;\n\tvar rnorm;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar mu;\n\n\tif ( arguments.length === 0 ) {\n\t\trnorm = randn();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trnorm = randn({\n\t\t\t\t'prng': opts.prng\n\t\t\t});\n\t\t} else {\n\t\t\trnorm = randn( opts );\n\t\t}\n\t} else {\n\t\tmu = arguments[ 0 ];\n\t\tsigma = arguments[ 1 ];\n\t\terr = validate( mu, sigma );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trnorm = randn({\n\t\t\t\t\t'prng': opts.prng\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\trnorm = randn( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trnorm = randn();\n\t\t}\n\t}\n\tif ( mu === void 0 ) {\n\t\tprng = lognormal2;\n\t} else {\n\t\tprng = lognormal1;\n\t}\n\trand = rnorm.PRNG;\n\n\tsetReadOnly( prng, 'NAME', 'lognormal' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t}\n\tsetReadOnly( prng, 'PRNG', rand );\n\treturn prng;\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\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 = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( mu === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ mu, sigma ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a log-normally distributed pseudorandom number with bound parameters `mu` and `sigma`.\n\t*\n\t* @private\n\t* @returns {PositiveNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = lognormal1();\n\t* // returns \n\t*/\n\tfunction lognormal1() {\n\t\treturn lognormal0( rnorm, mu, sigma );\n\t}\n\n\t/**\n\t* Returns a log-normally distributed pseudorandom number with parameters `mu` and `sigma`.\n\t*\n\t* @private\n\t* @param {number} mu - location parameter\n\t* @param {PositiveNumber} sigma - scale parameter\n\t* @returns {PositiveNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = lognormal2( -2.0, 4.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = lognormal2( 0.0, -1.0 );\n\t* // returns NaN\n\t*/\n\tfunction lognormal2( mu, sigma ) {\n\t\tif (\n\t\t\tisnan( mu ) ||\n\t\t\tisnan( sigma ) ||\n\t\t\tsigma <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn lognormal0( rnorm, mu, sigma );\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' );\n\n\n// MAIN //\n\n/**\n* Returns a log-normally distributed pseudorandom number with parameters `mu` and `sigma`.\n*\n* @name lognormal\n* @type {PRNG}\n* @param {number} mu - location parameter\n* @param {PositiveNumber} sigma - scale parameter\n* @returns {PositiveNumber} pseudorandom number\n*\n* @example\n* var v = lognormal( -2.0, 4.0 );\n* // returns \n*\n* @example\n* var v = lognormal( 0.0, -1.0 );\n* // returns NaN\n*/\nvar lognormal = factory();\n\n\n// EXPORTS //\n\nmodule.exports = lognormal;\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* Log-normal distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/lognormal\n*\n* @example\n* var lognormal = require( '@stdlib/random/base/lognormal' );\n*\n* var v = lognormal( 0.0, 1.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/lognormal' ).factory;\n* var lognormal = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = lognormal();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/lognormal' ).factory;\n* var lognormal = factory({\n* 'seed': 297\n* });\n*\n* var v = lognormal( 3.0, 2.0 );\n* // returns \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", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 binaryFactory = require( './../../../array/tools/binary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/lognormal' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a lognormal distribution.\n*\n* @name factory\n* @type {Function}\n* @param {number} [mu] - location parameter\n* @param {PositiveNumber} [sigma] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `sigma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var lognormal = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = lognormal( 10 );\n* // returns \n*\n* @example\n* var lognormal = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = lognormal( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = binaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a lognormal distribution.\n*\n* @name lognormal\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {number} mu - location parameter\n* @param {PositiveNumber} sigma - scale parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = lognormal( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = lognormal( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar lognormal = factory();\n\n\n// EXPORTS //\n\nmodule.exports = lognormal;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create an array containing pseudorandom numbers drawn from a lognormal distribution.\n*\n* @module @stdlib/random/array/lognormal\n*\n* @example\n* var lognormal = require( '@stdlib/random/array/lognormal' );\n*\n* var arr = lognormal( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var lognormal = require( '@stdlib/random/array/lognormal' );\n*\n* var arr = lognormal( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var lognormal = require( '@stdlib/random/array/lognormal' );\n*\n* var rand = lognormal.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var lognormal = require( '@stdlib/random/array/lognormal' );\n*\n* var rand = lognormal.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\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 INT32_MAX = require( '@stdlib/constants/int32/max' );\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// VARIABLES //\n\nvar MAX = INT32_MAX - 1;\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom integer on the interval \\\\([1, 2^{31}-1)\\\\).\n*\n* @private\n* @returns {PositiveInteger} pseudorandom integer\n*\n* @example\n* var v = randint32();\n* // returns \n*/\nfunction randint32() {\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 = randint32;\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/* eslint-disable max-len */\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 isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isInt32Array = require( '@stdlib/assert/is-int32array' );\nvar format = require( '@stdlib/string/format' );\nvar INT32_MAX = require( '@stdlib/constants/int32/max' );\nvar Int32Array = require( '@stdlib/array/int32' );\nvar gcopy = require( '@stdlib/blas/base/gcopy' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar randint32 = require( './rand_int32.js' );\n\n\n// VARIABLES //\n\nvar NORMALIZATION_CONSTANT = (INT32_MAX - 1)|0; // asm type annotation\nvar MAX_SEED = (INT32_MAX - 1)|0; // asm type annotation\nvar A = 16807|0; // asm type annotation\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 = 2; // state, 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 | seed_length | ...seed |\n\n// Define the index offset of the seed section in the state array:\nvar SEED_SECTION_OFFSET = 4; // | version | num_sections | state_length | ...state | seed_length | ...seed |\n\n// Define the length of the \"fixed\" length portion of the state array:\nvar STATE_FIXED_LENGTH = 5; // 1 (version) + 1 (num_sections) + 1 (state_length) + 1 (state) + 1 (seed_length)\n\n\n// FUNCTIONS //\n\n/**\n* Verifies state array integrity.\n*\n* @private\n* @param {Int32Array} 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 `1`...\n\tif ( state[ STATE_SECTION_OFFSET ] !== 1 ) {\n\t\treturn new RangeError( format( 'invalid %s. State array has an incompatible state length. Expected: `%u`. Actual: `%u`.', s1, 1, state[ STATE_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// MAIN //\n\n/**\n* Returns a linear congruential pseudorandom number generator (LCG) based on Park and Miller.\n*\n* @param {Options} [options] - options\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [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 the maximum signed 32-bit integer or an array-like object containing integers less than the maximum signed 32-bit integer\n* @throws {RangeError} a numeric seed must be a positive integer less than the maximum signed 32-bit integer\n* @throws {TypeError} state must be an `Int32Array`\n* @throws {Error} must provide a valid state\n* @throws {TypeError} `copy` option must be a boolean\n* @returns {PRNG} LCG PRNG\n*\n* @example\n* var minstd = factory();\n*\n* var v = minstd();\n* // returns \n*\n* @example\n* // Return a seeded LCG:\n* var minstd = factory({\n* 'seed': 1234\n* });\n*\n* var v = minstd();\n* // returns 20739838\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 ( !isInt32Array( state ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be an Int32Array. 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 Int32Array( 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 Int32Array( STATE.buffer, STATE.byteOffset+((STATE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), 1 );\n\n\t\t\t// Create a seed \"view\":\n\t\t\tseed = new Int32Array( 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 the maximum signed 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 ) && seed.length > 0 ) {\n\t\t\t\t\tslen = seed.length;\n\t\t\t\t\tSTATE = new Int32Array( 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 ] = 1;\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 Int32Array( STATE.buffer, STATE.byteOffset+((STATE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), 1 );\n\n\t\t\t\t\t// Create a seed \"view\":\n\t\t\t\t\tseed = new Int32Array( 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[ 0 ] = seed[ 0 ];\n\t\t\t\t} else {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be either a positive integer less than the maximum signed 32-bit integer or an array-like object containing integer values less than the maximum signed 32-bit integer. Option: `%s`.', 'seed', seed ) );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tseed = randint32()|0; // asm type annotation\n\t\t\t}\n\t\t}\n\t} else {\n\t\tseed = randint32()|0; // asm type annotation\n\t}\n\tif ( state === void 0 ) {\n\t\tSTATE = new Int32Array( 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 ] = 1;\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 Int32Array( STATE.buffer, STATE.byteOffset+((STATE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), 1 );\n\n\t\t// Create a seed \"view\":\n\t\tseed = new Int32Array( 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[ 0 ] = seed[ 0 ];\n\t}\n\tsetReadOnly( minstd, 'NAME', 'minstd' );\n\tsetReadOnlyAccessor( minstd, 'seed', getSeed );\n\tsetReadOnlyAccessor( minstd, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( minstd, 'state', getState, setState );\n\tsetReadOnlyAccessor( minstd, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( minstd, 'byteLength', getStateSize );\n\tsetReadOnly( minstd, 'toJSON', toJSON );\n\tsetReadOnly( minstd, 'MIN', 1 );\n\tsetReadOnly( minstd, 'MAX', INT32_MAX-1 );\n\tsetReadOnly( minstd, 'normalized', normalized );\n\n\tsetReadOnly( normalized, 'NAME', minstd.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', (minstd.MIN-1.0) / NORMALIZATION_CONSTANT );\n\tsetReadOnly( normalized, 'MAX', (minstd.MAX-1.0) / NORMALIZATION_CONSTANT );\n\n\treturn minstd;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMINSTD} seed\n\t*/\n\tfunction getSeed() {\n\t\tvar len = STATE[ SEED_SECTION_OFFSET ];\n\t\treturn gcopy( len, seed, 1, new Int32Array( 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 `2` sections:\n\t*\n\t* 0. preamble (version + number of sections)\n\t* 1. internal PRNG state\n\t* 2. 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., `2`).\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 {PRNGStateMINSTD} current state\n\t*/\n\tfunction getState() {\n\t\tvar len = STATE.length;\n\t\treturn gcopy( len, STATE, 1, new Int32Array( 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 {PRNGStateMINSTD} s - generator state\n\t* @throws {TypeError} must provide an `Int32Array`\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\tvar err;\n\t\tif ( !isInt32Array( s ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide an Int32Array. 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 Int32Array( 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 Int32Array( STATE.buffer, STATE.byteOffset+((STATE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), 1 );\n\n\t\t// Create a new seed \"view\":\n\t\tseed = new Int32Array( 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 = minstd.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 \\\\( [1,2^{31}-1) \\\\).\n\t*\n\t* @private\n\t* @returns {integer32} pseudorandom integer\n\t*/\n\tfunction minstd() {\n\t\tvar s = state[ 0 ]|0; // asm type annotation\n\t\ts = ( (A*s)%INT32_MAX )|0; // asm type annotation\n\t\tstate[ 0 ] = s;\n\t\treturn s|0; // asm type annotation\n\t}\n\n\t/**\n\t* Generates a pseudorandom number on the interval \\\\( [0,1) \\\\).\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*/\n\tfunction normalized() {\n\t\treturn (minstd()-1) / 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 randint32 = require( './rand_int32.js' );\n\n\n// MAIN //\n\n/**\n* Generates a pseudorandom integer on the interval \\\\( [1,2^{31}-1) \\\\).\n*\n* ## Method\n*\n* Linear congruential generators (LCGs) use the recurrence relation\n*\n* ```tex\n* X_{n+1} = ( a \\cdot X_n + c ) \\operatorname{mod}(m)\n* ```\n*\n* where the modulus \\\\( m \\\\) is a prime number or power of a prime number and \\\\( a \\\\) is a primitive root modulo \\\\( m \\\\).\n*\n* \n*\n* For an LCG to be a Lehmer RNG, the seed \\\\( X_0 \\\\) must be coprime to \\\\( m \\\\).\n*\n* \n*\n* In this implementation, the constants \\\\( a \\\\), \\\\( c \\\\), and \\\\( m \\\\) have the values\n*\n* ```tex\n* \\begin{align*}\n* a &= 7^5 = 16807 \\\\\n* c &= 0 \\\\\n* m &= 2^{31} - 1 = 2147483647\n* \\end{align*}\n* ```\n*\n* \n*\n* The constant \\\\( m \\\\) is a Mersenne prime (modulo \\\\(31\\\\)).\n*\n* \n*\n* \n*\n* The constant \\\\( a \\\\) is a primitive root (modulo \\\\(31\\\\)).\n*\n* \n*\n* Accordingly, the maximum possible product is\n*\n* ```tex\n* 16807 \\cdot (m - 1) \\approx 2^{46}\n* ```\n*\n* The values for \\\\( a \\\\), \\\\( c \\\\), and \\\\( m \\\\) are taken from Park and Miller, \"Random Number Generators: Good Ones Are Hard To Find\". Park's and Miller's article is also the basis for a recipe in the second edition of _Numerical Recipes in C_.\n*\n*\n* ## Notes\n*\n* - The generator has a period of approximately \\\\(2.1\\mbox{e}9\\\\) (see [Numerical Recipes in C, 2nd Edition](#references), p. 279).\n*\n*\n* ## References\n*\n* - Park, S. K., and K. W. Miller. 1988. \"Random Number Generators: Good Ones Are Hard to Find.\" _Communications of the ACM_ 31 (10). New York, NY, USA: ACM: 1192\u20131201. doi:[10.1145/63039.63042](http://dx.doi.org/10.1145/63039.63042).\n* - Press, William H., Brian P. Flannery, Saul A. Teukolsky, and William T. Vetterling. 1992. _Numerical Recipes in C: The Art of Scientific Computing, Second Edition_. Cambridge University Press.\n*\n*\n* @function minstd\n* @type {PRNG}\n* @returns {PositiveInteger} pseudorandom integer\n*\n* @example\n* var v = minstd();\n* // returns \n*/\nvar minstd = factory({\n\t'seed': randint32()\n});\n\n\n// EXPORTS //\n\nmodule.exports = minstd;\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 linear congruential pseudorandom number generator (LCG) based on Park and Miller.\n*\n* @module @stdlib/random/base/minstd\n*\n* @example\n* var minstd = require( '@stdlib/random/base/minstd' );\n*\n* var v = minstd();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/minstd' ).factory;\n*\n* var minstd = factory({\n* 'seed': 1234\n* });\n*\n* var v = minstd();\n* // returns 20739838\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", "{\n\t\"idtype\": \"float64\",\n \"ndtype\": \"float64\"\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 fdtypes = require( '@stdlib/array/typed-real-float-dtypes' );\nvar rdtypes = require( '@stdlib/array/typed-real-dtypes' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar RDTYPES = rdtypes();\nvar FDTYPES = fdtypes();\nRDTYPES.push( 'generic' );\nFDTYPES.push( 'generic' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* ## Notes\n*\n* - Validation modes:\n*\n* - `0`: factory validation\n* - `1`: integer PRNG validation\n* - `2`: normalized PRNG validation\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.dtype] - output array data type\n* @param {string} [options.idtype] - output array data type when generating integers\n* @param {string} [options.rdtype] - output array data type when generating normalized numbers\n* @param {integer} mode - validation mode\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'dtype': 'float64'\n* };\n* var err = validate( opts, options, 0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options, mode ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( mode === 0 ) {\n\t\tif ( hasOwnProp( options, 'idtype' ) ) {\n\t\t\topts.idtype = options.idtype;\n\t\t\tif ( RDTYPES.indexOf( opts.idtype ) < 0 ) {\n\t\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'idtype', RDTYPES.join( '\", \"' ), opts.idtype ) );\n\t\t\t}\n\t\t}\n\t\tif ( hasOwnProp( options, 'ndtype' ) ) {\n\t\t\topts.ndtype = options.ndtype;\n\t\t\tif ( FDTYPES.indexOf( opts.ndtype ) < 0 ) {\n\t\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'ndtype', FDTYPES.join( '\", \"' ), opts.ndtype ) );\n\t\t\t}\n\t\t}\n\t} else if ( mode === 1 && hasOwnProp( options, 'dtype' ) ) {\n\t\topts.dtype = options.dtype;\n\t\tif ( RDTYPES.indexOf( opts.dtype ) < 0 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', RDTYPES.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t} else if ( hasOwnProp( options, 'dtype' ) ) { // mode === 2\n\t\topts.dtype = options.dtype;\n\t\tif ( FDTYPES.indexOf( opts.dtype ) < 0 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', FDTYPES.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\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 base = require( './../../../base/minstd' );\nvar ctors = require( '@stdlib/array/typed-real-ctors' );\nvar filledBy = require( '@stdlib/array/base/filled-by' );\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar format = require( '@stdlib/string/format' );\nvar defaults = require( './defaults.json' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers generated using a linear congruential pseudorandom number generator (LCG).\n*\n* @param {Options} [options] - function options\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.idtype=\"float64\"] - default data type when generating integers\n* @param {string} [options.ndtype=\"float64\"] - default data type when generating normalized numbers\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var minstd = factory();\n* // returns \n*\n* var arr = minstd( 10 );\n* // returns \n*\n* @example\n* var minstd = factory();\n* // returns \n*\n* var arr = minstd( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var minstd = factory();\n* // returns \n*\n* var arr = minstd.normalized( 10 );\n* // returns \n*/\nfunction factory() {\n\tvar options;\n\tvar nargs;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\n\topts = {\n\t\t'idtype': defaults.idtype,\n\t\t'ndtype': defaults.ndtype\n\t};\n\n\tnargs = arguments.length;\n\trand = minstd;\n\tif ( nargs === 0 ) {\n\t\tprng = base;\n\t} else if ( nargs === 1 ) {\n\t\toptions = arguments[ 0 ];\n\t\tprng = base.factory( options );\n\t\terr = validate( opts, options, 0 );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\tsetReadOnlyAccessor( rand, 'seed', getSeed );\n\tsetReadOnlyAccessor( rand, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( rand, 'state', getState, setState );\n\tsetReadOnlyAccessor( rand, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( rand, 'byteLength', getStateSize );\n\tsetReadOnly( rand, 'PRNG', prng );\n\tsetReadOnly( rand, 'normalized', normalized );\n\treturn rand;\n\n\t/**\n\t* Returns an array containing pseudorandom integers on the interval `[1, 2147483646]`.\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction minstd( len, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 1 ) {\n\t\t\terr = validate( o, options, 1 );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tdt = o.dtype || opts.idtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, prng );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tnullary( [ out ], [ len ], [ 1 ], prng );\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns an array containing pseudorandom numbers on the interval `[0, 1)`.\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction normalized( len, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 1 ) {\n\t\t\terr = validate( o, options, 2 );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tdt = o.dtype || opts.ndtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, prng.normalized );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tnullary( [ out ], [ len ], [ 1 ], prng.normalized );\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {Int32Array} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {Int32Array} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {Int32Array} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom integers on the interval `[1, 2147483646]`.\n*\n* @name minstd\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = minstd( 10 );\n* // returns \n*\n* @example\n* var arr = minstd.normalized( 10 );\n* // returns \n*\n* @example\n* var arr = minstd( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar minstd = factory();\n\n\n// EXPORTS //\n\nmodule.exports = minstd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create an array containing pseudorandom numbers generated using a linear congruential pseudorandom number generator (LCG).\n*\n* @module @stdlib/random/array/minstd\n*\n* @example\n* var minstd = require( '@stdlib/random/array/minstd' );\n*\n* var arr = minstd( 10 );\n* // returns \n*\n* @example\n* var minstd = require( '@stdlib/random/array/minstd' );\n*\n* var arr = minstd( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var minstd = require( '@stdlib/random/array/minstd' );\n*\n* var arr = minstd.normalized( 10 );\n* // returns \n*\n* @example\n* var minstd = require( '@stdlib/random/array/minstd' );\n*\n* var arr = minstd.normalized( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var minstd = require( '@stdlib/random/array/minstd' );\n*\n* var rand = minstd.factory();\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var minstd = require( '@stdlib/random/array/minstd' );\n*\n* var rand = minstd.factory();\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"normalized\": \"main.normalized\" }\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 isnan = require( '@stdlib/math/base/assert/is-nan' );\n\n\n// VARIABLES //\n\nvar NUM_WARMUPS = 8;\n\n\n// MAIN //\n\n/**\n* Initializes a shuffle table.\n*\n* @private\n* @param {PRNG} rand - pseudorandom number generator\n* @param {Int32Array} table - table\n* @param {PositiveInteger} N - table size\n* @throws {Error} PRNG returned `NaN`\n* @returns {NumberArray} shuffle table\n*/\nfunction createTable( rand, table, N ) {\n\tvar v;\n\tvar i;\n\n\t// \"warm-up\" the PRNG...\n\tfor ( i = 0; i < NUM_WARMUPS; i++ ) {\n\t\tv = rand();\n\n\t\t// Prevent the above loop from being discarded by the compiler...\n\t\tif ( isnan( v ) ) {\n\t\t\tthrow new Error( 'unexpected error. PRNG returned NaN.' );\n\t\t}\n\t}\n\t// Initialize the shuffle table...\n\tfor ( i = N-1; i >= 0; i-- ) {\n\t\ttable[ i ] = rand();\n\t}\n\treturn table;\n}\n\n\n// EXPORTS //\n\nmodule.exports = createTable;\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 INT32_MAX = require( '@stdlib/constants/int32/max' );\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// VARIABLES //\n\nvar MAX = INT32_MAX - 1;\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom integer on the interval \\\\([1, 2^{31}-1)\\\\).\n*\n* @private\n* @returns {PositiveInteger} pseudorandom integer\n*\n* @example\n* var v = randint32();\n* // returns \n*/\nfunction randint32() {\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 = randint32;\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/* eslint-disable max-len */\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 isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isCollection = require( '@stdlib/assert/is-collection' );\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isInt32Array = require( '@stdlib/assert/is-int32array' );\nvar gcopy = require( '@stdlib/blas/base/gcopy' );\nvar floor = require( '@stdlib/math/base/special/floor' );\nvar Int32Array = require( '@stdlib/array/int32' );\nvar INT32_MAX = require( '@stdlib/constants/int32/max' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar createTable = require( './create_table.js' );\nvar randint32 = require( './rand_int32.js' );\n\n\n// VARIABLES //\n\nvar NORMALIZATION_CONSTANT = (INT32_MAX - 1)|0; // asm type annotation\nvar MAX_SEED = (INT32_MAX - 1)|0; // asm type annotation\nvar A = 16807|0; // asm type annotation\n\n// Define the number of elements in the shuffle table:\nvar TABLE_LENGTH = 32;\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; // table, other, seed\n\n// Define the index offset of the \"table\" section in the state array:\nvar TABLE_SECTION_OFFSET = 2; // | version | num_sections | table_length | ...table | other_length | shuffle_state | prng_state | seed_length | ...seed |\n\n// Define the index offset of the \"state\" section in the state array:\nvar STATE_SECTION_OFFSET = TABLE_LENGTH + 3; // | version | num_sections | table_length | ...table | state_length | shuffle_state | prng_state | seed_length | ...seed |\n\n// Define the index offset of the seed section in the state array:\nvar SEED_SECTION_OFFSET = TABLE_LENGTH + 6; // | version | num_sections | table_length | ...table | state_length | shuffle_state | prng_state | seed_length | ...seed |\n\n// Define the length of the \"fixed\" length portion of the state array:\nvar STATE_FIXED_LENGTH = TABLE_LENGTH + 7; // 1 (version) + 1 (num_sections) + 1 (table_length) + TABLE_LENGTH (table) + 1 (state_length) + 1 (shuffle_state) + 1 (prng_state) + 1 (seed_length)\n\n// Define the indices for the shuffle table and PRNG states:\nvar SHUFFLE_STATE = STATE_SECTION_OFFSET + 1;\nvar PRNG_STATE = STATE_SECTION_OFFSET + 2;\n\n\n// FUNCTIONS //\n\n/**\n* Verifies state array integrity.\n*\n* @private\n* @param {Int32Array} 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 \"table\" section must equal `TABLE_LENGTH`...\n\tif ( state[ TABLE_SECTION_OFFSET ] !== TABLE_LENGTH ) {\n\t\treturn new RangeError( format( 'invalid %s. State array has an incompatible table length. Expected: `%s`. Actual: `%s`.', s1, TABLE_LENGTH, state[ TABLE_SECTION_OFFSET ] ) );\n\t}\n\t// The length of the \"state\" section must equal `2`...\n\tif ( state[ STATE_SECTION_OFFSET ] !== 2 ) {\n\t\treturn new RangeError( format( 'invalid %s. State array has an incompatible state length. Expected: `%u`. Actual: `%u`.', s1, 2, state[ STATE_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// MAIN //\n\n/**\n* Returns a linear congruential pseudorandom number generator (LCG) whose output is shuffled.\n*\n* @param {Options} [options] - options\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [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 the maximum signed 32-bit integer or an array-like object containing integers less than the maximum signed 32-bit integer\n* @throws {RangeError} a numeric seed must be a positive integer less than the maximum signed 32-bit integer\n* @throws {TypeError} state must be an `Int32Array`\n* @throws {Error} must provide a valid state\n* @throws {TypeError} `copy` option must be a boolean\n* @returns {PRNG} shuffled LCG PRNG\n*\n* @example\n* var minstd = factory();\n*\n* var v = minstd();\n* // returns \n*\n* @example\n* // Return a seeded LCG:\n* var minstd = factory({\n* 'seed': 1234\n* });\n*\n* var v = minstd();\n* // returns 1421600654\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 ( !isInt32Array( state ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be an Int32Array. 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 Int32Array( state.length );\n\t\t\t\tgcopy( state.length, state, 1, STATE, 1 );\n\t\t\t}\n\t\t\t// Create a state (table) \"view\":\n\t\t\tstate = new Int32Array( STATE.buffer, STATE.byteOffset+((TABLE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), TABLE_LENGTH );\n\n\t\t\t// Create a seed \"view\":\n\t\t\tseed = new Int32Array( 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 the maximum signed 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 ) && seed.length > 0 ) {\n\t\t\t\t\tslen = seed.length;\n\t\t\t\t\tSTATE = new Int32Array( 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[ TABLE_SECTION_OFFSET ] = TABLE_LENGTH;\n\t\t\t\t\tSTATE[ STATE_SECTION_OFFSET ] = 2;\n\t\t\t\t\tSTATE[ PRNG_STATE ] = seed[ 0 ];\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 (table) \"view\":\n\t\t\t\t\tstate = new Int32Array( STATE.buffer, STATE.byteOffset+((TABLE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), TABLE_LENGTH );\n\n\t\t\t\t\t// Create a seed \"view\":\n\t\t\t\t\tseed = new Int32Array( 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 = createTable( minstd, state, TABLE_LENGTH );\n\t\t\t\t\tSTATE[ SHUFFLE_STATE ] = state[ 0 ];\n\t\t\t\t} else {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be either a positive integer less than the maximum signed 32-bit integer or an array-like object containing integer values less than the maximum signed 32-bit integer. Option: `%s`.', 'seed', seed ) );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tseed = randint32()|0; // asm type annotation\n\t\t\t}\n\t\t}\n\t} else {\n\t\tseed = randint32()|0; // asm type annotation\n\t}\n\tif ( state === void 0 ) {\n\t\tSTATE = new Int32Array( 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[ TABLE_SECTION_OFFSET ] = TABLE_LENGTH;\n\t\tSTATE[ STATE_SECTION_OFFSET ] = 2;\n\t\tSTATE[ PRNG_STATE ] = seed;\n\t\tSTATE[ SEED_SECTION_OFFSET ] = 1;\n\t\tSTATE[ SEED_SECTION_OFFSET+1 ] = seed;\n\n\t\t// Create a state (table) \"view\":\n\t\tstate = new Int32Array( STATE.buffer, STATE.byteOffset+((TABLE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), TABLE_LENGTH );\n\n\t\t// Create a seed \"view\":\n\t\tseed = new Int32Array( 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 = createTable( minstd, state, TABLE_LENGTH );\n\t\tSTATE[ SHUFFLE_STATE ] = state[ 0 ];\n\t}\n\tsetReadOnly( minstdShuffle, 'NAME', 'minstd-shuffle' );\n\tsetReadOnlyAccessor( minstdShuffle, 'seed', getSeed );\n\tsetReadOnlyAccessor( minstdShuffle, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( minstdShuffle, 'state', getState, setState );\n\tsetReadOnlyAccessor( minstdShuffle, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( minstdShuffle, 'byteLength', getStateSize );\n\tsetReadOnly( minstdShuffle, 'toJSON', toJSON );\n\tsetReadOnly( minstdShuffle, 'MIN', 1 );\n\tsetReadOnly( minstdShuffle, 'MAX', INT32_MAX-1 );\n\tsetReadOnly( minstdShuffle, 'normalized', normalized );\n\n\tsetReadOnly( normalized, 'NAME', minstdShuffle.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', (minstdShuffle.MIN-1.0) / NORMALIZATION_CONSTANT );\n\tsetReadOnly( normalized, 'MAX', (minstdShuffle.MAX-1.0) / NORMALIZATION_CONSTANT );\n\n\treturn minstdShuffle;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMINSTD} seed\n\t*/\n\tfunction getSeed() {\n\t\tvar len = STATE[ SEED_SECTION_OFFSET ];\n\t\treturn gcopy( len, seed, 1, new Int32Array( 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. shuffle table\n\t* 2. internal PRNG state\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 {PRNGStateMINSTD} current state\n\t*/\n\tfunction getState() {\n\t\tvar len = STATE.length;\n\t\treturn gcopy( len, STATE, 1, new Int32Array( 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 {PRNGStateMINSTD} s - generator state\n\t* @throws {TypeError} must provide an `Int32Array`\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\tvar err;\n\t\tif ( !isInt32Array( s ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide an Int32Array. 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 Int32Array( 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 (table) \"view\":\n\t\tstate = new Int32Array( STATE.buffer, STATE.byteOffset+((TABLE_SECTION_OFFSET+1)*STATE.BYTES_PER_ELEMENT), TABLE_LENGTH );\n\n\t\t// Create a new seed \"view\":\n\t\tseed = new Int32Array( 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 = minstdShuffle.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 \\\\( [1,2^{31}-1) \\\\).\n\t*\n\t* @private\n\t* @returns {integer32} pseudorandom integer\n\t*/\n\tfunction minstd() {\n\t\tvar s = STATE[ PRNG_STATE ]|0; // asm type annotation\n\t\ts = ( (A*s)%INT32_MAX )|0; // asm type annotation\n\t\tSTATE[ PRNG_STATE ] = s;\n\t\treturn s|0; // asm type annotation\n\t}\n\n\t/**\n\t* Generates a pseudorandom integer on the interval \\\\( [1,2^{31}-1) \\\\).\n\t*\n\t* @private\n\t* @returns {integer32} pseudorandom integer\n\t*\n\t* @example\n\t* var v = minstd();\n\t* // returns \n\t*/\n\tfunction minstdShuffle() {\n\t\tvar s;\n\t\tvar i;\n\n\t\ts = STATE[ SHUFFLE_STATE ];\n\t\ti = floor( TABLE_LENGTH * (s/INT32_MAX) );\n\n\t\t// Pull a state from the table:\n\t\ts = state[ i ];\n\n\t\t// Update the PRNG state:\n\t\tSTATE[ SHUFFLE_STATE ] = s;\n\n\t\t// Replace the pulled state:\n\t\tstate[ i ] = minstd();\n\n\t\treturn s;\n\t}\n\n\t/**\n\t* Generates a pseudorandom number on the interval \\\\( [0,1) \\\\).\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = normalized();\n\t* // returns \n\t*/\n\tfunction normalized() {\n\t\treturn (minstdShuffle()-1) / 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 randint32 = require( './rand_int32.js' );\n\n\n// MAIN //\n\n/**\n* Generates a pseudorandom integer on the interval \\\\( [1,2^{31}-1) \\\\).\n*\n* ## Method\n*\n* Linear congruential generators (LCGs) use the recurrence relation\n*\n* ```tex\n* X_{n+1} = ( a \\cdot X_n + c ) \\operatorname{mod}(m)\n* ```\n*\n* where the modulus \\\\( m \\\\) is a prime number or power of a prime number and \\\\( a \\\\) is a primitive root modulo \\\\( m \\\\).\n*\n* \n*\n* For an LCG to be a Lehmer RNG, the seed \\\\( X_0 \\\\) must be coprime to \\\\( m \\\\).\n*\n* \n*\n* In this implementation, the constants \\\\( a \\\\), \\\\( c \\\\), and \\\\( m \\\\) have the values\n*\n* ```tex\n* \\begin{align*}\n* a &= 7^5 = 16807 \\\\\n* c &= 0 \\\\\n* m &= 2^{31} - 1 = 2147483647\n* \\end{align*}\n* ```\n*\n* \n*\n* The constant \\\\( m \\\\) is a Mersenne prime (modulo \\\\(31\\\\)).\n*\n* \n*\n* \n*\n* The constant \\\\( a \\\\) is a primitive root (modulo \\\\(31\\\\)).\n*\n* \n*\n* Accordingly, the maximum possible product is\n*\n* ```tex\n* 16807 \\cdot (m - 1) \\approx 2^{46}\n* ```\n*\n* The values for \\\\( a \\\\), \\\\( c \\\\), and \\\\( m \\\\) are taken from Park and Miller, \"Random Number Generators: Good Ones Are Hard To Find\". Park's and Miller's article is also the basis for a recipe in the second edition of _Numerical Recipes in C_.\n*\n* This implementation subsequently shuffles the output of a linear congruential pseudorandom number generator (LCG) using a shuffle table in accordance with the Bays-Durham algorithm.\n*\n* ## Notes\n*\n* - The generator has a period of approximately \\\\(2.1\\mbox{e}9\\\\) (see [Numerical Recipes in C, 2nd Edition](#references), p. 279).\n*\n* ## References\n*\n* - Bays, Carter, and S. D. Durham. 1976. \"Improving a Poor Random Number Generator.\" _ACM Transactions on Mathematical Software_ 2 (1). New York, NY, USA: ACM: 59\u201364. doi:[10.1145/355666.355670](http://dx.doi.org/10.1145/355666.355670).\n* - Herzog, T.N., and G. Lord. 2002. _Applications of Monte Carlo Methods to Finance and Insurance_. ACTEX Publications. [https://books.google.com/books?id=vC7I\\\\\\_gdX-A0C](https://books.google.com/books?id=vC7I\\_gdX-A0C).\n* - Press, William H., Brian P. Flannery, Saul A. Teukolsky, and William T. Vetterling. 1992. _Numerical Recipes in C: The Art of Scientific Computing, Second Edition_. Cambridge University Press.\n*\n* @function minstd\n* @type {PRNG}\n* @returns {PositiveInteger} pseudorandom integer\n*\n* @example\n* var v = minstd();\n* // returns \n*/\nvar minstd = factory({\n\t'seed': randint32()\n});\n\n\n// EXPORTS //\n\nmodule.exports = minstd;\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 linear congruential pseudorandom number generator (LCG) whose output is shuffled.\n*\n* @module @stdlib/random/base/minstd-shuffle\n*\n* @example\n* var minstd = require( '@stdlib/random/base/minstd-shuffle' );\n*\n* var v = minstd();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/minstd-shuffle' ).factory;\n*\n* var minstd = factory({\n* 'seed': 1234\n* });\n*\n* var v = minstd();\n* // returns 1421600654\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", "{\n\t\"idtype\": \"float64\",\n \"ndtype\": \"float64\"\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 fdtypes = require( '@stdlib/array/typed-real-float-dtypes' );\nvar rdtypes = require( '@stdlib/array/typed-real-dtypes' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar RDTYPES = rdtypes();\nvar FDTYPES = fdtypes();\nRDTYPES.push( 'generic' );\nFDTYPES.push( 'generic' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* ## Notes\n*\n* - Validation modes:\n*\n* - `0`: factory validation\n* - `1`: integer PRNG validation\n* - `2`: normalized PRNG validation\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.dtype] - output array data type\n* @param {string} [options.idtype] - output array data type when generating integers\n* @param {string} [options.rdtype] - output array data type when generating normalized numbers\n* @param {integer} mode - validation mode\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'dtype': 'float64'\n* };\n* var err = validate( opts, options, 0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options, mode ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( mode === 0 ) {\n\t\tif ( hasOwnProp( options, 'idtype' ) ) {\n\t\t\topts.idtype = options.idtype;\n\t\t\tif ( RDTYPES.indexOf( opts.idtype ) < 0 ) {\n\t\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'idtype', RDTYPES.join( '\", \"' ), opts.idtype ) );\n\t\t\t}\n\t\t}\n\t\tif ( hasOwnProp( options, 'ndtype' ) ) {\n\t\t\topts.ndtype = options.ndtype;\n\t\t\tif ( FDTYPES.indexOf( opts.ndtype ) < 0 ) {\n\t\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'ndtype', FDTYPES.join( '\", \"' ), opts.ndtype ) );\n\t\t\t}\n\t\t}\n\t} else if ( mode === 1 && hasOwnProp( options, 'dtype' ) ) {\n\t\topts.dtype = options.dtype;\n\t\tif ( RDTYPES.indexOf( opts.dtype ) < 0 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', RDTYPES.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t} else if ( hasOwnProp( options, 'dtype' ) ) { // mode === 2\n\t\topts.dtype = options.dtype;\n\t\tif ( FDTYPES.indexOf( opts.dtype ) < 0 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', FDTYPES.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\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 base = require( './../../../base/minstd-shuffle' );\nvar ctors = require( '@stdlib/array/typed-real-ctors' );\nvar filledBy = require( '@stdlib/array/base/filled-by' );\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar format = require( '@stdlib/string/format' );\nvar defaults = require( './defaults.json' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers generated using a linear congruential pseudorandom number generator (LCG) whose output is shuffled.\n*\n* @param {Options} [options] - function options\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.idtype=\"float64\"] - default data type when generating integers\n* @param {string} [options.ndtype=\"float64\"] - default data type when generating normalized numbers\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var minstd = factory();\n* // returns \n*\n* var arr = minstd( 10 );\n* // returns \n*\n* @example\n* var minstd = factory();\n* // returns \n*\n* var arr = minstd( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var minstd = factory();\n* // returns \n*\n* var arr = minstd.normalized( 10 );\n* // returns \n*/\nfunction factory() {\n\tvar options;\n\tvar nargs;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\n\topts = {\n\t\t'idtype': defaults.idtype,\n\t\t'ndtype': defaults.ndtype\n\t};\n\n\tnargs = arguments.length;\n\trand = minstd;\n\tif ( nargs === 0 ) {\n\t\tprng = base;\n\t} else if ( nargs === 1 ) {\n\t\toptions = arguments[ 0 ];\n\t\tprng = base.factory( options );\n\t\terr = validate( opts, options, 0 );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\tsetReadOnlyAccessor( rand, 'seed', getSeed );\n\tsetReadOnlyAccessor( rand, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( rand, 'state', getState, setState );\n\tsetReadOnlyAccessor( rand, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( rand, 'byteLength', getStateSize );\n\tsetReadOnly( rand, 'PRNG', prng );\n\tsetReadOnly( rand, 'normalized', normalized );\n\treturn rand;\n\n\t/**\n\t* Returns an array containing pseudorandom integers on the interval `[1, 2147483646]`.\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction minstd( len, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 1 ) {\n\t\t\terr = validate( o, options, 1 );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tdt = o.dtype || opts.idtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, prng );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tnullary( [ out ], [ len ], [ 1 ], prng );\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns an array containing pseudorandom numbers on the interval `[0, 1)`.\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction normalized( len, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 1 ) {\n\t\t\terr = validate( o, options, 2 );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tdt = o.dtype || opts.ndtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, prng.normalized );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tnullary( [ out ], [ len ], [ 1 ], prng.normalized );\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {Int32Array} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {Int32Array} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {Int32Array} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom integers on the interval `[1, 2147483646]`.\n*\n* @name minstd\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = minstd( 10 );\n* // returns \n*\n* @example\n* var arr = minstd.normalized( 10 );\n* // returns \n*\n* @example\n* var arr = minstd( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar minstd = factory();\n\n\n// EXPORTS //\n\nmodule.exports = minstd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create an array containing pseudorandom numbers generated using a linear congruential pseudorandom number generator (LCG) whose output is shuffled.\n*\n* @module @stdlib/random/array/minstd-shuffle\n*\n* @example\n* var minstd = require( '@stdlib/random/array/minstd-shuffle' );\n*\n* var arr = minstd( 10 );\n* // returns \n*\n* @example\n* var minstd = require( '@stdlib/random/array/minstd-shuffle' );\n*\n* var arr = minstd( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var minstd = require( '@stdlib/random/array/minstd-shuffle' );\n*\n* var arr = minstd.normalized( 10 );\n* // returns \n*\n* @example\n* var minstd = require( '@stdlib/random/array/minstd-shuffle' );\n*\n* var arr = minstd.normalized( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var minstd = require( '@stdlib/random/array/minstd-shuffle' );\n*\n* var rand = minstd.factory();\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var minstd = require( '@stdlib/random/array/minstd-shuffle' );\n*\n* var rand = minstd.factory();\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"normalized\": \"main.normalized\" }\n", "{\n\t\"idtype\": \"float64\",\n \"ndtype\": \"float64\"\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 fdtypes = require( '@stdlib/array/typed-real-float-dtypes' );\nvar rdtypes = require( '@stdlib/array/typed-real-dtypes' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar RDTYPES = rdtypes();\nvar FDTYPES = fdtypes();\nRDTYPES.push( 'generic' );\nFDTYPES.push( 'generic' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* ## Notes\n*\n* - Validation modes:\n*\n* - `0`: factory validation\n* - `1`: integer PRNG validation\n* - `2`: normalized PRNG validation\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.dtype] - output array data type\n* @param {string} [options.idtype] - output array data type when generating integers\n* @param {string} [options.rdtype] - output array data type when generating normalized numbers\n* @param {integer} mode - validation mode\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'dtype': 'float64'\n* };\n* var err = validate( opts, options, 0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options, mode ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( mode === 0 ) {\n\t\tif ( hasOwnProp( options, 'idtype' ) ) {\n\t\t\topts.idtype = options.idtype;\n\t\t\tif ( RDTYPES.indexOf( opts.idtype ) < 0 ) {\n\t\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'idtype', RDTYPES.join( '\", \"' ), opts.idtype ) );\n\t\t\t}\n\t\t}\n\t\tif ( hasOwnProp( options, 'ndtype' ) ) {\n\t\t\topts.ndtype = options.ndtype;\n\t\t\tif ( FDTYPES.indexOf( opts.ndtype ) < 0 ) {\n\t\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'ndtype', FDTYPES.join( '\", \"' ), opts.ndtype ) );\n\t\t\t}\n\t\t}\n\t} else if ( mode === 1 && hasOwnProp( options, 'dtype' ) ) {\n\t\topts.dtype = options.dtype;\n\t\tif ( RDTYPES.indexOf( opts.dtype ) < 0 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', RDTYPES.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t} else if ( hasOwnProp( options, 'dtype' ) ) { // mode === 2\n\t\topts.dtype = options.dtype;\n\t\tif ( FDTYPES.indexOf( opts.dtype ) < 0 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', FDTYPES.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\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 base = require( './../../../base/mt19937' );\nvar ctors = require( '@stdlib/array/typed-real-ctors' );\nvar filledBy = require( '@stdlib/array/base/filled-by' );\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar format = require( '@stdlib/string/format' );\nvar defaults = require( './defaults.json' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers generated using a 32-bit Mersenne Twister pseudorandom number generator.\n*\n* @param {Options} [options] - function 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* @param {string} [options.idtype=\"float64\"] - default data type when generating integers\n* @param {string} [options.ndtype=\"float64\"] - default data type when generating normalized numbers\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var mt19937 = factory();\n* // returns \n*\n* var arr = mt19937( 10 );\n* // returns \n*\n* @example\n* var mt19937 = factory();\n* // returns \n*\n* var arr = mt19937( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var mt19937 = factory();\n* // returns \n*\n* var arr = mt19937.normalized( 10 );\n* // returns \n*/\nfunction factory() {\n\tvar options;\n\tvar nargs;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\n\topts = {\n\t\t'idtype': defaults.idtype,\n\t\t'ndtype': defaults.ndtype\n\t};\n\n\tnargs = arguments.length;\n\trand = mt19937;\n\tif ( nargs === 0 ) {\n\t\tprng = base;\n\t} else if ( nargs === 1 ) {\n\t\toptions = arguments[ 0 ];\n\t\tprng = base.factory( options );\n\t\terr = validate( opts, options, 0 );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\tsetReadOnlyAccessor( rand, 'seed', getSeed );\n\tsetReadOnlyAccessor( rand, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( rand, 'state', getState, setState );\n\tsetReadOnlyAccessor( rand, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( rand, 'byteLength', getStateSize );\n\tsetReadOnly( rand, 'PRNG', prng );\n\tsetReadOnly( rand, 'normalized', normalized );\n\treturn rand;\n\n\t/**\n\t* Returns an array containing pseudorandom integers on the interval `[0, 4294967295]`.\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction mt19937( len, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 1 ) {\n\t\t\terr = validate( o, options, 1 );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tdt = o.dtype || opts.idtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, prng );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tnullary( [ out ], [ len ], [ 1 ], prng );\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns an array containing pseudorandom numbers on the interval `[0, 1)` with 53-bit precision.\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction normalized( len, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 1 ) {\n\t\t\terr = validate( o, options, 2 );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tdt = o.dtype || opts.ndtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, prng.normalized );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tnullary( [ out ], [ len ], [ 1 ], prng.normalized );\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {Uint32Array} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {Uint32Array} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {Uint32Array} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom integers on the interval `[0, 4294967295]`.\n*\n* @name mt19937\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = mt19937( 10 );\n* // returns \n*\n* @example\n* var arr = mt19937.normalized( 10 );\n* // returns \n*\n* @example\n* var arr = mt19937( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar mt19937 = factory();\n\n\n// EXPORTS //\n\nmodule.exports = mt19937;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create an array containing pseudorandom numbers generated using a 32-bit Mersenne Twister pseudorandom number generator.\n*\n* @module @stdlib/random/array/mt19937\n*\n* @example\n* var mt19937 = require( '@stdlib/random/array/mt19937' );\n*\n* var arr = mt19937( 10 );\n* // returns \n*\n* @example\n* var mt19937 = require( '@stdlib/random/array/mt19937' );\n*\n* var arr = mt19937( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var mt19937 = require( '@stdlib/random/array/mt19937' );\n*\n* var arr = mt19937.normalized( 10 );\n* // returns \n*\n* @example\n* var mt19937 = require( '@stdlib/random/array/mt19937' );\n*\n* var arr = mt19937.normalized( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var mt19937 = require( '@stdlib/random/array/mt19937' );\n*\n* var rand = mt19937.factory();\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var mt19937 = require( '@stdlib/random/array/mt19937' );\n*\n* var rand = mt19937.factory();\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"normalized\": \"main.normalized\" }\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 exp = require( '@stdlib/math/base/special/exp' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Poisson distribution.\n*\n* ## Notes\n*\n* - Appropriate for \\\\(lambda < 30\\\\).\n*\n* ## References\n*\n* - Knuth, Donald E. 1997. _The Art of Computer Programming, Volume 2 (3rd Ed.): Seminumerical Algorithms_. Boston, MA, USA: Addison-Wesley Longman Publishing Co., Inc.\n*\n* @private\n* @param {PRNG} rand - PRNG for generating uniformly distributed numbers\n* @param {PositiveNumber} lambda - mean\n* @returns {NonNegativeInteger} pseudorandom number\n*/\nfunction poisson( rand, lambda ) {\n\tvar p = rand();\n\tvar k = 1;\n\twhile ( p > exp( -lambda ) ) {\n\t\tk += 1;\n\t\tp *= rand();\n\t}\n\treturn k - 1;\n}\n\n\n// EXPORTS //\n\nmodule.exports = poisson;\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 factorialln = require( '@stdlib/math/base/special/factorialln' );\nvar floor = require( '@stdlib/math/base/special/floor' );\nvar sign = require( '@stdlib/math/base/special/signum' );\nvar sqrt = require( '@stdlib/math/base/special/sqrt' );\nvar abs = require( '@stdlib/math/base/special/abs' );\nvar ln = require( '@stdlib/math/base/special/ln' );\nvar LN_SQRT_TWO_PI = require( '@stdlib/constants/float64/ln-sqrt-two-pi' );\n\n\n// VARIABLES //\n\nvar ONE_12 = 1.0 / 12.0;\nvar ONE_360 = 1.0 / 360.0;\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Poisson distribution with parameter `lambda`.\n*\n* ## References\n*\n* - H\u00F6rmann, W. 1993. \"The transformed rejection method for generating Poisson random variables.\" _Insurance: Mathematics and Economics_ 12 (1): 39\u201345. doi:[10.1016/0167-6687(93)90997-4][@hormann:1993b].\n*\n* [@hormann:1993b]: http://dx.doi.org/10.1016/0167-6687(93)90997-4\n*\n* @private\n* @param {PRNG} rand - PRNG for generating uniformly distributed numbers\n* @param {PositiveNumber} lambda - mean\n* @returns {NonNegativeInteger} pseudorandom number\n*/\nfunction poisson( rand, lambda ) {\n\tvar slambda;\n\tvar ainv;\n\tvar urvr;\n\tvar us;\n\tvar vr;\n\tvar a;\n\tvar b;\n\tvar k;\n\tvar u;\n\tvar v;\n\n\tslambda = sqrt( lambda );\n\n\tb = (2.53*slambda) + 0.931;\n\ta = (0.02483*b) - 0.059;\n\n\tainv = (1.1328/(b-3.4)) + 1.1239;\n\tvr = (-3.6224/(b-2.0)) + 0.9277;\n\turvr = 0.86 * vr;\n\n\twhile ( true ) {\n\t\tv = rand();\n\t\tif ( v <= urvr ) {\n\t\t\tu = (v / vr) - 0.43;\n\t\t\tu *= (2.0*a / (0.5-abs(u))) + b;\n\t\t\tu += lambda + 0.445;\n\t\t\treturn floor( u );\n\t\t}\n\t\tif ( v >= vr ) {\n\t\t\tu = rand() - 0.5;\n\t\t} else {\n\t\t\tu = (v / vr) - 0.93;\n\t\t\tu = (sign( u )*0.5) - u;\n\t\t\tv = vr * rand();\n\t\t}\n\t\tus = 0.5 - abs( u );\n\t\tif (\n\t\t\tus >= 0.013 ||\n\t\t\tus >= v\n\t\t) {\n\t\t\tk = floor( (((2.0*a/us) + b)*u) + lambda + 0.445 );\n\t\t\tv *= ainv / ( (a/(us*us)) + b );\n\t\t\tu = (k+0.5) * ln( lambda/k );\n\t\t\tu += -lambda - LN_SQRT_TWO_PI + k;\n\t\t\tu -= ( ONE_12 - (ONE_360/(k*k)) ) / k;\n\t\t\tif (\n\t\t\t\tk >= 10 &&\n\t\t\t\tu >= ln( v*slambda )\n\t\t\t) {\n\t\t\t\treturn k;\n\t\t\t}\n\t\t\tu = (k*ln( lambda )) - lambda - factorialln( k );\n\t\t\tif (\n\t\t\t\tk >= 0 &&\n\t\t\t\tk <= 9 &&\n\t\t\t\tu >= ln( v )\n\t\t\t) {\n\t\t\t\treturn k;\n\t\t\t}\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = poisson;\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 knuth = require( './knuth.js' );\nvar rejection = require( './rejection.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Poisson distribution with parameter `lambda`.\n*\n* @private\n* @param {PRNG} rand - PRNG for generating uniformly distributed numbers\n* @param {PositiveNumber} lambda - mean\n* @returns {NonNegativeInteger} pseudorandom number\n*/\nfunction poisson( rand, lambda ) {\n\tif ( lambda < 30.0 ) {\n\t\treturn knuth( rand, lambda );\n\t}\n\treturn rejection( rand, lambda );\n}\n\n\n// EXPORTS //\n\nmodule.exports = poisson;\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 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 isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar poisson0 = require( './poisson.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating Poisson distributed random numbers.\n*\n* @param {PositiveNumber} [lambda] - mean\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var poisson = factory( 5.0 );\n* var v = poisson();\n* // returns \n*\n* @example\n* var poisson = factory( 8.0, {\n* 'seed': 297\n* });\n* var v = poisson();\n* // returns \n*\n* @example\n* var poisson = factory();\n* var v = poisson( 0.5 );\n* // returns \n*/\nfunction factory() {\n\tvar lambda;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if (\n\t\targuments.length === 1 &&\n\t\tisObject( arguments[ 0 ] )\n\t) {\n\t\topts = arguments[ 0 ];\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tlambda = arguments[ 0 ];\n\t\tif ( !isPositive( lambda ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', lambda ) );\n\t\t}\n\t\tif ( arguments.length > 1 ) {\n\t\t\topts = arguments[ 1 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( lambda === void 0 ) {\n\t\tprng = poisson2;\n\t} else {\n\t\tprng = poisson1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'poisson' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\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 = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( lambda === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ lambda ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Poisson distribution.\n\t*\n\t* @private\n\t* @returns {NonNegativeInteger} pseudorandom number\n\t*\n\t* @example\n\t* var v = poisson1();\n\t* // returns \n\t*/\n\tfunction poisson1() {\n\t\treturn poisson0( rand, lambda );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Poisson distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} lambda - mean\n\t* @returns {NonNegativeInteger} pseudorandom number\n\t*\n\t* @example\n\t* var v = poisson2( 0.5 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = poisson2( NaN );\n\t* // returns NaN\n\t*\n\t* @example\n\t* var v = poisson2( -1.0 );\n\t* // returns NaN\n\t*/\n\tfunction poisson2( lambda ) {\n\t\tif (\n\t\t\tisnan( lambda ) ||\n\t\t\tlambda <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn poisson0( rand, lambda );\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' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Poisson distribution with parameter `lambda`.\n*\n* ## Method\n*\n* - When \\\\(\\lambda < 30\\\\), use Knuth's method.\n* - When \\\\(lambda \\geq 30\\\\), use transformed rejection method as Knuth's method does not scale well with \\\\(\\lambda\\\\).\n*\n* ## References\n*\n* - Knuth, Donald E. 1997. _The Art of Computer Programming, Volume 2 (3rd Ed.): Seminumerical Algorithms_. Boston, MA, USA: Addison-Wesley Longman Publishing Co., Inc.\n* - H\u00F6rmann, W. 1993. \"The transformed rejection method for generating Poisson random variables.\" _Insurance: Mathematics and Economics_ 12 (1): 39\u201345. doi:[10.1016/0167-6687(93)90997-4][@hormann:1993b].\n*\n* [@hormann:1993b]: http://dx.doi.org/10.1016/0167-6687(93)90997-4\n*\n* @name poisson\n* @type {PRNG}\n* @param {PositiveNumber} lambda - mean\n* @returns {NonNegativeInteger} pseudorandom number\n*\n* @example\n* var v = poisson( 0.5 );\n* // returns \n*\n* @example\n* var v = poisson( 0.0 );\n* // returns NaN\n*\n* @example\n* var v = poisson( NaN );\n* // returns NaN\n*/\nvar poisson = factory();\n\n\n// EXPORTS //\n\nmodule.exports = poisson;\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* Poisson distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/poisson\n*\n* @example\n* var poisson = require( '@stdlib/random/base/poisson' );\n*\n* var v = poisson( 4.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/poisson' ).factory;\n* var poisson = factory( 4.0, {\n* 'seed': 297\n* });\n*\n* var v = poisson();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/poisson' ).factory;\n* var poisson = factory({\n* 'seed': 297\n* });\n*\n* var v = poisson( 3.0 );\n* // returns \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", "/**\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 isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar isnan = require( '@stdlib/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {PositiveNumber} r - number of successes until experiment is stopped\n* @param {number} p - success probability\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 10, 0.5 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( r, p ) {\n\tif ( !isPositive( r ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', r ) );\n\t}\n\tif ( !isNumber( p ) || isnan( p ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a number and not NaN. Value: `%s`.', p ) );\n\t}\n\tif ( p <= 0.0 || p >= 1.0 ) {\n\t\treturn new RangeError( format( 'invalid argument. Second argument must be on the interval: (0, 1). Value: `%f`.', p ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 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 isUint32Array = require( '@stdlib/assert/is-uint32array' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar poisson = require( './../../../base/poisson' ).factory;\nvar gamma = require( './../../../base/gamma' ).factory;\nvar gcopy = require( '@stdlib/blas/base/gcopy' );\nvar Uint32Array = require( '@stdlib/array/uint32' );\nvar assign = require( '@stdlib/object/assign' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating negative binomial distributed random numbers.\n*\n* @param {PositiveNumber} [r] - number of successes until experiment is stopped\n* @param {number} [p] - success probability\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} `r` must be a positive number\n* @throws {TypeError} `p` must be number\n* @throws {RangeError} `p` must be a number on the interval `(0,1)`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var negativeBinomial = factory( 10, 0.5 );\n*\n* var v = negativeBinomial();\n* // returns \n*\n* @example\n* var negativeBinomial = factory( 10, 0.8, {\n* 'seed': 297\n* });\n*\n* var v = negativeBinomial();\n* // returns \n*\n* @example\n* var negativeBinomial = factory();\n*\n* var v = negativeBinomial( 10, 0.5 );\n* // returns \n*/\nfunction factory() {\n\tvar rgamma;\n\tvar STATE;\n\tvar rpois;\n\tvar opts;\n\tvar prng;\n\tvar rand;\n\tvar FLG;\n\tvar err;\n\tvar p;\n\tvar r;\n\n\tFLG = true;\n\tif ( arguments.length === 0 ) {\n\t\topts = {\n\t\t\t'copy': false\n\t\t};\n\t\trpois = poisson( opts );\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'copy' ) && !isBoolean( opts.copy ) ) {\n\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', opts.copy ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trpois = poisson({\n\t\t\t\t'prng': opts.prng\n\t\t\t});\n\t\t} else {\n\t\t\tif ( hasOwnProp( opts, 'state' ) && !isUint32Array( opts.state ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a Uint32Array. Option: `%s`.', 'state', opts.state ) );\n\t\t\t}\n\t\t\topts = assign( {}, opts );\n\t\t\tif ( opts.copy === false ) {\n\t\t\t\tFLG = false;\n\t\t\t} else if ( opts.state ) {\n\t\t\t\topts.state = gcopy( opts.state.length, opts.state, 1, new Uint32Array( opts.state.length ), 1 ); // eslint-disable-line max-len\n\t\t\t}\n\t\t\topts.copy = false;\n\t\t\trpois = poisson( opts );\n\t\t}\n\t} else {\n\t\tr = arguments[ 0 ];\n\t\tp = arguments[ 1 ];\n\t\terr = validate( r, p );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'copy' ) && !isBoolean( opts.copy ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', opts.copy ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trpois = poisson({\n\t\t\t\t\t'prng': opts.prng\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tif ( hasOwnProp( opts, 'state' ) && !isUint32Array( opts.state ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a Uint32Array. Option: `%s`.', 'state', opts.state ) );\n\t\t\t\t}\n\t\t\t\topts = assign( {}, opts );\n\t\t\t\tif ( opts.copy === false ) {\n\t\t\t\t\tFLG = false;\n\t\t\t\t} else if ( opts.state ) {\n\t\t\t\t\topts.state = gcopy( opts.state.length, opts.state, 1, new Uint32Array( opts.state.length ), 1 ); // eslint-disable-line max-len\n\t\t\t\t}\n\t\t\t\topts.copy = false;\n\t\t\t\trpois = poisson( opts );\n\t\t\t}\n\t\t} else {\n\t\t\topts = {\n\t\t\t\t'copy': false\n\t\t\t};\n\t\t\trpois = poisson( opts );\n\t\t}\n\t}\n\tif ( opts && opts.prng ) {\n\t\tif ( r === void 0 ) {\n\t\t\trgamma = gamma({\n\t\t\t\t'prng': opts.prng\n\t\t\t});\n\t\t} else {\n\t\t\trgamma = gamma( r, p/(1-p), {\n\t\t\t\t'prng': opts.prng\n\t\t\t});\n\t\t}\n\t} else {\n\t\tif ( opts.state ) {\n\t\t\tSTATE = opts.state;\n\t\t} else {\n\t\t\tSTATE = rpois.state;\n\t\t\trpois.state = STATE; // updates the underlying PRNG to point to a shared state\n\t\t}\n\t\tif ( r === void 0 ) {\n\t\t\trgamma = gamma({\n\t\t\t\t'state': STATE,\n\t\t\t\t'copy': false\n\t\t\t});\n\t\t} else {\n\t\t\trgamma = gamma( r, p/(1-p), {\n\t\t\t\t'state': STATE,\n\t\t\t\t'copy': false\n\t\t\t});\n\t\t}\n\t}\n\tif ( r === void 0 ) {\n\t\tprng = negativeBinomial2;\n\t} else {\n\t\tprng = negativeBinomial1;\n\t}\n\trand = rpois.PRNG;\n\n\tsetReadOnly( prng, 'NAME', 'negative-binomial' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t}\n\tsetReadOnly( prng, 'PRNG', rand );\n\treturn prng;\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\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\tif ( !isUint32Array( s ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a Uint32Array. Value: `%s`.', s ) );\n\t\t}\n\t\tif ( FLG ) {\n\t\t\ts = gcopy( s.length, s, 1, new Uint32Array( s.length ), 1 );\n\t\t}\n\t\trand.state = s;\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 = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( r === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ r, p ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a negative binomial distribution with bound parameters `r` and `p`.\n\t*\n\t* @private\n\t* @returns {NonNegativeInteger} pseudorandom number\n\t*\n\t* @example\n\t* var v = negativeBinomial1();\n\t* // returns \n\t*/\n\tfunction negativeBinomial1() {\n\t\treturn rpois( rgamma() );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a negative binomial distribution with parameters `r` and `p`.\n\t*\n\t* @private\n\t* @param {PositiveNumber} r - number of successes until experiment is stopped\n\t* @param {number} p - success probability\n\t* @returns {NonNegativeInteger} pseudorandom number\n\t*\n\t* @example\n\t* var v = negativeBinomial2( 10, 0.5 );\n\t* // returns \n\t*/\n\tfunction negativeBinomial2( r, p ) {\n\t\tif (\n\t\t\tisnan( r ) ||\n\t\t\tisnan( p ) ||\n\t\t\tp <= 0.0 ||\n\t\t\tp >= 1.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn rpois( rgamma( r, p/(1-p) ) );\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' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a negative binomial distribution.\n*\n* @name negativeBinomial\n* @type {PRNG}\n* @param {PositiveNumber} r - number of successes until experiment is stopped\n* @param {number} p - success probability\n* @returns {NonNegativeInteger} pseudorandom number\n*\n* @example\n* var v = negativeBinomial( 10, 0.5 );\n* // returns \n*/\nvar negativeBinomial = factory();\n\n\n// EXPORTS //\n\nmodule.exports = negativeBinomial;\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* Negative binomial distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/negative-binomial\n*\n* @example\n* var negativeBinomial = require( '@stdlib/random/base/negative-binomial' );\n*\n* var v = negativeBinomial( 20, 0.5 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/negative-binomial' ).factory;\n* var negativeBinomial = factory( 10, 0.3, {\n* 'seed': 297\n* });\n*\n* var v = negativeBinomial();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/negative-binomial' ).factory;\n* var negativeBinomial = factory({\n* 'seed': 297\n* });\n*\n* var v = negativeBinomial( 10, 0.67 );\n* // returns \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", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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 binaryFactory = require( './../../../array/tools/binary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/negative-binomial' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a negative binomial distribution.\n*\n* @name factory\n* @type {Function}\n* @param {PositiveNumber} [r] - number of successes until experiment is stopped\n* @param {Probability} [p] - success probability\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `r` must be a positive number\n* @throws {TypeError} `p` must be a probability (i.e., a number on the interval [0,1])\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var negativeBinomial = factory( 10, 0.5 );\n* // returns \n*\n* var arr = negativeBinomial( 10 );\n* // returns \n*\n* @example\n* var negativeBinomial = factory( 10, 0.5 );\n* // returns \n*\n* var arr = negativeBinomial( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = binaryFactory( base, DTYPES, defaults.get( 'dtypes.real' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a negative binomial distribution.\n*\n* @name negativeBinomial\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {PositiveNumber} r - number of successes until experiment is stopped\n* @param {Probability} p - success probability\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = negativeBinomial( 10, 10, 0.5 );\n* // returns \n*\n* @example\n* var arr = negativeBinomial( 10, 10, 0.5, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar negativeBinomial = factory();\n\n\n// EXPORTS //\n\nmodule.exports = negativeBinomial;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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* Create an array containing pseudorandom numbers drawn from a negative binomial distribution.\n*\n* @module @stdlib/random/array/negative-binomial\n*\n* @example\n* var negativeBinomial = require( '@stdlib/random/array/negative-binomial' );\n*\n* var arr = negativeBinomial( 10, 10, 0.5 );\n* // returns \n*\n* @example\n* var negativeBinomial = require( '@stdlib/random/array/negative-binomial' );\n*\n* var arr = negativeBinomial( 10, 10, 0.5, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var negativeBinomial = require( '@stdlib/random/array/negative-binomial' );\n*\n* var rand = negativeBinomial.factory( 10, 0.5 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var negativeBinomial = require( '@stdlib/random/array/negative-binomial' );\n*\n* var rand = negativeBinomial.factory( 10, 0.5 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\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 isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar isnan = require( '@stdlib/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {number} mu - mean\n* @param {PositiveNumber} sigma - standard deviation\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( mu, sigma ) {\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( sigma ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', sigma ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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* Returns a pseudorandom number from a normal distribution with parameters `mu` and `sigma`.\n*\n* @private\n* @param {PRNG} rand - pseudorandom number generator\n* @param {number} mu - mean\n* @param {PositiveNumber} sigma - standard deviation\n* @returns {number} pseudorandom number\n*/\nfunction normal( rand, mu, sigma ) {\n\treturn mu + (sigma*rand());\n}\n\n\n// EXPORTS //\n\nmodule.exports = normal;\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 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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randn = require( './../../../base/improved-ziggurat' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar normal0 = require( './normal.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating normally distributed random numbers.\n*\n* @param {number} [mu] - mean\n* @param {PositiveNumber} [sigma] - standard deviation\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} `mu` must be a number\n* @throws {TypeError} `sigma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var normal = factory( 0.0, 1.0 );\n* var v = normal();\n* // returns \n*\n* @example\n* var normal = factory( -3.0, 0.5, {\n* 'seed': 297\n* });\n* var v = normal();\n* // returns \n*/\nfunction factory() {\n\tvar sigma;\n\tvar rnorm;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar mu;\n\n\tif ( arguments.length === 0 ) {\n\t\trnorm = randn();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trnorm = randn({\n\t\t\t\t'prng': opts.prng\n\t\t\t});\n\t\t} else {\n\t\t\trnorm = randn( opts );\n\t\t}\n\t} else {\n\t\tmu = arguments[ 0 ];\n\t\tsigma = arguments[ 1 ];\n\t\terr = validate( mu, sigma );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trnorm = randn({\n\t\t\t\t\t'prng': opts.prng\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\trnorm = randn( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trnorm = randn();\n\t\t}\n\t}\n\tif ( mu === void 0 ) {\n\t\tprng = normal2;\n\t} else {\n\t\tprng = normal1;\n\t}\n\trand = rnorm.PRNG;\n\n\tsetReadOnly( prng, 'NAME', 'normal' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t}\n\tsetReadOnly( prng, 'PRNG', rand );\n\treturn prng;\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\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 = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( mu === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ mu, sigma ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number from a normal distribution with bound parameters `mu` and `sigma`.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = normal1();\n\t* // returns \n\t*/\n\tfunction normal1() {\n\t\treturn normal0( rnorm, mu, sigma );\n\t}\n\n\t/**\n\t* Returns a normally distributed pseudorandom number with mean `mu` and standard deviation `sigma`.\n\t*\n\t* @private\n\t* @param {number} mu - mean\n\t* @param {PositiveNumber} sigma - standard deviation\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = normal2( 0.0, 1.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = normal2( 0.0, -1.0 );\n\t* // returns NaN\n\t*/\n\tfunction normal2( mu, sigma ) {\n\t\tif (\n\t\t\tisnan( mu ) ||\n\t\t\tisnan( sigma ) ||\n\t\t\tsigma <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn normal0( rnorm, mu, sigma );\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' );\n\n\n// MAIN //\n\n/**\n* Returns a normally distributed pseudorandom number with mean `mu` and standard deviation `sigma`.\n*\n* @name normal\n* @type {PRNG}\n* @param {number} mu - mean\n* @param {PositiveNumber} sigma - standard deviation\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = normal( 0.0, 1.0 );\n* // returns \n*\n* @example\n* var v = normal( 0.0, -1.0 );\n* // returns NaN\n*/\nvar normal = factory();\n\n\n// EXPORTS //\n\nmodule.exports = normal;\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* Normally distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/normal\n*\n* @example\n* var normal = require( '@stdlib/random/base/normal' );\n*\n* var v = normal( 0.0, 1.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/normal' ).factory;\n* var normal = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = normal();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/normal' ).factory;\n* var normal = factory({\n* 'seed': 297\n* });\n*\n* var v = normal( -3.0, 2.0 );\n* // returns \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", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 binaryFactory = require( './../../../array/tools/binary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/normal' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a normal distribution.\n*\n* @name factory\n* @type {Function}\n* @param {number} [mu] - mean\n* @param {PositiveNumber} [sigma] - standard deviation\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `sigma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var normal = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = normal( 10 );\n* // returns \n*\n* @example\n* var normal = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = normal( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = binaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a normal distribution.\n*\n* @name normal\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {number} mu - mean\n* @param {PositiveNumber} sigma - standard deviation\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = normal( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = normal( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar normal = factory();\n\n\n// EXPORTS //\n\nmodule.exports = normal;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create an array containing pseudorandom numbers drawn from a normal distribution.\n*\n* @module @stdlib/random/array/normal\n*\n* @example\n* var normal = require( '@stdlib/random/array/normal' );\n*\n* var arr = normal( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var normal = require( '@stdlib/random/array/normal' );\n*\n* var arr = normal( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var normal = require( '@stdlib/random/array/normal' );\n*\n* var rand = normal.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var normal = require( '@stdlib/random/array/normal' );\n*\n* var rand = normal.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\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 isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - scale parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( alpha, beta ) {\n\tif ( !isPositive( alpha ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositive( beta ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 pow = require( '@stdlib/math/base/special/pow' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Pareto (Type I) distribution.\n*\n* @private\n* @param {PRNG} rand - PRNG for uniformly distributed numbers\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - scale parameter\n* @returns {NonNegativeNumber} pseudorandom number\n*/\nfunction pareto( rand, alpha, beta ) {\n\treturn beta / pow( rand(), 1.0/alpha );\n}\n\n\n// EXPORTS //\n\nmodule.exports = pareto;\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 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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar pareto0 = require( './pareto.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating Pareto (Type I) distributed random numbers.\n*\n* @param {PositiveNumber} [alpha] - shape parameter\n* @param {PositiveNumber} [beta] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var pareto1 = factory( 2.0, 1.0 );\n*\n* var v = pareto1();\n* // returns \n*\n* @example\n* var pareto1 = factory( 2.0, 2.0, {\n* 'seed': 297\n* });\n* var v = pareto1();\n* // returns \n*/\nfunction factory() {\n\tvar alpha;\n\tvar beta;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\talpha = arguments[ 0 ];\n\t\tbeta = arguments[ 1 ];\n\t\terr = validate( alpha, beta );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( alpha === void 0 ) {\n\t\tprng = pareto2;\n\t} else {\n\t\tprng = pareto1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'pareto-type1' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\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 = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( alpha === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ alpha, beta ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Pareto (Type I) distribution with bound parameters.\n\t*\n\t* @private\n\t* @returns {NonNegativeNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = pareto1();\n\t* // returns \n\t*/\n\tfunction pareto1() {\n\t\treturn pareto0( rand, alpha, beta );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Pareto (Type I) distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} alpha - shape parameter\n\t* @param {PositiveNumber} beta - scale parameter\n\t* @returns {NonNegativeNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = pareto2( 2.0, 3.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = pareto2( 3.0, 0.0 );\n\t* // returns NaN\n\t*\n\t* @example\n\t* var v = pareto2( 0.0, 2.0 );\n\t* // returns NaN\n\t*\n\t* @example\n\t* var v = pareto2( NaN, NaN );\n\t* // returns NaN\n\t*/\n\tfunction pareto2( alpha, beta ) {\n\t\tif (\n\t\t\tisnan( alpha ) ||\n\t\t\tisnan( beta ) ||\n\t\t\talpha <= 0.0 ||\n\t\t\tbeta <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn pareto0( rand, alpha, beta );\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' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Pareto (Type I) distribution.\n*\n* @name pareto1\n* @type {PRNG}\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - scale parameter\n* @returns {NonNegativeNumber} pseudorandom number\n*\n* @example\n* var v = pareto1( 2.0, 3.0 );\n* // returns \n*\n* @example\n* var v = pareto1( -2.0, 3.0 );\n* // returns NaN\n*/\nvar pareto1 = factory();\n\n\n// EXPORTS //\n\nmodule.exports = pareto1;\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* Pareto (Type I) distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/pareto-type1\n*\n* @example\n* var pareto1 = require( '@stdlib/random/base/pareto-type1' );\n*\n* var v = pareto1( 2.0, 3.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/pareto-type1' ).factory;\n* var pareto1 = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = pareto1();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/pareto-type1' ).factory;\n* var pareto1 = factory({\n* 'seed': 297\n* });\n*\n* var v = pareto1( 3.0, 2.0 );\n* // returns \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", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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 binaryFactory = require( './../../../array/tools/binary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/pareto-type1' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a Pareto (Type I) distribution.\n*\n* @name factory\n* @type {Function}\n* @param {PositiveNumber} [alpha] - shape parameter\n* @param {PositiveNumber} [beta] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var pareto1 = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = pareto1( 10 );\n* // returns \n*\n* @example\n* var pareto1 = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = pareto1( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = binaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a Pareto (Type I) distribution.\n*\n* @name pareto1\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - scale parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = pareto1( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = pareto1( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar pareto1 = factory();\n\n\n// EXPORTS //\n\nmodule.exports = pareto1;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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* Create an array containing pseudorandom numbers drawn from a Pareto (Type I) distribution.\n*\n* @module @stdlib/random/array/pareto-type1\n*\n* @example\n* var pareto1 = require( '@stdlib/random/array/pareto-type1' );\n*\n* var arr = pareto1( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var pareto1 = require( '@stdlib/random/array/pareto-type1' );\n*\n* var arr = pareto1( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var pareto1 = require( '@stdlib/random/array/pareto-type1' );\n*\n* var rand = pareto1.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var pareto1 = require( '@stdlib/random/array/pareto-type1' );\n*\n* var rand = pareto1.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 unaryFactory = require( './../../../array/tools/unary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/poisson' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a Poisson distribution.\n*\n* @name factory\n* @type {Function}\n* @param {PositiveNumber} [lambda] - mean parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var poisson = factory( 2.0 );\n* // returns \n*\n* var arr = poisson( 10 );\n* // returns \n*\n* @example\n* var poisson = factory( 2.0 );\n* // returns \n*\n* var arr = poisson( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = unaryFactory( base, DTYPES, defaults.get( 'dtypes.real' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a Poisson distribution.\n*\n* @name poisson\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {PositiveNumber} lambda - mean parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = poisson( 10, 2.0 );\n* // returns \n*\n* @example\n* var arr = poisson( 10, 2.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar poisson = factory();\n\n\n// EXPORTS //\n\nmodule.exports = poisson;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create an array containing pseudorandom numbers drawn from a Poisson distribution.\n*\n* @module @stdlib/random/array/poisson\n*\n* @example\n* var poisson = require( '@stdlib/random/array/poisson' );\n*\n* var arr = poisson( 10, 2.0 );\n* // returns \n*\n* @example\n* var poisson = require( '@stdlib/random/array/poisson' );\n*\n* var arr = poisson( 10, 2.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var poisson = require( '@stdlib/random/array/poisson' );\n*\n* var rand = poisson.factory( 2.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var poisson = require( '@stdlib/random/array/poisson' );\n*\n* var rand = poisson.factory( 2.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\n", "{\n\t\"name\": \"mt19937\",\n\t\"copy\": true\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'use strict';\n\n// MODULES //\n\nvar minstd = require( './../../../base/minstd' );\nvar minstdShuffle = require( './../../../base/minstd-shuffle' );\nvar mt19937 = require( './../../../base/mt19937' );\n\n\n// MAIN //\n\nvar prngs = {};\n\nprngs[ 'minstd' ] = minstd;\nprngs[ 'minstd-shuffle' ] = minstdShuffle;\nprngs[ 'mt19937' ] = mt19937;\n\n\n// EXPORTS //\n\nmodule.exports = prngs;\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 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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar defaults = require( './defaults.json' );\nvar PRNGS = require( './prngs.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating uniformly distributed random numbers on the interval \\\\( [0,1) \\\\).\n*\n* @param {Options} [options] - function options\n* @param {string} [options.name='mt19937'] - name of pseudorandom number generator\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [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} must provide an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide the name of a supported pseudorandom number generator\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var uniform = factory();\n* var v = uniform();\n* // returns \n*\n* @example\n* var uniform = factory({\n* 'name': 'minstd'\n* });\n* var v = uniform();\n* // returns \n*\n* @example\n* var uniform = factory({\n* 'seed': 12345\n* });\n* var v = uniform();\n* // returns \n*\n* @example\n* var uniform = factory({\n* 'name': 'minstd',\n* 'seed': 12345\n* });\n* var v = uniform();\n* // returns \n*/\nfunction factory( options ) {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\n\topts = {\n\t\t'name': defaults.name,\n\t\t'copy': defaults.copy\n\t};\n\tif ( arguments.length ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide an object. Value: `%s`.', options ) );\n\t\t}\n\t\tif ( hasOwnProp( options, 'name' ) ) {\n\t\t\topts.name = options.name;\n\t\t}\n\t\tif ( hasOwnProp( options, 'state' ) ) {\n\t\t\topts.state = options.state;\n\t\t\tif ( opts.state === void 0 ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option cannot be undefined. Option: `%s`.', 'state', opts.state ) );\n\t\t\t}\n\t\t} else if ( hasOwnProp( options, 'seed' ) ) {\n\t\t\topts.seed = options.seed;\n\t\t\tif ( opts.seed === void 0 ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option cannot be undefined. Option: `%s`.', 'seed', opts.seed ) );\n\t\t\t}\n\t\t}\n\t\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\t\topts.copy = options.copy;\n\t\t\tif ( !isBoolean( opts.copy ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', opts.copy ) );\n\t\t\t}\n\t\t}\n\t}\n\tprng = PRNGS[ opts.name ];\n\tif ( prng === void 0 ) {\n\t\tthrow new Error( format( 'invalid option. Unrecognized/unsupported PRNG. Option: `%s`.', opts.name ) );\n\t}\n\tif ( opts.state === void 0 ) {\n\t\tif ( opts.seed === void 0 ) {\n\t\t\trand = prng.factory();\n\t\t} else {\n\t\t\trand = prng.factory({\n\t\t\t\t'seed': opts.seed\n\t\t\t});\n\t\t}\n\t} else {\n\t\trand = prng.factory({\n\t\t\t'state': opts.state,\n\t\t\t'copy': opts.copy\n\t\t});\n\t}\n\tsetReadOnly( uniform, 'NAME', 'randu' );\n\tsetReadOnlyAccessor( uniform, 'seed', getSeed );\n\tsetReadOnlyAccessor( uniform, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( uniform, 'state', getState, setState );\n\tsetReadOnlyAccessor( uniform, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( uniform, 'byteLength', getStateSize );\n\tsetReadOnly( uniform, 'toJSON', toJSON );\n\tsetReadOnly( uniform, 'PRNG', rand );\n\tsetReadOnly( uniform, 'MIN', rand.normalized.MIN );\n\tsetReadOnly( uniform, 'MAX', rand.normalized.MAX );\n\n\treturn uniform;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {*} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {*} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {*} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\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 = uniform.NAME + '-' + rand.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tout.params = [];\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a uniformly distributed pseudorandom number on the interval \\\\( [0,1) \\\\).\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = uniform();\n\t* // returns \n\t*/\n\tfunction uniform() {\n\t\treturn rand.normalized();\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' );\n\n\n// MAIN //\n\n/**\n* Returns a uniformly distributed random number on the interval \\\\( [0,1) \\\\).\n*\n* @name randu\n* @type {PRNG}\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = randu();\n* // returns \n*/\nvar randu = factory();\n\n\n// EXPORTS //\n\nmodule.exports = randu;\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* Uniformly distributed pseudorandom numbers on the interval \\\\( [0,1) \\\\).\n*\n* @module @stdlib/random/base/randu\n*\n* @example\n* var randu = require( '@stdlib/random/base/randu' );\n*\n* var v = randu();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/randu' ).factory;\n*\n* var randu = factory({\n* 'name': 'minstd',\n* 'seed': 12345\n* });\n*\n* var v = randu();\n* // returns \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", "{\n\t\"dtype\": \"float64\"\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 dtypes = require( '@stdlib/array/typed-real-float-dtypes' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes();\nDTYPES.push( 'generic' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.dtype] - output array data type\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'dtype': 'float64'\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'dtype' ) ) {\n\t\topts.dtype = options.dtype;\n\t\tif ( DTYPES.indexOf( opts.dtype ) < 0 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'dtype', DTYPES.join( '\", \"' ), opts.dtype ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\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 base = require( './../../../base/randu' );\nvar ctors = require( '@stdlib/array/typed-real-float-ctors' );\nvar filledBy = require( '@stdlib/array/base/filled-by' );\nvar nullary = require( '@stdlib/strided/base/nullary' );\nvar format = require( '@stdlib/string/format' );\nvar defaults = require( './defaults.json' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing uniformly distributed pseudorandom numbers between `0` and `1`.\n*\n* @param {Options} [options] - function options\n* @param {string} [options.name='mt19937'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var randu = factory();\n* // returns \n*\n* var arr = randu( 10 );\n* // returns \n*\n* @example\n* var randu = factory();\n* // returns \n*\n* var arr = randu( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nfunction factory() {\n\tvar options;\n\tvar nargs;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\n\topts = {\n\t\t'dtype': defaults.dtype\n\t};\n\n\tnargs = arguments.length;\n\trand = randu;\n\tif ( nargs === 0 ) {\n\t\tprng = base;\n\t} else if ( nargs === 1 ) {\n\t\toptions = arguments[ 0 ];\n\t\tprng = base.factory( options );\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\tsetReadOnlyAccessor( rand, 'seed', getSeed );\n\tsetReadOnlyAccessor( rand, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( rand, 'state', getState, setState );\n\tsetReadOnlyAccessor( rand, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( rand, 'byteLength', getStateSize );\n\tsetReadOnly( rand, 'PRNG', prng.PRNG );\n\treturn rand;\n\n\t/**\n\t* Returns an array containing pseudorandom numbers drawn from a randu distribution.\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} len - array length\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.dtype] - output array data type\n\t* @throws {TypeError} first argument must be a nonnegative integer\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {(Array|TypedArray)} output array\n\t*/\n\tfunction randu( len, options ) {\n\t\tvar ctor;\n\t\tvar out;\n\t\tvar err;\n\t\tvar dt;\n\t\tvar o;\n\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t}\n\t\to = {};\n\t\tif ( arguments.length > 1 ) {\n\t\t\terr = validate( o, options );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tdt = o.dtype || opts.dtype;\n\t\tif ( dt === 'generic' ) {\n\t\t\treturn filledBy( len, prng );\n\t\t}\n\t\tctor = ctors( dt );\n\t\tout = new ctor( len );\n\t\tnullary( [ out ], [ len ], [ 1 ], prng );\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {*} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {*} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {*} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing uniformly distributed pseudorandom numbers between `0` and `1`.\n*\n* @name randu\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = randu( 10 );\n* // returns \n*\n* @example\n* var arr = randu( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar randu = factory();\n\n\n// EXPORTS //\n\nmodule.exports = randu;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create an array containing uniformly distributed pseudorandom numbers between `0` and `1`.\n*\n* @module @stdlib/random/array/randu\n*\n* @example\n* var randu = require( '@stdlib/random/array/randu' );\n*\n* var arr = randu( 10 );\n* // returns \n*\n* @example\n* var randu = require( '@stdlib/random/array/randu' );\n*\n* var arr = randu( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var randu = require( '@stdlib/random/array/randu' );\n*\n* var rand = randu.factory();\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var randu = require( '@stdlib/random/array/randu' );\n*\n* var rand = randu.factory();\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.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 sqrt = require( '@stdlib/math/base/special/sqrt' );\nvar ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number from a Rayleigh distribution with scale parameter `sigma`.\n*\n* @private\n* @param {PRNG} rand - PRNG for generating uniformly distributed numbers\n* @param {PositiveNumber} sigma - scale parameter\n* @returns {NonNegativeNumber} pseudorandom number\n*/\nfunction rayleigh( rand, sigma ) {\n\treturn sigma * sqrt( -2.0*ln( rand() ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = rayleigh;\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 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 isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar rayleigh0 = require( './rayleigh.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating Rayleigh distributed random numbers.\n*\n* @param {PositiveNumber} [sigma] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} `sigma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var rayleigh = factory( 1.0 );\n*\n* var v = rayleigh();\n* // returns \n*\n* @example\n* var rayleigh = factory( 0.5, {\n* 'seed': 297\n* });\n* var v = rayleigh();\n* // returns \n*\n* @example\n* var rayleigh = factory();\n* var v = rayleigh( 0.5 );\n* // returns \n*/\nfunction factory() {\n\tvar sigma;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if (\n\t\targuments.length === 1 &&\n\t\tisObject( arguments[ 0 ] )\n\t) {\n\t\topts = arguments[ 0 ];\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tsigma = arguments[ 0 ];\n\t\tif ( !isPositive( sigma ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', sigma ) );\n\t\t}\n\t\tif ( arguments.length > 1 ) {\n\t\t\topts = arguments[ 1 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( sigma === void 0 ) {\n\t\tprng = rayleigh2;\n\t} else {\n\t\tprng = rayleigh1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'rayleigh' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\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 = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( sigma === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ sigma ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number from a Rayleigh distribution with bound scale parameter `sigma`.\n\t*\n\t* @private\n\t* @returns {NonNegativeNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = rayleigh1();\n\t* // returns \n\t*/\n\tfunction rayleigh1() {\n\t\treturn rayleigh0( rand, sigma );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number from a Rayleigh distribution with scale parameter `sigma`.\n\t*\n\t* @private\n\t* @param {PositiveNumber} sigma - scale parameter\n\t* @returns {NonNegativeNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = rayleigh2( 3.0 );\n\t* // returns \n\t*/\n\tfunction rayleigh2( sigma ) {\n\t\tif (\n\t\t\tisnan( sigma ) ||\n\t\t\tsigma <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn rayleigh0( rand, sigma );\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' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Rayleigh distribution with scale parameter `sigma`.\n*\n* @name rayleigh\n* @type {Function}\n* @param {PositiveNumber} sigma - scale parameter\n* @returns {NonNegativeNumber} pseudorandom number\n*\n* @example\n* var v = rayleigh( 3.0 );\n* // returns \n*\n* @example\n* var v = rayleigh( 0.0 );\n* // returns NaN\n*\n* @example\n* var v = rayleigh( NaN );\n* // returns NaN\n*/\nvar rayleigh = factory();\n\n\n// EXPORTS //\n\nmodule.exports = rayleigh;\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* Rayleigh distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/rayleigh\n*\n* @example\n* var rayleigh = require( '@stdlib/random/base/rayleigh' );\n*\n* var v = rayleigh( 2.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/rayleigh' ).factory;\n* var rayleigh = factory( 3.0, {\n* 'seed': 297\n* });\n*\n* var v = rayleigh();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/rayleigh' ).factory;\n* var rayleigh = factory({\n* 'seed': 297\n* });\n*\n* var v = rayleigh( 2.0 );\n* // returns \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", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 unaryFactory = require( './../../../array/tools/unary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/rayleigh' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a Rayleigh distribution.\n*\n* @name factory\n* @type {Function}\n* @param {PositiveNumber} [sigma] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `sigma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var rayleigh = factory( 2.0 );\n* // returns \n*\n* var arr = rayleigh( 10 );\n* // returns \n*\n* @example\n* var rayleigh = factory( 2.0 );\n* // returns \n*\n* var arr = rayleigh( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = unaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a Rayleigh distribution.\n*\n* @name rayleigh\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {PositiveNumber} sigma - scale parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = rayleigh( 10, 2.0 );\n* // returns \n*\n* @example\n* var arr = rayleigh( 10, 2.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar rayleigh = factory();\n\n\n// EXPORTS //\n\nmodule.exports = rayleigh;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create an array containing pseudorandom numbers drawn from a Rayleigh distribution.\n*\n* @module @stdlib/random/array/rayleigh\n*\n* @example\n* var rayleigh = require( '@stdlib/random/array/rayleigh' );\n*\n* var arr = rayleigh( 10, 2.0 );\n* // returns \n*\n* @example\n* var rayleigh = require( '@stdlib/random/array/rayleigh' );\n*\n* var arr = rayleigh( 10, 2.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var rayleigh = require( '@stdlib/random/array/rayleigh' );\n*\n* var rand = rayleigh.factory( 2.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var rayleigh = require( '@stdlib/random/array/rayleigh' );\n*\n* var rand = rayleigh.factory( 2.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\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 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 isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isUint32Array = require( '@stdlib/assert/is-uint32array' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar chisquare = require( './../../../base/chisquare' ).factory;\nvar randn = require( './../../../base/improved-ziggurat' ).factory;\nvar gcopy = require( '@stdlib/blas/base/gcopy' );\nvar Uint32Array = require( '@stdlib/array/uint32' );\nvar assign = require( '@stdlib/object/assign' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar sqrt = require( '@stdlib/math/base/special/sqrt' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating t-distributed random numbers.\n*\n* @param {PositiveNumber} [v] - degrees of freedom\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} `v` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var t = factory( 1.0 );\n*\n* var v = t();\n* // returns \n*\n* @example\n* var t = factory( 0.5, {\n* 'seed': 297\n* });\n* var v = t();\n* // returns \n*\n* @example\n* var t = factory();\n* var v = t( 0.5 );\n* // returns \n*/\nfunction factory() {\n\tvar rchisq;\n\tvar STATE;\n\tvar rnorm;\n\tvar rand;\n\tvar opts;\n\tvar prng;\n\tvar FLG;\n\tvar v;\n\n\tFLG = true;\n\tif ( arguments.length === 0 ) {\n\t\topts = {\n\t\t\t'copy': false\n\t\t};\n\t\trnorm = randn( opts );\n\t} else if ( arguments.length === 1 ) {\n\t\tif ( isObject( arguments[ 0 ] ) ) {\n\t\t\topts = arguments[ 0 ];\n\t\t\tif ( hasOwnProp( opts, 'copy' ) && !isBoolean( opts.copy ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', opts.copy ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trnorm = randn({\n\t\t\t\t\t'prng': opts.prng\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tif ( hasOwnProp( opts, 'state' ) && !isUint32Array( opts.state ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a Uint32Array. Option: `%s`.', 'state', opts.state ) );\n\t\t\t\t}\n\t\t\t\topts = assign( {}, opts );\n\t\t\t\tif ( opts.copy === false ) {\n\t\t\t\t\tFLG = false;\n\t\t\t\t} else if ( opts.state ) {\n\t\t\t\t\topts.state = gcopy( opts.state.length, opts.state, 1, new Uint32Array( opts.state.length ), 1 ); // eslint-disable-line max-len\n\t\t\t\t}\n\t\t\t\topts.copy = false;\n\t\t\t\trnorm = randn( opts );\n\t\t\t}\n\t\t} else {\n\t\t\tv = arguments[ 0 ];\n\t\t\tif ( !isPositive( v ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number or an options object. Value: `%s`.', v ) );\n\t\t\t}\n\t\t\topts = {\n\t\t\t\t'copy': false\n\t\t\t};\n\t\t\trnorm = randn( opts );\n\t\t}\n\t} else {\n\t\tv = arguments[ 0 ];\n\t\tif ( !isPositive( v ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', v ) );\n\t\t}\n\t\topts = arguments[ 1 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'copy' ) && !isBoolean( opts.copy ) ) {\n\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', opts.copy ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trnorm = randn({\n\t\t\t\t'prng': opts.prng\n\t\t\t});\n\t\t} else {\n\t\t\tif ( hasOwnProp( opts, 'state' ) && !isUint32Array( opts.state ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a Uint32Array. Option: `%s`.', 'state', opts.state ) );\n\t\t\t}\n\t\t\topts = assign( {}, opts );\n\t\t\tif ( opts.copy === false ) {\n\t\t\t\tFLG = false;\n\t\t\t} else if ( opts.state ) {\n\t\t\t\topts.state = gcopy( opts.state.length, opts.state, 1, new Uint32Array( opts.state.length ), 1 ); // eslint-disable-line max-len\n\t\t\t}\n\t\t\topts.copy = false;\n\t\t\trnorm = randn( opts );\n\t\t}\n\t}\n\tif ( opts && opts.prng ) {\n\t\tif ( v === void 0 ) {\n\t\t\trchisq = chisquare({\n\t\t\t\t'prng': opts.prng\n\t\t\t});\n\t\t} else {\n\t\t\trchisq = chisquare( v, {\n\t\t\t\t'prng': opts.prng\n\t\t\t});\n\t\t}\n\t} else {\n\t\tif ( opts.state ) {\n\t\t\tSTATE = opts.state;\n\t\t} else {\n\t\t\tSTATE = rnorm.state;\n\t\t\trnorm.state = STATE; // updates the underlying PRNG to point to a shared state\n\t\t}\n\t\tif ( v === void 0 ) {\n\t\t\trchisq = chisquare({\n\t\t\t\t'state': STATE,\n\t\t\t\t'copy': false\n\t\t\t});\n\t\t} else {\n\t\t\trchisq = chisquare( v, {\n\t\t\t\t'state': STATE,\n\t\t\t\t'copy': false\n\t\t\t});\n\t\t}\n\t}\n\tif ( v === void 0 ) {\n\t\tprng = t2;\n\t} else {\n\t\tprng = t1;\n\t}\n\trand = rnorm.PRNG;\n\n\tsetReadOnly( prng, 'NAME', 't' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t}\n\tsetReadOnly( prng, 'PRNG', rand );\n\treturn prng;\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\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\tif ( !isUint32Array( s ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a Uint32Array. Value: `%s`.', s ) );\n\t\t}\n\t\tif ( FLG ) {\n\t\t\ts = gcopy( s.length, s, 1, new Uint32Array( s.length ), 1 );\n\t\t}\n\t\trand.state = s;\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 = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( v === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ v ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Student's t-distribution with bound degrees of freedom `v`.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = t1();\n\t* // returns \n\t*/\n\tfunction t1() {\n\t\treturn rnorm() / sqrt( rchisq() / v );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Student's t-distribution with degrees of freedom `v`.\n\t*\n\t* @private\n\t* @param {PositiveNumber} v - degrees of freedom\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = t2( 3.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = t2( 0.0 );\n\t* // returns NaN\n\t*\n\t* @example\n\t* var v = t2( -1.5 );\n\t* // returns NaN\n\t*/\n\tfunction t2( v ) {\n\t\tif (\n\t\t\tisnan( v ) ||\n\t\t\tv <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn rnorm() / sqrt( rchisq( v ) / v );\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' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Student's t-distribution with degrees of freedom `v`.\n*\n* @name t\n* @type {PRNG}\n* @param {PositiveNumber} v - degrees of freedom\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = t( 3.0 );\n* // returns \n*\n* @example\n* var v = t( 0.0 );\n* // returns NaN\n*\n* @example\n* var v = t( NaN );\n* // returns NaN\n*/\nvar t = factory();\n\n\n// EXPORTS //\n\nmodule.exports = t;\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* Student's t-distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/t\n*\n* @example\n* var t = require( '@stdlib/random/base/t' );\n*\n* var v = t( 2.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/t' ).factory;\n* var t = factory( 3.0, {\n* 'seed': 297\n* });\n*\n* var v = t();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/t' ).factory;\n* var t = factory({\n* 'seed': 297\n* });\n*\n* var v = t( 2.0 );\n* // returns \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", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 unaryFactory = require( './../../../array/tools/unary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/t' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a Student's t-distribution.\n*\n* @name factory\n* @type {Function}\n* @param {PositiveNumber} [v] - degrees of freedom\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `v` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var t = factory( 2.0 );\n* // returns \n*\n* var arr = t( 10 );\n* // returns \n*\n* @example\n* var t = factory( 2.0 );\n* // returns \n*\n* var arr = t( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = unaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a Student's t-distribution.\n*\n* @name t\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {PositiveNumber} v - degrees of freedom\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = t( 10, 2.0 );\n* // returns \n*\n* @example\n* var arr = t( 10, 2.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar t = factory();\n\n\n// EXPORTS //\n\nmodule.exports = t;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create an array containing pseudorandom numbers drawn from a Student's t-distribution.\n*\n* @module @stdlib/random/array/t\n*\n* @example\n* var t = require( '@stdlib/random/array/t' );\n*\n* var arr = t( 10, 2.0 );\n* // returns \n*\n* @example\n* var t = require( '@stdlib/random/array/t' );\n*\n* var arr = t( 10, 2.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var t = require( '@stdlib/random/array/t' );\n*\n* var rand = t.factory( 2.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var t = require( '@stdlib/random/array/t' );\n*\n* var rand = t.factory( 2.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\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 isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar isnan = require( '@stdlib/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {number} c - mode\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0, 1.3 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( a, b, c ) {\n\tif ( !isNumber( a ) || isnan( a ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', a ) );\n\t}\n\tif ( !isNumber( b ) || isnan( b ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a number and not NaN. Value: `%s`.', b ) );\n\t}\n\tif ( !isNumber( c ) || isnan( c ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Third argument must be a number and not NaN. Value: `%s`.', c ) );\n\t}\n\tif ( !(a <= c && c <= b) ) {\n\t\treturn new RangeError( format( 'invalid arguments. Parameters must satisfy the following condition: %s. a: `%f`. b: `%f`. c: `%f`.', 'a <= c <= b', a, b, c ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 sqrt = require( '@stdlib/math/base/special/sqrt' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a triangular distribution with minimum support `a`, maximum support `b` and mode `c`.\n*\n* @private\n* @param {PRNG} rand - PRNG for generating uniformly distributed numbers\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {number} c - mode\n* @returns {number} pseudorandom number\n*/\nfunction triangular( rand, a, b, c ) {\n\tvar fc;\n\tvar x;\n\tvar u;\n\tfc = (c - a) / (b - a);\n\tu = rand();\n\tif ( u < fc ) {\n\t\tx = (b - a) * (c - a);\n\t\treturn a + sqrt( x * u );\n\t}\n\tx = (b - a) * (b - c);\n\treturn b - sqrt( x * (1.0 - u) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = triangular;\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 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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar triangular0 = require( './triangular.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating random numbers drawn from a triangular distribution.\n*\n* @param {number} [a] - minimum support\n* @param {number} [b] - maximum support\n* @param {number} [c] - mode\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {TypeError} `c` must be a number\n* @throws {RangeError} arguments must satisfy `a <= c <= b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var triangular = factory( 0.0, 1.0, 0.8 );\n*\n* var v = triangular();\n* // returns \n*\n* @example\n* var triangular = factory( -3.0, -1.0, -2.0, {\n* 'seed': 297\n* });\n* var v = triangular();\n* // returns \n*/\nfunction factory() {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar a;\n\tvar b;\n\tvar c;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\ta = arguments[ 0 ];\n\t\tb = arguments[ 1 ];\n\t\tc = arguments[ 2 ];\n\t\terr = validate( a, b, c );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 3 ) {\n\t\t\topts = arguments[ 3 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( a === void 0 ) {\n\t\tprng = triangular2;\n\t} else {\n\t\tprng = triangular1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'triangular' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\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 = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( a === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ a, b, c ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a triangular distribution with bound parameters.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = triangular1();\n\t* // returns \n\t*/\n\tfunction triangular1() {\n\t\treturn triangular0( rand, a, b, c );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a triangular distribution with minimum support `a`, maximum support `b`, and mode `c`.\n\t*\n\t* @private\n\t* @param {number} a - minimum support\n\t* @param {number} b - maximum support\n\t* @param {number} c - mode\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = triangular2( 0.0, 1.0, 0.5 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = triangular2( 1.0, 0.0, 0.5 );\n\t* // returns NaN\n\t*\n\t* @example\n\t* var v = triangular2( 1.0, 2.0, NaN );\n\t* // returns NaN\n\t*/\n\tfunction triangular2( a, b, c ) {\n\t\tif (\n\t\t\tisnan( a ) ||\n\t\t\tisnan( b ) ||\n\t\t\tisnan( c ) ||\n\t\t\t!(a <= c && c <= b)\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn triangular0( rand, a, b, c );\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' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a triangular distribution with minimum support `a`, maximum support `b`, and mode `c`.\n*\n* @name triangular\n* @type {PRNG}\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {number} c - mode\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = triangular( 0.0, 1.0, 0.5 );\n* // returns \n*/\nvar triangular = factory();\n\n\n// EXPORTS //\n\nmodule.exports = triangular;\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* Triangular distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/triangular\n*\n* @example\n* var triangular = require( '@stdlib/random/base/triangular' );\n*\n* var v = triangular( 0.0, 10.0, 7.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/triangular' ).factory;\n* var triangular = factory( -5.0, 5.0, 3.0, {\n* 'seed': 297\n* });\n*\n* var v = triangular();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/triangular' ).factory;\n* var triangular = factory({\n* 'seed': 297\n* });\n*\n* var v = triangular( -5.0, 5.0, 3.0 );\n* // returns \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", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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 ternaryFactory = require( './../../../array/tools/ternary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/triangular' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a triangular distribution.\n*\n* @name factory\n* @type {Function}\n* @param {number} [a] - minimum support\n* @param {number} [b] - maximum support\n* @param {number} [c] - mode\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {TypeError} `c` must be a number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var triangular = factory( 2.0, 5.0, 3.0 );\n* // returns \n*\n* var arr = triangular( 10 );\n* // returns \n*\n* @example\n* var triangular = factory( 2.0, 5.0, 3.0 );\n* // returns \n*\n* var arr = triangular( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = ternaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a triangular distribution.\n*\n* @name triangular\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {number} c - mode\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = triangular( 10, 2.0, 5.0, 3.0 );\n* // returns \n*\n* @example\n* var arr = triangular( 10, 2.0, 5.0, 3.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar triangular = factory();\n\n\n// EXPORTS //\n\nmodule.exports = triangular;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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* Create an array containing pseudorandom numbers drawn from a triangular distribution.\n*\n* @module @stdlib/random/array/triangular\n*\n* @example\n* var triangular = require( '@stdlib/random/array/triangular' );\n*\n* var arr = triangular( 10, 2.0, 5.0, 3.0 );\n* // returns \n*\n* @example\n* var triangular = require( '@stdlib/random/array/triangular' );\n*\n* var arr = triangular( 10, 2.0, 5.0, 3.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var triangular = require( '@stdlib/random/array/triangular' );\n*\n* var rand = triangular.factory( 2.0, 5.0, 3.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var triangular = require( '@stdlib/random/array/triangular' );\n*\n* var rand = triangular.factory( 2.0, 5.0, 3.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\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 isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar isnan = require( '@stdlib/assert/is-nan' );\n\n\n// MAIN //\n\n/**\n* Validates values provided for minimum and maximum support.\n*\n* @private\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( a, b ) {\n\tif ( !isNumber( a ) || isnan( a ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', a ) );\n\t}\n\tif ( !isNumber( b ) || isnan( b ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a number and not NaN. Value: `%s`.', b ) );\n\t}\n\tif ( a >= b ) {\n\t\treturn new RangeError( format( 'invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.', a, b ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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* Returns a uniformly distributed pseudorandom number with minimum support `a` and maximum support `b`.\n*\n* @private\n* @param {PRNG} rand - pseudorandom number generator\n* @param {number} a - minimum support (inclusive)\n* @param {number} b - maximum support (exclusive)\n* @returns {number} pseudorandom number\n*/\nfunction uniform( rand, a, b ) {\n\tvar r = rand();\n\treturn ( b*r ) + ( (1.0-r)*a ); // equivalent to (b-a)*r + a\n}\n\n\n// EXPORTS //\n\nmodule.exports = uniform;\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 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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar uniform0 = require( './uniform.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating uniformly distributed random numbers.\n*\n* @param {number} [a] - minimum support (inclusive)\n* @param {number} [b] - maximum support (exclusive)\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {RangeError} `a` must be less than `b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var uniform = factory( 0.0, 1.0 );\n*\n* var v = uniform();\n* // returns \n*\n* @example\n* var uniform = factory( -3.0, -1.0, {\n* 'seed': 297\n* });\n* var v = uniform();\n* // returns \n*/\nfunction factory() {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar a;\n\tvar b;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\ta = arguments[ 0 ];\n\t\tb = arguments[ 1 ];\n\t\terr = validate( a, b );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( a === void 0 ) {\n\t\tprng = uniform2;\n\t} else {\n\t\tprng = uniform1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'uniform' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\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 = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( a === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ a, b ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a uniformly distributed pseudorandom number with minimum support `a` and maximum support `b`.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = uniform1();\n\t* // returns \n\t*/\n\tfunction uniform1() {\n\t\treturn uniform0( rand, a, b );\n\t}\n\n\t/**\n\t* Returns a uniformly distributed pseudorandom number with minimum support `a` and maximum support `b`.\n\t*\n\t* @private\n\t* @param {number} a - minimum support (inclusive)\n\t* @param {number} b - maximum support (exclusive)\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = uniform2( 0.0, 1.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = uniform2( 1.0, 0.0 );\n\t* // returns NaN\n\t*/\n\tfunction uniform2( a, b ) {\n\t\tif (\n\t\t\tisnan( a ) ||\n\t\t\tisnan( b ) ||\n\t\t\ta >= b\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn uniform0( rand, a, b );\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' );\n\n\n// MAIN //\n\n/**\n* Returns a uniformly distributed pseudorandom number with minimum support `a` and maximum support `b`.\n*\n* @name uniform\n* @type {PRNG}\n* @param {number} a - minimum support (inclusive)\n* @param {number} b - maximum support (exclusive)\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = uniform( 0.0, 1.0 );\n* // returns \n*/\nvar uniform = factory();\n\n\n// EXPORTS //\n\nmodule.exports = uniform;\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* Uniform distribution pseudorandom numbers.\n*\n* @module @stdlib/random/base/uniform\n*\n* @example\n* var uniform = require( '@stdlib/random/base/uniform' );\n*\n* var v = uniform( 0.0, 1.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/uniform' ).factory;\n* var uniform = factory( -5.0, 5.0, {\n* 'seed': 297\n* });\n*\n* var v = uniform();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/uniform' ).factory;\n* var uniform = factory({\n* 'seed': 297\n* });\n*\n* var v = uniform( -5.0, 5.0 );\n* // returns \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", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 binaryFactory = require( './../../../array/tools/binary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/uniform' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a continuous uniform distribution.\n*\n* @name factory\n* @type {Function}\n* @param {number} [a] - minimum support\n* @param {number} [b] - maximum support\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var uniform = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = uniform( 10 );\n* // returns \n*\n* @example\n* var uniform = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = uniform( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = binaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a continuous uniform distribution.\n*\n* @name uniform\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = uniform( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = uniform( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar uniform = factory();\n\n\n// EXPORTS //\n\nmodule.exports = uniform;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create an array containing pseudorandom numbers drawn from a continuous uniform distribution.\n*\n* @module @stdlib/random/array/uniform\n*\n* @example\n* var uniform = require( '@stdlib/random/array/uniform' );\n*\n* var arr = uniform( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var uniform = require( '@stdlib/random/array/uniform' );\n*\n* var arr = uniform( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var uniform = require( '@stdlib/random/array/uniform' );\n*\n* var rand = uniform.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var uniform = require( '@stdlib/random/array/uniform' );\n*\n* var rand = uniform.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\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 isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {PositiveNumber} k - scale parameter\n* @param {PositiveNumber} lambda - shape parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( k, lambda ) {\n\tif ( !isPositive( k ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Scale parameter must be a positive number. Value: `%s`.', k ) );\n\t}\n\tif ( !isPositive( lambda ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Shape parameter must be a positive number. Value: `%s`.', lambda ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 pow = require( '@stdlib/math/base/special/pow' );\nvar ln = require( '@stdlib/math/base/special/ln' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Weibull distribution.\n*\n* @private\n* @param {PRNG} rand - PRNG for generating uniformly distributed numbers\n* @param {PositiveNumber} k - scale parameter\n* @param {PositiveNumber} lambda - shape parameter\n* @returns {NonNegativeNumber} pseudorandom number\n*/\nfunction weibull( rand, k, lambda ) {\n\treturn lambda * pow( -ln( 1.0-rand() ), 1.0/k );\n}\n\n\n// EXPORTS //\n\nmodule.exports = weibull;\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 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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar randu = require( './../../../base/mt19937' ).factory;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar validate = require( './validate.js' );\nvar weibull0 = require( './weibull.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating Weibull distributed random numbers.\n*\n* @param {PositiveNumber} [k] - scale parameter\n* @param {PositiveNumber} [lambda] - shape parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} `k` must be a positive number\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var weibull = factory( 2.0, 1.0 );\n*\n* var v = weibull();\n* // returns \n*\n* @example\n* var weibull = factory( 2.0, 2.0, {\n* 'seed': 297\n* });\n* var v = weibull();\n* // returns \n*/\nfunction factory() {\n\tvar lambda;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\tvar k;\n\n\tif ( arguments.length === 0 ) {\n\t\trand = randu();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trand = opts.prng;\n\t\t} else {\n\t\t\trand = randu( opts );\n\t\t}\n\t} else {\n\t\tk = arguments[ 0 ];\n\t\tlambda = arguments[ 1 ];\n\t\terr = validate( lambda, k );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trand = opts.prng;\n\t\t\t} else {\n\t\t\t\trand = randu( opts );\n\t\t\t}\n\t\t} else {\n\t\t\trand = randu();\n\t\t}\n\t}\n\tif ( lambda === void 0 ) {\n\t\tprng = weibull2;\n\t} else {\n\t\tprng = weibull1;\n\t}\n\tsetReadOnly( prng, 'NAME', 'weibull' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t\tsetReadOnly( prng, 'PRNG', rand );\n\t\trand = rand.normalized;\n\t}\n\treturn prng;\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\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 = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( k === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ k, lambda ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Weibull distribution.\n\t*\n\t* @private\n\t* @returns {NonNegativeNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = weibull1();\n\t* // returns \n\t*/\n\tfunction weibull1() {\n\t\treturn weibull0( rand, k, lambda );\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a Weibull distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} k - scale parameter\n\t* @param {PositiveNumber} lambda - shape parameter\n\t* @returns {NonNegativeNumber} pseudorandom number\n\t*\n\t* @example\n\t* var v = weibull2( 2.0, 1.0 );\n\t* // returns \n\t*\n\t* @example\n\t* var v = weibull2( 3.0, 0.0 );\n\t* // returns NaN\n\t*\n\t* @example\n\t* var v = weibull2( 0.0, 2.0 );\n\t* // returns NaN\n\t*\n\t* @example\n\t* var v = weibull2( NaN, NaN );\n\t* // returns NaN\n\t*/\n\tfunction weibull2( k, lambda ) {\n\t\tif (\n\t\t\tisnan( k ) ||\n\t\t\tisnan( lambda ) ||\n\t\t\tk <= 0.0 ||\n\t\t\tlambda <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn weibull0( rand, k, lambda );\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' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number drawn from a Weibull distribution.\n*\n* @name weibull\n* @type {PRNG}\n* @param {PositiveNumber} k - scale parameter\n* @param {PositiveNumber} lambda - shape parameter\n* @returns {NonNegativeNumber} pseudorandom number\n*\n* @example\n* var v = weibull( 2.0, 3.0 );\n* // returns \n*\n* @example\n* var v = weibull( -2.0, 3.0 );\n* // returns NaN\n*/\nvar weibull = factory();\n\n\n// EXPORTS //\n\nmodule.exports = weibull;\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* Weibull distributed pseudorandom numbers.\n*\n* @module @stdlib/random/base/weibull\n*\n* @example\n* var weibull = require( '@stdlib/random/base/weibull' );\n*\n* var v = weibull( 2.0, 3.0 );\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/weibull' ).factory;\n* var weibull = factory( 2.0, 3.0, {\n* 'seed': 297\n* });\n*\n* var v = weibull();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/weibull' ).factory;\n* var weibull = factory({\n* 'seed': 297\n* });\n*\n* var v = weibull( 2.0, 3.0 );\n* // returns \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", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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 binaryFactory = require( './../../../array/tools/binary-factory' );\nvar dtypes = require( '@stdlib/array/dtypes' );\nvar defaults = require( '@stdlib/array/defaults' );\nvar base = require( './../../../base/weibull' );\n\n\n// VARIABLES //\n\nvar DTYPES = dtypes( 'real_floating_point_and_generic' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating arrays containing pseudorandom numbers drawn from a Weibull distribution.\n*\n* @name factory\n* @type {Function}\n* @param {PositiveNumber} [k] - scale parameter\n* @param {PositiveNumber} [lambda] - shape parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {string} [options.dtype=\"float64\"] - default data type\n* @throws {TypeError} `k` must be a positive number\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for creating arrays\n*\n* @example\n* var weibull = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = weibull( 10 );\n* // returns \n*\n* @example\n* var weibull = factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = weibull( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar factory = binaryFactory( base, DTYPES, defaults.get( 'dtypes.real_floating_point' ) );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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' );\n\n\n// MAIN //\n\n/**\n* Returns an array containing pseudorandom numbers drawn from a Weibull distribution.\n*\n* @name weibull\n* @type {Function}\n* @param {NonNegativeInteger} len - array length\n* @param {PositiveNumber} k - scale parameter\n* @param {PositiveNumber} lambda - shape parameter\n* @param {Options} [options] - options\n* @param {string} [options.dtype=\"float64\"] - output array data type\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {(Array|TypedArray)} output array\n*\n* @example\n* var arr = weibull( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var arr = weibull( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*/\nvar weibull = factory();\n\n\n// EXPORTS //\n\nmodule.exports = weibull;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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* Create an array containing pseudorandom numbers drawn from a Weibull distribution.\n*\n* @module @stdlib/random/array/weibull\n*\n* @example\n* var weibull = require( '@stdlib/random/array/weibull' );\n*\n* var arr = weibull( 10, 2.0, 5.0 );\n* // returns \n*\n* @example\n* var weibull = require( '@stdlib/random/array/weibull' );\n*\n* var arr = weibull( 10, 2.0, 5.0, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\n*\n* @example\n* var weibull = require( '@stdlib/random/array/weibull' );\n*\n* var rand = weibull.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10 );\n* // returns \n*\n* @example\n* var weibull = require( '@stdlib/random/array/weibull' );\n*\n* var rand = weibull.factory( 2.0, 5.0 );\n* // returns \n*\n* var arr = rand( 10, {\n* 'dtype': 'generic'\n* });\n* // returns [...]\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\n// exports: { \"factory\": \"main.factory\", \"assign\": \"main.assign\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-read-only-property' );\n\n\n// MAIN //\n\n/**\n* Top-level namespace.\n*\n* @namespace ns\n*/\nvar ns = {};\n\n/**\n* @name arcsine\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/arcsine}\n*/\nsetReadOnly( ns, 'arcsine', require( './../../array/arcsine' ) );\n\n/**\n* @name bernoulli\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/bernoulli}\n*/\nsetReadOnly( ns, 'bernoulli', require( './../../array/bernoulli' ) );\n\n/**\n* @name beta\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/beta}\n*/\nsetReadOnly( ns, 'beta', require( './../../array/beta' ) );\n\n/**\n* @name betaprime\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/betaprime}\n*/\nsetReadOnly( ns, 'betaprime', require( './../../array/betaprime' ) );\n\n/**\n* @name binomial\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/binomial}\n*/\nsetReadOnly( ns, 'binomial', require( './../../array/binomial' ) );\n\n/**\n* @name cauchy\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/cauchy}\n*/\nsetReadOnly( ns, 'cauchy', require( './../../array/cauchy' ) );\n\n/**\n* @name chi\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/chi}\n*/\nsetReadOnly( ns, 'chi', require( './../../array/chi' ) );\n\n/**\n* @name chisquare\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/chisquare}\n*/\nsetReadOnly( ns, 'chisquare', require( './../../array/chisquare' ) );\n\n/**\n* @name cosine\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/cosine}\n*/\nsetReadOnly( ns, 'cosine', require( './../../array/cosine' ) );\n\n/**\n* @name discreteUniform\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/discrete-uniform}\n*/\nsetReadOnly( ns, 'discreteUniform', require( './../../array/discrete-uniform' ) );\n\n/**\n* @name erlang\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/erlang}\n*/\nsetReadOnly( ns, 'erlang', require( './../../array/erlang' ) );\n\n/**\n* @name exponential\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/exponential}\n*/\nsetReadOnly( ns, 'exponential', require( './../../array/exponential' ) );\n\n/**\n* @name f\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/f}\n*/\nsetReadOnly( ns, 'f', require( './../../array/f' ) );\n\n/**\n* @name frechet\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/frechet}\n*/\nsetReadOnly( ns, 'frechet', require( './../../array/frechet' ) );\n\n/**\n* @name gamma\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/gamma}\n*/\nsetReadOnly( ns, 'gamma', require( './../../array/gamma' ) );\n\n/**\n* @name geometric\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/geometric}\n*/\nsetReadOnly( ns, 'geometric', require( './../../array/geometric' ) );\n\n/**\n* @name gumbel\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/gumbel}\n*/\nsetReadOnly( ns, 'gumbel', require( './../../array/gumbel' ) );\n\n/**\n* @name hypergeometric\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/hypergeometric}\n*/\nsetReadOnly( ns, 'hypergeometric', require( './../../array/hypergeometric' ) );\n\n/**\n* @name invgamma\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/invgamma}\n*/\nsetReadOnly( ns, 'invgamma', require( './../../array/invgamma' ) );\n\n/**\n* @name kumaraswamy\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/kumaraswamy}\n*/\nsetReadOnly( ns, 'kumaraswamy', require( './../../array/kumaraswamy' ) );\n\n/**\n* @name laplace\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/laplace}\n*/\nsetReadOnly( ns, 'laplace', require( './../../array/laplace' ) );\n\n/**\n* @name levy\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/levy}\n*/\nsetReadOnly( ns, 'levy', require( './../../array/levy' ) );\n\n/**\n* @name logistic\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/logistic}\n*/\nsetReadOnly( ns, 'logistic', require( './../../array/logistic' ) );\n\n/**\n* @name lognormal\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/lognormal}\n*/\nsetReadOnly( ns, 'lognormal', require( './../../array/lognormal' ) );\n\n/**\n* @name minstd\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/minstd}\n*/\nsetReadOnly( ns, 'minstd', require( './../../array/minstd' ) );\n\n/**\n* @name minstdShuffle\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/minstd-shuffle}\n*/\nsetReadOnly( ns, 'minstdShuffle', require( './../../array/minstd-shuffle' ) );\n\n/**\n* @name mt19937\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/mt19937}\n*/\nsetReadOnly( ns, 'mt19937', require( './../../array/mt19937' ) );\n\n/**\n* @name negativeBinomial\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/negative-binomial}\n*/\nsetReadOnly( ns, 'negativeBinomial', require( './../../array/negative-binomial' ) );\n\n/**\n* @name normal\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/normal}\n*/\nsetReadOnly( ns, 'normal', require( './../../array/normal' ) );\n\n/**\n* @name pareto1\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/pareto-type1}\n*/\nsetReadOnly( ns, 'pareto1', require( './../../array/pareto-type1' ) );\n\n/**\n* @name poisson\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/poisson}\n*/\nsetReadOnly( ns, 'poisson', require( './../../array/poisson' ) );\n\n/**\n* @name randu\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/randu}\n*/\nsetReadOnly( ns, 'randu', require( './../../array/randu' ) );\n\n/**\n* @name rayleigh\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/rayleigh}\n*/\nsetReadOnly( ns, 'rayleigh', require( './../../array/rayleigh' ) );\n\n/**\n* @name t\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/t}\n*/\nsetReadOnly( ns, 't', require( './../../array/t' ) );\n\n/**\n* @name triangular\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/triangular}\n*/\nsetReadOnly( ns, 'triangular', require( './../../array/triangular' ) );\n\n/**\n* @name uniform\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/uniform}\n*/\nsetReadOnly( ns, 'uniform', require( './../../array/uniform' ) );\n\n/**\n* @name weibull\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/array/weibull}\n*/\nsetReadOnly( ns, 'weibull', require( './../../array/weibull' ) );\n\n\n// EXPORTS //\n\nmodule.exports = ns;\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 sqrt = require( '@stdlib/math/base/special/sqrt' );\nvar ln = require( '@stdlib/math/base/special/ln' );\nvar sin = require( '@stdlib/math/base/special/sin' );\nvar cos = require( '@stdlib/math/base/special/cos' );\nvar TWO_PI = require( '@stdlib/constants/float64/two-pi' );\n\n\n// MAIN //\n\n/**\n* Returns a function for generating standard normally distributed pseudorandom numbers using the Box-Muller algorithm.\n*\n* @private\n* @param {PRNG} rand - PRNG which returns standard uniformly distributed numbers\n* @returns {PRNG} PRNG\n*/\nfunction wrap( rand ) {\n\tvar flg;\n\tvar r;\n\n\t// Flag indicating whether to generate new normal random variates or return a cached normal random variate:\n\tflg = true;\n\n\treturn randn;\n\n\t/**\n\t* Generates a standard normally distributed pseudorandom number.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var r = randn();\n\t* // returns \n\t*/\n\tfunction randn() {\n\t\tvar u1;\n\t\tvar u2;\n\t\tvar a;\n\t\tvar b;\n\t\tif ( flg ) {\n\t\t\t// Note: if `u1` is `0`, the natural log blows up, so we keep trying until we get a non-zero rand. Rarely should we need more than one iteration.\n\t\t\tdo {\n\t\t\t\tu1 = rand();\n\t\t\t\tu2 = rand();\n\t\t\t} while (\n\t\t\t\tu1 === 0.0\n\t\t\t);\n\t\t\ta = sqrt( -2.0 * ln(u1) );\n\t\t\tb = TWO_PI * u2;\n\t\t\tr = a * cos( b ); // cache for next call\n\t\t\tflg = false;\n\t\t\treturn a * sin( b );\n\t\t}\n\t\tflg = true;\n\t\treturn r;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = wrap;\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 sqrt = require( '@stdlib/math/base/special/sqrt' );\nvar ln = require( '@stdlib/math/base/special/ln' );\nvar cos = require( '@stdlib/math/base/special/cos' );\nvar PI = require( '@stdlib/constants/float64/pi' );\n\n\n// VARIABLES //\n\nvar COS_PI = cos( PI ); // -1\n\n\n// MAIN //\n\n/**\n* Returns the minimum possible normally distributed pseudorandom number.\n*\n* @private\n* @param {number} min - minimum possible uniformly distributed pseudorandom number\n* @returns {number} minimum possible number\n*/\nfunction getMin( min ) {\n\tvar a = sqrt( -2.0 * ln( min ) );\n\treturn a * COS_PI;\n}\n\n\n// EXPORTS //\n\nmodule.exports = getMin;\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 sqrt = require( '@stdlib/math/base/special/sqrt' );\nvar ln = require( '@stdlib/math/base/special/ln' );\nvar cos = require( '@stdlib/math/base/special/cos' );\nvar TWO_PI = require( '@stdlib/constants/float64/two-pi' );\n\n\n// MAIN //\n\n/**\n* Returns the maximum possible normally distributed pseudorandom number.\n*\n* @private\n* @param {number} min - minimum possible uniformly distributed pseudorandom number\n* @returns {number} maximum possible number\n*/\nfunction getMax( min ) {\n\tvar a = sqrt( -2.0 * ln( min ) );\n\tvar b = TWO_PI * min;\n\treturn a * cos( b );\n}\n\n\n// EXPORTS //\n\nmodule.exports = getMax;\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 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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isUint32Array = require( '@stdlib/assert/is-uint32array' );\nvar mt19937 = require( './../../../base/mt19937' ).factory;\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar randn0 = require( './randn.js' );\nvar getMin = require( './min.js' );\nvar getMax = require( './max.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator which implements the Box-Muller transform to generate standard normally distributed pseudorandom numbers.\n*\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} must provide an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var randn = factory();\n*\n* var r = randn();\n* // returns \n*\n* @example\n* // Return a seeded PRNG:\n* var randn = factory({\n* 'seed': 12345\n* });\n*\n* var r = randn();\n* // returns \n*/\nfunction factory( options ) {\n\tvar randu;\n\tvar randn;\n\tvar rand;\n\tvar opts;\n\n\topts = {\n\t\t'copy': true\n\t};\n\tif ( arguments.length ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide 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, 'prng' ) ) {\n\t\t\tif ( !isFunction( options.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', options.prng ) );\n\t\t\t}\n\t\t\trandu = options.prng;\n\t\t}\n\t\t// If provided a PRNG, ignore the `state` option, as we don't support getting or setting PRNG state.\n\t\telse if ( hasOwnProp( options, 'state' ) ) {\n\t\t\topts.state = options.state;\n\t\t\tif ( !isUint32Array( options.state ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a Uint32Array. Option: `%s`.', 'state', options.state ) );\n\t\t\t}\n\t\t}\n\t\t// If provided a PRNG, ignore the `seed` option, as a `seed`, by itself, is insufficient to guarantee reproducibility. If provided a state, ignore the `seed` option, as a PRNG state should contain seed information.\n\t\telse if ( hasOwnProp( options, 'seed' ) ) {\n\t\t\topts.seed = options.seed;\n\t\t\tif ( options.seed === void 0 ) {\n\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', options.seed ) );\n\t\t\t}\n\t\t}\n\t}\n\tif ( opts.state === void 0 ) {\n\t\tif ( randu === void 0 ) {\n\t\t\trand = mt19937( opts );\n\t\t\trandu = rand.normalized;\n\t\t} else {\n\t\t\topts.seed = null;\n\t\t}\n\t} else {\n\t\trand = mt19937( opts );\n\t\trandu = rand.normalized;\n\t}\n\trandn = randn0( randu );\n\n\tsetReadOnly( randn, 'NAME', 'box-muller' );\n\tif ( opts.seed === null ) {\n\t\tsetReadOnly( randn, 'seed', null );\n\t\tsetReadOnly( randn, 'seedLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( randn, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( randn, 'seedLength', getSeedLength );\n\t}\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( options && options.prng ) {\n\t\tsetReadWriteAccessor( randn, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( randn, 'stateLength', null );\n\t\tsetReadOnly( randn, 'byteLength', null );\n\t\tsetReadOnly( randn, 'toJSON', constantFunction( null ) );\n\t} else {\n\t\tsetReadWriteAccessor( randn, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( randn, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( randn, 'byteLength', getStateSize );\n\t\tsetReadOnly( randn, 'toJSON', toJSON );\n\t}\n\tsetReadOnly( randn, 'PRNG', randu );\n\n\tif ( hasOwnProp( randu, 'MIN' ) ) {\n\t\tsetReadOnly( randn, 'MIN', getMin( randu.MIN ) );\n\t\tsetReadOnly( randn, 'MAX', getMax( randu.MIN ) );\n\t} else {\n\t\tsetReadOnly( randn, 'MIN', null );\n\t\tsetReadOnly( randn, 'MAX', null );\n\t}\n\n\treturn randn;\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\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 = randn.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tout.params = [];\n\t\treturn out;\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' );\n\n\n// MAIN //\n\n/**\n* Generates a standard normally distributed random number.\n*\n* ## Method\n*\n* - Given two independent uniformly distributed random variables \\\\( U_1 \\\\) and \\\\( U_2 \\\\) in the interval \\\\( [0,1) \\\\), let\n*\n* ``` tex\n* \\begin{align*}\n* Z_1 &= R \\cos(\\theta) = \\sqrt{-2 \\ln(U_1)} \\cos(2\\pi U_2) \\\\\n* Z_2 &= R \\sin(\\theta) = \\sqrt{-2 \\ln(U_1)} \\sin(2\\pi U_2)\n* \\end{align*}\n* ```\n*\n* where \\\\( Z_1 \\\\) and \\\\( Z_2 \\\\) are independent random variables with a standard normal distribution.\n*\n* - As two uniform random variates are mapped to two standard normal random variates, one of the random variates is cached and returned upon the following invocation.\n*\n* ## Notes\n*\n* - The minimum and maximum pseudorandom numbers which can be generated are dependent on the number of bits an underlying uniform pseudorandom number generator (PRNG) uses. For instance, if a PRNG uses \\\\( 32 \\\\) bits, the smallest non-zero number that can be generated is \\\\( 2^{-32}). When \\\\( U_1 \\\\) equals this value and \\\\( U_2 \\\\) equals \\\\( 0 \\\\),\n*\n* ``` tex\n* r = \\sqrt{-2\\ln(2^{-32})} \\cos(2\\pi) \\approx 6.66\n* ```\n*\n* which means that the algorithm cannot produce random variates more than \\\\( 6.66 \\\\) standard deviations from the mean.\n*\n* \n*\n* This corresponds to a \\\\( 2.74 \\times 10^{-11} \\\\) loss due to tail truncation.\n*\n* \n*\n* ## References\n*\n* - Box, G. E. P., and Mervin E. Muller. 1958. \"A Note on the Generation of Random Normal Deviates.\" _The Annals of Mathematical Statistics_ 29 (2). The Institute of Mathematical Statistics: 610\u201311. doi:[10.1214/aoms/1177706645](http://dx.doi.org/10.1214/aoms/1177706645).\n* - Bell, James R. 1968. \"Algorithm 334: Normal Random Deviates.\" _Communications of the ACM_ 11 (7). New York, NY, USA: ACM: 498. doi:[10.1145/363397.363547](http://dx.doi.org/10.1145/363397.363547).\n* - Knop, R. 1969. \"Remark on Algorithm 334 \\[G5]: Normal Random Deviates.\" _Communications of the ACM_ 12 (5). New York, NY, USA: ACM: 281. doi:[10.1145/362946.362996](http://dx.doi.org/10.1145/362946.362996).\n* - Marsaglia, G., and T. A. Bray. 1964. \"A Convenient Method for Generating Normal Variables.\" _SIAM Review_ 6 (3). Society for Industrial; Applied Mathematics: 260\u201364. doi:[10.1137/1006063](http://dx.doi.org/10.1137/1006063).\n* - Thomas, David B., Wayne Luk, Philip H.W. Leong, and John D. Villasenor. 2007. \"Gaussian Random Number Generators.\" _ACM Computing Surveys_ 39 (4). New York, NY, USA: ACM. doi:[10.1145/1287620.1287622](http://dx.doi.org/10.1145/1287620.1287622).\n*\n* @name randn\n* @type {PRNG}\n* @returns {number} pseudorandom number\n*\n* @example\n* var r = randn();\n* // returns \n*/\nvar randn = factory();\n\n\n// EXPORTS //\n\nmodule.exports = randn;\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* Normally distributed pseudorandom numbers using the Box-Muller transform.\n*\n* @module @stdlib/random/base/box-muller\n*\n* @example\n* var randn = require( '@stdlib/random/base/box-muller' );\n*\n* var r = randn();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/box-muller' ).factory;\n*\n* var randn = factory({\n* 'seed': 12345\n* });\n*\n* var r = randn();\n* // returns \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", "{\n\t\"name\": \"mt19937\",\n\t\"copy\": true\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'use strict';\n\n// MODULES //\n\nvar minstd = require( './../../../base/minstd' );\nvar minstdShuffle = require( './../../../base/minstd-shuffle' );\nvar mt19937 = require( './../../../base/mt19937' );\n\n\n// MAIN //\n\nvar prngs = {};\n\nprngs[ 'minstd' ] = minstd;\nprngs[ 'minstd-shuffle' ] = minstdShuffle;\nprngs[ 'mt19937' ] = mt19937;\n\n\n// EXPORTS //\n\nmodule.exports = prngs;\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 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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar format = require( '@stdlib/string/format' );\nvar defaults = require( './defaults.json' );\nvar PRNGS = require( './prngs.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating random numbers having integer values.\n*\n* @param {Options} [options] - function options\n* @param {string} [options.name='mt19937'] - name of pseudorandom number generator\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [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} must provide an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide the name of a supported pseudorandom number generator\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var randi = factory();\n* var v = randi();\n* // returns \n*\n* @example\n* var randi = factory({\n* 'name': 'minstd'\n* });\n* var v = randi();\n* // returns \n*\n* @example\n* var randi = factory({\n* 'seed': 12345\n* });\n* var v = randi();\n* // returns \n*\n* @example\n* var randi = factory({\n* 'name': 'minstd',\n* 'seed': 12345\n* });\n* var v = randi();\n* // returns \n*/\nfunction factory( options ) {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\n\topts = {\n\t\t'name': defaults.name,\n\t\t'copy': defaults.copy\n\t};\n\tif ( arguments.length ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide an object. Value: `%s`.', options ) );\n\t\t}\n\t\tif ( hasOwnProp( options, 'name' ) ) {\n\t\t\topts.name = options.name;\n\t\t}\n\t\tif ( hasOwnProp( options, 'state' ) ) {\n\t\t\topts.state = options.state;\n\t\t\tif ( opts.state === void 0 ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option cannot be undefined. Option: `%s`.', 'state', opts.state ) );\n\t\t\t}\n\t\t} else if ( hasOwnProp( options, 'seed' ) ) {\n\t\t\topts.seed = options.seed;\n\t\t\tif ( opts.seed === void 0 ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option cannot be undefined. Option: `%s`.', 'seed', opts.seed ) );\n\t\t\t}\n\t\t}\n\t\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\t\topts.copy = options.copy;\n\t\t\tif ( !isBoolean( opts.copy ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', opts.copy ) );\n\t\t\t}\n\t\t}\n\t}\n\tprng = PRNGS[ opts.name ];\n\tif ( prng === void 0 ) {\n\t\tthrow new Error( format( 'invalid option. Unrecognized/unsupported PRNG. Option: `%s`.', opts.name ) );\n\t}\n\tif ( opts.state === void 0 ) {\n\t\tif ( opts.seed === void 0 ) {\n\t\t\trand = prng.factory();\n\t\t} else {\n\t\t\trand = prng.factory({\n\t\t\t\t'seed': opts.seed\n\t\t\t});\n\t\t}\n\t} else {\n\t\trand = prng.factory({\n\t\t\t'state': opts.state,\n\t\t\t'copy': opts.copy\n\t\t});\n\t}\n\tsetReadOnly( randi, 'NAME', 'randi' );\n\tsetReadOnlyAccessor( randi, 'seed', getSeed );\n\tsetReadOnlyAccessor( randi, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( randi, 'state', getState, setState );\n\tsetReadOnlyAccessor( randi, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( randi, 'byteLength', getStateSize );\n\tsetReadOnly( randi, 'toJSON', toJSON );\n\tsetReadOnly( randi, 'PRNG', rand );\n\tsetReadOnly( randi, 'MIN', rand.MIN );\n\tsetReadOnly( randi, 'MAX', rand.MAX );\n\n\treturn randi;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {*} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {*} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {*} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\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 = randi.NAME + '-' + rand.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tout.params = [];\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number having an integer value.\n\t*\n\t* @private\n\t* @returns {integer} pseudorandom number\n\t*\n\t* @example\n\t* var v = randi();\n\t* // returns \n\t*/\n\tfunction randi() {\n\t\treturn rand();\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' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number having an integer value.\n*\n* @name randi\n* @type {PRNG}\n* @returns {integer} pseudorandom number\n*\n* @example\n* var v = randi();\n* // returns \n*/\nvar randi = factory();\n\n\n// EXPORTS //\n\nmodule.exports = randi;\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* Pseudorandom numbers having integer values.\n*\n* @module @stdlib/random/base/randi\n*\n* @example\n* var randi = require( '@stdlib/random/base/randi' );\n*\n* var v = randi();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/randi' ).factory;\n*\n* var randi = factory({\n* 'name': 'minstd',\n* 'seed': 12345\n* });\n*\n* var v = randi();\n* // returns \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", "{\n\t\"name\": \"improved-ziggurat\",\n\t\"copy\": true\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'use strict';\n\n// MODULES //\n\nvar boxMuller = require( './../../../base/box-muller' );\nvar improvedZiggurat = require( './../../../base/improved-ziggurat' );\n\n\n// MAIN //\n\nvar prngs = {};\n\nprngs[ 'box-muller' ] = boxMuller;\nprngs[ 'improved-ziggurat' ] = improvedZiggurat;\n\n\n// EXPORTS //\n\nmodule.exports = prngs;\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 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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar format = require( '@stdlib/string/format' );\nvar noop = require( '@stdlib/utils/noop' );\nvar typedarray2json = require( '@stdlib/array/to-json' );\nvar defaults = require( './defaults.json' );\nvar PRNGS = require( './prngs.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for numbers from a standard normal distribution.\n*\n* @param {Options} [options] - function options\n* @param {string} [options.name='improved-ziggurat'] - name of pseudorandom number generator\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [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} must provide an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide the name of a supported pseudorandom number generator\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var randn = factory();\n*\n* var v = randn();\n* // returns \n*\n* @example\n* var randn = factory({\n* 'name': 'box-muller'\n* });\n* var v = randn();\n* // returns \n*\n* @example\n* var randn = factory({\n* 'seed': 12345\n* });\n* var v = randn();\n* // returns \n*\n* @example\n* var randn = factory({\n* 'name': 'box-muller',\n* 'seed': 12345\n* });\n* var v = randn();\n* // returns \n*/\nfunction factory( options ) {\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\n\topts = {\n\t\t'name': defaults.name,\n\t\t'copy': defaults.copy\n\t};\n\tif ( arguments.length ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide an object. Value: `%s`.', options ) );\n\t\t}\n\t\tif ( hasOwnProp( options, 'name' ) ) {\n\t\t\topts.name = options.name;\n\t\t}\n\t\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\t\topts.prng = options.prng;\n\t\t\tif ( opts.prng === void 0 ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option cannot be undefined. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t} else if ( hasOwnProp( options, 'state' ) ) {\n\t\t\topts.state = options.state;\n\t\t\tif ( opts.state === void 0 ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option cannot be undefined. Option: `%s`.', 'state', opts.state ) );\n\t\t\t}\n\t\t} else if ( hasOwnProp( options, 'seed' ) ) {\n\t\t\topts.seed = options.seed;\n\t\t\tif ( opts.seed === void 0 ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option cannot be undefined. Option: `%s`.', 'seed', opts.seed ) );\n\t\t\t}\n\t\t}\n\t\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\t\topts.copy = options.copy;\n\t\t\tif ( !isBoolean( opts.copy ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'copy', opts.copy ) );\n\t\t\t}\n\t\t}\n\t}\n\tprng = PRNGS[ opts.name ];\n\tif ( prng === void 0 ) {\n\t\tthrow new Error( format( 'invalid option. Unrecognized/unsupported PRNG. Option: `%s`.', opts.name ) );\n\t}\n\tif ( opts.prng === void 0 ) {\n\t\tif ( opts.state === void 0 ) {\n\t\t\tif ( opts.seed === void 0 ) {\n\t\t\t\trand = prng.factory();\n\t\t\t} else {\n\t\t\t\trand = prng.factory({\n\t\t\t\t\t'seed': opts.seed\n\t\t\t\t});\n\t\t\t}\n\t\t} else {\n\t\t\trand = prng.factory({\n\t\t\t\t'state': opts.state,\n\t\t\t\t'copy': opts.copy\n\t\t\t});\n\t\t}\n\t} else {\n\t\trand = prng.factory({\n\t\t\t'prng': opts.prng\n\t\t});\n\t}\n\tsetReadOnly( normal, 'NAME', 'randn' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts.prng ) {\n\t\tsetReadOnly( normal, 'seed', null );\n\t\tsetReadOnly( normal, 'seedLength', null );\n\t\tsetReadWriteAccessor( normal, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( normal, 'stateLength', null );\n\t\tsetReadOnly( normal, 'byteLength', null );\n\t\tsetReadOnly( normal, 'toJSON', constantFunction( null ) );\n\t} else {\n\t\tsetReadOnlyAccessor( normal, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( normal, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( normal, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( normal, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( normal, 'byteLength', getStateSize );\n\t\tsetReadOnly( normal, 'toJSON', toJSON );\n\t}\n\tsetReadOnly( normal, 'PRNG', rand.PRNG );\n\treturn normal;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {*} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {*} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {*} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\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 = normal.NAME + '-' + rand.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tout.params = [];\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from a standard normal distribution.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = normal();\n\t* // returns \n\t*/\n\tfunction normal() {\n\t\treturn rand();\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' );\n\n\n// MAIN //\n\n/**\n* Returns a standard normal random number.\n*\n* @name normal\n* @type {PRNG}\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = normal();\n* // returns \n*/\nvar normal = factory();\n\n\n// EXPORTS //\n\nmodule.exports = normal;\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* Standard normal pseudorandom numbers.\n*\n* @module @stdlib/random/base/randn\n*\n* @example\n* var randn = require( '@stdlib/random/base/randn' );\n*\n* var v = randn();\n* // returns \n*\n* @example\n* var factory = require( '@stdlib/random/base/randn' ).factory;\n*\n* var randn = factory({\n* 'name': 'box-muller',\n* 'seed': 12345\n* });\n*\n* var v = randn();\n* // returns \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", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2022 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// This file is generated using `scripts/build.js`.\n\n'use strict';\n\n// MODULES //\n\nvar prng0 = require( './../../../base/arcsine' );\nvar prng1 = require( './../../../base/bernoulli' );\nvar prng2 = require( './../../../base/beta' );\nvar prng3 = require( './../../../base/betaprime' );\nvar prng4 = require( './../../../base/binomial' );\nvar prng5 = require( './../../../base/box-muller' );\nvar prng6 = require( './../../../base/cauchy' );\nvar prng7 = require( './../../../base/chi' );\nvar prng8 = require( './../../../base/chisquare' );\nvar prng9 = require( './../../../base/cosine' );\nvar prng10 = require( './../../../base/discrete-uniform' );\nvar prng11 = require( './../../../base/erlang' );\nvar prng12 = require( './../../../base/exponential' );\nvar prng13 = require( './../../../base/f' );\nvar prng14 = require( './../../../base/frechet' );\nvar prng15 = require( './../../../base/gamma' );\nvar prng16 = require( './../../../base/geometric' );\nvar prng17 = require( './../../../base/gumbel' );\nvar prng18 = require( './../../../base/hypergeometric' );\nvar prng19 = require( './../../../base/improved-ziggurat' );\nvar prng20 = require( './../../../base/invgamma' );\nvar prng21 = require( './../../../base/kumaraswamy' );\nvar prng22 = require( './../../../base/laplace' );\nvar prng23 = require( './../../../base/levy' );\nvar prng24 = require( './../../../base/logistic' );\nvar prng25 = require( './../../../base/lognormal' );\nvar prng26 = require( './../../../base/minstd' );\nvar prng27 = require( './../../../base/minstd-shuffle' );\nvar prng28 = require( './../../../base/mt19937' );\nvar prng29 = require( './../../../base/negative-binomial' );\nvar prng30 = require( './../../../base/normal' );\nvar prng31 = require( './../../../base/pareto-type1' );\nvar prng32 = require( './../../../base/poisson' );\nvar prng33 = require( './../../../base/randi' );\nvar prng34 = require( './../../../base/randn' );\nvar prng35 = require( './../../../base/randu' );\nvar prng36 = require( './../../../base/rayleigh' );\nvar prng37 = require( './../../../base/t' );\nvar prng38 = require( './../../../base/triangular' );\nvar prng39 = require( './../../../base/uniform' );\nvar prng40 = require( './../../../base/weibull' );\n\n\n// MAIN //\n\nvar prngs = {};\nprngs[ 'arcsine' ] = prng0.factory;\nprngs[ 'bernoulli' ] = prng1.factory;\nprngs[ 'beta' ] = prng2.factory;\nprngs[ 'betaprime' ] = prng3.factory;\nprngs[ 'binomial' ] = prng4.factory;\nprngs[ 'box-muller' ] = prng5.factory;\nprngs[ 'cauchy' ] = prng6.factory;\nprngs[ 'chi' ] = prng7.factory;\nprngs[ 'chisquare' ] = prng8.factory;\nprngs[ 'cosine' ] = prng9.factory;\nprngs[ 'discrete-uniform' ] = prng10.factory;\nprngs[ 'erlang' ] = prng11.factory;\nprngs[ 'exponential' ] = prng12.factory;\nprngs[ 'f' ] = prng13.factory;\nprngs[ 'frechet' ] = prng14.factory;\nprngs[ 'gamma' ] = prng15.factory;\nprngs[ 'geometric' ] = prng16.factory;\nprngs[ 'gumbel' ] = prng17.factory;\nprngs[ 'hypergeometric' ] = prng18.factory;\nprngs[ 'improved-ziggurat' ] = prng19.factory;\nprngs[ 'invgamma' ] = prng20.factory;\nprngs[ 'kumaraswamy' ] = prng21.factory;\nprngs[ 'laplace' ] = prng22.factory;\nprngs[ 'levy' ] = prng23.factory;\nprngs[ 'logistic' ] = prng24.factory;\nprngs[ 'lognormal' ] = prng25.factory;\nprngs[ 'minstd' ] = prng26.factory;\nprngs[ 'minstd-shuffle' ] = prng27.factory;\nprngs[ 'mt19937' ] = prng28.factory;\nprngs[ 'negative-binomial' ] = prng29.factory;\nprngs[ 'normal' ] = prng30.factory;\nprngs[ 'pareto-type1' ] = prng31.factory;\nprngs[ 'poisson' ] = prng32.factory;\nprngs[ 'randi' ] = prng33.factory;\nprngs[ 'randn' ] = prng34.factory;\nprngs[ 'randu' ] = prng35.factory;\nprngs[ 'rayleigh' ] = prng36.factory;\nprngs[ 't' ] = prng37.factory;\nprngs[ 'triangular' ] = prng38.factory;\nprngs[ 'uniform' ] = prng39.factory;\nprngs[ 'weibull' ] = prng40.factory;\n\n\n// EXPORTS //\n\nmodule.exports = prngs;\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 isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isArray = require( '@stdlib/assert/is-array' );\nvar contains = require( '@stdlib/assert/contains' );\nvar Int32Array = require( '@stdlib/array/int32' );\nvar Uint32Array = require( '@stdlib/array/uint32' );\nvar table = require( './prngs.js' );\n\n\n// VARIABLES //\n\nvar TYPED_ARRAY_CTORS = {\n\t'Int32Array': Int32Array,\n\t'Uint32Array': Uint32Array\n};\nvar PRNG_WRAPPERS = [ 'randi', 'randn', 'randu' ];\n\n\n// MAIN //\n\n/**\n* Revives a JSON-serialized pseudorandom number generator.\n*\n* @param {string} key - key\n* @param {*} value - value\n* @returns {(*|Function)} value or PRNG\n*\n* @example\n* var parseJSON = require( '@stdlib/utils/parse-json' );\n* var mt19937 = require( '@stdlib/random/base/mt19937' );\n*\n* var str = JSON.stringify( mt19937 );\n* var rand = parseJSON( str, reviveBasePRNG );\n* // returns \n*/\nfunction reviveBasePRNG( key, value ) {\n\tvar factory;\n\tvar opts;\n\tvar args;\n\tvar ctor;\n\tvar tmp;\n\tif (\n\t\tvalue &&\n\t\tvalue.type === 'PRNG' &&\n\t\tisString( value.name ) &&\n\t\tisObject( value.state ) &&\n\t\tisArray( value.params ) &&\n\t\tisString( value.state.type ) &&\n\t\tisArray( value.state.data )\n\t) {\n\t\topts = {};\n\t\tfactory = table[ value.name ];\n\t\tif ( factory === void 0 ) {\n\t\t\ttmp = value.name.split( '-' );\n\t\t\tif ( contains( PRNG_WRAPPERS, tmp[ 0 ] ) ) {\n\t\t\t\tfactory = table[ tmp[ 0 ] ];\n\t\t\t\topts.name = tmp.slice( 1 ).join( '-' );\n\t\t\t}\n\t\t}\n\t\tif ( factory ) {\n\t\t\tctor = TYPED_ARRAY_CTORS[ value.state.type ];\n\t\t\tif ( ctor ) {\n\t\t\t\topts.state = new ctor( value.state.data );\n\n\t\t\t\targs = value.params.slice();\n\t\t\t\targs.push( opts );\n\n\t\t\t\ttry {\n\t\t\t\t\treturn factory.apply( null, args );\n\t\t\t\t} catch ( error ) { // eslint-disable-line no-unused-vars\n\t\t\t\t\t// Return the original JSON value...\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn value;\n}\n\n\n// EXPORTS //\n\nmodule.exports = reviveBasePRNG;\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* Revive a JSON-serialized pseudorandom generator.\n*\n* @module @stdlib/random/base/reviver\n*\n* @example\n* var parseJSON = require( '@stdlib/utils/parse-json' );\n* var mt19937 = require( '@stdlib/random/base/mt19937' );\n* var reviveBasePRNG = require( '@stdlib/random/base/reviver' );\n*\n* var str = JSON.stringify( mt19937 );\n* var rand = parseJSON( str, reviveBasePRNG );\n* // returns \n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-read-only-property' );\n\n\n// MAIN //\n\n/**\n* Top-level namespace.\n*\n* @namespace random\n*/\nvar random = {};\n\n/**\n* @name arcsine\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/arcsine}\n*/\nsetReadOnly( random, 'arcsine', require( './../../base/arcsine' ) );\n\n/**\n* @name bernoulli\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/bernoulli}\n*/\nsetReadOnly( random, 'bernoulli', require( './../../base/bernoulli' ) );\n\n/**\n* @name beta\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/beta}\n*/\nsetReadOnly( random, 'beta', require( './../../base/beta' ) );\n\n/**\n* @name betaprime\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/betaprime}\n*/\nsetReadOnly( random, 'betaprime', require( './../../base/betaprime' ) );\n\n/**\n* @name binomial\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/binomial}\n*/\nsetReadOnly( random, 'binomial', require( './../../base/binomial' ) );\n\n/**\n* @name boxMuller\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/box-muller}\n*/\nsetReadOnly( random, 'boxMuller', require( './../../base/box-muller' ) );\n\n/**\n* @name cauchy\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/cauchy}\n*/\nsetReadOnly( random, 'cauchy', require( './../../base/cauchy' ) );\n\n/**\n* @name chi\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/chi}\n*/\nsetReadOnly( random, 'chi', require( './../../base/chi' ) );\n\n/**\n* @name chisquare\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/chisquare}\n*/\nsetReadOnly( random, 'chisquare', require( './../../base/chisquare' ) );\n\n/**\n* @name cosine\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/cosine}\n*/\nsetReadOnly( random, 'cosine', require( './../../base/cosine' ) );\n\n/**\n* @name discreteUniform\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/discrete-uniform}\n*/\nsetReadOnly( random, 'discreteUniform', require( './../../base/discrete-uniform' ) );\n\n/**\n* @name erlang\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/erlang}\n*/\nsetReadOnly( random, 'erlang', require( './../../base/erlang' ) );\n\n/**\n* @name exponential\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/exponential}\n*/\nsetReadOnly( random, 'exponential', require( './../../base/exponential' ) );\n\n/**\n* @name f\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/f}\n*/\nsetReadOnly( random, 'f', require( './../../base/f' ) );\n\n/**\n* @name frechet\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/frechet}\n*/\nsetReadOnly( random, 'frechet', require( './../../base/frechet' ) );\n\n/**\n* @name gamma\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/gamma}\n*/\nsetReadOnly( random, 'gamma', require( './../../base/gamma' ) );\n\n/**\n* @name geometric\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/geometric}\n*/\nsetReadOnly( random, 'geometric', require( './../../base/geometric' ) );\n\n/**\n* @name gumbel\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/gumbel}\n*/\nsetReadOnly( random, 'gumbel', require( './../../base/gumbel' ) );\n\n/**\n* @name hypergeometric\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/hypergeometric}\n*/\n\nsetReadOnly( random, 'hypergeometric', require( './../../base/hypergeometric' ) );\n\n/**\n* @name improvedZiggurat\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/improved-ziggurat}\n*/\nsetReadOnly( random, 'improvedZiggurat', require( './../../base/improved-ziggurat' ) );\n\n/**\n* @name invgamma\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/invgamma}\n*/\nsetReadOnly( random, 'invgamma', require( './../../base/invgamma' ) );\n\n/**\n* @name kumaraswamy\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/kumaraswamy}\n*/\nsetReadOnly( random, 'kumaraswamy', require( './../../base/kumaraswamy' ) );\n\n/**\n* @name laplace\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/laplace}\n*/\nsetReadOnly( random, 'laplace', require( './../../base/laplace' ) );\n\n/**\n* @name levy\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/levy}\n*/\nsetReadOnly( random, 'levy', require( './../../base/levy' ) );\n\n/**\n* @name logistic\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/logistic}\n*/\nsetReadOnly( random, 'logistic', require( './../../base/logistic' ) );\n\n/**\n* @name lognormal\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/lognormal}\n*/\nsetReadOnly( random, 'lognormal', require( './../../base/lognormal' ) );\n\n/**\n* @name minstd\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/minstd}\n*/\nsetReadOnly( random, 'minstd', require( './../../base/minstd' ) );\n\n/**\n* @name minstdShuffle\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/minstd-shuffle}\n*/\nsetReadOnly( random, 'minstdShuffle', require( './../../base/minstd-shuffle' ) );\n\n/**\n* @name mt19937\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/mt19937}\n*/\nsetReadOnly( random, 'mt19937', require( './../../base/mt19937' ) );\n\n/**\n* @name negativeBinomial\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/negative-binomial}\n*/\nsetReadOnly( random, 'negativeBinomial', require( './../../base/negative-binomial' ) );\n\n/**\n* @name normal\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/normal}\n*/\nsetReadOnly( random, 'normal', require( './../../base/normal' ) );\n\n/**\n* @name pareto1\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/pareto-type1}\n*/\nsetReadOnly( random, 'pareto1', require( './../../base/pareto-type1' ) );\n\n/**\n* @name poisson\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/poisson}\n*/\nsetReadOnly( random, 'poisson', require( './../../base/poisson' ) );\n\n/**\n* @name randi\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/randi}\n*/\nsetReadOnly( random, 'randi', require( './../../base/randi' ) );\n\n/**\n* @name randn\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/randn}\n*/\nsetReadOnly( random, 'randn', require( './../../base/randn' ) );\n\n/**\n* @name randu\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/randu}\n*/\nsetReadOnly( random, 'randu', require( './../../base/randu' ) );\n\n/**\n* @name rayleigh\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/rayleigh}\n*/\nsetReadOnly( random, 'rayleigh', require( './../../base/rayleigh' ) );\n\n/**\n* @name reviveBasePRNG\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/reviver}\n*/\nsetReadOnly( random, 'reviveBasePRNG', require( './../../base/reviver' ) );\n\n/**\n* @name t\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/t}\n*/\nsetReadOnly( random, 't', require( './../../base/t' ) );\n\n/**\n* @name triangular\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/triangular}\n*/\nsetReadOnly( random, 'triangular', require( './../../base/triangular' ) );\n\n/**\n* @name uniform\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/uniform}\n*/\nsetReadOnly( random, 'uniform', require( './../../base/uniform' ) );\n\n/**\n* @name weibull\n* @memberof random\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/base/weibull}\n*/\nsetReadOnly( random, 'weibull', require( './../../base/weibull' ) );\n\n\n// EXPORTS //\n\nmodule.exports = random;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rarcsine = require( './../../../base/arcsine' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from an arcsine distribution.\n*\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {RangeError} `a` must be less than `b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( a, b, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isNumber( a ) || isnan( a ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', a ) );\n\t}\n\tif ( !isNumber( b ) || isnan( b ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a number and not NaN. Value: `%s`.', b ) );\n\t}\n\tif ( a >= b ) {\n\t\tthrow new RangeError( format( 'invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.', a, b ) );\n\t}\n\tif ( arguments.length > 2 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rarcsine( a, b, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rarcsine( a, b );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( a, b, opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from an arcsine distribution.\n*\n* @module @stdlib/random/iter/arcsine\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/arcsine' );\n*\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isProbability = require( '@stdlib/assert/is-probability' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rbern = require( './../../../base/bernoulli' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a Bernoulli distribution.\n*\n* @param {Probability} p - success probability\n* @param {Options} [options] - function options\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} first argument must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 0.3 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( p, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isProbability( p ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a probability. Value: `%s`.', p ) );\n\t}\n\tif ( arguments.length > 1 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rbern( p, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rbern( p );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( p, opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from a Bernoulli distribution.\n*\n* @module @stdlib/random/iter/bernoulli\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/bernoulli' );\n*\n* var iter = iterator( 0.3 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rbeta = require( './../../../base/beta' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a beta distribution.\n*\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( alpha, beta, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositiveNumber( alpha ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositiveNumber( beta ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\tif ( arguments.length > 2 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rbeta( alpha, beta, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rbeta( alpha, beta );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( alpha, beta, opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from a beta distribution.\n*\n* @module @stdlib/random/iter/beta\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/beta' );\n*\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rbetaprime = require( './../../../base/betaprime' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a beta prime distribution.\n*\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( alpha, beta, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositiveNumber( alpha ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositiveNumber( beta ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\tif ( arguments.length > 2 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rbetaprime( alpha, beta, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rbetaprime( alpha, beta );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( alpha, beta, opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from a beta prime distribution.\n*\n* @module @stdlib/random/iter/betaprime\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/betaprime' );\n*\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isProbability = require( '@stdlib/assert/is-probability' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rbinom = require( './../../../base/binomial' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a binomial distribution.\n*\n* @param {PositiveInteger} n - number of trials\n* @param {Probability} p - success probability\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} first argument must be a positive integer\n* @throws {TypeError} second argument must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 8, 0.3 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( n, p, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositiveInteger( n ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive integer. Value: `%s`.', n ) );\n\t}\n\tif ( !isProbability( p ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a probability. Value: `%s`.', p ) );\n\t}\n\tif ( arguments.length > 2 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rbinom( n, p, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rbinom( n, p );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( n, p, opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from a binomial distribution.\n*\n* @module @stdlib/random/iter/binomial\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/binomial' );\n*\n* var iter = iterator( 10, 0.3 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rnorm = require( './../../../base/box-muller' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a standard normal distribution using the Box-Muller transform.\n*\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\n\tif ( arguments.length > 0 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rnorm( opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rnorm();\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from a standard normal distribution using the Box-Muller transform.\n*\n* @module @stdlib/random/iter/box-muller\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/box-muller' );\n*\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rcauchy = require( './../../../base/cauchy' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a Cauchy distribution.\n*\n* @param {number} x0 - location parameter\n* @param {PositiveNumber} gamma - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `x0` must be a number\n* @throws {TypeError} `gamma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( x0, gamma, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isNumber( x0 ) || isnan( x0 ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', x0 ) );\n\t}\n\tif ( !isPositive( gamma ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', gamma ) );\n\t}\n\tif ( arguments.length > 2 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rcauchy( x0, gamma, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rcauchy( x0, gamma );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( x0, gamma, opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from a Cauchy distribution.\n*\n* @module @stdlib/random/iter/cauchy\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/cauchy' );\n*\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rchi = require( './../../../base/chi' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a chi distribution.\n*\n* @param {PositiveNumber} k - degrees of freedom\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} first argument must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( k, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositive( k ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', k ) );\n\t}\n\tif ( arguments.length > 1 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rchi( k, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rchi( k );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( k, opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from a chi distribution.\n*\n* @module @stdlib/random/iter/chi\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/chi' );\n*\n* var iter = iterator( 1.5 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rchisq = require( './../../../base/chisquare' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a chi-square distribution.\n*\n* @param {PositiveNumber} k - degrees of freedom\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} first argument must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( k, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositive( k ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', k ) );\n\t}\n\tif ( arguments.length > 1 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rchisq( k, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rchisq( k );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( k, opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from a chi-square distribution.\n*\n* @module @stdlib/random/iter/chisquare\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/chisquare' );\n*\n* var iter = iterator( 1.5 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rcosine = require( './../../../base/cosine' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a raised cosine distribution.\n*\n* @param {number} mu - location parameter\n* @param {PositiveNumber} s - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( mu, s, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( s ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', s ) );\n\t}\n\tif ( arguments.length > 2 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rcosine( mu, s, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rcosine( mu, s );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( mu, s, opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from a raised cosine distribution.\n*\n* @module @stdlib/random/iter/cosine\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/cosine' );\n*\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isInteger = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar runif = require( './../../../base/discrete-uniform' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a discrete uniform distribution.\n*\n* @param {integer} a - minimum support\n* @param {integer} b - maximum support\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `a` must be an integer\n* @throws {TypeError} `b` must be an integer\n* @throws {RangeError} `a` must be less than or equal to `b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2, 6 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( a, b, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isInteger( a ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', a ) );\n\t}\n\tif ( !isInteger( b ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', b ) );\n\t}\n\tif ( a > b ) {\n\t\tthrow new RangeError( format( 'invalid argument. Minimum support must be less than or equal to maximum support. Value: `[%d,%d]`.', a, b ) );\n\t}\n\tif ( arguments.length > 2 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = runif( a, b, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = runif( a, b );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( a, b, opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from a discrete uniform distribution.\n*\n* @module @stdlib/random/iter/discrete-uniform\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/discrete-uniform' );\n*\n* var iter = iterator( -1, 2 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rerlang = require( './../../../base/erlang' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from an Erlang distribution.\n*\n* @param {PositiveInteger} k - shape parameter\n* @param {PositiveNumber} lambda - rate parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `k` must be a positive integer\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( k, lambda, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositiveInteger( k ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive integer. Value: `%s`.', k ) );\n\t}\n\tif ( !isPositiveNumber( lambda ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', lambda ) );\n\t}\n\tif ( arguments.length > 2 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rerlang( k, lambda, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rerlang( k, lambda );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( k, lambda, opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from an Erlang distribution.\n*\n* @module @stdlib/random/iter/erlang\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/erlang' );\n*\n* var iter = iterator( 2, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rexp = require( './../../../base/exponential' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from an exponential distribution.\n*\n* @param {PositiveNumber} lambda - rate parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} first argument must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( lambda, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositive( lambda ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', lambda ) );\n\t}\n\tif ( arguments.length > 1 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rexp( lambda, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rexp( lambda );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( lambda, opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from an exponential distribution.\n*\n* @module @stdlib/random/iter/exponential\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/exponential' );\n*\n* var iter = iterator( 1.5 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rf = require( './../../../base/f' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from an F distribution.\n*\n* @param {PositiveNumber} d1 - degrees of freedom\n* @param {PositiveNumber} d2 - degrees of freedom\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `d1` must be a positive number\n* @throws {TypeError} `d2` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( d1, d2, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositiveNumber( d1 ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', d1 ) );\n\t}\n\tif ( !isPositiveNumber( d2 ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', d2 ) );\n\t}\n\tif ( arguments.length > 2 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rf( d1, d2, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rf( d1, d2 );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( d1, d2, opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from an F distribution.\n*\n* @module @stdlib/random/iter/f\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/f' );\n*\n* var iter = iterator( 2.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rfrechet = require( './../../../base/frechet' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a Fr\u00E9chet distribution.\n*\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} s - rate parameter\n* @param {number} m - location parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} `m` must be a number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0, 5.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( alpha, s, m, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositiveNumber( alpha ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositiveNumber( s ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', s ) );\n\t}\n\tif ( !isNumber( m ) || isnan( m ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a number. Value: `%s`.', m ) );\n\t}\n\tif ( arguments.length > 3 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rfrechet( alpha, s, m, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rfrechet( alpha, s, m );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( alpha, s, m, opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from a Fr\u00E9chet distribution.\n*\n* @module @stdlib/random/iter/frechet\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/frechet' );\n*\n* var iter = iterator( 2.0, 5.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rgamma = require( './../../../base/gamma' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a gamma distribution.\n*\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - rate parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( alpha, beta, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositiveNumber( alpha ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositiveNumber( beta ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\tif ( arguments.length > 2 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rgamma( alpha, beta, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rgamma( alpha, beta );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( alpha, beta, opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from a gamma distribution.\n*\n* @module @stdlib/random/iter/gamma\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/gamma' );\n*\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isProbability = require( '@stdlib/assert/is-probability' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rgeom = require( './../../../base/geometric' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a geometric distribution.\n*\n* @param {Probability} p - success probability\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} first argument must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 0.3 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( p, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isProbability( p ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a probability. Value: `%s`.', p ) );\n\t}\n\tif ( arguments.length > 1 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rgeom( p, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rgeom( p );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( p, opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from a geometric distribution.\n*\n* @module @stdlib/random/iter/geometric\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/geometric' );\n*\n* var iter = iterator( 0.3 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rgumbel = require( './../../../base/gumbel' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a Gumbel distribution.\n*\n* @param {number} mu - mean\n* @param {PositiveNumber} beta - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} first argument must be a number\n* @throws {TypeError} second argument must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( mu, beta, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( beta ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\tif ( arguments.length > 2 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rgumbel( mu, beta, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rgumbel( mu, beta );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( mu, beta, opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from a Gumbel distribution.\n*\n* @module @stdlib/random/iter/gumbel\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/gumbel' );\n*\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rhypergeom = require( './../../../base/hypergeometric' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a hypergeometric distribution.\n*\n* @param {NonNegativeInteger} N - population size\n* @param {NonNegativeInteger} K - subpopulation size\n* @param {NonNegativeInteger} n - number of draws\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} second argument must be a nonnegative integer\n* @throws {TypeError} third argument must be a nonnegative integer\n* @throws {RangeError} number of draws must be less than or equal to the population size\n* @throws {RangeError} subpopulation size must be less than or equal to the population size\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 10, 5, 3 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( N, K, n, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isNonNegativeInteger( N ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', N ) );\n\t}\n\tif ( !isNonNegativeInteger( K ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a nonnegative integer. Value: `%s`.', K ) );\n\t}\n\tif ( !isNonNegativeInteger( n ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a nonnegative integer. Value: `%s`.', n ) );\n\t}\n\tif ( n > N ) {\n\t\tthrow new RangeError( format( 'invalid argument. Number of draws must be less than or equal to the population size. Value: `%u`.', n ) );\n\t}\n\tif ( K > N ) {\n\t\tthrow new RangeError( format( 'invalid argument. Subpopulation size must be less than or equal to the population size. Value: `%u`.', K ) );\n\t}\n\tif ( arguments.length > 3 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rhypergeom( N, K, n, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rhypergeom( N, K, n );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( N, K, n, opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from a hypergeometric distribution.\n*\n* @module @stdlib/random/iter/hypergeometric\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/hypergeometric' );\n*\n* var iter = iterator( 10, 5, 6 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rnorm = require( './../../../base/improved-ziggurat' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a standard normal distribution using the Improved Ziggurat algorithm.\n*\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( arguments.length > 0 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rnorm( opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rnorm();\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from a standard normal distribution using the Improved Ziggurat algorithm.\n*\n* @module @stdlib/random/iter/improved-ziggurat\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/improved-ziggurat' );\n*\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rinvgamma = require( './../../../base/invgamma' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from an inverse gamma distribution.\n*\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0, 2.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( alpha, beta, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositiveNumber( alpha ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositiveNumber( beta ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\tif ( arguments.length > 2 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rinvgamma( alpha, beta, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rinvgamma( alpha, beta );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( alpha, beta, opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from an inverse gamma distribution.\n*\n* @module @stdlib/random/iter/invgamma\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/invgamma' );\n*\n* var iter = iterator( 2.0, 2.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rkumaraswamy = require( './../../../base/kumaraswamy' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a Kumaraswamy's double bounded distribution.\n*\n* @param {PositiveNumber} a - first shape parameter\n* @param {PositiveNumber} b - second shape parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `a` must be a positive number\n* @throws {TypeError} `b` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( a, b, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositiveNumber( a ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', a ) );\n\t}\n\tif ( !isPositiveNumber( b ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', b ) );\n\t}\n\tif ( arguments.length > 2 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rkumaraswamy( a, b, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rkumaraswamy( a, b );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( a, b, opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from a Kumaraswamy's double bounded distribution.\n*\n* @module @stdlib/random/iter/kumaraswamy\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/kumaraswamy' );\n*\n* var iter = iterator( 2.0, 1.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rlaplace = require( './../../../base/laplace' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a Laplace (double exponential) distribution.\n*\n* @param {number} mu - mean\n* @param {PositiveNumber} b - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `b` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( mu, b, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( b ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', b ) );\n\t}\n\tif ( arguments.length > 2 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rlaplace( mu, b, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rlaplace( mu, b );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( mu, b, opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from a Laplace (double exponential) distribution.\n*\n* @module @stdlib/random/iter/laplace\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/laplace' );\n*\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rlevy = require( './../../../base/levy' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a L\u00E9vy distribution.\n*\n* @param {number} mu - mean\n* @param {PositiveNumber} c - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `c` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( mu, c, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( c ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', c ) );\n\t}\n\tif ( arguments.length > 2 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rlevy( mu, c, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rlevy( mu, c );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( mu, c, opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from a L\u00E9vy distribution.\n*\n* @module @stdlib/random/iter/levy\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/levy' );\n*\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rlogis = require( './../../../base/logistic' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a logistic distribution.\n*\n* @param {number} mu - mean\n* @param {PositiveNumber} s - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( mu, s, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( s ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', s ) );\n\t}\n\tif ( arguments.length > 2 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rlogis( mu, s, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rlogis( mu, s );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( mu, s, opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from a logistic distribution.\n*\n* @module @stdlib/random/iter/logistic\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/logistic' );\n*\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rlognorm = require( './../../../base/lognormal' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a lognormal distribution.\n*\n* @param {number} mu - location parameter\n* @param {PositiveNumber} sigma - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `sigma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( mu, sigma, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( sigma ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', sigma ) );\n\t}\n\tif ( arguments.length > 2 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rlognorm( mu, sigma, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rlognorm( mu, sigma );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( mu, sigma, opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from a lognormal distribution.\n*\n* @module @stdlib/random/iter/lognormal\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/lognormal' );\n*\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 assign = require( '@stdlib/object/assign' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar minstd = require( './../../../base/minstd' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers via a linear congruential pseudorandom number generator (LCG) based on Park and Miller.\n*\n* @param {Options} [options] - function options\n* @param {boolean} [options.normalized=false] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( arguments.length > 0 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'normalized' ) ) {\n\t\t\tif ( !isBoolean( opts.normalized ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'normalized', opts.normalized ) );\n\t\t\t}\n\t\t}\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = minstd( opts );\n\t\tif ( opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = minstd();\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\tif ( opts.normalized ) {\n\t\trand = rand.normalized;\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMINSTD} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMINSTD} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMINSTD} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for a linear congruential pseudorandom number generator (LCG) based on Park and Miller.\n*\n* @module @stdlib/random/iter/minstd\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/minstd' );\n*\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 assign = require( '@stdlib/object/assign' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar minstd = require( './../../../base/minstd-shuffle' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers via a linear congruential pseudorandom number generator (LCG) whose output is shuffled.\n*\n* @param {Options} [options] - function options\n* @param {boolean} [options.normalized=false] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( arguments.length > 0 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'normalized' ) ) {\n\t\t\tif ( !isBoolean( opts.normalized ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'normalized', opts.normalized ) );\n\t\t\t}\n\t\t}\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = minstd( opts );\n\t\tif ( opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = minstd();\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\tif ( opts.normalized ) {\n\t\trand = rand.normalized;\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMINSTD} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMINSTD} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMINSTD} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for a linear congruential pseudorandom number generator (LCG) whose output is shuffled.\n*\n* @module @stdlib/random/iter/minstd-shuffle\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/minstd-shuffle' );\n*\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 assign = require( '@stdlib/object/assign' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar mt19937 = require( './../../../base/mt19937' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers via a 32-bit Mersenne Twister pseudorandom number generator.\n*\n* @param {Options} [options] - function options\n* @param {boolean} [options.normalized=false] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( arguments.length > 0 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'normalized' ) ) {\n\t\t\tif ( !isBoolean( opts.normalized ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'normalized', opts.normalized ) );\n\t\t\t}\n\t\t}\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = mt19937( opts );\n\t\tif ( opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = mt19937();\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\tif ( opts.normalized ) {\n\t\trand = rand.normalized;\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( opts );\n\t}\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\treturn rand.seed;\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 rand.seedLength;\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 rand.stateLength;\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 rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for a 32-bit Mersenne Twister pseudorandom number generator.\n*\n* @module @stdlib/random/iter/mt19937\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/mt19937' );\n*\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isProbability = require( '@stdlib/assert/is-probability' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rnbinom = require( './../../../base/negative-binomial' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a negative binomial distribution.\n*\n* @param {PositiveNumber} r - number of successes until experiment is stopped\n* @param {Probability} p - success probability\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} first argument must be a positive number\n* @throws {TypeError} second argument must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 8, 0.3 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( r, p, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositiveNumber( r ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive integer. Value: `%s`.', r ) );\n\t}\n\tif ( !isProbability( p ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a probability. Value: `%s`.', p ) );\n\t}\n\tif ( arguments.length > 2 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rnbinom( r, p, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rnbinom( r, p );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( r, p, opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from a negative binomial distribution.\n*\n* @module @stdlib/random/iter/negative-binomial\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/negative-binomial' );\n*\n* var iter = iterator( 10, 0.3 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rnorm = require( './../../../base/normal' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a normal distribution.\n*\n* @param {number} mu - mean\n* @param {PositiveNumber} sigma - standard deviation\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `sigma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( mu, sigma, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositive( sigma ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', sigma ) );\n\t}\n\tif ( arguments.length > 2 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rnorm( mu, sigma, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rnorm( mu, sigma );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( mu, sigma, opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from a normal distribution.\n*\n* @module @stdlib/random/iter/normal\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/normal' );\n*\n* var iter = iterator( -1.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rpareto = require( './../../../base/pareto-type1' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a Pareto (Type I) distribution.\n*\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( alpha, beta, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositiveNumber( alpha ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositiveNumber( beta ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\tif ( arguments.length > 2 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rpareto( alpha, beta, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rpareto( alpha, beta );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( alpha, beta, opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from a Pareto (Type I) distribution.\n*\n* @module @stdlib/random/iter/pareto-type1\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/pareto-type1' );\n*\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rpois = require( './../../../base/poisson' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a Poisson distribution.\n*\n* @param {PositiveNumber} lambda - mean\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} first argument must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( lambda, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositive( lambda ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', lambda ) );\n\t}\n\tif ( arguments.length > 1 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rpois( lambda, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rpois( lambda );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( lambda, opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from a Poisson distribution.\n*\n* @module @stdlib/random/iter/poisson\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/poisson' );\n*\n* var iter = iterator( 1.5 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 assign = require( '@stdlib/object/assign' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar randi = require( './../../../base/randi' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers having integer values.\n*\n* @param {Options} [options] - function options\n* @param {string} [options.name='mt19937'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( arguments.length > 0 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = randi( opts );\n\t\tif ( opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = randi();\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {*} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {*} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {*} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers having integer values.\n*\n* @module @stdlib/random/iter/randi\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/randi' );\n*\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar randn = require( './../../../base/randn' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a standard normal distribution.\n*\n* @param {Options} [options] - function options\n* @param {string} [options.name='improved-ziggurat'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( arguments.length > 0 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = randn( opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = randn();\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from a standard normal distribution.\n*\n* @module @stdlib/random/iter/randn\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/randn' );\n*\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 assign = require( '@stdlib/object/assign' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar randu = require( './../../../base/randu' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating uniformly distributed pseudorandom numbers between 0 and 1.\n*\n* @param {Options} [options] - function options\n* @param {string} [options.name='mt19937'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( arguments.length > 0 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = randu( opts );\n\t\tif ( opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = randu();\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( opts );\n\t}\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {*} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {*} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {*} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating uniformly distributed pseudorandom numbers between 0 and 1.\n*\n* @module @stdlib/random/iter/randu\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/randu' );\n*\n* var iter = iterator();\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rrayleigh = require( './../../../base/rayleigh' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a Rayleigh distribution.\n*\n* @param {PositiveNumber} sigma - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} first argument must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( sigma, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositive( sigma ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', sigma ) );\n\t}\n\tif ( arguments.length > 1 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rrayleigh( sigma, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rrayleigh( sigma );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( sigma, opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from a Rayleigh distribution.\n*\n* @module @stdlib/random/iter/rayleigh\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/rayleigh' );\n*\n* var iter = iterator( 1.5 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rt = require( './../../../base/t' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a Student's t distribution.\n*\n* @param {PositiveNumber} v - degrees of freedom\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} first argument must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( v, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositive( v ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', v ) );\n\t}\n\tif ( arguments.length > 1 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rt( v, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rt( v );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( v, opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from a Student's t distribution.\n*\n* @module @stdlib/random/iter/t\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/t' );\n*\n* var iter = iterator( 1.5 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rtriangular = require( './../../../base/triangular' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a triangular distribution.\n*\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {number} c - mode\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {RangeError} arguments must satisfy `a <= c <= b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0, 5.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( a, b, c, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isNumber( a ) || isnan( a ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', a ) );\n\t}\n\tif ( !isNumber( b ) || isnan( b ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a number and not NaN. Value: `%s`.', b ) );\n\t}\n\tif ( !isNumber( c ) || isnan( c ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a number and not NaN. Value: `%s`.', c ) );\n\t}\n\tif ( !(a <= c && c <= b) ) {\n\t\tthrow new RangeError( format( 'invalid arguments. Parameters must satisfy the following condition: %s. a: `%f`. b: `%f`. c: `%f`.', 'a <= c <= b', a, b, c ) );\n\t}\n\tif ( arguments.length > 3 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rtriangular( a, b, c, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rtriangular( a, b, c );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( a, b, c, opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from a triangular distribution.\n*\n* @module @stdlib/random/iter/triangular\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/triangular' );\n*\n* var iter = iterator( 2.0, 5.0, 3.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar runif = require( './../../../base/uniform' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a continuous uniform distribution.\n*\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {RangeError} `a` must be less than `b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( a, b, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isNumber( a ) || isnan( a ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', a ) );\n\t}\n\tif ( !isNumber( b ) || isnan( b ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a number and not NaN. Value: `%s`.', b ) );\n\t}\n\tif ( a >= b ) {\n\t\tthrow new RangeError( format( 'invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.', a, b ) );\n\t}\n\tif ( arguments.length > 2 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = runif( a, b, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = runif( a, b );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( a, b, opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from a continuous uniform distribution.\n*\n* @module @stdlib/random/iter/uniform\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/uniform' );\n*\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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 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 constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar assign = require( '@stdlib/object/assign' );\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar MAX_VALUE = require( '@stdlib/constants/float64/max' );\nvar rweibull = require( './../../../base/weibull' ).factory;\nvar iteratorSymbol = require( '@stdlib/symbol/iterator' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator for generating pseudorandom numbers drawn from a Weibull distribution.\n*\n* @param {PositiveNumber} k - scale parameter\n* @param {PositiveNumber} lambda - shape parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @throws {TypeError} `k` must be a positive number\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterator( k, lambda, options ) {\n\tvar opts;\n\tvar iter;\n\tvar rand;\n\tvar FLG;\n\tvar i;\n\tif ( !isPositiveNumber( k ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', k ) );\n\t}\n\tif ( !isPositiveNumber( lambda ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', lambda ) );\n\t}\n\tif ( arguments.length > 2 ) {\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\topts = assign( {}, options );\n\t\tif ( hasOwnProp( opts, 'iter' ) ) {\n\t\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t\t}\n\t\t} else {\n\t\t\topts.iter = MAX_VALUE;\n\t\t}\n\t\trand = rweibull( k, lambda, opts );\n\t\tif ( opts.prng === void 0 && opts.copy !== false ) {\n\t\t\topts.state = rand.state; // cache a copy of the PRNG state\n\t\t}\n\t} else {\n\t\trand = rweibull( k, lambda );\n\t\topts = {\n\t\t\t'iter': MAX_VALUE,\n\t\t\t'state': rand.state // cache a copy of the PRNG state\n\t\t};\n\t}\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\n\tsetReadOnly( iter, 'return', end );\n\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( iter, 'seed', null );\n\t\tsetReadOnly( iter, 'seedLength', null );\n\t\tsetReadWriteAccessor( iter, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( iter, 'stateLength', null );\n\t\tsetReadOnly( iter, 'byteLength', null );\n\t} else {\n\t\tsetReadOnlyAccessor( iter, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( iter, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( iter, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( iter, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( iter, 'byteLength', getStateSize );\n\t}\n\tsetReadOnly( iter, 'PRNG', rand.PRNG );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': rand(),\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\treturn iterator( k, lambda, opts );\n\t}\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\treturn rand.PRNG.seed;\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 rand.PRNG.seedLength;\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 rand.PRNG.stateLength;\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 rand.PRNG.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.PRNG.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.PRNG.state = s;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator;\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* Create an iterator for generating pseudorandom numbers drawn from a Weibull distribution.\n*\n* @module @stdlib/random/iter/weibull\n*\n* @example\n* var iterator = require( '@stdlib/random/iter/weibull' );\n*\n* var iter = iterator( 2.0, 5.0 );\n*\n* var r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* r = iter.next().value;\n* // returns \n*\n* // ...\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-read-only-property' );\n\n\n// MAIN //\n\n/**\n* Top-level namespace.\n*\n* @namespace ns\n*/\nvar ns = {};\n\n/**\n* @name arcsine\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/arcsine}\n*/\nsetReadOnly( ns, 'arcsine', require( './../../iter/arcsine' ) );\n\n/**\n* @name bernoulli\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/bernoulli}\n*/\nsetReadOnly( ns, 'bernoulli', require( './../../iter/bernoulli' ) );\n\n/**\n* @name beta\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/beta}\n*/\nsetReadOnly( ns, 'beta', require( './../../iter/beta' ) );\n\n/**\n* @name betaprime\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/betaprime}\n*/\nsetReadOnly( ns, 'betaprime', require( './../../iter/betaprime' ) );\n\n/**\n* @name binomial\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/binomial}\n*/\nsetReadOnly( ns, 'binomial', require( './../../iter/binomial' ) );\n\n/**\n* @name boxMuller\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/box-muller}\n*/\nsetReadOnly( ns, 'boxMuller', require( './../../iter/box-muller' ) );\n\n/**\n* @name cauchy\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/cauchy}\n*/\nsetReadOnly( ns, 'cauchy', require( './../../iter/cauchy' ) );\n\n/**\n* @name chi\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/chi}\n*/\nsetReadOnly( ns, 'chi', require( './../../iter/chi' ) );\n\n/**\n* @name chisquare\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/chisquare}\n*/\nsetReadOnly( ns, 'chisquare', require( './../../iter/chisquare' ) );\n\n/**\n* @name cosine\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/cosine}\n*/\nsetReadOnly( ns, 'cosine', require( './../../iter/cosine' ) );\n\n/**\n* @name discreteUniform\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/discrete-uniform}\n*/\nsetReadOnly( ns, 'discreteUniform', require( './../../iter/discrete-uniform' ) );\n\n/**\n* @name erlang\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/erlang}\n*/\nsetReadOnly( ns, 'erlang', require( './../../iter/erlang' ) );\n\n/**\n* @name exponential\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/exponential}\n*/\nsetReadOnly( ns, 'exponential', require( './../../iter/exponential' ) );\n\n/**\n* @name f\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/f}\n*/\nsetReadOnly( ns, 'f', require( './../../iter/f' ) );\n\n/**\n* @name frechet\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/frechet}\n*/\nsetReadOnly( ns, 'frechet', require( './../../iter/frechet' ) );\n\n/**\n* @name gamma\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/gamma}\n*/\nsetReadOnly( ns, 'gamma', require( './../../iter/gamma' ) );\n\n/**\n* @name geometric\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/geometric}\n*/\nsetReadOnly( ns, 'geometric', require( './../../iter/geometric' ) );\n\n/**\n* @name gumbel\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/gumbel}\n*/\nsetReadOnly( ns, 'gumbel', require( './../../iter/gumbel' ) );\n\n/**\n* @name hypergeometric\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/hypergeometric}\n*/\nsetReadOnly( ns, 'hypergeometric', require( './../../iter/hypergeometric' ) );\n\n/**\n* @name improvedZiggurat\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/improved-ziggurat}\n*/\nsetReadOnly( ns, 'improvedZiggurat', require( './../../iter/improved-ziggurat' ) );\n\n/**\n* @name invgamma\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/invgamma}\n*/\nsetReadOnly( ns, 'invgamma', require( './../../iter/invgamma' ) );\n\n/**\n* @name kumaraswamy\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/kumaraswamy}\n*/\nsetReadOnly( ns, 'kumaraswamy', require( './../../iter/kumaraswamy' ) );\n\n/**\n* @name laplace\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/laplace}\n*/\nsetReadOnly( ns, 'laplace', require( './../../iter/laplace' ) );\n\n/**\n* @name levy\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/levy}\n*/\nsetReadOnly( ns, 'levy', require( './../../iter/levy' ) );\n\n/**\n* @name logistic\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/logistic}\n*/\nsetReadOnly( ns, 'logistic', require( './../../iter/logistic' ) );\n\n/**\n* @name lognormal\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/lognormal}\n*/\nsetReadOnly( ns, 'lognormal', require( './../../iter/lognormal' ) );\n\n/**\n* @name minstd\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/minstd}\n*/\nsetReadOnly( ns, 'minstd', require( './../../iter/minstd' ) );\n\n/**\n* @name minstdShuffle\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/minstd-shuffle}\n*/\nsetReadOnly( ns, 'minstdShuffle', require( './../../iter/minstd-shuffle' ) );\n\n/**\n* @name mt19937\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/mt19937}\n*/\nsetReadOnly( ns, 'mt19937', require( './../../iter/mt19937' ) );\n\n/**\n* @name negativeBinomial\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/negative-binomial}\n*/\nsetReadOnly( ns, 'negativeBinomial', require( './../../iter/negative-binomial' ) );\n\n/**\n* @name normal\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/normal}\n*/\nsetReadOnly( ns, 'normal', require( './../../iter/normal' ) );\n\n/**\n* @name pareto1\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/pareto-type1}\n*/\nsetReadOnly( ns, 'pareto1', require( './../../iter/pareto-type1' ) );\n\n/**\n* @name poisson\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/poisson}\n*/\nsetReadOnly( ns, 'poisson', require( './../../iter/poisson' ) );\n\n/**\n* @name randi\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/randi}\n*/\nsetReadOnly( ns, 'randi', require( './../../iter/randi' ) );\n\n/**\n* @name randn\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/randn}\n*/\nsetReadOnly( ns, 'randn', require( './../../iter/randn' ) );\n\n/**\n* @name randu\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/randu}\n*/\nsetReadOnly( ns, 'randu', require( './../../iter/randu' ) );\n\n/**\n* @name rayleigh\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/rayleigh}\n*/\nsetReadOnly( ns, 'rayleigh', require( './../../iter/rayleigh' ) );\n\n/**\n* @name t\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/t}\n*/\nsetReadOnly( ns, 't', require( './../../iter/t' ) );\n\n/**\n* @name triangular\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/triangular}\n*/\nsetReadOnly( ns, 'triangular', require( './../../iter/triangular' ) );\n\n/**\n* @name uniform\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/uniform}\n*/\nsetReadOnly( ns, 'uniform', require( './../../iter/uniform' ) );\n\n/**\n* @name weibull\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/iter/weibull}\n*/\nsetReadOnly( ns, 'weibull', require( './../../iter/weibull' ) );\n\n\n// EXPORTS //\n\nmodule.exports = ns;\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 floor = require( '@stdlib/math/base/special/floor' );\n\n\n// MAIN //\n\n/**\n* Samples from a discrete uniform distribution (equal probabilities and with replacement).\n*\n* @private\n* @param {ArrayLike} x - array-like object from which to sample\n* @param {NonNegativeInteger} size - sample size\n* @param {Function} rand - PRNG for generating uniformly distributed numbers\n* @returns {Array} sample\n*/\nfunction discreteUniform( x, size, rand ) {\n\tvar pos;\n\tvar out;\n\tvar N;\n\tvar i;\n\n\tN = x.length;\n\tout = new Array( size );\n\tfor ( i = 0; i < size; i++ ) {\n\t\tpos = floor( N * rand() );\n\t\tout[ i ] = x[ pos ];\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = discreteUniform;\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* Samples without replacement from a discrete set using custom probabilities.\n*\n* ## Notes\n*\n* - After each draw, the probabilities of the remaining observations are renormalized so that they sum to one.\n*\n* @private\n* @param {ArrayLike} x - array-like object from which to sample\n* @param {NonNegativeInteger} size - sample size\n* @param {Function} rand - PRNG for generating uniformly distributed numbers\n* @param {ProbabilityArray} probabilities - element probabilities\n* @returns {Array} sample\n*/\nfunction renormalizing( x, size, rand, probabilities ) {\n\tvar probs;\n\tvar psum;\n\tvar out;\n\tvar N;\n\tvar i;\n\tvar j;\n\tvar k;\n\tvar u;\n\n\tN = x.length;\n\tprobs = new Array( N );\n\tfor ( i = 0; i < N; i++ ) {\n\t\tprobs[ i ] = probabilities[ i ];\n\t}\n\tout = new Array( size );\n\tfor ( i = 0; i < size; i++ ) {\n\t\tu = rand();\n\t\tpsum = 0;\n\t\tfor ( j = 0; j < N; j++ ) {\n\t\t\tpsum += probs[ j ];\n\t\t\tif ( u < psum ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tfor ( k = 0; k < N; k++ ) {\n\t\t\tif ( k === j ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tprobs[ k ] /= 1.0 - probs[ j ];\n\t\t}\n\t\tprobs[ j ] = 0.0;\n\t\tout[ i ] = x[ j ];\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = renormalizing;\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 floor = require( '@stdlib/math/base/special/floor' );\n\n\n// FUNCTIONS //\n\nvar slice = Array.prototype.slice;\n\n\n// MAIN //\n\n/**\n* Samples uniformly without replacement using the Fisher-Yates shuffle.\n*\n* ## References\n*\n* - Knuth, Donald E. 1997. _The Art of Computer Programming, Volume 2 (3rd Ed.): Seminumerical Algorithms_. Boston, MA, USA: Addison-Wesley Longman Publishing Co., Inc.\n*\n* @private\n* @param {ArrayLike} x - array-like object from which to sample\n* @param {NonNegativeInteger} size - sample size\n* @param {Function} rand - PRNG for generating uniformly distributed numbers\n* @returns {Array} sample\n*/\nfunction fisherYates( x, size, rand ) {\n\tvar tmp;\n\tvar N;\n\tvar i;\n\tvar j;\n\n\tN = x.length;\n\n\t// Note: we skip the first element, as no further swaps are possible given that all other indices are excluded from swapping...\n\tfor ( i = N-1; i > 0; i-- ) {\n\t\t// Generate an integer index on the interval: [0,i]\n\t\tj = floor( rand()*(i+1) );\n\n\t\t// Swap elements:\n\t\ttmp = x[ i ];\n\t\tx[ i ] = x[ j ];\n\t\tx[ j ] = tmp;\n\t}\n\treturn slice.call( x, 0, size );\n}\n\n\n// EXPORTS //\n\nmodule.exports = fisherYates;\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 floor = require( '@stdlib/math/base/special/floor' );\n\n\n// MAIN //\n\n/**\n* Samples with replacement and non-uniform probabilities using Vose's [alias method][alias-method].\n*\n* ## References\n*\n* - Vose, Michael D. 1991. \"A linear algorithm for generating random numbers with a given distribution.\" _IEEE Transactions on Software Engineering_ 17 (9): 972\u201375. doi:[10.1109/32.92917][@vose:1991].\n*\n* [alias-method]: http://keithschwarz.com/darts-dice-coins/\n* [@vose:1991]: https://doi.org/10.1109/32.92917\n*\n* @private\n* @param {ArrayLike} x - array-like object from which to sample\n* @param {NonNegativeInteger} size - sample size\n* @param {Function} rand - PRNG for generating uniformly distributed numbers\n* @param {ProbabilityArray} probabilities - element probabilities\n* @returns {Array} sample\n*/\nfunction vose( x, size, rand, probabilities ) {\n\tvar small;\n\tvar large;\n\tvar probs;\n\tvar alias;\n\tvar out;\n\tvar N;\n\tvar p;\n\tvar g;\n\tvar i;\n\tvar l;\n\n\tprobs = probabilities.slice();\n\tN = x.length;\n\n\tsmall = [];\n\tlarge = [];\n\tfor ( i = 0; i < N; i++ ) {\n\t\tprobs[ i ] *= N;\n\t\tif ( probs[ i ] < 1.0 ) {\n\t\t\tsmall.push( i );\n\t\t} else {\n\t\t\tlarge.push( i );\n\t\t}\n\t}\n\talias = new Array( N );\n\tp = new Array( N );\n\twhile ( small.length !== 0 && large.length !== 0 ) {\n\t\tl = small.shift();\n\t\tg = large.shift();\n\t\tp[ l ] = probs[ l ];\n\t\talias[ l ] = g;\n\t\tprobs[ g ] = probs[ g ] + probs[ l ] - 1.0;\n\t\tif ( probs[ g ] < 1.0 ) {\n\t\t\tsmall.push( g );\n\t\t} else {\n\t\t\tlarge.push( g );\n\t\t}\n\t}\n\tfor ( i = 0; i < large.length; i++ ) {\n\t\tp[ large[ i ] ] = 1.0;\n\t}\n\tfor ( i = 0; i < small.length; i++ ) {\n\t\tp[ small[ i ] ] = 1.0;\n\t}\n\tout = new Array( size );\n\tfor ( i = 0; i < size; i++ ) {\n\t\tl = floor( N*rand() );\n\t\tif ( rand() < p[ l ] ) {\n\t\t\tout[ i ] = x[ l ];\n\t\t} else {\n\t\t\tout[ i ] = x[ alias[ l ] ];\n\t\t}\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = vose;\n", "{\n\t\"mutate\": false,\n\t\"replace\": true\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'use strict';\n\n// MODULES //\n\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' );\nvar isUnityProbabilityArray = require( '@stdlib/assert/is-unity-probability-array' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination for validated options\n* @param {Options} options - function options\n* @param {NonNegativeInteger} [options.size] - sample size\n* @param {ProbabilityArray} [options.probs] - element probabilities\n* @param {boolean} [options.replace] - boolean indicating whether to sample with replacement\n* @param {boolean} [options.mutate] - boolean indicating whether to mutate the `pool` when sampling without replacement\n* @returns {(null|Error)} null or an error\n*\n* @example\n* var opts = {};\n* var options = {\n* 'size': 10,\n* 'replace': false,\n* 'mutate': true,\n* 'probs': [ 0.7, 0.3 ]\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'size' ) ) {\n\t\topts.size = options.size;\n\t\tif ( !isNonNegativeInteger( opts.size ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'size', opts.size ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'probs' ) ) {\n\t\topts.probs = options.probs;\n\t\tif ( !isUnityProbabilityArray( opts.probs ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be an array of probabilities that sum to one. Option: `%s`.', 'probs', opts.probs ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'mutate' ) ) {\n\t\topts.mutate = options.mutate;\n\t\tif ( !isBoolean( opts.mutate ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'mutate', opts.mutate ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'replace' ) ) {\n\t\topts.replace = options.replace;\n\t\tif ( !isBoolean( opts.replace ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'replace', opts.replace ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar isArrayLike = require( '@stdlib/assert/is-array-like' );\nvar isTypedArrayLike = require( '@stdlib/assert/is-typed-array-like' );\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar randu = require( './../../base/mt19937' ).factory;\nvar copy = require( '@stdlib/utils/copy' );\nvar discreteUniform = require( './discrete_uniform.js' );\nvar renormalizing = require( './renormalizing.js' );\nvar fisherYates = require( './fisher_yates.js' );\nvar vose = require( './vose.js' );\nvar defaults = require( './defaults.json' );\nvar validate = require( './validate.js' );\n\n\n// FUNCTIONS //\n\nvar slice = Array.prototype.slice;\n\n\n// MAIN //\n\n/**\n* Returns a function to sample elements from an array-like object.\n*\n* @param {(ArrayLike|TypedArrayLike)} [pool] - array-like object from which to sample\n* @param {Options} [options] - function options\n* @param {PositiveInteger} [options.seed] - integer-valued seed\n* @param {NonNegativeInteger} [options.size] - sample size\n* @param {boolean} [options.replace=true] - boolean indicating whether to sample with replacement\n* @param {boolean} [options.mutate=false] - boolean indicating whether to mutate the `pool` when sampling without replacement\n* @throws {TypeError} `pool` must be an array-like object\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @returns {Function} function to sample elements from an array-like object\n*\n* @example\n* var sample = factory({\n* 'seed': 232\n* });\n* var out = sample( 'abcdefg' );\n* // e.g., returns [ 'g', 'd', 'g', 'f', 'c', 'e', 'f' ]\n*\n* @example\n* var sample = factory( [ 1, 2, 3, 4, 5, 6 ], {\n* 'seed': 232,\n* 'size': 2\n* });\n* var out = sample();\n* // e.g., returns [ 6, 4 ]\n*\n* out = sample();\n* // e.g., returns [ 6, 5 ]\n*\n* @example\n* var sample = factory( [ 1, 2, 3, 4, 5, 6 ], {\n* 'seed': 474,\n* 'size': 3,\n* 'mutate': true,\n* 'replace': false\n* });\n* var out = sample();\n* // e.g., returns [ 4, 3, 6 ]\n*\n* out = sample();\n* // e.g., returns [ 1, 5, 2 ]\n*\n* out = sample();\n* // returns null\n*\n* @example\n* var sample = factory( [ 0, 1 ], {\n* 'size': 2\n* });\n*\n* var out = sample();\n* // e.g., returns [ 1, 1 ]\n*\n* out = sample({\n* 'size': 10\n* });\n* // e.g., returns [ 0, 1, 1, 1, 0, 1, 0, 0, 1, 1 ]\n*\n* @example\n* var sample = factory( [ 0, 1 ], {\n* 'size': 2\n* });\n*\n* var out = sample();\n* // e.g., returns [ 1, 1 ]\n*\n* out = sample({\n* 'replace': false\n* });\n* // e.g., returns [ 0, 1 ] or [ 1, 0 ]\n*\n* out = sample();\n* // e.g., returns [ 1, 1 ]\n*\n* @example\n* var sample = factory( [ 0, 1 ], {\n* 'size': 2,\n* 'mutate': true\n* });\n*\n* var out = sample();\n* // e.g., returns [ 1, 1 ]\n*\n* out = sample({\n* 'replace': false\n* });\n* // e.g., returns [ 0, 1 ] or [ 1, 0 ]\n*\n* out = sample();\n* // returns null\n*/\nfunction factory() {\n\tvar config;\n\tvar pool;\n\tvar conf;\n\tvar rand;\n\tvar err;\n\tvar fcn;\n\n\tconf = copy( defaults );\n\tif ( arguments.length === 1 ) {\n\t\tif ( isArrayLike( arguments[ 0 ] ) || isTypedArrayLike( arguments[ 0 ] ) ) { // eslint-disable-line max-len\n\t\t\tpool = arguments[ 0 ];\n\t\t} else {\n\t\t\tconfig = arguments[ 0 ];\n\t\t\terr = validate( conf, config );\n\t\t}\n\t} else if ( arguments.length > 1 ) {\n\t\tpool = arguments[ 0 ];\n\t\tconfig = arguments[ 1 ];\n\t\tif ( !( isArrayLike( pool ) || isTypedArrayLike( pool ) ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. `%s` argument must be array-like. Value: `%s`.', 'pool', pool ) );\n\t\t}\n\t\terr = validate( conf, config );\n\t}\n\tif ( err ) {\n\t\tthrow err;\n\t}\n\tif ( config && config.seed ) {\n\t\trand = randu({\n\t\t\t'seed': config.seed\n\t\t});\n\t} else {\n\t\trand = randu();\n\t}\n\tif ( pool === void 0 ) {\n\t\tfcn = sample1;\n\t} else {\n\t\tif ( isString( pool ) ) {\n\t\t\tpool = pool.split( '' );\n\t\t} else {\n\t\t\tpool = copy( pool );\n\t\t}\n\t\tfcn = sample2;\n\t}\n\tsetReadOnly( fcn, 'seed', rand.seed );\n\tsetReadOnly( fcn, 'PRNG', rand );\n\n\trand = rand.normalized;\n\n\treturn fcn;\n\n\t/**\n\t* Samples elements from an array-like object.\n\t*\n\t* @private\n\t* @param {(ArrayLike|TypedArrayLike)} x - array-like object from which to sample elements\n\t* @param {Options} [options] - function options\n\t* @param {NonNegativeInteger} [options.size] - sample size\n\t* @param {ProbabilityArray} [options.probs] - element probabilities\n\t* @param {boolean} [options.replace=true] - boolean indicating whether to sample with replacement\n\t* @throws {TypeError} first argument must be array-like\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {RangeError} `size` option must be less than or equal to the length of `x` when the `replace` option is `false`\n\t* @returns {Array} sample\n\t*/\n\tfunction sample1( x, options ) {\n\t\tvar replace;\n\t\tvar xcopy;\n\t\tvar probs;\n\t\tvar opts;\n\t\tvar size;\n\t\tvar err;\n\n\t\tif ( !( isArrayLike( x ) || isTypedArrayLike( x ) ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be array-like. Value: `%s`.', x ) );\n\t\t}\n\t\tif ( isString( x ) ) {\n\t\t\tx = x.split( '' );\n\t\t}\n\t\topts = {};\n\t\tif ( arguments.length > 1 ) {\n\t\t\terr = validate( opts, options );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tif ( opts.replace === void 0 ) {\n\t\t\treplace = conf.replace;\n\t\t} else {\n\t\t\treplace = opts.replace;\n\t\t}\n\t\tif ( opts.probs !== void 0 ) {\n\t\t\tprobs = opts.probs;\n\t\t}\n\t\tif ( opts.size ) {\n\t\t\tsize = opts.size;\n\t\t} else if ( conf.size ) {\n\t\t\tsize = conf.size;\n\t\t} else {\n\t\t\tsize = x.length;\n\t\t}\n\t\tif (\n\t\t\treplace === false &&\n\t\t\tsize > x.length\n\t\t) {\n\t\t\tthrow new RangeError( format( 'invalid option. `size` option must be less than or equal to the length of `x` when `replace` is `false`. Option: `%s`.', size ) );\n\t\t}\n\t\t// Custom probabilities...\n\t\tif ( probs ) {\n\t\t\tif ( replace ) {\n\t\t\t\treturn vose( x, size, rand, probs );\n\t\t\t}\n\t\t\treturn renormalizing( x, size, rand, probs );\n\t\t}\n\t\t// All elements equally likely...\n\t\tif ( replace ) {\n\t\t\treturn discreteUniform( x, size, rand );\n\t\t}\n\t\txcopy = slice.call( x );\n\t\treturn fisherYates( xcopy, size, rand );\n\t}\n\n\t/**\n\t* Samples elements from a population.\n\t*\n\t* @private\n\t* @param {Options} [options] - function options\n\t* @param {NonNegativeInteger} [options.size] - sample size\n\t* @param {boolean} [options.replace=true] - boolean indicating whether to sample with replacement\n\t* @param {boolean} [options.mutate=false] - boolean indicating whether to mutate the `pool` when sampling without replacement\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {RangeError} `size` option must be less than or equal to the population when the `replace` option is `false`\n\t* @returns {Array} sample\n\t*/\n\tfunction sample2( options ) {\n\t\tvar replace;\n\t\tvar mutate;\n\t\tvar opts;\n\t\tvar size;\n\t\tvar err;\n\t\tvar out;\n\n\t\tif ( pool.length === 0 ) {\n\t\t\treturn null;\n\t\t}\n\t\topts = {};\n\t\tif ( arguments.length ) {\n\t\t\terr = validate( opts, options );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tif ( opts.mutate === void 0 ) {\n\t\t\tmutate = conf.mutate;\n\t\t} else {\n\t\t\tmutate = opts.mutate;\n\t\t}\n\t\tif ( opts.replace === void 0 ) {\n\t\t\treplace = conf.replace;\n\t\t} else {\n\t\t\treplace = opts.replace;\n\t\t}\n\t\tif ( opts.size ) {\n\t\t\tsize = opts.size;\n\t\t} else if ( conf.size ) {\n\t\t\tsize = conf.size;\n\t\t} else {\n\t\t\tsize = pool.length;\n\t\t}\n\t\tif (\n\t\t\treplace === false &&\n\t\t\tsize > pool.length\n\t\t) {\n\t\t\tthrow new RangeError( format( 'invalid option. `size` option must be less than or equal to the population size when `replace` is `false`. Option: `%s`.', size ) );\n\t\t}\n\t\tif ( replace ) {\n\t\t\treturn discreteUniform( pool, size, rand );\n\t\t}\n\t\tout = fisherYates( pool, size, rand );\n\t\tif ( mutate ) {\n\t\t\t// Remove the sample observations:\n\t\t\tpool = pool.slice( size, pool.length );\n\t\t}\n\t\treturn out;\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' );\n\n\n// MAIN //\n\n/**\n* Samples elements from an array-like object.\n*\n* @name sample\n* @type {Function}\n* @param {ArrayLike} x - array-like object from which to sample\n* @param {Options} [options] - function options\n* @param {NonNegativeInteger} [options.size] - sample size\n* @param {ProbabilityArray} [options.probs] - element probabilities\n* @param {boolean} [options.replace=true] - boolean indicating whether to sample with replacement\n* @throws {TypeError} first argument must be array-like\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {RangeError} `size` option must be less than or equal to the length of `x` when the `replace` option is `false`\n* @returns {Array} sample\n*\n* @example\n* var out = sample( [ 3, null, NaN, 'abc', function(){} ] );\n* // e.g., returns [ 3, 'abc', null, 3, null ]\n*/\nvar sample = factory();\n\n\n// EXPORTS //\n\nmodule.exports = sample;\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* Sample elements from an array-like object.\n*\n* @module @stdlib/random/sample\n*\n* @example\n* var sample = require( '@stdlib/random/sample' );\n*\n* var out = sample( 'abc' );\n* // e.g., returns [ 'a', 'a', 'b' ]\n*\n* out = sample( [ 3, 6, 9 ] );\n* // e.g., returns [ 3, 9, 6 ]\n*\n* var bool = ( out.length === 3 );\n* // returns true\n*\n* @example\n* var sample = require( '@stdlib/random/sample' );\n*\n* var mysample = sample.factory({\n* 'seed': 323\n* });\n* var out = mysample( [ 3, 6, 9 ], {\n* 'size': 10\n* });\n* // e.g., returns [ 3, 9, 3, 3, 3, 6, 3, 3, 3, 6 ]\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", "{\n\t\"copy\": \"shallow\"\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'use strict';\n\n// MODULES //\n\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar indexOf = require( '@stdlib/utils/index-of' );\nvar format = require( '@stdlib/string/format' );\n\n\n// VARIABLES //\n\nvar COPY_OPTIONS = [ 'deep', 'shallow', 'none' ];\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination for validated options\n* @param {Options} options - function options\n* @param {string} [options.copy] - string denoting whether to return a copy (`deep`, `shallow` or `none`)\n* @returns {(null|Error)} null or an error\n*\n* @example\n* var opts = {};\n* var options = {\n* 'copy': 'shallow'\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t\tif ( !isString( opts.copy ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'copy', opts.copy ) );\n\t\t}\n\t\tif ( indexOf( COPY_OPTIONS, opts.copy ) === -1 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'copy', COPY_OPTIONS.join( '\", \"' ), opts.copy ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar isArrayLike = require( '@stdlib/assert/is-array-like' );\nvar isTypedArrayLike = require( '@stdlib/assert/is-typed-array-like' );\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar deepCopy = require( '@stdlib/utils/copy' );\nvar floor = require( '@stdlib/math/base/special/floor' );\nvar randu = require( './../../base/mt19937' ).factory;\nvar format = require( '@stdlib/string/format' );\nvar defaults = require( './defaults.json' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function to create a random permutation of elements from an array-like object.\n*\n* @param {Options} [config] - function options\n* @param {PositiveInteger} [config.seed] - integer-valued seed\n* @param {string} [config.copy=\"shallow\"] - default copy option (`deep`, `shallow` or `none`)\n* @throws {TypeError} options argument must be an object\n* @returns {Function} shuffle function\n*\n* @example\n* var shuffle = factory({\n* 'seed': 249\n* });\n* var data = [ 3, 8, 4, 8 ];\n* var out = shuffle( data );\n* // e.g., returns [ 4, 3, 8, 8 ]\n*/\nfunction factory( config ) {\n\tvar conf;\n\tvar rand;\n\tvar err;\n\n\tconf = deepCopy( defaults );\n\tif ( arguments.length ) {\n\t\terr = validate( conf, config );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\tif ( config && config.seed ) {\n\t\trand = randu({\n\t\t\t'seed': config.seed\n\t\t});\n\t} else {\n\t\trand = randu();\n\t}\n\tsetReadOnly( shuffle, 'seed', rand.seed );\n\tsetReadOnly( shuffle, 'PRNG', rand );\n\n\trand = rand.normalized;\n\n\treturn shuffle;\n\n\t/**\n\t* Returns a random permutation of elements in `arr`.\n\t*\n\t* @private\n\t* @param {(ArrayLike|TypedArrayLike)} arr - array-like object to shuffle\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.copy] - string indicating whether to return a copy (`deep`,`shallow` or `none`)\n\t* @throws {TypeError} first argument must be array-like\n\t* @throws {TypeError} options must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {ArrayLike} the shuffled array-like object\n\t*\n\t* @example\n\t* var data = [ 1, 2, 3 ];\n\t* var out = shuffle( data );\n\t* // e.g., returns [ 3, 1, 2 ]\n\t*\n\t* @example\n\t* var data = [ 1, 2, 3 ];\n\t* var out = shuffle( data, {\n\t* 'copy': 'none'\n\t* });\n\t* var bool = ( data === out );\n\t* // returns true\n\t*/\n\tfunction shuffle( arr, options ) {\n\t\tvar strflg;\n\t\tvar level;\n\t\tvar copy;\n\t\tvar opts;\n\t\tvar err;\n\t\tvar out;\n\t\tvar tmp;\n\t\tvar N;\n\t\tvar i;\n\t\tvar j;\n\n\t\tif ( !( isArrayLike( arr ) || isTypedArrayLike( arr ) ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be array-like. Value: `%s`.', arr ) );\n\t\t}\n\t\tif ( arguments.length > 1 ) {\n\t\t\topts = {};\n\t\t\terr = validate( opts, options );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tcopy = ( opts && opts.copy ) ? opts.copy : conf.copy;\n\n\t\tstrflg = isString( arr );\n\t\tif ( strflg ) {\n\t\t\tarr = arr.split( '' );\n\t\t\tcopy = 'none';\n\t\t}\n\n\t\tlevel = 0;\n\t\tif ( copy === 'shallow' ) {\n\t\t\tlevel += 1;\n\t\t} else if ( copy === 'deep' ) {\n\t\t\tlevel += 2;\n\t\t}\n\t\tN = arr.length;\n\t\tout = deepCopy( arr, level );\n\n\t\t// Note: we skip the first element, as no further swaps are possible given that all other indices are excluded from swapping...\n\t\tfor ( i = N - 1; i > 0; i-- ) {\n\t\t\t// Generate an integer index on the interval [0,i]:\n\t\t\tj = floor( rand() * (i+1.0) );\n\n\t\t\t// Swap elements:\n\t\t\ttmp = out[ i ];\n\t\t\tout[ i ] = out[ j ];\n\t\t\tout[ j ] = tmp;\n\t\t}\n\n\t\tif ( strflg ) {\n\t\t\tout = arr.join( '' );\n\t\t}\n\t\treturn out;\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' );\n\n\n// MAIN //\n\n/**\n* Returns a random permutation of elements in `arr`.\n*\n* @name shuffle\n* @type {Function}\n* @param {ArrayLike} arr - array-like object to shuffle\n* @param {Options} [options] - function options\n* @param {string} [options.copy=\"shallow\"] - string indicating whether to return a copy (`deep`,`shallow` or `none`)\n* @throws {TypeError} options must be an object\n* @throws {TypeError} must provide valid options\n* @returns {ArrayLike} the shuffled array-like object\n*\n* @example\n* var data = [ 1, 2, 3 ];\n* var out = shuffle( data );\n* // e.g., returns [ 3, 1, 2 ]\n*\n* @example\n* var data = [ 1, 2, 3 ];\n* var out = shuffle( data, {\n* 'copy': 'none'\n* });\n* var bool = ( data === out );\n* // returns true\n*/\nvar shuffle = factory();\n\n\n// EXPORTS //\n\nmodule.exports = shuffle;\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* Return a random permutation of elements from an array-like object.\n*\n* @module @stdlib/random/shuffle\n*\n* @example\n* var shuffle = require( '@stdlib/random/shuffle' );\n*\n* var data = [ 1, 2, 3 ];\n* var out = shuffle( data );\n* // e.g., returns [ 3, 1, 2 ]\n*\n* out = shuffle( data, {\n* 'copy': 'none'\n* });\n*\n* var bool = ( data === out );\n* // returns true\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", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:arcsine' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rarcsine = require( './../../../base/arcsine' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from an arcsine distribution.\n*\n* @constructor\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {RangeError} `a` must be less than `b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( a, b, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( a, b, options );\n\t\t}\n\t\treturn new RandomStream( a, b );\n\t}\n\tif ( !isNumber( a ) || isnan( a ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', a ) );\n\t}\n\tif ( !isNumber( b ) || isnan( b ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a number and not NaN. Value: `%s`.', b ) );\n\t}\n\tif ( a >= b ) {\n\t\tthrow new RangeError( format( 'invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.', a, b ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rarcsine( a, b, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar format = require( '@stdlib/string/format' );\nvar assign = require( '@stdlib/object/assign' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from an arcsine distribution.\n*\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {RangeError} `a` must be less than `b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( a, b, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( a, b, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from an arcsine distribution.\n*\n* @param {number} [a] - minimum support\n* @param {number} [b] - maximum support\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( a, b, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( a ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', a ) );\n\t\t}\n\t\topts = assign( {}, a );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from an arcsine distribution.\n\t*\n\t* @private\n\t* @param {number} a - minimum support\n\t* @param {number} b - maximum support\n\t* @throws {TypeError} `a` must be a number\n\t* @throws {TypeError} `b` must be a number\n\t* @throws {RangeError} `a` must be less than `b`\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( a, b ) {\n\t\treturn new RandomStream( a, b, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from an arcsine distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `a` must be a number\n\t* @throws {TypeError} `b` must be a number\n\t* @throws {RangeError} `a` must be less than `b`\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( a, b, opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from an arcsine distribution.\n*\n* @module @stdlib/random/streams/arcsine\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/arcsine' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/arcsine' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/arcsine' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:bernoulli' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isProbability = require( '@stdlib/assert/is-probability' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rbern = require( './../../../base/bernoulli' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a Bernoulli distribution.\n*\n* @constructor\n* @param {Probability} p - success probability\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `p` must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 0.5, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( p, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 1 ) {\n\t\t\treturn new RandomStream( p, options );\n\t\t}\n\t\treturn new RandomStream( p );\n\t}\n\tif ( !isProbability( p ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a probability. Value: `%s`.', p ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rbern( p, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar format = require( '@stdlib/string/format' );\nvar assign = require( '@stdlib/object/assign' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a Bernoulli distribution.\n*\n* @param {Probability} p - success probability\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `p` must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 0.7, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( p, options ) {\n\tvar opts;\n\tif ( arguments.length > 1 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( p, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar isProbability = require( '@stdlib/assert/is-probability' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\nvar assign = require( '@stdlib/object/assign' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a Bernoulli distribution.\n*\n* @param {Probability} [p] - success probability\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 0.3 ) );\n* }\n*/\nfunction factory( p, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs > 1 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\tfcn = createStream2;\n\t\topts = assign( {}, options );\n\t} else if ( nargs === 1 ) {\n\t\tif ( isProbability( p ) ) {\n\t\t\tfcn = createStream2;\n\t\t\topts = {};\n\t\t} else {\n\t\t\tif ( !isPlainObject( p ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', p ) );\n\t\t\t}\n\t\t\topts = assign( {}, p );\n\t\t\tfcn = createStream1;\n\t\t}\n\t} else {\n\t\topts = {};\n\t\tfcn = createStream1;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Bernoulli distribution.\n\t*\n\t* @private\n\t* @param {Probability} p - success probability\n\t* @throws {TypeError} `p` must be a probability\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( p ) {\n\t\treturn new RandomStream( p, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Bernoulli distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `p` must be a probability\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( p, opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from a Bernoulli distribution.\n*\n* @module @stdlib/random/streams/bernoulli\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/bernoulli' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 0.2, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/bernoulli' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 0.2 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/bernoulli' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 0.2, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:beta' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rbeta = require( './../../../base/beta' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a beta distribution.\n*\n* @constructor\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( alpha, beta, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( alpha, beta, options );\n\t\t}\n\t\treturn new RandomStream( alpha, beta );\n\t}\n\tif ( !isPositiveNumber( alpha ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositiveNumber( beta ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rbeta( alpha, beta, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar format = require( '@stdlib/string/format' );\nvar assign = require( '@stdlib/object/assign' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a beta distribution.\n*\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( alpha, beta, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( alpha, beta, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a beta distribution.\n*\n* @param {PositiveNumber} [alpha] - first shape parameter\n* @param {PositiveNumber} [beta] - second shape parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( alpha, beta, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( alpha ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', alpha ) );\n\t\t}\n\t\topts = assign( {}, alpha );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a beta distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} alpha - first shape parameter\n\t* @param {PositiveNumber} beta - second shape parameter\n\t* @throws {TypeError} `alpha` must be a positive number\n\t* @throws {TypeError} `beta` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( alpha, beta ) {\n\t\treturn new RandomStream( alpha, beta, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a beta distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `alpha` must be a positive number\n\t* @throws {TypeError} `beta` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( alpha, beta, opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from a beta distribution.\n*\n* @module @stdlib/random/streams/beta\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/beta' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/beta' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/beta' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:betaprime' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rbetaprime = require( './../../../base/betaprime' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a beta prime distribution.\n*\n* @constructor\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( alpha, beta, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( alpha, beta, options );\n\t\t}\n\t\treturn new RandomStream( alpha, beta );\n\t}\n\tif ( !isPositiveNumber( alpha ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositiveNumber( beta ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rbetaprime( alpha, beta, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar format = require( '@stdlib/string/format' );\nvar assign = require( '@stdlib/object/assign' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a beta prime distribution.\n*\n* @param {PositiveNumber} alpha - first shape parameter\n* @param {PositiveNumber} beta - second shape parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( alpha, beta, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( alpha, beta, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a beta prime distribution.\n*\n* @param {PositiveNumber} [alpha] - first shape parameter\n* @param {PositiveNumber} [beta] - second shape parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( alpha, beta, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( alpha ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', alpha ) );\n\t\t}\n\t\topts = assign( {}, alpha );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a beta prime distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} alpha - first shape parameter\n\t* @param {PositiveNumber} beta - second shape parameter\n\t* @throws {TypeError} `alpha` must be a positive number\n\t* @throws {TypeError} `beta` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( alpha, beta ) {\n\t\treturn new RandomStream( alpha, beta, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a beta prime distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `alpha` must be a positive number\n\t* @throws {TypeError} `beta` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( alpha, beta, opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from a beta prime distribution.\n*\n* @module @stdlib/random/streams/betaprime\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/betaprime' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/betaprime' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/betaprime' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isPlainObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:binomial' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isProbability = require( '@stdlib/assert/is-probability' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rbinom = require( './../../../base/binomial' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a binomial distribution.\n*\n* @constructor\n* @param {PositiveInteger} n - number of trials\n* @param {Probability} p - success probability\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `n` must be a positive integer\n* @throws {TypeError} `p` must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 20, 0.2, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( n, p, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( n, p, options );\n\t\t}\n\t\treturn new RandomStream( n, p );\n\t}\n\tif ( !isPositiveInteger( n ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive integer. Value: `%s`.', n ) );\n\t}\n\tif ( !isProbability( p ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a probability. Value: `%s`.', p ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rbinom( n, p, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a binomial distribution.\n*\n* @param {PositiveInteger} n - number of trials\n* @param {Probability} p - success probability\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `n` must be a positive integer\n* @throws {TypeError} `p` must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 20, 0.1, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( n, p, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isPlainObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( n, p, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a binomial distribution.\n*\n* @param {PositiveInteger} [n] - number of trials\n* @param {Probability} [p] - second shape parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 20, 0.5 ) );\n* }\n*/\nfunction factory( n, p, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( n ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', n ) );\n\t\t}\n\t\topts = assign( {}, n );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a binomial distribution.\n\t*\n\t* @private\n\t* @param {PositiveInteger} n - number of trials\n\t* @param {Probability} p - success probability\n\t* @throws {TypeError} `n` must be a positive integer\n\t* @throws {TypeError} `p` must be a positive probability\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( n, p ) {\n\t\treturn new RandomStream( n, p, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a binomial distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `n` must be a positive integer\n\t* @throws {TypeError} `p` must be a probability\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( n, p, opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from a binomial distribution.\n*\n* @module @stdlib/random/streams/binomial\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/binomial' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 20, 0.4, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/binomial' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 20, 0.4 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/binomial' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 20, 0.4, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:box-muller' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar randn = require( './../../../base/box-muller' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a standard normal distribution using the Box-Muller transform.\n*\n* @constructor\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 0 ) {\n\t\t\treturn new RandomStream( options );\n\t\t}\n\t\treturn new RandomStream();\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 0 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', randn( opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a standard normal distribution using the Box-Muller transform.\n*\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a standard normal distribution using the Box-Muller transform.\n*\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*/\nfunction factory( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\treturn createStream;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a standard normal distribution using the Box-Muller transform.\n\t*\n\t* @private\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream() {\n\t\treturn new RandomStream( opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from a standard normal distribution using the Box-Muller transform.\n*\n* @module @stdlib/random/streams/box-muller\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/box-muller' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/box-muller' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/box-muller' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:cauchy' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rcauchy = require( './../../../base/cauchy' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a Cauchy distribution.\n*\n* @constructor\n* @param {number} x0 - location parameter\n* @param {PositiveNumber} gamma - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `x0` must be a number\n* @throws {TypeError} `gamma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( x0, gamma, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( x0, gamma, options );\n\t\t}\n\t\treturn new RandomStream( x0, gamma );\n\t}\n\tif ( !isNumber( x0 ) || isnan( x0 ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', x0 ) );\n\t}\n\tif ( !isPositiveNumber( gamma ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', gamma ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rcauchy( x0, gamma, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a Cauchy distribution.\n*\n* @param {number} x0 - location parameter\n* @param {PositiveNumber} gamma - scale parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `gamma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( x0, gamma, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( x0, gamma, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a Cauchy distribution.\n*\n* @param {number} [x0] - location parameter\n* @param {PositiveNumber} [gamma] - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( x0, gamma, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( x0 ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', x0 ) );\n\t\t}\n\t\topts = assign( {}, x0 );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Cauchy distribution.\n\t*\n\t* @private\n\t* @param {number} x0 - location parameter\n\t* @param {PositiveNumber} gamma - scale parameter\n\t* @throws {TypeError} `gamma` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( x0, gamma ) {\n\t\treturn new RandomStream( x0, gamma, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Cauchy distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `gamma` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( x0, gamma, opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from a Cauchy distribution.\n*\n* @module @stdlib/random/streams/cauchy\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/cauchy' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/cauchy' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/cauchy' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:chi' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rchi = require( './../../../base/chi' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a chi distribution.\n*\n* @constructor\n* @param {PositiveNumber} k - degrees of freedom\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `k` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( k, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 1 ) {\n\t\t\treturn new RandomStream( k, options );\n\t\t}\n\t\treturn new RandomStream( k );\n\t}\n\tif ( !isPositiveNumber( k ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', k ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rchi( k, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a chi distribution.\n*\n* @param {PositiveNumber} k - degrees of freedom\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `k` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( k, options ) {\n\tvar opts;\n\tif ( arguments.length > 1 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( k, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a chi distribution.\n*\n* @param {PositiveNumber} [k] - degrees of freedom\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 3.0 ) );\n* }\n*/\nfunction factory( k, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs > 1 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\tfcn = createStream2;\n\t\topts = assign( {}, options );\n\t} else if ( nargs === 1 ) {\n\t\tif ( isPositive( k ) ) {\n\t\t\tfcn = createStream2;\n\t\t\topts = {};\n\t\t} else {\n\t\t\tif ( !isPlainObject( k ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', k ) );\n\t\t\t}\n\t\t\topts = assign( {}, k );\n\t\t\tfcn = createStream1;\n\t\t}\n\t} else {\n\t\topts = {};\n\t\tfcn = createStream1;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a chi distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} k - degrees of freedom\n\t* @throws {TypeError} `k` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( k ) {\n\t\treturn new RandomStream( k, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a chi distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `k` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( k, opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from a chi distribution.\n*\n* @module @stdlib/random/streams/chi\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/chi' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/chi' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/chi' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:chisquare' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rchisquare = require( './../../../base/chisquare' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a chi-square distribution.\n*\n* @constructor\n* @param {PositiveNumber} k - degrees of freedom\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `k` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( k, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 1 ) {\n\t\t\treturn new RandomStream( k, options );\n\t\t}\n\t\treturn new RandomStream( k );\n\t}\n\tif ( !isPositiveNumber( k ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', k ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rchisquare( k, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a chi-square distribution.\n*\n* @param {PositiveNumber} k - degrees of freedom\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `k` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( k, options ) {\n\tvar opts;\n\tif ( arguments.length > 1 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, opts );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( k, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a chi-square distribution.\n*\n* @param {PositiveNumber} [k] - degrees of freedom\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 3.0 ) );\n* }\n*/\nfunction factory( k, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs > 1 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\tfcn = createStream2;\n\t\topts = assign( {}, options);\n\t} else if ( nargs === 1 ) {\n\t\tif ( isPositive( k ) ) {\n\t\t\tfcn = createStream2;\n\t\t\topts = {};\n\t\t} else {\n\t\t\tif ( !isPlainObject( k ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', k ) );\n\t\t\t}\n\t\t\topts = assign( {}, k );\n\t\t\tfcn = createStream1;\n\t\t}\n\t} else {\n\t\topts = {};\n\t\tfcn = createStream1;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a chi-square distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} k - degrees of freedom\n\t* @throws {TypeError} `k` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( k ) {\n\t\treturn new RandomStream( k, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a chi-square distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `k` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( k, opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from a chi-square distribution.\n*\n* @module @stdlib/random/streams/chisquare\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/chisquare' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/chisquare' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/chisquare' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:cosine' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rcosine = require( './../../../base/cosine' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a raised cosine distribution.\n*\n* @constructor\n* @param {number} mu - location parameter\n* @param {PositiveNumber} s - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( mu, s, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( mu, s, options );\n\t\t}\n\t\treturn new RandomStream( mu, s );\n\t}\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositiveNumber( s ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', s ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rcosine( mu, s, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a raised cosine distribution.\n*\n* @param {number} mu - location parameter\n* @param {PositiveNumber} s - scale parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( mu, s, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( mu, s, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a raised cosine distribution.\n*\n* @param {number} [mu] - location parameter\n* @param {PositiveNumber} [s] - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( mu, s, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( mu ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', mu ) );\n\t\t}\n\t\topts = assign( {}, mu );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a raised cosine distribution.\n\t*\n\t* @private\n\t* @param {number} mu - location parameter\n\t* @param {PositiveNumber} s - scale parameter\n\t* @throws {TypeError} `s` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( mu, s ) {\n\t\treturn new RandomStream( mu, s, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a raised cosine distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `s` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( mu, s, opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from a raised cosine distribution.\n*\n* @module @stdlib/random/streams/cosine\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/cosine' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/cosine' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/cosine' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:discrete-uniform' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isInteger = require( '@stdlib/assert/is-integer' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rduniform = require( './../../../base/discrete-uniform' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a discrete uniform distribution.\n*\n* @constructor\n* @param {integer} a - minimum support\n* @param {integer} b - maximum support\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `a` must be an integer\n* @throws {TypeError} `b` must be an integer\n* @throws {RangeError} `a` must be less than or equal to `b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2, 5, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( a, b, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( a, b, options );\n\t\t}\n\t\treturn new RandomStream( a, b );\n\t}\n\tif ( !isInteger( a ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an integer. Value: `%s`.', a ) );\n\t}\n\tif ( !isInteger( b ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an integer. Value: `%s`.', b ) );\n\t}\n\tif ( a > b ) {\n\t\tthrow new RangeError( format( 'invalid argument. Minimum support must be less than or equal to maximum support. Value: `[%d, %d]`.', a, b ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rduniform( a, b, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a discrete uniform distribution.\n*\n* @param {integer} a - minimum support\n* @param {integer} b - maximum support\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `a` must be an integer\n* @throws {TypeError} `b` must be an integer\n* @throws {RangeError} `a` must be less than or equal to `b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2, 5, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( a, b, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( a, b, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a discrete uniform distribution.\n*\n* @param {integer} [a] - minimum support\n* @param {integer} [b] - maximum support\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2, 5 ) );\n* }\n*/\nfunction factory( a, b, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( a ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', a ) );\n\t\t}\n\t\topts = assign( {}, a );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a discrete uniform distribution.\n\t*\n\t* @private\n\t* @param {integer} a - minimum support\n\t* @param {integer} b - maximum support\n\t* @throws {TypeError} `a` must be an integer\n\t* @throws {TypeError} `b` must be an integer\n\t* @throws {RangeError} `a` must be less than or equal to `b`\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( a, b ) {\n\t\treturn new RandomStream( a, b, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a discrete uniform distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `a` must be an integer\n\t* @throws {TypeError} `b` must be an integer\n\t* @throws {RangeError} `a` must be less than or equal to `b`\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( a, b, opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from a discrete uniform distribution.\n*\n* @module @stdlib/random/streams/discrete-uniform\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/discrete-uniform' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2, 5, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/discrete-uniform' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2, 5 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/discrete-uniform' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2, 5, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:erlang' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rerlang = require( './../../../base/erlang' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from an Erlang distribution.\n*\n* @constructor\n* @param {PositiveInteger} k - shape parameter\n* @param {PositiveNumber} lambda - rate parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `k` must be a positive integer\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( k, lambda, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( k, lambda, options );\n\t\t}\n\t\treturn new RandomStream( k, lambda );\n\t}\n\tif ( !isPositiveInteger( k ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive integer. Value: `%s`.', k ) );\n\t}\n\tif ( !isPositiveNumber( lambda ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', lambda ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rerlang( k, lambda, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from an Erlang distribution.\n*\n* @param {PositiveInteger} k - shape parameter\n* @param {PositiveNumber} lambda - rate parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `k` must be a positive integer\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( k, lambda, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( k, lambda, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from an Erlang distribution.\n*\n* @param {PositiveInteger} [k] - shape parameter\n* @param {PositiveNumber} [lambda] - rate parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2, 5.0 ) );\n* }\n*/\nfunction factory( k, lambda, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( k ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', k ) );\n\t\t}\n\t\topts = assign( {}, k );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from an Erlang distribution.\n\t*\n\t* @private\n\t* @param {PositiveInteger} k - shape parameter\n\t* @param {PositiveNumber} lambda - rate parameter\n\t* @throws {TypeError} `k` must be a positive integer\n\t* @throws {TypeError} `lambda` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( k, lambda ) {\n\t\treturn new RandomStream( k, lambda, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from an Erlang distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `k` must be a positive integer\n\t* @throws {TypeError} `lambda` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( k, lambda, opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from an Erlang distribution.\n*\n* @module @stdlib/random/streams/erlang\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/erlang' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/erlang' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/erlang' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:exponential' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rexponential = require( './../../../base/exponential' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from an exponential distribution.\n*\n* @constructor\n* @param {PositiveNumber} lambda - rate parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( lambda, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 1 ) {\n\t\t\treturn new RandomStream( lambda, options );\n\t\t}\n\t\treturn new RandomStream( lambda );\n\t}\n\tif ( !isPositiveNumber( lambda ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', lambda ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rexponential( lambda, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from an exponential distribution.\n*\n* @param {PositiveNumber} lambda - rate parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( lambda, options ) {\n\tvar opts;\n\tif ( arguments.length > 1 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( lambda, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from an exponential distribution.\n*\n* @param {PositiveNumber} [lambda] - rate parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 3.0 ) );\n* }\n*/\nfunction factory( lambda, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs > 1 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\tfcn = createStream2;\n\t\topts = assign( {}, options );\n\t} else if ( nargs === 1 ) {\n\t\tif ( isPositive( lambda ) ) {\n\t\t\tfcn = createStream2;\n\t\t\topts = {};\n\t\t} else {\n\t\t\tif ( !isPlainObject( lambda ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', lambda ) );\n\t\t\t}\n\t\t\topts = assign( {}, lambda );\n\t\t\tfcn = createStream1;\n\t\t}\n\t} else {\n\t\topts = {};\n\t\tfcn = createStream1;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from an exponential distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} lambda - rate parameter\n\t* @throws {TypeError} `lambda` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( lambda ) {\n\t\treturn new RandomStream( lambda, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from an exponential distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `lambda` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( lambda, opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from an exponential distribution.\n*\n* @module @stdlib/random/streams/exponential\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/exponential' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/exponential' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/exponential' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:f' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rf = require( './../../../base/f' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from an F distribution.\n*\n* @constructor\n* @param {PositiveNumber} d1 - degrees of freedom\n* @param {PositiveNumber} d2 - degrees of freedom\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `d1` must be a positive number\n* @throws {TypeError} `d2` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( d1, d2, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( d1, d2, options );\n\t\t}\n\t\treturn new RandomStream( d1, d2 );\n\t}\n\tif ( !isPositiveNumber( d1 ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', d1 ) );\n\t}\n\tif ( !isPositiveNumber( d2 ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', d2 ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rf( d1, d2, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from an F distribution.\n*\n* @param {PositiveNumber} d1 - degrees of freedom\n* @param {PositiveNumber} d2 - degrees of freedom\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `d1` must be a positive number\n* @throws {TypeError} `d2` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( d1, d2, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( d1, d2, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from an F distribution.\n*\n* @param {PositiveNumber} [d1] - degrees of freedom\n* @param {PositiveNumber} [d2] - degrees of freedom\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( d1, d2, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( d1 ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', d1 ) );\n\t\t}\n\t\topts = assign( {}, d1 );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from an F distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} d1 - degrees of freedom\n\t* @param {PositiveNumber} d2 - degrees of freedom\n\t* @throws {TypeError} `d1` must be a positive number\n\t* @throws {TypeError} `d2` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( d1, d2 ) {\n\t\treturn new RandomStream( d1, d2, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from an F distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `d1` must be a positive number\n\t* @throws {TypeError} `d2` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( d1, d2, opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from an F distribution.\n*\n* @module @stdlib/random/streams/f\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/f' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/f' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/f' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:frechet' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' );\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rfrechet = require( './../../../base/frechet' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a Fr\u00E9chet distribution.\n*\n* @constructor\n* @param {PositiveNumber} [alpha] - shape parameter\n* @param {PositiveNumber} [s] - scale parameter\n* @param {number} [m] - location parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} `m` must be a number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, 1.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( alpha, s, m, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 3 ) {\n\t\t\treturn new RandomStream( alpha, s, m, options );\n\t\t}\n\t\treturn new RandomStream( alpha, s, m );\n\t}\n\tif ( !isPositiveNumber( alpha ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number and not NaN. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositiveNumber( s ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number and not NaN. Value: `%s`.', s ) );\n\t}\n\tif ( !isNumber( m ) || isnan( m ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a number. Value: `%s`.', m ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 3 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rfrechet( alpha, s, m, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a Fr\u00E9chet distribution.\n*\n* @param {PositiveNumber} [alpha] - shape parameter\n* @param {PositiveNumber} [s] - scale parameter\n* @param {number} [m] - location parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} `m` must be a number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 5.0, -1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( alpha, s, m, options ) {\n\tvar opts;\n\tif ( arguments.length > 3 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( alpha, s, m, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a Fr\u00E9chet distribution.\n*\n* @param {PositiveNumber} [alpha] - shape parameter\n* @param {PositiveNumber} [s] - scale parameter\n* @param {number} [m] - location parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0, 0.0 ) );\n* }\n*/\nfunction factory( alpha, s, m, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( alpha ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', alpha ) );\n\t\t}\n\t\topts = assign( {}, alpha );\n\t} else if ( nargs > 3 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 3 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Fr\u00E9chet distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} alpha - shape parameter\n\t* @param {PositiveNumber} s - scale parameter\n\t* @param {number} m - location parameter\n\t* @throws {TypeError} `alpha` must be a positive number\n\t* @throws {TypeError} `s` must be a positive number\n\t* @throws {TypeError} `m` must be a number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( alpha, s, m ) {\n\t\treturn new RandomStream( alpha, s, m, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Fr\u00E9chet distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `alpha` must be a positive number\n\t* @throws {TypeError} `s` must be a positive number\n\t* @throws {TypeError} `m` must be a number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( alpha, s, m, opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from a Fr\u00E9chet distribution.\n*\n* @module @stdlib/random/streams/frechet\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/frechet' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 5.0, 3.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/frechet' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0, -2.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/frechet' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 5.0, 0.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:gamma' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rgamma = require( './../../../base/gamma' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a gamma distribution.\n*\n* @constructor\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - rate parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( alpha, beta, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( alpha, beta, options );\n\t\t}\n\t\treturn new RandomStream( alpha, beta );\n\t}\n\tif ( !isPositiveNumber( alpha ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositiveNumber( beta ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rgamma( alpha, beta, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a gamma distribution.\n*\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - rate parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( alpha, beta, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( alpha, beta, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a gamma distribution.\n*\n* @param {PositiveNumber} [alpha] - shape parameter\n* @param {PositiveNumber} [beta] - rate parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( alpha, beta, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( alpha ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', alpha ) );\n\t\t}\n\t\topts = assign( {}, alpha );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a gamma distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} alpha - shape parameter\n\t* @param {PositiveNumber} beta - rate parameter\n\t* @throws {TypeError} `alpha` must be a positive number\n\t* @throws {TypeError} `beta` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( alpha, beta ) {\n\t\treturn new RandomStream( alpha, beta, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a gamma distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `alpha` must be a positive number\n\t* @throws {TypeError} `beta` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( alpha, beta, opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from a gamma distribution.\n*\n* @module @stdlib/random/streams/gamma\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/gamma' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/gamma' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/gamma' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:geometric' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isProbability = require( '@stdlib/assert/is-probability' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rgeom = require( './../../../base/geometric' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a geometric distribution.\n*\n* @constructor\n* @param {Probability} p - success probability\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `p` must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 0.5, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( p, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 1 ) {\n\t\t\treturn new RandomStream( p, options );\n\t\t}\n\t\treturn new RandomStream( p );\n\t}\n\tif ( !isProbability( p ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a probability. Value: `%s`.', p ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rgeom( p, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a geometric distribution.\n*\n* @param {Probability} p - success probability\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `p` must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 0.7, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( p, options ) {\n\tvar opts;\n\tif ( arguments.length > 1 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( p, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isProbability = require( '@stdlib/assert/is-probability' ).isPrimitive;\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a geometric distribution.\n*\n* @param {Probability} [p] - success probability\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 0.3 ) );\n* }\n*/\nfunction factory( p, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs > 1 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\tfcn = createStream2;\n\t\topts = assign( {}, options );\n\t} else if ( nargs === 1 ) {\n\t\tif ( isProbability( p ) ) {\n\t\t\tfcn = createStream2;\n\t\t\topts = {};\n\t\t} else {\n\t\t\tif ( !isPlainObject( p ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', p ) );\n\t\t\t}\n\t\t\topts = assign( {}, p );\n\t\t\tfcn = createStream1;\n\t\t}\n\t} else {\n\t\topts = {};\n\t\tfcn = createStream1;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a geometric distribution.\n\t*\n\t* @private\n\t* @param {Probability} p - success probability\n\t* @throws {TypeError} `p` must be a probability\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( p ) {\n\t\treturn new RandomStream( p, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a geometric distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `p` must be a probability\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( p, opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from a geometric distribution.\n*\n* @module @stdlib/random/streams/geometric\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/geometric' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 0.2, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/geometric' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 0.2 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/geometric' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 0.2, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:gumbel' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rgumbel = require( './../../../base/gumbel' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a Gumbel distribution.\n*\n* @constructor\n* @param {number} mu - mean\n* @param {PositiveNumber} beta - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( mu, beta, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( mu, beta, options );\n\t\t}\n\t\treturn new RandomStream( mu, beta );\n\t}\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositiveNumber( beta ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rgumbel( mu, beta, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a Gumbel distribution.\n*\n* @param {number} mu - mean\n* @param {PositiveNumber} beta - scale parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( mu, beta, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( mu, beta, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a Gumbel distribution.\n*\n* @param {number} [mu] - mean\n* @param {PositiveNumber} [beta] - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( mu, beta, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( mu ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', mu ) );\n\t\t}\n\t\topts = assign( {}, mu );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Gumbel distribution.\n\t*\n\t* @private\n\t* @param {number} mu - mean\n\t* @param {PositiveNumber} beta - scale parameter\n\t* @throws {TypeError} `mu` must be a number\n\t* @throws {TypeError} `beta` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( mu, beta ) {\n\t\treturn new RandomStream( mu, beta, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Gumbel distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `mu` must be a number\n\t* @throws {TypeError} `beta` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( mu, beta, opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from a Gumbel distribution.\n*\n* @module @stdlib/random/streams/gumbel\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/gumbel' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/gumbel' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/gumbel' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:hypergeometric' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rhypergeom = require( './../../../base/hypergeometric' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a hypergeometric distribution.\n*\n* @constructor\n* @param {NonNegativeInteger} [N] - population size\n* @param {NonNegativeInteger} [K] - subpopulation size\n* @param {NonNegativeInteger} [n] - number of draws\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `N` must be a nonnegative integer\n* @throws {TypeError} `K` must be a nonnegative integer\n* @throws {TypeError} `n` must be a nonnegative integer\n* @throws {RangeError} `n` must be less than or equal to `N`\n* @throws {RangeError} `K` must be less than or equal to `N`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 20, 10, 7, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( N, K, n, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 3 ) {\n\t\t\treturn new RandomStream( N, K, n, options );\n\t\t}\n\t\treturn new RandomStream( N, K, n );\n\t}\n\tif ( !isNonNegativeInteger( N ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', N ) );\n\t}\n\tif ( !isNonNegativeInteger( K ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a nonnegative integer. Value: `%s`.', K ) );\n\t}\n\tif ( !isNonNegativeInteger( n ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a nonnegative integer. Value: `%s`.', n ) );\n\t}\n\tif ( n > N ) {\n\t\tthrow new RangeError( 'invalid argument. Third argument must be less than or equal to the first argument.' );\n\t}\n\tif ( K > N ) {\n\t\tthrow new RangeError( 'invalid argument. Second argument must be less than or equal to the first argument.' );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 3 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rhypergeom( N, K, n, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a hypergeometric distribution.\n*\n* @param {NonNegativeInteger} [N] - population size\n* @param {NonNegativeInteger} [K] - subpopulation size\n* @param {NonNegativeInteger} [n] - number of draws\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `N` must be a nonnegative integer\n* @throws {TypeError} `K` must be a nonnegative integer\n* @throws {TypeError} `n` must be a nonnegative integer\n* @throws {RangeError} `n` must be less than or equal to `N`\n* @throws {RangeError} `K` must be less than or equal to `N`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 20, 10, 7, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( N, K, n, options ) {\n\tvar opts;\n\tif ( arguments.length > 3 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( N, K, n, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a hypergeometric distribution.\n*\n* @param {NonNegativeInteger} [N] - population size\n* @param {NonNegativeInteger} [K] - subpopulation size\n* @param {NonNegativeInteger} [n] - number of draws\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 5, 3, 2 ) );\n* }\n*/\nfunction factory( N, K, n, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( N ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', N ) );\n\t\t}\n\t\topts = assign( {}, N );\n\t} else if ( nargs > 3 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 3 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a hypergeometric distribution.\n\t*\n\t* @private\n\t* @param {NonNegativeInteger} N - population size\n\t* @param {NonNegativeInteger} K - subpopulation size\n\t* @param {NonNegativeInteger} n - number of draws\n\t* @throws {TypeError} `N` must be a nonnegative integer\n\t* @throws {TypeError} `K` must be a nonnegative integer\n\t* @throws {TypeError} `n` must be a nonnegative integer\n\t* @throws {RangeError} `n` must be less than or equal to `N`\n\t* @throws {RangeError} `K` must be less than or equal to `N`\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( N, K, n ) {\n\t\treturn new RandomStream( N, K, n, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a hypergeometric distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `N` must be a nonnegative integer\n\t* @throws {TypeError} `K` must be a nonnegative integer\n\t* @throws {TypeError} `n` must be a nonnegative integer\n\t* @throws {RangeError} `n` must be less than or equal to `N`\n\t* @throws {RangeError} `K` must be less than or equal to `N`\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( N, K, n, opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from a hypergeometric distribution.\n*\n* @module @stdlib/random/streams/hypergeometric\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/hypergeometric' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 5, 3, 2, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/hypergeometric' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 5, 3, 2 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/hypergeometric' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 5, 3, 2, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:improved-ziggurat' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar randn = require( './../../../base/improved-ziggurat' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a standard normal distribution using the Improved Ziggurat algorithm.\n*\n* @constructor\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 0 ) {\n\t\t\treturn new RandomStream( options );\n\t\t}\n\t\treturn new RandomStream();\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 0 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', randn( opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a standard normal distribution using the Improved Ziggurat algorithm.\n*\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a standard normal distribution using the Improved Ziggurat algorithm.\n*\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*/\nfunction factory( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\treturn createStream;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a standard normal distribution using the Improved Ziggurat algorithm.\n\t*\n\t* @private\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream() {\n\t\treturn new RandomStream( opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from a standard normal distribution using the Improved Ziggurat algorithm.\n*\n* @module @stdlib/random/streams/improved-ziggurat\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/improved-ziggurat' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/improved-ziggurat' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/improved-ziggurat' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:invgamma' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rinvgamma = require( './../../../base/invgamma' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from an inverse gamma distribution.\n*\n* @constructor\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( alpha, beta, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( alpha, beta, options );\n\t\t}\n\t\treturn new RandomStream( alpha, beta );\n\t}\n\tif ( !isPositiveNumber( alpha ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositiveNumber( beta ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rinvgamma( alpha, beta, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from an inverse gamma distribution.\n*\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - scale parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( alpha, beta, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( alpha, beta, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from an inverse gamma distribution.\n*\n* @param {PositiveNumber} [alpha] - shape parameter\n* @param {PositiveNumber} [beta] - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( alpha, beta, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( alpha ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', alpha ) );\n\t\t}\n\t\topts = assign( {}, alpha );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from an inverse gamma distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} alpha - shape parameter\n\t* @param {PositiveNumber} beta - scale parameter\n\t* @throws {TypeError} `alpha` must be a positive number\n\t* @throws {TypeError} `beta` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( alpha, beta ) {\n\t\treturn new RandomStream( alpha, beta, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from an inverse gamma distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `alpha` must be a positive number\n\t* @throws {TypeError} `beta` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( alpha, beta, opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from an inverse gamma distribution.\n*\n* @module @stdlib/random/streams/invgamma\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/invgamma' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/invgamma' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/invgamma' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:kumaraswamy' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rkumaraswamy = require( './../../../base/kumaraswamy' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a Kumaraswamy's double bounded distribution.\n*\n* @constructor\n* @param {PositiveNumber} a - first shape parameter\n* @param {PositiveNumber} b - second shape parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `a` must be a positive number\n* @throws {TypeError} `b` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( a, b, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( a, b, options );\n\t\t}\n\t\treturn new RandomStream( a, b );\n\t}\n\tif ( !isPositiveNumber( a ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', a ) );\n\t}\n\tif ( !isPositiveNumber( b ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', b ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rkumaraswamy( a, b, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a Kumaraswamy's double bounded distribution.\n*\n* @param {PositiveNumber} a - first shape parameter\n* @param {PositiveNumber} b - second shape parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `a` must be a positive number\n* @throws {TypeError} `b` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( a, b, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( a, b, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a Kumaraswamy's double bounded distribution.\n*\n* @param {PositiveNumber} [a] - first shape parameter\n* @param {PositiveNumber} [b] - second shape parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( a, b, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( a ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', a ) );\n\t\t}\n\t\topts = assign( {}, a );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Kumaraswamy's double bounded distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} a - first shape parameter\n\t* @param {PositiveNumber} b - second shape parameter\n\t* @throws {TypeError} `a` must be a positive number\n\t* @throws {TypeError} `b` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( a, b ) {\n\t\treturn new RandomStream( a, b, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Kumaraswamy's double bounded distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `a` must be a positive number\n\t* @throws {TypeError} `b` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( a, b, opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from a Kumaraswamy's double bounded distribution.\n*\n* @module @stdlib/random/streams/kumaraswamy\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/kumaraswamy' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/kumaraswamy' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/kumaraswamy' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:laplace' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rlaplace = require( './../../../base/laplace' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar format = require( '@stdlib/string/format' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a Laplace (double exponential) distribution.\n*\n* @constructor\n* @param {number} mu - mean\n* @param {PositiveNumber} b - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `b` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( mu, b, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( mu, b, options );\n\t\t}\n\t\treturn new RandomStream( mu, b );\n\t}\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositiveNumber( b ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', b ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rlaplace( mu, b, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a Laplace (double exponential) distribution.\n*\n* @param {number} mu - mean\n* @param {PositiveNumber} b - scale parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `b` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( mu, b, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( mu, b, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a Laplace (double exponential) distribution.\n*\n* @param {number} [mu] - mean\n* @param {PositiveNumber} [b] - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( mu, b, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( mu ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', mu ) );\n\t\t}\n\t\topts = assign( {}, mu );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Laplace (double exponential) distribution.\n\t*\n\t* @private\n\t* @param {number} mu - mean\n\t* @param {PositiveNumber} b - scale parameter\n\t* @throws {TypeError} `mu` must be a number\n\t* @throws {TypeError} `b` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( mu, b ) {\n\t\treturn new RandomStream( mu, b, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Laplace (double exponential) distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `mu` must be a number\n\t* @throws {TypeError} `b` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( mu, b, opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from a Laplace (double exponential) distribution.\n*\n* @module @stdlib/random/streams/laplace\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/laplace' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/laplace' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/laplace' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:levy' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rlevy = require( './../../../base/levy' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a L\u00E9vy distribution.\n*\n* @constructor\n* @param {number} mu - mean\n* @param {PositiveNumber} c - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `c` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( mu, c, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( mu, c, options );\n\t\t}\n\t\treturn new RandomStream( mu, c );\n\t}\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositiveNumber( c ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', c ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rlevy( mu, c, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a L\u00E9vy distribution.\n*\n* @param {number} mu - mean\n* @param {PositiveNumber} c - scale parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `c` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( mu, c, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( mu, c, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a L\u00E9vy distribution.\n*\n* @param {number} [mu] - mean\n* @param {PositiveNumber} [c] - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( mu, c, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( mu ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', mu ) );\n\t\t}\n\t\topts = assign( {}, mu );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a L\u00E9vy distribution.\n\t*\n\t* @private\n\t* @param {number} mu - mean\n\t* @param {PositiveNumber} c - scale parameter\n\t* @throws {TypeError} `mu` must be a number\n\t* @throws {TypeError} `c` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( mu, c ) {\n\t\treturn new RandomStream( mu, c, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a L\u00E9vy distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `mu` must be a number\n\t* @throws {TypeError} `c` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( mu, c, opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from a L\u00E9vy distribution.\n*\n* @module @stdlib/random/streams/levy\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/levy' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/levy' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/levy' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:logistic' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rlogistic = require( './../../../base/logistic' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a logistic distribution.\n*\n* @constructor\n* @param {number} mu - mean\n* @param {PositiveNumber} s - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( mu, s, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( mu, s, options );\n\t\t}\n\t\treturn new RandomStream( mu, s );\n\t}\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositiveNumber( s ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', s ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rlogistic( mu, s, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a logistic distribution.\n*\n* @param {number} mu - mean\n* @param {PositiveNumber} s - scale parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `s` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( mu, s, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( mu, s, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a logistic distribution.\n*\n* @param {number} [mu] - mean\n* @param {PositiveNumber} [s] - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( mu, s, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( mu ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', mu ) );\n\t\t}\n\t\topts = assign( {}, mu );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a logistic distribution.\n\t*\n\t* @private\n\t* @param {number} mu - mean\n\t* @param {PositiveNumber} s - scale parameter\n\t* @throws {TypeError} `mu` must be a number\n\t* @throws {TypeError} `s` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( mu, s ) {\n\t\treturn new RandomStream( mu, s, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a logistic distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `mu` must be a number\n\t* @throws {TypeError} `s` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( mu, s, opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from a logistic distribution.\n*\n* @module @stdlib/random/streams/logistic\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/logistic' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/logistic' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/logistic' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:lognormal' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rlognormal = require( './../../../base/lognormal' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a lognormal distribution.\n*\n* @constructor\n* @param {number} mu - location parameter\n* @param {PositiveNumber} sigma - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `sigma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( mu, sigma, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( mu, sigma, options );\n\t\t}\n\t\treturn new RandomStream( mu, sigma );\n\t}\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositiveNumber( sigma ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', sigma ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rlognormal( mu, sigma, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a lognormal distribution.\n*\n* @param {number} mu - location parameter\n* @param {PositiveNumber} sigma - scale parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `sigma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( mu, sigma, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( mu, sigma, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a lognormal distribution.\n*\n* @param {number} [mu] - location parameter\n* @param {PositiveNumber} [sigma] - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( mu, sigma, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( mu ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', mu ) );\n\t\t}\n\t\topts = assign( {}, mu );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a lognormal distribution.\n\t*\n\t* @private\n\t* @param {number} mu - location parameter\n\t* @param {PositiveNumber} sigma - scale parameter\n\t* @throws {TypeError} `mu` must be a number\n\t* @throws {TypeError} `sigma` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( mu, sigma ) {\n\t\treturn new RandomStream( mu, sigma, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a lognormal distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `mu` must be a number\n\t* @throws {TypeError} `sigma` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( mu, sigma, opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from a lognormal distribution.\n*\n* @module @stdlib/random/streams/lognormal\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/lognormal' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 0.0, 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/lognormal' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 0.0, 2.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/lognormal' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 0.0, 2.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308,\n\t\"normalized\": false\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {boolean} [options.normalized] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'normalized' ) ) {\n\t\topts.normalized = options.normalized;\n\t\tif ( !isBoolean( opts.normalized ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'normalized', opts.normalized ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:minstd' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar minstd = require( './../../../base/minstd' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {PRNGSeedMINSTD} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {PositiveInteger} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {PositiveInteger} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {PositiveInteger} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {PRNGStateMINSTD} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMINSTD} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers via a linear congruential pseudorandom number generator (LCG) based on Park and Miller.\n*\n* @constructor\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {boolean} [options.normalized=false] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( options ) {\n\tvar prng;\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 0 ) {\n\t\t\treturn new RandomStream( options );\n\t\t}\n\t\treturn new RandomStream();\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 0 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tprng = minstd( opts );\n\tif ( opts.normalized ) {\n\t\tprng = prng.normalized;\n\t}\n\tsetNonEnumerableReadOnly( this, '_prng', prng );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {PRNGSeedMINSTD}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {PRNGStateMINSTD}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers via a linear congruential pseudorandom number generator (LCG) based on Park and Miller.\n*\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {boolean} [options.normalized=false] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers via a linear congruential pseudorandom number generator (LCG) based on Park and Miller.\n*\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {boolean} [options.normalized=false] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*/\nfunction factory( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\treturn createStream;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers via a linear congruential pseudorandom number generator (LCG) based on Park and Miller.\n\t*\n\t* @private\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream() {\n\t\treturn new RandomStream( opts );\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/**\n* Create a readable stream for generating pseudorandom numbers via a linear congruential pseudorandom number generator (LCG) based on Park and Miller.\n*\n* @module @stdlib/random/streams/minstd\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/minstd' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/minstd' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/minstd' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308,\n\t\"normalized\": false\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {boolean} [options.normalized] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'normalized' ) ) {\n\t\topts.normalized = options.normalized;\n\t\tif ( !isBoolean( opts.normalized ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'normalized', opts.normalized ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:minstd-shuffle' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar minstd = require( './../../../base/minstd-shuffle' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {PRNGSeedMINSTD} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {PositiveInteger} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {PositiveInteger} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {PositiveInteger} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {PRNGStateMINSTD} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMINSTD} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers via a linear congruential pseudorandom number generator (LCG) whose output is shuffled.\n*\n* @constructor\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {boolean} [options.normalized=false] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( options ) {\n\tvar prng;\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 0 ) {\n\t\t\treturn new RandomStream( options );\n\t\t}\n\t\treturn new RandomStream();\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 0 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tprng = minstd( opts );\n\tif ( opts.normalized ) {\n\t\tprng = prng.normalized;\n\t}\n\tsetNonEnumerableReadOnly( this, '_prng', prng );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {PRNGSeedMINSTD}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {PRNGStateMINSTD}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers via a linear congruential pseudorandom number generator (LCG) whose output is shuffled.\n*\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {boolean} [options.normalized=false] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers via a linear congruential pseudorandom number generator (LCG) whose output is shuffled.\n*\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {boolean} [options.normalized=false] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*/\nfunction factory( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\treturn createStream;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers via a linear congruential pseudorandom number generator (LCG) whose output is shuffled.\n\t*\n\t* @private\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream() {\n\t\treturn new RandomStream( opts );\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/**\n* Create a readable stream for generating pseudorandom numbers via a linear congruential pseudorandom number generator (LCG) whose output is shuffled.\n*\n* @module @stdlib/random/streams/minstd-shuffle\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/minstd-shuffle' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/minstd-shuffle' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/minstd-shuffle' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308,\n\t\"normalized\": false\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {boolean} [options.normalized] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'normalized' ) ) {\n\t\topts.normalized = options.normalized;\n\t\tif ( !isBoolean( opts.normalized ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'normalized', opts.normalized ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:mt19937' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar mt19937 = require( './../../../base/mt19937' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {PRNGSeedMT19937} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {PositiveInteger} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {PositiveInteger} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {PositiveInteger} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {PRNGStateMT19937} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers via a 32-bit Mersenne Twister pseudorandom number generator.\n*\n* @constructor\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {boolean} [options.normalized=false] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( options ) {\n\tvar prng;\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 0 ) {\n\t\t\treturn new RandomStream( options );\n\t\t}\n\t\treturn new RandomStream();\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 0 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tprng = mt19937( opts );\n\tif ( opts.normalized ) {\n\t\tprng = prng.normalized;\n\t}\n\tsetNonEnumerableReadOnly( this, '_prng', prng );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {PRNGSeedMT19937}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {PRNGStateMT19937}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers via a 32-bit Mersenne Twister pseudorandom number generator.\n*\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {boolean} [options.normalized=false] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers via a 32-bit Mersenne Twister pseudorandom number generator.\n*\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {boolean} [options.normalized=false] - boolean indicating whether to return pseudorandom numbers on the interval `[0,1)`\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*/\nfunction factory( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\treturn createStream;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers via a 32-bit Mersenne Twister pseudorandom number generator.\n\t*\n\t* @private\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream() {\n\t\treturn new RandomStream( opts );\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/**\n* Create a readable stream for generating pseudorandom numbers via a 32-bit Mersenne Twister pseudorandom number generator.\n*\n* @module @stdlib/random/streams/mt19937\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/mt19937' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/mt19937' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/mt19937' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isPlainObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:negative-binomial' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isProbability = require( '@stdlib/assert/is-probability' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rnbinom = require( './../../../base/negative-binomial' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a binomial distribution.\n*\n* @constructor\n* @param {PositiveNumber} r - number of successes until experiment is stopped\n* @param {Probability} p - success probability\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `r` must be a positive number\n* @throws {TypeError} `p` must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 20.0, 0.2, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( r, p, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( r, p, options );\n\t\t}\n\t\treturn new RandomStream( r, p );\n\t}\n\tif ( !isPositiveNumber( r ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', r ) );\n\t}\n\tif ( !isProbability( p ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a probability. Value: `%s`.', p ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rnbinom( r, p, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a negative binomial distribution.\n*\n* @param {PositiveNumber} r - number of successes until experiment is stopped\n* @param {Probability} p - success probability\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `r` must be a positive number\n* @throws {TypeError} `p` must be a probability\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 20.0, 0.1, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( r, p, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isPlainObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( r, p, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a negative binomial distribution.\n*\n* @param {PositiveNumber} [r] - number of successes until experiment is stopped\n* @param {Probability} [p] - second shape parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 20.0, 0.5 ) );\n* }\n*/\nfunction factory( r, p, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( r ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', r ) );\n\t\t}\n\t\topts = assign( {}, r );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a negative binomial distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} r - number of trials\n\t* @param {Probability} p - success probability\n\t* @throws {TypeError} `r` must be a positive number\n\t* @throws {TypeError} `p` must be a positive probability\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( r, p ) {\n\t\treturn new RandomStream( r, p, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a negative binomial distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `r` must be a positive number\n\t* @throws {TypeError} `p` must be a probability\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( r, p, opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from a negative binomial distribution.\n*\n* @module @stdlib/random/streams/negative-binomial\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/negative-binomial' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 20.0, 0.4, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/negative-binomial' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 20.0, 0.4 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/negative-binomial' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 20.0, 0.4, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:normal' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rnorm = require( './../../../base/normal' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a normal distribution.\n*\n* @constructor\n* @param {number} mu - mean\n* @param {PositiveNumber} sigma - standard deviation\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `sigma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( mu, sigma, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( mu, sigma, options );\n\t\t}\n\t\treturn new RandomStream( mu, sigma );\n\t}\n\tif ( !isNumber( mu ) || isnan( mu ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', mu ) );\n\t}\n\tif ( !isPositiveNumber( sigma ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', sigma ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rnorm( mu, sigma, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a normal distribution.\n*\n* @param {number} mu - mean\n* @param {PositiveNumber} sigma - standard deviation\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `mu` must be a number\n* @throws {TypeError} `sigma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( mu, sigma, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( mu, sigma, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a normal distribution.\n*\n* @param {number} [mu] - mean\n* @param {PositiveNumber} [sigma] - standard deviation\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( mu, sigma, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( mu ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', mu ) );\n\t\t}\n\t\topts = assign( {}, mu );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a normal distribution.\n\t*\n\t* @private\n\t* @param {number} mu - mean\n\t* @param {PositiveNumber} sigma - standard deviation\n\t* @throws {TypeError} `mu` must be a number\n\t* @throws {TypeError} `sigma` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( mu, sigma ) {\n\t\treturn new RandomStream( mu, sigma, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a normal distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `mu` must be a number\n\t* @throws {TypeError} `sigma` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( mu, sigma, opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from a normal distribution.\n*\n* @module @stdlib/random/streams/normal\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/normal' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 0.0, 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/normal' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 0.0, 2.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/normal' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 0.0, 2.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isPlainObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:pareto1' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rpareto1 = require( './../../../base/pareto-type1' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a Pareto (Type I) distribution.\n*\n* @constructor\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( alpha, beta, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( alpha, beta, options );\n\t\t}\n\t\treturn new RandomStream( alpha, beta );\n\t}\n\tif ( !isPositiveNumber( alpha ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositiveNumber( beta ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rpareto1( alpha, beta, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a Pareto (Type I) distribution.\n*\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - scale parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( alpha, beta, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isPlainObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( alpha, beta, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a Pareto (Type I) distribution.\n*\n* @param {PositiveNumber} [alpha] - shape parameter\n* @param {PositiveNumber} [beta] - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( alpha, beta, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( alpha ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', alpha ) );\n\t\t}\n\t\topts = assign( {}, alpha );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Pareto (Type I) distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} alpha - shape parameter\n\t* @param {PositiveNumber} beta - scale parameter\n\t* @throws {TypeError} `alpha` must be a positive number\n\t* @throws {TypeError} `beta` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( alpha, beta ) {\n\t\treturn new RandomStream( alpha, beta, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Pareto (Type I) distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `alpha` must be a positive number\n\t* @throws {TypeError} `beta` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( alpha, beta, opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from a Pareto (Type I) distribution.\n*\n* @module @stdlib/random/streams/pareto-type1\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/pareto-type1' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/pareto-type1' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/pareto-type1' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:poisson' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rpoisson = require( './../../../base/poisson' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar format = require( '@stdlib/string/format' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a Poisson distribution.\n*\n* @constructor\n* @param {PositiveNumber} lambda - mean\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( lambda, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 1 ) {\n\t\t\treturn new RandomStream( lambda, options );\n\t\t}\n\t\treturn new RandomStream( lambda );\n\t}\n\tif ( !isPositiveNumber( lambda ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', lambda ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rpoisson( lambda, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a Poisson distribution.\n*\n* @param {PositiveNumber} lambda - mean\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( lambda, options ) {\n\tvar opts;\n\tif ( arguments.length > 1 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( lambda, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a Poisson distribution.\n*\n* @param {PositiveNumber} [lambda] - mean\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 3.0 ) );\n* }\n*/\nfunction factory( lambda, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs > 1 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\tfcn = createStream2;\n\t\topts = assign( {}, options );\n\t} else if ( nargs === 1 ) {\n\t\tif ( isPositive( lambda ) ) {\n\t\t\tfcn = createStream2;\n\t\t\topts = {};\n\t\t} else {\n\t\t\tif ( !isPlainObject( lambda ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', lambda ) );\n\t\t\t}\n\t\t\topts = assign( {}, lambda );\n\t\t\tfcn = createStream1;\n\t\t}\n\t} else {\n\t\topts = {};\n\t\tfcn = createStream1;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Poisson distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} lambda - mean\n\t* @throws {TypeError} `lambda` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( lambda ) {\n\t\treturn new RandomStream( lambda, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Poisson distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `lambda` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( lambda, opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from a Poisson distribution.\n*\n* @module @stdlib/random/streams/poisson\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/poisson' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/poisson' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/poisson' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308,\n\t\"name\": \"mt19937\"\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {string} [options.name] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'name' ) ) {\n\t\topts.name = options.name;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:randi' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar randi = require( './../../../base/randi' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {*} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {PositiveInteger} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {PositiveInteger} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {PositiveInteger} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {*} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {*} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers having integer values.\n*\n* @constructor\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {string} [options.name='mt19937'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 0 ) {\n\t\t\treturn new RandomStream( options );\n\t\t}\n\t\treturn new RandomStream();\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 0 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', randi( opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {*}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {*}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers having integer values.\n*\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {string} [options.name='mt19937'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers having integer values.\n*\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {string} [options.name='mt19937'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*/\nfunction factory( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\treturn createStream;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers having integer values.\n\t*\n\t* @private\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream() {\n\t\treturn new RandomStream( opts );\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/**\n* Create a readable stream for generating pseudorandom numbers having integer values.\n*\n* @module @stdlib/random/streams/randi\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/randi' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/randi' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/randi' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308,\n\t\"name\": \"improved-ziggurat\"\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {string} [options.name] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'name' ) ) {\n\t\topts.name = options.name;\n\t}\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:randn' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar randn = require( './../../../base/randn' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a standard normal distribution.\n*\n* @constructor\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {string} [options.name='improved-ziggurat'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 0 ) {\n\t\t\treturn new RandomStream( options );\n\t\t}\n\t\treturn new RandomStream();\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 0 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', randn( opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a standard normal distribution.\n*\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {string} [options.name='improved-ziggurat'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a standard normal distribution.\n*\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {string} [options.name='improved-ziggurat'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*/\nfunction factory( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\treturn createStream;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a standard normal distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream() {\n\t\treturn new RandomStream( opts );\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/**\n* Create a readable stream for generating pseudorandom numbers from a standard normal distribution.\n*\n* @module @stdlib/random/streams/randn\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/randn' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/randn' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/randn' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308,\n\t\"name\": \"mt19937\"\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {string} [options.name] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'name' ) ) {\n\t\topts.name = options.name;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:randu' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar randu = require( './../../../base/randu' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {*} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {PositiveInteger} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {PositiveInteger} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {PositiveInteger} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {*} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {*} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of uniformly distributed pseudorandom numbers between `0` and `1`.\n*\n* @constructor\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {string} [options.name='mt19937'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 0 ) {\n\t\t\treturn new RandomStream( options );\n\t\t}\n\t\treturn new RandomStream();\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 0 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', randu( opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {*}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {*}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {PositiveInteger}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating uniformly distributed pseudorandom numbers between `0` and `1`.\n*\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {string} [options.name='mt19937'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate uniformly distributed pseudorandom numbers between `0` and `1`.\n*\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {Function} [options.name='mt19937'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*/\nfunction factory( options ) {\n\tvar opts;\n\tif ( arguments.length > 0 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\treturn createStream;\n\n\t/**\n\t* Returns a readable stream for generating uniformly distributed pseudorandom numbers between `0` and `1`.\n\t*\n\t* @private\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream() {\n\t\treturn new RandomStream( opts );\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/**\n* Create a readable stream for generating uniformly distributed pseudorandom numbers between `0` and `1`.\n*\n* @module @stdlib/random/streams/randu\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/randu' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/randu' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream() );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/randu' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:rayleigh' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rrayleigh = require( './../../../base/rayleigh' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a Rayleigh distribution.\n*\n* @constructor\n* @param {PositiveNumber} sigma - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `sigma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( sigma, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 1 ) {\n\t\t\treturn new RandomStream( sigma, options );\n\t\t}\n\t\treturn new RandomStream( sigma );\n\t}\n\tif ( !isPositiveNumber( sigma ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', sigma ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rrayleigh( sigma, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a Rayleigh distribution.\n*\n* @param {PositiveNumber} sigma - scale parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `sigma` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( sigma, options ) {\n\tvar opts;\n\tif ( arguments.length > 1 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( sigma, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a Rayleigh distribution.\n*\n* @param {PositiveNumber} [sigma] - scale parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 3.0 ) );\n* }\n*/\nfunction factory( sigma, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs > 1 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\tfcn = createStream2;\n\t\topts = assign( {}, options );\n\t} else if ( nargs === 1 ) {\n\t\tif ( isPositive( sigma ) ) {\n\t\t\tfcn = createStream2;\n\t\t\topts = {};\n\t\t} else {\n\t\t\tif ( !isPlainObject( sigma ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', sigma ) );\n\t\t\t}\n\t\t\topts = assign( {}, sigma );\n\t\t\tfcn = createStream1;\n\t\t}\n\t} else {\n\t\topts = {};\n\t\tfcn = createStream1;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Rayleigh distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} sigma - scale parameter\n\t* @throws {TypeError} `sigma` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( sigma ) {\n\t\treturn new RandomStream( sigma, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Rayleigh distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `sigma` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( sigma, opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from a Rayleigh distribution.\n*\n* @module @stdlib/random/streams/rayleigh\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/rayleigh' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/rayleigh' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/rayleigh' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:t' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rt = require( './../../../base/t' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a Student's t distribution.\n*\n* @constructor\n* @param {PositiveNumber} v - degrees of freedom\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `v` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( v, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 1 ) {\n\t\t\treturn new RandomStream( v, options );\n\t\t}\n\t\treturn new RandomStream( v );\n\t}\n\tif ( !isPositiveNumber( v ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', v ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 1 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rt( v, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a Student's t distribution.\n*\n* @param {PositiveNumber} v - degrees of freedom\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `v` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( v, options ) {\n\tvar opts;\n\tif ( arguments.length > 1 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( v, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPositive = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a Student's t distribution.\n*\n* @param {PositiveNumber} [v] - degrees of freedom\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 3.0 ) );\n* }\n*/\nfunction factory( v, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs > 1 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\tfcn = createStream2;\n\t\topts = assign( {}, options );\n\t} else if ( nargs === 1 ) {\n\t\tif ( isPositive( v ) ) {\n\t\t\tfcn = createStream2;\n\t\t\topts = {};\n\t\t} else {\n\t\t\tif ( !isPlainObject( v ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', v ) );\n\t\t\t}\n\t\t\topts = assign( {}, v );\n\t\t\tfcn = createStream1;\n\t\t}\n\t} else {\n\t\topts = {};\n\t\tfcn = createStream1;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Student's t distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} v - degrees of freedom\n\t* @throws {TypeError} `v` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( v ) {\n\t\treturn new RandomStream( v, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Student's t distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `v` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( v, opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from a Student's t distribution.\n*\n* @module @stdlib/random/streams/t\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/t' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/t' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/t' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:triangular' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rtriang = require( './../../../base/triangular' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a uniform distribution.\n*\n* @constructor\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {number} c - mode\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {TypeError} `c` must be a number\n* @throws {RangeError} arguments must satisfy `a <= c <= b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( a, b, c, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 3 ) {\n\t\t\treturn new RandomStream( a, b, c, options );\n\t\t}\n\t\treturn new RandomStream( a, b, c );\n\t}\n\tif ( !isNumber( a ) || isnan( a ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', a ) );\n\t}\n\tif ( !isNumber( b ) || isnan( b ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a number and not NaN. Value: `%s`.', b ) );\n\t}\n\tif ( !isNumber( c ) || isnan( c ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a number and not NaN. Value: `%s`.', c ) );\n\t}\n\tif ( !(a <= c && c <= b) ) {\n\t\tthrow new RangeError( format( 'invalid arguments. Parameters must satisfy the following condition: %s. a: `%f`. b: `%f`. c: `%f`.', 'a <= c <= b', a, b, c ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 3 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rtriang( a, b, c, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a triangular distribution.\n*\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {number} c - mode\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {TypeError} `c` must be a number\n* @throws {RangeError} arguments must satisfy `a <= c <= b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 5.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( a, b, c, options ) {\n\tvar opts;\n\tif ( arguments.length > 3 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( a, b, c, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a triangular distribution.\n*\n* @param {number} [a] - minimum support\n* @param {number} [b] - maximum support\n* @param {number} [c] - mode\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0, 4.0 ) );\n* }\n*/\nfunction factory( a, b, c, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( a ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', a ) );\n\t\t}\n\t\topts = assign( {}, a );\n\t} else if ( nargs > 3 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 3 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a triangular distribution.\n\t*\n\t* @private\n\t* @param {number} a - minimum support\n\t* @param {number} b - maximum support\n\t* @param {number} c - mode\n\t* @throws {TypeError} `a` must be a number\n\t* @throws {TypeError} `b` must be a number\n\t* @throws {TypeError} `c` must be a number\n\t* @throws {RangeError} arguments must satisfy `a <= c <= b`\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( a, b, c ) {\n\t\treturn new RandomStream( a, b, c, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a triangular distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `a` must be a number\n\t* @throws {TypeError} `b` must be a number\n\t* @throws {TypeError} `c` must be a number\n\t* @throws {RangeError} arguments must satisfy `a <= c <= b`\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( a, b, c, opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from a triangular distribution.\n*\n* @module @stdlib/random/streams/triangular\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/triangular' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 5.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/triangular' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/triangular' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 5.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:uniform' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar runiform = require( './../../../base/uniform' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar format = require( '@stdlib/string/format' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a uniform distribution.\n*\n* @constructor\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {RangeError} `a` must be less than `b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( a, b, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( a, b, options );\n\t\t}\n\t\treturn new RandomStream( a, b );\n\t}\n\tif ( !isNumber( a ) || isnan( a ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number and not NaN. Value: `%s`.', a ) );\n\t}\n\tif ( !isNumber( b ) || isnan( b ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a number and not NaN. Value: `%s`.', b ) );\n\t}\n\tif ( a >= b ) {\n\t\tthrow new RangeError( format( 'invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.', a, b ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', runiform( a, b, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a uniform distribution.\n*\n* @param {number} a - minimum support\n* @param {number} b - maximum support\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `a` must be a number\n* @throws {TypeError} `b` must be a number\n* @throws {RangeError} `a` must be less than `b`\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( a, b, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( a, b, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a uniform distribution.\n*\n* @param {number} [a] - minimum support\n* @param {number} [b] - maximum support\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( a, b, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( a ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', a ) );\n\t\t}\n\t\topts = assign( {}, a );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a uniform distribution.\n\t*\n\t* @private\n\t* @param {number} a - minimum support\n\t* @param {number} b - maximum support\n\t* @throws {TypeError} `a` must be a number\n\t* @throws {TypeError} `b` must be a number\n\t* @throws {RangeError} `a` must be less than `b`\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( a, b ) {\n\t\treturn new RandomStream( a, b, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a uniform distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `a` must be a number\n\t* @throws {TypeError} `b` must be a number\n\t* @throws {RangeError} `a` must be less than `b`\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( a, b, opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from a uniform distribution.\n*\n* @module @stdlib/random/streams/uniform\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/uniform' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/uniform' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/uniform' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "{\n\t\"objectMode\": false,\n\t\"encoding\": null,\n\t\"sep\": \"\\n\",\n\t\"copy\": true,\n\t\"siter\": 1e308\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'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert/is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert/has-own-property' );\nvar isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert/is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert/is-string' ).isPrimitive;\nvar isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert/is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.sep] - separator used to join streamed data\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in the internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @returns {(Error|null)} null or an error object\n*\n* @example\n* var opts = {};\n* var options = {\n* 'objectMode': true\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'sep' ) ) {\n\t\topts.sep = options.sep;\n\t\tif ( !isString( opts.sep ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'sep', opts.sep ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'encoding' ) ) {\n\t\topts.encoding = options.encoding;\n\t\tif ( !isString( opts.encoding ) && opts.encoding !== null ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string or null. Option: `%s`.', 'encoding', opts.encoding ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'iter' ) ) {\n\t\topts.iter = options.iter;\n\t\tif ( !isNonNegativeInteger( opts.iter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'iter', opts.iter ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'siter' ) ) {\n\t\topts.siter = options.siter;\n\t\tif ( !isPositiveInteger( opts.siter ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'siter', opts.siter ) );\n\t\t}\n\t}\n\t// Pass through options...\n\tif ( hasOwnProp( options, 'prng' ) ) {\n\t\topts.prng = options.prng;\n\t}\n\tif ( hasOwnProp( options, 'seed' ) ) {\n\t\topts.seed = options.seed;\n\t}\n\tif ( hasOwnProp( options, 'state' ) ) {\n\t\topts.state = options.state;\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 logger = require( 'debug' );\n\n\n// MAIN //\n\nvar debug = logger( 'random:streams:weibull' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\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 Readable = require( 'readable-stream' ).Readable;\nvar isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive;\nvar isError = require( '@stdlib/assert/is-error' );\nvar assign = require( '@stdlib/object/assign' );\nvar inherit = require( '@stdlib/utils/inherit' );\nvar setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' );\nvar setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' );\nvar rweibull = require( './../../../base/weibull' ).factory;\nvar string2buffer = require( '@stdlib/buffer/from-string' );\nvar format = require( '@stdlib/string/format' );\nvar nextTick = require( '@stdlib/utils/next-tick' );\nvar DEFAULTS = require( './defaults.json' );\nvar validate = require( './validate.js' );\nvar debug = require( './debug.js' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns the PRNG seed.\n*\n* @private\n* @returns {(PRNGSeedMT19937|null)} seed\n*/\nfunction getSeed() {\n\treturn this._prng.seed; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG seed length.\n*\n* @private\n* @returns {(PositiveInteger|null)} seed length\n*/\nfunction getSeedLength() {\n\treturn this._prng.seedLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state length.\n*\n* @private\n* @returns {(PositiveInteger|null)} state length\n*/\nfunction getStateLength() {\n\treturn this._prng.stateLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the PRNG state size (in bytes).\n*\n* @private\n* @returns {(PositiveInteger|null)} state size (in bytes)\n*/\nfunction getStateSize() {\n\treturn this._prng.byteLength; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Returns the current PRNG state.\n*\n* @private\n* @returns {(PRNGStateMT19937|null)} current state\n*/\nfunction getState() {\n\treturn this._prng.state; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Sets the PRNG state.\n*\n* @private\n* @param {PRNGStateMT19937} s - generator state\n* @throws {Error} must provide a valid state\n*/\nfunction setState( s ) {\n\tthis._prng.state = s; // eslint-disable-line no-invalid-this\n}\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nfunction read() {\n\t/* eslint-disable no-invalid-this */\n\tvar FLG;\n\tvar r;\n\n\tif ( this._destroyed ) {\n\t\treturn;\n\t}\n\tFLG = true;\n\twhile ( FLG ) {\n\t\tthis._i += 1;\n\t\tif ( this._i > this._iter ) {\n\t\t\tdebug( 'Finished generating pseudorandom numbers.' );\n\t\t\treturn this.push( null );\n\t\t}\n\t\tr = this._prng();\n\n\t\tdebug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i );\n\n\t\tif ( this._objectMode === false ) {\n\t\t\tr = r.toString();\n\t\t\tif ( this._i === 1 ) {\n\t\t\t\tr = string2buffer( r );\n\t\t\t} else {\n\t\t\t\tr = string2buffer( this._sep+r );\n\t\t\t}\n\t\t}\n\t\tFLG = this.push( r );\n\t\tif ( this._i%this._siter === 0 ) {\n\t\t\tthis.emit( 'state', this.state );\n\t\t}\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @private\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nfunction destroy( error ) {\n\t/* eslint-disable no-invalid-this */\n\tvar self;\n\tif ( this._destroyed ) {\n\t\tdebug( 'Attempted to destroy an already destroyed stream.' );\n\t\treturn this;\n\t}\n\tself = this;\n\tthis._destroyed = true;\n\n\tnextTick( close );\n\n\treturn this;\n\n\t/**\n\t* Closes a stream.\n\t*\n\t* @private\n\t*/\n\tfunction close() {\n\t\tif ( error ) {\n\t\t\tdebug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) );\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tdebug( 'Closing the stream...' );\n\t\tself.emit( 'close' );\n\t}\n\n\t/* eslint-enable no-invalid-this */\n}\n\n\n// MAIN //\n\n/**\n* Stream constructor for generating a stream of pseudorandom numbers drawn from a Weibull distribution.\n*\n* @constructor\n* @param {PositiveNumber} k - scale parameter\n* @param {PositiveNumber} lambda - shape parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `k` must be a positive number\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = new RandomStream( 2.0, 5.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*/\nfunction RandomStream( k, lambda, options ) {\n\tvar opts;\n\tvar err;\n\tif ( !( this instanceof RandomStream ) ) {\n\t\tif ( arguments.length > 2 ) {\n\t\t\treturn new RandomStream( k, lambda, options );\n\t\t}\n\t\treturn new RandomStream( k, lambda );\n\t}\n\tif ( !isPositiveNumber( k ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', k ) );\n\t}\n\tif ( !isPositiveNumber( lambda ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', lambda ) );\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 2 ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Make the stream a readable stream:\n\tdebug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tReadable.call( this, opts );\n\n\t// Destruction state:\n\tsetNonEnumerable( this, '_destroyed', false );\n\n\t// Cache whether the stream is operating in object mode:\n\tsetNonEnumerableReadOnly( this, '_objectMode', opts.objectMode );\n\n\t// Cache the separator:\n\tsetNonEnumerableReadOnly( this, '_sep', opts.sep );\n\n\t// Cache the total number of iterations:\n\tsetNonEnumerableReadOnly( this, '_iter', opts.iter );\n\n\t// Cache the number of iterations after which to emit the underlying PRNG state:\n\tsetNonEnumerableReadOnly( this, '_siter', opts.siter );\n\n\t// Initialize an iteration counter:\n\tsetNonEnumerable( this, '_i', 0 );\n\n\t// Create the underlying PRNG:\n\tsetNonEnumerableReadOnly( this, '_prng', rweibull( k, lambda, opts ) );\n\tsetNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG );\n\n\treturn this;\n}\n\n/*\n* Inherit from the `Readable` prototype.\n*/\ninherit( RandomStream, Readable );\n\n/**\n* PRNG seed.\n*\n* @name seed\n* @memberof RandomStream.prototype\n* @type {(PRNGSeedMT19937|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed );\n\n/**\n* PRNG seed length.\n*\n* @name seedLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength );\n\n/**\n* PRNG state getter/setter.\n*\n* @name state\n* @memberof RandomStream.prototype\n* @type {(PRNGStateMT19937|null)}\n* @throws {Error} must provide a valid state\n*/\nsetReadWriteAccessor( RandomStream.prototype, 'state', getState, setState );\n\n/**\n* PRNG state length.\n*\n* @name stateLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength );\n\n/**\n* PRNG state size (in bytes).\n*\n* @name byteLength\n* @memberof RandomStream.prototype\n* @type {(PositiveInteger|null)}\n*/\nsetReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize );\n\n/**\n* Implements the `_read` method.\n*\n* @private\n* @name _read\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {number} size - number (of bytes) to read\n* @returns {void}\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, '_read', read );\n\n/**\n* Gracefully destroys a stream, providing backward compatibility.\n*\n* @name destroy\n* @memberof RandomStream.prototype\n* @type {Function}\n* @param {(string|Object|Error)} [error] - error\n* @returns {RandomStream} Stream instance\n*/\nsetNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy );\n\n\n// EXPORTS //\n\nmodule.exports = RandomStream;\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 isObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns an \"objectMode\" readable stream for generating pseudorandom numbers drawn from a Weibull distribution.\n*\n* @param {PositiveNumber} k - scale parameter\n* @param {PositiveNumber} lambda - shape parameter\n* @param {Options} [options] - stream options\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of objects to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} `k` must be a positive number\n* @throws {TypeError} `lambda` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {RandomStream} Stream instance\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = objectMode( 2.0, 1.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\nfunction objectMode( k, lambda, options ) {\n\tvar opts;\n\tif ( arguments.length > 2 ) {\n\t\topts = options;\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\treturn new RandomStream( k, lambda, opts );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\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 isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar assign = require( '@stdlib/object/assign' );\nvar format = require( '@stdlib/string/format' );\nvar RandomStream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function for creating readable streams which generate pseudorandom numbers drawn from a Weibull distribution.\n*\n* @param {PositiveNumber} [k] - scale parameter\n* @param {PositiveNumber} [lambda] - shape parameter\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether a stream should operate in object mode\n* @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to `strings`\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers\n* @param {string} [options.sep='\\n'] - separator used to join streamed data\n* @param {NonNegativeInteger} [options.iter] - number of iterations\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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* @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state\n* @throws {TypeError} options argument must be an object\n* @returns {Function} stream factory\n*\n* @example\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 5.0 ) );\n* }\n*/\nfunction factory( k, lambda, options ) {\n\tvar nargs;\n\tvar opts;\n\tvar fcn;\n\n\tnargs = arguments.length;\n\tif ( nargs === 1 ) {\n\t\tif ( !isPlainObject( k ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', k ) );\n\t\t}\n\t\topts = assign( {}, k );\n\t} else if ( nargs > 2 ) {\n\t\tif ( !isPlainObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\tif ( nargs < 2 ) {\n\t\tfcn = createStream1;\n\t} else {\n\t\tfcn = createStream2;\n\t}\n\treturn fcn;\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Weibull distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} k - scale parameter\n\t* @param {PositiveNumber} lambda - shape parameter\n\t* @throws {TypeError} `k` must be a positive number\n\t* @throws {TypeError} `lambda` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream1( k, lambda ) {\n\t\treturn new RandomStream( k, lambda, opts );\n\t}\n\n\t/**\n\t* Returns a readable stream for generating pseudorandom numbers drawn from a Weibull distribution.\n\t*\n\t* @private\n\t* @throws {TypeError} `k` must be a positive number\n\t* @throws {TypeError} `lambda` must be a positive number\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {RandomStream} Stream instance\n\t*/\n\tfunction createStream2() {\n\t\treturn new RandomStream( k, lambda, opts );\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/**\n* Create a readable stream for generating pseudorandom numbers drawn from a Weibull distribution.\n*\n* @module @stdlib/random/streams/weibull\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/weibull' );\n*\n* function log( chunk ) {\n* console.log( chunk.toString() );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream( log ) );\n*\n* @example\n* var randomStream = require( '@stdlib/random/streams/weibull' );\n*\n* var opts = {\n* 'sep': ',',\n* 'objectMode': false,\n* 'encoding': 'utf8',\n* 'highWaterMark': 64\n* };\n*\n* var createStream = randomStream.factory( opts );\n*\n* // Create 10 identically configured streams...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( createStream( 2.0, 4.0 ) );\n* }\n*\n* @example\n* var inspectStream = require( '@stdlib/streams/node/inspect-sink' );\n* var randomStream = require( '@stdlib/random/streams/weibull' );\n*\n* function log( v ) {\n* console.log( v );\n* }\n*\n* var opts = {\n* 'iter': 10\n* };\n*\n* var stream = randomStream.objectMode( 2.0, 4.0, opts );\n*\n* stream.pipe( inspectStream.objectMode( log ) );\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\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* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-read-only-property' );\n\n\n// MAIN //\n\n/**\n* Top-level namespace.\n*\n* @namespace ns\n*/\nvar ns = {};\n\n/**\n* @name arcsine\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/arcsine}\n*/\nsetReadOnly( ns, 'arcsine', require( './../../streams/arcsine' ) );\n\n/**\n* @name bernoulli\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/bernoulli}\n*/\nsetReadOnly( ns, 'bernoulli', require( './../../streams/bernoulli' ) );\n\n/**\n* @name beta\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/beta}\n*/\nsetReadOnly( ns, 'beta', require( './../../streams/beta' ) );\n\n/**\n* @name betaprime\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/betaprime}\n*/\nsetReadOnly( ns, 'betaprime', require( './../../streams/betaprime' ) );\n\n/**\n* @name binomial\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/binomial}\n*/\nsetReadOnly( ns, 'binomial', require( './../../streams/binomial' ) );\n\n/**\n* @name boxMuller\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/box-muller}\n*/\nsetReadOnly( ns, 'boxMuller', require( './../../streams/box-muller' ) );\n\n/**\n* @name cauchy\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/cauchy}\n*/\nsetReadOnly( ns, 'cauchy', require( './../../streams/cauchy' ) );\n\n/**\n* @name chi\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/chi}\n*/\nsetReadOnly( ns, 'chi', require( './../../streams/chi' ) );\n\n/**\n* @name chisquare\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/chisquare}\n*/\nsetReadOnly( ns, 'chisquare', require( './../../streams/chisquare' ) );\n\n/**\n* @name cosine\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/cosine}\n*/\nsetReadOnly( ns, 'cosine', require( './../../streams/cosine' ) );\n\n/**\n* @name discreteUniform\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/discrete-uniform}\n*/\nsetReadOnly( ns, 'discreteUniform', require( './../../streams/discrete-uniform' ) );\n\n/**\n* @name erlang\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/erlang}\n*/\nsetReadOnly( ns, 'erlang', require( './../../streams/erlang' ) );\n\n/**\n* @name exponential\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/exponential}\n*/\nsetReadOnly( ns, 'exponential', require( './../../streams/exponential' ) );\n\n/**\n* @name f\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/f}\n*/\nsetReadOnly( ns, 'f', require( './../../streams/f' ) );\n\n/**\n* @name frechet\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/frechet}\n*/\nsetReadOnly( ns, 'frechet', require( './../../streams/frechet' ) );\n\n/**\n* @name gamma\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/gamma}\n*/\nsetReadOnly( ns, 'gamma', require( './../../streams/gamma' ) );\n\n/**\n* @name geometric\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/geometric}\n*/\nsetReadOnly( ns, 'geometric', require( './../../streams/geometric' ) );\n\n/**\n* @name gumbel\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/gumbel}\n*/\nsetReadOnly( ns, 'gumbel', require( './../../streams/gumbel' ) );\n\n/**\n* @name hypergeometric\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/hypergeometric}\n*/\nsetReadOnly( ns, 'hypergeometric', require( './../../streams/hypergeometric' ) );\n\n/**\n* @name improvedZiggurat\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/improved-ziggurat}\n*/\nsetReadOnly( ns, 'improvedZiggurat', require( './../../streams/improved-ziggurat' ) );\n\n/**\n* @name invgamma\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/invgamma}\n*/\nsetReadOnly( ns, 'invgamma', require( './../../streams/invgamma' ) );\n\n/**\n* @name kumaraswamy\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/kumaraswamy}\n*/\nsetReadOnly( ns, 'kumaraswamy', require( './../../streams/kumaraswamy' ) );\n\n/**\n* @name laplace\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/laplace}\n*/\nsetReadOnly( ns, 'laplace', require( './../../streams/laplace' ) );\n\n/**\n* @name levy\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/levy}\n*/\nsetReadOnly( ns, 'levy', require( './../../streams/levy' ) );\n\n/**\n* @name logistic\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/logistic}\n*/\nsetReadOnly( ns, 'logistic', require( './../../streams/logistic' ) );\n\n/**\n* @name lognormal\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/lognormal}\n*/\nsetReadOnly( ns, 'lognormal', require( './../../streams/lognormal' ) );\n\n/**\n* @name minstd\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/minstd}\n*/\nsetReadOnly( ns, 'minstd', require( './../../streams/minstd' ) );\n\n/**\n* @name minstdShuffle\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/minstd-shuffle}\n*/\nsetReadOnly( ns, 'minstdShuffle', require( './../../streams/minstd-shuffle' ) );\n\n/**\n* @name mt19937\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/mt19937}\n*/\nsetReadOnly( ns, 'mt19937', require( './../../streams/mt19937' ) );\n\n/**\n* @name negativeBinomial\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/negative-binomial}\n*/\nsetReadOnly( ns, 'negativeBinomial', require( './../../streams/negative-binomial' ) );\n\n/**\n* @name normal\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/normal}\n*/\nsetReadOnly( ns, 'normal', require( './../../streams/normal' ) );\n\n/**\n* @name pareto1\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/pareto-type1}\n*/\nsetReadOnly( ns, 'pareto1', require( './../../streams/pareto-type1' ) );\n\n/**\n* @name poisson\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/poisson}\n*/\nsetReadOnly( ns, 'poisson', require( './../../streams/poisson' ) );\n\n/**\n* @name randi\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/randi}\n*/\nsetReadOnly( ns, 'randi', require( './../../streams/randi' ) );\n\n/**\n* @name randn\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/randn}\n*/\nsetReadOnly( ns, 'randn', require( './../../streams/randn' ) );\n\n/**\n* @name randu\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/randu}\n*/\nsetReadOnly( ns, 'randu', require( './../../streams/randu' ) );\n\n/**\n* @name rayleigh\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/rayleigh}\n*/\nsetReadOnly( ns, 'rayleigh', require( './../../streams/rayleigh' ) );\n\n/**\n* @name t\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/t}\n*/\nsetReadOnly( ns, 't', require( './../../streams/t' ) );\n\n/**\n* @name triangular\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/triangular}\n*/\nsetReadOnly( ns, 'triangular', require( './../../streams/triangular' ) );\n\n/**\n* @name uniform\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/uniform}\n*/\nsetReadOnly( ns, 'uniform', require( './../../streams/uniform' ) );\n\n/**\n* @name weibull\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/streams/weibull}\n*/\nsetReadOnly( ns, 'weibull', require( './../../streams/weibull' ) );\n\n\n// EXPORTS //\n\nmodule.exports = ns;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 isAccessorArray = require( '@stdlib/array/base/assert/is-accessor-array' );\nvar random = require( './../../../base/arcsine' );\n\n\n// MAIN //\n\n/**\n* Returns a function for generating pseudorandom numbers.\n*\n* ## Notes\n*\n* - The returned object has the following properties:\n*\n* - **arity**: number of function parameters.\n* - **fcn**: function for generating pseudorandom numbers.\n*\n* @private\n* @param {Collection} x - first parameter\n* @param {integer} sx - `x` stride length\n* @param {NonNegativeInteger} ox - starting `x` index\n* @param {Collection} y - second parameter\n* @param {integer} sy - `y` stride length\n* @param {NonNegativeInteger} oy - starting `y` index\n* @param {boolean} hasOptions - boolean indicating whether to process an options argument\n* @param {(void|Options)} options - function options\n* @returns {Object} function object\n*/\nfunction clbk( x, sx, ox, y, sy, oy, hasOptions, options ) {\n\tvar out;\n\tvar v1;\n\tvar v2;\n\n\tout = {\n\t\t'arity': 0,\n\t\t'fcn': null\n\t};\n\tif ( hasOptions ) {\n\t\tif ( sx === 0 && sy === 0 ) {\n\t\t\tif ( isAccessorArray( x ) ) {\n\t\t\t\tv1 = x.get( ox );\n\t\t\t} else {\n\t\t\t\tv1 = x[ ox ];\n\t\t\t}\n\t\t\tif ( isAccessorArray( y ) ) {\n\t\t\t\tv2 = y.get( oy );\n\t\t\t} else {\n\t\t\t\tv2 = y[ oy ];\n\t\t\t}\n\t\t\tout.fcn = random.factory( v1, v2, options );\n\t\t\treturn out;\n\t\t}\n\t\tout.fcn = random.factory( options );\n\t} else {\n\t\tout.fcn = random;\n\t}\n\tout.arity += 2;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = clbk;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from an arcsine distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} a - minimum support\n* @param {integer} sa - `a` stride length\n* @param {Collection} b - maximum support\n* @param {integer} sb - `b` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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 {Error} minimum support must be less than maximum support\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* arcsine( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*/\nfunction arcsine( N, a, sa, b, sb, out, so, options ) {\n\tvar rand = prng( a, sa, 0, b, sb, 0, arguments.length > 7, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ a, b, out ], [ N ], [ sa, sb, so ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = arcsine;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar binary = require( '@stdlib/strided/base/binary' ).ndarray;\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from an arcsine distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} a - minimum support\n* @param {integer} sa - `a` stride length\n* @param {NonNegativeInteger} oa - starting `a` index\n* @param {Collection} b - maximum support\n* @param {integer} sb - `b` stride length\n* @param {NonNegativeInteger} ob - starting `b` index\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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 {Error} minimum support must be less than maximum support\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* arcsine( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\nfunction arcsine( N, a, sa, oa, b, sb, ob, out, so, oo, options ) { // eslint-disable-line max-params\n\tvar rand = prng( a, sa, oa, b, sb, ob, arguments.length > 10, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ a, b, out ], [ N ], [ sa, sb, so ], [ oa, ob, oo ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = arcsine;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Fill a strided array with pseudorandom numbers drawn from an arcsine distribution.\n*\n* @module @stdlib/random/strided/arcsine\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var arcsine = require( '@stdlib/random/strided/arcsine' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* arcsine( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var arcsine = require( '@stdlib/random/strided/arcsine' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* arcsine.ndarray( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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 setReadWriteAccessor = require( '@stdlib/utils/define-nonenumerable-read-write-accessor' );\nvar setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only-accessor' );\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar isFunction = require( '@stdlib/assert/is-function' );\nvar isMethodIn = require( '@stdlib/assert/is-method-in' );\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar constantFunction = require( '@stdlib/utils/constant-function' );\nvar noop = require( '@stdlib/utils/noop' );\nvar unary = require( '@stdlib/strided/base/unary' );\nvar format = require( '@stdlib/string/format' );\n\n\n// MAIN //\n\n/**\n* Returns a factory function for filling strided arrays with pseudorandom values drawn from a unary PRNG.\n*\n* @param {Function} prng - unary pseudorandom value generator\n* @param {Function} prng.factory - method which returns a new unary pseudorandom value generator\n* @throws {TypeError} first argument must be a function\n* @throws {TypeError} first argument must have a `factory` method\n* @returns {Function} function which returns a function for filling strided arrays\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var exponential = require( '@stdlib/random/base/exponential' );\n*\n* var factory = createFactory( exponential );\n* // returns \n*\n* var random = factory();\n* // returns \n*\n* var out = new Float64Array( 10 );\n* // returns \n*\n* random( out.length, [ 2.0 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var exponential = require( '@stdlib/random/base/exponential' );\n*\n* var factory = createFactory( exponential );\n* // returns \n*\n* var random = factory();\n* // returns \n*\n* var out = new Float64Array( 10 );\n* // returns \n*\n* random.ndarray( out.length, [ 2.0 ], 0, 0, out, 1, 0 );\n*/\nfunction createFactory( prng ) {\n\tif ( !isFunction( prng ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a function. Value: `%s`.', prng ) );\n\t}\n\tif ( !isMethodIn( prng, 'factory' ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must have a `%s` method.', 'factory' ) );\n\t}\n\treturn factory;\n\n\t/**\n\t* Returns a function for filling strided arrays with pseudorandom values drawn from a PRNG.\n\t*\n\t* @private\n\t* @param {Options} [options] - function options\n\t* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n\t* @param {*} [options.seed] - pseudorandom value generator seed\n\t* @param {*} [options.state] - pseudorandom value generator state\n\t* @param {boolean} [options.copy] - boolean indicating whether to copy a provided pseudorandom value generator state\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @throws {Error} must provide a valid state\n\t* @returns {Function} function for filling strided arrays\n\t*/\n\tfunction factory() {\n\t\tvar base;\n\t\tvar opts;\n\n\t\tif ( arguments.length > 0 ) {\n\t\t\topts = arguments[ 0 ];\n\t\t\tif ( !isPlainObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tbase = prng.factory( opts );\n\t\t} else {\n\t\t\topts = {};\n\t\t\tbase = prng;\n\t\t}\n\t\tif ( opts && opts.prng ) {\n\t\t\tsetReadOnly( rand, 'seed', null );\n\t\t\tsetReadOnly( rand, 'seedLength', null );\n\t\t\tsetReadWriteAccessor( rand, 'state', constantFunction( null ), noop );\n\t\t\tsetReadOnly( rand, 'stateLength', null );\n\t\t\tsetReadOnly( rand, 'byteLength', null );\n\t\t} else {\n\t\t\tsetReadOnlyAccessor( rand, 'seed', getSeed );\n\t\t\tsetReadOnlyAccessor( rand, 'seedLength', getSeedLength );\n\t\t\tsetReadWriteAccessor( rand, 'state', getState, setState );\n\t\t\tsetReadOnlyAccessor( rand, 'stateLength', getStateLength );\n\t\t\tsetReadOnlyAccessor( rand, 'byteLength', getStateSize );\n\t\t}\n\t\tsetReadOnly( rand, 'PRNG', base.PRNG );\n\t\tsetReadOnly( rand, 'ndarray', ndarray );\n\t\treturn rand;\n\n\t\t/**\n\t\t* Fills a strided array with pseudorandom values drawn from a PRNG.\n\t\t*\n\t\t* @private\n\t\t* @param {NonNegativeInteger} N - number of indexed elements\n\t\t* @param {Collection} param1 - PRNG parameter\n\t\t* @param {integer} sp1 - PRNG parameter stride length\n\t\t* @param {Collection} out - output array\n\t\t* @param {integer} so - output array stride length\n\t\t* @returns {Collection} output array\n\t\t*/\n\t\tfunction rand( N, param1, sp1, out, so ) {\n\t\t\tunary( [ param1, out ], [ N ], [ sp1, so ], base );\n\t\t\treturn out;\n\t\t}\n\n\t\t/**\n\t\t* Fills a strided array with pseudorandom values drawn from a PRNG using alternative indexing semantics.\n\t\t*\n\t\t* @private\n\t\t* @param {NonNegativeInteger} N - number of indexed elements\n\t\t* @param {Collection} param1 - PRNG parameter\n\t\t* @param {integer} sp1 - PRNG parameter stride length\n\t\t* @param {NonNegativeInteger} op1 - PRNG parameter starting index\n\t\t* @param {Collection} out - output array\n\t\t* @param {integer} so - output array stride length\n\t\t* @param {NonNegativeInteger} oo - output array starting index\n\t\t* @returns {Collection} output array\n\t\t*/\n\t\tfunction ndarray( N, param1, sp1, op1, out, so, oo ) {\n\t\t\tunary.ndarray( [ param1, out ], [ N ], [ sp1, so ], [ op1, oo ], base ); // eslint-disable-line max-len\n\t\t\treturn out;\n\t\t}\n\n\t\t/**\n\t\t* Returns the PRNG seed.\n\t\t*\n\t\t* @private\n\t\t* @returns {*} seed\n\t\t*/\n\t\tfunction getSeed() {\n\t\t\treturn rand.PRNG.seed;\n\t\t}\n\n\t\t/**\n\t\t* Returns the PRNG seed length.\n\t\t*\n\t\t* @private\n\t\t* @returns {PositiveInteger} seed length\n\t\t*/\n\t\tfunction getSeedLength() {\n\t\t\treturn rand.PRNG.seedLength;\n\t\t}\n\n\t\t/**\n\t\t* Returns the PRNG state length.\n\t\t*\n\t\t* @private\n\t\t* @returns {PositiveInteger} state length\n\t\t*/\n\t\tfunction getStateLength() {\n\t\t\treturn rand.PRNG.stateLength;\n\t\t}\n\n\t\t/**\n\t\t* Returns the PRNG state size (in bytes).\n\t\t*\n\t\t* @private\n\t\t* @returns {PositiveInteger} state size (in bytes)\n\t\t*/\n\t\tfunction getStateSize() {\n\t\t\treturn rand.PRNG.byteLength;\n\t\t}\n\n\t\t/**\n\t\t* Returns the current pseudorandom number generator state.\n\t\t*\n\t\t* @private\n\t\t* @returns {*} current state\n\t\t*/\n\t\tfunction getState() {\n\t\t\treturn rand.PRNG.state;\n\t\t}\n\n\t\t/**\n\t\t* Sets the pseudorandom number generator state.\n\t\t*\n\t\t* @private\n\t\t* @param {*} s - generator state\n\t\t* @throws {Error} must provide a valid state\n\t\t*/\n\t\tfunction setState( s ) {\n\t\t\trand.PRNG.state = s;\n\t\t}\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = createFactory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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* Create a factory function for filling strided arrays with pseudorandom values drawn from a unary PRNG.\n*\n* @module @stdlib/random/strided/tools/unary-factory\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var exponential = require( '@stdlib/random/base/exponential' );\n* var unaryFactory = require( '@stdlib/random/strided/tools/unary-factory' );\n*\n* var factory = createFactory( exponential );\n* // returns \n*\n* var random = factory();\n* // returns \n*\n* var out = new Float64Array( 10 );\n* // returns \n*\n* random( out.length, [ 2.0 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var exponential = require( '@stdlib/random/base/exponential' );\n* var unaryFactory = require( '@stdlib/random/strided/tools/unary-factory' );\n*\n* var factory = createFactory( exponential );\n* // returns \n*\n* var random = factory();\n* // returns \n*\n* var out = new Float64Array( 10 );\n* // returns \n*\n* random.ndarray( out.length, [ 2.0 ], 0, 0, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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 unaryFactory = require( './../../../strided/tools/unary-factory' );\nvar base = require( './../../../base/bernoulli' );\n\n\n// MAIN //\n\n/**\n* Returns a function for filling strided arrays containing pseudorandom numbers drawn from a Bernoulli distribution.\n*\n* @name factory\n* @type {Function}\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for filling strided arrays\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var bernoulli = factory();\n* // returns \n*\n* var out = new Float64Array( 10 );\n* // returns \n*\n* var arr = bernoulli( out.length, [ 0.5 ], 0, out, 1 );\n* // returns \n*\n* var bool = ( arr === out );\n* // returns true\n*/\nvar factory = unaryFactory( base );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a Bernoulli distribution.\n*\n* @name bernoulli\n* @type {Function}\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} p - success probability\n* @param {integer} sp - `p` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* bernoulli( out.length, [ 0.5 ], 0, out, 1 );\n*/\nvar bernoulli = factory();\n\n\n// EXPORTS //\n\nmodule.exports = bernoulli;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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* Fill a strided array with pseudorandom numbers drawn from a Bernoulli distribution.\n*\n* @module @stdlib/random/strided/bernoulli\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var bernoulli = require( '@stdlib/random/strided/bernoulli' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* bernoulli( out.length, [ 0.5 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var bernoulli = require( '@stdlib/random/strided/bernoulli' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* bernoulli.ndarray( out.length, [ 0.5 ], 0, 0, out, 1, 0 );\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\n// exports: { \"factory\": \"main.factory\", \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 isAccessorArray = require( '@stdlib/array/base/assert/is-accessor-array' );\nvar random = require( './../../../base/beta' );\n\n\n// MAIN //\n\n/**\n* Returns a function for generating pseudorandom numbers.\n*\n* ## Notes\n*\n* - The returned object has the following properties:\n*\n* - **arity**: number of function parameters.\n* - **fcn**: function for generating pseudorandom numbers.\n*\n* @private\n* @param {Collection} x - first parameter\n* @param {integer} sx - `x` stride length\n* @param {NonNegativeInteger} ox - starting `x` index\n* @param {Collection} y - second parameter\n* @param {integer} sy - `y` stride length\n* @param {NonNegativeInteger} oy - starting `y` index\n* @param {boolean} hasOptions - boolean indicating whether to process an options argument\n* @param {(void|Options)} options - function options\n* @returns {Object} function object\n*/\nfunction clbk( x, sx, ox, y, sy, oy, hasOptions, options ) {\n\tvar out;\n\tvar v1;\n\tvar v2;\n\n\tout = {\n\t\t'arity': 0,\n\t\t'fcn': null\n\t};\n\tif ( hasOptions ) {\n\t\tif ( sx === 0 && sy === 0 ) {\n\t\t\tif ( isAccessorArray( x ) ) {\n\t\t\t\tv1 = x.get( ox );\n\t\t\t} else {\n\t\t\t\tv1 = x[ ox ];\n\t\t\t}\n\t\t\tif ( isAccessorArray( y ) ) {\n\t\t\t\tv2 = y.get( oy );\n\t\t\t} else {\n\t\t\t\tv2 = y[ oy ];\n\t\t\t}\n\t\t\tout.fcn = random.factory( v1, v2, options );\n\t\t\treturn out;\n\t\t}\n\t\tout.fcn = random.factory( options );\n\t} else {\n\t\tout.fcn = random;\n\t}\n\tout.arity += 2;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = clbk;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a beta distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} alpha - first shape parameter\n* @param {integer} sa - `alpha` stride length\n* @param {Collection} beta - second shape parameter\n* @param {integer} sb - `beta` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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 {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* beta( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*/\nfunction beta( N, alpha, sa, beta, sb, out, so, options ) {\n\tvar rand = prng( alpha, sa, 0, beta, sb, 0, arguments.length > 7, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ alpha, beta, out ], [ N ], [ sa, sb, so ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = beta;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar binary = require( '@stdlib/strided/base/binary' ).ndarray;\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a beta distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} alpha - first shape parameter\n* @param {integer} sa - `alpha` stride length\n* @param {NonNegativeInteger} oa - starting `alpha` index\n* @param {Collection} beta - second shape parameter\n* @param {integer} sb - `beta` stride length\n* @param {NonNegativeInteger} ob - starting `beta` index\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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 {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* beta( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\nfunction beta( N, alpha, sa, oa, beta, sb, ob, out, so, oo, options ) { // eslint-disable-line max-params\n\tvar rand = prng( alpha, sa, oa, beta, sb, ob, arguments.length > 10, options ); // eslint-disable-line max-len\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ alpha, beta, out ], [ N ], [ sa, sb, so ], [ oa, ob, oo ], rand.fcn ); // eslint-disable-line max-len\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = beta;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Fill a strided array with pseudorandom numbers drawn from a beta distribution.\n*\n* @module @stdlib/random/strided/beta\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var beta = require( '@stdlib/random/strided/beta' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* beta( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var beta = require( '@stdlib/random/strided/beta' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* beta.ndarray( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 isAccessorArray = require( '@stdlib/array/base/assert/is-accessor-array' );\nvar random = require( './../../../base/betaprime' );\n\n\n// MAIN //\n\n/**\n* Returns a function for generating pseudorandom numbers.\n*\n* ## Notes\n*\n* - The returned object has the following properties:\n*\n* - **arity**: number of function parameters.\n* - **fcn**: function for generating pseudorandom numbers.\n*\n* @private\n* @param {Collection} x - first parameter\n* @param {integer} sx - `x` stride length\n* @param {NonNegativeInteger} ox - starting `x` index\n* @param {Collection} y - second parameter\n* @param {integer} sy - `y` stride length\n* @param {NonNegativeInteger} oy - starting `y` index\n* @param {boolean} hasOptions - boolean indicating whether to process an options argument\n* @param {(void|Options)} options - function options\n* @returns {Object} function object\n*/\nfunction clbk( x, sx, ox, y, sy, oy, hasOptions, options ) {\n\tvar out;\n\tvar v1;\n\tvar v2;\n\n\tout = {\n\t\t'arity': 0,\n\t\t'fcn': null\n\t};\n\tif ( hasOptions ) {\n\t\tif ( sx === 0 && sy === 0 ) {\n\t\t\tif ( isAccessorArray( x ) ) {\n\t\t\t\tv1 = x.get( ox );\n\t\t\t} else {\n\t\t\t\tv1 = x[ ox ];\n\t\t\t}\n\t\t\tif ( isAccessorArray( y ) ) {\n\t\t\t\tv2 = y.get( oy );\n\t\t\t} else {\n\t\t\t\tv2 = y[ oy ];\n\t\t\t}\n\t\t\tout.fcn = random.factory( v1, v2, options );\n\t\t\treturn out;\n\t\t}\n\t\tout.fcn = random.factory( options );\n\t} else {\n\t\tout.fcn = random;\n\t}\n\tout.arity += 2;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = clbk;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a beta prime distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} alpha - first shape parameter\n* @param {integer} sa - `alpha` stride length\n* @param {Collection} beta - second shape parameter\n* @param {integer} sb - `beta` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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 {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* betaprime( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*/\nfunction betaprime( N, alpha, sa, beta, sb, out, so, options ) {\n\tvar rand = prng( alpha, sa, 0, beta, sb, 0, arguments.length > 7, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ alpha, beta, out ], [ N ], [ sa, sb, so ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = betaprime;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar binary = require( '@stdlib/strided/base/binary' ).ndarray;\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a beta prime distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} alpha - first shape parameter\n* @param {integer} sa - `alpha` stride length\n* @param {NonNegativeInteger} oa - starting `alpha` index\n* @param {Collection} beta - second shape parameter\n* @param {integer} sb - `beta` stride length\n* @param {NonNegativeInteger} ob - starting `beta` index\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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 {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* betaprime( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\nfunction betaprime( N, alpha, sa, oa, beta, sb, ob, out, so, oo, options ) { // eslint-disable-line max-params\n\tvar rand = prng( alpha, sa, oa, beta, sb, ob, arguments.length > 10, options ); // eslint-disable-line max-len\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ alpha, beta, out ], [ N ], [ sa, sb, so ], [ oa, ob, oo ], rand.fcn ); // eslint-disable-line max-len\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = betaprime;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Fill a strided array with pseudorandom numbers drawn from a beta prime distribution.\n*\n* @module @stdlib/random/strided/betaprime\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var betaprime = require( '@stdlib/random/strided/betaprime' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* betaprime( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var betaprime = require( '@stdlib/random/strided/betaprime' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* betaprime.ndarray( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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 unaryFactory = require( './../../../strided/tools/unary-factory' );\nvar base = require( './../../../base/chi' );\n\n\n// MAIN //\n\n/**\n* Returns a function for filling strided arrays containing pseudorandom numbers drawn from a chi distribution.\n*\n* @name factory\n* @type {Function}\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for filling strided arrays\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var chi = factory();\n* // returns \n*\n* var out = new Float64Array( 10 );\n* // returns \n*\n* var arr = chi( out.length, [ 2.0 ], 0, out, 1 );\n* // returns \n*\n* var bool = ( arr === out );\n* // returns true\n*/\nvar factory = unaryFactory( base );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a chi distribution.\n*\n* @name chi\n* @type {Function}\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} k - degrees of freedom\n* @param {integer} sk - `k` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* chi( out.length, [ 2.0 ], 0, out, 1 );\n*/\nvar chi = factory();\n\n\n// EXPORTS //\n\nmodule.exports = chi;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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* Fill a strided array with pseudorandom numbers drawn from a chi distribution.\n*\n* @module @stdlib/random/strided/chi\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var chi = require( '@stdlib/random/strided/chi' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* chi( out.length, [ 2.0 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var chi = require( '@stdlib/random/strided/chi' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* chi.ndarray( out.length, [ 2.0 ], 0, 0, out, 1, 0 );\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\n// exports: { \"factory\": \"main.factory\", \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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 unaryFactory = require( './../../../strided/tools/unary-factory' );\nvar base = require( './../../../base/chisquare' );\n\n\n// MAIN //\n\n/**\n* Returns a function for filling strided arrays containing pseudorandom numbers drawn from a chi-square distribution.\n*\n* @name factory\n* @type {Function}\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for filling strided arrays\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var chisquare = factory();\n* // returns \n*\n* var out = new Float64Array( 10 );\n* // returns \n*\n* var arr = chisquare( out.length, [ 2.0 ], 0, out, 1 );\n* // returns \n*\n* var bool = ( arr === out );\n* // returns true\n*/\nvar factory = unaryFactory( base );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a chi-square distribution.\n*\n* @name chisquare\n* @type {Function}\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} k - degrees of freedom\n* @param {integer} sk - `k` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* chisquare( out.length, [ 2.0 ], 0, out, 1 );\n*/\nvar chisquare = factory();\n\n\n// EXPORTS //\n\nmodule.exports = chisquare;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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* Fill a strided array with pseudorandom numbers drawn from a chi-square distribution.\n*\n* @module @stdlib/random/strided/chisquare\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var chisquare = require( '@stdlib/random/strided/chisquare' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* chisquare( out.length, [ 2.0 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var chisquare = require( '@stdlib/random/strided/chisquare' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* chisquare.ndarray( out.length, [ 2.0 ], 0, 0, out, 1, 0 );\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\n// exports: { \"factory\": \"main.factory\", \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 isAccessorArray = require( '@stdlib/array/base/assert/is-accessor-array' );\nvar random = require( './../../../base/cosine' );\n\n\n// MAIN //\n\n/**\n* Returns a function for generating pseudorandom numbers.\n.\n*\n* ## Notes\n*\n* - The returned object has the following properties:\n*\n* - **arity**: number of function parameters.\n* - **fcn**: function for generating pseudorandom numbers.\n*\n* @private\n* @param {Collection} x - first parameter\n* @param {integer} sx - `x` stride length\n* @param {NonNegativeInteger} ox - starting `x` index\n* @param {Collection} y - second parameter\n* @param {integer} sy - `y` stride length\n* @param {NonNegativeInteger} oy - starting `y` index\n* @param {boolean} hasOptions - boolean indicating whether to process an options argument\n* @param {(void|Options)} options - function options\n* @returns {Object} function object\n*/\nfunction clbk( x, sx, ox, y, sy, oy, hasOptions, options ) {\n\tvar out;\n\tvar v1;\n\tvar v2;\n\n\tout = {\n\t\t'arity': 0,\n\t\t'fcn': null\n\t};\n\tif ( hasOptions ) {\n\t\tif ( sx === 0 && sy === 0 ) {\n\t\t\tif ( isAccessorArray( x ) ) {\n\t\t\t\tv1 = x.get( ox );\n\t\t\t} else {\n\t\t\t\tv1 = x[ ox ];\n\t\t\t}\n\t\t\tif ( isAccessorArray( y ) ) {\n\t\t\t\tv2 = y.get( oy );\n\t\t\t} else {\n\t\t\t\tv2 = y[ oy ];\n\t\t\t}\n\t\t\tout.fcn = random.factory( v1, v2, options );\n\t\t\treturn out;\n\t\t}\n\t\tout.fcn = random.factory( options );\n\t} else {\n\t\tout.fcn = random;\n\t}\n\tout.arity += 2;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = clbk;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a raised cosine distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} mu - mean\n* @param {integer} sm - `mu` stride length\n* @param {Collection} s - scale parameter\n* @param {integer} ss - `s` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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 {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* cosine( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*/\nfunction cosine( N, mu, sm, s, ss, out, so, options ) {\n\tvar rand = prng( mu, sm, 0, s, ss, 0, arguments.length > 7, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ mu, s, out ], [ N ], [ sm, ss, so ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = cosine;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar binary = require( '@stdlib/strided/base/binary' ).ndarray;\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a raised cosine distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} mu - mean\n* @param {integer} sm - `mu` stride length\n* @param {NonNegativeInteger} om - starting `mu` index\n* @param {Collection} s - scale parameter\n* @param {integer} ss - `s` stride length\n* @param {NonNegativeInteger} os - starting `s` index\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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 {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* cosine( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\nfunction cosine( N, mu, sm, om, s, ss, os, out, so, oo, options ) { // eslint-disable-line max-params\n\tvar rand = prng( mu, sm, om, s, ss, os, arguments.length > 10, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ mu, s, out ], [ N ], [ sm, ss, so ], [ om, os, oo ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = cosine;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Fill a strided array with pseudorandom numbers drawn from a raised cosine distribution.\n*\n* @module @stdlib/random/strided/cosine\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var cosine = require( '@stdlib/random/strided/cosine' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* cosine( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var cosine = require( '@stdlib/random/strided/cosine' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* cosine.ndarray( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 isAccessorArray = require( '@stdlib/array/base/assert/is-accessor-array' );\nvar random = require( './../../../base/discrete-uniform' );\n\n\n// MAIN //\n\n/**\n* Returns a function for generating pseudorandom numbers.\n*\n* ## Notes\n*\n* - The returned object has the following properties:\n*\n* - **arity**: number of function parameters.\n* - **fcn**: function for generating pseudorandom numbers.\n*\n* @private\n* @param {Collection} x - first parameter\n* @param {integer} sx - `x` stride length\n* @param {NonNegativeInteger} ox - starting `x` index\n* @param {Collection} y - second parameter\n* @param {integer} sy - `y` stride length\n* @param {NonNegativeInteger} oy - starting `y` index\n* @param {boolean} hasOptions - boolean indicating whether to process an options argument\n* @param {(void|Options)} options - function options\n* @returns {Object} function object\n*/\nfunction clbk( x, sx, ox, y, sy, oy, hasOptions, options ) {\n\tvar out;\n\tvar v1;\n\tvar v2;\n\n\tout = {\n\t\t'arity': 0,\n\t\t'fcn': null\n\t};\n\tif ( hasOptions ) {\n\t\tif ( sx === 0 && sy === 0 ) {\n\t\t\tif ( isAccessorArray( x ) ) {\n\t\t\t\tv1 = x.get( ox );\n\t\t\t} else {\n\t\t\t\tv1 = x[ ox ];\n\t\t\t}\n\t\t\tif ( isAccessorArray( y ) ) {\n\t\t\t\tv2 = y.get( oy );\n\t\t\t} else {\n\t\t\t\tv2 = y[ oy ];\n\t\t\t}\n\t\t\tout.fcn = random.factory( v1, v2, options );\n\t\t\treturn out;\n\t\t}\n\t\tout.fcn = random.factory( options );\n\t} else {\n\t\tout.fcn = random;\n\t}\n\tout.arity += 2;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = clbk;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a discrete uniform distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} a - minimum support\n* @param {integer} sa - `a` stride length\n* @param {Collection} b - maximum support\n* @param {integer} sb - `b` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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 {Error} minimum support must be less than or equal to maximum support\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* discreteUniform( out.length, [ -10 ], 0, [ 10 ], 0, out, 1 );\n*/\nfunction discreteUniform( N, a, sa, b, sb, out, so, options ) {\n\tvar rand = prng( a, sa, 0, b, sb, 0, arguments.length > 7, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ a, b, out ], [ N ], [ sa, sb, so ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = discreteUniform;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar binary = require( '@stdlib/strided/base/binary' ).ndarray;\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a discrete uniform distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} a - minimum support\n* @param {integer} sa - `a` stride length\n* @param {NonNegativeInteger} oa - starting `a` index\n* @param {Collection} b - maximum support\n* @param {integer} sb - `b` stride length\n* @param {NonNegativeInteger} ob - starting `b` index\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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 {Error} minimum support must be less than or equal to maximum support\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* discreteUniform( out.length, [ -10 ], 0, 0, [ 10 ], 0, 0, out, 1, 0 );\n*/\nfunction discreteUniform( N, a, sa, oa, b, sb, ob, out, so, oo, options ) { // eslint-disable-line max-params\n\tvar rand = prng( a, sa, oa, b, sb, ob, arguments.length > 10, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ a, b, out ], [ N ], [ sa, sb, so ], [ oa, ob, oo ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = discreteUniform;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Fill a strided array with pseudorandom numbers drawn from a discrete uniform distribution.\n*\n* @module @stdlib/random/strided/discrete-uniform\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var discreteUniform = require( '@stdlib/random/strided/discrete-uniform' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* discreteUniform( out.length, [ -10 ], 0, [ 10 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var discreteUniform = require( '@stdlib/random/strided/discrete-uniform' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* discreteUniform.ndarray( out.length, [ -10 ], 0, 0, [ 10 ], 0, 0, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 unaryFactory = require( './../../../strided/tools/unary-factory' );\nvar base = require( './../../../base/exponential' );\n\n\n// MAIN //\n\n/**\n* Returns a function for filling strided arrays containing pseudorandom numbers drawn from an exponential distribution.\n*\n* @name factory\n* @type {Function}\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for filling strided arrays\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var exponential = factory();\n* // returns \n*\n* var out = new Float64Array( 10 );\n* // returns \n*\n* var arr = exponential( out.length, [ 2.0 ], 0, out, 1 );\n* // returns \n*\n* var bool = ( arr === out );\n* // returns true\n*/\nvar factory = unaryFactory( base );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from an exponential distribution.\n*\n* @name exponential\n* @type {Function}\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} lambda - rate parameter\n* @param {integer} sl - `lambda` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* exponential( out.length, [ 2.0 ], 0, out, 1 );\n*/\nvar exponential = factory();\n\n\n// EXPORTS //\n\nmodule.exports = exponential;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Fill a strided array with pseudorandom numbers drawn from an exponential distribution.\n*\n* @module @stdlib/random/strided/exponential\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var exponential = require( '@stdlib/random/strided/exponential' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* exponential( out.length, [ 2.0 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var exponential = require( '@stdlib/random/strided/exponential' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* exponential.ndarray( out.length, [ 2.0 ], 0, 0, out, 1, 0 );\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\n// exports: { \"factory\": \"main.factory\", \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 isAccessorArray = require( '@stdlib/array/base/assert/is-accessor-array' );\nvar random = require( './../../../base/gamma' );\n\n\n// MAIN //\n\n/**\n* Returns a function for generating pseudorandom numbers.\n*\n* ## Notes\n*\n* - The returned object has the following properties:\n*\n* - **arity**: number of function parameters.\n* - **fcn**: function for generating pseudorandom numbers.\n*\n* @private\n* @param {Collection} x - first parameter\n* @param {integer} sx - `x` stride length\n* @param {NonNegativeInteger} ox - starting `x` index\n* @param {Collection} y - second parameter\n* @param {integer} sy - `y` stride length\n* @param {NonNegativeInteger} oy - starting `y` index\n* @param {boolean} hasOptions - boolean indicating whether to process an options argument\n* @param {(void|Options)} options - function options\n* @returns {Object} function object\n*/\nfunction clbk( x, sx, ox, y, sy, oy, hasOptions, options ) {\n\tvar out;\n\tvar v1;\n\tvar v2;\n\n\tout = {\n\t\t'arity': 0,\n\t\t'fcn': null\n\t};\n\tif ( hasOptions ) {\n\t\tif ( sx === 0 && sy === 0 ) {\n\t\t\tif ( isAccessorArray( x ) ) {\n\t\t\t\tv1 = x.get( ox );\n\t\t\t} else {\n\t\t\t\tv1 = x[ ox ];\n\t\t\t}\n\t\t\tif ( isAccessorArray( y ) ) {\n\t\t\t\tv2 = y.get( oy );\n\t\t\t} else {\n\t\t\t\tv2 = y[ oy ];\n\t\t\t}\n\t\t\tout.fcn = random.factory( v1, v2, options );\n\t\t\treturn out;\n\t\t}\n\t\tout.fcn = random.factory( options );\n\t} else {\n\t\tout.fcn = random;\n\t}\n\tout.arity += 2;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = clbk;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a gamma distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} alpha - shape parameter\n* @param {integer} sa - `alpha` stride length\n* @param {Collection} beta - rate parameter\n* @param {integer} sb - `beta` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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 {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* gamma( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*/\nfunction gamma( N, alpha, sa, beta, sb, out, so, options ) {\n\tvar rand = prng( alpha, sa, 0, beta, sb, 0, arguments.length > 7, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ alpha, beta, out ], [ N ], [ sa, sb, so ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gamma;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar binary = require( '@stdlib/strided/base/binary' ).ndarray;\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a gamma distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} alpha - shape parameter\n* @param {integer} sa - `alpha` stride length\n* @param {NonNegativeInteger} oa - starting `alpha` index\n* @param {Collection} beta - rate parameter\n* @param {integer} sb - `beta` stride length\n* @param {NonNegativeInteger} ob - starting `beta` index\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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 {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* gamma( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\nfunction gamma( N, alpha, sa, oa, beta, sb, ob, out, so, oo, options ) { // eslint-disable-line max-params\n\tvar rand = prng( alpha, sa, oa, beta, sb, ob, arguments.length > 10, options ); // eslint-disable-line max-len\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ alpha, beta, out ], [ N ], [ sa, sb, so ], [ oa, ob, oo ], rand.fcn ); // eslint-disable-line max-len\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = gamma;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Fill a strided array with pseudorandom numbers drawn from a gamma distribution.\n*\n* @module @stdlib/random/strided/gamma\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var gamma = require( '@stdlib/random/strided/gamma' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* gamma( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var gamma = require( '@stdlib/random/strided/gamma' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* gamma.ndarray( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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 unaryFactory = require( './../../../strided/tools/unary-factory' );\nvar base = require( './../../../base/geometric' );\n\n\n// MAIN //\n\n/**\n* Returns a function for filling strided arrays containing pseudorandom numbers drawn from a geometric distribution.\n*\n* @name factory\n* @type {Function}\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for filling strided arrays\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var geometric = factory();\n* // returns \n*\n* var out = new Float64Array( 10 );\n* // returns \n*\n* var arr = geometric( out.length, [ 0.01 ], 0, out, 1 );\n* // returns \n*\n* var bool = ( arr === out );\n* // returns true\n*/\nvar factory = unaryFactory( base );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a geometric distribution.\n*\n* @name geometric\n* @type {Function}\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} p - success probability\n* @param {integer} sp - `p` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* geometric( out.length, [ 0.01 ], 0, out, 1 );\n*/\nvar geometric = factory();\n\n\n// EXPORTS //\n\nmodule.exports = geometric;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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* Fill a strided array with pseudorandom numbers drawn from a geometric distribution.\n*\n* @module @stdlib/random/strided/geometric\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var geometric = require( '@stdlib/random/strided/geometric' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* geometric( out.length, [ 0.01 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var geometric = require( '@stdlib/random/strided/geometric' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* geometric.ndarray( out.length, [ 0.01 ], 0, 0, out, 1, 0 );\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\n// exports: { \"factory\": \"main.factory\", \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 isAccessorArray = require( '@stdlib/array/base/assert/is-accessor-array' );\nvar random = require( './../../../base/invgamma' );\n\n\n// MAIN //\n\n/**\n* Returns a function for generating pseudorandom numbers.\n.\n*\n* ## Notes\n*\n* - The returned object has the following properties:\n*\n* - **arity**: number of function parameters.\n* - **fcn**: function for generating pseudorandom numbers.\n*\n* @private\n* @param {Collection} x - first parameter\n* @param {integer} sx - `x` stride length\n* @param {NonNegativeInteger} ox - starting `x` index\n* @param {Collection} y - second parameter\n* @param {integer} sy - `y` stride length\n* @param {NonNegativeInteger} oy - starting `y` index\n* @param {boolean} hasOptions - boolean indicating whether to process an options argument\n* @param {(void|Options)} options - function options\n* @returns {Object} function object\n*/\nfunction clbk( x, sx, ox, y, sy, oy, hasOptions, options ) {\n\tvar out;\n\tvar v1;\n\tvar v2;\n\n\tout = {\n\t\t'arity': 0,\n\t\t'fcn': null\n\t};\n\tif ( hasOptions ) {\n\t\tif ( sx === 0 && sy === 0 ) {\n\t\t\tif ( isAccessorArray( x ) ) {\n\t\t\t\tv1 = x.get( ox );\n\t\t\t} else {\n\t\t\t\tv1 = x[ ox ];\n\t\t\t}\n\t\t\tif ( isAccessorArray( y ) ) {\n\t\t\t\tv2 = y.get( oy );\n\t\t\t} else {\n\t\t\t\tv2 = y[ oy ];\n\t\t\t}\n\t\t\tout.fcn = random.factory( v1, v2, options );\n\t\t\treturn out;\n\t\t}\n\t\tout.fcn = random.factory( options );\n\t} else {\n\t\tout.fcn = random;\n\t}\n\tout.arity += 2;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = clbk;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from an inverse gamma distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} alpha - shape parameter\n* @param {integer} sa - `alpha` stride length\n* @param {Collection} beta - scale parameter\n* @param {integer} sb - `beta` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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 {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* invgamma( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*/\nfunction invgamma( N, alpha, sa, beta, sb, out, so, options ) {\n\tvar rand = prng( alpha, sa, 0, beta, sb, 0, arguments.length > 7, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ alpha, beta, out ], [ N ], [ sa, sb, so ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = invgamma;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar binary = require( '@stdlib/strided/base/binary' ).ndarray;\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from an inverse gamma distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} alpha - shape parameter\n* @param {integer} sa - `alpha` stride length\n* @param {NonNegativeInteger} oa - starting `alpha` index\n* @param {Collection} beta - scale parameter\n* @param {integer} sb - `beta` stride length\n* @param {NonNegativeInteger} ob - starting `beta` index\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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 {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* invgamma( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\nfunction invgamma( N, alpha, sa, oa, beta, sb, ob, out, so, oo, options ) { // eslint-disable-line max-params\n\tvar rand = prng( alpha, sa, oa, beta, sb, ob, arguments.length > 10, options ); // eslint-disable-line max-len\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ alpha, beta, out ], [ N ], [ sa, sb, so ], [ oa, ob, oo ], rand.fcn ); // eslint-disable-line max-len\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = invgamma;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Fill a strided array with pseudorandom numbers drawn from an inverse gamma distribution.\n*\n* @module @stdlib/random/strided/invgamma\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var invgamma = require( '@stdlib/random/strided/invgamma' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* invgamma( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var invgamma = require( '@stdlib/random/strided/invgamma' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* invgamma.ndarray( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 isAccessorArray = require( '@stdlib/array/base/assert/is-accessor-array' );\nvar random = require( './../../../base/lognormal' );\n\n\n// MAIN //\n\n/**\n* Returns a function for generating pseudorandom numbers.\n*\n* ## Notes\n*\n* - The returned object has the following properties:\n*\n* - **arity**: number of function parameters.\n* - **fcn**: function for generating pseudorandom numbers.\n*\n* @private\n* @param {Collection} x - first parameter\n* @param {integer} sx - `x` stride length\n* @param {NonNegativeInteger} ox - starting `x` index\n* @param {Collection} y - second parameter\n* @param {integer} sy - `y` stride length\n* @param {NonNegativeInteger} oy - starting `y` index\n* @param {boolean} hasOptions - boolean indicating whether to process an options argument\n* @param {(void|Options)} options - function options\n* @returns {Object} function object\n*/\nfunction clbk( x, sx, ox, y, sy, oy, hasOptions, options ) {\n\tvar out;\n\tvar v1;\n\tvar v2;\n\n\tout = {\n\t\t'arity': 0,\n\t\t'fcn': null\n\t};\n\tif ( hasOptions ) {\n\t\tif ( sx === 0 && sy === 0 ) {\n\t\t\tif ( isAccessorArray( x ) ) {\n\t\t\t\tv1 = x.get( ox );\n\t\t\t} else {\n\t\t\t\tv1 = x[ ox ];\n\t\t\t}\n\t\t\tif ( isAccessorArray( y ) ) {\n\t\t\t\tv2 = y.get( oy );\n\t\t\t} else {\n\t\t\t\tv2 = y[ oy ];\n\t\t\t}\n\t\t\tout.fcn = random.factory( v1, v2, options );\n\t\t\treturn out;\n\t\t}\n\t\tout.fcn = random.factory( options );\n\t} else {\n\t\tout.fcn = random;\n\t}\n\tout.arity += 2;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = clbk;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a lognormal distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} mu - location parameter\n* @param {integer} sm - `mu` stride length\n* @param {Collection} sigma - scale parameter\n* @param {integer} ss - `sigma` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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 {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* lognormal( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*/\nfunction lognormal( N, mu, sm, sigma, ss, out, so, options ) {\n\tvar rand = prng( mu, sm, 0, sigma, ss, 0, arguments.length > 7, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ mu, sigma, out ], [ N ], [ sm, ss, so ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = lognormal;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar binary = require( '@stdlib/strided/base/binary' ).ndarray;\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a lognormal distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} mu - location parameter\n* @param {integer} sm - `mu` stride length\n* @param {NonNegativeInteger} om - starting `mu` index\n* @param {Collection} sigma - scale parameter\n* @param {integer} ss - `sigma` stride length\n* @param {NonNegativeInteger} os - starting `sigma` index\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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 {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* lognormal( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\nfunction lognormal( N, mu, sm, om, sigma, ss, os, out, so, oo, options ) { // eslint-disable-line max-params\n\tvar rand = prng( mu, sm, om, sigma, ss, os, arguments.length > 10, options ); // eslint-disable-line max-len\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ mu, sigma, out ], [ N ], [ sm, ss, so ], [ om, os, oo ], rand.fcn ); // eslint-disable-line max-len\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = lognormal;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Fill a strided array with pseudorandom numbers drawn from a lognormal distribution.\n*\n* @module @stdlib/random/strided/lognormal\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var lognormal = require( '@stdlib/random/strided/lognormal' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* lognormal( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var lognormal = require( '@stdlib/random/strided/lognormal' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* lognormal.ndarray( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' );\nvar random = require( './../../../base/minstd' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom integers on the interval `[1, 2147483646]`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [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 {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd( out.length, out, 1 );\n*/\nfunction minstd( N, out, so, options ) {\n\tvar rand;\n\tif ( arguments.length > 3 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], rand );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = minstd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar random = require( './../../../base/minstd' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom integers on the interval `[1, 2147483646]`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [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 {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd( out.length, out, 1, 0 );\n*/\nfunction minstd( N, out, so, oo, options ) {\n\tvar rand;\n\tif ( arguments.length > 4 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], [ oo ], rand );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = minstd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' );\nvar random = require( './../../../base/minstd' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers between `0` and `1`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [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 {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd( out.length, out, 1 );\n*/\nfunction minstd( N, out, so, options ) {\n\tvar rand;\n\tif ( arguments.length > 3 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], rand.normalized );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = minstd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar random = require( './../../../base/minstd' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with uniformly distributed pseudorandom numbers between `0` and `1`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [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 {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd( out.length, out, 1, 0 );\n*/\nfunction minstd( N, out, so, oo, options ) {\n\tvar rand;\n\tif ( arguments.length > 4 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.normalized );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = minstd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Fill a strided array with pseudorandom numbers generated using a linear congruential pseudorandom number generator (LCG).\n*\n* @module @stdlib/random/strided/minstd\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var minstd = require( '@stdlib/random/strided/minstd' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd( out.length, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var minstd = require( '@stdlib/random/strided/minstd' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd.ndarray( out.length, out, 1, 0 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var minstd = require( '@stdlib/random/strided/minstd' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd.normalized( out.length, out, 1 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\nvar normalized = require( './normalized.js' );\nvar ndarrayNormalized = require( './normalized.ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\nsetReadOnly( main, 'normalized', normalized );\nsetReadOnly( normalized, 'ndarray', ndarrayNormalized );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\", \"normalized\": \"main.normalized\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' );\nvar random = require( './../../../base/minstd-shuffle' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom integers on the interval `[1, 2147483646]`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [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 {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd( out.length, out, 1 );\n*/\nfunction minstd( N, out, so, options ) {\n\tvar rand;\n\tif ( arguments.length > 3 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], rand );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = minstd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar random = require( './../../../base/minstd-shuffle' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom integers on the interval `[1, 2147483646]`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [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 {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd( out.length, out, 1, 0 );\n*/\nfunction minstd( N, out, so, oo, options ) {\n\tvar rand;\n\tif ( arguments.length > 4 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], [ oo ], rand );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = minstd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' );\nvar random = require( './../../../base/minstd-shuffle' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers between `0` and `1`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [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 {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd( out.length, out, 1 );\n*/\nfunction minstd( N, out, so, options ) {\n\tvar rand;\n\tif ( arguments.length > 3 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], rand.normalized );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = minstd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar random = require( './../../../base/minstd-shuffle' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with uniformly distributed pseudorandom numbers between `0` and `1`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNGSeedMINSTD} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMINSTD} [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 {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd( out.length, out, 1, 0 );\n*/\nfunction minstd( N, out, so, oo, options ) {\n\tvar rand;\n\tif ( arguments.length > 4 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.normalized );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = minstd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Fill a strided array with pseudorandom numbers generated using a linear congruential pseudorandom number generator (LCG) whose output is shuffled.\n*\n* @module @stdlib/random/strided/minstd-shuffle\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var minstd = require( '@stdlib/random/strided/minstd-shuffle' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd( out.length, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var minstd = require( '@stdlib/random/strided/minstd-shuffle' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd.ndarray( out.length, out, 1, 0 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var minstd = require( '@stdlib/random/strided/minstd-shuffle' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* minstd.normalized( out.length, out, 1 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\nvar normalized = require( './normalized.js' );\nvar ndarrayNormalized = require( './normalized.ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\nsetReadOnly( main, 'normalized', normalized );\nsetReadOnly( normalized, 'ndarray', ndarrayNormalized );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\", \"normalized\": \"main.normalized\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' );\nvar random = require( './../../../base/mt19937' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom integers on the interval `[0, 4294967295]`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function 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 {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* mt19937( out.length, out, 1 );\n*/\nfunction mt19937( N, out, so, options ) {\n\tvar rand;\n\tif ( arguments.length > 3 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], rand );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = mt19937;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar random = require( './../../../base/mt19937' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom integers on the interval `[0, 4294967295]`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function 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 {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* mt19937( out.length, out, 1, 0 );\n*/\nfunction mt19937( N, out, so, oo, options ) {\n\tvar rand;\n\tif ( arguments.length > 4 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], [ oo ], rand );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = mt19937;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' );\nvar random = require( './../../../base/mt19937' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers between `0` and `1`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function 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 {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* mt19937( out.length, out, 1 );\n*/\nfunction mt19937( N, out, so, options ) {\n\tvar rand;\n\tif ( arguments.length > 3 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], rand.normalized );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = mt19937;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar random = require( './../../../base/mt19937' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with uniformly distributed pseudorandom numbers between `0` and `1`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function 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 {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* mt19937( out.length, out, 1, 0 );\n*/\nfunction mt19937( N, out, so, oo, options ) {\n\tvar rand;\n\tif ( arguments.length > 4 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.normalized );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = mt19937;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Fill a strided array with pseudorandom numbers generated using a 32-bit Mersenne Twister pseudorandom number generator.\n*\n* @module @stdlib/random/strided/mt19937\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var mt19937 = require( '@stdlib/random/strided/mt19937' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* mt19937( out.length, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var mt19937 = require( '@stdlib/random/strided/mt19937' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* mt19937.ndarray( out.length, out, 1, 0 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var mt19937 = require( '@stdlib/random/strided/mt19937' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* mt19937.normalized( out.length, out, 1 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\nvar normalized = require( './normalized.js' );\nvar ndarrayNormalized = require( './normalized.ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\nsetReadOnly( main, 'normalized', normalized );\nsetReadOnly( normalized, 'ndarray', ndarrayNormalized );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\", \"normalized\": \"main.normalized\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 isAccessorArray = require( '@stdlib/array/base/assert/is-accessor-array' );\nvar random = require( './../../../base/normal' );\n\n\n// MAIN //\n\n/**\n* Returns a function for generating pseudorandom numbers.\n*\n* ## Notes\n*\n* - The returned object has the following properties:\n*\n* - **arity**: number of function parameters.\n* - **fcn**: function for generating pseudorandom numbers.\n*\n* @private\n* @param {Collection} x - first parameter\n* @param {integer} sx - `x` stride length\n* @param {NonNegativeInteger} ox - starting `x` index\n* @param {Collection} y - second parameter\n* @param {integer} sy - `y` stride length\n* @param {NonNegativeInteger} oy - starting `y` index\n* @param {boolean} hasOptions - boolean indicating whether to process an options argument\n* @param {(void|Options)} options - function options\n* @returns {Object} function object\n*/\nfunction clbk( x, sx, ox, y, sy, oy, hasOptions, options ) {\n\tvar out;\n\tvar v1;\n\tvar v2;\n\n\tout = {\n\t\t'arity': 0,\n\t\t'fcn': null\n\t};\n\tif ( hasOptions ) {\n\t\tif ( sx === 0 && sy === 0 ) {\n\t\t\tif ( isAccessorArray( x ) ) {\n\t\t\t\tv1 = x.get( ox );\n\t\t\t} else {\n\t\t\t\tv1 = x[ ox ];\n\t\t\t}\n\t\t\tif ( isAccessorArray( y ) ) {\n\t\t\t\tv2 = y.get( oy );\n\t\t\t} else {\n\t\t\t\tv2 = y[ oy ];\n\t\t\t}\n\t\t\tout.fcn = random.factory( v1, v2, options );\n\t\t\treturn out;\n\t\t}\n\t\tout.fcn = random.factory( options );\n\t} else {\n\t\tout.fcn = random;\n\t}\n\tout.arity += 2;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = clbk;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a normal distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} mu - mean\n* @param {integer} sm - `mu` stride length\n* @param {Collection} sigma - standard deviation\n* @param {integer} ss - `sigma` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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 {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* normal( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*/\nfunction normal( N, mu, sm, sigma, ss, out, so, options ) {\n\tvar rand = prng( mu, sm, 0, sigma, ss, 0, arguments.length > 7, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ mu, sigma, out ], [ N ], [ sm, ss, so ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = normal;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar binary = require( '@stdlib/strided/base/binary' ).ndarray;\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a normal distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} mu - mean\n* @param {integer} sm - `mu` stride length\n* @param {NonNegativeInteger} om - starting `mu` index\n* @param {Collection} sigma - standard deviation\n* @param {integer} ss - `sigma` stride length\n* @param {NonNegativeInteger} os - starting `sigma` index\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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 {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* normal( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\nfunction normal( N, mu, sm, om, sigma, ss, os, out, so, oo, options ) { // eslint-disable-line max-params\n\tvar rand = prng( mu, sm, om, sigma, ss, os, arguments.length > 10, options ); // eslint-disable-line max-len\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ mu, sigma, out ], [ N ], [ sm, ss, so ], [ om, os, oo ], rand.fcn ); // eslint-disable-line max-len\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = normal;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Fill a strided array with pseudorandom numbers drawn from a normal distribution.\n*\n* @module @stdlib/random/strided/normal\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var normal = require( '@stdlib/random/strided/normal' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* normal( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var normal = require( '@stdlib/random/strided/normal' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* normal.ndarray( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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 unaryFactory = require( './../../../strided/tools/unary-factory' );\nvar base = require( './../../../base/poisson' );\n\n\n// MAIN //\n\n/**\n* Returns a function for filling strided arrays containing pseudorandom numbers drawn from a Poisson distribution.\n*\n* @name factory\n* @type {Function}\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Function} function for filling strided arrays\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* var poisson = factory();\n* // returns \n*\n* var out = new Float64Array( 10 );\n* // returns \n*\n* var arr = poisson( out.length, [ 2.0 ], 0, out, 1 );\n* // returns \n*\n* var bool = ( arr === out );\n* // returns true\n*/\nvar factory = unaryFactory( base );\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a Poisson distribution.\n*\n* @name poisson\n* @type {Function}\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} lambda - mean parameter\n* @param {integer} sl - `lambda` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* poisson( out.length, [ 2.0 ], 0, out, 1 );\n*/\nvar poisson = factory();\n\n\n// EXPORTS //\n\nmodule.exports = poisson;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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* Fill a strided array with pseudorandom numbers drawn from a Poisson distribution.\n*\n* @module @stdlib/random/strided/poisson\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var poisson = require( '@stdlib/random/strided/poisson' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* poisson( out.length, [ 2.0 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var poisson = require( '@stdlib/random/strided/poisson' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* poisson.ndarray( out.length, [ 2.0 ], 0, 0, out, 1, 0 );\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\n// exports: { \"factory\": \"main.factory\", \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' );\nvar random = require( './../../../base/randu' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with uniformly distributed pseudorandom numbers between `0` and `1`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {string} [options.name='mt19937'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [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 {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* randu( out.length, out, 1 );\n*/\nfunction randu( N, out, so, options ) {\n\tvar rand;\n\tif ( arguments.length > 3 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], rand );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = randu;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar random = require( './../../../base/randu' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with uniformly distributed pseudorandom numbers between `0` and `1`.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {string} [options.name='mt19937'] - name of a supported pseudorandom number generator (PRNG), which will serve as the underlying source of pseudorandom numbers\n* @param {*} [options.seed] - pseudorandom number generator seed\n* @param {*} [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 {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* randu( out.length, out, 1, 0 );\n*/\nfunction randu( N, out, so, oo, options ) {\n\tvar rand;\n\tif ( arguments.length > 4 ) {\n\t\trand = random.factory( options );\n\t} else {\n\t\trand = random;\n\t}\n\tnullary( [ out ], [ N ], [ so ], [ oo ], rand );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = randu;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Fill a strided array with uniformly distributed pseudorandom numbers between `0` and `1`.\n*\n* @module @stdlib/random/strided/randu\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var randu = require( '@stdlib/random/strided/randu' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* randu( out.length, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var randu = require( '@stdlib/random/strided/randu' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* randu.ndarray( out.length, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 isAccessorArray = require( '@stdlib/array/base/assert/is-accessor-array' );\nvar random = require( './../../../base/uniform' );\n\n\n// MAIN //\n\n/**\n* Returns a function for generating pseudorandom numbers.\n*\n* ## Notes\n*\n* - The returned object has the following properties:\n*\n* - **arity**: number of function parameters.\n* - **fcn**: function for generating pseudorandom numbers.\n*\n* @private\n* @param {Collection} x - first parameter\n* @param {integer} sx - `x` stride length\n* @param {NonNegativeInteger} ox - starting `x` index\n* @param {Collection} y - second parameter\n* @param {integer} sy - `y` stride length\n* @param {NonNegativeInteger} oy - starting `y` index\n* @param {boolean} hasOptions - boolean indicating whether to process an options argument\n* @param {(void|Options)} options - function options\n* @returns {Object} function object\n*/\nfunction clbk( x, sx, ox, y, sy, oy, hasOptions, options ) {\n\tvar out;\n\tvar v1;\n\tvar v2;\n\n\tout = {\n\t\t'arity': 0,\n\t\t'fcn': null\n\t};\n\tif ( hasOptions ) {\n\t\tif ( sx === 0 && sy === 0 ) {\n\t\t\tif ( isAccessorArray( x ) ) {\n\t\t\t\tv1 = x.get( ox );\n\t\t\t} else {\n\t\t\t\tv1 = x[ ox ];\n\t\t\t}\n\t\t\tif ( isAccessorArray( y ) ) {\n\t\t\t\tv2 = y.get( oy );\n\t\t\t} else {\n\t\t\t\tv2 = y[ oy ];\n\t\t\t}\n\t\t\tout.fcn = random.factory( v1, v2, options );\n\t\t\treturn out;\n\t\t}\n\t\tout.fcn = random.factory( options );\n\t} else {\n\t\tout.fcn = random;\n\t}\n\tout.arity += 2;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = clbk;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a continuous uniform distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} a - minimum support\n* @param {integer} sa - `a` stride length\n* @param {Collection} b - maximum support\n* @param {integer} sb - `b` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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 {Error} minimum support must be less than maximum support\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* uniform( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*/\nfunction uniform( N, a, sa, b, sb, out, so, options ) {\n\tvar rand = prng( a, sa, 0, b, sb, 0, arguments.length > 7, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ a, b, out ], [ N ], [ sa, sb, so ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = uniform;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar binary = require( '@stdlib/strided/base/binary' ).ndarray;\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a continuous uniform distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} a - minimum support\n* @param {integer} sa - `a` stride length\n* @param {NonNegativeInteger} oa - starting `a` index\n* @param {Collection} b - maximum support\n* @param {integer} sb - `b` stride length\n* @param {NonNegativeInteger} ob - starting `b` index\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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 {Error} minimum support must be less than maximum support\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* uniform( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\nfunction uniform( N, a, sa, oa, b, sb, ob, out, so, oo, options ) { // eslint-disable-line max-params\n\tvar rand = prng( a, sa, oa, b, sb, ob, arguments.length > 10, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ a, b, out ], [ N ], [ sa, sb, so ], [ oa, ob, oo ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = uniform;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Fill a strided array with pseudorandom numbers drawn from a continuous uniform distribution.\n*\n* @module @stdlib/random/strided/uniform\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var uniform = require( '@stdlib/random/strided/uniform' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* uniform( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var uniform = require( '@stdlib/random/strided/uniform' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* uniform.ndarray( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 isAccessorArray = require( '@stdlib/array/base/assert/is-accessor-array' );\nvar random = require( './../../../base/weibull' );\n\n\n// MAIN //\n\n/**\n* Returns a function for generating pseudorandom numbers.\n*\n* ## Notes\n*\n* - The returned object has the following properties:\n*\n* - **arity**: number of function parameters.\n* - **fcn**: function for generating pseudorandom numbers.\n*\n* @private\n* @param {Collection} x - first parameter\n* @param {integer} sx - `x` stride length\n* @param {NonNegativeInteger} ox - starting `x` index\n* @param {Collection} y - second parameter\n* @param {integer} sy - `y` stride length\n* @param {NonNegativeInteger} oy - starting `y` index\n* @param {boolean} hasOptions - boolean indicating whether to process an options argument\n* @param {(void|Options)} options - function options\n* @returns {Object} function object\n*/\nfunction clbk( x, sx, ox, y, sy, oy, hasOptions, options ) {\n\tvar out;\n\tvar v1;\n\tvar v2;\n\n\tout = {\n\t\t'arity': 0,\n\t\t'fcn': null\n\t};\n\tif ( hasOptions ) {\n\t\tif ( sx === 0 && sy === 0 ) {\n\t\t\tif ( isAccessorArray( x ) ) {\n\t\t\t\tv1 = x.get( ox );\n\t\t\t} else {\n\t\t\t\tv1 = x[ ox ];\n\t\t\t}\n\t\t\tif ( isAccessorArray( y ) ) {\n\t\t\t\tv2 = y.get( oy );\n\t\t\t} else {\n\t\t\t\tv2 = y[ oy ];\n\t\t\t}\n\t\t\tout.fcn = random.factory( v1, v2, options );\n\t\t\treturn out;\n\t\t}\n\t\tout.fcn = random.factory( options );\n\t} else {\n\t\tout.fcn = random;\n\t}\n\tout.arity += 2;\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = clbk;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' );\nvar binary = require( '@stdlib/strided/base/binary' );\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a Weibull distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} k - scale parameter\n* @param {integer} sk - `k` stride length\n* @param {Collection} lambda - shape parameter\n* @param {integer} sl - `lambda` stride length\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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 {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* weibull( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*/\nfunction weibull( N, k, sk, lambda, sl, out, so, options ) {\n\tvar rand = prng( k, sk, 0, lambda, sl, 0, arguments.length > 7, options );\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ k, lambda, out ], [ N ], [ sk, sl, so ], rand.fcn );\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = weibull;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 nullary = require( '@stdlib/strided/base/nullary' ).ndarray;\nvar binary = require( '@stdlib/strided/base/binary' ).ndarray;\nvar prng = require( './prng.js' );\n\n\n// MAIN //\n\n/**\n* Fills a strided array with pseudorandom numbers drawn from a Weibull distribution.\n*\n* @param {NonNegativeInteger} N - number of indexed elements\n* @param {Collection} k - scale parameter\n* @param {integer} sk - `k` stride length\n* @param {NonNegativeInteger} ok - starting `k` index\n* @param {Collection} lambda - shape parameter\n* @param {integer} sl - `lambda` stride length\n* @param {NonNegativeInteger} ol - starting `lambda` index\n* @param {Collection} out - output array\n* @param {integer} so - `out` stride length\n* @param {NonNegativeInteger} oo - starting `out` index\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\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 {Error} must provide valid distribution parameters\n* @throws {Error} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {Collection} output array\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* weibull( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\nfunction weibull( N, k, sk, ok, lambda, sl, ol, out, so, oo, options ) { // eslint-disable-line max-params\n\tvar rand = prng( k, sk, ok, lambda, sl, ol, arguments.length > 10, options ); // eslint-disable-line max-len\n\tif ( rand.arity === 0 ) {\n\t\tnullary( [ out ], [ N ], [ so ], [ oo ], rand.fcn );\n\t\treturn out;\n\t}\n\tbinary( [ k, lambda, out ], [ N ], [ sk, sl, so ], [ ok, ol, oo ], rand.fcn ); // eslint-disable-line max-len\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = weibull;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Fill a strided array with pseudorandom numbers drawn from a Weibull distribution.\n*\n* @module @stdlib/random/strided/weibull\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var weibull = require( '@stdlib/random/strided/weibull' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* weibull( out.length, [ 2.0 ], 0, [ 5.0 ], 0, out, 1 );\n*\n* @example\n* var Float64Array = require( '@stdlib/array/float64' );\n* var weibull = require( '@stdlib/random/strided/weibull' );\n*\n* // Create an array:\n* var out = new Float64Array( 10 );\n*\n* // Fill the array with pseudorandom numbers:\n* weibull.ndarray( out.length, [ 2.0 ], 0, 0, [ 5.0 ], 0, 0, out, 1, 0 );\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar ndarray = require( './ndarray.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'ndarray', ndarray );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n\n// exports: { \"ndarray\": \"main.ndarray\" }\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-read-only-property' );\n\n\n// MAIN //\n\n/**\n* Top-level namespace.\n*\n* @namespace ns\n*/\nvar ns = {};\n\n/**\n* @name arcsine\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/arcsine}\n*/\nsetReadOnly( ns, 'arcsine', require( './../../strided/arcsine' ) );\n\n/**\n* @name bernoulli\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/bernoulli}\n*/\nsetReadOnly( ns, 'bernoulli', require( './../../strided/bernoulli' ) );\n\n/**\n* @name beta\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/beta}\n*/\nsetReadOnly( ns, 'beta', require( './../../strided/beta' ) );\n\n/**\n* @name betaprime\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/betaprime}\n*/\nsetReadOnly( ns, 'betaprime', require( './../../strided/betaprime' ) );\n\n/**\n* @name chi\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/chi}\n*/\nsetReadOnly( ns, 'chi', require( './../../strided/chi' ) );\n\n/**\n* @name chisquare\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/chisquare}\n*/\nsetReadOnly( ns, 'chisquare', require( './../../strided/chisquare' ) );\n\n/**\n* @name cosine\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/cosine}\n*/\nsetReadOnly( ns, 'cosine', require( './../../strided/cosine' ) );\n\n/**\n* @name discreteUniform\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/discrete-uniform}\n*/\nsetReadOnly( ns, 'discreteUniform', require( './../../strided/discrete-uniform' ) );\n\n/**\n* @name exponential\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/exponential}\n*/\nsetReadOnly( ns, 'exponential', require( './../../strided/exponential' ) );\n\n/**\n* @name gamma\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/gamma}\n*/\nsetReadOnly( ns, 'gamma', require( './../../strided/gamma' ) );\n\n/**\n* @name geometric\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/geometric}\n*/\nsetReadOnly( ns, 'geometric', require( './../../strided/geometric' ) );\n\n/**\n* @name invgamma\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/invgamma}\n*/\nsetReadOnly( ns, 'invgamma', require( './../../strided/invgamma' ) );\n\n/**\n* @name lognormal\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/lognormal}\n*/\nsetReadOnly( ns, 'lognormal', require( './../../strided/lognormal' ) );\n\n/**\n* @name minstd\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/minstd}\n*/\nsetReadOnly( ns, 'minstd', require( './../../strided/minstd' ) );\n\n/**\n* @name minstdShuffle\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/minstd-shuffle}\n*/\nsetReadOnly( ns, 'minstdShuffle', require( './../../strided/minstd-shuffle' ) );\n\n/**\n* @name mt19937\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/mt19937}\n*/\nsetReadOnly( ns, 'mt19937', require( './../../strided/mt19937' ) );\n\n/**\n* @name normal\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/normal}\n*/\nsetReadOnly( ns, 'normal', require( './../../strided/normal' ) );\n\n/**\n* @name poisson\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/poisson}\n*/\nsetReadOnly( ns, 'poisson', require( './../../strided/poisson' ) );\n\n/**\n* @name randu\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/randu}\n*/\nsetReadOnly( ns, 'randu', require( './../../strided/randu' ) );\n\n/**\n* @name uniform\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/uniform}\n*/\nsetReadOnly( ns, 'uniform', require( './../../strided/uniform' ) );\n\n/**\n* @name weibull\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/strided/weibull}\n*/\nsetReadOnly( ns, 'weibull', require( './../../strided/weibull' ) );\n\n\n// EXPORTS //\n\nmodule.exports = ns;\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* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils/define-read-only-property' );\n\n\n// MAIN //\n\n/**\n* Top-level namespace.\n*\n* @namespace ns\n*/\nvar ns = {};\n\n/**\n* @name array\n* @memberof ns\n* @readonly\n* @type {Namespace}\n* @see {@link module:@stdlib/random/array}\n*/\nsetReadOnly( ns, 'array', require( './../array' ) );\n\n/**\n* @name base\n* @memberof ns\n* @readonly\n* @type {Namespace}\n* @see {@link module:@stdlib/random/base}\n*/\nsetReadOnly( ns, 'base', require( './../base' ) );\n\n/**\n* @name iterators\n* @memberof ns\n* @readonly\n* @type {Namespace}\n* @see {@link module:@stdlib/random/iter}\n*/\nsetReadOnly( ns, 'iterators', require( './../iter' ) );\n\n/**\n* @name sample\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/sample}\n*/\nsetReadOnly( ns, 'sample', require( './../sample' ) );\n\n/**\n* @name shuffle\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/random/shuffle}\n*/\nsetReadOnly( ns, 'shuffle', require( './../shuffle' ) );\n\n/**\n* @name streams\n* @memberof ns\n* @readonly\n* @type {Namespace}\n* @see {@link module:@stdlib/random/streams}\n*/\nsetReadOnly( ns, 'streams', require( './../streams' ) );\n\n/**\n* @name strided\n* @memberof ns\n* @readonly\n* @type {Namespace}\n* @see {@link module:@stdlib/random/strided}\n*/\nsetReadOnly( ns, 'strided', require( './../strided' ) );\n\n\n// EXPORTS //\n\nmodule.exports = ns;\n"], + "mappings": "uGAAA,IAAAA,GAAAC,EAAA,SAAAC,IAAAC,GAAA,cAsBA,IAAIC,GAAW,QAAS,gCAAiC,EACrDC,GAAa,QAAS,iCAAkC,EACxDC,GAAW,QAAS,oCAAqC,EACzDC,GAAS,QAAS,uBAAwB,EA0B9C,SAASC,GAAUC,EAAMC,EAAQC,EAAU,CAC1C,OAAMP,GAAUO,CAAQ,EAGnBN,GAAYM,EAAS,OAAQ,IACjCF,EAAK,MAAQE,EAAQ,MAChB,CAACL,GAAUI,EAAQD,EAAK,KAAM,GAC3B,IAAI,UAAWF,GAAQ,gFAAiF,QAASG,EAAO,KAAM,MAAO,EAAGD,EAAK,KAAM,CAAE,EAGvJ,KARC,IAAI,UAAWF,GAAQ,qEAAsEI,CAAQ,CAAE,CAShH,CAKAR,GAAO,QAAUK,KCnEjB,IAAAI,GAAAC,EAAA,SAAAC,IAAAC,GAAA,cAwBA,IAAIC,GAAc,QAAS,uDAAwD,EAC/EC,GAAuB,QAAS,uCAAwC,EAAE,YAC1EC,GAAa,QAAS,4BAA6B,EACnDC,GAAgB,QAAS,gCAAiC,EAAE,WAC5DC,GAAe,QAAS,8BAA+B,EACvDC,GAAW,QAAS,oCAAqC,EACzDC,GAAW,QAAS,8BAA+B,EACnDC,GAAS,QAAS,6BAA8B,EAChDC,GAAQ,QAAS,qBAAsB,EACvCC,GAAS,QAAS,uBAAwB,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AAI,UAAW,IAA0B,EAKtD,OAAO,QAAUA", + "names": ["require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "contains", "format", "validate", "opts", "dtypes", "options", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "isNonNegativeInteger", "isFunction", "isStringArray", "isCollection", "contains", "filledBy", "binary", "ctors", "format", "validate", "Random", "prng", "dtypes", "dtype", "len", "param1", "param2", "options", "ctor", "opts", "out", "err", "dt", "wrapper", "require_lib", "__commonJSMin", "exports", "module", "main", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "contains", "format", "validate", "opts", "dtypes", "options", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "isNonNegativeInteger", "isFunction", "isStringArray", "isCollection", "contains", "filledBy", "nullary", "ctors", "format", "validate", "Random", "prng", "dtypes", "dtype", "len", "options", "ctor", "opts", "out", "err", "dt", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadWriteAccessor", "setReadOnlyAccessor", "setReadOnly", "isStringArray", "isFunction", "isMethodIn", "hasOwnProp", "contains", "constantFunction", "noop", "BinaryRandom", "NullaryRandom", "format", "createFactory", "prng", "dtypes", "dtype", "isValidDataType", "factory", "Random", "random", "param1", "param2", "assign", "nargs", "base", "opts", "rand", "dt", "rand1", "rand2", "assign1", "assign2", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "len", "options", "out", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "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", "M", "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", "initState", "seed", "i", "j", "k", "twist", "w", "factory", "options", "STATE", "opts", "slen", "err", "mt19937", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "normalized", "len", "out", "r", "x", "require_main", "__commonJSMin", "exports", "module", "factory", "randuint32", "mt19937", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isNumber", "format", "isnan", "validate", "a", "b", "require_arcsine", "__commonJSMin", "exports", "module", "pow", "sin", "HALF_PI", "arcsine", "rand", "a", "b", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "typedarray2json", "format", "validate", "arcsine0", "factory", "opts", "rand", "prng", "err", "a", "b", "arcsine2", "arcsine1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "arcsine", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "binaryFactory", "dtypes", "defaults", "base", "DTYPES", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "arcsine", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "contains", "format", "validate", "opts", "dtypes", "options", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "isNonNegativeInteger", "isFunction", "isStringArray", "isCollection", "contains", "filledBy", "unary", "ctors", "format", "validate", "Random", "prng", "dtypes", "dtype", "len", "param1", "options", "ctor", "opts", "out", "err", "dt", "wrapper", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadWriteAccessor", "setReadOnlyAccessor", "setReadOnly", "isStringArray", "isFunction", "isMethodIn", "isPlainObject", "hasOwnProp", "contains", "constantFunction", "noop", "UnaryRandom", "NullaryRandom", "format", "createFactory", "prng", "dtypes", "dtype", "isValidDataType", "factory", "Random", "random", "param1", "assign", "nargs", "base", "opts", "rand", "dt", "rand1", "rand2", "assign1", "assign2", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "len", "options", "out", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isProbability", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "typedarray2json", "format", "factory", "opts", "rand", "prng", "p", "bernoulli2", "bernoulli1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "bernoulli", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "unaryFactory", "dtypes", "defaults", "base", "DTYPES", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "bernoulli", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_coords_array", "__commonJSMin", "exports", "module", "sqrt", "exp", "ln", "V", "coordsArray", "N", "rTail", "X", "f", "i", "require_ratio_array", "__commonJSMin", "exports", "module", "ratioArray", "X", "R", "i", "require_sample_tail", "__commonJSMin", "exports", "module", "ln", "sampleTail", "rand", "rTail", "isNegative", "x", "y", "require_improved_ziggurat", "__commonJSMin", "exports", "module", "abs", "exp", "coordsArray", "ratioArray", "sampleTail", "NUM_BLOCKS", "START_RIGHT_TAIL", "X", "R", "LAST_7_BITS_MASK", "wrap", "randu", "randi", "randn", "f0", "f1", "x2", "x", "u", "i", "j", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isFunction", "isObject", "isBoolean", "hasOwnProp", "isUint32Array", "mt19937", "constantFunction", "noop", "floor", "UINT32_MAX", "typedarray2json", "format", "improvedZiggurat", "factory", "options", "randu", "randi", "randn", "opts", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "randn", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isPositive", "format", "validate", "alpha", "beta", "require_standard_gamma", "__commonJSMin", "exports", "module", "ln", "sqrt", "pow", "ONE_THIRD", "standardGamma", "randu", "randn", "alpha", "flg", "x2", "v0", "v1", "c", "d", "x", "s", "u", "v", "require_sample1", "__commonJSMin", "exports", "module", "pow", "ln", "sample", "randu", "randn", "alpha", "flg", "s4", "A", "s", "t", "u", "x", "y", "require_sample2", "__commonJSMin", "exports", "module", "pow", "ln", "sample", "randu", "randn", "alpha", "beta", "sigma", "flg", "mu", "A", "B", "C", "L", "s", "u", "x", "y", "require_sample3", "__commonJSMin", "exports", "module", "exp", "pow", "ln", "sample", "rand", "alpha", "beta", "lx", "ly", "xy", "v", "x", "y", "require_beta", "__commonJSMin", "exports", "module", "standardGamma", "sample1", "sample2", "sample3", "sample", "randu", "randn", "alpha", "beta", "ga", "gb", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isBoolean", "isFunction", "hasOwnProp", "constantFunction", "noop", "randn", "randu", "isnan", "gcopy", "Uint32Array", "isUint32Array", "assign", "typedarray2json", "format", "validate", "beta0", "factory", "STATE", "rnorm", "alpha", "beta", "opts", "rand", "prng", "FLG", "err", "beta2", "beta1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "beta", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "binaryFactory", "dtypes", "defaults", "base", "DTYPES", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "beta", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isPositive", "format", "validate", "alpha", "beta", "require_gamma", "__commonJSMin", "exports", "module", "ln", "gamma", "randu", "randn", "beta", "d", "c", "flg", "x2", "v0", "v1", "x", "u", "v", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isUint32Array", "isBoolean", "isFunction", "hasOwnProp", "constantFunction", "noop", "randn", "randu", "isnan", "sqrt", "pow", "gcopy", "Uint32Array", "typedarray2json", "assign", "format", "validate", "gamma0", "ONE_THIRD", "factory", "STATE", "alpha", "rnorm", "beta", "opts", "rand", "prng", "FLG", "err", "c", "d", "gamma2", "gamma1a", "gamma1b", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "gamma", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isPositive", "format", "validate", "alpha", "beta", "require_betaprime", "__commonJSMin", "exports", "module", "sample", "rgamma", "alpha", "beta", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "constantFunction", "noop", "gammaFactory", "isnan", "typedarray2json", "format", "validate", "betaprime0", "factory", "rgamma", "alpha", "beta", "opts", "rand", "prng", "err", "betaprime2", "betaprime1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "betaprime", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "binaryFactory", "dtypes", "defaults", "base", "DTYPES", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "betaprime", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isPositiveInteger", "isProbability", "format", "validate", "n", "p", "require_sample1", "__commonJSMin", "exports", "module", "sample", "rand", "n", "p", "sum", "i", "require_correction", "__commonJSMin", "exports", "module", "pow", "ONE_12", "ONE_360", "ONE_1260", "correction", "k", "v", "require_sample2", "__commonJSMin", "exports", "module", "floor", "sign", "sqrt", "abs", "ln", "correction", "ONE_SIXTH", "sample", "rand", "n", "p", "alpha", "urvr", "snpq", "npq", "rho", "tmp", "nm", "nr", "us", "km", "nk", "vr", "a", "b", "c", "f", "h", "i", "k", "m", "q", "r", "t", "u", "v", "x", "require_binomial", "__commonJSMin", "exports", "module", "sample1", "sample2", "sample", "rand", "n", "p", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "isnan", "isPositiveInteger", "isProbability", "randu", "typedarray2json", "format", "validate", "binomial0", "factory", "opts", "rand", "prng", "err", "p", "binomial2", "binomial1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "n", "require_main", "__commonJSMin", "exports", "module", "factory", "binomial", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "binaryFactory", "dtypes", "defaults", "base", "DTYPES", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "binomial", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isNumber", "isPositive", "format", "isnan", "validate", "x0", "gamma", "require_cauchy", "__commonJSMin", "exports", "module", "tan", "PI", "cauchy", "randn", "x0", "gamma", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "isnan", "randn", "typedarray2json", "format", "validate", "cauchy0", "factory", "gamma", "rnorm", "opts", "rand", "prng", "err", "x0", "cauchy2", "cauchy1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "cauchy", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "binaryFactory", "dtypes", "defaults", "base", "DTYPES", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "cauchy", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isPositive", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "isnan", "gamma", "typedarray2json", "format", "factory", "rgamma", "rand", "opts", "prng", "k", "chisquare2", "chisquare1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "chisquare", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isPositive", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "isnan", "chisquare", "typedarray2json", "sqrt", "format", "factory", "rchisq", "rand", "opts", "prng", "k", "chi2", "chi1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "chi", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "unaryFactory", "dtypes", "defaults", "base", "DTYPES", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "chi", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "unaryFactory", "dtypes", "defaults", "base", "DTYPES", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "chisquare", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isNumber", "isPositive", "format", "isnan", "validate", "mu", "s", "require_cosine", "__commonJSMin", "exports", "module", "quantile", "sample", "rand", "mu", "s", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "typedarray2json", "format", "validate", "cosine0", "factory", "opts", "rand", "prng", "err", "mu", "s", "cosine2", "cosine1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "cosine", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "binaryFactory", "dtypes", "defaults", "base", "DTYPES", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "cosine", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isInteger", "format", "isnan", "validate", "a", "b", "require_discrete_uniform", "__commonJSMin", "exports", "module", "MAX_SAFE_INTEGER", "floor", "discreteUniform", "rand", "a", "b", "result", "RANGE", "range", "limit", "bsize", "mult", "MIN", "MAX", "inc", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randi", "isnan", "isInteger", "typedarray2json", "format", "validate", "discreteUniform0", "factory", "opts", "rand", "prng", "err", "a", "b", "discreteUniform2", "discreteUniform1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "discreteUniform", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "binaryFactory", "dtypes", "defaults", "base", "DTYPES", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "discreteUniform", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isPositive", "isPositiveInteger", "format", "validate", "k", "lambda", "require_erlang", "__commonJSMin", "exports", "module", "ln", "erlang", "rand", "k", "lambda", "prod", "i", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "isPositiveInteger", "typedarray2json", "format", "validate", "erlang0", "factory", "lambda", "rand", "opts", "prng", "err", "k", "erlang2", "erlang1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "erlang", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "binaryFactory", "dtypes", "defaults", "base", "DTYPES", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "erlang", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_exponential", "__commonJSMin", "exports", "module", "ln", "exponential", "rand", "lambda", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isPositive", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "typedarray2json", "format", "exponential0", "factory", "lambda", "opts", "rand", "prng", "exponential2", "exponential1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "exponential", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "unaryFactory", "dtypes", "defaults", "base", "DTYPES", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "exponential", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isPositive", "format", "validate", "d1", "d2", "require_f", "__commonJSMin", "exports", "module", "f", "rchisq", "d1", "d2", "x1", "x2", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "chisquare", "isnan", "typedarray2json", "format", "validate", "f0", "factory", "rchisq", "opts", "rand", "prng", "err", "d1", "d2", "f2", "f1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "f", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "binaryFactory", "dtypes", "defaults", "base", "DTYPES", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "f", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "contains", "format", "validate", "opts", "dtypes", "options", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "isNonNegativeInteger", "isFunction", "isStringArray", "isCollection", "contains", "filledBy", "ternary", "ctors", "format", "validate", "Random", "prng", "dtypes", "dtype", "len", "param1", "param2", "param3", "options", "ctor", "opts", "out", "err", "dt", "wrapper", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadWriteAccessor", "setReadOnlyAccessor", "setReadOnly", "isStringArray", "isFunction", "isMethodIn", "hasOwnProp", "contains", "constantFunction", "noop", "TernaryRandom", "NullaryRandom", "format", "createFactory", "prng", "dtypes", "dtype", "isValidDataType", "factory", "Random", "random", "param1", "param2", "param3", "assign", "nargs", "base", "opts", "rand", "dt", "rand1", "rand2", "assign1", "assign2", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "len", "options", "out", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_validate", "__commonJSMin", "exports", "module", "isPositiveNumber", "isNumber", "isnan", "format", "validate", "alpha", "s", "m", "require_frechet", "__commonJSMin", "exports", "module", "pow", "ln", "frechet", "rand", "alpha", "s", "m", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "typedarray2json", "format", "validate", "frechet0", "factory", "alpha", "opts", "rand", "prng", "err", "s", "m", "frechet2", "frechet1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "frechet", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "ternaryFactory", "dtypes", "defaults", "base", "DTYPES", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "frechet", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "binaryFactory", "dtypes", "defaults", "base", "DTYPES", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "gamma", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_geometric", "__commonJSMin", "exports", "module", "floor", "ln", "geometric", "rand", "p", "u", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isProbability", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "typedarray2json", "format", "geometric0", "factory", "opts", "rand", "prng", "p", "geometric2", "geometric1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "geometric", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "unaryFactory", "dtypes", "defaults", "base", "DTYPES", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "geometric", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isNumber", "isPositive", "format", "isnan", "validate", "mu", "beta", "require_gumbel", "__commonJSMin", "exports", "module", "ln", "gumbel", "rand", "mu", "beta", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "typedarray2json", "format", "validate", "gumbel0", "factory", "beta", "opts", "rand", "prng", "err", "mu", "gumbel2", "gumbel1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "gumbel", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "binaryFactory", "dtypes", "defaults", "base", "DTYPES", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "gumbel", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isNonNegativeInteger", "format", "validate", "N", "K", "n", "require_hin", "__commonJSMin", "exports", "module", "factorial", "hin", "rand", "n1", "n2", "k", "p", "u", "x", "require_hypergeometric", "__commonJSMin", "exports", "module", "hin", "hypergeometric", "rand", "N", "K", "n", "n1", "n2", "k", "x", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isNonNegativeInteger", "PINF", "typedarray2json", "format", "validate", "hypergeometric0", "factory", "opts", "rand", "prng", "err", "N", "K", "n", "hypergeometric2", "hypergeometric1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "hypergeometric", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "ternaryFactory", "dtypes", "defaults", "base", "DTYPES", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "hypergeometric", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isPositive", "format", "validate", "alpha", "beta", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "gamma", "isnan", "typedarray2json", "format", "validate", "factory", "rgamma", "alpha", "beta", "opts", "rand", "prng", "err", "invgamma2", "invgamma1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "invgamma", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "binaryFactory", "dtypes", "defaults", "base", "DTYPES", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "invgamma", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isPositive", "format", "validate", "a", "b", "require_kumaraswamy", "__commonJSMin", "exports", "module", "pow", "sample", "rand", "a", "b", "u", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "typedarray2json", "format", "validate", "kumaraswamy0", "factory", "opts", "rand", "prng", "err", "a", "b", "kumaraswamy2", "kumaraswamy1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "kumaraswamy", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "binaryFactory", "dtypes", "defaults", "base", "DTYPES", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "kumaraswamy", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isNumber", "isPositive", "format", "isnan", "validate", "mu", "b", "require_laplace", "__commonJSMin", "exports", "module", "sign", "abs", "ln", "laplace", "rand", "mu", "b", "u", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "typedarray2json", "format", "validate", "laplace0", "factory", "opts", "rand", "prng", "err", "mu", "b", "laplace2", "laplace1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "laplace", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "binaryFactory", "dtypes", "defaults", "base", "DTYPES", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "laplace", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isNumber", "isPositive", "format", "isnan", "validate", "mu", "c", "require_levy", "__commonJSMin", "exports", "module", "normalQuantile", "levy", "rand", "mu", "c", "z", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "typedarray2json", "format", "validate", "levy0", "factory", "opts", "rand", "prng", "err", "mu", "c", "levy2", "levy1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "levy", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "binaryFactory", "dtypes", "defaults", "base", "DTYPES", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "levy", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isNumber", "isPositive", "isnan", "format", "validate", "mu", "s", "require_logistic", "__commonJSMin", "exports", "module", "ln", "logistic", "rand", "mu", "s", "u", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "typedarray2json", "format", "validate", "logistic0", "factory", "opts", "rand", "prng", "err", "mu", "s", "logistic2", "logistic1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "logistic", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "binaryFactory", "dtypes", "defaults", "base", "DTYPES", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "logistic", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isNumber", "isPositive", "format", "isnan", "validate", "mu", "sigma", "require_lognormal", "__commonJSMin", "exports", "module", "exp", "lognormal", "randn", "mu", "sigma", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randn", "isnan", "typedarray2json", "format", "validate", "lognormal0", "factory", "sigma", "rnorm", "opts", "rand", "prng", "err", "mu", "lognormal2", "lognormal1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "lognormal", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "binaryFactory", "dtypes", "defaults", "base", "DTYPES", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "lognormal", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_rand_int32", "__commonJSMin", "exports", "module", "INT32_MAX", "floor", "MAX", "randint32", "v", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "hasOwnProp", "isObject", "isBoolean", "isCollection", "isPositiveInteger", "isInt32Array", "format", "INT32_MAX", "Int32Array", "gcopy", "typedarray2json", "randint32", "NORMALIZATION_CONSTANT", "MAX_SEED", "A", "STATE_ARRAY_VERSION", "NUM_STATE_SECTIONS", "STATE_SECTION_OFFSET", "SEED_SECTION_OFFSET", "STATE_FIXED_LENGTH", "verifyState", "state", "FLG", "s1", "factory", "options", "STATE", "opts", "seed", "slen", "err", "minstd", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "normalized", "len", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "randint32", "minstd", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "fdtypes", "rdtypes", "isObject", "hasOwnProp", "format", "RDTYPES", "FDTYPES", "validate", "opts", "options", "mode", "require_factory", "__commonJSMin", "exports", "module", "isNonNegativeInteger", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "base", "ctors", "filledBy", "nullary", "format", "defaults", "validate", "factory", "options", "nargs", "opts", "rand", "prng", "err", "minstd", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "normalized", "len", "ctor", "out", "dt", "o", "s", "require_main", "__commonJSMin", "exports", "module", "factory", "minstd", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_create_table", "__commonJSMin", "exports", "module", "isnan", "NUM_WARMUPS", "createTable", "rand", "table", "N", "v", "i", "require_rand_int32", "__commonJSMin", "exports", "module", "INT32_MAX", "floor", "MAX", "randint32", "v", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "hasOwnProp", "isObject", "isBoolean", "isCollection", "isPositiveInteger", "isInt32Array", "gcopy", "floor", "Int32Array", "INT32_MAX", "typedarray2json", "format", "createTable", "randint32", "NORMALIZATION_CONSTANT", "MAX_SEED", "A", "TABLE_LENGTH", "STATE_ARRAY_VERSION", "NUM_STATE_SECTIONS", "TABLE_SECTION_OFFSET", "STATE_SECTION_OFFSET", "SEED_SECTION_OFFSET", "STATE_FIXED_LENGTH", "SHUFFLE_STATE", "PRNG_STATE", "verifyState", "state", "FLG", "s1", "factory", "options", "STATE", "opts", "seed", "slen", "err", "minstd", "minstdShuffle", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "normalized", "len", "s", "out", "i", "require_main", "__commonJSMin", "exports", "module", "factory", "randint32", "minstd", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "fdtypes", "rdtypes", "isObject", "hasOwnProp", "format", "RDTYPES", "FDTYPES", "validate", "opts", "options", "mode", "require_factory", "__commonJSMin", "exports", "module", "isNonNegativeInteger", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "base", "ctors", "filledBy", "nullary", "format", "defaults", "validate", "factory", "options", "nargs", "opts", "rand", "prng", "err", "minstd", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "normalized", "len", "ctor", "out", "dt", "o", "s", "require_main", "__commonJSMin", "exports", "module", "factory", "minstd", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "fdtypes", "rdtypes", "isObject", "hasOwnProp", "format", "RDTYPES", "FDTYPES", "validate", "opts", "options", "mode", "require_factory", "__commonJSMin", "exports", "module", "isNonNegativeInteger", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "base", "ctors", "filledBy", "nullary", "format", "defaults", "validate", "factory", "options", "nargs", "opts", "rand", "prng", "err", "mt19937", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "normalized", "len", "ctor", "out", "dt", "o", "s", "require_main", "__commonJSMin", "exports", "module", "factory", "mt19937", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_knuth", "__commonJSMin", "exports", "module", "exp", "poisson", "rand", "lambda", "p", "k", "require_rejection", "__commonJSMin", "exports", "module", "factorialln", "floor", "sign", "sqrt", "abs", "ln", "LN_SQRT_TWO_PI", "ONE_12", "ONE_360", "poisson", "rand", "lambda", "slambda", "ainv", "urvr", "us", "vr", "a", "b", "k", "u", "v", "require_poisson", "__commonJSMin", "exports", "module", "knuth", "rejection", "poisson", "rand", "lambda", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isPositive", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "typedarray2json", "format", "poisson0", "factory", "lambda", "opts", "rand", "prng", "poisson2", "poisson1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "poisson", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isPositive", "isNumber", "format", "isnan", "validate", "p", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "hasOwnProp", "isObject", "isUint32Array", "isBoolean", "isFunction", "constantFunction", "noop", "isnan", "poisson", "gamma", "gcopy", "Uint32Array", "assign", "typedarray2json", "format", "validate", "factory", "rgamma", "STATE", "rpois", "opts", "prng", "rand", "FLG", "err", "p", "r", "negativeBinomial2", "negativeBinomial1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "negativeBinomial", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "binaryFactory", "dtypes", "defaults", "base", "DTYPES", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "negativeBinomial", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isNumber", "isPositive", "format", "isnan", "validate", "mu", "sigma", "require_normal", "__commonJSMin", "exports", "module", "normal", "rand", "mu", "sigma", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randn", "isnan", "typedarray2json", "format", "validate", "normal0", "factory", "sigma", "rnorm", "opts", "rand", "prng", "err", "mu", "normal2", "normal1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "normal", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "binaryFactory", "dtypes", "defaults", "base", "DTYPES", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "normal", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isPositive", "format", "validate", "alpha", "beta", "require_pareto", "__commonJSMin", "exports", "module", "pow", "pareto", "rand", "alpha", "beta", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "typedarray2json", "format", "validate", "pareto0", "factory", "alpha", "beta", "opts", "rand", "prng", "err", "pareto2", "pareto1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "pareto1", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "binaryFactory", "dtypes", "defaults", "base", "DTYPES", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "pareto1", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "unaryFactory", "dtypes", "defaults", "base", "DTYPES", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "poisson", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_prngs", "__commonJSMin", "exports", "module", "minstd", "minstdShuffle", "mt19937", "prngs", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isBoolean", "hasOwnProp", "typedarray2json", "format", "defaults", "PRNGS", "factory", "options", "opts", "rand", "prng", "uniform", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "randu", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "dtypes", "isObject", "hasOwnProp", "format", "DTYPES", "validate", "opts", "options", "require_factory", "__commonJSMin", "exports", "module", "isNonNegativeInteger", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "base", "ctors", "filledBy", "nullary", "format", "defaults", "validate", "factory", "options", "nargs", "opts", "rand", "prng", "err", "randu", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "len", "ctor", "out", "dt", "o", "s", "require_main", "__commonJSMin", "exports", "module", "factory", "randu", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_rayleigh", "__commonJSMin", "exports", "module", "sqrt", "ln", "rayleigh", "rand", "sigma", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isPositive", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "typedarray2json", "format", "rayleigh0", "factory", "sigma", "opts", "rand", "prng", "rayleigh2", "rayleigh1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "rayleigh", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "unaryFactory", "dtypes", "defaults", "base", "DTYPES", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "rayleigh", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "hasOwnProp", "isPositive", "isObject", "isUint32Array", "isBoolean", "isnan", "isFunction", "constantFunction", "noop", "chisquare", "randn", "gcopy", "Uint32Array", "assign", "typedarray2json", "format", "sqrt", "factory", "rchisq", "STATE", "rnorm", "rand", "opts", "prng", "FLG", "v", "t2", "t1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "t", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "unaryFactory", "dtypes", "defaults", "base", "DTYPES", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "t", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isNumber", "format", "isnan", "validate", "a", "b", "c", "require_triangular", "__commonJSMin", "exports", "module", "sqrt", "triangular", "rand", "a", "b", "c", "fc", "x", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "typedarray2json", "format", "validate", "triangular0", "factory", "opts", "rand", "prng", "err", "a", "b", "c", "triangular2", "triangular1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "triangular", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "ternaryFactory", "dtypes", "defaults", "base", "DTYPES", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "triangular", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isNumber", "format", "isnan", "validate", "a", "b", "require_uniform", "__commonJSMin", "exports", "module", "uniform", "rand", "a", "b", "r", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "typedarray2json", "format", "validate", "uniform0", "factory", "opts", "rand", "prng", "err", "a", "b", "uniform2", "uniform1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "uniform", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "binaryFactory", "dtypes", "defaults", "base", "DTYPES", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "uniform", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_validate", "__commonJSMin", "exports", "module", "isPositive", "format", "validate", "k", "lambda", "require_weibull", "__commonJSMin", "exports", "module", "pow", "ln", "weibull", "rand", "k", "lambda", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "randu", "isnan", "typedarray2json", "format", "validate", "weibull0", "factory", "lambda", "opts", "rand", "prng", "err", "k", "weibull2", "weibull1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "weibull", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "binaryFactory", "dtypes", "defaults", "base", "DTYPES", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "weibull", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "ns", "require_randn", "__commonJSMin", "exports", "module", "sqrt", "ln", "sin", "cos", "TWO_PI", "wrap", "rand", "flg", "r", "randn", "u1", "u2", "a", "b", "require_min", "__commonJSMin", "exports", "module", "sqrt", "ln", "cos", "PI", "COS_PI", "getMin", "min", "a", "require_max", "__commonJSMin", "exports", "module", "sqrt", "ln", "cos", "TWO_PI", "getMax", "min", "a", "b", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "isBoolean", "hasOwnProp", "isUint32Array", "mt19937", "constantFunction", "noop", "typedarray2json", "format", "randn0", "getMin", "getMax", "factory", "options", "randu", "randn", "rand", "opts", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "randn", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_prngs", "__commonJSMin", "exports", "module", "minstd", "minstdShuffle", "mt19937", "prngs", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isBoolean", "hasOwnProp", "typedarray2json", "format", "defaults", "PRNGS", "factory", "options", "opts", "rand", "prng", "randi", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "randi", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_prngs", "__commonJSMin", "exports", "module", "boxMuller", "improvedZiggurat", "prngs", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isBoolean", "hasOwnProp", "constantFunction", "format", "noop", "typedarray2json", "defaults", "PRNGS", "factory", "options", "opts", "rand", "prng", "normal", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "normal", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_prngs", "__commonJSMin", "exports", "module", "prng0", "prng1", "prng2", "prng3", "prng4", "prng5", "prng6", "prng7", "prng8", "prng9", "prng10", "prng11", "prng12", "prng13", "prng14", "prng15", "prng16", "prng17", "prng18", "prng19", "prng20", "prng21", "prng22", "prng23", "prng24", "prng25", "prng26", "prng27", "prng28", "prng29", "prng30", "prng31", "prng32", "prng33", "prng34", "prng35", "prng36", "prng37", "prng38", "prng39", "prng40", "prngs", "require_main", "__commonJSMin", "exports", "module", "isString", "isObject", "isArray", "contains", "Int32Array", "Uint32Array", "table", "TYPED_ARRAY_CTORS", "PRNG_WRAPPERS", "reviveBasePRNG", "key", "value", "factory", "opts", "args", "ctor", "tmp", "error", "require_lib", "__commonJSMin", "exports", "module", "main", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "random", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isNumber", "isnan", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rarcsine", "iteratorSymbol", "format", "iterator", "a", "b", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isProbability", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rbern", "iteratorSymbol", "format", "iterator", "p", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isPositiveNumber", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rbeta", "iteratorSymbol", "format", "iterator", "alpha", "beta", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isPositiveNumber", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rbetaprime", "iteratorSymbol", "format", "iterator", "alpha", "beta", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isProbability", "isObject", "isPositiveInteger", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rbinom", "iteratorSymbol", "format", "iterator", "n", "p", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rnorm", "iteratorSymbol", "format", "iterator", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isNumber", "isnan", "isObject", "isNonNegativeInteger", "isPositive", "hasOwnProp", "MAX_VALUE", "rcauchy", "iteratorSymbol", "format", "iterator", "x0", "gamma", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isPositive", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rchi", "iteratorSymbol", "format", "iterator", "k", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isPositive", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rchisq", "iteratorSymbol", "format", "iterator", "k", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isNumber", "isnan", "isObject", "isNonNegativeInteger", "isPositive", "hasOwnProp", "MAX_VALUE", "rcosine", "iteratorSymbol", "format", "iterator", "mu", "s", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isInteger", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "runif", "iteratorSymbol", "format", "iterator", "a", "b", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isPositiveNumber", "isObject", "isNonNegativeInteger", "isPositiveInteger", "hasOwnProp", "MAX_VALUE", "rerlang", "iteratorSymbol", "format", "iterator", "k", "lambda", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isPositive", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rexp", "iteratorSymbol", "format", "iterator", "lambda", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isPositiveNumber", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rf", "iteratorSymbol", "format", "iterator", "d1", "d2", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isPositiveNumber", "isObject", "isNumber", "isnan", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rfrechet", "iteratorSymbol", "format", "iterator", "alpha", "s", "m", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isPositiveNumber", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rgamma", "iteratorSymbol", "format", "iterator", "alpha", "beta", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isProbability", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rgeom", "iteratorSymbol", "format", "iterator", "p", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isNumber", "isnan", "isObject", "isNonNegativeInteger", "isPositive", "hasOwnProp", "MAX_VALUE", "rgumbel", "iteratorSymbol", "format", "iterator", "mu", "beta", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rhypergeom", "iteratorSymbol", "format", "iterator", "N", "K", "n", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rnorm", "iteratorSymbol", "format", "iterator", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isPositiveNumber", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rinvgamma", "iteratorSymbol", "format", "iterator", "alpha", "beta", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isPositiveNumber", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rkumaraswamy", "iteratorSymbol", "format", "iterator", "a", "b", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isNumber", "isnan", "isObject", "isNonNegativeInteger", "isPositive", "hasOwnProp", "MAX_VALUE", "rlaplace", "iteratorSymbol", "format", "iterator", "mu", "b", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isNumber", "isnan", "isObject", "isNonNegativeInteger", "isPositive", "hasOwnProp", "MAX_VALUE", "rlevy", "iteratorSymbol", "format", "iterator", "mu", "c", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isNumber", "isnan", "isObject", "isNonNegativeInteger", "isPositive", "hasOwnProp", "MAX_VALUE", "rlogis", "iteratorSymbol", "format", "iterator", "mu", "s", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isNumber", "isnan", "isObject", "isNonNegativeInteger", "isPositive", "hasOwnProp", "MAX_VALUE", "rlognorm", "iteratorSymbol", "format", "iterator", "mu", "sigma", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "assign", "isObject", "isBoolean", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "minstd", "iteratorSymbol", "format", "iterator", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "assign", "isObject", "isBoolean", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "minstd", "iteratorSymbol", "format", "iterator", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "assign", "isObject", "isBoolean", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "mt19937", "iteratorSymbol", "format", "iterator", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isProbability", "isObject", "isPositiveNumber", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rnbinom", "iteratorSymbol", "format", "iterator", "p", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isNumber", "isnan", "isObject", "isNonNegativeInteger", "isPositive", "hasOwnProp", "MAX_VALUE", "rnorm", "iteratorSymbol", "format", "iterator", "mu", "sigma", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isPositiveNumber", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rpareto", "iteratorSymbol", "format", "iterator", "alpha", "beta", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isPositive", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rpois", "iteratorSymbol", "format", "iterator", "lambda", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "assign", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "randi", "iteratorSymbol", "format", "iterator", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "randn", "iteratorSymbol", "format", "iterator", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "assign", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "randu", "iteratorSymbol", "format", "iterator", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isPositive", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rrayleigh", "iteratorSymbol", "format", "iterator", "sigma", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isPositive", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rt", "iteratorSymbol", "format", "iterator", "v", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isNumber", "isnan", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rtriangular", "iteratorSymbol", "format", "iterator", "a", "b", "c", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isNumber", "isnan", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "runif", "iteratorSymbol", "format", "iterator", "a", "b", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "constantFunction", "noop", "assign", "isPositiveNumber", "isObject", "isNonNegativeInteger", "hasOwnProp", "MAX_VALUE", "rweibull", "iteratorSymbol", "format", "iterator", "k", "lambda", "options", "opts", "iter", "rand", "FLG", "i", "next", "end", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "factory", "value", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "ns", "require_discrete_uniform", "__commonJSMin", "exports", "module", "floor", "discreteUniform", "x", "size", "rand", "pos", "out", "N", "i", "require_renormalizing", "__commonJSMin", "exports", "module", "renormalizing", "x", "size", "rand", "probabilities", "probs", "psum", "out", "N", "i", "j", "k", "u", "require_fisher_yates", "__commonJSMin", "exports", "module", "floor", "slice", "fisherYates", "x", "size", "rand", "tmp", "N", "i", "j", "require_vose", "__commonJSMin", "exports", "module", "floor", "vose", "x", "size", "rand", "probabilities", "small", "large", "probs", "alias", "out", "N", "p", "g", "i", "l", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isNonNegativeInteger", "isUnityProbabilityArray", "hasOwnProp", "isBoolean", "isObject", "format", "validate", "opts", "options", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "isArrayLike", "isTypedArrayLike", "isString", "format", "randu", "copy", "discreteUniform", "renormalizing", "fisherYates", "vose", "defaults", "validate", "slice", "factory", "config", "pool", "conf", "rand", "err", "fcn", "sample1", "sample2", "x", "options", "replace", "xcopy", "probs", "opts", "size", "mutate", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "sample", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "hasOwnProp", "isString", "isObject", "indexOf", "format", "COPY_OPTIONS", "validate", "opts", "options", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "isArrayLike", "isTypedArrayLike", "isString", "deepCopy", "floor", "randu", "format", "defaults", "validate", "factory", "config", "conf", "rand", "err", "shuffle", "arr", "options", "strflg", "level", "copy", "opts", "out", "tmp", "N", "i", "j", "require_main", "__commonJSMin", "exports", "module", "factory", "shuffle", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isNumber", "isnan", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rarcsine", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "a", "b", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "format", "assign", "RandomStream", "objectMode", "a", "b", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "a", "b", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isProbability", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rbern", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "p", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "format", "assign", "RandomStream", "objectMode", "p", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "isProbability", "format", "assign", "RandomStream", "factory", "p", "options", "nargs", "opts", "fcn", "createStream2", "createStream1", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rbeta", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "alpha", "beta", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "format", "assign", "RandomStream", "objectMode", "alpha", "beta", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "alpha", "beta", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rbetaprime", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "alpha", "beta", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "format", "assign", "RandomStream", "objectMode", "alpha", "beta", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "alpha", "beta", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isPlainObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveInteger", "isProbability", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rbinom", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "n", "p", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "objectMode", "n", "p", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "n", "p", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "randn", "string2buffer", "nextTick", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "options", "opts", "createStream", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isNumber", "isnan", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rcauchy", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "x0", "gamma", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "x0", "gamma", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "x0", "gamma", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rchi", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "k", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "k", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "isPositive", "assign", "format", "RandomStream", "factory", "k", "options", "nargs", "opts", "fcn", "createStream2", "createStream1", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rchisquare", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "k", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "k", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPositive", "isPlainObject", "assign", "format", "RandomStream", "factory", "k", "options", "nargs", "opts", "fcn", "createStream2", "createStream1", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isNumber", "isnan", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rcosine", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "mu", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "mu", "s", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "mu", "s", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isInteger", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rduniform", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "a", "b", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "a", "b", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "a", "b", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveInteger", "isPositiveNumber", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rerlang", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "k", "lambda", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "k", "lambda", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "k", "lambda", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rexponential", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "lambda", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "lambda", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPositive", "isPlainObject", "assign", "format", "RandomStream", "factory", "lambda", "options", "nargs", "opts", "fcn", "createStream2", "createStream1", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rf", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "d1", "d2", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "d1", "d2", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "d1", "d2", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isNumber", "isnan", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rfrechet", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "alpha", "m", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "alpha", "s", "m", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "alpha", "s", "m", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rgamma", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "alpha", "beta", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "alpha", "beta", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "alpha", "beta", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isProbability", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rgeom", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "p", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "p", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isProbability", "isPlainObject", "assign", "format", "RandomStream", "factory", "p", "options", "nargs", "opts", "fcn", "createStream2", "createStream1", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isNumber", "isnan", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rgumbel", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "mu", "beta", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "mu", "beta", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "mu", "beta", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isNonNegativeInteger", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rhypergeom", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "N", "K", "n", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "N", "K", "n", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "N", "K", "n", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "randn", "string2buffer", "nextTick", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "options", "opts", "createStream", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rinvgamma", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "alpha", "beta", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "alpha", "beta", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "alpha", "beta", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rkumaraswamy", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "a", "b", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "a", "b", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "a", "b", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isNumber", "isnan", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rlaplace", "string2buffer", "format", "nextTick", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "mu", "b", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "mu", "b", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "mu", "b", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isNumber", "isnan", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rlevy", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "mu", "c", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "mu", "c", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "mu", "c", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isNumber", "isnan", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rlogistic", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "mu", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "mu", "s", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "mu", "s", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isNumber", "isnan", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rlognormal", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "mu", "sigma", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "mu", "sigma", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "mu", "sigma", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "minstd", "string2buffer", "nextTick", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "options", "prng", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "options", "opts", "createStream", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "minstd", "string2buffer", "nextTick", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "options", "prng", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "options", "opts", "createStream", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "mt19937", "string2buffer", "nextTick", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "options", "prng", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "options", "opts", "createStream", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isPlainObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isProbability", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rnbinom", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "p", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "objectMode", "p", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "p", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "r", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isNumber", "isnan", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rnorm", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "mu", "sigma", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "mu", "sigma", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "mu", "sigma", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isPlainObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rpareto1", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "alpha", "beta", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "objectMode", "alpha", "beta", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "alpha", "beta", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rpoisson", "string2buffer", "format", "nextTick", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "lambda", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "lambda", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPositive", "isPlainObject", "assign", "format", "RandomStream", "factory", "lambda", "options", "nargs", "opts", "fcn", "createStream2", "createStream1", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "randi", "string2buffer", "nextTick", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "options", "opts", "createStream", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "randn", "string2buffer", "nextTick", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "options", "opts", "createStream", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "randu", "string2buffer", "nextTick", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "options", "opts", "createStream", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rrayleigh", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "sigma", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "sigma", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPositive", "isPlainObject", "assign", "format", "RandomStream", "factory", "sigma", "options", "nargs", "opts", "fcn", "createStream2", "createStream1", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rt", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "v", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "v", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPositive", "isPlainObject", "assign", "format", "RandomStream", "factory", "v", "options", "nargs", "opts", "fcn", "createStream2", "createStream1", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isNumber", "isnan", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rtriang", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "a", "b", "c", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "a", "b", "c", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "a", "b", "c", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isNumber", "isnan", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "runiform", "string2buffer", "nextTick", "format", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "a", "b", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "a", "b", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "a", "b", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_debug", "__commonJSMin", "exports", "module", "logger", "debug", "require_main", "__commonJSMin", "exports", "module", "Readable", "isPositiveNumber", "isError", "assign", "inherit", "setNonEnumerable", "setNonEnumerableReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "rweibull", "string2buffer", "format", "nextTick", "DEFAULTS", "validate", "debug", "getSeed", "getSeedLength", "getStateLength", "getStateSize", "getState", "setState", "s", "read", "FLG", "r", "destroy", "error", "self", "close", "RandomStream", "k", "lambda", "options", "opts", "err", "require_object_mode", "__commonJSMin", "exports", "module", "isObject", "assign", "format", "RandomStream", "objectMode", "k", "lambda", "options", "opts", "require_factory", "__commonJSMin", "exports", "module", "isPlainObject", "assign", "format", "RandomStream", "factory", "k", "lambda", "options", "nargs", "opts", "fcn", "createStream1", "createStream2", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "objectMode", "factory", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "ns", "require_prng", "__commonJSMin", "exports", "module", "isAccessorArray", "random", "clbk", "x", "sx", "ox", "y", "sy", "oy", "hasOptions", "options", "out", "v1", "v2", "require_main", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "arcsine", "N", "a", "sa", "b", "sb", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "arcsine", "N", "a", "sa", "oa", "b", "sb", "ob", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_main", "__commonJSMin", "exports", "module", "setReadWriteAccessor", "setReadOnlyAccessor", "setReadOnly", "isFunction", "isMethodIn", "isPlainObject", "constantFunction", "noop", "unary", "format", "createFactory", "prng", "factory", "base", "opts", "rand", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "ndarray", "N", "param1", "sp1", "out", "so", "op1", "oo", "s", "require_lib", "__commonJSMin", "exports", "module", "main", "require_factory", "__commonJSMin", "exports", "module", "unaryFactory", "base", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "bernoulli", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_prng", "__commonJSMin", "exports", "module", "isAccessorArray", "random", "clbk", "x", "sx", "ox", "y", "sy", "oy", "hasOptions", "options", "out", "v1", "v2", "require_main", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "beta", "N", "alpha", "sa", "sb", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "beta", "N", "alpha", "sa", "oa", "sb", "ob", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_prng", "__commonJSMin", "exports", "module", "isAccessorArray", "random", "clbk", "x", "sx", "ox", "y", "sy", "oy", "hasOptions", "options", "out", "v1", "v2", "require_main", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "betaprime", "N", "alpha", "sa", "beta", "sb", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "betaprime", "N", "alpha", "sa", "oa", "beta", "sb", "ob", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_factory", "__commonJSMin", "exports", "module", "unaryFactory", "base", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "chi", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_factory", "__commonJSMin", "exports", "module", "unaryFactory", "base", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "chisquare", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_prng", "__commonJSMin", "exports", "module", "isAccessorArray", "random", "clbk", "x", "sx", "ox", "y", "sy", "oy", "hasOptions", "options", "out", "v1", "v2", "require_main", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "cosine", "N", "mu", "sm", "s", "ss", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "cosine", "N", "mu", "sm", "om", "s", "ss", "os", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_prng", "__commonJSMin", "exports", "module", "isAccessorArray", "random", "clbk", "x", "sx", "ox", "y", "sy", "oy", "hasOptions", "options", "out", "v1", "v2", "require_main", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "discreteUniform", "N", "a", "sa", "b", "sb", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "discreteUniform", "N", "a", "sa", "oa", "b", "sb", "ob", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_factory", "__commonJSMin", "exports", "module", "unaryFactory", "base", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "exponential", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_prng", "__commonJSMin", "exports", "module", "isAccessorArray", "random", "clbk", "x", "sx", "ox", "y", "sy", "oy", "hasOptions", "options", "out", "v1", "v2", "require_main", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "gamma", "N", "alpha", "sa", "beta", "sb", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "gamma", "N", "alpha", "sa", "oa", "beta", "sb", "ob", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_factory", "__commonJSMin", "exports", "module", "unaryFactory", "base", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "geometric", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_prng", "__commonJSMin", "exports", "module", "isAccessorArray", "random", "clbk", "x", "sx", "ox", "y", "sy", "oy", "hasOptions", "options", "out", "v1", "v2", "require_main", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "invgamma", "N", "alpha", "sa", "beta", "sb", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "invgamma", "N", "alpha", "sa", "oa", "beta", "sb", "ob", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_prng", "__commonJSMin", "exports", "module", "isAccessorArray", "random", "clbk", "x", "sx", "ox", "y", "sy", "oy", "hasOptions", "options", "out", "v1", "v2", "require_main", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "lognormal", "N", "mu", "sm", "sigma", "ss", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "lognormal", "N", "mu", "sm", "om", "sigma", "ss", "os", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_main", "__commonJSMin", "exports", "module", "nullary", "random", "minstd", "N", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "random", "minstd", "N", "out", "so", "oo", "options", "rand", "require_normalized", "__commonJSMin", "exports", "module", "nullary", "random", "minstd", "N", "out", "so", "options", "rand", "require_normalized_ndarray", "__commonJSMin", "exports", "module", "nullary", "random", "minstd", "N", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "normalized", "ndarrayNormalized", "require_main", "__commonJSMin", "exports", "module", "nullary", "random", "minstd", "N", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "random", "minstd", "N", "out", "so", "oo", "options", "rand", "require_normalized", "__commonJSMin", "exports", "module", "nullary", "random", "minstd", "N", "out", "so", "options", "rand", "require_normalized_ndarray", "__commonJSMin", "exports", "module", "nullary", "random", "minstd", "N", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "normalized", "ndarrayNormalized", "require_main", "__commonJSMin", "exports", "module", "nullary", "random", "mt19937", "N", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "random", "mt19937", "N", "out", "so", "oo", "options", "rand", "require_normalized", "__commonJSMin", "exports", "module", "nullary", "random", "mt19937", "N", "out", "so", "options", "rand", "require_normalized_ndarray", "__commonJSMin", "exports", "module", "nullary", "random", "mt19937", "N", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "normalized", "ndarrayNormalized", "require_prng", "__commonJSMin", "exports", "module", "isAccessorArray", "random", "clbk", "x", "sx", "ox", "y", "sy", "oy", "hasOptions", "options", "out", "v1", "v2", "require_main", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "normal", "N", "mu", "sm", "sigma", "ss", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "normal", "N", "mu", "sm", "om", "sigma", "ss", "os", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_factory", "__commonJSMin", "exports", "module", "unaryFactory", "base", "factory", "require_main", "__commonJSMin", "exports", "module", "factory", "poisson", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "factory", "require_main", "__commonJSMin", "exports", "module", "nullary", "random", "randu", "N", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "random", "randu", "N", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_prng", "__commonJSMin", "exports", "module", "isAccessorArray", "random", "clbk", "x", "sx", "ox", "y", "sy", "oy", "hasOptions", "options", "out", "v1", "v2", "require_main", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "uniform", "N", "a", "sa", "b", "sb", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "uniform", "N", "a", "sa", "oa", "b", "sb", "ob", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_prng", "__commonJSMin", "exports", "module", "isAccessorArray", "random", "clbk", "x", "sx", "ox", "y", "sy", "oy", "hasOptions", "options", "out", "v1", "v2", "require_main", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "weibull", "N", "k", "sk", "lambda", "sl", "out", "so", "options", "rand", "require_ndarray", "__commonJSMin", "exports", "module", "nullary", "binary", "prng", "weibull", "N", "k", "sk", "ok", "lambda", "sl", "ol", "out", "so", "oo", "options", "rand", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "main", "ndarray", "require_lib", "__commonJSMin", "exports", "module", "setReadOnly", "ns", "setReadOnly", "ns"] } diff --git a/strided/bernoulli/test/test.factory.js b/strided/bernoulli/test/test.factory.js index 10b3167b..b1d25f68 100644 --- a/strided/bernoulli/test/test.factory.js +++ b/strided/bernoulli/test/test.factory.js @@ -447,7 +447,7 @@ tape( 'the function returns a function which returns a reference to the output a x1 = [ PARAM1[ 0 ] ]; out = zeros( 10, 'generic' ); - actual = random( out.length, x1, 1, out, 1 ); + actual = random( out.length, x1, 0, out, 1 ); t.strictEqual( actual, out, 'same reference' ); x1 = [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ]; @@ -471,10 +471,10 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the returned func out = zeros( 10, 'generic' ); expected = zeros( 10, 'generic' ); - random( -1, x1, 1, out, 1 ); + random( -1, x1, 0, out, 1 ); t.deepEqual( out, expected, 'returns expected value' ); - random( 0, x1, 1, out, 1 ); + random( 0, x1, 0, out, 1 ); t.deepEqual( out, expected, 'returns expected value' ); x1 = [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ]; @@ -502,10 +502,10 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the returned func out = zeros( 10, 'generic' ); expected = zeros( 10, 'generic' ); - random( -1, x1, 1, toAccessorArray( out ), 1 ); + random( -1, x1, 0, toAccessorArray( out ), 1 ); t.deepEqual( out, expected, 'returns expected value' ); - random( 0, x1, 1, toAccessorArray( out ), 1 ); + random( 0, x1, 0, toAccessorArray( out ), 1 ); t.deepEqual( out, expected, 'returns expected value' ); x1 = toAccessorArray( [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ] ); @@ -1255,7 +1255,7 @@ tape( 'the function returns a function having an `ndarray` method which returns x1 = [ PARAM1[ 0 ] ]; out = zeros( 10, 'generic' ); - actual = random.ndarray( out.length, x1, 1, 0, out, 1, 0 ); + actual = random.ndarray( out.length, x1, 0, 0, out, 1, 0 ); t.strictEqual( actual, out, 'same reference' ); x1 = [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ]; @@ -1279,10 +1279,10 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the `ndarray` met out = zeros( 10, 'generic' ); expected = zeros( 10, 'generic' ); - random.ndarray( -1, x1, 1, 0, out, 1, 0 ); + random.ndarray( -1, x1, 0, 0, out, 1, 0 ); t.deepEqual( out, expected, 'returns expected value' ); - random.ndarray( 0, x1, 1, 0, out, 1, 0 ); + random.ndarray( 0, x1, 0, 0, out, 1, 0 ); t.deepEqual( out, expected, 'returns expected value' ); x1 = [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ]; @@ -1310,10 +1310,10 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the `ndarray` met out = zeros( 10, 'generic' ); expected = zeros( 10, 'generic' ); - random.ndarray( -1, x1, 1, 0, toAccessorArray( out ), 1, 0 ); + random.ndarray( -1, x1, 0, 0, toAccessorArray( out ), 1, 0 ); t.deepEqual( out, expected, 'returns expected value' ); - random.ndarray( 0, x1, 1, 0, toAccessorArray( out ), 1, 0 ); + random.ndarray( 0, x1, 0, 0, toAccessorArray( out ), 1, 0 ); t.deepEqual( out, expected, 'returns expected value' ); x1 = toAccessorArray( [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ] ); diff --git a/strided/bernoulli/test/test.main.js b/strided/bernoulli/test/test.main.js index 310d75ca..d923d85c 100644 --- a/strided/bernoulli/test/test.main.js +++ b/strided/bernoulli/test/test.main.js @@ -107,7 +107,7 @@ tape( 'the function returns a reference to the output array', function test( t ) x1 = [ PARAM1[ 0 ] ]; out = zeros( 10, 'generic' ); - actual = random( out.length, x1, 1, out, 1 ); + actual = random( out.length, x1, 0, out, 1 ); t.strictEqual( actual, out, 'same reference' ); x1 = [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ]; @@ -128,10 +128,10 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the function leav out = zeros( 10, 'generic' ); expected = zeros( 10, 'generic' ); - random( -1, x1, 1, out, 1 ); + random( -1, x1, 0, out, 1 ); t.deepEqual( out, expected, 'returns expected value' ); - random( 0, x1, 1, out, 1 ); + random( 0, x1, 0, out, 1 ); t.deepEqual( out, expected, 'returns expected value' ); x1 = [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ]; @@ -156,10 +156,10 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the function leav out = zeros( 10, 'generic' ); expected = zeros( 10, 'generic' ); - random( -1, x1, 1, toAccessorArray( out ), 1 ); + random( -1, x1, 0, toAccessorArray( out ), 1 ); t.deepEqual( out, expected, 'returns expected value' ); - random( 0, x1, 1, toAccessorArray( out ), 1 ); + random( 0, x1, 0, toAccessorArray( out ), 1 ); t.deepEqual( out, expected, 'returns expected value' ); x1 = toAccessorArray( [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ] ); diff --git a/strided/bernoulli/test/test.ndarray.js b/strided/bernoulli/test/test.ndarray.js index 5a3a609a..5b3e3191 100644 --- a/strided/bernoulli/test/test.ndarray.js +++ b/strided/bernoulli/test/test.ndarray.js @@ -107,7 +107,7 @@ tape( 'the function returns a reference to the output array', function test( t ) x1 = [ PARAM1[ 0 ] ]; out = zeros( 10, 'generic' ); - actual = random( out.length, x1, 1, 0, out, 1, 0 ); + actual = random( out.length, x1, 0, 0, out, 1, 0 ); t.strictEqual( actual, out, 'same reference' ); x1 = [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ]; @@ -128,10 +128,10 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the function leav out = zeros( 10, 'generic' ); expected = zeros( 10, 'generic' ); - random( -1, x1, 1, 0, out, 1, 0 ); + random( -1, x1, 0, 0, out, 1, 0 ); t.deepEqual( out, expected, 'returns expected value' ); - random( 0, x1, 1, 0, out, 1, 0 ); + random( 0, x1, 0, 0, out, 1, 0 ); t.deepEqual( out, expected, 'returns expected value' ); x1 = [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ]; @@ -156,10 +156,10 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the function leav out = zeros( 10, 'generic' ); expected = zeros( 10, 'generic' ); - random( -1, x1, 1, 0, toAccessorArray( out ), 1, 0 ); + random( -1, x1, 0, 0, toAccessorArray( out ), 1, 0 ); t.deepEqual( out, expected, 'returns expected value' ); - random( 0, x1, 1, 0, toAccessorArray( out ), 1, 0 ); + random( 0, x1, 0, 0, toAccessorArray( out ), 1, 0 ); t.deepEqual( out, expected, 'returns expected value' ); x1 = toAccessorArray( [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ] ); diff --git a/strided/chi/test/test.factory.js b/strided/chi/test/test.factory.js index 941d3335..e8da88f3 100644 --- a/strided/chi/test/test.factory.js +++ b/strided/chi/test/test.factory.js @@ -447,7 +447,7 @@ tape( 'the function returns a function which returns a reference to the output a x1 = [ PARAM1[ 0 ] ]; out = zeros( 10, 'generic' ); - actual = random( out.length, x1, 1, out, 1 ); + actual = random( out.length, x1, 0, out, 1 ); t.strictEqual( actual, out, 'same reference' ); x1 = [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ]; @@ -471,10 +471,10 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the returned func out = zeros( 10, 'generic' ); expected = zeros( 10, 'generic' ); - random( -1, x1, 1, out, 1 ); + random( -1, x1, 0, out, 1 ); t.deepEqual( out, expected, 'returns expected value' ); - random( 0, x1, 1, out, 1 ); + random( 0, x1, 0, out, 1 ); t.deepEqual( out, expected, 'returns expected value' ); x1 = [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ]; @@ -502,10 +502,10 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the returned func out = zeros( 10, 'generic' ); expected = zeros( 10, 'generic' ); - random( -1, x1, 1, toAccessorArray( out ), 1 ); + random( -1, x1, 0, toAccessorArray( out ), 1 ); t.deepEqual( out, expected, 'returns expected value' ); - random( 0, x1, 1, toAccessorArray( out ), 1 ); + random( 0, x1, 0, toAccessorArray( out ), 1 ); t.deepEqual( out, expected, 'returns expected value' ); x1 = toAccessorArray( [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ] ); @@ -1255,7 +1255,7 @@ tape( 'the function returns a function having an `ndarray` method which returns x1 = [ PARAM1[ 0 ] ]; out = zeros( 10, 'generic' ); - actual = random.ndarray( out.length, x1, 1, 0, out, 1, 0 ); + actual = random.ndarray( out.length, x1, 0, 0, out, 1, 0 ); t.strictEqual( actual, out, 'same reference' ); x1 = [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ]; @@ -1279,10 +1279,10 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the `ndarray` met out = zeros( 10, 'generic' ); expected = zeros( 10, 'generic' ); - random.ndarray( -1, x1, 1, 0, out, 1, 0 ); + random.ndarray( -1, x1, 0, 0, out, 1, 0 ); t.deepEqual( out, expected, 'returns expected value' ); - random.ndarray( 0, x1, 1, 0, out, 1, 0 ); + random.ndarray( 0, x1, 0, 0, out, 1, 0 ); t.deepEqual( out, expected, 'returns expected value' ); x1 = [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ]; @@ -1310,10 +1310,10 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the `ndarray` met out = zeros( 10, 'generic' ); expected = zeros( 10, 'generic' ); - random.ndarray( -1, x1, 1, 0, toAccessorArray( out ), 1, 0 ); + random.ndarray( -1, x1, 0, 0, toAccessorArray( out ), 1, 0 ); t.deepEqual( out, expected, 'returns expected value' ); - random.ndarray( 0, x1, 1, 0, toAccessorArray( out ), 1, 0 ); + random.ndarray( 0, x1, 0, 0, toAccessorArray( out ), 1, 0 ); t.deepEqual( out, expected, 'returns expected value' ); x1 = toAccessorArray( [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ] ); diff --git a/strided/chi/test/test.main.js b/strided/chi/test/test.main.js index cf5ad5d6..bafb8fdd 100644 --- a/strided/chi/test/test.main.js +++ b/strided/chi/test/test.main.js @@ -107,7 +107,7 @@ tape( 'the function returns a reference to the output array', function test( t ) x1 = [ PARAM1[ 0 ] ]; out = zeros( 10, 'generic' ); - actual = random( out.length, x1, 1, out, 1 ); + actual = random( out.length, x1, 0, out, 1 ); t.strictEqual( actual, out, 'same reference' ); x1 = [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ]; @@ -128,10 +128,10 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the function leav out = zeros( 10, 'generic' ); expected = zeros( 10, 'generic' ); - random( -1, x1, 1, out, 1 ); + random( -1, x1, 0, out, 1 ); t.deepEqual( out, expected, 'returns expected value' ); - random( 0, x1, 1, out, 1 ); + random( 0, x1, 0, out, 1 ); t.deepEqual( out, expected, 'returns expected value' ); x1 = [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ]; @@ -156,10 +156,10 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the function leav out = zeros( 10, 'generic' ); expected = zeros( 10, 'generic' ); - random( -1, x1, 1, toAccessorArray( out ), 1 ); + random( -1, x1, 0, toAccessorArray( out ), 1 ); t.deepEqual( out, expected, 'returns expected value' ); - random( 0, x1, 1, toAccessorArray( out ), 1 ); + random( 0, x1, 0, toAccessorArray( out ), 1 ); t.deepEqual( out, expected, 'returns expected value' ); x1 = toAccessorArray( [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ] ); diff --git a/strided/chi/test/test.ndarray.js b/strided/chi/test/test.ndarray.js index cf372493..826482a2 100644 --- a/strided/chi/test/test.ndarray.js +++ b/strided/chi/test/test.ndarray.js @@ -107,7 +107,7 @@ tape( 'the function returns a reference to the output array', function test( t ) x1 = [ PARAM1[ 0 ] ]; out = zeros( 10, 'generic' ); - actual = random( out.length, x1, 1, 0, out, 1, 0 ); + actual = random( out.length, x1, 0, 0, out, 1, 0 ); t.strictEqual( actual, out, 'same reference' ); x1 = [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ]; @@ -128,10 +128,10 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the function leav out = zeros( 10, 'generic' ); expected = zeros( 10, 'generic' ); - random( -1, x1, 1, 0, out, 1, 0 ); + random( -1, x1, 0, 0, out, 1, 0 ); t.deepEqual( out, expected, 'returns expected value' ); - random( 0, x1, 1, 0, out, 1, 0 ); + random( 0, x1, 0, 0, out, 1, 0 ); t.deepEqual( out, expected, 'returns expected value' ); x1 = [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ]; @@ -156,10 +156,10 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the function leav out = zeros( 10, 'generic' ); expected = zeros( 10, 'generic' ); - random( -1, x1, 1, 0, toAccessorArray( out ), 1, 0 ); + random( -1, x1, 0, 0, toAccessorArray( out ), 1, 0 ); t.deepEqual( out, expected, 'returns expected value' ); - random( 0, x1, 1, 0, toAccessorArray( out ), 1, 0 ); + random( 0, x1, 0, 0, toAccessorArray( out ), 1, 0 ); t.deepEqual( out, expected, 'returns expected value' ); x1 = toAccessorArray( [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ] ); diff --git a/strided/chisquare/test/test.factory.js b/strided/chisquare/test/test.factory.js index 715311c5..7142fb2d 100644 --- a/strided/chisquare/test/test.factory.js +++ b/strided/chisquare/test/test.factory.js @@ -447,7 +447,7 @@ tape( 'the function returns a function which returns a reference to the output a x1 = [ PARAM1[ 0 ] ]; out = zeros( 10, 'generic' ); - actual = random( out.length, x1, 1, out, 1 ); + actual = random( out.length, x1, 0, out, 1 ); t.strictEqual( actual, out, 'same reference' ); x1 = [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ]; @@ -471,10 +471,10 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the returned func out = zeros( 10, 'generic' ); expected = zeros( 10, 'generic' ); - random( -1, x1, 1, out, 1 ); + random( -1, x1, 0, out, 1 ); t.deepEqual( out, expected, 'returns expected value' ); - random( 0, x1, 1, out, 1 ); + random( 0, x1, 0, out, 1 ); t.deepEqual( out, expected, 'returns expected value' ); x1 = [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ]; @@ -502,10 +502,10 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the returned func out = zeros( 10, 'generic' ); expected = zeros( 10, 'generic' ); - random( -1, x1, 1, toAccessorArray( out ), 1 ); + random( -1, x1, 0, toAccessorArray( out ), 1 ); t.deepEqual( out, expected, 'returns expected value' ); - random( 0, x1, 1, toAccessorArray( out ), 1 ); + random( 0, x1, 0, toAccessorArray( out ), 1 ); t.deepEqual( out, expected, 'returns expected value' ); x1 = toAccessorArray( [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ] ); @@ -1255,7 +1255,7 @@ tape( 'the function returns a function having an `ndarray` method which returns x1 = [ PARAM1[ 0 ] ]; out = zeros( 10, 'generic' ); - actual = random.ndarray( out.length, x1, 1, 0, out, 1, 0 ); + actual = random.ndarray( out.length, x1, 0, 0, out, 1, 0 ); t.strictEqual( actual, out, 'same reference' ); x1 = [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ]; @@ -1279,10 +1279,10 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the `ndarray` met out = zeros( 10, 'generic' ); expected = zeros( 10, 'generic' ); - random.ndarray( -1, x1, 1, 0, out, 1, 0 ); + random.ndarray( -1, x1, 0, 0, out, 1, 0 ); t.deepEqual( out, expected, 'returns expected value' ); - random.ndarray( 0, x1, 1, 0, out, 1, 0 ); + random.ndarray( 0, x1, 0, 0, out, 1, 0 ); t.deepEqual( out, expected, 'returns expected value' ); x1 = [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ]; @@ -1310,10 +1310,10 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the `ndarray` met out = zeros( 10, 'generic' ); expected = zeros( 10, 'generic' ); - random.ndarray( -1, x1, 1, 0, toAccessorArray( out ), 1, 0 ); + random.ndarray( -1, x1, 0, 0, toAccessorArray( out ), 1, 0 ); t.deepEqual( out, expected, 'returns expected value' ); - random.ndarray( 0, x1, 1, 0, toAccessorArray( out ), 1, 0 ); + random.ndarray( 0, x1, 0, 0, toAccessorArray( out ), 1, 0 ); t.deepEqual( out, expected, 'returns expected value' ); x1 = toAccessorArray( [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ] ); diff --git a/strided/chisquare/test/test.main.js b/strided/chisquare/test/test.main.js index cf5ad5d6..bafb8fdd 100644 --- a/strided/chisquare/test/test.main.js +++ b/strided/chisquare/test/test.main.js @@ -107,7 +107,7 @@ tape( 'the function returns a reference to the output array', function test( t ) x1 = [ PARAM1[ 0 ] ]; out = zeros( 10, 'generic' ); - actual = random( out.length, x1, 1, out, 1 ); + actual = random( out.length, x1, 0, out, 1 ); t.strictEqual( actual, out, 'same reference' ); x1 = [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ]; @@ -128,10 +128,10 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the function leav out = zeros( 10, 'generic' ); expected = zeros( 10, 'generic' ); - random( -1, x1, 1, out, 1 ); + random( -1, x1, 0, out, 1 ); t.deepEqual( out, expected, 'returns expected value' ); - random( 0, x1, 1, out, 1 ); + random( 0, x1, 0, out, 1 ); t.deepEqual( out, expected, 'returns expected value' ); x1 = [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ]; @@ -156,10 +156,10 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the function leav out = zeros( 10, 'generic' ); expected = zeros( 10, 'generic' ); - random( -1, x1, 1, toAccessorArray( out ), 1 ); + random( -1, x1, 0, toAccessorArray( out ), 1 ); t.deepEqual( out, expected, 'returns expected value' ); - random( 0, x1, 1, toAccessorArray( out ), 1 ); + random( 0, x1, 0, toAccessorArray( out ), 1 ); t.deepEqual( out, expected, 'returns expected value' ); x1 = toAccessorArray( [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ] ); diff --git a/strided/chisquare/test/test.ndarray.js b/strided/chisquare/test/test.ndarray.js index cf372493..826482a2 100644 --- a/strided/chisquare/test/test.ndarray.js +++ b/strided/chisquare/test/test.ndarray.js @@ -107,7 +107,7 @@ tape( 'the function returns a reference to the output array', function test( t ) x1 = [ PARAM1[ 0 ] ]; out = zeros( 10, 'generic' ); - actual = random( out.length, x1, 1, 0, out, 1, 0 ); + actual = random( out.length, x1, 0, 0, out, 1, 0 ); t.strictEqual( actual, out, 'same reference' ); x1 = [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ]; @@ -128,10 +128,10 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the function leav out = zeros( 10, 'generic' ); expected = zeros( 10, 'generic' ); - random( -1, x1, 1, 0, out, 1, 0 ); + random( -1, x1, 0, 0, out, 1, 0 ); t.deepEqual( out, expected, 'returns expected value' ); - random( 0, x1, 1, 0, out, 1, 0 ); + random( 0, x1, 0, 0, out, 1, 0 ); t.deepEqual( out, expected, 'returns expected value' ); x1 = [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ]; @@ -156,10 +156,10 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the function leav out = zeros( 10, 'generic' ); expected = zeros( 10, 'generic' ); - random( -1, x1, 1, 0, toAccessorArray( out ), 1, 0 ); + random( -1, x1, 0, 0, toAccessorArray( out ), 1, 0 ); t.deepEqual( out, expected, 'returns expected value' ); - random( 0, x1, 1, 0, toAccessorArray( out ), 1, 0 ); + random( 0, x1, 0, 0, toAccessorArray( out ), 1, 0 ); t.deepEqual( out, expected, 'returns expected value' ); x1 = toAccessorArray( [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ] ); diff --git a/strided/exponential/test/test.factory.js b/strided/exponential/test/test.factory.js index 1030020a..51065a8d 100644 --- a/strided/exponential/test/test.factory.js +++ b/strided/exponential/test/test.factory.js @@ -447,7 +447,7 @@ tape( 'the function returns a function which returns a reference to the output a x1 = [ PARAM1[ 0 ] ]; out = zeros( 10, 'generic' ); - actual = random( out.length, x1, 1, out, 1 ); + actual = random( out.length, x1, 0, out, 1 ); t.strictEqual( actual, out, 'same reference' ); x1 = [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ]; @@ -471,10 +471,10 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the returned func out = zeros( 10, 'generic' ); expected = zeros( 10, 'generic' ); - random( -1, x1, 1, out, 1 ); + random( -1, x1, 0, out, 1 ); t.deepEqual( out, expected, 'returns expected value' ); - random( 0, x1, 1, out, 1 ); + random( 0, x1, 0, out, 1 ); t.deepEqual( out, expected, 'returns expected value' ); x1 = [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ]; @@ -502,10 +502,10 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the returned func out = zeros( 10, 'generic' ); expected = zeros( 10, 'generic' ); - random( -1, x1, 1, toAccessorArray( out ), 1 ); + random( -1, x1, 0, toAccessorArray( out ), 1 ); t.deepEqual( out, expected, 'returns expected value' ); - random( 0, x1, 1, toAccessorArray( out ), 1 ); + random( 0, x1, 0, toAccessorArray( out ), 1 ); t.deepEqual( out, expected, 'returns expected value' ); x1 = toAccessorArray( [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ] ); @@ -1255,7 +1255,7 @@ tape( 'the function returns a function having an `ndarray` method which returns x1 = [ PARAM1[ 0 ] ]; out = zeros( 10, 'generic' ); - actual = random.ndarray( out.length, x1, 1, 0, out, 1, 0 ); + actual = random.ndarray( out.length, x1, 0, 0, out, 1, 0 ); t.strictEqual( actual, out, 'same reference' ); x1 = [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ]; @@ -1279,10 +1279,10 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the `ndarray` met out = zeros( 10, 'generic' ); expected = zeros( 10, 'generic' ); - random.ndarray( -1, x1, 1, 0, out, 1, 0 ); + random.ndarray( -1, x1, 0, 0, out, 1, 0 ); t.deepEqual( out, expected, 'returns expected value' ); - random.ndarray( 0, x1, 1, 0, out, 1, 0 ); + random.ndarray( 0, x1, 0, 0, out, 1, 0 ); t.deepEqual( out, expected, 'returns expected value' ); x1 = [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ]; @@ -1310,10 +1310,10 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the `ndarray` met out = zeros( 10, 'generic' ); expected = zeros( 10, 'generic' ); - random.ndarray( -1, x1, 1, 0, toAccessorArray( out ), 1, 0 ); + random.ndarray( -1, x1, 0, 0, toAccessorArray( out ), 1, 0 ); t.deepEqual( out, expected, 'returns expected value' ); - random.ndarray( 0, x1, 1, 0, toAccessorArray( out ), 1, 0 ); + random.ndarray( 0, x1, 0, 0, toAccessorArray( out ), 1, 0 ); t.deepEqual( out, expected, 'returns expected value' ); x1 = toAccessorArray( [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ] ); diff --git a/strided/exponential/test/test.main.js b/strided/exponential/test/test.main.js index 49c5e7b7..2e316200 100644 --- a/strided/exponential/test/test.main.js +++ b/strided/exponential/test/test.main.js @@ -107,7 +107,7 @@ tape( 'the function returns a reference to the output array', function test( t ) x1 = [ PARAM1[ 0 ] ]; out = zeros( 10, 'generic' ); - actual = random( out.length, x1, 1, out, 1 ); + actual = random( out.length, x1, 0, out, 1 ); t.strictEqual( actual, out, 'same reference' ); x1 = [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ]; @@ -128,10 +128,10 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the function leav out = zeros( 10, 'generic' ); expected = zeros( 10, 'generic' ); - random( -1, x1, 1, out, 1 ); + random( -1, x1, 0, out, 1 ); t.deepEqual( out, expected, 'returns expected value' ); - random( 0, x1, 1, out, 1 ); + random( 0, x1, 0, out, 1 ); t.deepEqual( out, expected, 'returns expected value' ); x1 = [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ]; @@ -156,10 +156,10 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the function leav out = zeros( 10, 'generic' ); expected = zeros( 10, 'generic' ); - random( -1, x1, 1, toAccessorArray( out ), 1 ); + random( -1, x1, 0, toAccessorArray( out ), 1 ); t.deepEqual( out, expected, 'returns expected value' ); - random( 0, x1, 1, toAccessorArray( out ), 1 ); + random( 0, x1, 0, toAccessorArray( out ), 1 ); t.deepEqual( out, expected, 'returns expected value' ); x1 = toAccessorArray( [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ] ); diff --git a/strided/exponential/test/test.ndarray.js b/strided/exponential/test/test.ndarray.js index 95293e28..ad803809 100644 --- a/strided/exponential/test/test.ndarray.js +++ b/strided/exponential/test/test.ndarray.js @@ -107,7 +107,7 @@ tape( 'the function returns a reference to the output array', function test( t ) x1 = [ PARAM1[ 0 ] ]; out = zeros( 10, 'generic' ); - actual = random( out.length, x1, 1, 0, out, 1, 0 ); + actual = random( out.length, x1, 0, 0, out, 1, 0 ); t.strictEqual( actual, out, 'same reference' ); x1 = [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ]; @@ -128,10 +128,10 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the function leav out = zeros( 10, 'generic' ); expected = zeros( 10, 'generic' ); - random( -1, x1, 1, 0, out, 1, 0 ); + random( -1, x1, 0, 0, out, 1, 0 ); t.deepEqual( out, expected, 'returns expected value' ); - random( 0, x1, 1, 0, out, 1, 0 ); + random( 0, x1, 0, 0, out, 1, 0 ); t.deepEqual( out, expected, 'returns expected value' ); x1 = [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ]; @@ -156,10 +156,10 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the function leav out = zeros( 10, 'generic' ); expected = zeros( 10, 'generic' ); - random( -1, x1, 1, 0, toAccessorArray( out ), 1, 0 ); + random( -1, x1, 0, 0, toAccessorArray( out ), 1, 0 ); t.deepEqual( out, expected, 'returns expected value' ); - random( 0, x1, 1, 0, toAccessorArray( out ), 1, 0 ); + random( 0, x1, 0, 0, toAccessorArray( out ), 1, 0 ); t.deepEqual( out, expected, 'returns expected value' ); x1 = toAccessorArray( [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ] ); diff --git a/strided/geometric/test/test.factory.js b/strided/geometric/test/test.factory.js index eff69998..f9caf29f 100644 --- a/strided/geometric/test/test.factory.js +++ b/strided/geometric/test/test.factory.js @@ -447,7 +447,7 @@ tape( 'the function returns a function which returns a reference to the output a x1 = [ PARAM1[ 0 ] ]; out = zeros( 10, 'generic' ); - actual = random( out.length, x1, 1, out, 1 ); + actual = random( out.length, x1, 0, out, 1 ); t.strictEqual( actual, out, 'same reference' ); x1 = [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ]; @@ -471,10 +471,10 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the returned func out = zeros( 10, 'generic' ); expected = zeros( 10, 'generic' ); - random( -1, x1, 1, out, 1 ); + random( -1, x1, 0, out, 1 ); t.deepEqual( out, expected, 'returns expected value' ); - random( 0, x1, 1, out, 1 ); + random( 0, x1, 0, out, 1 ); t.deepEqual( out, expected, 'returns expected value' ); x1 = [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ]; @@ -502,10 +502,10 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the returned func out = zeros( 10, 'generic' ); expected = zeros( 10, 'generic' ); - random( -1, x1, 1, toAccessorArray( out ), 1 ); + random( -1, x1, 0, toAccessorArray( out ), 1 ); t.deepEqual( out, expected, 'returns expected value' ); - random( 0, x1, 1, toAccessorArray( out ), 1 ); + random( 0, x1, 0, toAccessorArray( out ), 1 ); t.deepEqual( out, expected, 'returns expected value' ); x1 = toAccessorArray( [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ] ); @@ -1255,7 +1255,7 @@ tape( 'the function returns a function having an `ndarray` method which returns x1 = [ PARAM1[ 0 ] ]; out = zeros( 10, 'generic' ); - actual = random.ndarray( out.length, x1, 1, 0, out, 1, 0 ); + actual = random.ndarray( out.length, x1, 0, 0, out, 1, 0 ); t.strictEqual( actual, out, 'same reference' ); x1 = [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ]; @@ -1279,10 +1279,10 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the `ndarray` met out = zeros( 10, 'generic' ); expected = zeros( 10, 'generic' ); - random.ndarray( -1, x1, 1, 0, out, 1, 0 ); + random.ndarray( -1, x1, 0, 0, out, 1, 0 ); t.deepEqual( out, expected, 'returns expected value' ); - random.ndarray( 0, x1, 1, 0, out, 1, 0 ); + random.ndarray( 0, x1, 0, 0, out, 1, 0 ); t.deepEqual( out, expected, 'returns expected value' ); x1 = [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ]; @@ -1310,10 +1310,10 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the `ndarray` met out = zeros( 10, 'generic' ); expected = zeros( 10, 'generic' ); - random.ndarray( -1, x1, 1, 0, toAccessorArray( out ), 1, 0 ); + random.ndarray( -1, x1, 0, 0, toAccessorArray( out ), 1, 0 ); t.deepEqual( out, expected, 'returns expected value' ); - random.ndarray( 0, x1, 1, 0, toAccessorArray( out ), 1, 0 ); + random.ndarray( 0, x1, 0, 0, toAccessorArray( out ), 1, 0 ); t.deepEqual( out, expected, 'returns expected value' ); x1 = toAccessorArray( [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ] ); diff --git a/strided/geometric/test/test.main.js b/strided/geometric/test/test.main.js index 310d75ca..d923d85c 100644 --- a/strided/geometric/test/test.main.js +++ b/strided/geometric/test/test.main.js @@ -107,7 +107,7 @@ tape( 'the function returns a reference to the output array', function test( t ) x1 = [ PARAM1[ 0 ] ]; out = zeros( 10, 'generic' ); - actual = random( out.length, x1, 1, out, 1 ); + actual = random( out.length, x1, 0, out, 1 ); t.strictEqual( actual, out, 'same reference' ); x1 = [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ]; @@ -128,10 +128,10 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the function leav out = zeros( 10, 'generic' ); expected = zeros( 10, 'generic' ); - random( -1, x1, 1, out, 1 ); + random( -1, x1, 0, out, 1 ); t.deepEqual( out, expected, 'returns expected value' ); - random( 0, x1, 1, out, 1 ); + random( 0, x1, 0, out, 1 ); t.deepEqual( out, expected, 'returns expected value' ); x1 = [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ]; @@ -156,10 +156,10 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the function leav out = zeros( 10, 'generic' ); expected = zeros( 10, 'generic' ); - random( -1, x1, 1, toAccessorArray( out ), 1 ); + random( -1, x1, 0, toAccessorArray( out ), 1 ); t.deepEqual( out, expected, 'returns expected value' ); - random( 0, x1, 1, toAccessorArray( out ), 1 ); + random( 0, x1, 0, toAccessorArray( out ), 1 ); t.deepEqual( out, expected, 'returns expected value' ); x1 = toAccessorArray( [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ] ); diff --git a/strided/geometric/test/test.ndarray.js b/strided/geometric/test/test.ndarray.js index 5a3a609a..5b3e3191 100644 --- a/strided/geometric/test/test.ndarray.js +++ b/strided/geometric/test/test.ndarray.js @@ -107,7 +107,7 @@ tape( 'the function returns a reference to the output array', function test( t ) x1 = [ PARAM1[ 0 ] ]; out = zeros( 10, 'generic' ); - actual = random( out.length, x1, 1, 0, out, 1, 0 ); + actual = random( out.length, x1, 0, 0, out, 1, 0 ); t.strictEqual( actual, out, 'same reference' ); x1 = [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ]; @@ -128,10 +128,10 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the function leav out = zeros( 10, 'generic' ); expected = zeros( 10, 'generic' ); - random( -1, x1, 1, 0, out, 1, 0 ); + random( -1, x1, 0, 0, out, 1, 0 ); t.deepEqual( out, expected, 'returns expected value' ); - random( 0, x1, 1, 0, out, 1, 0 ); + random( 0, x1, 0, 0, out, 1, 0 ); t.deepEqual( out, expected, 'returns expected value' ); x1 = [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ]; @@ -156,10 +156,10 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the function leav out = zeros( 10, 'generic' ); expected = zeros( 10, 'generic' ); - random( -1, x1, 1, 0, toAccessorArray( out ), 1, 0 ); + random( -1, x1, 0, 0, toAccessorArray( out ), 1, 0 ); t.deepEqual( out, expected, 'returns expected value' ); - random( 0, x1, 1, 0, toAccessorArray( out ), 1, 0 ); + random( 0, x1, 0, 0, toAccessorArray( out ), 1, 0 ); t.deepEqual( out, expected, 'returns expected value' ); x1 = toAccessorArray( [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ] ); diff --git a/strided/lib/index.js b/strided/lib/index.js index 6a9c8623..01672ab6 100644 --- a/strided/lib/index.js +++ b/strided/lib/index.js @@ -189,6 +189,15 @@ setReadOnly( ns, 'mt19937', require( './../../strided/mt19937' ) ); */ setReadOnly( ns, 'normal', require( './../../strided/normal' ) ); +/** +* @name poisson +* @memberof ns +* @readonly +* @type {Function} +* @see {@link module:@stdlib/random/strided/poisson} +*/ +setReadOnly( ns, 'poisson', require( './../../strided/poisson' ) ); + /** * @name randu * @memberof ns diff --git a/strided/poisson/README.md b/strided/poisson/README.md new file mode 100644 index 00000000..2ec42c4c --- /dev/null +++ b/strided/poisson/README.md @@ -0,0 +1,375 @@ + + +# Poisson Random Numbers + +> Fill a strided array with pseudorandom numbers drawn from a [Poisson][@stdlib/random/base/poisson] distribution. + +
+ +## Usage + +```javascript +var poisson = require( '@stdlib/random/strided/poisson' ); +``` + +#### poisson( N, lambda, sl, out, so ) + +Fills a strided array with pseudorandom numbers drawn from a [Poisson][@stdlib/random/base/poisson] distribution. + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); + +// Create an array: +var out = new Float64Array( 10 ); + +// Fill the array with pseudorandom numbers: +poisson( out.length, [ 2.0 ], 0, out, 1 ); +``` + +The function has the following parameters: + +- **N**: number of indexed elements. +- **lambda**: rate parameter. +- **sl**: index increment for `lambda`. +- **out**: output array. +- **so**: index increment for `out`. + +The `N` and stride parameters determine which strided array elements are accessed at runtime. For example, to access every other value in `out`, + +```javascript +var out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; + +poisson( 3, [ 2.0 ], 0, out, 2 ); +``` + +Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. + + + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); + +// Initial array: +var lambda0 = new Float64Array( [ 2.0, 2.0, 2.0, 2.0, 2.0, 2.0 ] ); + +// Create offset view: +var lambda1 = new Float64Array( lambda0.buffer, lambda0.BYTES_PER_ELEMENT*3 ); // start at 4th element + +// Create an output array: +var out = new Float64Array( 3 ); + +// Fill the output array: +poisson( out.length, lambda1, -1, out, 1 ); +``` + +#### poisson.ndarray( N, lambda, sl, ol, out, so, oo ) + +Fills a strided array with pseudorandom numbers drawn from a [Poisson][@stdlib/random/base/poisson] distribution using alternative indexing semantics. + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); + +// Create an array: +var out = new Float64Array( 10 ); + +// Fill the array with pseudorandom numbers: +poisson.ndarray( out.length, [ 2.0 ], 0, 0, out, 1, 0 ); +``` + +The function has the following additional parameters: + +- **ol**: starting index for `lambda`. +- **oo**: starting index for `out`. + +While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the offset parameters support indexing semantics based on starting indices. For example, to access every other value in `out` starting from the second value, + +```javascript +var out = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ]; + +poisson.ndarray( 3, [ 2.0 ], 0, 0, out, 2, 1 ); +``` + +#### poisson.factory( \[options] ) + +Returns a function for filling strided arrays with pseudorandom numbers drawn from a [Poisson][@stdlib/random/base/poisson] distribution. + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); + +var random = poisson.factory(); +// returns + +// Create an array: +var out = new Float64Array( 10 ); + +// Fill the array with pseudorandom numbers: +random( out.length, [ 2.0 ], 0, out, 1 ); +``` + +The function accepts the following `options`: + +- **prng**: pseudorandom number generator for generating uniformly distributed pseudorandom numbers on the interval `[0,1)`. If provided, the function **ignores** both the `state` and `seed` options. In order to seed the underlying pseudorandom number generator, one must seed the provided `prng` (assuming the provided `prng` is seedable). +- **seed**: pseudorandom number generator seed. +- **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 an underlying generator has exclusive control over its internal state. Default: `true`. + +To use a custom PRNG as the underlying source of uniformly distributed pseudorandom numbers, set the `prng` option. + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); +var minstd = require( '@stdlib/random/base/minstd' ); + +var opts = { + 'prng': minstd.normalized +}; +var random = poisson.factory( opts ); + +var out = new Float64Array( 10 ); +random( out.length, [ 2.0 ], 0, out, 1 ); +``` + +To seed the underlying pseudorandom number generator, set the `seed` option. + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); + +var opts = { + 'seed': 12345 +}; +var random = poisson.factory( opts ); + +var out = new Float64Array( 10 ); +random( out.length, [ 2.0 ], 0, out, 1 ); +``` + +* * * + +#### random.PRNG + +The underlying pseudorandom number generator. + +```javascript +var prng = poisson.PRNG; +// returns +``` + +#### poisson.seed + +The value used to seed the underlying pseudorandom number generator. + +```javascript +var seed = poisson.seed; +// returns +``` + +If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. + +```javascript +var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; + +var random = poisson.factory({ + 'prng': minstd +}); +// returns + +var seed = random.seed; +// returns null +``` + +#### poisson.seedLength + +Length of underlying pseudorandom number generator seed. + +```javascript +var len = poisson.seedLength; +// returns +``` + +If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. + +```javascript +var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; + +var random = poisson.factory({ + 'prng': minstd +}); +// returns + +var len = random.seedLength; +// returns null +``` + +#### poisson.state + +Writable property for getting and setting the underlying pseudorandom number generator state. + +```javascript +var state = poisson.state; +// returns +``` + +If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. + +```javascript +var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; + +var random = poisson.factory({ + 'prng': minstd +}); +// returns + +var state = random.state; +// returns null +``` + +#### poisson.stateLength + +Length of underlying pseudorandom number generator state. + +```javascript +var len = poisson.stateLength; +// returns +``` + +If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. + +```javascript +var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; + +var random = poisson.factory({ + 'prng': minstd +}); +// returns + +var len = random.stateLength; +// returns null +``` + +#### poisson.byteLength + +Size (in bytes) of underlying pseudorandom number generator state. + +```javascript +var sz = poisson.byteLength; +// returns +``` + +If the `factory` method is provided a PRNG for uniformly distributed numbers, the associated property value on the returned function is `null`. + +```javascript +var minstd = require( '@stdlib/random/base/minstd-shuffle' ).normalized; + +var random = poisson.factory({ + 'prng': minstd +}); +// returns + +var sz = random.byteLength; +// returns null +``` + +
+ + + +
+ +* * * + +## Notes + +- If `N <= 0`, both `poisson` and `poisson.ndarray` leave the output array unchanged. +- Both `poisson` and `poisson.ndarray` support array-like objects having getter and setter accessors for array element access. + +
+ + + +
+ +* * * + +## Examples + + + +```javascript +var zeros = require( '@stdlib/array/zeros' ); +var zeroTo = require( '@stdlib/array/zero-to' ); +var logEach = require( '@stdlib/console/log-each' ); +var poisson = require( '@stdlib/random/strided/poisson' ); + +// Specify a PRNG seed: +var opts = { + 'seed': 1234 +}; + +// Create a seeded PRNG: +var rand1 = poisson.factory( opts ); + +// Create an array: +var x1 = zeros( 10, 'float64' ); + +// Fill the array with pseudorandom numbers: +rand1( x1.length, [ 2.0 ], 0, x1, 1 ); + +// Create another function for filling strided arrays: +var rand2 = poisson.factory( opts ); +// returns + +// Create a second array: +var x2 = zeros( 10, 'generic' ); + +// Fill the array with the same pseudorandom numbers: +rand2( x2.length, [ 2.0 ], 0, x2, 1 ); + +// Create a list of indices: +var idx = zeroTo( x1.length, 'generic' ); + +// Print the array contents: +logEach( 'x1[%d] = %.2f; x2[%d] = %.2f', idx, x1, idx, x2 ); +``` + +
+ + + + + + + + + + + + + + diff --git a/strided/poisson/benchmark/benchmark.float32.broadcast.js b/strided/poisson/benchmark/benchmark.float32.broadcast.js new file mode 100644 index 00000000..2134d30d --- /dev/null +++ b/strided/poisson/benchmark/benchmark.float32.broadcast.js @@ -0,0 +1,100 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var filledarray = require( '@stdlib/array/filled' ); +var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var pkg = require( './../package.json' ).name; +var random = require( './../lib' ); + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var out; + var x; + + x = filledarray( 2.0, 1, 'float32' ); + out = filledarray( 0.0, len, 'float32' ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var o; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + o = random( len, x, 0, out, 1 ); + if ( isnanf( o[ i%len ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnanf( o[ i%len ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( pkg+'::broadcast:dtype=float32,len='+len, f ); + } +} + +main(); diff --git a/strided/poisson/benchmark/benchmark.float32.js b/strided/poisson/benchmark/benchmark.float32.js new file mode 100644 index 00000000..5e989730 --- /dev/null +++ b/strided/poisson/benchmark/benchmark.float32.js @@ -0,0 +1,100 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var filledarray = require( '@stdlib/array/filled' ); +var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var pkg = require( './../package.json' ).name; +var random = require( './../lib' ); + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var out; + var x; + + x = filledarray( 2.0, len, 'float32' ); + out = filledarray( 0.0, len, 'float32' ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var o; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + o = random( len, x, 1, out, 1 ); + if ( isnanf( o[ i%len ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnanf( o[ i%len ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( pkg+':dtype=float32,len='+len, f ); + } +} + +main(); diff --git a/strided/poisson/benchmark/benchmark.float64.broadcast.js b/strided/poisson/benchmark/benchmark.float64.broadcast.js new file mode 100644 index 00000000..b7d33b2f --- /dev/null +++ b/strided/poisson/benchmark/benchmark.float64.broadcast.js @@ -0,0 +1,100 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var filledarray = require( '@stdlib/array/filled' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var pkg = require( './../package.json' ).name; +var random = require( './../lib' ); + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var out; + var x; + + x = filledarray( 2.0, 1, 'float64' ); + out = filledarray( 0.0, len, 'float64' ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var o; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + o = random( len, x, 0, out, 1 ); + if ( isnan( o[ i%len ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( o[ i%len ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( pkg+'::broadcast:dtype=float64,len='+len, f ); + } +} + +main(); diff --git a/strided/poisson/benchmark/benchmark.float64.js b/strided/poisson/benchmark/benchmark.float64.js new file mode 100644 index 00000000..ef48824a --- /dev/null +++ b/strided/poisson/benchmark/benchmark.float64.js @@ -0,0 +1,100 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var filledarray = require( '@stdlib/array/filled' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var pkg = require( './../package.json' ).name; +var random = require( './../lib' ); + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var out; + var x; + + x = filledarray( 2.0, len, 'float64' ); + out = filledarray( 0.0, len, 'float64' ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var o; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + o = random( len, x, 1, out, 1 ); + if ( isnan( o[ i%len ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( o[ i%len ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( pkg+':dtype=float64,len='+len, f ); + } +} + +main(); diff --git a/strided/poisson/benchmark/benchmark.generic.broadcast.js b/strided/poisson/benchmark/benchmark.generic.broadcast.js new file mode 100644 index 00000000..ceebbc0c --- /dev/null +++ b/strided/poisson/benchmark/benchmark.generic.broadcast.js @@ -0,0 +1,100 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var filledarray = require( '@stdlib/array/filled' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var pkg = require( './../package.json' ).name; +var random = require( './../lib' ); + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var out; + var x; + + x = filledarray( 2.0, 1, 'generic' ); + out = filledarray( 0.0, len, 'generic' ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var o; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + o = random( len, x, 0, out, 1 ); + if ( isnan( o[ i%len ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( o[ i%len ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( pkg+'::broadcast:dtype=generic,len='+len, f ); + } +} + +main(); diff --git a/strided/poisson/benchmark/benchmark.generic.js b/strided/poisson/benchmark/benchmark.generic.js new file mode 100644 index 00000000..151a3e06 --- /dev/null +++ b/strided/poisson/benchmark/benchmark.generic.js @@ -0,0 +1,100 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var filledarray = require( '@stdlib/array/filled' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var pkg = require( './../package.json' ).name; +var random = require( './../lib' ); + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var out; + var x; + + x = filledarray( 2.0, len, 'generic' ); + out = filledarray( 0.0, len, 'generic' ); + + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var o; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + o = random( len, x, 1, out, 1 ); + if ( isnan( o[ i%len ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( o[ i%len ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( pkg+':dtype=generic,len='+len, f ); + } +} + +main(); diff --git a/strided/poisson/docs/repl.txt b/strided/poisson/docs/repl.txt new file mode 100644 index 00000000..1d2470bc --- /dev/null +++ b/strided/poisson/docs/repl.txt @@ -0,0 +1,203 @@ + +{{alias}}( N, lambda, sl, out, so ) + Fills a strided array with pseudorandom numbers drawn from a Poisson + distribution. + + The `N` and stride parameters determine which elements in the provided + strided arrays are accessed at runtime. + + Indexing is relative to the first index. To introduce an offset, use typed + array views. + + If `N` is less than or equal to `0`, the output strided array is left + unchanged. + + Parameters + ---------- + N: integer + Number of indexed elements. + + lambda: ArrayLikeObject + Mean parameter. + + sl: integer + Index increment for `lambda`. + + out: ArrayLikeObject + Output array. + + so: integer + Index increment for `out`. + + Returns + ------- + out: ArrayLikeObject + Output array. + + Examples + -------- + > var out = {{alias:@stdlib/array/zeros}}( 5, 'generic' ); + > {{alias}}( out.length, [ 2.0 ], 0, out, 1 ) + [...] + + +{{alias}}.ndarray( N, lambda, sl, ol, out, so, oo ) + Fills a strided array with pseudorandom numbers drawn from a Poisson + distribution using alternative indexing semantics. + + While typed array views mandate a view offset based on the underlying + buffer, the offset parameters support indexing semantics based on starting + indices. + + Parameters + ---------- + N: integer + Number of indexed elements. + + lambda: ArrayLikeObject + Mean parameter. + + sl: integer + Index increment for `lambda`. + + ol: integer + Starting index for `lambda`. + + out: ArrayLikeObject + Output array. + + so: integer + Index increment for `out`. + + oo: integer + Starting index for `out`. + + Returns + ------- + out: ArrayLikeObject + Output array. + + Examples + -------- + > var out = {{alias:@stdlib/array/zeros}}( 5, 'generic' ); + > {{alias}}.ndarray( out.length, [ 2.0 ], 0, 0, out, 1, 0 ) + [...] + + +{{alias}}.factory( [options] ) + Returns a function for filling strided arrays with pseudorandom numbers + drawn from a Poisson distribution. + + Parameters + ---------- + options: Object (optional) + Options. + + options.prng: Function (optional) + Pseudorandom number generator (PRNG) for generating uniformly + distributed pseudorandom numbers on the interval `[0,1)`. If provided, + the `state` and `seed` options are ignored. In order to seed the + returned pseudorandom number generator, one must seed the provided + `prng` (assuming the provided `prng` is seedable). + + options.seed: integer|ArrayLikeObject (optional) + Pseudorandom number generator seed. The seed may be either a positive + unsigned 32-bit integer or, for arbitrary length seeds, an array-like + object containing unsigned 32-bit integers. + + options.state: Uint32Array (optional) + Pseudorandom number generator state. If provided, the `seed` option is + ignored. + + options.copy: boolean (optional) + 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. + + Returns + ------- + fcn: Function + Function for filling strided arrays. + + Examples + -------- + > var fcn = {{alias}}.factory(); + > var out = {{alias:@stdlib/array/zeros}}( 5, 'generic' ); + > fcn( out.length, [ 2.0 ], 0, out, 1 ) + [...] + + +{{alias}}.PRNG + Underlying pseudorandom number generator. + + Examples + -------- + > var prng = {{alias}}.PRNG; + + +{{alias}}.seed + Pseudorandom number generator seed. + + Examples + -------- + > var seed = {{alias}}.seed; + + +{{alias}}.seedLength + Length of generator seed. + + Examples + -------- + > var len = {{alias}}.seedLength; + + +{{alias}}.state + Generator state. + + Examples + -------- + > var out = {{alias:@stdlib/array/zeros}}( 3, 'generic' ); + > {{alias}}( out.length, [ 2.0 ], 0, out, 1 ) + [...] + + // Get a copy of the current state: + > var state = {{alias}}.state + + + // Advance the generator state: + > out = {{alias:@stdlib/array/zeros}}( 3, 'generic' ); + > {{alias}}( out.length, [ 2.0 ], 0, out, 1 ) + [...] + > out = {{alias:@stdlib/array/zeros}}( 3, 'generic' ); + > {{alias}}( out.length, [ 2.0 ], 0, out, 1 ) + [...] + + // Set the state: + > {{alias}}.state = state; + + // Regenerate previous generated values: + > out = {{alias:@stdlib/array/zeros}}( 3, 'generic' ); + > {{alias}}( out.length, [ 2.0 ], 0, out, 1 ) + [...] + + +{{alias}}.stateLength + Length of generator state. + + Examples + -------- + > var len = {{alias}}.stateLength; + + +{{alias}}.byteLength + Size (in bytes) of generator state. + + Examples + -------- + > var sz = {{alias}}.byteLength; + + See Also + -------- + diff --git a/strided/poisson/docs/types/index.d.ts b/strided/poisson/docs/types/index.d.ts new file mode 100644 index 00000000..5fb9194e --- /dev/null +++ b/strided/poisson/docs/types/index.d.ts @@ -0,0 +1,208 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// TypeScript Version: 4.1 + +/// + +import * as random from '@stdlib/types/random'; +import { Collection } from '@stdlib/types/array'; + +/** +* Interface defining function options. +*/ +interface Options { + /** + * Pseudorandom number generator which generates uniformly distributed pseudorandom numbers. + */ + prng?: random.PRNG; + + /** + * Pseudorandom number generator seed. + */ + seed?: random.PRNGSeedMT19937; + + /** + * Pseudorandom number generator state. + */ + state?: random.PRNGStateMT19937; + + /** + * Specifies whether to copy a provided pseudorandom number generator state (default: `true`). + */ + copy?: boolean; +} + +/** +* Interface for PRNG properties and methods. +*/ +interface PRNG { + /** + * Underlying pseudorandom number generator. + */ + readonly PRNG: random.PRNG; + + /** + * PRNG seed. + */ + readonly seed: random.PRNGSeedMT19937 | null; + + /** + * PRNG seed length. + */ + readonly seedLength: number | null; + + /** + * PRNG state. + */ + state: random.PRNGStateMT19937 | null; + + /** + * PRNG state length. + */ + readonly stateLength: number | null; + + /** + * PRNG state size (in bytes). + */ + readonly byteLength: number | null; +} + +/** +* Interface for filling strided arrays with pseudorandom numbers drawn from a Poisson distribution. +*/ +interface Random extends PRNG { + /** + * Fills a strided array with pseudorandom numbers drawn from a Poisson distribution. + * + * @param N - number of indexed elements + * @param lambda - mean parameter + * @param sl - `lambda` strided length + * @param out - output array + * @param so - `out` stride length + * @returns output array + * + * @example + * var Float64Array = require( '@stdlib/array/float64' ); + * + * // Create an array: + * var out = new Float64Array( 10 ); + * + * // Fill the array with pseudorandom numbers: + * poisson( out.length, [ 2.0 ], 0, out, 1 ); + */ + ( N: number, lambda: Collection, sl: number, out: Collection, so: number ): Collection; + + /** + * Fills a strided array with pseudorandom numbers drawn from a Poisson distribution using alternative indexing semantics. + * + * @param N - number of indexed elements + * @param lambda - mean parameter + * @param sl - `lambda` strided length + * @param ol - starting index for `lambda` + * @param out - output array + * @param so - `out` stride length + * @param oo - starting index for `out` + * @returns output array + * + * @example + * var Float64Array = require( '@stdlib/array/float64' ); + * + * // Create an array: + * var out = new Float64Array( 10 ); + * + * // Fill the array with pseudorandom numbers: + * poisson.ndarray( out.length, [ 2.0 ], 0, 0, out, 1, 0 ); + */ + ndarray( N: number, lambda: Collection, sl: number, ol: number, out: Collection, so: number, oo: number ): Collection; +} + +/** +* Interface describing the main export. +*/ +interface Routine extends Random { + /** + * Returns a function for filling strided arrays with pseudorandom numbers drawn from a Poisson distribution. + * + * @param options - function options + * @throws must provide a valid state + * @returns function for filling strided arrays + * + * @example + * var Float64Array = require( '@stdlib/array/float64' ); + * + * // Create a new PRNG function: + * var random = poisson.factory(); + * + * // Create an array: + * var out = new Float64Array( 10 ); + * + * // Fill the array with pseudorandom numbers: + * random( out.length, [ 2.0 ], 0, out, 1 ); + * + * @example + * var Float64Array = require( '@stdlib/array/float64' ); + * + * // Create a new PRNG function: + * var random = poisson.factory({ + * 'seed': 297 + * }); + * + * // Create an array: + * var out = new Float64Array( 10 ); + * + * // Fill the array with pseudorandom numbers: + * random( out.length, [ 2.0 ], 0, out, 1 ); + */ + factory( options?: Options ): Random; +} + +/** +* Fills a strided array with pseudorandom numbers drawn from a Poisson distribution. +* +* @param N - number of indexed elements +* @param lambda - mean parameter +* @param sl - `lambda` stride length +* @param out - output array +* @param so - `out` stride length +* @returns output array +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* // Create an array: +* var out = new Float64Array( 10 ); +* +* // Fill the array with pseudorandom numbers: +* poisson( out.length, [ 2.0 ], 0, out, 1 ); +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* // Create an array: +* var out = new Float64Array( 10 ); +* +* // Fill the array with pseudorandom numbers: +* poisson.ndarray( out.length, [ 2.0 ], 0, 0, out, 1, 0 ); +*/ +declare var poisson: Routine; + + +// EXPORTS // + +export = poisson; diff --git a/strided/poisson/docs/types/test.ts b/strided/poisson/docs/types/test.ts new file mode 100644 index 00000000..b4dc8c38 --- /dev/null +++ b/strided/poisson/docs/types/test.ts @@ -0,0 +1,255 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +import random = require( './index' ); + + +// TESTS // + +// The function returns a collection... +{ + const x1 = new Float64Array( 10 ); + const out = new Float64Array( 10 ); + + random( x1.length, x1, 1, out, 1 ); // $ExpectType Collection +} + +// The compiler throws an error if the function is provided a first argument which is not a number... +{ + const x1 = new Float64Array( 10 ); + const out = new Float64Array( 10 ); + + random( '10', x1, 1, out, 1 ); // $ExpectError + random( true, x1, 1, out, 1 ); // $ExpectError + random( false, x1, 1, out, 1 ); // $ExpectError + random( null, x1, 1, out, 1 ); // $ExpectError + random( undefined, x1, 1, out, 1 ); // $ExpectError + random( [], x1, 1, out, 1 ); // $ExpectError + random( {}, x1, 1, out, 1 ); // $ExpectError + random( ( x: number ): number => x, x1, 1, out, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a second argument which is not a collection... +{ + const x1 = new Float64Array( 10 ); + const out = new Float64Array( 10 ); + + random( x1.length, 10, 1, out, 1 ); // $ExpectError + random( x1.length, true, 1, out, 1 ); // $ExpectError + random( x1.length, false, 1, out, 1 ); // $ExpectError + random( x1.length, null, 1, out, 1 ); // $ExpectError + random( x1.length, undefined, 1, out, 1 ); // $ExpectError + random( x1.length, {}, 1, out, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a third argument which is not a number... +{ + const x1 = new Float64Array( 10 ); + const out = new Float64Array( 10 ); + + random( x1.length, x1, '10', out, 1 ); // $ExpectError + random( x1.length, x1, true, out, 1 ); // $ExpectError + random( x1.length, x1, false, out, 1 ); // $ExpectError + random( x1.length, x1, null, out, 1 ); // $ExpectError + random( x1.length, x1, undefined, out, 1 ); // $ExpectError + random( x1.length, x1, [], out, 1 ); // $ExpectError + random( x1.length, x1, {}, out, 1 ); // $ExpectError + random( x1.length, x1, ( x: number ): number => x, out, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fourth argument which is not a collection... +{ + const x1 = new Float64Array( 10 ); + + random( x1.length, x1, 1, 10, 1 ); // $ExpectError + random( x1.length, x1, 1, true, 1 ); // $ExpectError + random( x1.length, x1, 1, false, 1 ); // $ExpectError + random( x1.length, x1, 1, null, 1 ); // $ExpectError + random( x1.length, x1, 1, undefined, 1 ); // $ExpectError + random( x1.length, x1, 1, {}, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fifth argument which is not a number... +{ + const x1 = new Float64Array( 10 ); + const out = new Float64Array( 10 ); + + random( x1.length, x1, 1, out, '10' ); // $ExpectError + random( x1.length, x1, 1, out, true ); // $ExpectError + random( x1.length, x1, 1, out, false ); // $ExpectError + random( x1.length, x1, 1, out, null ); // $ExpectError + random( x1.length, x1, 1, out, undefined ); // $ExpectError + random( x1.length, x1, 1, out, [] ); // $ExpectError + random( x1.length, x1, 1, out, {} ); // $ExpectError + random( x1.length, x1, 1, out, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided an unsupported number of arguments... +{ + const x1 = new Float64Array( 10 ); + const out = new Float64Array( 10 ); + + random(); // $ExpectError + random( x1.length ); // $ExpectError + random( x1.length, x1 ); // $ExpectError + random( x1.length, x1, 1 ); // $ExpectError + random( x1.length, x1, 1, out ); // $ExpectError +} + +// Attached to main export is an `ndarray` method which returns a collection... +{ + const x1 = new Float64Array( 10 ); + const out = new Float64Array( 10 ); + + random.ndarray( x1.length, x1, 1, 0, out, 1, 0 ); // $ExpectType Collection +} + +// The compiler throws an error if the `ndarray` method is provided a first argument which is not a number... +{ + const x1 = new Float64Array( 10 ); + const out = new Float64Array( 10 ); + + random.ndarray( '10', x1, 1, 0, out, 1, 0 ); // $ExpectError + random.ndarray( true, x1, 1, 0, out, 1, 0 ); // $ExpectError + random.ndarray( false, x1, 1, 0, out, 1, 0 ); // $ExpectError + random.ndarray( null, x1, 1, 0, out, 1, 0 ); // $ExpectError + random.ndarray( undefined, x1, 1, 0, out, 1, 0 ); // $ExpectError + random.ndarray( [], x1, 1, 0, out, 1, 0 ); // $ExpectError + random.ndarray( {}, x1, 1, 0, out, 1, 0 ); // $ExpectError + random.ndarray( ( x: number ): number => x, x1, 1, 0, out, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a second argument which is not a collection... +{ + const x1 = new Float64Array( 10 ); + const out = new Float64Array( 10 ); + + random.ndarray( x1.length, 10, 1, 0, out, 1, 0 ); // $ExpectError + random.ndarray( x1.length, true, 1, 0, out, 1, 0 ); // $ExpectError + random.ndarray( x1.length, false, 1, 0, out, 1, 0 ); // $ExpectError + random.ndarray( x1.length, null, 1, 0, out, 1, 0 ); // $ExpectError + random.ndarray( x1.length, undefined, 1, 0, out, 1, 0 ); // $ExpectError + random.ndarray( x1.length, {}, 1, 0, out, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a third argument which is not a number... +{ + const x1 = new Float64Array( 10 ); + const out = new Float64Array( 10 ); + + random.ndarray( x1.length, x1, '10', 0, out, 1, 0 ); // $ExpectError + random.ndarray( x1.length, x1, true, 0, out, 1, 0 ); // $ExpectError + random.ndarray( x1.length, x1, false, 0, out, 1, 0 ); // $ExpectError + random.ndarray( x1.length, x1, null, 0, out, 1, 0 ); // $ExpectError + random.ndarray( x1.length, x1, undefined, 0, out, 1, 0 ); // $ExpectError + random.ndarray( x1.length, x1, [], 0, out, 1, 0 ); // $ExpectError + random.ndarray( x1.length, x1, {}, 0, out, 1, 0 ); // $ExpectError + random.ndarray( x1.length, x1, ( x: number ): number => x, 0, out, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a fourth argument which is not a number... +{ + const x1 = new Float64Array( 10 ); + const out = new Float64Array( 10 ); + + random.ndarray( x1.length, x1, 1, '10', out, 1, 0 ); // $ExpectError + random.ndarray( x1.length, x1, 1, true, out, 1, 0 ); // $ExpectError + random.ndarray( x1.length, x1, 1, false, out, 1, 0 ); // $ExpectError + random.ndarray( x1.length, x1, 1, null, out, 1, 0 ); // $ExpectError + random.ndarray( x1.length, x1, 1, undefined, out, 1, 0 ); // $ExpectError + random.ndarray( x1.length, x1, 1, [], out, 1, 0 ); // $ExpectError + random.ndarray( x1.length, x1, 1, {}, out, 1, 0 ); // $ExpectError + random.ndarray( x1.length, x1, 1, ( x: number ): number => x, out, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a fifth argument which is not a collection... +{ + const x1 = new Float64Array( 10 ); + + random.ndarray( x1.length, x1, 1, 0, 10, 1, 0 ); // $ExpectError + random.ndarray( x1.length, x1, 1, 0, true, 1, 0 ); // $ExpectError + random.ndarray( x1.length, x1, 1, 0, false, 1, 0 ); // $ExpectError + random.ndarray( x1.length, x1, 1, 0, null, 1, 0 ); // $ExpectError + random.ndarray( x1.length, x1, 1, 0, undefined, 1, 0 ); // $ExpectError + random.ndarray( x1.length, x1, 1, 0, {}, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a sixth argument which is not a number... +{ + const x1 = new Float64Array( 10 ); + const out = new Float64Array( 10 ); + + random.ndarray( x1.length, x1, 1, 0, out, '10', 0 ); // $ExpectError + random.ndarray( x1.length, x1, 1, 0, out, true, 0 ); // $ExpectError + random.ndarray( x1.length, x1, 1, 0, out, false, 0 ); // $ExpectError + random.ndarray( x1.length, x1, 1, 0, out, null, 0 ); // $ExpectError + random.ndarray( x1.length, x1, 1, 0, out, undefined, 0 ); // $ExpectError + random.ndarray( x1.length, x1, 1, 0, out, [], 0 ); // $ExpectError + random.ndarray( x1.length, x1, 1, 0, out, {}, 0 ); // $ExpectError + random.ndarray( x1.length, x1, 1, 0, out, ( x: number ): number => x, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a seventh argument which is not a number... +{ + const x1 = new Float64Array( 10 ); + const out = new Float64Array( 10 ); + + random.ndarray( x1.length, x1, 1, 0, out, 1, '10' ); // $ExpectError + random.ndarray( x1.length, x1, 1, 0, out, 1, true ); // $ExpectError + random.ndarray( x1.length, x1, 1, 0, out, 1, false ); // $ExpectError + random.ndarray( x1.length, x1, 1, 0, out, 1, null ); // $ExpectError + random.ndarray( x1.length, x1, 1, 0, out, 1, undefined ); // $ExpectError + random.ndarray( x1.length, x1, 1, 0, out, 1, [] ); // $ExpectError + random.ndarray( x1.length, x1, 1, 0, out, 1, {} ); // $ExpectError + random.ndarray( x1.length, x1, 1, 0, out, 1, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided an unsupported number of arguments... +{ + const x1 = new Float64Array( 10 ); + const out = new Float64Array( 10 ); + + random.ndarray(); // $ExpectError + random.ndarray( x1.length ); // $ExpectError + random.ndarray( x1.length, x1 ); // $ExpectError + random.ndarray( x1.length, x1, 1 ); // $ExpectError + random.ndarray( x1.length, x1, 1, 0 ); // $ExpectError + random.ndarray( x1.length, x1, 1, 0, out ); // $ExpectError + random.ndarray( x1.length, x1, 1, 0, out, 1 ); // $ExpectError +} + +// Attached to main export is a `factory` method which returns a function... +{ + random.factory(); // $ExpectType Random + random.factory( {} ); // $ExpectType Random + random.factory( { 'copy': true } ); // $ExpectType Random +} + +// The compiler throws an error if the `factory` method is provided an invalid option... +{ + random.factory( { 'copy': '10' } ); // $ExpectError + random.factory( { 'copy': null } ); // $ExpectError + random.factory( { 'copy': [] } ); // $ExpectError + random.factory( { 'copy': {} } ); // $ExpectError + random.factory( { 'copy': ( x: number ): number => x } ); // $ExpectError +} + +// The compiler throws an error if the `factory` method is provided an unsupported number of arguments... +{ + random.factory( {}, {} ); // $ExpectError +} diff --git a/strided/poisson/examples/index.js b/strided/poisson/examples/index.js new file mode 100644 index 00000000..44a5682e --- /dev/null +++ b/strided/poisson/examples/index.js @@ -0,0 +1,54 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +var zeros = require( '@stdlib/array/zeros' ); +var zeroTo = require( '@stdlib/array/zero-to' ); +var logEach = require( '@stdlib/console/log-each' ); +var poisson = require( './../lib' ); + +// Specify a PRNG seed: +var opts = { + 'seed': 1234 +}; + +// Create a seeded PRNG: +var rand1 = poisson.factory( opts ); + +// Create an array: +var x1 = zeros( 10, 'float64' ); + +// Fill the array with pseudorandom numbers: +rand1( x1.length, [ 2.0 ], 0, x1, 1 ); + +// Create another function for filling strided arrays: +var rand2 = poisson.factory( opts ); +// returns + +// Create a second array: +var x2 = zeros( 10, 'generic' ); + +// Fill the array with the same pseudorandom numbers: +rand2( x2.length, [ 2.0 ], 0, x2, 1 ); + +// Create a list of indices: +var idx = zeroTo( x1.length, 'generic' ); + +// Print the array contents: +logEach( 'x1[%d] = %.2f; x2[%d] = %.2f', idx, x1, idx, x2 ); diff --git a/strided/poisson/lib/factory.js b/strided/poisson/lib/factory.js new file mode 100644 index 00000000..9cdb8927 --- /dev/null +++ b/strided/poisson/lib/factory.js @@ -0,0 +1,64 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var unaryFactory = require( './../../../strided/tools/unary-factory' ); +var base = require( './../../../base/poisson' ); + + +// MAIN // + +/** +* Returns a function for filling strided arrays containing pseudorandom numbers drawn from a Poisson distribution. +* +* @name factory +* @type {Function} +* @param {Options} [options] - function options +* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers +* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed +* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state +* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state +* @throws {TypeError} options argument must be an object +* @throws {TypeError} must provide valid options +* @throws {Error} must provide a valid state +* @returns {Function} function for filling strided arrays +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var poisson = factory(); +* // returns +* +* var out = new Float64Array( 10 ); +* // returns +* +* var arr = poisson( out.length, [ 2.0 ], 0, out, 1 ); +* // returns +* +* var bool = ( arr === out ); +* // returns true +*/ +var factory = unaryFactory( base ); + + +// EXPORTS // + +module.exports = factory; diff --git a/strided/poisson/lib/index.js b/strided/poisson/lib/index.js new file mode 100644 index 00000000..b1c209f0 --- /dev/null +++ b/strided/poisson/lib/index.js @@ -0,0 +1,63 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +/** +* Fill a strided array with pseudorandom numbers drawn from a Poisson distribution. +* +* @module @stdlib/random/strided/poisson +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* var poisson = require( '@stdlib/random/strided/poisson' ); +* +* // Create an array: +* var out = new Float64Array( 10 ); +* +* // Fill the array with pseudorandom numbers: +* poisson( out.length, [ 2.0 ], 0, out, 1 ); +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* var poisson = require( '@stdlib/random/strided/poisson' ); +* +* // Create an array: +* var out = new Float64Array( 10 ); +* +* // Fill the array with pseudorandom numbers: +* poisson.ndarray( out.length, [ 2.0 ], 0, 0, out, 1, 0 ); +*/ + +// MODULES // + +var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); +var main = require( './main.js' ); +var factory = require( './factory.js' ); + + +// MAIN // + +setReadOnly( main, 'factory', factory ); + + +// EXPORTS // + +module.exports = main; + +// exports: { "factory": "main.factory", "ndarray": "main.ndarray" } diff --git a/strided/poisson/lib/main.js b/strided/poisson/lib/main.js new file mode 100644 index 00000000..72487146 --- /dev/null +++ b/strided/poisson/lib/main.js @@ -0,0 +1,54 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var factory = require( './factory.js' ); + + +// MAIN // + +/** +* Fills a strided array with pseudorandom numbers drawn from a Poisson distribution. +* +* @name poisson +* @type {Function} +* @param {NonNegativeInteger} N - number of indexed elements +* @param {Collection} lambda - mean parameter +* @param {integer} sl - `lambda` stride length +* @param {Collection} out - output array +* @param {integer} so - `out` stride length +* @returns {Collection} output array +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* // Create an array: +* var out = new Float64Array( 10 ); +* +* // Fill the array with pseudorandom numbers: +* poisson( out.length, [ 2.0 ], 0, out, 1 ); +*/ +var poisson = factory(); + + +// EXPORTS // + +module.exports = poisson; diff --git a/strided/poisson/package.json b/strided/poisson/package.json new file mode 100644 index 00000000..5e433639 --- /dev/null +++ b/strided/poisson/package.json @@ -0,0 +1,74 @@ +{ + "name": "@stdlib/random/strided/poisson", + "version": "0.0.0", + "description": "Fill a strided array with pseudorandom numbers drawn from a Poisson distribution.", + "license": "Apache-2.0", + "author": { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + }, + "contributors": [ + { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + } + ], + "main": "./lib", + "directories": { + "benchmark": "./benchmark", + "doc": "./docs", + "example": "./examples", + "lib": "./lib", + "test": "./test" + }, + "types": "./docs/types", + "scripts": {}, + "homepage": "https://github.com/stdlib-js/stdlib", + "repository": { + "type": "git", + "url": "git://github.com/stdlib-js/stdlib.git" + }, + "bugs": { + "url": "https://github.com/stdlib-js/stdlib/issues" + }, + "dependencies": {}, + "devDependencies": {}, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "keywords": [ + "stdlib", + "stdmath", + "mathematics", + "math", + "statistics", + "stats", + "prng", + "rng", + "pseudorandom", + "random", + "rand", + "poisson", + "poiss", + "discrete", + "generator", + "seed", + "seedable", + "strided", + "array", + "vector", + "ndarray" + ] +} diff --git a/strided/poisson/test/test.factory.js b/strided/poisson/test/test.factory.js new file mode 100644 index 00000000..96774010 --- /dev/null +++ b/strided/poisson/test/test.factory.js @@ -0,0 +1,1476 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var Float64Array = require( '@stdlib/array/float64' ); +var zeros = require( '@stdlib/array/zeros' ); +var toAccessorArray = require( '@stdlib/array/base/to-accessor-array' ); +var randomArray = require( './../../../array/uniform' ); +var prng = require( './../../../base/poisson' ); +var factory = require( './../lib' ).factory; + + +// VARIABLES // + +// Valid values for PRNG parameters: +var PARAM1 = randomArray( 10, 2.0, 5.0, { + 'dtype': 'generic' +}); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof factory, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function throws an error if provided an options argument which is not an object', function test( t ) { + var values; + var i; + + values = [ + '5', + 5, + NaN, + true, + false, + null, + void 0, + [], + function noop() {} + ]; + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + factory( value ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid option', function test( t ) { + var values; + var i; + + values = [ + '5', + 5, + NaN, + null, + void 0, + [], + {}, + function noop() {} + ]; + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + factory({ + 'copy': value + }); + }; + } +}); + +tape( 'the function returns a function which fills a strided array with pseudorandom numbers', function test( t ) { + var random; + var out; + var x1; + var N; + var i; + + random = factory(); + + N = 10; + + x1 = [ PARAM1[ 0 ] ]; + out = zeros( N, 'generic' ); + + random( N, x1, 0, out, 1 ); + for ( i = 0; i < N; i++ ) { + t.strictEqual( typeof out[ i ], 'number', 'returns expected value' ); + } + + x1 = randomArray( N, 2.0, 5.0, { + 'dtype': 'generic' + }); + out = zeros( N, 'generic' ); + + random( N, x1, 1, out, 1 ); + for ( i = 0; i < N; i++ ) { + t.strictEqual( typeof out[ i ], 'number', 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function returns a function which fills a strided array with pseudorandom numbers (accessors)', function test( t ) { + var random; + var out; + var x1; + var N; + var i; + + random = factory(); + + N = 10; + + x1 = toAccessorArray( [ PARAM1[ 0 ] ] ); + out = zeros( N, 'generic' ); + + random( N, x1, 0, out, 1 ); + for ( i = 0; i < N; i++ ) { + t.strictEqual( typeof out[ i ], 'number', 'returns expected value' ); + } + + x1 = toAccessorArray( randomArray( N, 2.0, 5.0, { + 'dtype': 'generic' + })); + out = zeros( N, 'generic' ); + + random( N, x1, 1, out, 1 ); + for ( i = 0; i < N; i++ ) { + t.strictEqual( typeof out[ i ], 'number', 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function returns a function which fills a strided array with pseudorandom numbers (seeded)', function test( t ) { + var random; + var rand; + var opts; + var out; + var x1; + var N; + var i; + + opts = { + 'seed': prng.seed + }; + random = factory( opts ); + + N = 10; + + x1 = [ PARAM1[ 0 ] ]; + out = zeros( N, 'generic' ); + + random( N, x1, 0, out, 1 ); + + rand = prng.factory({ + 'seed': opts.seed + }); + for ( i = 0; i < N; i++ ) { + t.strictEqual( out[ i ], rand( x1[ 0 ] ), 'returns expected value' ); + } + + x1 = randomArray( N, 2.0, 5.0, { + 'dtype': 'generic' + }); + out = zeros( N, 'generic' ); + + random = factory( opts ); + random( N, x1, 1, out, 1 ); + + rand = prng.factory({ + 'seed': opts.seed + }); + for ( i = 0; i < N; i++ ) { + t.strictEqual( out[ i ], rand( x1[ i ] ), 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function fills a strided array with pseudorandom numbers (accessors; seeded)', function test( t ) { + var random; + var rand; + var opts; + var out; + var x1; + var N; + var i; + + opts = { + 'seed': prng.seed + }; + random = factory( opts ); + + N = 10; + + x1 = toAccessorArray( [ PARAM1[ 0 ] ] ); + out = zeros( N, 'generic' ); + + random( N, x1, 0, out, 1 ); + + rand = prng.factory({ + 'seed': opts.seed + }); + for ( i = 0; i < N; i++ ) { + t.strictEqual( out[ i ], rand( x1.get( 0 ) ), 'returns expected value' ); + } + + x1 = toAccessorArray( randomArray( N, 2.0, 5.0, { + 'dtype': 'generic' + })); + out = zeros( N, 'generic' ); + + random = factory( opts ); + random( N, x1, 1, out, 1 ); + + rand = prng.factory({ + 'seed': opts.seed + }); + for ( i = 0; i < N; i++ ) { + t.strictEqual( out[ i ], rand( x1.get( i ) ), 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function returns a function which supports a stride for the first strided array', function test( t ) { + var expected; + var random; + var rand; + var opts; + var out; + var x1; + var N; + + N = 3; + x1 = [ + PARAM1[ 0 ], // 0 + PARAM1[ 1 ], + PARAM1[ 2 ], // 1 + PARAM1[ 3 ], + PARAM1[ 4 ] // 2 + ]; + out = [ + 0.0, // 0 + 0.0, // 1 + 0.0, // 2 + 0.0, + 0.0 + ]; + + opts = { + 'seed': prng.seed + }; + random = factory( opts ); + random( N, x1, 2, out, 1 ); + + rand = prng.factory({ + 'seed': opts.seed + }); + expected = [ + rand( x1[ 0 ] ), + rand( x1[ 2 ] ), + rand( x1[ 4 ] ), + 0.0, + 0.0 + ]; + + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns a function which supports a stride for the first strided array (accessors)', function test( t ) { + var expected; + var random; + var rand; + var opts; + var out; + var x1; + var N; + + N = 3; + x1 = toAccessorArray([ + PARAM1[ 0 ], // 0 + PARAM1[ 1 ], + PARAM1[ 2 ], // 1 + PARAM1[ 3 ], + PARAM1[ 4 ] // 2 + ]); + out = [ + 0.0, // 0 + 0.0, // 1 + 0.0, // 2 + 0.0, + 0.0 + ]; + + opts = { + 'seed': prng.seed + }; + random = factory( opts ); + random( N, x1, 2, toAccessorArray( out ), 1 ); + + rand = prng.factory({ + 'seed': opts.seed + }); + expected = [ + rand( x1.get( 0 ) ), + rand( x1.get( 2 ) ), + rand( x1.get( 4 ) ), + 0.0, + 0.0 + ]; + + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns a function which supports a stride for the output strided array', function test( t ) { + var expected; + var random; + var rand; + var opts; + var out; + var x1; + var N; + + N = 3; + x1 = [ + PARAM1[ 0 ], // 0 + PARAM1[ 1 ], // 1 + PARAM1[ 2 ], // 2 + PARAM1[ 3 ], + PARAM1[ 4 ] + ]; + out = [ + 0.0, // 0 + 0.0, + 0.0, // 1 + 0.0, + 0.0 // 2 + ]; + + opts = { + 'seed': prng.seed + }; + random = factory( opts ); + random( N, x1, 1, out, 2 ); + + rand = prng.factory({ + 'seed': opts.seed + }); + expected = [ + rand( x1[ 0 ] ), + 0.0, + rand( x1[ 1 ] ), + 0.0, + rand( x1[ 2 ] ) + ]; + + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns a function which supports a stride for the output strided array (accessors)', function test( t ) { + var expected; + var random; + var rand; + var opts; + var out; + var x1; + var N; + + N = 3; + x1 = toAccessorArray([ + PARAM1[ 0 ], // 0 + PARAM1[ 1 ], // 1 + PARAM1[ 2 ], // 2 + PARAM1[ 3 ], + PARAM1[ 4 ] + ]); + out = [ + 0.0, // 0 + 0.0, + 0.0, // 1 + 0.0, + 0.0 // 2 + ]; + + opts = { + 'seed': prng.seed + }; + random = factory( opts ); + random( N, x1, 1, toAccessorArray( out ), 2 ); + + rand = prng.factory({ + 'seed': opts.seed + }); + expected = [ + rand( x1.get( 0 ) ), + 0.0, + rand( x1.get( 1 ) ), + 0.0, + rand( x1.get( 2 ) ) + ]; + + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns a function which returns a reference to the output array', function test( t ) { + var random; + var actual; + var out; + var x1; + + random = factory(); + + x1 = [ PARAM1[ 0 ] ]; + out = zeros( 10, 'generic' ); + + actual = random( out.length, x1, 0, out, 1 ); + t.strictEqual( actual, out, 'same reference' ); + + x1 = [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ]; + out = zeros( 3, 'generic' ); + + actual = random( out.length, x1, 1, out, 1 ); + t.strictEqual( actual, out, 'same reference' ); + + t.end(); +}); + +tape( 'if provided an `N` parameter less than or equal to `0`, the returned function leaves the output array unchanged', function test( t ) { + var expected; + var random; + var out; + var x1; + + random = factory(); + + x1 = [ PARAM1[ 0 ] ]; + out = zeros( 10, 'generic' ); + expected = zeros( 10, 'generic' ); + + random( -1, x1, 0, out, 1 ); + t.deepEqual( out, expected, 'returns expected value' ); + + random( 0, x1, 0, out, 1 ); + t.deepEqual( out, expected, 'returns expected value' ); + + x1 = [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ]; + out = zeros( x1.length, 'generic' ); + expected = zeros( x1.length, 'generic' ); + + random( -1, x1, 1, out, 1 ); + t.deepEqual( out, expected, 'returns expected value' ); + + random( 0, x1, 1, out, 1 ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'if provided an `N` parameter less than or equal to `0`, the returned function leaves the output array unchanged (accessors)', function test( t ) { + var expected; + var random; + var out; + var x1; + + random = factory(); + + x1 = toAccessorArray( [ PARAM1[ 0 ] ] ); + out = zeros( 10, 'generic' ); + expected = zeros( 10, 'generic' ); + + random( -1, x1, 0, toAccessorArray( out ), 1 ); + t.deepEqual( out, expected, 'returns expected value' ); + + random( 0, x1, 0, toAccessorArray( out ), 1 ); + t.deepEqual( out, expected, 'returns expected value' ); + + x1 = toAccessorArray( [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ] ); + out = zeros( x1.length, 'generic' ); + expected = zeros( x1.length, 'generic' ); + + random( -1, x1, 1, toAccessorArray( out ), 1 ); + t.deepEqual( out, expected, 'returns expected value' ); + + random( 0, x1, 1, toAccessorArray( out ), 1 ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function returns a function which supports negative strides', function test( t ) { + var expected; + var random; + var rand; + var opts; + var out; + var x1; + var N; + + N = 3; + x1 = [ + PARAM1[ 0 ], // 2 + PARAM1[ 1 ], + PARAM1[ 2 ], // 1 + PARAM1[ 3 ], + PARAM1[ 4 ] // 0 + ]; + out = [ + 0.0, // 0 + 0.0, + 0.0, // 1 + 0.0, + 0.0 // 2 + ]; + + opts = { + 'seed': prng.seed + }; + random = factory( opts ); + random( N, x1, -2, out, 2 ); + + rand = prng.factory({ + 'seed': opts.seed + }); + expected = [ + rand( x1[ 4 ] ), + 0.0, + rand( x1[ 2 ] ), + 0.0, + rand( x1[ 0 ] ) + ]; + + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns a function which supports negative strides (accessors)', function test( t ) { + var expected; + var random; + var rand; + var opts; + var out; + var x1; + var N; + + N = 3; + x1 = toAccessorArray([ + PARAM1[ 0 ], // 2 + PARAM1[ 1 ], + PARAM1[ 2 ], // 1 + PARAM1[ 3 ], + PARAM1[ 4 ] // 0 + ]); + out = [ + 0.0, // 0 + 0.0, + 0.0, // 1 + 0.0, + 0.0 // 2 + ]; + + opts = { + 'seed': prng.seed + }; + random = factory( opts ); + random( N, x1, -2, toAccessorArray( out ), 2 ); + + rand = prng.factory({ + 'seed': opts.seed + }); + expected = [ + rand( x1.get( 4 ) ), + 0.0, + rand( x1.get( 2 ) ), + 0.0, + rand( x1.get( 0 ) ) + ]; + + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns a function which supports complex access patterns', function test( t ) { + var expected; + var random; + var rand; + var opts; + var out; + var x1; + var N; + + N = 3; + x1 = [ + PARAM1[ 0 ], // 0 + PARAM1[ 1 ], + PARAM1[ 2 ], // 1 + PARAM1[ 3 ], + PARAM1[ 4 ], // 2 + PARAM1[ 5 ] + ]; + out = [ + 0.0, // 2 + 0.0, + 0.0, // 1 + 0.0, + 0.0 // 0 + ]; + + opts = { + 'seed': prng.seed + }; + random = factory( opts ); + random( N, x1, 2, out, -2 ); + + rand = prng.factory({ + 'seed': opts.seed + }); + + // The order in which `rand` is invoked matters as the order in which pseudorandom numbers is generated is fixed... + expected = [ + rand( x1[ 0 ] ), + rand( x1[ 2 ] ), + rand( x1[ 4 ] ) + ]; + expected = [ + expected[ 2 ], + 0.0, + expected[ 1 ], + 0.0, + expected[ 0 ] + ]; + + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns a function which supports view offsets', function test( t ) { + var expected; + var viewOut; + var viewX1; + var random; + var rand; + var opts; + var out; + var x1; + var N; + + N = 3; + + // Initial arrays... + x1 = new Float64Array([ + PARAM1[ 0 ], + PARAM1[ 1 ], // 2 + PARAM1[ 2 ], + PARAM1[ 3 ], // 1 + PARAM1[ 4 ], + PARAM1[ 5 ] // 0 + ]); + out = new Float64Array([ + 0.0, + 0.0, + 0.0, // 0 + 0.0, // 1 + 0.0, // 2 + 0.0 + ]); + + // Create offset views... + viewX1 = new Float64Array( x1.buffer, x1.BYTES_PER_ELEMENT*1 ); // begin at the 2nd element + viewOut = new Float64Array( out.buffer, out.BYTES_PER_ELEMENT*2 ); // begin at the 3rd element + + opts = { + 'seed': prng.seed + }; + random = factory( opts ); + random( N, viewX1, -2, viewOut, 1 ); + + rand = prng.factory({ + 'seed': opts.seed + }); + expected = new Float64Array([ + 0.0, + 0.0, + rand( x1[ 5 ] ), + rand( x1[ 3 ] ), + rand( x1[ 1 ] ), + 0.0 + ]); + + t.deepEqual( expected, out, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns a function having an `ndarray` method which fills a strided array with pseudorandom numbers', function test( t ) { + var random; + var out; + var x1; + var N; + var i; + + random = factory(); + + N = 10; + + x1 = [ PARAM1[ 0 ] ]; + out = zeros( N, 'generic' ); + + random.ndarray( N, x1, 0, 0, out, 1, 0 ); + for ( i = 0; i < N; i++ ) { + t.strictEqual( typeof out[ i ], 'number', 'returns expected value' ); + } + + x1 = randomArray( N, 2.0, 5.0, { + 'dtype': 'generic' + }); + out = zeros( N, 'generic' ); + + random.ndarray( N, x1, 1, 0, out, 1, 0 ); + for ( i = 0; i < N; i++ ) { + t.strictEqual( typeof out[ i ], 'number', 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function returns a function having an `ndarray` method which fills a strided array with pseudorandom numbers (accessors)', function test( t ) { + var random; + var out; + var x1; + var N; + var i; + + random = factory(); + + N = 10; + + x1 = toAccessorArray( [ PARAM1[ 0 ] ] ); + out = toAccessorArray( zeros( N, 'generic' ) ); + + random.ndarray( N, x1, 0, 0, out, 1, 0 ); + for ( i = 0; i < N; i++ ) { + t.strictEqual( typeof out.get( i ), 'number', 'returns expected value' ); + } + + x1 = toAccessorArray( randomArray( N, 2.0, 5.0, { + 'dtype': 'generic' + })); + out = toAccessorArray( zeros( N, 'generic' ) ); + + random.ndarray( N, x1, 1, 0, out, 1, 0 ); + for ( i = 0; i < N; i++ ) { + t.strictEqual( typeof out.get( i ), 'number', 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function returns a function having an `ndarray` method which fills a strided array with pseudorandom numbers (seeded)', function test( t ) { + var random; + var rand; + var opts; + var out; + var x1; + var N; + var i; + + opts = { + 'seed': prng.seed + }; + random = factory( opts ); + + N = 10; + + x1 = [ PARAM1[ 0 ] ]; + out = zeros( N, 'generic' ); + + random.ndarray( N, x1, 0, 0, out, 1, 0 ); + + rand = prng.factory({ + 'seed': opts.seed + }); + for ( i = 0; i < N; i++ ) { + t.strictEqual( out[ i ], rand( x1[ 0 ] ), 'returns expected value' ); + } + + x1 = randomArray( N, 2.0, 5.0, { + 'dtype': 'generic' + }); + out = zeros( N, 'generic' ); + + random = factory( opts ); + random.ndarray( N, x1, 1, 0, out, 1, 0 ); + + rand = prng.factory({ + 'seed': opts.seed + }); + for ( i = 0; i < N; i++ ) { + t.strictEqual( out[ i ], rand( x1[ i ] ), 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function returns a function having an `ndarray` method which fills a strided array with pseudorandom numbers (accessors; seeded)', function test( t ) { + var random; + var rand; + var opts; + var out; + var x1; + var N; + var i; + + opts = { + 'seed': prng.seed + }; + random = factory( opts ); + + N = 10; + + x1 = toAccessorArray( [ PARAM1[ 0 ] ] ); + out = toAccessorArray( zeros( N, 'generic' ) ); + + random.ndarray( N, x1, 0, 0, out, 1, 0 ); + + rand = prng.factory({ + 'seed': opts.seed + }); + for ( i = 0; i < N; i++ ) { + t.strictEqual( out.get( i ), rand( x1.get( 0 ) ), 'returns expected value' ); + } + + x1 = toAccessorArray( randomArray( N, 2.0, 5.0, { + 'dtype': 'generic' + })); + out = toAccessorArray( zeros( N, 'generic' ) ); + + random = factory( opts ); + random.ndarray( N, x1, 1, 0, out, 1, 0 ); + + rand = prng.factory({ + 'seed': opts.seed + }); + for ( i = 0; i < N; i++ ) { + t.strictEqual( out.get( i ), rand( x1.get( i ) ), 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function returns a function having an `ndarray` method which supports a stride for the first strided array', function test( t ) { + var expected; + var random; + var rand; + var opts; + var out; + var x1; + var N; + + N = 3; + x1 = [ + PARAM1[ 0 ], // 0 + PARAM1[ 1 ], + PARAM1[ 2 ], // 1 + PARAM1[ 3 ], + PARAM1[ 4 ] // 2 + ]; + out = [ + 0.0, // 0 + 0.0, // 1 + 0.0, // 2 + 0.0, + 0.0 + ]; + + opts = { + 'seed': prng.seed + }; + random = factory( opts ); + random.ndarray( N, x1, 2, 0, out, 1, 0 ); + + rand = prng.factory({ + 'seed': opts.seed + }); + expected = [ + rand( x1[ 0 ] ), + rand( x1[ 2 ] ), + rand( x1[ 4 ] ), + 0.0, + 0.0 + ]; + + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns a function having an `ndarray` method which supports a stride for the first strided array (accessors)', function test( t ) { + var expected; + var random; + var rand; + var opts; + var out; + var x1; + var N; + + N = 3; + x1 = toAccessorArray([ + PARAM1[ 0 ], // 0 + PARAM1[ 1 ], + PARAM1[ 2 ], // 1 + PARAM1[ 3 ], + PARAM1[ 4 ] // 2 + ]); + out = [ + 0.0, // 0 + 0.0, // 1 + 0.0, // 2 + 0.0, + 0.0 + ]; + + opts = { + 'seed': prng.seed + }; + random = factory( opts ); + random.ndarray( N, x1, 2, 0, toAccessorArray( out ), 1, 0 ); + + rand = prng.factory({ + 'seed': opts.seed + }); + expected = [ + rand( x1.get( 0 ) ), + rand( x1.get( 2 ) ), + rand( x1.get( 4 ) ), + 0.0, + 0.0 + ]; + + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns a function having an `ndarray` method which supports an offset for the first strided array', function test( t ) { + var expected; + var random; + var rand; + var opts; + var out; + var x1; + var N; + + N = 3; + x1 = [ + PARAM1[ 0 ], + PARAM1[ 1 ], + PARAM1[ 2 ], // 0 + PARAM1[ 3 ], // 1 + PARAM1[ 4 ] // 2 + ]; + out = [ + 0.0, // 0 + 0.0, // 1 + 0.0, // 2 + 0.0, + 0.0 + ]; + + opts = { + 'seed': prng.seed + }; + random = factory( opts ); + random.ndarray( N, x1, 1, 2, out, 1, 0 ); + + rand = prng.factory({ + 'seed': opts.seed + }); + expected = [ + rand( x1[ 2 ] ), + rand( x1[ 3 ] ), + rand( x1[ 4 ] ), + 0.0, + 0.0 + ]; + + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns a function having an `ndarray` method which supports an offset for the first strided array (accessors)', function test( t ) { + var expected; + var random; + var rand; + var opts; + var out; + var x1; + var N; + + N = 3; + x1 = toAccessorArray([ + PARAM1[ 0 ], + PARAM1[ 1 ], + PARAM1[ 2 ], // 0 + PARAM1[ 3 ], // 1 + PARAM1[ 4 ] // 2 + ]); + out = [ + 0.0, // 0 + 0.0, // 1 + 0.0, // 2 + 0.0, + 0.0 + ]; + + opts = { + 'seed': prng.seed + }; + random = factory( opts ); + random.ndarray( N, x1, 1, 2, toAccessorArray( out ), 1, 0 ); + + rand = prng.factory({ + 'seed': opts.seed + }); + expected = [ + rand( x1.get( 2 ) ), + rand( x1.get( 3 ) ), + rand( x1.get( 4 ) ), + 0.0, + 0.0 + ]; + + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns a function having an `ndarray` method which supports a stride for the output strided array', function test( t ) { + var expected; + var random; + var rand; + var opts; + var out; + var x1; + var N; + + N = 3; + x1 = [ + PARAM1[ 0 ], // 0 + PARAM1[ 1 ], // 1 + PARAM1[ 2 ], // 2 + PARAM1[ 3 ], + PARAM1[ 4 ] + ]; + out = [ + 0.0, // 0 + 0.0, + 0.0, // 1 + 0.0, + 0.0 // 2 + ]; + + opts = { + 'seed': prng.seed + }; + random = factory( opts ); + random.ndarray( N, x1, 1, 0, out, 2, 0 ); + + rand = prng.factory({ + 'seed': opts.seed + }); + expected = [ + rand( x1[ 0 ] ), + 0.0, + rand( x1[ 1 ] ), + 0.0, + rand( x1[ 2 ] ) + ]; + + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns a function having an `ndarray` method which supports a stride for the output strided array (accessors)', function test( t ) { + var expected; + var random; + var rand; + var opts; + var out; + var x1; + var N; + + N = 3; + x1 = toAccessorArray([ + PARAM1[ 0 ], // 0 + PARAM1[ 1 ], // 1 + PARAM1[ 2 ], // 2 + PARAM1[ 3 ], + PARAM1[ 4 ] + ]); + out = [ + 0.0, // 0 + 0.0, + 0.0, // 1 + 0.0, + 0.0 // 2 + ]; + + opts = { + 'seed': prng.seed + }; + random = factory( opts ); + random.ndarray( N, x1, 1, 0, toAccessorArray( out ), 2, 0 ); + + rand = prng.factory({ + 'seed': opts.seed + }); + expected = [ + rand( x1.get( 0 ) ), + 0.0, + rand( x1.get( 1 ) ), + 0.0, + rand( x1.get( 2 ) ) + ]; + + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns a function having an `ndarray` method which supports an offset for the output strided array', function test( t ) { + var expected; + var random; + var rand; + var opts; + var out; + var x1; + var N; + + N = 3; + x1 = [ + PARAM1[ 0 ], // 0 + PARAM1[ 1 ], // 1 + PARAM1[ 2 ], // 2 + PARAM1[ 3 ], + PARAM1[ 4 ] + ]; + out = [ + 0.0, + 0.0, + 0.0, // 0 + 0.0, // 1 + 0.0 // 2 + ]; + + opts = { + 'seed': prng.seed + }; + random = factory( opts ); + random.ndarray( N, x1, 1, 0, out, 1, 2 ); + + rand = prng.factory({ + 'seed': opts.seed + }); + expected = [ + 0.0, + 0.0, + rand( x1[ 0 ] ), + rand( x1[ 1 ] ), + rand( x1[ 2 ] ) + ]; + + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns a function having an `ndarray` method which supports an offset for the output strided array (accessors)', function test( t ) { + var expected; + var random; + var rand; + var opts; + var out; + var x1; + var N; + + N = 3; + x1 = toAccessorArray([ + PARAM1[ 0 ], // 0 + PARAM1[ 1 ], // 1 + PARAM1[ 2 ], // 2 + PARAM1[ 3 ], + PARAM1[ 4 ] + ]); + out = [ + 0.0, + 0.0, + 0.0, // 0 + 0.0, // 1 + 0.0 // 2 + ]; + + opts = { + 'seed': prng.seed + }; + random = factory( opts ); + random.ndarray( N, x1, 1, 0, toAccessorArray( out ), 1, 2 ); + + rand = prng.factory({ + 'seed': opts.seed + }); + expected = [ + 0.0, + 0.0, + rand( x1.get( 0 ) ), + rand( x1.get( 1 ) ), + rand( x1.get( 2 ) ) + ]; + + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns a function having an `ndarray` method which returns a reference to the output array', function test( t ) { + var random; + var actual; + var out; + var x1; + + random = factory(); + + x1 = [ PARAM1[ 0 ] ]; + out = zeros( 10, 'generic' ); + + actual = random.ndarray( out.length, x1, 0, 0, out, 1, 0 ); + t.strictEqual( actual, out, 'same reference' ); + + x1 = [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ]; + out = zeros( 3, 'generic' ); + + actual = random.ndarray( out.length, x1, 1, 0, out, 1, 0 ); + t.strictEqual( actual, out, 'same reference' ); + + t.end(); +}); + +tape( 'if provided an `N` parameter less than or equal to `0`, the `ndarray` method on the returned function leaves the output array unchanged', function test( t ) { + var expected; + var random; + var out; + var x1; + + random = factory(); + + x1 = [ PARAM1[ 0 ] ]; + out = zeros( 10, 'generic' ); + expected = zeros( 10, 'generic' ); + + random.ndarray( -1, x1, 0, 0, out, 1, 0 ); + t.deepEqual( out, expected, 'returns expected value' ); + + random.ndarray( 0, x1, 0, 0, out, 1, 0 ); + t.deepEqual( out, expected, 'returns expected value' ); + + x1 = [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ]; + out = zeros( x1.length, 'generic' ); + expected = zeros( x1.length, 'generic' ); + + random.ndarray( -1, x1, 1, 0, out, 1, 0 ); + t.deepEqual( out, expected, 'returns expected value' ); + + random.ndarray( 0, x1, 1, 0, out, 1, 0 ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'if provided an `N` parameter less than or equal to `0`, the `ndarray` method on the returned function leaves the output array unchanged (accessors)', function test( t ) { + var expected; + var random; + var out; + var x1; + + random = factory(); + + x1 = toAccessorArray( [ PARAM1[ 0 ] ] ); + out = zeros( 10, 'generic' ); + expected = zeros( 10, 'generic' ); + + random.ndarray( -1, x1, 0, 0, toAccessorArray( out ), 1, 0 ); + t.deepEqual( out, expected, 'returns expected value' ); + + random.ndarray( 0, x1, 0, 0, toAccessorArray( out ), 1, 0 ); + t.deepEqual( out, expected, 'returns expected value' ); + + x1 = toAccessorArray( [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ] ); + out = zeros( x1.length, 'generic' ); + expected = zeros( x1.length, 'generic' ); + + random.ndarray( -1, x1, 1, 0, toAccessorArray( out ), 1, 0 ); + t.deepEqual( out, expected, 'returns expected value' ); + + random.ndarray( 0, x1, 1, 0, toAccessorArray( out ), 1, 0 ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function returns a function having an `ndarray` method which supports negative strides', function test( t ) { + var expected; + var random; + var rand; + var opts; + var out; + var x1; + var N; + + N = 3; + x1 = [ + PARAM1[ 0 ], // 2 + PARAM1[ 1 ], + PARAM1[ 2 ], // 1 + PARAM1[ 3 ], + PARAM1[ 4 ] // 0 + ]; + out = [ + 0.0, // 0 + 0.0, + 0.0, // 1 + 0.0, + 0.0 // 2 + ]; + + opts = { + 'seed': prng.seed + }; + random = factory( opts ); + random.ndarray( N, x1, -2, 4, out, 2, 0 ); + + rand = prng.factory({ + 'seed': opts.seed + }); + expected = [ + rand( x1[ 4 ] ), + 0.0, + rand( x1[ 2 ] ), + 0.0, + rand( x1[ 0 ] ) + ]; + + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns a function having an `ndarray` method which supports negative strides (accessors)', function test( t ) { + var expected; + var random; + var rand; + var opts; + var out; + var x1; + var N; + + N = 3; + x1 = toAccessorArray([ + PARAM1[ 0 ], // 2 + PARAM1[ 1 ], + PARAM1[ 2 ], // 1 + PARAM1[ 3 ], + PARAM1[ 4 ] // 0 + ]); + out = [ + 0.0, // 0 + 0.0, + 0.0, // 1 + 0.0, + 0.0 // 2 + ]; + + opts = { + 'seed': prng.seed + }; + random = factory( opts ); + random.ndarray( N, x1, -2, 4, toAccessorArray( out ), 2, 0 ); + + rand = prng.factory({ + 'seed': opts.seed + }); + expected = [ + rand( x1.get( 4 ) ), + 0.0, + rand( x1.get( 2 ) ), + 0.0, + rand( x1.get( 0 ) ) + ]; + + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns a function having an `ndarray` method which supports complex access patterns', function test( t ) { + var expected; + var random; + var rand; + var opts; + var out; + var x1; + var N; + + N = 3; + x1 = [ + PARAM1[ 0 ], + PARAM1[ 1 ], // 0 + PARAM1[ 2 ], + PARAM1[ 3 ], // 1 + PARAM1[ 4 ], + PARAM1[ 5 ] // 2 + ]; + out = [ + 0.0, // 2 + 0.0, + 0.0, // 1 + 0.0, + 0.0 // 0 + ]; + + opts = { + 'seed': prng.seed + }; + random = factory( opts ); + random.ndarray( N, x1, 2, 1, out, -2, 4 ); + + rand = prng.factory({ + 'seed': opts.seed + }); + + // The order in which `rand` is invoked matters as the order in which pseudorandom numbers are generated is fixed... + expected = [ + rand( x1[ 1 ] ), + rand( x1[ 3 ] ), + rand( x1[ 5 ] ) + ]; + expected = [ + expected[ 2 ], + 0.0, + expected[ 1 ], + 0.0, + expected[ 0 ] + ]; + + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); diff --git a/strided/poisson/test/test.js b/strided/poisson/test/test.js new file mode 100644 index 00000000..e7fde2ad --- /dev/null +++ b/strided/poisson/test/test.js @@ -0,0 +1,74 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var isUint32Array = require( '@stdlib/assert/is-uint32array' ); +var random = require( './../lib' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof random, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'attached to the main export is an `ndarray` method', function test( t ) { + t.strictEqual( typeof random.ndarray, 'function', 'method is a function' ); + t.end(); +}); + +tape( 'attached to the main export is a `factory` method', function test( t ) { + t.strictEqual( typeof random.factory, 'function', 'method is a function' ); + t.end(); +}); + +tape( 'attached to the main export is the underlying PRNG', function test( t ) { + t.equal( typeof random.PRNG, 'function', 'has property' ); + t.end(); +}); + +tape( 'attached to the main export is the generator seed', function test( t ) { + t.equal( isUint32Array( random.seed ), true, 'has property' ); + t.end(); +}); + +tape( 'attached to the main export is the generator seed length', function test( t ) { + t.equal( typeof random.seedLength, 'number', 'has property' ); + t.end(); +}); + +tape( 'attached to the main export is the generator state', function test( t ) { + t.equal( isUint32Array( random.state ), true, 'has property' ); + t.end(); +}); + +tape( 'attached to the main export is the generator state length', function test( t ) { + t.equal( typeof random.stateLength, 'number', 'has property' ); + t.end(); +}); + +tape( 'attached to the main export is the generator state size', function test( t ) { + t.equal( typeof random.byteLength, 'number', 'has property' ); + t.end(); +}); diff --git a/strided/poisson/test/test.main.js b/strided/poisson/test/test.main.js new file mode 100644 index 00000000..bafb8fdd --- /dev/null +++ b/strided/poisson/test/test.main.js @@ -0,0 +1,176 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var zeros = require( '@stdlib/array/zeros' ); +var toAccessorArray = require( '@stdlib/array/base/to-accessor-array' ); +var randomArray = require( './../../../array/uniform' ); +var random = require( './../lib' ); + + +// VARIABLES // + +// Valid values for PRNG parameters: +var PARAM1 = randomArray( 10, 2.0, 5.0, { + 'dtype': 'generic' +}); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof random, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function fills a strided array with pseudorandom numbers', function test( t ) { + var out; + var x1; + var N; + var i; + + N = 10; + + x1 = [ PARAM1[ 0 ] ]; + out = zeros( N, 'generic' ); + + random( N, x1, 0, out, 1 ); + for ( i = 0; i < N; i++ ) { + t.strictEqual( typeof out[ i ], 'number', 'returns expected value' ); + } + + x1 = randomArray( N, 2.0, 5.0, { + 'dtype': 'generic' + }); + out = zeros( N, 'generic' ); + + random( N, x1, 1, out, 1 ); + for ( i = 0; i < N; i++ ) { + t.strictEqual( typeof out[ i ], 'number', 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function fills a strided array with pseudorandom numbers (accessors)', function test( t ) { + var out; + var x1; + var N; + var i; + + N = 10; + + x1 = toAccessorArray( [ PARAM1[ 0 ] ] ); + out = zeros( N, 'generic' ); + + random( N, x1, 0, out, 1 ); + for ( i = 0; i < N; i++ ) { + t.strictEqual( typeof out[ i ], 'number', 'returns expected value' ); + } + + x1 = toAccessorArray( randomArray( N, 2.0, 5.0, { + 'dtype': 'generic' + })); + out = zeros( N, 'generic' ); + + random( N, x1, 1, out, 1 ); + for ( i = 0; i < N; i++ ) { + t.strictEqual( typeof out[ i ], 'number', 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function returns a reference to the output array', function test( t ) { + var actual; + var out; + var x1; + + x1 = [ PARAM1[ 0 ] ]; + out = zeros( 10, 'generic' ); + + actual = random( out.length, x1, 0, out, 1 ); + t.strictEqual( actual, out, 'same reference' ); + + x1 = [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ]; + out = zeros( 3, 'generic' ); + + actual = random( out.length, x1, 1, out, 1 ); + t.strictEqual( actual, out, 'same reference' ); + + t.end(); +}); + +tape( 'if provided an `N` parameter less than or equal to `0`, the function leaves the output array unchanged', function test( t ) { + var expected; + var out; + var x1; + + x1 = [ PARAM1[ 0 ] ]; + out = zeros( 10, 'generic' ); + expected = zeros( 10, 'generic' ); + + random( -1, x1, 0, out, 1 ); + t.deepEqual( out, expected, 'returns expected value' ); + + random( 0, x1, 0, out, 1 ); + t.deepEqual( out, expected, 'returns expected value' ); + + x1 = [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ]; + out = zeros( x1.length, 'generic' ); + expected = zeros( x1.length, 'generic' ); + + random( -1, x1, 1, out, 1 ); + t.deepEqual( out, expected, 'returns expected value' ); + + random( 0, x1, 1, out, 1 ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'if provided an `N` parameter less than or equal to `0`, the function leaves the output array unchanged (accessors)', function test( t ) { + var expected; + var out; + var x1; + + x1 = toAccessorArray( [ PARAM1[ 0 ] ] ); + out = zeros( 10, 'generic' ); + expected = zeros( 10, 'generic' ); + + random( -1, x1, 0, toAccessorArray( out ), 1 ); + t.deepEqual( out, expected, 'returns expected value' ); + + random( 0, x1, 0, toAccessorArray( out ), 1 ); + t.deepEqual( out, expected, 'returns expected value' ); + + x1 = toAccessorArray( [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ] ); + out = zeros( x1.length, 'generic' ); + expected = zeros( x1.length, 'generic' ); + + random( -1, x1, 1, toAccessorArray( out ), 1 ); + t.deepEqual( out, expected, 'returns expected value' ); + + random( 0, x1, 1, toAccessorArray( out ), 1 ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); diff --git a/strided/poisson/test/test.ndarray.js b/strided/poisson/test/test.ndarray.js new file mode 100644 index 00000000..826482a2 --- /dev/null +++ b/strided/poisson/test/test.ndarray.js @@ -0,0 +1,176 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var zeros = require( '@stdlib/array/zeros' ); +var toAccessorArray = require( '@stdlib/array/base/to-accessor-array' ); +var randomArray = require( './../../../array/uniform' ); +var random = require( './../lib' ).ndarray; + + +// VARIABLES // + +// Valid values for PRNG parameters: +var PARAM1 = randomArray( 10, 2.0, 5.0, { + 'dtype': 'generic' +}); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof random, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function fills a strided array with pseudorandom numbers', function test( t ) { + var out; + var x1; + var N; + var i; + + N = 10; + + x1 = [ PARAM1[ 0 ] ]; + out = zeros( N, 'generic' ); + + random( N, x1, 0, 0, out, 1, 0 ); + for ( i = 0; i < N; i++ ) { + t.strictEqual( typeof out[ i ], 'number', 'returns expected value' ); + } + + x1 = randomArray( N, 2.0, 5.0, { + 'dtype': 'generic' + }); + out = zeros( N, 'generic' ); + + random( N, x1, 1, 0, out, 1, 0 ); + for ( i = 0; i < N; i++ ) { + t.strictEqual( typeof out[ i ], 'number', 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function fills a strided array with pseudorandom numbers (accessors)', function test( t ) { + var out; + var x1; + var N; + var i; + + N = 10; + + x1 = toAccessorArray( [ PARAM1[ 0 ] ] ); + out = toAccessorArray( zeros( N, 'generic' ) ); + + random( N, x1, 0, 0, out, 1, 0 ); + for ( i = 0; i < N; i++ ) { + t.strictEqual( typeof out.get( i ), 'number', 'returns expected value' ); + } + + x1 = toAccessorArray( randomArray( N, 2.0, 5.0, { + 'dtype': 'generic' + })); + out = toAccessorArray( zeros( N, 'generic' ) ); + + random( N, x1, 1, 0, out, 1, 0 ); + for ( i = 0; i < N; i++ ) { + t.strictEqual( typeof out.get( i ), 'number', 'returns expected value' ); + } + t.end(); +}); + +tape( 'the function returns a reference to the output array', function test( t ) { + var actual; + var out; + var x1; + + x1 = [ PARAM1[ 0 ] ]; + out = zeros( 10, 'generic' ); + + actual = random( out.length, x1, 0, 0, out, 1, 0 ); + t.strictEqual( actual, out, 'same reference' ); + + x1 = [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ]; + out = zeros( 3, 'generic' ); + + actual = random( out.length, x1, 1, 0, out, 1, 0 ); + t.strictEqual( actual, out, 'same reference' ); + + t.end(); +}); + +tape( 'if provided an `N` parameter less than or equal to `0`, the function leaves the output array unchanged', function test( t ) { + var expected; + var out; + var x1; + + x1 = [ PARAM1[ 0 ] ]; + out = zeros( 10, 'generic' ); + expected = zeros( 10, 'generic' ); + + random( -1, x1, 0, 0, out, 1, 0 ); + t.deepEqual( out, expected, 'returns expected value' ); + + random( 0, x1, 0, 0, out, 1, 0 ); + t.deepEqual( out, expected, 'returns expected value' ); + + x1 = [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ]; + out = zeros( x1.length, 'generic' ); + expected = zeros( x1.length, 'generic' ); + + random( -1, x1, 1, 0, out, 1, 0 ); + t.deepEqual( out, expected, 'returns expected value' ); + + random( 0, x1, 1, 0, out, 1, 0 ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'if provided an `N` parameter less than or equal to `0`, the function leaves the output array unchanged (accessors)', function test( t ) { + var expected; + var out; + var x1; + + x1 = toAccessorArray( [ PARAM1[ 0 ] ] ); + out = zeros( 10, 'generic' ); + expected = zeros( 10, 'generic' ); + + random( -1, x1, 0, 0, toAccessorArray( out ), 1, 0 ); + t.deepEqual( out, expected, 'returns expected value' ); + + random( 0, x1, 0, 0, toAccessorArray( out ), 1, 0 ); + t.deepEqual( out, expected, 'returns expected value' ); + + x1 = toAccessorArray( [ PARAM1[ 0 ], PARAM1[ 1 ], PARAM1[ 2 ] ] ); + out = zeros( x1.length, 'generic' ); + expected = zeros( x1.length, 'generic' ); + + random( -1, x1, 1, 0, toAccessorArray( out ), 1, 0 ); + t.deepEqual( out, expected, 'returns expected value' ); + + random( 0, x1, 1, 0, toAccessorArray( out ), 1, 0 ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +});