From 39fc3a4936c2a1308d229232771bcbd91ce0ac91 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sun, 28 Jan 2024 11:47:38 +0000 Subject: [PATCH] Auto-generated commit --- dist/index.js | 2 +- dist/index.js.map | 8 +- strided/bernoulli/README.md | 375 +++++ .../benchmark/benchmark.float32.broadcast.js | 100 ++ .../bernoulli/benchmark/benchmark.float32.js | 100 ++ .../benchmark/benchmark.float64.broadcast.js | 100 ++ .../bernoulli/benchmark/benchmark.float64.js | 100 ++ .../benchmark/benchmark.generic.broadcast.js | 100 ++ .../bernoulli/benchmark/benchmark.generic.js | 100 ++ strided/bernoulli/docs/repl.txt | 203 +++ strided/bernoulli/docs/types/index.d.ts | 208 +++ strided/bernoulli/docs/types/test.ts | 255 +++ strided/bernoulli/examples/index.js | 54 + strided/bernoulli/lib/factory.js | 64 + strided/bernoulli/lib/index.js | 63 + strided/bernoulli/lib/main.js | 54 + strided/bernoulli/package.json | 73 + strided/bernoulli/test/test.factory.js | 1476 +++++++++++++++++ strided/bernoulli/test/test.js | 74 + strided/bernoulli/test/test.main.js | 176 ++ strided/bernoulli/test/test.ndarray.js | 176 ++ strided/lib/index.js | 9 + 22 files changed, 3865 insertions(+), 5 deletions(-) create mode 100644 strided/bernoulli/README.md create mode 100644 strided/bernoulli/benchmark/benchmark.float32.broadcast.js create mode 100644 strided/bernoulli/benchmark/benchmark.float32.js create mode 100644 strided/bernoulli/benchmark/benchmark.float64.broadcast.js create mode 100644 strided/bernoulli/benchmark/benchmark.float64.js create mode 100644 strided/bernoulli/benchmark/benchmark.generic.broadcast.js create mode 100644 strided/bernoulli/benchmark/benchmark.generic.js create mode 100644 strided/bernoulli/docs/repl.txt create mode 100644 strided/bernoulli/docs/types/index.d.ts create mode 100644 strided/bernoulli/docs/types/test.ts create mode 100644 strided/bernoulli/examples/index.js create mode 100644 strided/bernoulli/lib/factory.js create mode 100644 strided/bernoulli/lib/index.js create mode 100644 strided/bernoulli/lib/main.js create mode 100644 strided/bernoulli/package.json create mode 100644 strided/bernoulli/test/test.factory.js create mode 100644 strided/bernoulli/test/test.js create mode 100644 strided/bernoulli/test/test.main.js create mode 100644 strided/bernoulli/test/test.ndarray.js diff --git a/dist/index.js b/dist/index.js index ada2fa6b..eb932688 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 Xh=s(function(J7e,Dh){"use strict";var o$=require("@stdlib/assert/is-plain-object"),v$=require("@stdlib/assert/has-own-property"),g$=require("@stdlib/array/base/assert/contains"),Bh=require("@stdlib/string/format");function f$(r,e,t){return o$(t)?v$(t,"dtype")&&(r.dtype=t.dtype,!g$(e,r.dtype))?new TypeError(Bh('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",e.join('", "'),r.dtype)):null:new TypeError(Bh("invalid argument. Options argument must be an object. Value: `%s`.",t))}Dh.exports=f$});var Qh=s(function(U7e,Zh){"use strict";var Yh=require("@stdlib/utils/define-nonenumerable-read-only-property"),d$=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,l$=require("@stdlib/assert/is-function"),c$=require("@stdlib/assert/is-string-array").primitives,m$=require("@stdlib/assert/is-collection"),h$=require("@stdlib/array/base/assert/contains"),p$=require("@stdlib/array/base/filled-by"),Hh=require("@stdlib/strided/base/binary"),y$=require("@stdlib/array/ctors"),Ws=require("@stdlib/string/format"),q$=Xh();function Is(r,e,t){if(!(this instanceof Is))return new Is(r,e,t);if(!l$(r))throw new TypeError(Ws("invalid argument. First argument must be a function. Value: `%s`.",r));if(!c$(e))throw new TypeError(Ws("invalid argument. Second argument must be an array of strings. Value: `%s`.",e));if(!h$(e,t))throw new TypeError(Ws("invalid argument. Third argument must be a supported data type. Value: `%s`.",t));return this._prng=r,this._dtypes=e,this._dtype=t,this}Yh(Is.prototype,"generate",function(e,t,i,n){var a,u,o,v,g,c;if(!d$(e))throw new TypeError(Ws("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",e));if(u={},arguments.length>3&&(g=q$(u,this._dtypes,n),g))throw g;if(o=this._prng,c=u.dtype||this._dtype,c==="generic")return p$(e,l);return a=y$(c),v=new a(e),Hh([[t],[i],v],[e],[0,0,1],o),v;function l(){return o(t,i)}});Yh(Is.prototype,"assign",function(e,t,i){if(!m$(i))throw new TypeError(Ws("invalid argument. Third argument must be an array-like object. Value: `%s`.",i));return Hh([[e],[t],i],[i.length],[0,0,1],this._prng),i});Zh.exports=Is});var Kh=s(function(C7e,$h){"use strict";var b$=Qh();$h.exports=b$});var tp=s(function(B7e,rp){"use strict";var w$=require("@stdlib/assert/is-plain-object"),S$=require("@stdlib/assert/has-own-property"),O$=require("@stdlib/array/base/assert/contains"),ep=require("@stdlib/string/format");function E$(r,e,t){return w$(t)?S$(t,"dtype")&&(r.dtype=t.dtype,!O$(e,r.dtype))?new TypeError(ep('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",e.join('", "'),r.dtype)):null:new TypeError(ep("invalid argument. Options argument must be an object. Value: `%s`.",t))}rp.exports=E$});var sp=s(function(D7e,ap){"use strict";var ip=require("@stdlib/utils/define-nonenumerable-read-only-property"),_$=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,N$=require("@stdlib/assert/is-function"),L$=require("@stdlib/assert/is-string-array").primitives,R$=require("@stdlib/assert/is-collection"),P$=require("@stdlib/array/base/assert/contains"),T$=require("@stdlib/array/base/filled-by"),np=require("@stdlib/strided/base/nullary"),j$=require("@stdlib/array/ctors"),ks=require("@stdlib/string/format"),M$=tp();function zs(r,e,t){if(!(this instanceof zs))return new zs(r,e,t);if(!N$(r))throw new TypeError(ks("invalid argument. First argument must be a function. Value: `%s`.",r));if(!L$(e))throw new TypeError(ks("invalid argument. Second argument must be an array of strings. Value: `%s`.",e));if(!P$(e,t))throw new TypeError(ks("invalid argument. Third argument must be a supported data type. Value: `%s`.",t));return this._prng=r,this._dtypes=e,this._dtype=t,this}ip(zs.prototype,"generate",function(e,t){var i,n,a,u,o;if(!_$(e))throw new TypeError(ks("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",e));if(n={},arguments.length>1&&(u=M$(n,this._dtypes,t),u))throw u;return o=n.dtype||this._dtype,o==="generic"?T$(e,this._prng):(i=j$(o),a=new i(e),np([a],[e],[1],this._prng),a)});ip(zs.prototype,"assign",function(e){if(!R$(e))throw new TypeError(ks("invalid argument. First argument must be an array-like object. Value: `%s`.",e));return np([e],[e.length],[1],this._prng),e});ap.exports=zs});var _u=s(function(X7e,up){"use strict";var x$=sp();up.exports=x$});var fp=s(function(Y7e,gp){"use strict";var op=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Nu=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),sa=require("@stdlib/utils/define-nonenumerable-read-only-property"),A$=require("@stdlib/assert/is-string-array").primitives,G$=require("@stdlib/assert/is-function"),V$=require("@stdlib/assert/is-method-in"),F$=require("@stdlib/assert/has-own-property"),vp=require("@stdlib/array/base/assert/contains").factory,W$=require("@stdlib/utils/constant-function"),I$=require("@stdlib/utils/noop"),k$=Kh(),z$=_u(),Js=require("@stdlib/string/format");function J$(r,e,t){var i;if(!G$(r))throw new TypeError(Js("invalid argument. First argument must be a function. Value: `%s`.",r));if(!V$(r,"factory"))throw new TypeError(Js("invalid argument. First argument must have a `%s` method.","factory"));if(!A$(e))throw new TypeError(Js("invalid argument. Second argument must an array of strings. Value: `%s`.",e));if(!vp(e,t))throw new TypeError(Js("invalid argument. Third argument must be a supported data type. Value: `%s`.",t));return i=vp(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),F$(m,"dtype")){if(p=m.dtype,!i(p))throw new TypeError(Js('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=k$):(g=q,a=z$),u=new a(l,e,p),m&&m.prng?(sa(h,"seed",null),sa(h,"seedLength",null),op(h,"state",W$(null),I$),sa(h,"stateLength",null),sa(h,"byteLength",null)):(Nu(h,"seed",b),Nu(h,"seedLength",w),op(h,"state",J,x),Nu(h,"stateLength",S),Nu(h,"byteLength",W)),sa(h,"PRNG",l.PRNG),sa(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}}}gp.exports=J$});var F=s(function(H7e,dp){"use strict";var U$=fp();dp.exports=U$});var Md=s(function(Z7e,lp){"use strict";var C$=require("@stdlib/constants/uint32/max"),B$=require("@stdlib/math/base/special/floor"),D$=C$-1;function X$(){var r=B$(1+D$*Math.random());return r>>>0}lp.exports=X$});var kd=s(function(Q7e,Ep){"use strict";var Ar=require("@stdlib/utils/define-nonenumerable-read-only-property"),ft=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),cp=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),xd=require("@stdlib/assert/has-own-property"),Y$=require("@stdlib/assert/is-plain-object"),H$=require("@stdlib/assert/is-collection"),mp=require("@stdlib/assert/is-uint32array"),Z$=require("@stdlib/assert/is-boolean").isPrimitive,hp=require("@stdlib/assert/is-positive-integer").isPrimitive,wp=require("@stdlib/constants/float64/max-safe-integer"),Sp=require("@stdlib/constants/uint32/max"),U=require("@stdlib/array/uint32"),Q$=require("@stdlib/math/base/special/max"),Id=require("@stdlib/math/base/ops/umul"),ua=require("@stdlib/blas/base/gcopy"),$$=require("@stdlib/array/to-json"),B=require("@stdlib/string/format"),pp=Md(),I=624,Ad=397,yp=Sp>>>0,K$=19650218,Gd=2147483648,Vd=2147483647,eK=1812433253,rK=1664525,tK=1566083941,iK=2636928640,nK=4022730752,aK=2567483615,Fd=[0,aK>>>0],Op=1/(wp+1),sK=67108864,uK=2147483648,Wd=1,oK=wp*Op,Lu=1,Ru=3,dt=2,lt=I+3,C=I+5,Us=I+6;function qp(r,e){var t;return e?t="option":t="argument",r.length>>0,i=1;i>>0,t=(t^t>>>30)>>>0,r[i]=Id(t,eK)+i>>>0;return r}function vK(r,e,t,i){var n,a,u,o;for(a=1,u=0,o=Q$(e,i);o>0;o--)n=r[a-1]>>>0,n=(n^n>>>30)>>>0,n=Id(n,rK)>>>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=Id(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]=uK,r}function gK(r){var e,t,i,n;for(n=I-Ad,t=0;t>>1^Fd[e&Wd];for(i=I-1;t>>1^Fd[e&Wd];return e=r[i]&Gd|r[0]&Vd,r[i]=r[Ad-1]^e>>>1^Fd[e&Wd],r}function fK(r){var e,t,i,n,a,u;if(i={},arguments.length){if(!Y$(r))throw new TypeError(B("invalid argument. Options argument must be an object. Value: `%s`.",r));if(xd(r,"copy")&&(i.copy=r.copy,!Z$(r.copy)))throw new TypeError(B("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",r.copy));if(xd(r,"state")){if(t=r.state,i.state=!0,!mp(t))throw new TypeError(B("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",t));if(u=qp(t,!0),u)throw u;i.copy===!1?e=t:(e=new U(t.length),ua(t.length,t,1,e,1)),t=new U(e.buffer,e.byteOffset+(dt+1)*e.BYTES_PER_ELEMENT,I),n=new U(e.buffer,e.byteOffset+(C+1)*e.BYTES_PER_ELEMENT,t[C])}if(n===void 0)if(xd(r,"seed"))if(n=r.seed,i.seed=!0,hp(n)){if(n>yp)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(H$(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],!hp(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>yp)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(Us+a),e[0]=Lu,e[1]=Ru,e[dt]=I,e[lt]=1,e[lt+1]=I,e[C]=a,ua.ndarray(a,n,1,0,e,1,C+1),t=new U(e.buffer,e.byteOffset+(dt+1)*e.BYTES_PER_ELEMENT,I),n=new U(e.buffer,e.byteOffset+(C+1)*e.BYTES_PER_ELEMENT,a),t=bp(t,I,K$),t=vK(t,I,n,a)}else n=pp()>>>0}else n=pp()>>>0;return t===void 0&&(e=new U(Us+1),e[0]=Lu,e[1]=Ru,e[dt]=I,e[lt]=1,e[lt+1]=I,e[C]=1,e[C+1]=n,t=new U(e.buffer,e.byteOffset+(dt+1)*e.BYTES_PER_ELEMENT,I),n=new U(e.buffer,e.byteOffset+(C+1)*e.BYTES_PER_ELEMENT,1),t=bp(t,I,n)),Ar(p,"NAME","mt19937"),ft(p,"seed",o),ft(p,"seedLength",v),cp(p,"state",l,m),ft(p,"stateLength",g),ft(p,"byteLength",c),Ar(p,"toJSON",h),Ar(p,"MIN",0),Ar(p,"MAX",Sp),Ar(p,"normalized",d),Ar(d,"NAME",p.NAME),ft(d,"seed",o),ft(d,"seedLength",v),cp(d,"state",l,m),ft(d,"stateLength",g),ft(d,"byteLength",c),Ar(d,"toJSON",h),Ar(d,"MIN",0),Ar(d,"MAX",oK),p;function o(){var f=e[C];return ua(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 ua(f,e,1,new U(f),1)}function m(f){var y;if(!mp(f))throw new TypeError(B("invalid argument. Must provide a Uint32Array. Value: `%s`.",f));if(y=qp(f,!1),y)throw y;i.copy===!1?i.state&&f.length===e.length?ua(f.length,f,1,e,1):(e=f,i.state=!0):(f.length!==e.length&&(e=new U(f.length)),ua(f.length,f,1,e,1)),t=new U(e.buffer,e.byteOffset+(dt+1)*e.BYTES_PER_ELEMENT,I),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=$$(e),f.params=[],f}function p(){var f,y;return y=e[lt+1],y>=I&&(t=gK(t),y=0),f=t[y],e[lt+1]=y+1,f^=f>>>11,f^=f<<7&iK,f^=f<<15&nK,f^=f>>>18,f>>>0}function d(){var f=p()>>>5,y=p()>>>6;return(f*sK+y)*Op}}Ep.exports=fK});var Np=s(function($7e,_p){"use strict";var dK=kd(),lK=Md(),cK=dK({seed:lK()});_p.exports=cK});var T=s(function(K7e,Rp){"use strict";var mK=require("@stdlib/utils/define-nonenumerable-read-only-property"),Lp=Np(),hK=kd();mK(Lp,"factory",hK);Rp.exports=Lp});var Mp=s(function(e5e,jp){"use strict";var Pp=require("@stdlib/assert/is-number").isPrimitive,zd=require("@stdlib/string/format"),Tp=require("@stdlib/assert/is-nan");function pK(r,e){return!Pp(r)||Tp(r)?new TypeError(zd("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):!Pp(e)||Tp(e)?new TypeError(zd("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e)):r>=e?new RangeError(zd("invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.",r,e)):null}jp.exports=pK});var Ap=s(function(r5e,xp){"use strict";var yK=require("@stdlib/math/base/special/pow"),qK=require("@stdlib/math/base/special/sin"),bK=require("@stdlib/constants/float64/half-pi");function wK(r,e,t){return e+yK(qK(bK*r()),2)*(t-e)}xp.exports=wK});var Jd=s(function(t5e,Jp){"use strict";var Gr=require("@stdlib/utils/define-nonenumerable-read-only-property"),Pu=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Gp=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Vp=require("@stdlib/assert/is-plain-object"),Fp=require("@stdlib/assert/is-function"),Wp=require("@stdlib/assert/has-own-property"),Ip=require("@stdlib/utils/constant-function"),SK=require("@stdlib/utils/noop"),Tu=T().factory,kp=require("@stdlib/math/base/assert/is-nan"),OK=require("@stdlib/array/to-json"),ju=require("@stdlib/string/format"),EK=Mp(),zp=Ap();function _K(){var r,e,t,i,n,a;if(arguments.length===0)e=Tu();else if(arguments.length===1){if(r=arguments[0],!Vp(r))throw new TypeError(ju("invalid argument. Options argument must be an object. Value: `%s`.",r));if(Wp(r,"prng")){if(!Fp(r.prng))throw new TypeError(ju("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Tu(r)}else{if(n=arguments[0],a=arguments[1],i=EK(n,a),i)throw i;if(arguments.length>2){if(r=arguments[2],!Vp(r))throw new TypeError(ju("invalid argument. Options argument must be an object. Value: `%s`.",r));if(Wp(r,"prng")){if(!Fp(r.prng))throw new TypeError(ju("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Tu(r)}else e=Tu()}return n===void 0?t=p:t=h,Gr(t,"NAME","arcsine"),r&&r.prng?(Gr(t,"seed",null),Gr(t,"seedLength",null),Gp(t,"state",Ip(null),SK),Gr(t,"stateLength",null),Gr(t,"byteLength",null),Gr(t,"toJSON",Ip(null)),Gr(t,"PRNG",e)):(Pu(t,"seed",u),Pu(t,"seedLength",o),Gp(t,"state",c,l),Pu(t,"stateLength",v),Pu(t,"byteLength",g),Gr(t,"toJSON",m),Gr(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=OK(e.state),n===void 0?d.params=[]:d.params=[n,a],d}function h(){return zp(e,n,a)}function p(d,f){return kp(d)||kp(f)||d>=f?NaN:zp(e,d,f)}}Jp.exports=_K});var Cp=s(function(i5e,Up){"use strict";var NK=Jd(),LK=NK();Up.exports=LK});var nn=s(function(n5e,Dp){"use strict";var RK=require("@stdlib/utils/define-nonenumerable-read-only-property"),Bp=Cp(),PK=Jd();RK(Bp,"factory",PK);Dp.exports=Bp});var Ud=s(function(a5e,Xp){"use strict";var TK=F(),jK=require("@stdlib/array/dtypes"),MK=require("@stdlib/array/defaults"),xK=nn(),AK=jK("real_floating_point_and_generic"),GK=TK(xK,AK,MK.get("dtypes.real_floating_point"));Xp.exports=GK});var Hp=s(function(s5e,Yp){"use strict";var VK=Ud(),FK=VK();Yp.exports=FK});var $p=s(function(u5e,Qp){"use strict";var WK=require("@stdlib/utils/define-nonenumerable-read-only-property"),Zp=Hp(),IK=Ud();WK(Zp,"factory",IK);Qp.exports=Zp});var ry=s(function(o5e,ey){"use strict";var kK=require("@stdlib/assert/is-plain-object"),zK=require("@stdlib/assert/has-own-property"),JK=require("@stdlib/array/base/assert/contains"),Kp=require("@stdlib/string/format");function UK(r,e,t){return kK(t)?zK(t,"dtype")&&(r.dtype=t.dtype,!JK(e,r.dtype))?new TypeError(Kp('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",e.join('", "'),r.dtype)):null:new TypeError(Kp("invalid argument. Options argument must be an object. Value: `%s`.",t))}ey.exports=UK});var ay=s(function(v5e,ny){"use strict";var ty=require("@stdlib/utils/define-nonenumerable-read-only-property"),CK=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,BK=require("@stdlib/assert/is-function"),DK=require("@stdlib/assert/is-string-array").primitives,XK=require("@stdlib/assert/is-collection"),YK=require("@stdlib/array/base/assert/contains"),HK=require("@stdlib/array/base/filled-by"),iy=require("@stdlib/strided/base/unary"),ZK=require("@stdlib/array/ctors"),Cs=require("@stdlib/string/format"),QK=ry();function Bs(r,e,t){if(!(this instanceof Bs))return new Bs(r,e,t);if(!BK(r))throw new TypeError(Cs("invalid argument. First argument must be a function. Value: `%s`.",r));if(!DK(e))throw new TypeError(Cs("invalid argument. Second argument must be an array of strings. Value: `%s`.",e));if(!YK(e,t))throw new TypeError(Cs("invalid argument. Third argument must be a supported data type. Value: `%s`.",t));return this._prng=r,this._dtypes=e,this._dtype=t,this}ty(Bs.prototype,"generate",function(e,t,i){var n,a,u,o,v,g;if(!CK(e))throw new TypeError(Cs("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",e));if(a={},arguments.length>2&&(v=QK(a,this._dtypes,i),v))throw v;if(u=this._prng,g=a.dtype||this._dtype,g==="generic")return HK(e,c);return n=ZK(g),o=new n(e),iy([[t],o],[e],[0,1],u),o;function c(){return u(t)}});ty(Bs.prototype,"assign",function(e,t){if(!XK(t))throw new TypeError(Cs("invalid argument. Second argument must be an array-like object. Value: `%s`.",t));return iy([[e],t],[t.length],[0,1],this._prng),t});ny.exports=Bs});var uy=s(function(g5e,sy){"use strict";var $K=ay();sy.exports=$K});var fy=s(function(f5e,gy){"use strict";var oy=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Mu=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),oa=require("@stdlib/utils/define-nonenumerable-read-only-property"),KK=require("@stdlib/assert/is-string-array").primitives,eee=require("@stdlib/assert/is-function"),ree=require("@stdlib/assert/is-method-in"),tee=require("@stdlib/assert/is-plain-object"),iee=require("@stdlib/assert/has-own-property"),vy=require("@stdlib/array/base/assert/contains").factory,nee=require("@stdlib/utils/constant-function"),aee=require("@stdlib/utils/noop"),see=uy(),uee=_u(),Ds=require("@stdlib/string/format");function oee(r,e,t){var i;if(!eee(r))throw new TypeError(Ds("invalid argument. First argument must be a function. Value: `%s`.",r));if(!ree(r,"factory"))throw new TypeError(Ds("invalid argument. First argument must have a `%s` method.","factory"));if(!KK(e))throw new TypeError(Ds("invalid argument. Second argument must an array of strings. Value: `%s`.",e));if(!vy(e,t))throw new TypeError(Ds("invalid argument. Third argument must be a supported data type. Value: `%s`.",t));return i=vy(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),iee(l,"dtype")){if(h=l.dtype,!i(h))throw new TypeError(Ds('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=see):(v=y,a=uee),u=new a(c,e,h),l&&l.prng?(oa(m,"seed",null),oa(m,"seedLength",null),oy(m,"state",nee(null),aee),oa(m,"stateLength",null),oa(m,"byteLength",null)):(Mu(m,"seed",q),Mu(m,"seedLength",b),oy(m,"state",W,J),Mu(m,"stateLength",w),Mu(m,"byteLength",S)),oa(m,"PRNG",c.PRNG),oa(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}}}gy.exports=oee});var Vr=s(function(d5e,dy){"use strict";var vee=fy();dy.exports=vee});var Cd=s(function(l5e,yy){"use strict";var Fr=require("@stdlib/utils/define-nonenumerable-read-only-property"),xu=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),ly=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),cy=require("@stdlib/assert/is-plain-object"),gee=require("@stdlib/assert/is-probability").isPrimitive,my=require("@stdlib/assert/is-function"),hy=require("@stdlib/assert/has-own-property"),py=require("@stdlib/utils/constant-function"),fee=require("@stdlib/utils/noop"),Au=T().factory,dee=require("@stdlib/math/base/assert/is-nan"),lee=require("@stdlib/array/to-json"),Gu=require("@stdlib/string/format");function cee(){var r,e,t,i;if(arguments.length===0)e=Au();else if(arguments.length===1&&cy(arguments[0]))if(r=arguments[0],hy(r,"prng")){if(!my(r.prng))throw new TypeError(Gu("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Au(r);else{if(i=arguments[0],!gee(i))throw new TypeError(Gu("invalid argument. First argument must be a probability. Value: `%s`.",i));if(arguments.length>1){if(r=arguments[1],!cy(r))throw new TypeError(Gu("invalid argument. Options argument must be an object. Value: `%s`.",r));if(hy(r,"prng")){if(!my(r.prng))throw new TypeError(Gu("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Au(r)}else e=Au()}return i===void 0?t=m:t=l,Fr(t,"NAME","bernoulli"),r&&r.prng?(Fr(t,"seed",null),Fr(t,"seedLength",null),ly(t,"state",py(null),fee),Fr(t,"stateLength",null),Fr(t,"byteLength",null),Fr(t,"toJSON",py(null)),Fr(t,"PRNG",e)):(xu(t,"seed",n),xu(t,"seedLength",a),ly(t,"state",v,g),xu(t,"stateLength",u),xu(t,"byteLength",o),Fr(t,"toJSON",c),Fr(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=lee(e.state),i===void 0?h.params=[]:h.params=[i],h}function l(){return e()<=i?1:0}function m(h){return dee(h)||h<0||h>1?NaN:e()<=h?1:0}}yy.exports=cee});var by=s(function(c5e,qy){"use strict";var mee=Cd(),hee=mee();qy.exports=hee});var va=s(function(m5e,Sy){"use strict";var pee=require("@stdlib/utils/define-nonenumerable-read-only-property"),wy=by(),yee=Cd();pee(wy,"factory",yee);Sy.exports=wy});var Bd=s(function(h5e,Oy){"use strict";var qee=Vr(),bee=require("@stdlib/array/dtypes"),wee=require("@stdlib/array/defaults"),See=va(),Oee=bee("real_and_generic"),Eee=qee(See,Oee,wee.get("dtypes.real"));Oy.exports=Eee});var _y=s(function(p5e,Ey){"use strict";var _ee=Bd(),Nee=_ee();Ey.exports=Nee});var Ry=s(function(y5e,Ly){"use strict";var Lee=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ny=_y(),Ree=Bd();Lee(Ny,"factory",Ree);Ly.exports=Ny});var My=s(function(q5e,jy){"use strict";var Pee=require("@stdlib/math/base/special/sqrt"),Py=require("@stdlib/math/base/special/exp"),Tee=require("@stdlib/math/base/special/ln"),Ty=.00991256303526217;function jee(r,e){var t,i,n;for(i=Py(-.5*e*e),t=[],t.push(Ty/i),t.push(e),n=2;n=0&&g<=1&&(v=r(),n=Yd(u,4),c=8*t-12,c=1-n/c,v<=c?i=!1:(c+=.5*Yd(n/(8*t-8),2),v=nq(v)&&(i=!1))));return g}aq.exports=are});var oq=s(function(P5e,uq){"use strict";var sre=require("@stdlib/math/base/special/pow"),Wu=require("@stdlib/math/base/special/ln");function ure(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*Wu(g),u=o/g,n=.5/sre(g,.5),a=!0;a===!0;)l=e(),h=u+l*n,h>=0&&h<=1&&(m=r(),p=o*Wu(h/o),p+=v*Wu((1-h)/v),p+=c+.5*l*l,p>=Wu(m)&&(a=!1));return h}uq.exports=ure});var fq=s(function(T5e,gq){"use strict";var Hd=require("@stdlib/math/base/special/exp"),vq=require("@stdlib/math/base/special/pow"),Zd=require("@stdlib/math/base/special/ln");function ore(r,e,t){for(var i,n,a,u,o,v,g;;)if(u=r(),o=r(),v=vq(u,1/e),g=vq(o,1/t),a=v+g,a<=1)return a>0?v/a:(i=Zd(u)/e,n=Zd(o)/t,i>n?(n-=i,i=0):(i-=n,n=0),Hd(i-Zd(Hd(i)+Hd(n))))}gq.exports=ore});var cq=s(function(j5e,lq){"use strict";var dq=iq(),vre=sq(),gre=oq(),fre=fq();function dre(r,e,t,i){var n,a;return t===i&&t>1.5?vre(r,e,t):t>1&&i>1?gre(r,e,t,i):t<1&&i<1?fre(r,t,i):(n=dq(r,e,t),a=dq(r,e,i),n/(n+a))}lq.exports=dre});var el=s(function(M5e,Eq){"use strict";var Wr=require("@stdlib/utils/define-nonenumerable-read-only-property"),Iu=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),mq=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),hq=require("@stdlib/assert/is-plain-object"),pq=require("@stdlib/assert/is-boolean").isPrimitive,yq=require("@stdlib/assert/is-function"),ga=require("@stdlib/assert/has-own-property"),qq=require("@stdlib/utils/constant-function"),lre=require("@stdlib/utils/noop"),bq=Q().factory,ku=T().factory,wq=require("@stdlib/math/base/assert/is-nan"),Qd=require("@stdlib/blas/base/gcopy"),$d=require("@stdlib/array/uint32"),Kd=require("@stdlib/assert/is-uint32array"),Sq=require("@stdlib/object/assign"),cre=require("@stdlib/array/to-json"),Ir=require("@stdlib/string/format"),mre=$y(),Oq=cq();function hre(){var r,e,t,i,n,a,u,o,v;if(o=!0,arguments.length===0)n={copy:!1},a=ku(n);else if(arguments.length===1){if(n=arguments[0],!hq(n))throw new TypeError(Ir("invalid argument. Options argument must be an object. Value: `%s`.",n));if(ga(n,"copy")&&!pq(n.copy))throw new TypeError(Ir("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",n.copy));if(ga(n,"prng")){if(!yq(n.prng))throw new TypeError(Ir("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",n.prng));a=n.prng}else{if(ga(n,"state")&&!Kd(n.state))throw new TypeError(Ir("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",n.state));n=Sq({},n),n.copy===!1?o=!1:n.state&&(n.state=Qd(n.state.length,n.state,1,new $d(n.state.length),1)),n.copy=!1,a=ku(n)}}else{if(t=arguments[0],i=arguments[1],v=mre(t,i),v)throw v;if(arguments.length>2){if(n=arguments[2],!hq(n))throw new TypeError(Ir("invalid argument. Options argument must be an object. Value: `%s`.",n));if(ga(n,"copy")&&!pq(n.copy))throw new TypeError(Ir("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",n.copy));if(ga(n,"prng")){if(!yq(n.prng))throw new TypeError(Ir("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",n.prng));a=n.prng}else{if(ga(n,"state")&&!Kd(n.state))throw new TypeError(Ir("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",n.state));n=Sq({},n),n.copy===!1?o=!1:n.state&&(n.state=Qd(n.state.length,n.state,1,new $d(n.state.length),1)),n.copy=!1,a=ku(n)}}else n={copy:!1},a=ku(n)}return n&&n.prng?e=bq({prng:n.prng}):(n.state?r=n.state:(r=a.state,a.state=r),e=bq({state:r,copy:!1})),t===void 0?u=y:u=f,Wr(u,"NAME","beta"),n&&n.prng?(Wr(u,"seed",null),Wr(u,"seedLength",null),mq(u,"state",qq(null),lre),Wr(u,"stateLength",null),Wr(u,"byteLength",null),Wr(u,"toJSON",qq(null)),Wr(u,"PRNG",a)):(Iu(u,"seed",g),Iu(u,"seedLength",c),mq(u,"state",h,p),Iu(u,"stateLength",l),Iu(u,"byteLength",m),Wr(u,"toJSON",d),Wr(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(!Kd(q))throw new TypeError(Ir("invalid argument. Must provide a Uint32Array. Value: `%s`.",q));o&&(q=Qd(q.length,q,1,new $d(q.length),1)),a.state=q}function d(){var q={};return q.type="PRNG",q.name=u.NAME,q.state=cre(a.state),t===void 0?q.params=[]:q.params=[t,i],q}function f(){return Oq(a,e,t,i)}function y(q,b){return wq(q)||wq(b)||q<=0||b<=0?NaN:Oq(a,e,q,b)}}Eq.exports=hre});var Nq=s(function(x5e,_q){"use strict";var pre=el(),yre=pre();_q.exports=yre});var sn=s(function(A5e,Rq){"use strict";var qre=require("@stdlib/utils/define-nonenumerable-read-only-property"),Lq=Nq(),bre=el();qre(Lq,"factory",bre);Rq.exports=Lq});var rl=s(function(G5e,Pq){"use strict";var wre=F(),Sre=require("@stdlib/array/dtypes"),Ore=require("@stdlib/array/defaults"),Ere=sn(),_re=Sre("real_floating_point_and_generic"),Nre=wre(Ere,_re,Ore.get("dtypes.real_floating_point"));Pq.exports=Nre});var jq=s(function(V5e,Tq){"use strict";var Lre=rl(),Rre=Lre();Tq.exports=Rre});var Aq=s(function(F5e,xq){"use strict";var Pre=require("@stdlib/utils/define-nonenumerable-read-only-property"),Mq=jq(),Tre=rl();Pre(Mq,"factory",Tre);xq.exports=Mq});var Wq=s(function(W5e,Fq){"use strict";var Gq=require("@stdlib/assert/is-positive-number").isPrimitive,Vq=require("@stdlib/string/format");function jre(r,e){return Gq(r)?Gq(e)?null:new TypeError(Vq("invalid argument. Second argument must be a positive number. Value: `%s`.",e)):new TypeError(Vq("invalid argument. First argument must be a positive number. Value: `%s`.",r))}Fq.exports=jre});var zq=s(function(I5e,kq){"use strict";var Iq=require("@stdlib/math/base/special/ln");function Mre(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+Iq(l)),c=r(),(c2){if(n=arguments[2],!Uq(n))throw new TypeError(zr("invalid argument. Options argument must be an object. Value: `%s`.",n));if(fa(n,"copy")&&!Cq(n.copy))throw new TypeError(zr("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",n.copy));if(fa(n,"prng")){if(!Bq(n.prng))throw new TypeError(zr("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",n.prng));a=n.prng}else{if(fa(n,"state")&&!tl(n.state))throw new TypeError(zr("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",n.state));n=Zq({},n),n.copy===!1?o=!1:n.state&&(n.state=nl(n.state.length,n.state,1,new al(n.state.length),1)),n.copy=!1,a=Ju(n)}}else n={copy:!1},a=Ju(n)}return n&&n.prng?t=Xq({prng:n.prng}):(n.state?r=n.state:(r=a.state,a.state=r),t=Xq({state:r,copy:!1})),e===void 0?u=w:(e>=1?(u=q,c=e-Cu):(u=b,c=e+1-Cu),g=1/il(9*c)),kr(u,"NAME","gamma"),n&&n.prng?(kr(u,"seed",null),kr(u,"seedLength",null),Jq(u,"state",Dq(null),xre),kr(u,"stateLength",null),kr(u,"byteLength",null),kr(u,"toJSON",Dq(null)),kr(u,"PRNG",a)):(zu(u,"seed",l),zu(u,"seedLength",m),Jq(u,"state",d,f),zu(u,"stateLength",h),zu(u,"byteLength",p),kr(u,"toJSON",y),kr(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(!tl(S))throw new TypeError(zr("invalid argument. Must provide a Uint32Array. Value: `%s`.",S));o&&(S=nl(S.length,S,1,new al(S.length),1)),a.state=S}function y(){var S={};return S.type="PRNG",S.name=u.NAME,S.state=Are(a.state),e===void 0?S.params=[]:S.params=[e,i],S}function q(){return Uu(a,t,i,c,g)}function b(){return Uu(a,t,i,c,g)*Hq(a(),1/e)}function w(S,W){var J,x;return Yq(S)||Yq(W)||S<=0||W<=0?NaN:S<1?(x=S+1-Cu,J=1/il(9*x),Uu(a,t,W,x,J)*Hq(a(),1/S)):(x=S-Cu,J=1/il(9*x),Uu(a,t,W,x,J))}}Qq.exports=Vre});var Kq=s(function(z5e,$q){"use strict";var Fre=sl(),Wre=Fre();$q.exports=Wre});var Ce=s(function(J5e,rb){"use strict";var Ire=require("@stdlib/utils/define-nonenumerable-read-only-property"),eb=Kq(),kre=sl();Ire(eb,"factory",kre);rb.exports=eb});var ab=s(function(U5e,nb){"use strict";var tb=require("@stdlib/assert/is-positive-number").isPrimitive,ib=require("@stdlib/string/format");function zre(r,e){return tb(r)?tb(e)?null:new TypeError(ib("invalid argument. Second argument must be a positive number. Value: `%s`.",e)):new TypeError(ib("invalid argument. First argument must be a positive number. Value: `%s`.",r))}nb.exports=zre});var ub=s(function(C5e,sb){"use strict";function Jre(r,e,t){return r(e,1)/r(t,1)}sb.exports=Jre});var ul=s(function(B5e,cb){"use strict";var mt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Bu=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),ob=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),vb=require("@stdlib/assert/is-plain-object"),gb=require("@stdlib/utils/constant-function"),Ure=require("@stdlib/utils/noop"),Du=Ce().factory,fb=require("@stdlib/math/base/assert/is-nan"),Cre=require("@stdlib/array/to-json"),db=require("@stdlib/string/format"),Bre=ab(),lb=ub();function Dre(){var r,e,t,i,n,a,u;if(arguments.length===0)r=Du();else if(arguments.length===1){if(i=arguments[0],!vb(i))throw new TypeError(db("invalid argument. Options argument must be an object. Value: `%s`.",i));r=Du(i)}else{if(e=arguments[0],t=arguments[1],u=Bre(e,t),u)throw u;if(arguments.length>2){if(i=arguments[2],!vb(i))throw new TypeError(db("invalid argument. Options argument must be an object. Value: `%s`.",i));r=Du(i)}else r=Du()}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),ob(a,"state",gb(null),Ure),mt(a,"stateLength",null),mt(a,"byteLength",null),mt(a,"toJSON",gb(null))):(Bu(a,"seed",o),Bu(a,"seedLength",v),ob(a,"state",l,m),Bu(a,"stateLength",g),Bu(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=Cre(n.state),e===void 0?f.params=[]:f.params=[e,t],f}function p(){return lb(r,e,t)}function d(f,y){return fb(f)||fb(y)||f<=0||y<=0?NaN:lb(r,f,y)}}cb.exports=Dre});var hb=s(function(D5e,mb){"use strict";var Xre=ul(),Yre=Xre();mb.exports=Yre});var un=s(function(X5e,yb){"use strict";var Hre=require("@stdlib/utils/define-nonenumerable-read-only-property"),pb=hb(),Zre=ul();Hre(pb,"factory",Zre);yb.exports=pb});var ol=s(function(Y5e,qb){"use strict";var Qre=F(),$re=require("@stdlib/array/dtypes"),Kre=require("@stdlib/array/defaults"),ete=un(),rte=$re("real_floating_point_and_generic"),tte=Qre(ete,rte,Kre.get("dtypes.real_floating_point"));qb.exports=tte});var wb=s(function(H5e,bb){"use strict";var ite=ol(),nte=ite();bb.exports=nte});var Eb=s(function(Z5e,Ob){"use strict";var ate=require("@stdlib/utils/define-nonenumerable-read-only-property"),Sb=wb(),ste=ol();ate(Sb,"factory",ste);Ob.exports=Sb});var Lb=s(function(Q5e,Nb){"use strict";var ute=require("@stdlib/assert/is-positive-integer").isPrimitive,ote=require("@stdlib/assert/is-probability").isPrimitive,_b=require("@stdlib/string/format");function vte(r,e){return ute(r)?ote(e)?null:new TypeError(_b("invalid argument. Second argument must be a probability. Value: `%s`.",e)):new TypeError(_b("invalid argument. First argument must be a positive integer. Value: `%s`.",e))}Nb.exports=vte});var Pb=s(function($5e,Rb){"use strict";function gte(r,e,t){var i=0,n;for(n=0;n=p?A=r()-.5:(A=G/p-.93,A=hte(A)*.5-A,G=p*r()),l=.5-gl(A),S=vl(A*(2*d/l+f)+y),!(S<0||S>e))if(G=G*i/(d/(l*l)+f),m=gl(S-W),m>15){if(G=Xu(G),o=m/u,v=(m/3+.625)*m,v+=yte,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}}}Mb.exports=qte});var Vb=s(function(rYe,Gb){"use strict";var bte=Pb(),wte=xb();function Ab(r,e,t){return t>.5?e-Ab(r,e,1-t):e*t<10?bte(r,e,t):wte(r,e,t)}Gb.exports=Ab});var fl=s(function(tYe,Cb){"use strict";var Jr=require("@stdlib/utils/define-nonenumerable-read-only-property"),Hu=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Fb=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Wb=require("@stdlib/assert/is-plain-object"),Ib=require("@stdlib/assert/is-function"),kb=require("@stdlib/assert/has-own-property"),zb=require("@stdlib/utils/constant-function"),Ste=require("@stdlib/utils/noop"),Jb=require("@stdlib/math/base/assert/is-nan"),Ote=require("@stdlib/math/base/assert/is-positive-integer"),Ete=require("@stdlib/math/base/assert/is-probability"),Zu=T().factory,_te=require("@stdlib/array/to-json"),Qu=require("@stdlib/string/format"),Nte=Lb(),Ub=Vb();function Lte(){var r,e,t,i,n,a;if(arguments.length===0)e=Zu();else if(arguments.length===1){if(r=arguments[0],!Wb(r))throw new TypeError(Qu("invalid argument. Options argument must be an object. Value: `%s`.",r));if(kb(r,"prng")){if(!Ib(r.prng))throw new TypeError(Qu("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Zu(r)}else{if(n=arguments[0],a=arguments[1],i=Nte(n,a),i)throw i;if(arguments.length>2){if(r=arguments[2],!Wb(r))throw new TypeError(Qu("invalid argument. Options argument must be an object. Value: `%s`.",r));if(kb(r,"prng")){if(!Ib(r.prng))throw new TypeError(Qu("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Zu(r)}else e=Zu()}return n===void 0?t=p:t=h,Jr(t,"NAME","binomial"),r&&r.prng?(Jr(t,"seed",null),Jr(t,"seedLength",null),Fb(t,"state",zb(null),Ste),Jr(t,"stateLength",null),Jr(t,"byteLength",null),Jr(t,"toJSON",zb(null)),Jr(t,"PRNG",e)):(Hu(t,"seed",u),Hu(t,"seedLength",o),Fb(t,"state",c,l),Hu(t,"stateLength",v),Hu(t,"byteLength",g),Jr(t,"toJSON",m),Jr(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=_te(e.state),n===void 0?d.params=[]:d.params=[n,a],d}function h(){return Ub(e,n,a)}function p(d,f){return Jb(d)||Jb(f)||!Ote(d)||!Ete(f)?NaN:Ub(e,d,f)}}Cb.exports=Lte});var Db=s(function(iYe,Bb){"use strict";var Rte=fl(),Pte=Rte();Bb.exports=Pte});var da=s(function(nYe,Yb){"use strict";var Tte=require("@stdlib/utils/define-nonenumerable-read-only-property"),Xb=Db(),jte=fl();Tte(Xb,"factory",jte);Yb.exports=Xb});var dl=s(function(aYe,Hb){"use strict";var Mte=F(),xte=require("@stdlib/array/dtypes"),Ate=require("@stdlib/array/defaults"),Gte=da(),Vte=xte("real_and_generic"),Fte=Mte(Gte,Vte,Ate.get("dtypes.real"));Hb.exports=Fte});var Qb=s(function(sYe,Zb){"use strict";var Wte=dl(),Ite=Wte();Zb.exports=Ite});var ew=s(function(uYe,Kb){"use strict";var kte=require("@stdlib/utils/define-nonenumerable-read-only-property"),$b=Qb(),zte=dl();kte($b,"factory",zte);Kb.exports=$b});var iw=s(function(oYe,tw){"use strict";var Jte=require("@stdlib/assert/is-number").isPrimitive,Ute=require("@stdlib/assert/is-positive-number").isPrimitive,rw=require("@stdlib/string/format"),Cte=require("@stdlib/assert/is-nan");function Bte(r,e){return!Jte(r)||Cte(r)?new TypeError(rw("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):Ute(e)?null:new TypeError(rw("invalid argument. Second argument must be a positive number. Value: `%s`.",e))}tw.exports=Bte});var aw=s(function(vYe,nw){"use strict";var Dte=require("@stdlib/math/base/special/tan"),Xte=require("@stdlib/constants/float64/pi");function Yte(r,e,t){return e+t*Dte(Xte*(r()-.5))}nw.exports=Yte});var ll=s(function(gYe,lw){"use strict";var ht=require("@stdlib/utils/define-nonenumerable-read-only-property"),$u=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),sw=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),uw=require("@stdlib/assert/is-plain-object"),ow=require("@stdlib/assert/is-function"),vw=require("@stdlib/assert/has-own-property"),gw=require("@stdlib/utils/constant-function"),Hte=require("@stdlib/utils/noop"),fw=require("@stdlib/math/base/assert/is-nan"),la=Q().factory,Zte=require("@stdlib/array/to-json"),Ku=require("@stdlib/string/format"),Qte=iw(),dw=aw();function $te(){var r,e,t,i,n,a,u;if(arguments.length===0)e=la();else if(arguments.length===1){if(t=arguments[0],!uw(t))throw new TypeError(Ku("invalid argument. Options argument must be an object. Value: `%s`.",t));if(vw(t,"prng")){if(!ow(t.prng))throw new TypeError(Ku("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",t.prng));e=la({prng:t.prng})}else e=la(t)}else{if(u=arguments[0],r=arguments[1],a=Qte(u,r),a)throw a;if(arguments.length>2){if(t=arguments[2],!uw(t))throw new TypeError(Ku("invalid argument. Options argument must be an object. Value: `%s`.",t));if(vw(t,"prng")){if(!ow(t.prng))throw new TypeError(Ku("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",t.prng));e=la({prng:t.prng})}else e=la(t)}else e=la()}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),sw(n,"state",gw(null),Hte),ht(n,"stateLength",null),ht(n,"byteLength",null),ht(n,"toJSON",gw(null))):($u(n,"seed",o),$u(n,"seedLength",v),sw(n,"state",l,m),$u(n,"stateLength",g),$u(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=Zte(i.state),u===void 0?f.params=[]:f.params=[u,r],f}function p(){return dw(e,u,r)}function d(f,y){return fw(f)||fw(y)||y<=0?NaN:dw(e,f,y)}}lw.exports=$te});var mw=s(function(fYe,cw){"use strict";var Kte=ll(),eie=Kte();cw.exports=eie});var ca=s(function(dYe,pw){"use strict";var rie=require("@stdlib/utils/define-nonenumerable-read-only-property"),hw=mw(),tie=ll();rie(hw,"factory",tie);pw.exports=hw});var cl=s(function(lYe,yw){"use strict";var iie=F(),nie=require("@stdlib/array/dtypes"),aie=require("@stdlib/array/defaults"),sie=ca(),uie=nie("real_floating_point_and_generic"),oie=iie(sie,uie,aie.get("dtypes.real_floating_point"));yw.exports=oie});var bw=s(function(cYe,qw){"use strict";var vie=cl(),gie=vie();qw.exports=gie});var Ow=s(function(mYe,Sw){"use strict";var fie=require("@stdlib/utils/define-nonenumerable-read-only-property"),ww=bw(),die=cl();fie(ww,"factory",die);Sw.exports=ww});var ml=s(function(hYe,Pw){"use strict";var pt=require("@stdlib/utils/define-nonenumerable-read-only-property"),eo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Ew=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),lie=require("@stdlib/assert/is-positive-number").isPrimitive,_w=require("@stdlib/assert/is-plain-object"),Nw=require("@stdlib/assert/is-function"),Lw=require("@stdlib/assert/has-own-property"),Rw=require("@stdlib/utils/constant-function"),cie=require("@stdlib/utils/noop"),mie=require("@stdlib/math/base/assert/is-nan"),ma=Ce().factory,hie=require("@stdlib/array/to-json"),ro=require("@stdlib/string/format");function pie(){var r,e,t,i,n;if(arguments.length===0)r=ma();else if(arguments.length===1&&_w(arguments[0]))if(t=arguments[0],Lw(t,"prng")){if(!Nw(t.prng))throw new TypeError(ro("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",t.prng));r=ma({prng:t.prng})}else r=ma(t);else{if(n=arguments[0],!lie(n))throw new TypeError(ro("invalid argument. First argument must be a positive number. Value: `%s`.",n));if(arguments.length>1){if(t=arguments[1],!_w(t))throw new TypeError(ro("invalid argument. Options argument must be an object. Value: `%s`.",t));if(Lw(t,"prng")){if(!Nw(t.prng))throw new TypeError(ro("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",t.prng));r=ma(n/2,.5,{prng:t.prng})}else r=ma(n/2,.5,t)}else r=ma(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),Ew(i,"state",Rw(null),cie),pt(i,"stateLength",null),pt(i,"byteLength",null),pt(i,"toJSON",Rw(null))):(eo(i,"seed",a),eo(i,"seedLength",u),Ew(i,"state",g,c),eo(i,"stateLength",o),eo(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=hie(e.state),n===void 0?p.params=[]:p.params=[n],p}function m(){return r()}function h(p){return mie(p)||p<=0?NaN:r(p/2,.5)}}Pw.exports=pie});var jw=s(function(pYe,Tw){"use strict";var yie=ml(),qie=yie();Tw.exports=qie});var Ur=s(function(yYe,xw){"use strict";var bie=require("@stdlib/utils/define-nonenumerable-read-only-property"),Mw=jw(),wie=ml();bie(Mw,"factory",wie);xw.exports=Mw});var hl=s(function(qYe,kw){"use strict";var yt=require("@stdlib/utils/define-nonenumerable-read-only-property"),to=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Aw=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Sie=require("@stdlib/assert/is-positive-number").isPrimitive,Gw=require("@stdlib/assert/is-plain-object"),Vw=require("@stdlib/assert/is-function"),Fw=require("@stdlib/assert/has-own-property"),Ww=require("@stdlib/utils/constant-function"),Oie=require("@stdlib/utils/noop"),Eie=require("@stdlib/math/base/assert/is-nan"),ha=Ur().factory,_ie=require("@stdlib/array/to-json"),Iw=require("@stdlib/math/base/special/sqrt"),io=require("@stdlib/string/format");function Nie(){var r,e,t,i,n;if(arguments.length===0)r=ha();else if(arguments.length===1&&Gw(arguments[0]))if(t=arguments[0],Fw(t,"prng")){if(!Vw(t.prng))throw new TypeError(io("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",t.prng));r=ha({prng:t.prng})}else r=ha(t);else{if(n=arguments[0],!Sie(n))throw new TypeError(io("invalid argument. First argument must be a positive number. Value: `%s`.",n));if(arguments.length>1){if(t=arguments[1],!Gw(t))throw new TypeError(io("invalid argument. Options argument must be an object. Value: `%s`.",t));if(Fw(t,"prng")){if(!Vw(t.prng))throw new TypeError(io("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",t.prng));r=ha(n,{prng:t.prng})}else r=ha(n,t)}else r=ha(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),Aw(i,"state",Ww(null),Oie),yt(i,"stateLength",null),yt(i,"byteLength",null),yt(i,"toJSON",Ww(null))):(to(i,"seed",a),to(i,"seedLength",u),Aw(i,"state",g,c),to(i,"stateLength",o),to(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=_ie(e.state),n===void 0?p.params=[]:p.params=[n],p}function m(){return Iw(r())}function h(p){return Eie(p)||p<=0?NaN:Iw(r(p))}}kw.exports=Nie});var Jw=s(function(bYe,zw){"use strict";var Lie=hl(),Rie=Lie();zw.exports=Rie});var pa=s(function(wYe,Cw){"use strict";var Pie=require("@stdlib/utils/define-nonenumerable-read-only-property"),Uw=Jw(),Tie=hl();Pie(Uw,"factory",Tie);Cw.exports=Uw});var pl=s(function(SYe,Bw){"use strict";var jie=Vr(),Mie=require("@stdlib/array/dtypes"),xie=require("@stdlib/array/defaults"),Aie=pa(),Gie=Mie("real_floating_point_and_generic"),Vie=jie(Aie,Gie,xie.get("dtypes.real_floating_point"));Bw.exports=Vie});var Xw=s(function(OYe,Dw){"use strict";var Fie=pl(),Wie=Fie();Dw.exports=Wie});var Zw=s(function(EYe,Hw){"use strict";var Iie=require("@stdlib/utils/define-nonenumerable-read-only-property"),Yw=Xw(),kie=pl();Iie(Yw,"factory",kie);Hw.exports=Yw});var yl=s(function(_Ye,Qw){"use strict";var zie=Vr(),Jie=require("@stdlib/array/dtypes"),Uie=require("@stdlib/array/defaults"),Cie=Ur(),Bie=Jie("real_floating_point_and_generic"),Die=zie(Cie,Bie,Uie.get("dtypes.real_floating_point"));Qw.exports=Die});var Kw=s(function(NYe,$w){"use strict";var Xie=yl(),Yie=Xie();$w.exports=Yie});var tS=s(function(LYe,rS){"use strict";var Hie=require("@stdlib/utils/define-nonenumerable-read-only-property"),eS=Kw(),Zie=yl();Hie(eS,"factory",Zie);rS.exports=eS});var aS=s(function(RYe,nS){"use strict";var Qie=require("@stdlib/assert/is-number").isPrimitive,$ie=require("@stdlib/assert/is-positive-number").isPrimitive,iS=require("@stdlib/string/format"),Kie=require("@stdlib/assert/is-nan");function ene(r,e){return!Qie(r)||Kie(r)?new TypeError(iS("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):$ie(e)?null:new TypeError(iS("invalid argument. Second argument must be a positive number. Value: `%s`.",e))}nS.exports=ene});var uS=s(function(PYe,sS){"use strict";var rne=require("@stdlib/stats/base/dists/cosine/quantile");function tne(r,e,t){return rne(r(),e,t)}sS.exports=tne});var ql=s(function(TYe,mS){"use strict";var Cr=require("@stdlib/utils/define-nonenumerable-read-only-property"),no=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),oS=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),vS=require("@stdlib/assert/is-plain-object"),gS=require("@stdlib/assert/is-function"),fS=require("@stdlib/assert/has-own-property"),dS=require("@stdlib/utils/constant-function"),ine=require("@stdlib/utils/noop"),ao=T().factory,lS=require("@stdlib/math/base/assert/is-nan"),nne=require("@stdlib/array/to-json"),so=require("@stdlib/string/format"),ane=aS(),cS=uS();function sne(){var r,e,t,i,n,a;if(arguments.length===0)e=ao();else if(arguments.length===1){if(r=arguments[0],!vS(r))throw new TypeError(so("invalid argument. Options argument must be an object. Value: `%s`.",r));if(fS(r,"prng")){if(!gS(r.prng))throw new TypeError(so("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=ao(r)}else{if(n=arguments[0],a=arguments[1],i=ane(n,a),i)throw i;if(arguments.length>2){if(r=arguments[2],!vS(r))throw new TypeError(so("invalid argument. Options argument must be an object. Value: `%s`.",r));if(fS(r,"prng")){if(!gS(r.prng))throw new TypeError(so("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=ao(r)}else e=ao()}return n===void 0?t=p:t=h,Cr(t,"NAME","cosine"),r&&r.prng?(Cr(t,"seed",null),Cr(t,"seedLength",null),oS(t,"state",dS(null),ine),Cr(t,"stateLength",null),Cr(t,"byteLength",null),Cr(t,"toJSON",dS(null)),Cr(t,"PRNG",e)):(no(t,"seed",u),no(t,"seedLength",o),oS(t,"state",c,l),no(t,"stateLength",v),no(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=nne(e.state),n===void 0?d.params=[]:d.params=[n,a],d}function h(){return cS(e,n,a)}function p(d,f){return lS(d)||lS(f)||f<=0?NaN:cS(e,d,f)}}mS.exports=sne});var pS=s(function(jYe,hS){"use strict";var une=ql(),one=une();hS.exports=one});var on=s(function(MYe,qS){"use strict";var vne=require("@stdlib/utils/define-nonenumerable-read-only-property"),yS=pS(),gne=ql();vne(yS,"factory",gne);qS.exports=yS});var bl=s(function(xYe,bS){"use strict";var fne=F(),dne=require("@stdlib/array/dtypes"),lne=require("@stdlib/array/defaults"),cne=on(),mne=dne("real_floating_point_and_generic"),hne=fne(cne,mne,lne.get("dtypes.real_floating_point"));bS.exports=hne});var SS=s(function(AYe,wS){"use strict";var pne=bl(),yne=pne();wS.exports=yne});var _S=s(function(GYe,ES){"use strict";var qne=require("@stdlib/utils/define-nonenumerable-read-only-property"),OS=SS(),bne=bl();qne(OS,"factory",bne);ES.exports=OS});var PS=s(function(VYe,RS){"use strict";var NS=require("@stdlib/assert/is-integer").isPrimitive,wl=require("@stdlib/string/format"),LS=require("@stdlib/assert/is-nan");function wne(r,e){return!NS(r)||LS(r)?new TypeError(wl("invalid argument. First argument must be an integer and not NaN. Value: `%s`.",r)):!NS(e)||LS(e)?new TypeError(wl("invalid argument. Second argument must be an integer and not NaN. Value: `%s`.",e)):r>e?new RangeError(wl("invalid argument. Minimum support must be less than or equal to maximum support. Value: `[%d, %d]`.",r,e)):null}RS.exports=wne});var MS=s(function(FYe,jS){"use strict";var Sl=require("@stdlib/constants/float64/max-safe-integer"),ya=require("@stdlib/math/base/special/floor");function TS(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(nSl/v)&&(l*=v,i+=l,!(i>a)))return i+e}for(n===Sl?(o=ya(n/(a+1)),n%(a+1)===a&&(o+=1)):o=ya((n+1)/(a+1));;)if(i=r()-g,i=ya(i/o),i<=a)return i+e}jS.exports=TS});var Ol=s(function(WYe,kS){"use strict";var Br=require("@stdlib/utils/define-nonenumerable-read-only-property"),uo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),xS=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),AS=require("@stdlib/assert/is-plain-object"),GS=require("@stdlib/assert/is-function"),VS=require("@stdlib/assert/has-own-property"),FS=require("@stdlib/utils/constant-function"),Sne=require("@stdlib/utils/noop"),oo=T().factory,WS=require("@stdlib/math/base/assert/is-nan"),qa=require("@stdlib/math/base/assert/is-integer"),One=require("@stdlib/array/to-json"),qt=require("@stdlib/string/format"),Ene=PS(),IS=MS();function _ne(){var r,e,t,i,n,a;if(arguments.length===0)e=oo();else if(arguments.length===1){if(r=arguments[0],!AS(r))throw new TypeError(qt("invalid argument. Options argument must be an object. Value: `%s`.",r));if(VS(r,"prng")){if(!GS(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,!qa(e.MIN))throw new TypeError(qt("invalid option. `%s` option must have a `MIN` property specifying the minimum possible pseudorandom integer value.","prng"));if(!qa(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=oo(r)}else{if(n=arguments[0],a=arguments[1],i=Ene(n,a),i)throw i;if(arguments.length>2){if(r=arguments[2],!AS(r))throw new TypeError(qt("invalid argument. Options argument must be an object. Value: `%s`.",r));if(VS(r,"prng")){if(!GS(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,!qa(e.MIN))throw new TypeError(qt("invalid option. `%s` option must have a `MIN` property specifying the minimum possible pseudorandom integer value.","prng"));if(!qa(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=oo(r)}else e=oo()}return n===void 0?t=p:t=h,Br(t,"NAME","discrete-uniform"),r&&r.prng?(Br(t,"seed",null),Br(t,"seedLength",null),xS(t,"state",FS(null),Sne),Br(t,"stateLength",null),Br(t,"byteLength",null),Br(t,"toJSON",FS(null)),Br(t,"PRNG",e)):(uo(t,"seed",u),uo(t,"seedLength",o),xS(t,"state",c,l),uo(t,"stateLength",v),uo(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=One(e.state),n===void 0?d.params=[]:d.params=[n,a],d}function h(){return IS(e,n,a)}function p(d,f){return WS(d)||WS(f)||!qa(d)||!qa(f)||d>f?NaN:IS(e,d,f)}}kS.exports=_ne});var JS=s(function(IYe,zS){"use strict";var Nne=Ol(),Lne=Nne();zS.exports=Lne});var vn=s(function(kYe,CS){"use strict";var Rne=require("@stdlib/utils/define-nonenumerable-read-only-property"),US=JS(),Pne=Ol();Rne(US,"factory",Pne);CS.exports=US});var El=s(function(zYe,BS){"use strict";var Tne=F(),jne=require("@stdlib/array/dtypes"),Mne=require("@stdlib/array/defaults"),xne=vn(),Ane=jne("real_and_generic"),Gne=Tne(xne,Ane,Mne.get("dtypes.real"));BS.exports=Gne});var XS=s(function(JYe,DS){"use strict";var Vne=El(),Fne=Vne();DS.exports=Fne});var ZS=s(function(UYe,HS){"use strict";var Wne=require("@stdlib/utils/define-nonenumerable-read-only-property"),YS=XS(),Ine=El();Wne(YS,"factory",Ine);HS.exports=YS});var KS=s(function(CYe,$S){"use strict";var kne=require("@stdlib/assert/is-positive-number").isPrimitive,zne=require("@stdlib/assert/is-positive-integer").isPrimitive,QS=require("@stdlib/string/format");function Jne(r,e){return zne(r)?kne(e)?null:new TypeError(QS("invalid argument. Second argument must be a positive number. Value: `%s`.",e)):new TypeError(QS("invalid argument. First argument must be a positive integer. Value: `%s`.",r))}$S.exports=Jne});var rO=s(function(BYe,eO){"use strict";var Une=require("@stdlib/math/base/special/ln");function Cne(r,e,t){var i,n;for(i=1,n=0;n2){if(t=arguments[2],!iO(t))throw new TypeError(fo("invalid argument. Options argument must be an object. Value: `%s`.",t));if(aO(t,"prng")){if(!nO(t.prng))throw new TypeError(fo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",t.prng));e=t.prng}else e=go(t)}else e=go()}return a===void 0?i=p:i=h,Dr(i,"NAME","erlang"),t&&t.prng?(Dr(i,"seed",null),Dr(i,"seedLength",null),tO(i,"state",sO(null),Bne),Dr(i,"stateLength",null),Dr(i,"byteLength",null),Dr(i,"toJSON",sO(null)),Dr(i,"PRNG",e)):(vo(i,"seed",u),vo(i,"seedLength",o),tO(i,"state",c,l),vo(i,"stateLength",v),vo(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=Xne(e.state),a===void 0?d.params=[]:d.params=[a,r],d}function h(){return oO(e,a,r)}function p(d,f){return uO(d)||uO(f)||!Dne(d)||f<=0?NaN:oO(e,d,f)}}vO.exports=Hne});var fO=s(function(XYe,gO){"use strict";var Zne=_l(),Qne=Zne();gO.exports=Qne});var ba=s(function(YYe,lO){"use strict";var $ne=require("@stdlib/utils/define-nonenumerable-read-only-property"),dO=fO(),Kne=_l();$ne(dO,"factory",Kne);lO.exports=dO});var Nl=s(function(HYe,cO){"use strict";var eae=F(),rae=require("@stdlib/array/dtypes"),tae=require("@stdlib/array/defaults"),iae=ba(),nae=rae("real_floating_point_and_generic"),aae=eae(iae,nae,tae.get("dtypes.real_floating_point"));cO.exports=aae});var hO=s(function(ZYe,mO){"use strict";var sae=Nl(),uae=sae();mO.exports=uae});var qO=s(function(QYe,yO){"use strict";var oae=require("@stdlib/utils/define-nonenumerable-read-only-property"),pO=hO(),vae=Nl();oae(pO,"factory",vae);yO.exports=pO});var wO=s(function($Ye,bO){"use strict";var gae=require("@stdlib/math/base/special/ln");function fae(r,e){return-gae(1-r())/e}bO.exports=fae});var Ll=s(function(KYe,RO){"use strict";var Xr=require("@stdlib/utils/define-nonenumerable-read-only-property"),lo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),SO=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),dae=require("@stdlib/assert/is-positive-number").isPrimitive,OO=require("@stdlib/assert/is-plain-object"),EO=require("@stdlib/assert/is-function"),_O=require("@stdlib/assert/has-own-property"),NO=require("@stdlib/utils/constant-function"),lae=require("@stdlib/utils/noop"),co=T().factory,cae=require("@stdlib/math/base/assert/is-nan"),mae=require("@stdlib/array/to-json"),mo=require("@stdlib/string/format"),LO=wO();function hae(){var r,e,t,i;if(arguments.length===0)t=co();else if(arguments.length===1&&OO(arguments[0]))if(e=arguments[0],_O(e,"prng")){if(!EO(e.prng))throw new TypeError(mo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));t=e.prng}else t=co(e);else{if(r=arguments[0],!dae(r))throw new TypeError(mo("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(arguments.length>1){if(e=arguments[1],!OO(e))throw new TypeError(mo("invalid argument. Options argument must be an object. Value: `%s`.",e));if(_O(e,"prng")){if(!EO(e.prng))throw new TypeError(mo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));t=e.prng}else t=co(e)}else t=co()}return r===void 0?i=m:i=l,Xr(i,"NAME","exponential"),e&&e.prng?(Xr(i,"seed",null),Xr(i,"seedLength",null),SO(i,"state",NO(null),lae),Xr(i,"stateLength",null),Xr(i,"byteLength",null),Xr(i,"toJSON",NO(null)),Xr(i,"PRNG",t)):(lo(i,"seed",n),lo(i,"seedLength",a),SO(i,"state",v,g),lo(i,"stateLength",u),lo(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=mae(t.state),r===void 0?h.params=[]:h.params=[r],h}function l(){return LO(t,r)}function m(h){return cae(h)||h<=0?NaN:LO(t,h)}}RO.exports=hae});var TO=s(function(e6e,PO){"use strict";var pae=Ll(),yae=pae();PO.exports=yae});var gn=s(function(r6e,MO){"use strict";var qae=require("@stdlib/utils/define-nonenumerable-read-only-property"),jO=TO(),bae=Ll();qae(jO,"factory",bae);MO.exports=jO});var Rl=s(function(t6e,xO){"use strict";var wae=Vr(),Sae=require("@stdlib/array/dtypes"),Oae=require("@stdlib/array/defaults"),Eae=gn(),_ae=Sae("real_floating_point_and_generic"),Nae=wae(Eae,_ae,Oae.get("dtypes.real_floating_point"));xO.exports=Nae});var GO=s(function(i6e,AO){"use strict";var Lae=Rl(),Rae=Lae();AO.exports=Rae});var WO=s(function(n6e,FO){"use strict";var Pae=require("@stdlib/utils/define-nonenumerable-read-only-property"),VO=GO(),Tae=Rl();Pae(VO,"factory",Tae);FO.exports=VO});var JO=s(function(a6e,zO){"use strict";var IO=require("@stdlib/assert/is-positive-number").isPrimitive,kO=require("@stdlib/string/format");function jae(r,e){return IO(r)?IO(e)?null:new TypeError(kO("invalid argument. Second argument must be a positive number. Value: `%s`.",e)):new TypeError(kO("invalid argument. First argument must be a positive number. Value: `%s`.",r))}zO.exports=jae});var CO=s(function(s6e,UO){"use strict";function Mae(r,e,t){var i=r(e)/e,n=r(t)/t;return i/n}UO.exports=Mae});var Pl=s(function(u6e,$O){"use strict";var bt=require("@stdlib/utils/define-nonenumerable-read-only-property"),ho=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),BO=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),DO=require("@stdlib/assert/is-plain-object"),XO=require("@stdlib/assert/is-function"),YO=require("@stdlib/assert/has-own-property"),HO=require("@stdlib/utils/constant-function"),xae=require("@stdlib/utils/noop"),wa=Ur().factory,ZO=require("@stdlib/math/base/assert/is-nan"),Aae=require("@stdlib/array/to-json"),po=require("@stdlib/string/format"),Gae=JO(),QO=CO();function Vae(){var r,e,t,i,n,a,u;if(arguments.length===0)r=wa();else if(arguments.length===1){if(e=arguments[0],!DO(e))throw new TypeError(po("invalid argument. Options argument must be an object. Value: `%s`.",e));if(YO(e,"prng")){if(!XO(e.prng))throw new TypeError(po("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));r=wa({prng:e.prng})}else r=wa(e)}else{if(a=arguments[0],u=arguments[1],n=Gae(a,u),n)throw n;if(arguments.length>2){if(e=arguments[2],!DO(e))throw new TypeError(po("invalid argument. Options argument must be an object. Value: `%s`.",e));if(YO(e,"prng")){if(!XO(e.prng))throw new TypeError(po("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));r=wa({prng:e.prng})}else r=wa(e)}else r=wa()}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),BO(i,"state",HO(null),xae),bt(i,"stateLength",null),bt(i,"byteLength",null),bt(i,"toJSON",HO(null))):(ho(i,"seed",o),ho(i,"seedLength",v),BO(i,"state",l,m),ho(i,"stateLength",g),ho(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=Aae(t.state),a===void 0?f.params=[]:f.params=[a,u],f}function p(){return QO(r,a,u)}function d(f,y){return ZO(f)||ZO(y)||f<=0||y<=0?NaN:QO(r,f,y)}}$O.exports=Vae});var eE=s(function(o6e,KO){"use strict";var Fae=Pl(),Wae=Fae();KO.exports=Wae});var Sa=s(function(v6e,tE){"use strict";var Iae=require("@stdlib/utils/define-nonenumerable-read-only-property"),rE=eE(),kae=Pl();Iae(rE,"factory",kae);tE.exports=rE});var Tl=s(function(g6e,iE){"use strict";var zae=F(),Jae=require("@stdlib/array/dtypes"),Uae=require("@stdlib/array/defaults"),Cae=Sa(),Bae=Jae("real_floating_point_and_generic"),Dae=zae(Cae,Bae,Uae.get("dtypes.real_floating_point"));iE.exports=Dae});var aE=s(function(f6e,nE){"use strict";var Xae=Tl(),Yae=Xae();nE.exports=Yae});var oE=s(function(d6e,uE){"use strict";var Hae=require("@stdlib/utils/define-nonenumerable-read-only-property"),sE=aE(),Zae=Tl();Hae(sE,"factory",Zae);uE.exports=sE});var fE=s(function(l6e,gE){"use strict";var Qae=require("@stdlib/assert/is-plain-object"),$ae=require("@stdlib/assert/has-own-property"),Kae=require("@stdlib/array/base/assert/contains"),vE=require("@stdlib/string/format");function ese(r,e,t){return Qae(t)?$ae(t,"dtype")&&(r.dtype=t.dtype,!Kae(e,r.dtype))?new TypeError(vE('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",e.join('", "'),r.dtype)):null:new TypeError(vE("invalid argument. Options argument must be an object. Value: `%s`.",t))}gE.exports=ese});var mE=s(function(c6e,cE){"use strict";var dE=require("@stdlib/utils/define-nonenumerable-read-only-property"),rse=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,tse=require("@stdlib/assert/is-function"),ise=require("@stdlib/assert/is-string-array").primitives,nse=require("@stdlib/assert/is-collection"),ase=require("@stdlib/array/base/assert/contains"),sse=require("@stdlib/array/base/filled-by"),lE=require("@stdlib/strided/base/ternary"),use=require("@stdlib/array/ctors"),Ys=require("@stdlib/string/format"),ose=fE();function Hs(r,e,t){if(!(this instanceof Hs))return new Hs(r,e,t);if(!tse(r))throw new TypeError(Ys("invalid argument. First argument must be a function. Value: `%s`.",r));if(!ise(e))throw new TypeError(Ys("invalid argument. Second argument must be an array of strings. Value: `%s`.",e));if(!ase(e,t))throw new TypeError(Ys("invalid argument. Third argument must be a supported data type. Value: `%s`.",t));return this._prng=r,this._dtypes=e,this._dtype=t,this}dE(Hs.prototype,"generate",function(e,t,i,n,a){var u,o,v,g,c,l;if(!rse(e))throw new TypeError(Ys("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",e));if(o={},arguments.length>4&&(c=ose(o,this._dtypes,a),c))throw c;if(v=this._prng,l=o.dtype||this._dtype,l==="generic")return sse(e,m);return u=use(l),g=new u(e),lE([[t],[i],[n],g],[e],[0,0,0,1],v),g;function m(){return v(t,i,n)}});dE(Hs.prototype,"assign",function(e,t,i,n){if(!nse(n))throw new TypeError(Ys("invalid argument. Third argument must be an array-like object. Value: `%s`.",n));return lE([[e],[t],[i],n],[n.length],[0,0,0,1],this._prng),n});cE.exports=Hs});var pE=s(function(m6e,hE){"use strict";var vse=mE();hE.exports=vse});var wE=s(function(h6e,bE){"use strict";var yE=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),yo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Oa=require("@stdlib/utils/define-nonenumerable-read-only-property"),gse=require("@stdlib/assert/is-string-array").primitives,fse=require("@stdlib/assert/is-function"),dse=require("@stdlib/assert/is-method-in"),lse=require("@stdlib/assert/has-own-property"),qE=require("@stdlib/array/base/assert/contains").factory,cse=require("@stdlib/utils/constant-function"),mse=require("@stdlib/utils/noop"),hse=pE(),pse=_u(),Zs=require("@stdlib/string/format");function yse(r,e,t){var i;if(!fse(r))throw new TypeError(Zs("invalid argument. First argument must be a function. Value: `%s`.",r));if(!dse(r,"factory"))throw new TypeError(Zs("invalid argument. First argument must have a `%s` method.","factory"));if(!gse(e))throw new TypeError(Zs("invalid argument. Second argument must an array of strings. Value: `%s`.",e));if(!qE(e,t))throw new TypeError(Zs("invalid argument. Third argument must be a supported data type. Value: `%s`.",t));return i=qE(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),lse(h,"dtype")){if(d=h.dtype,!i(d))throw new TypeError(Zs('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=hse):(c=b,a=pse),u=new a(m,e,d),h&&h.prng?(Oa(p,"seed",null),Oa(p,"seedLength",null),yE(p,"state",cse(null),mse),Oa(p,"stateLength",null),Oa(p,"byteLength",null)):(yo(p,"seed",w),yo(p,"seedLength",S),yE(p,"state",x,V),yo(p,"stateLength",W),yo(p,"byteLength",J)),Oa(p,"PRNG",m.PRNG),Oa(p,"assign",c),p;function f(A,G,Ue,Eu,u$){return arguments.length<5?u.generate(A,G,Ue,Eu):u.generate(A,G,Ue,Eu,u$)}function y(A,G){return arguments.length<2?u.generate(A):u.generate(A,G)}function q(A,G,Ue,Eu){return u.assign(A,G,Ue,Eu)}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}}}bE.exports=yse});var qo=s(function(p6e,SE){"use strict";var qse=wE();SE.exports=qse});var _E=s(function(y6e,EE){"use strict";var OE=require("@stdlib/assert/is-positive-number").isPrimitive,bse=require("@stdlib/assert/is-number").isPrimitive,jl=require("@stdlib/assert/is-nan"),Ml=require("@stdlib/string/format");function wse(r,e,t){return!OE(r)||jl(r)?new TypeError(Ml("invalid argument. First argument must be a positive number and not NaN. Value: `%s`.",r)):!OE(e)||jl(e)?new TypeError(Ml("invalid argument. Second argument must be a positive number and not NaN. Value: `%s`.",e)):!bse(t)||jl(t)?new TypeError(Ml("invalid argument. Third argument must be a number and not NaN. Value: `%s`.",t)):null}EE.exports=wse});var LE=s(function(q6e,NE){"use strict";var Sse=require("@stdlib/math/base/special/pow"),Ose=require("@stdlib/math/base/special/ln");function Ese(r,e,t,i){return i+t*Sse(-Ose(r()),-1/e)}NE.exports=Ese});var Al=s(function(b6e,AE){"use strict";var Yr=require("@stdlib/utils/define-nonenumerable-read-only-property"),bo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),RE=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),PE=require("@stdlib/assert/is-plain-object"),TE=require("@stdlib/assert/is-function"),jE=require("@stdlib/assert/has-own-property"),ME=require("@stdlib/utils/constant-function"),_se=require("@stdlib/utils/noop"),wo=T().factory,xl=require("@stdlib/math/base/assert/is-nan"),Nse=require("@stdlib/array/to-json"),So=require("@stdlib/string/format"),Lse=_E(),xE=LE();function Rse(){var r,e,t,i,n,a,u;if(arguments.length===0)t=wo();else if(arguments.length===1){if(e=arguments[0],!PE(e))throw new TypeError(So("invalid argument. Options argument must be an object. Value: `%s`.",e));if(jE(e,"prng")){if(!TE(e.prng))throw new TypeError(So("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));t=e.prng}else t=wo(e)}else{if(r=arguments[0],a=arguments[1],u=arguments[2],n=Lse(r,a,u),n)throw n;if(arguments.length>3){if(e=arguments[3],!PE(e))throw new TypeError(So("invalid argument. Options argument must be an object. Value: `%s`.",e));if(jE(e,"prng")){if(!TE(e.prng))throw new TypeError(So("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));t=e.prng}else t=wo(e)}else t=wo()}return r===void 0?i=d:i=p,Yr(i,"NAME","frechet"),e&&e.prng?(Yr(i,"seed",null),Yr(i,"seedLength",null),RE(i,"state",ME(null),_se),Yr(i,"stateLength",null),Yr(i,"byteLength",null),Yr(i,"toJSON",ME(null)),Yr(i,"PRNG",t)):(bo(i,"seed",o),bo(i,"seedLength",v),RE(i,"state",l,m),bo(i,"stateLength",g),bo(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=Nse(t.state),r===void 0?f.params=[]:f.params=[r,a,u],f}function p(){return xE(t,r,a,u)}function d(f,y,q){return xl(f)||xl(y)||xl(q)||f<=0||y<=0?NaN:xE(t,f,y,q)}}AE.exports=Rse});var VE=s(function(w6e,GE){"use strict";var Pse=Al(),Tse=Pse();GE.exports=Tse});var Ea=s(function(S6e,WE){"use strict";var jse=require("@stdlib/utils/define-nonenumerable-read-only-property"),FE=VE(),Mse=Al();jse(FE,"factory",Mse);WE.exports=FE});var Gl=s(function(O6e,IE){"use strict";var xse=qo(),Ase=require("@stdlib/array/dtypes"),Gse=require("@stdlib/array/defaults"),Vse=Ea(),Fse=Ase("real_floating_point_and_generic"),Wse=xse(Vse,Fse,Gse.get("dtypes.real_floating_point"));IE.exports=Wse});var zE=s(function(E6e,kE){"use strict";var Ise=Gl(),kse=Ise();kE.exports=kse});var CE=s(function(_6e,UE){"use strict";var zse=require("@stdlib/utils/define-nonenumerable-read-only-property"),JE=zE(),Jse=Gl();zse(JE,"factory",Jse);UE.exports=JE});var Vl=s(function(N6e,BE){"use strict";var Use=F(),Cse=require("@stdlib/array/dtypes"),Bse=require("@stdlib/array/defaults"),Dse=Ce(),Xse=Cse("real_floating_point_and_generic"),Yse=Use(Dse,Xse,Bse.get("dtypes.real_floating_point"));BE.exports=Yse});var XE=s(function(L6e,DE){"use strict";var Hse=Vl(),Zse=Hse();DE.exports=Zse});var ZE=s(function(R6e,HE){"use strict";var Qse=require("@stdlib/utils/define-nonenumerable-read-only-property"),YE=XE(),$se=Vl();Qse(YE,"factory",$se);HE.exports=YE});var KE=s(function(P6e,$E){"use strict";var Kse=require("@stdlib/math/base/special/floor"),QE=require("@stdlib/math/base/special/ln");function eue(r,e){var t=r();return t===0&&(t=r()),Kse(QE(t)/QE(1-e))}$E.exports=eue});var Fl=s(function(T6e,s_){"use strict";var Hr=require("@stdlib/utils/define-nonenumerable-read-only-property"),Oo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),e_=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),r_=require("@stdlib/assert/is-plain-object"),rue=require("@stdlib/assert/is-probability").isPrimitive,t_=require("@stdlib/assert/is-function"),i_=require("@stdlib/assert/has-own-property"),n_=require("@stdlib/utils/constant-function"),tue=require("@stdlib/utils/noop"),Eo=T().factory,iue=require("@stdlib/math/base/assert/is-nan"),nue=require("@stdlib/array/to-json"),_o=require("@stdlib/string/format"),a_=KE();function aue(){var r,e,t,i;if(arguments.length===0)e=Eo();else if(arguments.length===1&&r_(arguments[0]))if(r=arguments[0],i_(r,"prng")){if(!t_(r.prng))throw new TypeError(_o("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Eo(r);else{if(i=arguments[0],!rue(i))throw new TypeError(_o("invalid argument. First argument must be a probability. Value: `%s`.",i));if(arguments.length>1){if(r=arguments[1],!r_(r))throw new TypeError(_o("invalid argument. Options argument must be an object. Value: `%s`.",r));if(i_(r,"prng")){if(!t_(r.prng))throw new TypeError(_o("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Eo(r)}else e=Eo()}return i===void 0?t=m:t=l,Hr(t,"NAME","geometric"),r&&r.prng?(Hr(t,"seed",null),Hr(t,"seedLength",null),e_(t,"state",n_(null),tue),Hr(t,"stateLength",null),Hr(t,"byteLength",null),Hr(t,"toJSON",n_(null)),Hr(t,"PRNG",e)):(Oo(t,"seed",n),Oo(t,"seedLength",a),e_(t,"state",v,g),Oo(t,"stateLength",u),Oo(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=nue(e.state),i===void 0?h.params=[]:h.params=[i],h}function l(){return a_(e,i)}function m(h){return iue(h)||h<0||h>1?NaN:a_(e,h)}}s_.exports=aue});var o_=s(function(j6e,u_){"use strict";var sue=Fl(),uue=sue();u_.exports=uue});var _a=s(function(M6e,g_){"use strict";var oue=require("@stdlib/utils/define-nonenumerable-read-only-property"),v_=o_(),vue=Fl();oue(v_,"factory",vue);g_.exports=v_});var Wl=s(function(x6e,f_){"use strict";var gue=Vr(),fue=require("@stdlib/array/dtypes"),due=require("@stdlib/array/defaults"),lue=_a(),cue=fue("real_and_generic"),mue=gue(lue,cue,due.get("dtypes.real"));f_.exports=mue});var l_=s(function(A6e,d_){"use strict";var hue=Wl(),pue=hue();d_.exports=pue});var h_=s(function(G6e,m_){"use strict";var yue=require("@stdlib/utils/define-nonenumerable-read-only-property"),c_=l_(),que=Wl();yue(c_,"factory",que);m_.exports=c_});var q_=s(function(V6e,y_){"use strict";var bue=require("@stdlib/assert/is-number").isPrimitive,wue=require("@stdlib/assert/is-positive-number").isPrimitive,p_=require("@stdlib/string/format"),Sue=require("@stdlib/assert/is-nan");function Oue(r,e){return!bue(r)||Sue(r)?new TypeError(p_("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):wue(e)?null:new TypeError(p_("invalid argument. Second argument must be a positive number. Value: `%s`.",e))}y_.exports=Oue});var S_=s(function(F6e,w_){"use strict";var b_=require("@stdlib/math/base/special/ln");function Eue(r,e,t){return e-t*b_(-b_(r()))}w_.exports=Eue});var Il=s(function(W6e,T_){"use strict";var Zr=require("@stdlib/utils/define-nonenumerable-read-only-property"),No=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),O_=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),E_=require("@stdlib/assert/is-plain-object"),__=require("@stdlib/assert/is-function"),N_=require("@stdlib/assert/has-own-property"),L_=require("@stdlib/utils/constant-function"),_ue=require("@stdlib/utils/noop"),Lo=T().factory,R_=require("@stdlib/math/base/assert/is-nan"),Nue=require("@stdlib/array/to-json"),Ro=require("@stdlib/string/format"),Lue=q_(),P_=S_();function Rue(){var r,e,t,i,n,a;if(arguments.length===0)t=Lo();else if(arguments.length===1){if(e=arguments[0],!E_(e))throw new TypeError(Ro("invalid argument. Options argument must be an object. Value: `%s`.",e));if(N_(e,"prng")){if(!__(e.prng))throw new TypeError(Ro("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));t=e.prng}else t=Lo(e)}else{if(a=arguments[0],r=arguments[1],n=Lue(a,r),n)throw n;if(arguments.length>2){if(e=arguments[2],!E_(e))throw new TypeError(Ro("invalid argument. Options argument must be an object. Value: `%s`.",e));if(N_(e,"prng")){if(!__(e.prng))throw new TypeError(Ro("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));t=e.prng}else t=Lo(e)}else t=Lo()}return a===void 0?i=p:i=h,Zr(i,"NAME","gumbel"),e&&e.prng?(Zr(i,"seed",null),Zr(i,"seedLength",null),O_(i,"state",L_(null),_ue),Zr(i,"stateLength",null),Zr(i,"byteLength",null),Zr(i,"toJSON",L_(null)),Zr(i,"PRNG",t)):(No(i,"seed",u),No(i,"seedLength",o),O_(i,"state",c,l),No(i,"stateLength",v),No(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=Nue(t.state),a===void 0?d.params=[]:d.params=[a,r],d}function h(){return P_(t,a,r)}function p(d,f){return R_(d)||R_(f)||f<=0?NaN:P_(t,d,f)}}T_.exports=Rue});var M_=s(function(I6e,j_){"use strict";var Pue=Il(),Tue=Pue();j_.exports=Tue});var Na=s(function(k6e,A_){"use strict";var jue=require("@stdlib/utils/define-nonenumerable-read-only-property"),x_=M_(),Mue=Il();jue(x_,"factory",Mue);A_.exports=x_});var kl=s(function(z6e,G_){"use strict";var xue=F(),Aue=require("@stdlib/array/dtypes"),Gue=require("@stdlib/array/defaults"),Vue=Na(),Fue=Aue("real_floating_point_and_generic"),Wue=xue(Vue,Fue,Gue.get("dtypes.real_floating_point"));G_.exports=Wue});var F_=s(function(J6e,V_){"use strict";var Iue=kl(),kue=Iue();V_.exports=kue});var k_=s(function(U6e,I_){"use strict";var zue=require("@stdlib/utils/define-nonenumerable-read-only-property"),W_=F_(),Jue=kl();zue(W_,"factory",Jue);I_.exports=W_});var J_=s(function(C6e,z_){"use strict";var zl=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Qs=require("@stdlib/string/format");function Uue(r,e,t){return zl(r)?zl(e)?zl(t)?t>r?new RangeError(Qs("invalid argument. Third argument must be less than or equal to the first argument. Value: `%u`.",t)):e>r?new RangeError(Qs("invalid argument. Second argument must be less than or equal to the first argument. Value: `%u`.",e)):null:new TypeError(Qs("invalid argument. Third argument must be a nonnegative integer. Value: `%s`.",t)):new TypeError(Qs("invalid argument. Second argument must be a nonnegative integer. Value: `%s`.",e)):new TypeError(Qs("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",r))}z_.exports=Uue});var C_=s(function(B6e,U_){"use strict";var wt=require("@stdlib/math/base/special/factorial");function Cue(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}U_.exports=Cue});var D_=s(function(D6e,B_){"use strict";var Po=C_();function Bue(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=Po(r,n,a,u),t-o):(a=t,n=e-t,o=Po(r,n,a,u),i-e+t+o)):(u=i,2*t<=e?(n=t,a=e-t,o=Po(r,n,a,u),o):(n=e-t,a=t,o=Po(r,n,a,u),i-o))}B_.exports=Bue});var Ul=s(function(X6e,eN){"use strict";var Qr=require("@stdlib/utils/define-nonenumerable-read-only-property"),To=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),X_=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Y_=require("@stdlib/assert/is-plain-object"),H_=require("@stdlib/assert/is-function"),Z_=require("@stdlib/assert/has-own-property"),Q_=require("@stdlib/utils/constant-function"),Due=require("@stdlib/utils/noop"),jo=T().factory,Jl=require("@stdlib/math/base/assert/is-nonnegative-integer"),$_=require("@stdlib/constants/float64/pinf"),Xue=require("@stdlib/array/to-json"),Mo=require("@stdlib/string/format"),Yue=J_(),K_=D_();function Hue(){var r,e,t,i,n,a,u;if(arguments.length===0)e=jo();else if(arguments.length===1){if(r=arguments[0],!Y_(r))throw new TypeError(Mo("invalid argument. Options argument must be an object. Value: `%s`.",r));if(Z_(r,"prng")){if(!H_(r.prng))throw new TypeError(Mo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=jo(r)}else{if(n=arguments[0],a=arguments[1],u=arguments[2],i=Yue(n,a,u),i)throw i;if(arguments.length>3){if(r=arguments[3],!Y_(r))throw new TypeError(Mo("invalid argument. Options argument must be an object. Value: `%s`.",r));if(Z_(r,"prng")){if(!H_(r.prng))throw new TypeError(Mo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=jo(r)}else e=jo()}return n===void 0?t=d:t=p,Qr(t,"NAME","hypergeometric"),r&&r.prng?(Qr(t,"seed",null),Qr(t,"seedLength",null),X_(t,"state",Q_(null),Due),Qr(t,"stateLength",null),Qr(t,"byteLength",null),Qr(t,"toJSON",Q_(null)),Qr(t,"PRNG",e)):(To(t,"seed",o),To(t,"seedLength",v),X_(t,"state",l,m),To(t,"stateLength",g),To(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=Xue(e.state),n===void 0?f.params=[]:f.params=[n,a,u],f}function p(){return K_(e,n,a,u)}function d(f,y,q){return f===$_||y===$_||!Jl(f)||!Jl(y)||!Jl(q)||q>f?NaN:K_(e,f,y,q)}}eN.exports=Hue});var tN=s(function(Y6e,rN){"use strict";var Zue=Ul(),Que=Zue();rN.exports=Que});var La=s(function(H6e,nN){"use strict";var $ue=require("@stdlib/utils/define-nonenumerable-read-only-property"),iN=tN(),Kue=Ul();$ue(iN,"factory",Kue);nN.exports=iN});var Cl=s(function(Z6e,aN){"use strict";var eoe=qo(),roe=require("@stdlib/array/dtypes"),toe=require("@stdlib/array/defaults"),ioe=La(),noe=roe("real_and_generic"),aoe=eoe(ioe,noe,toe.get("dtypes.real"));aN.exports=aoe});var uN=s(function(Q6e,sN){"use strict";var soe=Cl(),uoe=soe();sN.exports=uoe});var gN=s(function($6e,vN){"use strict";var ooe=require("@stdlib/utils/define-nonenumerable-read-only-property"),oN=uN(),voe=Cl();ooe(oN,"factory",voe);vN.exports=oN});var cN=s(function(K6e,lN){"use strict";var fN=require("@stdlib/assert/is-positive-number").isPrimitive,dN=require("@stdlib/string/format");function goe(r,e){return fN(r)?fN(e)?null:new TypeError(dN("invalid argument. Second argument must be a positive number. Value: `%s`.",e)):new TypeError(dN("invalid argument. First argument must be a positive number. Value: `%s`.",r))}lN.exports=goe});var Bl=s(function(e4e,wN){"use strict";var St=require("@stdlib/utils/define-nonenumerable-read-only-property"),xo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),mN=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),hN=require("@stdlib/assert/is-plain-object"),pN=require("@stdlib/assert/is-function"),yN=require("@stdlib/assert/has-own-property"),qN=require("@stdlib/utils/constant-function"),foe=require("@stdlib/utils/noop"),Ra=Ce().factory,bN=require("@stdlib/math/base/assert/is-nan"),doe=require("@stdlib/array/to-json"),Ao=require("@stdlib/string/format"),loe=cN();function coe(){var r,e,t,i,n,a,u;if(arguments.length===0)r=Ra();else if(arguments.length===1){if(i=arguments[0],!hN(i))throw new TypeError(Ao("invalid argument. Options argument must be an object. Value: `%s`.",i));if(yN(i,"prng")){if(!pN(i.prng))throw new TypeError(Ao("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=loe(e,t),u)throw u;if(arguments.length>2){if(i=arguments[2],!hN(i))throw new TypeError(Ao("invalid argument. Options argument must be an object. Value: `%s`.",i));if(yN(i,"prng")){if(!pN(i.prng))throw new TypeError(Ao("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),mN(a,"state",qN(null),foe),St(a,"stateLength",null),St(a,"byteLength",null),St(a,"toJSON",qN(null))):(xo(a,"seed",o),xo(a,"seedLength",v),mN(a,"state",l,m),xo(a,"stateLength",g),xo(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=doe(n.state),e===void 0?f.params=[]:f.params=[e,t],f}function p(){return 1/r()}function d(f,y){return bN(f)||bN(y)||f<=0||y<=0?NaN:1/r(f,y)}}wN.exports=coe});var ON=s(function(r4e,SN){"use strict";var moe=Bl(),hoe=moe();SN.exports=hoe});var fn=s(function(t4e,_N){"use strict";var poe=require("@stdlib/utils/define-nonenumerable-read-only-property"),EN=ON(),yoe=Bl();poe(EN,"factory",yoe);_N.exports=EN});var Dl=s(function(i4e,NN){"use strict";var qoe=F(),boe=require("@stdlib/array/dtypes"),woe=require("@stdlib/array/defaults"),Soe=fn(),Ooe=boe("real_floating_point_and_generic"),Eoe=qoe(Soe,Ooe,woe.get("dtypes.real_floating_point"));NN.exports=Eoe});var RN=s(function(n4e,LN){"use strict";var _oe=Dl(),Noe=_oe();LN.exports=Noe});var jN=s(function(a4e,TN){"use strict";var Loe=require("@stdlib/utils/define-nonenumerable-read-only-property"),PN=RN(),Roe=Dl();Loe(PN,"factory",Roe);TN.exports=PN});var GN=s(function(s4e,AN){"use strict";var MN=require("@stdlib/assert/is-positive-number").isPrimitive,xN=require("@stdlib/string/format");function Poe(r,e){return MN(r)?MN(e)?null:new TypeError(xN("invalid argument. Second argument must be a positive number. Value: `%s`.",e)):new TypeError(xN("invalid argument. First argument must be a positive number. Value: `%s`.",r))}AN.exports=Poe});var WN=s(function(u4e,FN){"use strict";var VN=require("@stdlib/math/base/special/pow");function Toe(r,e,t){var i=r();return VN(1-VN(1-i,1/t),1/e)}FN.exports=Toe});var Xl=s(function(o4e,DN){"use strict";var $r=require("@stdlib/utils/define-nonenumerable-read-only-property"),Go=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),IN=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),kN=require("@stdlib/assert/is-plain-object"),zN=require("@stdlib/assert/is-function"),JN=require("@stdlib/assert/has-own-property"),UN=require("@stdlib/utils/constant-function"),joe=require("@stdlib/utils/noop"),Vo=T().factory,CN=require("@stdlib/math/base/assert/is-nan"),Moe=require("@stdlib/array/to-json"),Fo=require("@stdlib/string/format"),xoe=GN(),BN=WN();function Aoe(){var r,e,t,i,n,a;if(arguments.length===0)e=Vo();else if(arguments.length===1){if(r=arguments[0],!kN(r))throw new TypeError(Fo("invalid argument. Options argument must be an object. Value: `%s`.",r));if(JN(r,"prng")){if(!zN(r.prng))throw new TypeError(Fo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Vo(r)}else{if(n=arguments[0],a=arguments[1],i=xoe(n,a),i)throw i;if(arguments.length>2){if(r=arguments[2],!kN(r))throw new TypeError(Fo("invalid argument. Options argument must be an object. Value: `%s`.",r));if(JN(r,"prng")){if(!zN(r.prng))throw new TypeError(Fo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Vo(r)}else e=Vo()}return n===void 0?t=p:t=h,$r(t,"NAME","kumaraswamy"),r&&r.prng?($r(t,"seed",null),$r(t,"seedLength",null),IN(t,"state",UN(null),joe),$r(t,"stateLength",null),$r(t,"byteLength",null),$r(t,"toJSON",UN(null)),$r(t,"PRNG",e)):(Go(t,"seed",u),Go(t,"seedLength",o),IN(t,"state",c,l),Go(t,"stateLength",v),Go(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=Moe(e.state),n===void 0?d.params=[]:d.params=[n,a],d}function h(){return BN(e,n,a)}function p(d,f){return CN(d)||CN(f)||d<=0||f<=0?NaN:BN(e,d,f)}}DN.exports=Aoe});var YN=s(function(v4e,XN){"use strict";var Goe=Xl(),Voe=Goe();XN.exports=Voe});var Pa=s(function(g4e,ZN){"use strict";var Foe=require("@stdlib/utils/define-nonenumerable-read-only-property"),HN=YN(),Woe=Xl();Foe(HN,"factory",Woe);ZN.exports=HN});var Yl=s(function(f4e,QN){"use strict";var Ioe=F(),koe=require("@stdlib/array/dtypes"),zoe=require("@stdlib/array/defaults"),Joe=Pa(),Uoe=koe("real_floating_point_and_generic"),Coe=Ioe(Joe,Uoe,zoe.get("dtypes.real_floating_point"));QN.exports=Coe});var KN=s(function(d4e,$N){"use strict";var Boe=Yl(),Doe=Boe();$N.exports=Doe});var tL=s(function(l4e,rL){"use strict";var Xoe=require("@stdlib/utils/define-nonenumerable-read-only-property"),eL=KN(),Yoe=Yl();Xoe(eL,"factory",Yoe);rL.exports=eL});var aL=s(function(c4e,nL){"use strict";var Hoe=require("@stdlib/assert/is-number").isPrimitive,Zoe=require("@stdlib/assert/is-positive-number").isPrimitive,iL=require("@stdlib/string/format"),Qoe=require("@stdlib/assert/is-nan");function $oe(r,e){return!Hoe(r)||Qoe(r)?new TypeError(iL("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):Zoe(e)?null:new TypeError(iL("invalid argument. Second argument must be a positive number. Value: `%s`.",e))}nL.exports=$oe});var uL=s(function(m4e,sL){"use strict";var Koe=require("@stdlib/math/base/special/signum"),eve=require("@stdlib/math/base/special/abs"),rve=require("@stdlib/math/base/special/ln");function tve(r,e,t){var i=r()-.5;return e-t*Koe(i)*rve(1-2*eve(i))}sL.exports=tve});var Hl=s(function(h4e,mL){"use strict";var Kr=require("@stdlib/utils/define-nonenumerable-read-only-property"),Wo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),oL=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),vL=require("@stdlib/assert/is-plain-object"),gL=require("@stdlib/assert/is-function"),fL=require("@stdlib/assert/has-own-property"),dL=require("@stdlib/utils/constant-function"),ive=require("@stdlib/utils/noop"),Io=T().factory,lL=require("@stdlib/math/base/assert/is-nan"),nve=require("@stdlib/array/to-json"),ko=require("@stdlib/string/format"),ave=aL(),cL=uL();function sve(){var r,e,t,i,n,a;if(arguments.length===0)e=Io();else if(arguments.length===1){if(r=arguments[0],!vL(r))throw new TypeError(ko("invalid argument. Options argument must be an object. Value: `%s`.",r));if(fL(r,"prng")){if(!gL(r.prng))throw new TypeError(ko("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Io(r)}else{if(n=arguments[0],a=arguments[1],i=ave(n,a),i)throw i;if(arguments.length>2){if(r=arguments[2],!vL(r))throw new TypeError(ko("invalid argument. Options argument must be an object. Value: `%s`.",r));if(fL(r,"prng")){if(!gL(r.prng))throw new TypeError(ko("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Io(r)}else e=Io()}return n===void 0?t=p:t=h,Kr(t,"NAME","laplace"),r&&r.prng?(Kr(t,"seed",null),Kr(t,"seedLength",null),oL(t,"state",dL(null),ive),Kr(t,"stateLength",null),Kr(t,"byteLength",null),Kr(t,"toJSON",dL(null)),Kr(t,"PRNG",e)):(Wo(t,"seed",u),Wo(t,"seedLength",o),oL(t,"state",c,l),Wo(t,"stateLength",v),Wo(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=nve(e.state),n===void 0?d.params=[]:d.params=[n,a],d}function h(){return cL(e,n,a)}function p(d,f){return lL(d)||lL(f)||f<=0?NaN:cL(e,d,f)}}mL.exports=sve});var pL=s(function(p4e,hL){"use strict";var uve=Hl(),ove=uve();hL.exports=ove});var Ta=s(function(y4e,qL){"use strict";var vve=require("@stdlib/utils/define-nonenumerable-read-only-property"),yL=pL(),gve=Hl();vve(yL,"factory",gve);qL.exports=yL});var Zl=s(function(q4e,bL){"use strict";var fve=F(),dve=require("@stdlib/array/dtypes"),lve=require("@stdlib/array/defaults"),cve=Ta(),mve=dve("real_floating_point_and_generic"),hve=fve(cve,mve,lve.get("dtypes.real_floating_point"));bL.exports=hve});var SL=s(function(b4e,wL){"use strict";var pve=Zl(),yve=pve();wL.exports=yve});var _L=s(function(w4e,EL){"use strict";var qve=require("@stdlib/utils/define-nonenumerable-read-only-property"),OL=SL(),bve=Zl();qve(OL,"factory",bve);EL.exports=OL});var RL=s(function(S4e,LL){"use strict";var wve=require("@stdlib/assert/is-number").isPrimitive,Sve=require("@stdlib/assert/is-positive-number").isPrimitive,NL=require("@stdlib/string/format"),Ove=require("@stdlib/assert/is-nan");function Eve(r,e){return!wve(r)||Ove(r)?new TypeError(NL("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):Sve(e)?null:new TypeError(NL("invalid argument. Second argument must be a positive number. Value: `%s`.",e))}LL.exports=Eve});var TL=s(function(O4e,PL){"use strict";var _ve=require("@stdlib/stats/base/dists/normal/quantile");function Nve(r,e,t){var i=_ve(1-r()/2,0,1);return e+t/(i*i)}PL.exports=Nve});var Ql=s(function(E4e,WL){"use strict";var et=require("@stdlib/utils/define-nonenumerable-read-only-property"),zo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),jL=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),ML=require("@stdlib/assert/is-plain-object"),xL=require("@stdlib/assert/is-function"),AL=require("@stdlib/assert/has-own-property"),GL=require("@stdlib/utils/constant-function"),Lve=require("@stdlib/utils/noop"),Jo=T().factory,VL=require("@stdlib/math/base/assert/is-nan"),Rve=require("@stdlib/array/to-json"),Uo=require("@stdlib/string/format"),Pve=RL(),FL=TL();function Tve(){var r,e,t,i,n,a;if(arguments.length===0)e=Jo();else if(arguments.length===1){if(r=arguments[0],!ML(r))throw new TypeError(Uo("invalid argument. Options argument must be an object. Value: `%s`.",r));if(AL(r,"prng")){if(!xL(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=Jo(r)}else{if(n=arguments[0],a=arguments[1],i=Pve(n,a),i)throw i;if(arguments.length>2){if(r=arguments[2],!ML(r))throw new TypeError(Uo("invalid argument. Options argument must be an object. Value: `%s`.",r));if(AL(r,"prng")){if(!xL(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=Jo(r)}else e=Jo()}return n===void 0?t=p:t=h,et(t,"NAME","levy"),r&&r.prng?(et(t,"seed",null),et(t,"seedLength",null),jL(t,"state",GL(null),Lve),et(t,"stateLength",null),et(t,"byteLength",null),et(t,"toJSON",GL(null)),et(t,"PRNG",e)):(zo(t,"seed",u),zo(t,"seedLength",o),jL(t,"state",c,l),zo(t,"stateLength",v),zo(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=Rve(e.state),n===void 0?d.params=[]:d.params=[n,a],d}function h(){return FL(e,n,a)}function p(d,f){return VL(d)||VL(f)||f<=0?NaN:FL(e,d,f)}}WL.exports=Tve});var kL=s(function(_4e,IL){"use strict";var jve=Ql(),Mve=jve();IL.exports=Mve});var ja=s(function(N4e,JL){"use strict";var xve=require("@stdlib/utils/define-nonenumerable-read-only-property"),zL=kL(),Ave=Ql();xve(zL,"factory",Ave);JL.exports=zL});var $l=s(function(L4e,UL){"use strict";var Gve=F(),Vve=require("@stdlib/array/dtypes"),Fve=require("@stdlib/array/defaults"),Wve=ja(),Ive=Vve("real_floating_point_and_generic"),kve=Gve(Wve,Ive,Fve.get("dtypes.real_floating_point"));UL.exports=kve});var BL=s(function(R4e,CL){"use strict";var zve=$l(),Jve=zve();CL.exports=Jve});var YL=s(function(P4e,XL){"use strict";var Uve=require("@stdlib/utils/define-nonenumerable-read-only-property"),DL=BL(),Cve=$l();Uve(DL,"factory",Cve);XL.exports=DL});var QL=s(function(T4e,ZL){"use strict";var Bve=require("@stdlib/assert/is-number").isPrimitive,Dve=require("@stdlib/assert/is-positive-number").isPrimitive,Xve=require("@stdlib/assert/is-nan"),HL=require("@stdlib/string/format");function Yve(r,e){return!Bve(r)||Xve(r)?new TypeError(HL("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):Dve(e)?null:new TypeError(HL("invalid argument. Second argument must be a positive number. Value: `%s`.",e))}ZL.exports=Yve});var KL=s(function(j4e,$L){"use strict";var Hve=require("@stdlib/math/base/special/ln");function Zve(r,e,t){var i=r();return e+t*Hve(i/(1-i))}$L.exports=Zve});var Kl=s(function(M4e,uR){"use strict";var rt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Co=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),eR=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),rR=require("@stdlib/assert/is-plain-object"),tR=require("@stdlib/assert/is-function"),iR=require("@stdlib/assert/has-own-property"),nR=require("@stdlib/utils/constant-function"),Qve=require("@stdlib/utils/noop"),Bo=T().factory,aR=require("@stdlib/math/base/assert/is-nan"),$ve=require("@stdlib/array/to-json"),Do=require("@stdlib/string/format"),Kve=QL(),sR=KL();function ege(){var r,e,t,i,n,a;if(arguments.length===0)e=Bo();else if(arguments.length===1){if(r=arguments[0],!rR(r))throw new TypeError(Do("invalid argument. Options argument must be an object. Value: `%s`.",r));if(iR(r,"prng")){if(!tR(r.prng))throw new TypeError(Do("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Bo(r)}else{if(n=arguments[0],a=arguments[1],i=Kve(n,a),i)throw i;if(arguments.length>2){if(r=arguments[2],!rR(r))throw new TypeError(Do("invalid argument. Options argument must be an object. Value: `%s`.",r));if(iR(r,"prng")){if(!tR(r.prng))throw new TypeError(Do("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Bo(r)}else e=Bo()}return n===void 0?t=p:t=h,rt(t,"NAME","logistic"),r&&r.prng?(rt(t,"seed",null),rt(t,"seedLength",null),eR(t,"state",nR(null),Qve),rt(t,"stateLength",null),rt(t,"byteLength",null),rt(t,"toJSON",nR(null)),rt(t,"PRNG",e)):(Co(t,"seed",u),Co(t,"seedLength",o),eR(t,"state",c,l),Co(t,"stateLength",v),Co(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=$ve(e.state),n===void 0?d.params=[]:d.params=[n,a],d}function h(){return sR(e,n,a)}function p(d,f){return aR(d)||aR(f)||f<=0?NaN:sR(e,d,f)}}uR.exports=ege});var vR=s(function(x4e,oR){"use strict";var rge=Kl(),tge=rge();oR.exports=tge});var Ma=s(function(A4e,fR){"use strict";var ige=require("@stdlib/utils/define-nonenumerable-read-only-property"),gR=vR(),nge=Kl();ige(gR,"factory",nge);fR.exports=gR});var ec=s(function(G4e,dR){"use strict";var age=F(),sge=require("@stdlib/array/dtypes"),uge=require("@stdlib/array/defaults"),oge=Ma(),vge=sge("real_floating_point_and_generic"),gge=age(oge,vge,uge.get("dtypes.real_floating_point"));dR.exports=gge});var cR=s(function(V4e,lR){"use strict";var fge=ec(),dge=fge();lR.exports=dge});var pR=s(function(F4e,hR){"use strict";var lge=require("@stdlib/utils/define-nonenumerable-read-only-property"),mR=cR(),cge=ec();lge(mR,"factory",cge);hR.exports=mR});var bR=s(function(W4e,qR){"use strict";var mge=require("@stdlib/assert/is-number").isPrimitive,hge=require("@stdlib/assert/is-positive-number").isPrimitive,yR=require("@stdlib/string/format"),pge=require("@stdlib/assert/is-nan");function yge(r,e){return!mge(r)||pge(r)?new TypeError(yR("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):hge(e)?null:new TypeError(yR("invalid argument. Second argument must be a positive number. Value: `%s`.",e))}qR.exports=yge});var SR=s(function(I4e,wR){"use strict";var qge=require("@stdlib/math/base/special/exp");function bge(r,e,t){return qge(e+t*r())}wR.exports=bge});var rc=s(function(k4e,TR){"use strict";var Ot=require("@stdlib/utils/define-nonenumerable-read-only-property"),Xo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),OR=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),ER=require("@stdlib/assert/is-plain-object"),_R=require("@stdlib/assert/is-function"),NR=require("@stdlib/assert/has-own-property"),LR=require("@stdlib/utils/constant-function"),wge=require("@stdlib/utils/noop"),xa=Q().factory,RR=require("@stdlib/math/base/assert/is-nan"),Sge=require("@stdlib/array/to-json"),Yo=require("@stdlib/string/format"),Oge=bR(),PR=SR();function Ege(){var r,e,t,i,n,a,u;if(arguments.length===0)e=xa();else if(arguments.length===1){if(t=arguments[0],!ER(t))throw new TypeError(Yo("invalid argument. Options argument must be an object. Value: `%s`.",t));if(NR(t,"prng")){if(!_R(t.prng))throw new TypeError(Yo("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=Oge(u,r),a)throw a;if(arguments.length>2){if(t=arguments[2],!ER(t))throw new TypeError(Yo("invalid argument. Options argument must be an object. Value: `%s`.",t));if(NR(t,"prng")){if(!_R(t.prng))throw new TypeError(Yo("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),OR(n,"state",LR(null),wge),Ot(n,"stateLength",null),Ot(n,"byteLength",null),Ot(n,"toJSON",LR(null))):(Xo(n,"seed",o),Xo(n,"seedLength",v),OR(n,"state",l,m),Xo(n,"stateLength",g),Xo(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=Sge(i.state),u===void 0?f.params=[]:f.params=[u,r],f}function p(){return PR(e,u,r)}function d(f,y){return RR(f)||RR(y)||y<=0?NaN:PR(e,f,y)}}TR.exports=Ege});var MR=s(function(z4e,jR){"use strict";var _ge=rc(),Nge=_ge();jR.exports=Nge});var dn=s(function(J4e,AR){"use strict";var Lge=require("@stdlib/utils/define-nonenumerable-read-only-property"),xR=MR(),Rge=rc();Lge(xR,"factory",Rge);AR.exports=xR});var tc=s(function(U4e,GR){"use strict";var Pge=F(),Tge=require("@stdlib/array/dtypes"),jge=require("@stdlib/array/defaults"),Mge=dn(),xge=Tge("real_floating_point_and_generic"),Age=Pge(Mge,xge,jge.get("dtypes.real_floating_point"));GR.exports=Age});var FR=s(function(C4e,VR){"use strict";var Gge=tc(),Vge=Gge();VR.exports=Vge});var kR=s(function(B4e,IR){"use strict";var Fge=require("@stdlib/utils/define-nonenumerable-read-only-property"),WR=FR(),Wge=tc();Fge(WR,"factory",Wge);IR.exports=WR});var ic=s(function(D4e,zR){"use strict";var Ige=require("@stdlib/constants/int32/max"),kge=require("@stdlib/math/base/special/floor"),zge=Ige-1;function Jge(){var r=kge(1+zge*Math.random());return r|0}zR.exports=Jge});var sc=s(function(X4e,DR){"use strict";var tt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Et=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),JR=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),nc=require("@stdlib/assert/has-own-property"),Uge=require("@stdlib/assert/is-plain-object"),Cge=require("@stdlib/assert/is-boolean").isPrimitive,Bge=require("@stdlib/assert/is-collection"),Dge=require("@stdlib/assert/is-positive-integer").isPrimitive,UR=require("@stdlib/assert/is-int32array"),Be=require("@stdlib/string/format"),Ho=require("@stdlib/constants/int32/max"),D=require("@stdlib/array/int32"),Aa=require("@stdlib/blas/base/gcopy"),Xge=require("@stdlib/array/to-json"),CR=ic(),ac=Ho-1|0,Yge=Ho-1|0,Hge=16807,Zo=1,Qo=2,_t=2,X=4,$s=5;function BR(r,e){var t;return e?t="option":t="argument",r.length<$s+1?new RangeError(Be("invalid %s. State array has insufficient length.",t)):r[0]!==Zo?new RangeError(Be("invalid %s. State array has an incompatible schema version. Expected: `%s`. Actual: `%s`.",t,Zo,r[0])):r[1]!==Qo?new RangeError(Be("invalid %s. State array has an incompatible number of sections. Expected: `%s`. Actual: `%s`.",t,Qo,r[1])):r[_t]!==1?new RangeError(Be("invalid %s. State array has an incompatible state length. Expected: `%u`. Actual: `%u`.",t,1,r[_t])):r[X]!==r.length-$s?new RangeError(Be("invalid %s. State array length is incompatible with seed section length. Expected: `%u`. Actual: `%u`.",t,r.length-$s,r[X])):null}function Zge(r){var e,t,i,n,a,u;if(i={},arguments.length){if(!Uge(r))throw new TypeError(Be("invalid argument. Options argument must be an object. Value: `%s`.",r));if(nc(r,"copy")&&(i.copy=r.copy,!Cge(r.copy)))throw new TypeError(Be("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",r.copy));if(nc(r,"state")){if(t=r.state,i.state=!0,!UR(t))throw new TypeError(Be("invalid option. `%s` option must be an Int32Array. Option: `%s`.","state",t));if(u=BR(t,!0),u)throw u;i.copy===!1?e=t:(e=new D(t.length),Aa(t.length,t,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,t[X])}if(n===void 0)if(nc(r,"seed"))if(n=r.seed,i.seed=!0,Dge(n)){if(n>Yge)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(Bge(n)&&n.length>0)a=n.length,e=new D($s+a),e[0]=Zo,e[1]=Qo,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=CR()|0}else n=CR()|0;return t===void 0&&(e=new D($s+1),e[0]=Zo,e[1]=Qo,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),JR(p,"state",l,m),Et(p,"stateLength",g),Et(p,"byteLength",c),tt(p,"toJSON",h),tt(p,"MIN",1),tt(p,"MAX",Ho-1),tt(p,"normalized",d),tt(d,"NAME",p.NAME),Et(d,"seed",o),Et(d,"seedLength",v),JR(d,"state",l,m),Et(d,"stateLength",g),Et(d,"byteLength",c),tt(d,"toJSON",h),tt(d,"MIN",(p.MIN-1)/ac),tt(d,"MAX",(p.MAX-1)/ac),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(!UR(f))throw new TypeError(Be("invalid argument. Must provide an Int32Array. Value: `%s`.",f));if(y=BR(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=Xge(e),f.params=[],f}function p(){var f=t[0]|0;return f=Hge*f%Ho|0,t[0]=f,f|0}function d(){return(p()-1)/ac}}DR.exports=Zge});var YR=s(function(Y4e,XR){"use strict";var Qge=sc(),$ge=ic(),Kge=Qge({seed:$ge()});XR.exports=Kge});var $=s(function(H4e,ZR){"use strict";var efe=require("@stdlib/utils/define-nonenumerable-read-only-property"),HR=YR(),rfe=sc();efe(HR,"factory",rfe);ZR.exports=HR});var QR=s(function(Z4e,tfe){tfe.exports={idtype:"float64",ndtype:"float64"}});var KR=s(function(Q4e,$R){"use strict";var ife=require("@stdlib/array/typed-real-float-dtypes"),nfe=require("@stdlib/array/typed-real-dtypes"),afe=require("@stdlib/assert/is-plain-object"),$o=require("@stdlib/assert/has-own-property"),Ks=require("@stdlib/string/format"),eu=nfe(),ru=ife();eu.push("generic");ru.push("generic");function sfe(r,e,t){if(!afe(e))return new TypeError(Ks("invalid argument. Options argument must be an object. Value: `%s`.",e));if(t===0){if($o(e,"idtype")&&(r.idtype=e.idtype,eu.indexOf(r.idtype)<0))return new TypeError(Ks('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"idtype",eu.join('", "'),r.idtype));if($o(e,"ndtype")&&(r.ndtype=e.ndtype,ru.indexOf(r.ndtype)<0))return new TypeError(Ks('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"ndtype",ru.join('", "'),r.ndtype))}else if(t===1&&$o(e,"dtype")){if(r.dtype=e.dtype,eu.indexOf(r.dtype)<0)return new TypeError(Ks('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",eu.join('", "'),r.dtype))}else if($o(e,"dtype")&&(r.dtype=e.dtype,ru.indexOf(r.dtype)<0))return new TypeError(Ks('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",ru.join('", "'),r.dtype));return null}$R.exports=sfe});var oc=s(function($4e,oP){"use strict";var eP=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,rP=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ko=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),ufe=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),tP=$(),iP=require("@stdlib/array/typed-real-ctors"),nP=require("@stdlib/array/base/filled-by"),aP=require("@stdlib/strided/base/nullary"),sP=require("@stdlib/string/format"),uP=QR(),uc=KR();function ofe(){var r,e,t,i,n,a;if(t={idtype:uP.idtype,ndtype:uP.ndtype},e=arguments.length,i=u,e===0)n=tP;else if(e===1&&(r=arguments[0],n=tP.factory(r),a=uc(t,r,0),a))throw a;return Ko(i,"seed",v),Ko(i,"seedLength",g),ufe(i,"state",m,h),Ko(i,"stateLength",c),Ko(i,"byteLength",l),rP(i,"PRNG",n),rP(i,"normalized",o),i;function u(p,d){var f,y,q,b,w;if(!eP(p))throw new TypeError(sP("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",p));if(w={},arguments.length>1&&(q=uc(w,d,1),q))throw q;return b=w.dtype||t.idtype,b==="generic"?nP(p,n):(f=iP(b),y=new f(p),aP([y],[p],[1],n),y)}function o(p,d){var f,y,q,b,w;if(!eP(p))throw new TypeError(sP("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",p));if(w={},arguments.length>1&&(q=uc(w,d,2),q))throw q;return b=w.dtype||t.ndtype,b==="generic"?nP(p,n.normalized):(f=iP(b),y=new f(p),aP([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}}oP.exports=ofe});var gP=s(function(K4e,vP){"use strict";var vfe=oc(),gfe=vfe();vP.exports=gfe});var lP=s(function(eHe,dP){"use strict";var ffe=require("@stdlib/utils/define-nonenumerable-read-only-property"),fP=gP(),dfe=oc();ffe(fP,"factory",dfe);dP.exports=fP});var mP=s(function(rHe,cP){"use strict";var lfe=require("@stdlib/math/base/assert/is-nan"),cfe=8;function mfe(r,e,t){var i,n;for(n=0;n=0;n--)e[n]=r();return e}cP.exports=mfe});var vc=s(function(tHe,hP){"use strict";var hfe=require("@stdlib/constants/int32/max"),pfe=require("@stdlib/math/base/special/floor"),yfe=hfe-1;function qfe(){var r=pfe(1+yfe*Math.random());return r|0}hP.exports=qfe});var dc=s(function(iHe,SP){"use strict";var it=require("@stdlib/utils/define-nonenumerable-read-only-property"),Nt=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),pP=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),gc=require("@stdlib/assert/has-own-property"),bfe=require("@stdlib/assert/is-plain-object"),wfe=require("@stdlib/assert/is-boolean").isPrimitive,Sfe=require("@stdlib/assert/is-collection"),Ofe=require("@stdlib/assert/is-positive-integer").isPrimitive,yP=require("@stdlib/assert/is-int32array"),Ga=require("@stdlib/blas/base/gcopy"),Efe=require("@stdlib/math/base/special/floor"),Y=require("@stdlib/array/int32"),tu=require("@stdlib/constants/int32/max"),_fe=require("@stdlib/array/to-json"),K=require("@stdlib/string/format"),qP=mP(),bP=vc(),fc=tu-1|0,Nfe=tu-1|0,Lfe=16807,Z=32,tv=1,iv=3,Lt=2,Va=Z+3,H=Z+6,iu=Z+7,ev=Va+1,rv=Va+2;function wP(r,e){var t;return e?t="option":t="argument",r.lengthNfe)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(Sfe(n)&&n.length>0)a=n.length,e=new Y(iu+a),e[0]=tv,e[1]=iv,e[Lt]=Z,e[Va]=2,e[rv]=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=qP(p,t,Z),e[ev]=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=bP()|0}else n=bP()|0;return t===void 0&&(e=new Y(iu+1),e[0]=tv,e[1]=iv,e[Lt]=Z,e[Va]=2,e[rv]=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=qP(p,t,Z),e[ev]=t[0]),it(d,"NAME","minstd-shuffle"),Nt(d,"seed",o),Nt(d,"seedLength",v),pP(d,"state",l,m),Nt(d,"stateLength",g),Nt(d,"byteLength",c),it(d,"toJSON",h),it(d,"MIN",1),it(d,"MAX",tu-1),it(d,"normalized",f),it(f,"NAME",d.NAME),Nt(f,"seed",o),Nt(f,"seedLength",v),pP(f,"state",l,m),Nt(f,"stateLength",g),Nt(f,"byteLength",c),it(f,"toJSON",h),it(f,"MIN",(d.MIN-1)/fc),it(f,"MAX",(d.MAX-1)/fc),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(!yP(y))throw new TypeError(K("invalid argument. Must provide an Int32Array. Value: `%s`.",y));if(q=wP(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=_fe(e),y.params=[],y}function p(){var y=e[rv]|0;return y=Lfe*y%tu|0,e[rv]=y,y|0}function d(){var y,q;return y=e[ev],q=Efe(Z*(y/tu)),y=t[q],e[ev]=y,t[q]=p(),y}function f(){return(d()-1)/fc}}SP.exports=Rfe});var EP=s(function(nHe,OP){"use strict";var Pfe=dc(),Tfe=vc(),jfe=Pfe({seed:Tfe()});OP.exports=jfe});var ee=s(function(aHe,NP){"use strict";var Mfe=require("@stdlib/utils/define-nonenumerable-read-only-property"),_P=EP(),xfe=dc();Mfe(_P,"factory",xfe);NP.exports=_P});var LP=s(function(sHe,Afe){Afe.exports={idtype:"float64",ndtype:"float64"}});var PP=s(function(uHe,RP){"use strict";var Gfe=require("@stdlib/array/typed-real-float-dtypes"),Vfe=require("@stdlib/array/typed-real-dtypes"),Ffe=require("@stdlib/assert/is-plain-object"),nv=require("@stdlib/assert/has-own-property"),nu=require("@stdlib/string/format"),au=Vfe(),su=Gfe();au.push("generic");su.push("generic");function Wfe(r,e,t){if(!Ffe(e))return new TypeError(nu("invalid argument. Options argument must be an object. Value: `%s`.",e));if(t===0){if(nv(e,"idtype")&&(r.idtype=e.idtype,au.indexOf(r.idtype)<0))return new TypeError(nu('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"idtype",au.join('", "'),r.idtype));if(nv(e,"ndtype")&&(r.ndtype=e.ndtype,su.indexOf(r.ndtype)<0))return new TypeError(nu('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"ndtype",su.join('", "'),r.ndtype))}else if(t===1&&nv(e,"dtype")){if(r.dtype=e.dtype,au.indexOf(r.dtype)<0)return new TypeError(nu('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",au.join('", "'),r.dtype))}else if(nv(e,"dtype")&&(r.dtype=e.dtype,su.indexOf(r.dtype)<0))return new TypeError(nu('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",su.join('", "'),r.dtype));return null}RP.exports=Wfe});var cc=s(function(oHe,WP){"use strict";var TP=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,jP=require("@stdlib/utils/define-nonenumerable-read-only-property"),av=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Ife=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),MP=ee(),xP=require("@stdlib/array/typed-real-ctors"),AP=require("@stdlib/array/base/filled-by"),GP=require("@stdlib/strided/base/nullary"),VP=require("@stdlib/string/format"),FP=LP(),lc=PP();function kfe(){var r,e,t,i,n,a;if(t={idtype:FP.idtype,ndtype:FP.ndtype},e=arguments.length,i=u,e===0)n=MP;else if(e===1&&(r=arguments[0],n=MP.factory(r),a=lc(t,r,0),a))throw a;return av(i,"seed",v),av(i,"seedLength",g),Ife(i,"state",m,h),av(i,"stateLength",c),av(i,"byteLength",l),jP(i,"PRNG",n),jP(i,"normalized",o),i;function u(p,d){var f,y,q,b,w;if(!TP(p))throw new TypeError(VP("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",p));if(w={},arguments.length>1&&(q=lc(w,d,1),q))throw q;return b=w.dtype||t.idtype,b==="generic"?AP(p,n):(f=xP(b),y=new f(p),GP([y],[p],[1],n),y)}function o(p,d){var f,y,q,b,w;if(!TP(p))throw new TypeError(VP("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",p));if(w={},arguments.length>1&&(q=lc(w,d,2),q))throw q;return b=w.dtype||t.ndtype,b==="generic"?AP(p,n.normalized):(f=xP(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}}WP.exports=kfe});var kP=s(function(vHe,IP){"use strict";var zfe=cc(),Jfe=zfe();IP.exports=Jfe});var UP=s(function(gHe,JP){"use strict";var Ufe=require("@stdlib/utils/define-nonenumerable-read-only-property"),zP=kP(),Cfe=cc();Ufe(zP,"factory",Cfe);JP.exports=zP});var CP=s(function(fHe,Bfe){Bfe.exports={idtype:"float64",ndtype:"float64"}});var DP=s(function(dHe,BP){"use strict";var Dfe=require("@stdlib/array/typed-real-float-dtypes"),Xfe=require("@stdlib/array/typed-real-dtypes"),Yfe=require("@stdlib/assert/is-plain-object"),sv=require("@stdlib/assert/has-own-property"),uu=require("@stdlib/string/format"),ou=Xfe(),vu=Dfe();ou.push("generic");vu.push("generic");function Hfe(r,e,t){if(!Yfe(e))return new TypeError(uu("invalid argument. Options argument must be an object. Value: `%s`.",e));if(t===0){if(sv(e,"idtype")&&(r.idtype=e.idtype,ou.indexOf(r.idtype)<0))return new TypeError(uu('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"idtype",ou.join('", "'),r.idtype));if(sv(e,"ndtype")&&(r.ndtype=e.ndtype,vu.indexOf(r.ndtype)<0))return new TypeError(uu('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"ndtype",vu.join('", "'),r.ndtype))}else if(t===1&&sv(e,"dtype")){if(r.dtype=e.dtype,ou.indexOf(r.dtype)<0)return new TypeError(uu('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",ou.join('", "'),r.dtype))}else if(sv(e,"dtype")&&(r.dtype=e.dtype,vu.indexOf(r.dtype)<0))return new TypeError(uu('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",vu.join('", "'),r.dtype));return null}BP.exports=Hfe});var hc=s(function(lHe,rT){"use strict";var XP=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,YP=require("@stdlib/utils/define-nonenumerable-read-only-property"),uv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Zfe=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),HP=T(),ZP=require("@stdlib/array/typed-real-ctors"),QP=require("@stdlib/array/base/filled-by"),$P=require("@stdlib/strided/base/nullary"),KP=require("@stdlib/string/format"),eT=CP(),mc=DP();function Qfe(){var r,e,t,i,n,a;if(t={idtype:eT.idtype,ndtype:eT.ndtype},e=arguments.length,i=u,e===0)n=HP;else if(e===1&&(r=arguments[0],n=HP.factory(r),a=mc(t,r,0),a))throw a;return uv(i,"seed",v),uv(i,"seedLength",g),Zfe(i,"state",m,h),uv(i,"stateLength",c),uv(i,"byteLength",l),YP(i,"PRNG",n),YP(i,"normalized",o),i;function u(p,d){var f,y,q,b,w;if(!XP(p))throw new TypeError(KP("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",p));if(w={},arguments.length>1&&(q=mc(w,d,1),q))throw q;return b=w.dtype||t.idtype,b==="generic"?QP(p,n):(f=ZP(b),y=new f(p),$P([y],[p],[1],n),y)}function o(p,d){var f,y,q,b,w;if(!XP(p))throw new TypeError(KP("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",p));if(w={},arguments.length>1&&(q=mc(w,d,2),q))throw q;return b=w.dtype||t.ndtype,b==="generic"?QP(p,n.normalized):(f=ZP(b),y=new f(p),$P([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}}rT.exports=Qfe});var iT=s(function(cHe,tT){"use strict";var $fe=hc(),Kfe=$fe();tT.exports=Kfe});var sT=s(function(mHe,aT){"use strict";var ede=require("@stdlib/utils/define-nonenumerable-read-only-property"),nT=iT(),rde=hc();ede(nT,"factory",rde);aT.exports=nT});var oT=s(function(hHe,uT){"use strict";var tde=require("@stdlib/math/base/special/exp");function ide(r,e){for(var t=r(),i=1;t>tde(-e);)i+=1,t*=r();return i-1}uT.exports=ide});var dT=s(function(pHe,fT){"use strict";var nde=require("@stdlib/math/base/special/factorialln"),vT=require("@stdlib/math/base/special/floor"),ade=require("@stdlib/math/base/special/signum"),sde=require("@stdlib/math/base/special/sqrt"),gT=require("@stdlib/math/base/special/abs"),ov=require("@stdlib/math/base/special/ln"),ude=require("@stdlib/constants/float64/ln-sqrt-two-pi"),ode=1/12,vde=1/360;function gde(r,e){var t,i,n,a,u,o,v,g,c,l;for(t=sde(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-gT(c))+v,c+=e+.445,vT(c);if(l>=u?c=r()-.5:(c=l/u-.93,c=ade(c)*.5-c,l=u*r()),a=.5-gT(c),(a>=.013||a>=l)&&(g=vT((2*o/a+v)*c+e+.445),l*=i/(o/(a*a)+v),c=(g+.5)*ov(e/g),c+=-e-ude+g,c-=(ode-vde/(g*g))/g,g>=10&&c>=ov(l*t)||(c=g*ov(e)-e-nde(g),g>=0&&g<=9&&c>=ov(l))))return g}}fT.exports=gde});var cT=s(function(yHe,lT){"use strict";var fde=oT(),dde=dT();function lde(r,e){return e<30?fde(r,e):dde(r,e)}lT.exports=lde});var pc=s(function(qHe,wT){"use strict";var nt=require("@stdlib/utils/define-nonenumerable-read-only-property"),vv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),mT=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),cde=require("@stdlib/assert/is-positive-number").isPrimitive,hT=require("@stdlib/assert/is-plain-object"),pT=require("@stdlib/assert/is-function"),yT=require("@stdlib/assert/has-own-property"),qT=require("@stdlib/utils/constant-function"),mde=require("@stdlib/utils/noop"),gv=T().factory,hde=require("@stdlib/math/base/assert/is-nan"),pde=require("@stdlib/array/to-json"),fv=require("@stdlib/string/format"),bT=cT();function yde(){var r,e,t,i;if(arguments.length===0)t=gv();else if(arguments.length===1&&hT(arguments[0]))if(e=arguments[0],yT(e,"prng")){if(!pT(e.prng))throw new TypeError(fv("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));t=e.prng}else t=gv(e);else{if(r=arguments[0],!cde(r))throw new TypeError(fv("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(arguments.length>1){if(e=arguments[1],!hT(e))throw new TypeError(fv("invalid argument. Options argument must be an object. Value: `%s`.",e));if(yT(e,"prng")){if(!pT(e.prng))throw new TypeError(fv("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));t=e.prng}else t=gv(e)}else t=gv()}return r===void 0?i=m:i=l,nt(i,"NAME","poisson"),e&&e.prng?(nt(i,"seed",null),nt(i,"seedLength",null),mT(i,"state",qT(null),mde),nt(i,"stateLength",null),nt(i,"byteLength",null),nt(i,"toJSON",qT(null)),nt(i,"PRNG",t)):(vv(i,"seed",n),vv(i,"seedLength",a),mT(i,"state",v,g),vv(i,"stateLength",u),vv(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=pde(t.state),r===void 0?h.params=[]:h.params=[r],h}function l(){return bT(t,r)}function m(h){return hde(h)||h<=0?NaN:bT(t,h)}}wT.exports=yde});var OT=s(function(bHe,ST){"use strict";var qde=pc(),bde=qde();ST.exports=bde});var ln=s(function(wHe,_T){"use strict";var wde=require("@stdlib/utils/define-nonenumerable-read-only-property"),ET=OT(),Sde=pc();wde(ET,"factory",Sde);_T.exports=ET});var LT=s(function(SHe,NT){"use strict";var Ode=require("@stdlib/assert/is-positive-number").isPrimitive,Ede=require("@stdlib/assert/is-number").isPrimitive,yc=require("@stdlib/string/format"),_de=require("@stdlib/assert/is-nan");function Nde(r,e){return Ode(r)?!Ede(e)||_de(e)?new TypeError(yc("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e)):e<=0||e>=1?new RangeError(yc("invalid argument. Second argument must be on the interval: (0, 1). Value: `%f`.",e)):null:new TypeError(yc("invalid argument. First argument must be a positive number. Value: `%s`.",r))}NT.exports=Nde});var Sc=s(function(OHe,GT){"use strict";var Rt=require("@stdlib/utils/define-nonenumerable-read-only-property"),dv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),RT=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Fa=require("@stdlib/assert/has-own-property"),PT=require("@stdlib/assert/is-plain-object"),qc=require("@stdlib/assert/is-uint32array"),TT=require("@stdlib/assert/is-boolean").isPrimitive,jT=require("@stdlib/assert/is-function"),MT=require("@stdlib/utils/constant-function"),Lde=require("@stdlib/utils/noop"),xT=require("@stdlib/math/base/assert/is-nan"),Wa=ln().factory,lv=Ce().factory,bc=require("@stdlib/blas/base/gcopy"),wc=require("@stdlib/array/uint32"),AT=require("@stdlib/object/assign"),Rde=require("@stdlib/array/to-json"),at=require("@stdlib/string/format"),Pde=LT();function Tde(){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],!PT(i))throw new TypeError(at("invalid argument. Options argument must be an object. Value: `%s`.",i));if(Fa(i,"copy")&&!TT(i.copy))throw new TypeError(at("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",i.copy));if(Fa(i,"prng")){if(!jT(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")&&!qc(i.state))throw new TypeError(at("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",i.state));i=AT({},i),i.copy===!1?u=!1:i.state&&(i.state=bc(i.state.length,i.state,1,new wc(i.state.length),1)),i.copy=!1,t=Wa(i)}}else{if(g=arguments[0],v=arguments[1],o=Pde(g,v),o)throw o;if(arguments.length>2){if(i=arguments[2],!PT(i))throw new TypeError(at("invalid argument. Options argument must be an object. Value: `%s`.",i));if(Fa(i,"copy")&&!TT(i.copy))throw new TypeError(at("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",i.copy));if(Fa(i,"prng")){if(!jT(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")&&!qc(i.state))throw new TypeError(at("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",i.state));i=AT({},i),i.copy===!1?u=!1:i.state&&(i.state=bc(i.state.length,i.state,1,new wc(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=lv({prng:i.prng}):r=lv(g,v/(1-v),{prng:i.prng}):(i.state?e=i.state:(e=t.state,t.state=e),g===void 0?r=lv({state:e,copy:!1}):r=lv(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),RT(n,"state",MT(null),Lde),Rt(n,"stateLength",null),Rt(n,"byteLength",null),Rt(n,"toJSON",MT(null))):(dv(n,"seed",c),dv(n,"seedLength",l),RT(n,"state",p,d),dv(n,"stateLength",m),dv(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(!qc(b))throw new TypeError(at("invalid argument. Must provide a Uint32Array. Value: `%s`.",b));u&&(b=bc(b.length,b,1,new wc(b.length),1)),a.state=b}function f(){var b={};return b.type="PRNG",b.name=n.NAME,b.state=Rde(a.state),g===void 0?b.params=[]:b.params=[g,v],b}function y(){return t(r())}function q(b,w){return xT(b)||xT(w)||w<=0||w>=1?NaN:t(r(b,w/(1-w)))}}GT.exports=Tde});var FT=s(function(EHe,VT){"use strict";var jde=Sc(),Mde=jde();VT.exports=Mde});var Ia=s(function(_He,IT){"use strict";var xde=require("@stdlib/utils/define-nonenumerable-read-only-property"),WT=FT(),Ade=Sc();xde(WT,"factory",Ade);IT.exports=WT});var Oc=s(function(NHe,kT){"use strict";var Gde=F(),Vde=require("@stdlib/array/dtypes"),Fde=require("@stdlib/array/defaults"),Wde=Ia(),Ide=Vde("real_and_generic"),kde=Gde(Wde,Ide,Fde.get("dtypes.real"));kT.exports=kde});var JT=s(function(LHe,zT){"use strict";var zde=Oc(),Jde=zde();zT.exports=Jde});var BT=s(function(RHe,CT){"use strict";var Ude=require("@stdlib/utils/define-nonenumerable-read-only-property"),UT=JT(),Cde=Oc();Ude(UT,"factory",Cde);CT.exports=UT});var YT=s(function(PHe,XT){"use strict";var Bde=require("@stdlib/assert/is-number").isPrimitive,Dde=require("@stdlib/assert/is-positive-number").isPrimitive,DT=require("@stdlib/string/format"),Xde=require("@stdlib/assert/is-nan");function Yde(r,e){return!Bde(r)||Xde(r)?new TypeError(DT("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):Dde(e)?null:new TypeError(DT("invalid argument. Second argument must be a positive number. Value: `%s`.",e))}XT.exports=Yde});var ZT=s(function(THe,HT){"use strict";function Hde(r,e,t){return e+t*r()}HT.exports=Hde});var Ec=s(function(jHe,nj){"use strict";var Pt=require("@stdlib/utils/define-nonenumerable-read-only-property"),cv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),QT=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),$T=require("@stdlib/assert/is-plain-object"),KT=require("@stdlib/assert/is-function"),ej=require("@stdlib/assert/has-own-property"),rj=require("@stdlib/utils/constant-function"),Zde=require("@stdlib/utils/noop"),ka=Q().factory,tj=require("@stdlib/math/base/assert/is-nan"),Qde=require("@stdlib/array/to-json"),mv=require("@stdlib/string/format"),$de=YT(),ij=ZT();function Kde(){var r,e,t,i,n,a,u;if(arguments.length===0)e=ka();else if(arguments.length===1){if(t=arguments[0],!$T(t))throw new TypeError(mv("invalid argument. Options argument must be an object. Value: `%s`.",t));if(ej(t,"prng")){if(!KT(t.prng))throw new TypeError(mv("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=$de(u,r),a)throw a;if(arguments.length>2){if(t=arguments[2],!$T(t))throw new TypeError(mv("invalid argument. Options argument must be an object. Value: `%s`.",t));if(ej(t,"prng")){if(!KT(t.prng))throw new TypeError(mv("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),QT(n,"state",rj(null),Zde),Pt(n,"stateLength",null),Pt(n,"byteLength",null),Pt(n,"toJSON",rj(null))):(cv(n,"seed",o),cv(n,"seedLength",v),QT(n,"state",l,m),cv(n,"stateLength",g),cv(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=Qde(i.state),u===void 0?f.params=[]:f.params=[u,r],f}function p(){return ij(e,u,r)}function d(f,y){return tj(f)||tj(y)||y<=0?NaN:ij(e,f,y)}}nj.exports=Kde});var sj=s(function(MHe,aj){"use strict";var ele=Ec(),rle=ele();aj.exports=rle});var cn=s(function(xHe,oj){"use strict";var tle=require("@stdlib/utils/define-nonenumerable-read-only-property"),uj=sj(),ile=Ec();tle(uj,"factory",ile);oj.exports=uj});var _c=s(function(AHe,vj){"use strict";var nle=F(),ale=require("@stdlib/array/dtypes"),sle=require("@stdlib/array/defaults"),ule=cn(),ole=ale("real_floating_point_and_generic"),vle=nle(ule,ole,sle.get("dtypes.real_floating_point"));vj.exports=vle});var fj=s(function(GHe,gj){"use strict";var gle=_c(),fle=gle();gj.exports=fle});var cj=s(function(VHe,lj){"use strict";var dle=require("@stdlib/utils/define-nonenumerable-read-only-property"),dj=fj(),lle=_c();dle(dj,"factory",lle);lj.exports=dj});var yj=s(function(FHe,pj){"use strict";var mj=require("@stdlib/assert/is-positive-number").isPrimitive,hj=require("@stdlib/string/format");function cle(r,e){return mj(r)?mj(e)?null:new TypeError(hj("invalid argument. Second argument must be a positive number. Value: `%s`.",e)):new TypeError(hj("invalid argument. First argument must be a positive number. Value: `%s`.",r))}pj.exports=cle});var bj=s(function(WHe,qj){"use strict";var mle=require("@stdlib/math/base/special/pow");function hle(r,e,t){return t/mle(r(),1/e)}qj.exports=hle});var Nc=s(function(IHe,Rj){"use strict";var st=require("@stdlib/utils/define-nonenumerable-read-only-property"),hv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),wj=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Sj=require("@stdlib/assert/is-plain-object"),Oj=require("@stdlib/assert/is-function"),Ej=require("@stdlib/assert/has-own-property"),_j=require("@stdlib/utils/constant-function"),ple=require("@stdlib/utils/noop"),pv=T().factory,Nj=require("@stdlib/math/base/assert/is-nan"),yle=require("@stdlib/array/to-json"),yv=require("@stdlib/string/format"),qle=yj(),Lj=bj();function ble(){var r,e,t,i,n,a;if(arguments.length===0)i=pv();else if(arguments.length===1){if(t=arguments[0],!Sj(t))throw new TypeError(yv("invalid argument. Options argument must be an object. Value: `%s`.",t));if(Ej(t,"prng")){if(!Oj(t.prng))throw new TypeError(yv("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",t.prng));i=t.prng}else i=pv(t)}else{if(r=arguments[0],e=arguments[1],a=qle(r,e),a)throw a;if(arguments.length>2){if(t=arguments[2],!Sj(t))throw new TypeError(yv("invalid argument. Options argument must be an object. Value: `%s`.",t));if(Ej(t,"prng")){if(!Oj(t.prng))throw new TypeError(yv("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",t.prng));i=t.prng}else i=pv(t)}else i=pv()}return r===void 0?n=p:n=h,st(n,"NAME","pareto-type1"),t&&t.prng?(st(n,"seed",null),st(n,"seedLength",null),wj(n,"state",_j(null),ple),st(n,"stateLength",null),st(n,"byteLength",null),st(n,"toJSON",_j(null)),st(n,"PRNG",i)):(hv(n,"seed",u),hv(n,"seedLength",o),wj(n,"state",c,l),hv(n,"stateLength",v),hv(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=yle(i.state),r===void 0?d.params=[]:d.params=[r,e],d}function h(){return Lj(i,r,e)}function p(d,f){return Nj(d)||Nj(f)||d<=0||f<=0?NaN:Lj(i,d,f)}}Rj.exports=ble});var Tj=s(function(kHe,Pj){"use strict";var wle=Nc(),Sle=wle();Pj.exports=Sle});var za=s(function(zHe,Mj){"use strict";var Ole=require("@stdlib/utils/define-nonenumerable-read-only-property"),jj=Tj(),Ele=Nc();Ole(jj,"factory",Ele);Mj.exports=jj});var Lc=s(function(JHe,xj){"use strict";var _le=F(),Nle=require("@stdlib/array/dtypes"),Lle=require("@stdlib/array/defaults"),Rle=za(),Ple=Nle("real_floating_point_and_generic"),Tle=_le(Rle,Ple,Lle.get("dtypes.real_floating_point"));xj.exports=Tle});var Gj=s(function(UHe,Aj){"use strict";var jle=Lc(),Mle=jle();Aj.exports=Mle});var Wj=s(function(CHe,Fj){"use strict";var xle=require("@stdlib/utils/define-nonenumerable-read-only-property"),Vj=Gj(),Ale=Lc();xle(Vj,"factory",Ale);Fj.exports=Vj});var Rc=s(function(BHe,Ij){"use strict";var Gle=Vr(),Vle=require("@stdlib/array/dtypes"),Fle=require("@stdlib/array/defaults"),Wle=ln(),Ile=Vle("real_and_generic"),kle=Gle(Wle,Ile,Fle.get("dtypes.real"));Ij.exports=kle});var zj=s(function(DHe,kj){"use strict";var zle=Rc(),Jle=zle();kj.exports=Jle});var Cj=s(function(XHe,Uj){"use strict";var Ule=require("@stdlib/utils/define-nonenumerable-read-only-property"),Jj=zj(),Cle=Rc();Ule(Jj,"factory",Cle);Uj.exports=Jj});var Bj=s(function(YHe,Ble){Ble.exports={name:"mt19937",copy:!0}});var Xj=s(function(HHe,Dj){"use strict";var Dle=$(),Xle=ee(),Yle=T(),qv={};qv.minstd=Dle;qv["minstd-shuffle"]=Xle;qv.mt19937=Yle;Dj.exports=qv});var Pc=s(function(ZHe,Hj){"use strict";var gu=require("@stdlib/utils/define-nonenumerable-read-only-property"),bv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Hle=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Zle=require("@stdlib/assert/is-plain-object"),Qle=require("@stdlib/assert/is-boolean").isPrimitive,wv=require("@stdlib/assert/has-own-property"),$le=require("@stdlib/array/to-json"),fu=require("@stdlib/string/format"),Yj=Bj(),Kle=Xj();function ece(r){var e,t,i;if(e={name:Yj.name,copy:Yj.copy},arguments.length){if(!Zle(r))throw new TypeError(fu("invalid argument. Must provide an object. Value: `%s`.",r));if(wv(r,"name")&&(e.name=r.name),wv(r,"state")){if(e.state=r.state,e.state===void 0)throw new TypeError(fu("invalid option. `%s` option cannot be undefined. Option: `%s`.","state",e.state))}else if(wv(r,"seed")&&(e.seed=r.seed,e.seed===void 0))throw new TypeError(fu("invalid option. `%s` option cannot be undefined. Option: `%s`.","seed",e.seed));if(wv(r,"copy")&&(e.copy=r.copy,!Qle(e.copy)))throw new TypeError(fu("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",e.copy))}if(i=Kle[e.name],i===void 0)throw new Error(fu("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}),gu(l,"NAME","randu"),bv(l,"seed",n),bv(l,"seedLength",a),Hle(l,"state",v,g),bv(l,"stateLength",u),bv(l,"byteLength",o),gu(l,"toJSON",c),gu(l,"PRNG",t),gu(l,"MIN",t.normalized.MIN),gu(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=$le(t.state),m.params=[],m}function l(){return t.normalized()}}Hj.exports=ece});var Qj=s(function(QHe,Zj){"use strict";var rce=Pc(),tce=rce();Zj.exports=tce});var Tt=s(function($He,Kj){"use strict";var ice=require("@stdlib/utils/define-nonenumerable-read-only-property"),$j=Qj(),nce=Pc();ice($j,"factory",nce);Kj.exports=$j});var e0=s(function(KHe,ace){ace.exports={dtype:"float64"}});var i0=s(function(eZe,t0){"use strict";var sce=require("@stdlib/array/typed-real-float-dtypes"),uce=require("@stdlib/assert/is-plain-object"),oce=require("@stdlib/assert/has-own-property"),r0=require("@stdlib/string/format"),Tc=sce();Tc.push("generic");function vce(r,e){return uce(e)?oce(e,"dtype")&&(r.dtype=e.dtype,Tc.indexOf(r.dtype)<0)?new TypeError(r0('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",Tc.join('", "'),r.dtype)):null:new TypeError(r0("invalid argument. Options argument must be an object. Value: `%s`.",e))}t0.exports=vce});var jc=s(function(rZe,s0){"use strict";var gce=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,fce=require("@stdlib/utils/define-nonenumerable-read-only-property"),Sv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),dce=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),n0=Tt(),lce=require("@stdlib/array/typed-real-float-ctors"),cce=require("@stdlib/array/base/filled-by"),mce=require("@stdlib/strided/base/nullary"),hce=require("@stdlib/string/format"),pce=e0(),a0=i0();function yce(){var r,e,t,i,n,a;if(t={dtype:pce.dtype},e=arguments.length,i=u,e===0)n=n0;else if(e===1&&(r=arguments[0],n=n0.factory(r),a=a0(t,r),a))throw a;return Sv(i,"seed",o),Sv(i,"seedLength",v),dce(i,"state",l,m),Sv(i,"stateLength",g),Sv(i,"byteLength",c),fce(i,"PRNG",n.PRNG),i;function u(h,p){var d,f,y,q,b;if(!gce(h))throw new TypeError(hce("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",h));if(b={},arguments.length>1&&(y=a0(b,p),y))throw y;return q=b.dtype||t.dtype,q==="generic"?cce(h,n):(d=lce(q),f=new d(h),mce([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}}s0.exports=yce});var o0=s(function(tZe,u0){"use strict";var qce=jc(),bce=qce();u0.exports=bce});var f0=s(function(iZe,g0){"use strict";var wce=require("@stdlib/utils/define-nonenumerable-read-only-property"),v0=o0(),Sce=jc();wce(v0,"factory",Sce);g0.exports=v0});var l0=s(function(nZe,d0){"use strict";var Oce=require("@stdlib/math/base/special/sqrt"),Ece=require("@stdlib/math/base/special/ln");function _ce(r,e){return e*Oce(-2*Ece(r()))}d0.exports=_ce});var Mc=s(function(aZe,b0){"use strict";var ut=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ov=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),c0=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Nce=require("@stdlib/assert/is-positive-number").isPrimitive,m0=require("@stdlib/assert/is-plain-object"),h0=require("@stdlib/assert/is-function"),p0=require("@stdlib/assert/has-own-property"),y0=require("@stdlib/utils/constant-function"),Lce=require("@stdlib/utils/noop"),Ev=T().factory,Rce=require("@stdlib/math/base/assert/is-nan"),Pce=require("@stdlib/array/to-json"),_v=require("@stdlib/string/format"),q0=l0();function Tce(){var r,e,t,i;if(arguments.length===0)t=Ev();else if(arguments.length===1&&m0(arguments[0]))if(e=arguments[0],p0(e,"prng")){if(!h0(e.prng))throw new TypeError(_v("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));t=e.prng}else t=Ev(e);else{if(r=arguments[0],!Nce(r))throw new TypeError(_v("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(arguments.length>1){if(e=arguments[1],!m0(e))throw new TypeError(_v("invalid argument. Options argument must be an object. Value: `%s`.",e));if(p0(e,"prng")){if(!h0(e.prng))throw new TypeError(_v("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));t=e.prng}else t=Ev(e)}else t=Ev()}return r===void 0?i=m:i=l,ut(i,"NAME","rayleigh"),e&&e.prng?(ut(i,"seed",null),ut(i,"seedLength",null),c0(i,"state",y0(null),Lce),ut(i,"stateLength",null),ut(i,"byteLength",null),ut(i,"toJSON",y0(null)),ut(i,"PRNG",t)):(Ov(i,"seed",n),Ov(i,"seedLength",a),c0(i,"state",v,g),Ov(i,"stateLength",u),Ov(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=Pce(t.state),r===void 0?h.params=[]:h.params=[r],h}function l(){return q0(t,r)}function m(h){return Rce(h)||h<=0?NaN:q0(t,h)}}b0.exports=Tce});var S0=s(function(sZe,w0){"use strict";var jce=Mc(),Mce=jce();w0.exports=Mce});var Ja=s(function(uZe,E0){"use strict";var xce=require("@stdlib/utils/define-nonenumerable-read-only-property"),O0=S0(),Ace=Mc();xce(O0,"factory",Ace);E0.exports=O0});var xc=s(function(oZe,_0){"use strict";var Gce=Vr(),Vce=require("@stdlib/array/dtypes"),Fce=require("@stdlib/array/defaults"),Wce=Ja(),Ice=Vce("real_floating_point_and_generic"),kce=Gce(Wce,Ice,Fce.get("dtypes.real_floating_point"));_0.exports=kce});var L0=s(function(vZe,N0){"use strict";var zce=xc(),Jce=zce();N0.exports=Jce});var T0=s(function(gZe,P0){"use strict";var Uce=require("@stdlib/utils/define-nonenumerable-read-only-property"),R0=L0(),Cce=xc();Uce(R0,"factory",Cce);P0.exports=R0});var Fc=s(function(fZe,I0){"use strict";var jt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Nv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),j0=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Ua=require("@stdlib/assert/has-own-property"),M0=require("@stdlib/assert/is-positive-number").isPrimitive,x0=require("@stdlib/assert/is-plain-object"),Ac=require("@stdlib/assert/is-uint32array"),A0=require("@stdlib/assert/is-boolean").isPrimitive,Bce=require("@stdlib/math/base/assert/is-nan"),G0=require("@stdlib/assert/is-function"),V0=require("@stdlib/utils/constant-function"),Dce=require("@stdlib/utils/noop"),Lv=Ur().factory,Ca=Q().factory,Gc=require("@stdlib/blas/base/gcopy"),Vc=require("@stdlib/array/uint32"),F0=require("@stdlib/object/assign"),Xce=require("@stdlib/array/to-json"),Xe=require("@stdlib/string/format"),W0=require("@stdlib/math/base/special/sqrt");function Yce(){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(x0(arguments[0])){if(n=arguments[0],Ua(n,"copy")&&!A0(n.copy))throw new TypeError(Xe("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",n.copy));if(Ua(n,"prng")){if(!G0(n.prng))throw new TypeError(Xe("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")&&!Ac(n.state))throw new TypeError(Xe("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",n.state));n=F0({},n),n.copy===!1?u=!1:n.state&&(n.state=Gc(n.state.length,n.state,1,new Vc(n.state.length),1)),n.copy=!1,t=Ca(n)}}else{if(o=arguments[0],!M0(o))throw new TypeError(Xe("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],!M0(o))throw new TypeError(Xe("invalid argument. First argument must be a positive number. Value: `%s`.",o));if(n=arguments[1],!x0(n))throw new TypeError(Xe("invalid argument. Options argument must be an object. Value: `%s`.",n));if(Ua(n,"copy")&&!A0(n.copy))throw new TypeError(Xe("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",n.copy));if(Ua(n,"prng")){if(!G0(n.prng))throw new TypeError(Xe("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")&&!Ac(n.state))throw new TypeError(Xe("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",n.state));n=F0({},n),n.copy===!1?u=!1:n.state&&(n.state=Gc(n.state.length,n.state,1,new Vc(n.state.length),1)),n.copy=!1,t=Ca(n)}}return n&&n.prng?o===void 0?r=Lv({prng:n.prng}):r=Lv(o,{prng:n.prng}):(n.state?e=n.state:(e=t.state,t.state=e),o===void 0?r=Lv({state:e,copy:!1}):r=Lv(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),j0(a,"state",V0(null),Dce),jt(a,"stateLength",null),jt(a,"byteLength",null),jt(a,"toJSON",V0(null))):(Nv(a,"seed",v),Nv(a,"seedLength",g),j0(a,"state",m,h),Nv(a,"stateLength",c),Nv(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(!Ac(y))throw new TypeError(Xe("invalid argument. Must provide a Uint32Array. Value: `%s`.",y));u&&(y=Gc(y.length,y,1,new Vc(y.length),1)),i.state=y}function p(){var y={};return y.type="PRNG",y.name=a.NAME,y.state=Xce(i.state),o===void 0?y.params=[]:y.params=[o],y}function d(){return t()/W0(r()/o)}function f(y){return Bce(y)||y<=0?NaN:t()/W0(r(y)/y)}}I0.exports=Yce});var z0=s(function(dZe,k0){"use strict";var Hce=Fc(),Zce=Hce();k0.exports=Zce});var Ba=s(function(lZe,U0){"use strict";var Qce=require("@stdlib/utils/define-nonenumerable-read-only-property"),J0=z0(),$ce=Fc();Qce(J0,"factory",$ce);U0.exports=J0});var Wc=s(function(cZe,C0){"use strict";var Kce=Vr(),eme=require("@stdlib/array/dtypes"),rme=require("@stdlib/array/defaults"),tme=Ba(),ime=eme("real_floating_point_and_generic"),nme=Kce(tme,ime,rme.get("dtypes.real_floating_point"));C0.exports=nme});var D0=s(function(mZe,B0){"use strict";var ame=Wc(),sme=ame();B0.exports=sme});var H0=s(function(hZe,Y0){"use strict";var ume=require("@stdlib/utils/define-nonenumerable-read-only-property"),X0=D0(),ome=Wc();ume(X0,"factory",ome);Y0.exports=X0});var Q0=s(function(pZe,Z0){"use strict";var Ic=require("@stdlib/assert/is-number").isPrimitive,Rv=require("@stdlib/string/format"),kc=require("@stdlib/assert/is-nan");function vme(r,e,t){return!Ic(r)||kc(r)?new TypeError(Rv("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):!Ic(e)||kc(e)?new TypeError(Rv("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e)):!Ic(t)||kc(t)?new TypeError(Rv("invalid argument. Third argument must be a number and not NaN. Value: `%s`.",t)):r<=t&&t<=e?null:new RangeError(Rv("invalid arguments. Parameters must satisfy the following condition: %s. a: `%f`. b: `%f`. c: `%f`.","a <= c <= b",r,e,t))}Z0.exports=vme});var eM=s(function(yZe,K0){"use strict";var $0=require("@stdlib/math/base/special/sqrt");function gme(r,e,t,i){var n,a,u;return n=(i-e)/(t-e),u=r(),u3){if(r=arguments[3],!tM(r))throw new TypeError(jv("invalid argument. Options argument must be an object. Value: `%s`.",r));if(nM(r,"prng")){if(!iM(r.prng))throw new TypeError(jv("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Tv(r)}else e=Tv()}return n===void 0?t=d:t=p,ot(t,"NAME","triangular"),r&&r.prng?(ot(t,"seed",null),ot(t,"seedLength",null),rM(t,"state",aM(null),fme),ot(t,"stateLength",null),ot(t,"byteLength",null),ot(t,"toJSON",aM(null)),ot(t,"PRNG",e)):(Pv(t,"seed",o),Pv(t,"seedLength",v),rM(t,"state",l,m),Pv(t,"stateLength",g),Pv(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=dme(e.state),n===void 0?f.params=[]:f.params=[n,a,u],f}function p(){return sM(e,n,a,u)}function d(f,y,q){return zc(f)||zc(y)||zc(q)||!(f<=q&&q<=y)?NaN:sM(e,f,y,q)}}uM.exports=cme});var vM=s(function(bZe,oM){"use strict";var mme=Jc(),hme=mme();oM.exports=hme});var Da=s(function(wZe,fM){"use strict";var pme=require("@stdlib/utils/define-nonenumerable-read-only-property"),gM=vM(),yme=Jc();pme(gM,"factory",yme);fM.exports=gM});var Uc=s(function(SZe,dM){"use strict";var qme=qo(),bme=require("@stdlib/array/dtypes"),wme=require("@stdlib/array/defaults"),Sme=Da(),Ome=bme("real_floating_point_and_generic"),Eme=qme(Sme,Ome,wme.get("dtypes.real_floating_point"));dM.exports=Eme});var cM=s(function(OZe,lM){"use strict";var _me=Uc(),Nme=_me();lM.exports=Nme});var pM=s(function(EZe,hM){"use strict";var Lme=require("@stdlib/utils/define-nonenumerable-read-only-property"),mM=cM(),Rme=Uc();Lme(mM,"factory",Rme);hM.exports=mM});var wM=s(function(_Ze,bM){"use strict";var yM=require("@stdlib/assert/is-number").isPrimitive,Cc=require("@stdlib/string/format"),qM=require("@stdlib/assert/is-nan");function Pme(r,e){return!yM(r)||qM(r)?new TypeError(Cc("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):!yM(e)||qM(e)?new TypeError(Cc("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e)):r>=e?new RangeError(Cc("invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.",r,e)):null}bM.exports=Pme});var OM=s(function(NZe,SM){"use strict";function Tme(r,e,t){var i=r();return t*i+(1-i)*e}SM.exports=Tme});var Bc=s(function(LZe,jM){"use strict";var vt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Mv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),EM=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),_M=require("@stdlib/assert/is-plain-object"),NM=require("@stdlib/assert/is-function"),LM=require("@stdlib/assert/has-own-property"),RM=require("@stdlib/utils/constant-function"),jme=require("@stdlib/utils/noop"),xv=T().factory,PM=require("@stdlib/math/base/assert/is-nan"),Mme=require("@stdlib/array/to-json"),Av=require("@stdlib/string/format"),xme=wM(),TM=OM();function Ame(){var r,e,t,i,n,a;if(arguments.length===0)e=xv();else if(arguments.length===1){if(r=arguments[0],!_M(r))throw new TypeError(Av("invalid argument. Options argument must be an object. Value: `%s`.",r));if(LM(r,"prng")){if(!NM(r.prng))throw new TypeError(Av("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=xv(r)}else{if(n=arguments[0],a=arguments[1],i=xme(n,a),i)throw i;if(arguments.length>2){if(r=arguments[2],!_M(r))throw new TypeError(Av("invalid argument. Options argument must be an object. Value: `%s`.",r));if(LM(r,"prng")){if(!NM(r.prng))throw new TypeError(Av("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=xv(r)}else e=xv()}return n===void 0?t=p:t=h,vt(t,"NAME","uniform"),r&&r.prng?(vt(t,"seed",null),vt(t,"seedLength",null),EM(t,"state",RM(null),jme),vt(t,"stateLength",null),vt(t,"byteLength",null),vt(t,"toJSON",RM(null)),vt(t,"PRNG",e)):(Mv(t,"seed",u),Mv(t,"seedLength",o),EM(t,"state",c,l),Mv(t,"stateLength",v),Mv(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=Mme(e.state),n===void 0?d.params=[]:d.params=[n,a],d}function h(){return TM(e,n,a)}function p(d,f){return PM(d)||PM(f)||d>=f?NaN:TM(e,d,f)}}jM.exports=Ame});var xM=s(function(RZe,MM){"use strict";var Gme=Bc(),Vme=Gme();MM.exports=Vme});var mn=s(function(PZe,GM){"use strict";var Fme=require("@stdlib/utils/define-nonenumerable-read-only-property"),AM=xM(),Wme=Bc();Fme(AM,"factory",Wme);GM.exports=AM});var Dc=s(function(TZe,VM){"use strict";var Ime=F(),kme=require("@stdlib/array/dtypes"),zme=require("@stdlib/array/defaults"),Jme=mn(),Ume=kme("real_floating_point_and_generic"),Cme=Ime(Jme,Ume,zme.get("dtypes.real_floating_point"));VM.exports=Cme});var WM=s(function(jZe,FM){"use strict";var Bme=Dc(),Dme=Bme();FM.exports=Dme});var zM=s(function(MZe,kM){"use strict";var Xme=require("@stdlib/utils/define-nonenumerable-read-only-property"),IM=WM(),Yme=Dc();Xme(IM,"factory",Yme);kM.exports=IM});var BM=s(function(xZe,CM){"use strict";var JM=require("@stdlib/assert/is-positive-number").isPrimitive,UM=require("@stdlib/string/format");function Hme(r,e){return JM(r)?JM(e)?null:new TypeError(UM("invalid argument. Shape parameter must be a positive number. Value: `%s`.",e)):new TypeError(UM("invalid argument. Scale parameter must be a positive number. Value: `%s`.",r))}CM.exports=Hme});var XM=s(function(AZe,DM){"use strict";var Zme=require("@stdlib/math/base/special/pow"),Qme=require("@stdlib/math/base/special/ln");function $me(r,e,t){return t*Zme(-Qme(1-r()),1/e)}DM.exports=$me});var Xc=s(function(GZe,rx){"use strict";var gt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Gv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),YM=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),HM=require("@stdlib/assert/is-plain-object"),ZM=require("@stdlib/assert/is-function"),QM=require("@stdlib/assert/has-own-property"),$M=require("@stdlib/utils/constant-function"),Kme=require("@stdlib/utils/noop"),Vv=T().factory,KM=require("@stdlib/math/base/assert/is-nan"),ehe=require("@stdlib/array/to-json"),Fv=require("@stdlib/string/format"),rhe=BM(),ex=XM();function the(){var r,e,t,i,n,a;if(arguments.length===0)t=Vv();else if(arguments.length===1){if(e=arguments[0],!HM(e))throw new TypeError(Fv("invalid argument. Options argument must be an object. Value: `%s`.",e));if(QM(e,"prng")){if(!ZM(e.prng))throw new TypeError(Fv("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));t=e.prng}else t=Vv(e)}else{if(a=arguments[0],r=arguments[1],n=rhe(r,a),n)throw n;if(arguments.length>2){if(e=arguments[2],!HM(e))throw new TypeError(Fv("invalid argument. Options argument must be an object. Value: `%s`.",e));if(QM(e,"prng")){if(!ZM(e.prng))throw new TypeError(Fv("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));t=e.prng}else t=Vv(e)}else t=Vv()}return r===void 0?i=p:i=h,gt(i,"NAME","weibull"),e&&e.prng?(gt(i,"seed",null),gt(i,"seedLength",null),YM(i,"state",$M(null),Kme),gt(i,"stateLength",null),gt(i,"byteLength",null),gt(i,"toJSON",$M(null)),gt(i,"PRNG",t)):(Gv(i,"seed",u),Gv(i,"seedLength",o),YM(i,"state",c,l),Gv(i,"stateLength",v),Gv(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=ehe(t.state),a===void 0?d.params=[]:d.params=[a,r],d}function h(){return ex(t,a,r)}function p(d,f){return KM(d)||KM(f)||d<=0||f<=0?NaN:ex(t,d,f)}}rx.exports=the});var ix=s(function(VZe,tx){"use strict";var ihe=Xc(),nhe=ihe();tx.exports=nhe});var hn=s(function(FZe,ax){"use strict";var ahe=require("@stdlib/utils/define-nonenumerable-read-only-property"),nx=ix(),she=Xc();ahe(nx,"factory",she);ax.exports=nx});var Yc=s(function(WZe,sx){"use strict";var uhe=F(),ohe=require("@stdlib/array/dtypes"),vhe=require("@stdlib/array/defaults"),ghe=hn(),fhe=ohe("real_floating_point_and_generic"),dhe=uhe(ghe,fhe,vhe.get("dtypes.real_floating_point"));sx.exports=dhe});var ox=s(function(IZe,ux){"use strict";var lhe=Yc(),che=lhe();ux.exports=che});var fx=s(function(kZe,gx){"use strict";var mhe=require("@stdlib/utils/define-nonenumerable-read-only-property"),vx=ox(),hhe=Yc();mhe(vx,"factory",hhe);gx.exports=vx});var lx=s(function(zZe,dx){"use strict";var M=require("@stdlib/utils/define-read-only-property"),j={};M(j,"arcsine",$p());M(j,"bernoulli",Ry());M(j,"beta",Aq());M(j,"betaprime",Eb());M(j,"binomial",ew());M(j,"cauchy",Ow());M(j,"chi",Zw());M(j,"chisquare",tS());M(j,"cosine",_S());M(j,"discreteUniform",ZS());M(j,"erlang",qO());M(j,"exponential",WO());M(j,"f",oE());M(j,"frechet",CE());M(j,"gamma",ZE());M(j,"geometric",h_());M(j,"gumbel",k_());M(j,"hypergeometric",gN());M(j,"invgamma",jN());M(j,"kumaraswamy",tL());M(j,"laplace",_L());M(j,"levy",YL());M(j,"logistic",pR());M(j,"lognormal",kR());M(j,"minstd",lP());M(j,"minstdShuffle",UP());M(j,"mt19937",sT());M(j,"negativeBinomial",BT());M(j,"normal",cj());M(j,"pareto1",Wj());M(j,"poisson",Cj());M(j,"randu",f0());M(j,"rayleigh",T0());M(j,"t",H0());M(j,"triangular",pM());M(j,"uniform",zM());M(j,"weibull",fx());dx.exports=j});var mx=s(function(JZe,cx){"use strict";var phe=require("@stdlib/math/base/special/sqrt"),yhe=require("@stdlib/math/base/special/ln"),qhe=require("@stdlib/math/base/special/sin"),bhe=require("@stdlib/math/base/special/cos"),whe=require("@stdlib/constants/float64/two-pi");function She(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=phe(-2*yhe(n)),o=whe*a,t=u*bhe(o),e=!1,u*qhe(o)}return e=!0,t}}cx.exports=She});var px=s(function(UZe,hx){"use strict";var Ohe=require("@stdlib/math/base/special/sqrt"),Ehe=require("@stdlib/math/base/special/ln"),_he=require("@stdlib/math/base/special/cos"),Nhe=require("@stdlib/constants/float64/pi"),Lhe=_he(Nhe);function Rhe(r){var e=Ohe(-2*Ehe(r));return e*Lhe}hx.exports=Rhe});var qx=s(function(CZe,yx){"use strict";var Phe=require("@stdlib/math/base/special/sqrt"),The=require("@stdlib/math/base/special/ln"),jhe=require("@stdlib/math/base/special/cos"),Mhe=require("@stdlib/constants/float64/two-pi");function xhe(r){var e=Phe(-2*The(r)),t=Mhe*r;return e*jhe(t)}yx.exports=xhe});var Hc=s(function(BZe,Ox){"use strict";var re=require("@stdlib/utils/define-nonenumerable-read-only-property"),Wv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),bx=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Ahe=require("@stdlib/assert/is-plain-object"),Ghe=require("@stdlib/assert/is-function"),Vhe=require("@stdlib/assert/is-boolean").isPrimitive,du=require("@stdlib/assert/has-own-property"),Fhe=require("@stdlib/assert/is-uint32array"),wx=T().factory,Sx=require("@stdlib/utils/constant-function"),Whe=require("@stdlib/utils/noop"),Ihe=require("@stdlib/array/to-json"),lu=require("@stdlib/string/format"),khe=mx(),zhe=px(),Jhe=qx();function Uhe(r){var e,t,i,n;if(n={copy:!0},arguments.length){if(!Ahe(r))throw new TypeError(lu("invalid argument. Must provide an object. Value: `%s`.",r));if(du(r,"copy")&&(n.copy=r.copy,!Vhe(r.copy)))throw new TypeError(lu("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",r.copy));if(du(r,"prng")){if(!Ghe(r.prng))throw new TypeError(lu("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else if(du(r,"state")){if(n.state=r.state,!Fhe(r.state))throw new TypeError(lu("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",r.state))}else if(du(r,"seed")&&(n.seed=r.seed,r.seed===void 0))throw new TypeError(lu("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=wx(n),e=i.normalized):n.seed=null:(i=wx(n),e=i.normalized),t=khe(e),re(t,"NAME","box-muller"),n.seed===null?(re(t,"seed",null),re(t,"seedLength",null)):(Wv(t,"seed",a),Wv(t,"seedLength",u)),r&&r.prng?(bx(t,"state",Sx(null),Whe),re(t,"stateLength",null),re(t,"byteLength",null),re(t,"toJSON",Sx(null))):(bx(t,"state",g,c),Wv(t,"stateLength",o),Wv(t,"byteLength",v),re(t,"toJSON",l)),re(t,"PRNG",e),du(e,"MIN")?(re(t,"MIN",zhe(e.MIN)),re(t,"MAX",Jhe(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=Ihe(i.state),m.params=[],m}}Ox.exports=Uhe});var _x=s(function(DZe,Ex){"use strict";var Che=Hc(),Bhe=Che();Ex.exports=Bhe});var Xa=s(function(XZe,Lx){"use strict";var Dhe=require("@stdlib/utils/define-nonenumerable-read-only-property"),Nx=_x(),Xhe=Hc();Dhe(Nx,"factory",Xhe);Lx.exports=Nx});var Rx=s(function(YZe,Yhe){Yhe.exports={name:"mt19937",copy:!0}});var Tx=s(function(HZe,Px){"use strict";var Hhe=$(),Zhe=ee(),Qhe=T(),Iv={};Iv.minstd=Hhe;Iv["minstd-shuffle"]=Zhe;Iv.mt19937=Qhe;Px.exports=Iv});var Zc=s(function(ZZe,Mx){"use strict";var cu=require("@stdlib/utils/define-nonenumerable-read-only-property"),kv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),$he=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Khe=require("@stdlib/assert/is-plain-object"),epe=require("@stdlib/assert/is-boolean").isPrimitive,zv=require("@stdlib/assert/has-own-property"),rpe=require("@stdlib/array/to-json"),mu=require("@stdlib/string/format"),jx=Rx(),tpe=Tx();function ipe(r){var e,t,i;if(e={name:jx.name,copy:jx.copy},arguments.length){if(!Khe(r))throw new TypeError(mu("invalid argument. Must provide an object. Value: `%s`.",r));if(zv(r,"name")&&(e.name=r.name),zv(r,"state")){if(e.state=r.state,e.state===void 0)throw new TypeError(mu("invalid option. `%s` option cannot be undefined. Option: `%s`.","state",e.state))}else if(zv(r,"seed")&&(e.seed=r.seed,e.seed===void 0))throw new TypeError(mu("invalid option. `%s` option cannot be undefined. Option: `%s`.","seed",e.seed));if(zv(r,"copy")&&(e.copy=r.copy,!epe(e.copy)))throw new TypeError(mu("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",e.copy))}if(i=tpe[e.name],i===void 0)throw new Error(mu("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}),cu(l,"NAME","randi"),kv(l,"seed",n),kv(l,"seedLength",a),$he(l,"state",v,g),kv(l,"stateLength",u),kv(l,"byteLength",o),cu(l,"toJSON",c),cu(l,"PRNG",t),cu(l,"MIN",t.MIN),cu(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=rpe(t.state),m.params=[],m}function l(){return t()}}Mx.exports=ipe});var Ax=s(function(QZe,xx){"use strict";var npe=Zc(),ape=npe();xx.exports=ape});var hu=s(function($Ze,Vx){"use strict";var spe=require("@stdlib/utils/define-nonenumerable-read-only-property"),Gx=Ax(),upe=Zc();spe(Gx,"factory",upe);Vx.exports=Gx});var Fx=s(function(KZe,ope){ope.exports={name:"improved-ziggurat",copy:!0}});var Ix=s(function(eQe,Wx){"use strict";var vpe=Xa(),gpe=Q(),Qc={};Qc["box-muller"]=vpe;Qc["improved-ziggurat"]=gpe;Wx.exports=Qc});var $c=s(function(rQe,Ux){"use strict";var Mt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Jv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),kx=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),fpe=require("@stdlib/assert/is-plain-object"),dpe=require("@stdlib/assert/is-boolean").isPrimitive,pu=require("@stdlib/assert/has-own-property"),zx=require("@stdlib/utils/constant-function"),Ya=require("@stdlib/string/format"),lpe=require("@stdlib/utils/noop"),cpe=require("@stdlib/array/to-json"),Jx=Fx(),mpe=Ix();function hpe(r){var e,t,i;if(e={name:Jx.name,copy:Jx.copy},arguments.length){if(!fpe(r))throw new TypeError(Ya("invalid argument. Must provide an object. Value: `%s`.",r));if(pu(r,"name")&&(e.name=r.name),pu(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(pu(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(pu(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(pu(r,"copy")&&(e.copy=r.copy,!dpe(e.copy)))throw new TypeError(Ya("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",e.copy))}if(i=mpe[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),kx(l,"state",zx(null),lpe),Mt(l,"stateLength",null),Mt(l,"byteLength",null),Mt(l,"toJSON",zx(null))):(Jv(l,"seed",n),Jv(l,"seedLength",a),kx(l,"state",v,g),Jv(l,"stateLength",u),Jv(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=cpe(t.state),m.params=[],m}function l(){return t()}}Ux.exports=hpe});var Bx=s(function(tQe,Cx){"use strict";var ppe=$c(),ype=ppe();Cx.exports=ype});var yu=s(function(iQe,Xx){"use strict";var qpe=require("@stdlib/utils/define-nonenumerable-read-only-property"),Dx=Bx(),bpe=$c();qpe(Dx,"factory",bpe);Xx.exports=Dx});var Hx=s(function(nQe,Yx){"use strict";var wpe=nn(),Spe=va(),Ope=sn(),Epe=un(),_pe=da(),Npe=Xa(),Lpe=ca(),Rpe=pa(),Ppe=Ur(),Tpe=on(),jpe=vn(),Mpe=ba(),xpe=gn(),Ape=Sa(),Gpe=Ea(),Vpe=Ce(),Fpe=_a(),Wpe=Na(),Ipe=La(),kpe=Q(),zpe=fn(),Jpe=Pa(),Upe=Ta(),Cpe=ja(),Bpe=Ma(),Dpe=dn(),Xpe=$(),Ype=ee(),Hpe=T(),Zpe=Ia(),Qpe=cn(),$pe=za(),Kpe=ln(),eye=hu(),rye=yu(),tye=Tt(),iye=Ja(),nye=Ba(),aye=Da(),sye=mn(),uye=hn(),E={};E.arcsine=wpe.factory;E.bernoulli=Spe.factory;E.beta=Ope.factory;E.betaprime=Epe.factory;E.binomial=_pe.factory;E["box-muller"]=Npe.factory;E.cauchy=Lpe.factory;E.chi=Rpe.factory;E.chisquare=Ppe.factory;E.cosine=Tpe.factory;E["discrete-uniform"]=jpe.factory;E.erlang=Mpe.factory;E.exponential=xpe.factory;E.f=Ape.factory;E.frechet=Gpe.factory;E.gamma=Vpe.factory;E.geometric=Fpe.factory;E.gumbel=Wpe.factory;E.hypergeometric=Ipe.factory;E["improved-ziggurat"]=kpe.factory;E.invgamma=zpe.factory;E.kumaraswamy=Jpe.factory;E.laplace=Upe.factory;E.levy=Cpe.factory;E.logistic=Bpe.factory;E.lognormal=Dpe.factory;E.minstd=Xpe.factory;E["minstd-shuffle"]=Ype.factory;E.mt19937=Hpe.factory;E["negative-binomial"]=Zpe.factory;E.normal=Qpe.factory;E["pareto-type1"]=$pe.factory;E.poisson=Kpe.factory;E.randi=eye.factory;E.randn=rye.factory;E.randu=tye.factory;E.rayleigh=iye.factory;E.t=nye.factory;E.triangular=aye.factory;E.uniform=sye.factory;E.weibull=uye.factory;Yx.exports=E});var e1=s(function(aQe,Kx){"use strict";var Zx=require("@stdlib/assert/is-string").isPrimitive,oye=require("@stdlib/assert/is-plain-object"),Qx=require("@stdlib/assert/is-array"),vye=require("@stdlib/assert/contains"),gye=require("@stdlib/array/int32"),fye=require("@stdlib/array/uint32"),$x=Hx(),dye={Int32Array:gye,Uint32Array:fye},lye=["randi","randn","randu"];function cye(r,e){var t,i,n,a,u;if(e&&e.type==="PRNG"&&Zx(e.name)&&oye(e.state)&&Qx(e.params)&&Zx(e.state.type)&&Qx(e.state.data)&&(i={},t=$x[e.name],t===void 0&&(u=e.name.split("-"),vye(lye,u[0])&&(t=$x[u[0]],i.name=u.slice(1).join("-"))),t&&(a=dye[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}Kx.exports=cye});var t1=s(function(sQe,r1){"use strict";var mye=e1();r1.exports=mye});var n1=s(function(uQe,i1){"use strict";var _=require("@stdlib/utils/define-read-only-property"),O={};_(O,"arcsine",nn());_(O,"bernoulli",va());_(O,"beta",sn());_(O,"betaprime",un());_(O,"binomial",da());_(O,"boxMuller",Xa());_(O,"cauchy",ca());_(O,"chi",pa());_(O,"chisquare",Ur());_(O,"cosine",on());_(O,"discreteUniform",vn());_(O,"erlang",ba());_(O,"exponential",gn());_(O,"f",Sa());_(O,"frechet",Ea());_(O,"gamma",Ce());_(O,"geometric",_a());_(O,"gumbel",Na());_(O,"hypergeometric",La());_(O,"improvedZiggurat",Q());_(O,"invgamma",fn());_(O,"kumaraswamy",Pa());_(O,"laplace",Ta());_(O,"levy",ja());_(O,"logistic",Ma());_(O,"lognormal",dn());_(O,"minstd",$());_(O,"minstdShuffle",ee());_(O,"mt19937",T());_(O,"negativeBinomial",Ia());_(O,"normal",cn());_(O,"pareto1",za());_(O,"poisson",ln());_(O,"randi",hu());_(O,"randn",yu());_(O,"randu",Tt());_(O,"rayleigh",Ja());_(O,"reviveBasePRNG",t1());_(O,"t",Ba());_(O,"triangular",Da());_(O,"uniform",mn());_(O,"weibull",hn());i1.exports=O});var l1=s(function(oQe,d1){"use strict";var xt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Uv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),a1=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),hye=require("@stdlib/utils/constant-function"),pye=require("@stdlib/utils/noop"),yye=require("@stdlib/object/assign"),s1=require("@stdlib/assert/is-number").isPrimitive,u1=require("@stdlib/math/base/assert/is-nan"),qye=require("@stdlib/assert/is-plain-object"),bye=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,wye=require("@stdlib/assert/has-own-property"),o1=require("@stdlib/constants/float64/max"),v1=nn().factory,g1=require("@stdlib/symbol/iterator"),qu=require("@stdlib/string/format");function f1(r,e,t){var i,n,a,u,o;if(!s1(r)||u1(r))throw new TypeError(qu("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!s1(e)||u1(e))throw new TypeError(qu("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e));if(r>=e)throw new RangeError(qu("invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.",r,e));if(arguments.length>2){if(!qye(t))throw new TypeError(qu("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=yye({},t),wye(i,"iter")){if(!bye(i.iter))throw new TypeError(qu("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=o1;a=v1(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=v1(r,e),i={iter:o1,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),a1(n,"state",hye(null),pye),xt(n,"stateLength",null),xt(n,"byteLength",null)):(Uv(n,"seed",l),Uv(n,"seedLength",m),a1(n,"state",d,f),Uv(n,"stateLength",h),Uv(n,"byteLength",p)),xt(n,"PRNG",a.PRNG),g1&&xt(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 f1(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=f1});var m1=s(function(vQe,c1){"use strict";var Sye=l1();c1.exports=Sye});var S1=s(function(gQe,w1){"use strict";var At=require("@stdlib/utils/define-nonenumerable-read-only-property"),Cv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),h1=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Oye=require("@stdlib/utils/constant-function"),Eye=require("@stdlib/utils/noop"),_ye=require("@stdlib/object/assign"),Nye=require("@stdlib/assert/is-probability").isPrimitive,Lye=require("@stdlib/assert/is-plain-object"),Rye=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Pye=require("@stdlib/assert/has-own-property"),p1=require("@stdlib/constants/float64/max"),y1=va().factory,q1=require("@stdlib/symbol/iterator"),Kc=require("@stdlib/string/format");function b1(r,e){var t,i,n,a,u;if(!Nye(r))throw new TypeError(Kc("invalid argument. First argument must be a probability. Value: `%s`.",r));if(arguments.length>1){if(!Lye(e))throw new TypeError(Kc("invalid argument. Options argument must be an object. Value: `%s`.",e));if(t=_ye({},e),Pye(t,"iter")){if(!Rye(t.iter))throw new TypeError(Kc("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=p1;n=y1(r,t),t.prng===void 0&&t.copy!==!1&&(t.state=n.state)}else n=y1(r),t={iter:p1,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),h1(i,"state",Oye(null),Eye),At(i,"stateLength",null),At(i,"byteLength",null)):(Cv(i,"seed",c),Cv(i,"seedLength",l),h1(i,"state",p,d),Cv(i,"stateLength",m),Cv(i,"byteLength",h)),At(i,"PRNG",n.PRNG),q1&&At(i,q1,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 b1(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}}w1.exports=b1});var E1=s(function(fQe,O1){"use strict";var Tye=S1();O1.exports=Tye});var M1=s(function(dQe,j1){"use strict";var Gt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Bv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),_1=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),jye=require("@stdlib/utils/constant-function"),Mye=require("@stdlib/utils/noop"),xye=require("@stdlib/object/assign"),N1=require("@stdlib/assert/is-positive-number").isPrimitive,Aye=require("@stdlib/assert/is-plain-object"),Gye=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Vye=require("@stdlib/assert/has-own-property"),L1=require("@stdlib/constants/float64/max"),R1=sn().factory,P1=require("@stdlib/symbol/iterator"),Dv=require("@stdlib/string/format");function T1(r,e,t){var i,n,a,u,o;if(!N1(r))throw new TypeError(Dv("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!N1(e))throw new TypeError(Dv("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!Aye(t))throw new TypeError(Dv("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=xye({},t),Vye(i,"iter")){if(!Gye(i.iter))throw new TypeError(Dv("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=L1;a=R1(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=R1(r,e),i={iter:L1,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),_1(n,"state",jye(null),Mye),Gt(n,"stateLength",null),Gt(n,"byteLength",null)):(Bv(n,"seed",l),Bv(n,"seedLength",m),_1(n,"state",d,f),Bv(n,"stateLength",h),Bv(n,"byteLength",p)),Gt(n,"PRNG",a.PRNG),P1&&Gt(n,P1,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 T1(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}}j1.exports=T1});var A1=s(function(lQe,x1){"use strict";var Fye=M1();x1.exports=Fye});var J1=s(function(cQe,z1){"use strict";var Vt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Xv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),G1=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Wye=require("@stdlib/utils/constant-function"),Iye=require("@stdlib/utils/noop"),kye=require("@stdlib/object/assign"),V1=require("@stdlib/assert/is-positive-number").isPrimitive,zye=require("@stdlib/assert/is-plain-object"),Jye=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Uye=require("@stdlib/assert/has-own-property"),F1=require("@stdlib/constants/float64/max"),W1=un().factory,I1=require("@stdlib/symbol/iterator"),Yv=require("@stdlib/string/format");function k1(r,e,t){var i,n,a,u,o;if(!V1(r))throw new TypeError(Yv("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!V1(e))throw new TypeError(Yv("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!zye(t))throw new TypeError(Yv("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=kye({},t),Uye(i,"iter")){if(!Jye(i.iter))throw new TypeError(Yv("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=F1;a=W1(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=W1(r,e),i={iter:F1,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),G1(n,"state",Wye(null),Iye),Vt(n,"stateLength",null),Vt(n,"byteLength",null)):(Xv(n,"seed",l),Xv(n,"seedLength",m),G1(n,"state",d,f),Xv(n,"stateLength",h),Xv(n,"byteLength",p)),Vt(n,"PRNG",a.PRNG),I1&&Vt(n,I1,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 k1(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}}z1.exports=k1});var C1=s(function(mQe,U1){"use strict";var Cye=J1();U1.exports=Cye});var Q1=s(function(hQe,Z1){"use strict";var Ft=require("@stdlib/utils/define-nonenumerable-read-only-property"),Hv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),B1=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Bye=require("@stdlib/utils/constant-function"),Dye=require("@stdlib/utils/noop"),Xye=require("@stdlib/object/assign"),Yye=require("@stdlib/assert/is-probability").isPrimitive,Hye=require("@stdlib/assert/is-plain-object"),Zye=require("@stdlib/assert/is-positive-integer").isPrimitive,Qye=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,$ye=require("@stdlib/assert/has-own-property"),D1=require("@stdlib/constants/float64/max"),X1=da().factory,Y1=require("@stdlib/symbol/iterator"),Zv=require("@stdlib/string/format");function H1(r,e,t){var i,n,a,u,o;if(!Zye(r))throw new TypeError(Zv("invalid argument. First argument must be a positive integer. Value: `%s`.",r));if(!Yye(e))throw new TypeError(Zv("invalid argument. Second argument must be a probability. Value: `%s`.",e));if(arguments.length>2){if(!Hye(t))throw new TypeError(Zv("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=Xye({},t),$ye(i,"iter")){if(!Qye(i.iter))throw new TypeError(Zv("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=D1;a=X1(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=X1(r,e),i={iter:D1,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),B1(n,"state",Bye(null),Dye),Ft(n,"stateLength",null),Ft(n,"byteLength",null)):(Hv(n,"seed",l),Hv(n,"seedLength",m),B1(n,"state",d,f),Hv(n,"stateLength",h),Hv(n,"byteLength",p)),Ft(n,"PRNG",a.PRNG),Y1&&Ft(n,Y1,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}}Z1.exports=H1});var K1=s(function(pQe,$1){"use strict";var Kye=Q1();$1.exports=Kye});var uA=s(function(yQe,sA){"use strict";var Wt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Qv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),eA=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),eqe=require("@stdlib/utils/constant-function"),rqe=require("@stdlib/utils/noop"),tqe=require("@stdlib/object/assign"),iqe=require("@stdlib/assert/is-plain-object"),nqe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,aqe=require("@stdlib/assert/has-own-property"),rA=require("@stdlib/constants/float64/max"),tA=Xa().factory,iA=require("@stdlib/symbol/iterator"),nA=require("@stdlib/string/format");function aA(r){var e,t,i,n,a;if(arguments.length>0){if(!iqe(r))throw new TypeError(nA("invalid argument. Options argument must be an object. Value: `%s`.",r));if(e=tqe({},r),aqe(e,"iter")){if(!nqe(e.iter))throw new TypeError(nA("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",e.iter))}else e.iter=rA;i=tA(e),e.prng===void 0&&e.copy!==!1&&(e.state=i.state)}else i=tA(),e={iter:rA,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),eA(t,"state",eqe(null),rqe),Wt(t,"stateLength",null),Wt(t,"byteLength",null)):(Qv(t,"seed",g),Qv(t,"seedLength",c),eA(t,"state",h,p),Qv(t,"stateLength",l),Qv(t,"byteLength",m)),Wt(t,"PRNG",i.PRNG),iA&&Wt(t,iA,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 aA(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}}sA.exports=aA});var vA=s(function(qQe,oA){"use strict";var sqe=uA();oA.exports=sqe});var hA=s(function(bQe,mA){"use strict";var It=require("@stdlib/utils/define-nonenumerable-read-only-property"),$v=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),gA=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),uqe=require("@stdlib/utils/constant-function"),oqe=require("@stdlib/utils/noop"),vqe=require("@stdlib/object/assign"),gqe=require("@stdlib/assert/is-number").isPrimitive,fqe=require("@stdlib/math/base/assert/is-nan"),dqe=require("@stdlib/assert/is-plain-object"),lqe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,cqe=require("@stdlib/assert/is-positive-number").isPrimitive,mqe=require("@stdlib/assert/has-own-property"),fA=require("@stdlib/constants/float64/max"),dA=ca().factory,lA=require("@stdlib/symbol/iterator"),Kv=require("@stdlib/string/format");function cA(r,e,t){var i,n,a,u,o;if(!gqe(r)||fqe(r))throw new TypeError(Kv("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!cqe(e))throw new TypeError(Kv("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!dqe(t))throw new TypeError(Kv("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=vqe({},t),mqe(i,"iter")){if(!lqe(i.iter))throw new TypeError(Kv("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=fA;a=dA(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=dA(r,e),i={iter:fA,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),gA(n,"state",uqe(null),oqe),It(n,"stateLength",null),It(n,"byteLength",null)):($v(n,"seed",l),$v(n,"seedLength",m),gA(n,"state",d,f),$v(n,"stateLength",h),$v(n,"byteLength",p)),It(n,"PRNG",a.PRNG),lA&&It(n,lA,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 cA(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}}mA.exports=cA});var yA=s(function(wQe,pA){"use strict";var hqe=hA();pA.exports=hqe});var _A=s(function(SQe,EA){"use strict";var kt=require("@stdlib/utils/define-nonenumerable-read-only-property"),eg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),qA=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),pqe=require("@stdlib/utils/constant-function"),yqe=require("@stdlib/utils/noop"),qqe=require("@stdlib/object/assign"),bqe=require("@stdlib/assert/is-positive-number").isPrimitive,wqe=require("@stdlib/assert/is-plain-object"),Sqe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Oqe=require("@stdlib/assert/has-own-property"),bA=require("@stdlib/constants/float64/max"),wA=pa().factory,SA=require("@stdlib/symbol/iterator"),em=require("@stdlib/string/format");function OA(r,e){var t,i,n,a,u;if(!bqe(r))throw new TypeError(em("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(arguments.length>1){if(!wqe(e))throw new TypeError(em("invalid argument. Options argument must be an object. Value: `%s`.",e));if(t=qqe({},e),Oqe(t,"iter")){if(!Sqe(t.iter))throw new TypeError(em("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=bA;n=wA(r,t),t.prng===void 0&&t.copy!==!1&&(t.state=n.state)}else n=wA(r),t={iter:bA,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),qA(i,"state",pqe(null),yqe),kt(i,"stateLength",null),kt(i,"byteLength",null)):(eg(i,"seed",c),eg(i,"seedLength",l),qA(i,"state",p,d),eg(i,"stateLength",m),eg(i,"byteLength",h)),kt(i,"PRNG",n.PRNG),SA&&kt(i,SA,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 OA(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}}EA.exports=OA});var LA=s(function(OQe,NA){"use strict";var Eqe=_A();NA.exports=Eqe});var AA=s(function(EQe,xA){"use strict";var zt=require("@stdlib/utils/define-nonenumerable-read-only-property"),rg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),RA=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),_qe=require("@stdlib/utils/constant-function"),Nqe=require("@stdlib/utils/noop"),Lqe=require("@stdlib/object/assign"),Rqe=require("@stdlib/assert/is-positive-number").isPrimitive,Pqe=require("@stdlib/assert/is-plain-object"),Tqe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,jqe=require("@stdlib/assert/has-own-property"),PA=require("@stdlib/constants/float64/max"),TA=Ur().factory,jA=require("@stdlib/symbol/iterator"),rm=require("@stdlib/string/format");function MA(r,e){var t,i,n,a,u;if(!Rqe(r))throw new TypeError(rm("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(arguments.length>1){if(!Pqe(e))throw new TypeError(rm("invalid argument. Options argument must be an object. Value: `%s`.",e));if(t=Lqe({},e),jqe(t,"iter")){if(!Tqe(t.iter))throw new TypeError(rm("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=PA;n=TA(r,t),t.prng===void 0&&t.copy!==!1&&(t.state=n.state)}else n=TA(r),t={iter:PA,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),RA(i,"state",_qe(null),Nqe),zt(i,"stateLength",null),zt(i,"byteLength",null)):(rg(i,"seed",c),rg(i,"seedLength",l),RA(i,"state",p,d),rg(i,"stateLength",m),rg(i,"byteLength",h)),zt(i,"PRNG",n.PRNG),jA&&zt(i,jA,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 MA(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}}xA.exports=MA});var VA=s(function(_Qe,GA){"use strict";var Mqe=AA();GA.exports=Mqe});var UA=s(function(NQe,JA){"use strict";var Jt=require("@stdlib/utils/define-nonenumerable-read-only-property"),tg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),FA=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),xqe=require("@stdlib/utils/constant-function"),Aqe=require("@stdlib/utils/noop"),Gqe=require("@stdlib/object/assign"),Vqe=require("@stdlib/assert/is-number").isPrimitive,Fqe=require("@stdlib/math/base/assert/is-nan"),Wqe=require("@stdlib/assert/is-plain-object"),Iqe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,kqe=require("@stdlib/assert/is-positive-number").isPrimitive,zqe=require("@stdlib/assert/has-own-property"),WA=require("@stdlib/constants/float64/max"),IA=on().factory,kA=require("@stdlib/symbol/iterator"),ig=require("@stdlib/string/format");function zA(r,e,t){var i,n,a,u,o;if(!Vqe(r)||Fqe(r))throw new TypeError(ig("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!kqe(e))throw new TypeError(ig("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!Wqe(t))throw new TypeError(ig("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=Gqe({},t),zqe(i,"iter")){if(!Iqe(i.iter))throw new TypeError(ig("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=WA;a=IA(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=IA(r,e),i={iter:WA,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),FA(n,"state",xqe(null),Aqe),Jt(n,"stateLength",null),Jt(n,"byteLength",null)):(tg(n,"seed",l),tg(n,"seedLength",m),FA(n,"state",d,f),tg(n,"stateLength",h),tg(n,"byteLength",p)),Jt(n,"PRNG",a.PRNG),kA&&Jt(n,kA,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 zA(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}}JA.exports=zA});var BA=s(function(LQe,CA){"use strict";var Jqe=UA();CA.exports=Jqe});var KA=s(function(RQe,$A){"use strict";var Ut=require("@stdlib/utils/define-nonenumerable-read-only-property"),ng=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),DA=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Uqe=require("@stdlib/utils/constant-function"),Cqe=require("@stdlib/utils/noop"),Bqe=require("@stdlib/object/assign"),XA=require("@stdlib/assert/is-number").isPrimitive,Dqe=require("@stdlib/assert/is-plain-object"),Xqe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Yqe=require("@stdlib/assert/has-own-property"),YA=require("@stdlib/constants/float64/max"),HA=vn().factory,ZA=require("@stdlib/symbol/iterator"),bu=require("@stdlib/string/format");function QA(r,e,t){var i,n,a,u,o;if(!XA(r))throw new TypeError(bu("invalid argument. First argument must be an integer. Value: `%s`.",r));if(!XA(e))throw new TypeError(bu("invalid argument. Second argument must be an integer. Value: `%s`.",e));if(r>e)throw new RangeError(bu("invalid argument. Minimum support must be less than or equal to maximum support. Value: `[%d,%d]`.",r,e));if(arguments.length>2){if(!Dqe(t))throw new TypeError(bu("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=Bqe({},t),Yqe(i,"iter")){if(!Xqe(i.iter))throw new TypeError(bu("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=YA;a=HA(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=HA(r,e),i={iter:YA,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),DA(n,"state",Uqe(null),Cqe),Ut(n,"stateLength",null),Ut(n,"byteLength",null)):(ng(n,"seed",l),ng(n,"seedLength",m),DA(n,"state",d,f),ng(n,"stateLength",h),ng(n,"byteLength",p)),Ut(n,"PRNG",a.PRNG),ZA&&Ut(n,ZA,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}}$A.exports=QA});var rG=s(function(PQe,eG){"use strict";var Hqe=KA();eG.exports=Hqe});var oG=s(function(TQe,uG){"use strict";var Ct=require("@stdlib/utils/define-nonenumerable-read-only-property"),ag=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),tG=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Zqe=require("@stdlib/utils/constant-function"),Qqe=require("@stdlib/utils/noop"),$qe=require("@stdlib/object/assign"),Kqe=require("@stdlib/assert/is-positive-number").isPrimitive,ebe=require("@stdlib/assert/is-plain-object"),rbe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,tbe=require("@stdlib/assert/is-positive-integer").isPrimitive,ibe=require("@stdlib/assert/has-own-property"),iG=require("@stdlib/constants/float64/max"),nG=ba().factory,aG=require("@stdlib/symbol/iterator"),sg=require("@stdlib/string/format");function sG(r,e,t){var i,n,a,u,o;if(!tbe(r))throw new TypeError(sg("invalid argument. First argument must be a positive integer. Value: `%s`.",r));if(!Kqe(e))throw new TypeError(sg("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!ebe(t))throw new TypeError(sg("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=$qe({},t),ibe(i,"iter")){if(!rbe(i.iter))throw new TypeError(sg("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=iG;a=nG(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=nG(r,e),i={iter:iG,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),tG(n,"state",Zqe(null),Qqe),Ct(n,"stateLength",null),Ct(n,"byteLength",null)):(ag(n,"seed",l),ag(n,"seedLength",m),tG(n,"state",d,f),ag(n,"stateLength",h),ag(n,"byteLength",p)),Ct(n,"PRNG",a.PRNG),aG&&Ct(n,aG,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 sG(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}}uG.exports=sG});var gG=s(function(jQe,vG){"use strict";var nbe=oG();vG.exports=nbe});var pG=s(function(MQe,hG){"use strict";var Bt=require("@stdlib/utils/define-nonenumerable-read-only-property"),ug=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),fG=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),abe=require("@stdlib/utils/constant-function"),sbe=require("@stdlib/utils/noop"),ube=require("@stdlib/object/assign"),obe=require("@stdlib/assert/is-positive-number").isPrimitive,vbe=require("@stdlib/assert/is-plain-object"),gbe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,fbe=require("@stdlib/assert/has-own-property"),dG=require("@stdlib/constants/float64/max"),lG=gn().factory,cG=require("@stdlib/symbol/iterator"),tm=require("@stdlib/string/format");function mG(r,e){var t,i,n,a,u;if(!obe(r))throw new TypeError(tm("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(arguments.length>1){if(!vbe(e))throw new TypeError(tm("invalid argument. Options argument must be an object. Value: `%s`.",e));if(t=ube({},e),fbe(t,"iter")){if(!gbe(t.iter))throw new TypeError(tm("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=dG;n=lG(r,t),t.prng===void 0&&t.copy!==!1&&(t.state=n.state)}else n=lG(r),t={iter:dG,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),fG(i,"state",abe(null),sbe),Bt(i,"stateLength",null),Bt(i,"byteLength",null)):(ug(i,"seed",c),ug(i,"seedLength",l),fG(i,"state",p,d),ug(i,"stateLength",m),ug(i,"byteLength",h)),Bt(i,"PRNG",n.PRNG),cG&&Bt(i,cG,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 mG(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}}hG.exports=mG});var qG=s(function(xQe,yG){"use strict";var dbe=pG();yG.exports=dbe});var LG=s(function(AQe,NG){"use strict";var Dt=require("@stdlib/utils/define-nonenumerable-read-only-property"),og=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),bG=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),lbe=require("@stdlib/utils/constant-function"),cbe=require("@stdlib/utils/noop"),mbe=require("@stdlib/object/assign"),wG=require("@stdlib/assert/is-positive-number").isPrimitive,hbe=require("@stdlib/assert/is-plain-object"),pbe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,ybe=require("@stdlib/assert/has-own-property"),SG=require("@stdlib/constants/float64/max"),OG=Sa().factory,EG=require("@stdlib/symbol/iterator"),vg=require("@stdlib/string/format");function _G(r,e,t){var i,n,a,u,o;if(!wG(r))throw new TypeError(vg("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!wG(e))throw new TypeError(vg("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!hbe(t))throw new TypeError(vg("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=mbe({},t),ybe(i,"iter")){if(!pbe(i.iter))throw new TypeError(vg("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=SG;a=OG(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=OG(r,e),i={iter:SG,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),bG(n,"state",lbe(null),cbe),Dt(n,"stateLength",null),Dt(n,"byteLength",null)):(og(n,"seed",l),og(n,"seedLength",m),bG(n,"state",d,f),og(n,"stateLength",h),og(n,"byteLength",p)),Dt(n,"PRNG",a.PRNG),EG&&Dt(n,EG,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 _G(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=_G});var PG=s(function(GQe,RG){"use strict";var qbe=LG();RG.exports=qbe});var FG=s(function(VQe,VG){"use strict";var Xt=require("@stdlib/utils/define-nonenumerable-read-only-property"),gg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),TG=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),bbe=require("@stdlib/utils/constant-function"),wbe=require("@stdlib/utils/noop"),Sbe=require("@stdlib/object/assign"),jG=require("@stdlib/assert/is-positive-number").isPrimitive,Obe=require("@stdlib/assert/is-plain-object"),Ebe=require("@stdlib/assert/is-number").isPrimitive,_be=require("@stdlib/math/base/assert/is-nan"),Nbe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Lbe=require("@stdlib/assert/has-own-property"),MG=require("@stdlib/constants/float64/max"),xG=Ea().factory,AG=require("@stdlib/symbol/iterator"),wu=require("@stdlib/string/format");function GG(r,e,t,i){var n,a,u,o,v;if(!jG(r))throw new TypeError(wu("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!jG(e))throw new TypeError(wu("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(!Ebe(t)||_be(t))throw new TypeError(wu("invalid argument. Third argument must be a number. Value: `%s`.",t));if(arguments.length>3){if(!Obe(i))throw new TypeError(wu("invalid argument. Options argument must be an object. Value: `%s`.",i));if(n=Sbe({},i),Lbe(n,"iter")){if(!Nbe(n.iter))throw new TypeError(wu("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",n.iter))}else n.iter=MG;u=xG(r,e,t,n),n.prng===void 0&&n.copy!==!1&&(n.state=u.state)}else u=xG(r,e,t),n={iter:MG,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),TG(a,"state",bbe(null),wbe),Xt(a,"stateLength",null),Xt(a,"byteLength",null)):(gg(a,"seed",m),gg(a,"seedLength",h),TG(a,"state",f,y),gg(a,"stateLength",p),gg(a,"byteLength",d)),Xt(a,"PRNG",u.PRNG),AG&&Xt(a,AG,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 GG(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}}VG.exports=GG});var IG=s(function(FQe,WG){"use strict";var Rbe=FG();WG.exports=Rbe});var XG=s(function(WQe,DG){"use strict";var Yt=require("@stdlib/utils/define-nonenumerable-read-only-property"),fg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),kG=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Pbe=require("@stdlib/utils/constant-function"),Tbe=require("@stdlib/utils/noop"),jbe=require("@stdlib/object/assign"),zG=require("@stdlib/assert/is-positive-number").isPrimitive,Mbe=require("@stdlib/assert/is-plain-object"),xbe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Abe=require("@stdlib/assert/has-own-property"),JG=require("@stdlib/constants/float64/max"),UG=Ce().factory,CG=require("@stdlib/symbol/iterator"),dg=require("@stdlib/string/format");function BG(r,e,t){var i,n,a,u,o;if(!zG(r))throw new TypeError(dg("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!zG(e))throw new TypeError(dg("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!Mbe(t))throw new TypeError(dg("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=jbe({},t),Abe(i,"iter")){if(!xbe(i.iter))throw new TypeError(dg("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=JG;a=UG(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=UG(r,e),i={iter:JG,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),kG(n,"state",Pbe(null),Tbe),Yt(n,"stateLength",null),Yt(n,"byteLength",null)):(fg(n,"seed",l),fg(n,"seedLength",m),kG(n,"state",d,f),fg(n,"stateLength",h),fg(n,"byteLength",p)),Yt(n,"PRNG",a.PRNG),CG&&Yt(n,CG,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 BG(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=BG});var HG=s(function(IQe,YG){"use strict";var Gbe=XG();YG.exports=Gbe});var tV=s(function(kQe,rV){"use strict";var Ht=require("@stdlib/utils/define-nonenumerable-read-only-property"),lg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),ZG=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Vbe=require("@stdlib/utils/constant-function"),Fbe=require("@stdlib/utils/noop"),Wbe=require("@stdlib/object/assign"),Ibe=require("@stdlib/assert/is-probability").isPrimitive,kbe=require("@stdlib/assert/is-plain-object"),zbe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Jbe=require("@stdlib/assert/has-own-property"),QG=require("@stdlib/constants/float64/max"),$G=_a().factory,KG=require("@stdlib/symbol/iterator"),im=require("@stdlib/string/format");function eV(r,e){var t,i,n,a,u;if(!Ibe(r))throw new TypeError(im("invalid argument. First argument must be a probability. Value: `%s`.",r));if(arguments.length>1){if(!kbe(e))throw new TypeError(im("invalid argument. Options argument must be an object. Value: `%s`.",e));if(t=Wbe({},e),Jbe(t,"iter")){if(!zbe(t.iter))throw new TypeError(im("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=QG;n=$G(r,t),t.prng===void 0&&t.copy!==!1&&(t.state=n.state)}else n=$G(r),t={iter:QG,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),ZG(i,"state",Vbe(null),Fbe),Ht(i,"stateLength",null),Ht(i,"byteLength",null)):(lg(i,"seed",c),lg(i,"seedLength",l),ZG(i,"state",p,d),lg(i,"stateLength",m),lg(i,"byteLength",h)),Ht(i,"PRNG",n.PRNG),KG&&Ht(i,KG,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 eV(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}}rV.exports=eV});var nV=s(function(zQe,iV){"use strict";var Ube=tV();iV.exports=Ube});var fV=s(function(JQe,gV){"use strict";var Zt=require("@stdlib/utils/define-nonenumerable-read-only-property"),cg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),aV=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Cbe=require("@stdlib/utils/constant-function"),Bbe=require("@stdlib/utils/noop"),Dbe=require("@stdlib/object/assign"),Xbe=require("@stdlib/assert/is-number").isPrimitive,Ybe=require("@stdlib/math/base/assert/is-nan"),Hbe=require("@stdlib/assert/is-plain-object"),Zbe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Qbe=require("@stdlib/assert/is-positive-number").isPrimitive,$be=require("@stdlib/assert/has-own-property"),sV=require("@stdlib/constants/float64/max"),uV=Na().factory,oV=require("@stdlib/symbol/iterator"),mg=require("@stdlib/string/format");function vV(r,e,t){var i,n,a,u,o;if(!Xbe(r)||Ybe(r))throw new TypeError(mg("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!Qbe(e))throw new TypeError(mg("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!Hbe(t))throw new TypeError(mg("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=Dbe({},t),$be(i,"iter")){if(!Zbe(i.iter))throw new TypeError(mg("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=sV;a=uV(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=uV(r,e),i={iter:sV,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),aV(n,"state",Cbe(null),Bbe),Zt(n,"stateLength",null),Zt(n,"byteLength",null)):(cg(n,"seed",l),cg(n,"seedLength",m),aV(n,"state",d,f),cg(n,"stateLength",h),cg(n,"byteLength",p)),Zt(n,"PRNG",a.PRNG),oV&&Zt(n,oV,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 vV(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}}gV.exports=vV});var lV=s(function(UQe,dV){"use strict";var Kbe=fV();dV.exports=Kbe});var bV=s(function(CQe,qV){"use strict";var Qt=require("@stdlib/utils/define-nonenumerable-read-only-property"),hg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),cV=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),ewe=require("@stdlib/utils/constant-function"),rwe=require("@stdlib/utils/noop"),twe=require("@stdlib/object/assign"),iwe=require("@stdlib/assert/is-plain-object"),pg=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,nwe=require("@stdlib/assert/has-own-property"),mV=require("@stdlib/constants/float64/max"),hV=La().factory,pV=require("@stdlib/symbol/iterator"),pn=require("@stdlib/string/format");function yV(r,e,t,i){var n,a,u,o,v;if(!pg(r))throw new TypeError(pn("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",r));if(!pg(e))throw new TypeError(pn("invalid argument. Second argument must be a nonnegative integer. Value: `%s`.",e));if(!pg(t))throw new TypeError(pn("invalid argument. Third argument must be a nonnegative integer. Value: `%s`.",t));if(t>r)throw new RangeError(pn("invalid argument. Number of draws must be less than or equal to the population size. Value: `%u`.",t));if(e>r)throw new RangeError(pn("invalid argument. Subpopulation size must be less than or equal to the population size. Value: `%u`.",e));if(arguments.length>3){if(!iwe(i))throw new TypeError(pn("invalid argument. Options argument must be an object. Value: `%s`.",i));if(n=twe({},i),nwe(n,"iter")){if(!pg(n.iter))throw new TypeError(pn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",n.iter))}else n.iter=mV;u=hV(r,e,t,n),n.prng===void 0&&n.copy!==!1&&(n.state=u.state)}else u=hV(r,e,t),n={iter:mV,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),cV(a,"state",ewe(null),rwe),Qt(a,"stateLength",null),Qt(a,"byteLength",null)):(hg(a,"seed",m),hg(a,"seedLength",h),cV(a,"state",f,y),hg(a,"stateLength",p),hg(a,"byteLength",d)),Qt(a,"PRNG",u.PRNG),pV&&Qt(a,pV,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 yV(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}}qV.exports=yV});var SV=s(function(BQe,wV){"use strict";var awe=bV();wV.exports=awe});var TV=s(function(DQe,PV){"use strict";var $t=require("@stdlib/utils/define-nonenumerable-read-only-property"),yg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),OV=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),swe=require("@stdlib/utils/constant-function"),uwe=require("@stdlib/utils/noop"),owe=require("@stdlib/object/assign"),vwe=require("@stdlib/assert/is-plain-object"),gwe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,fwe=require("@stdlib/assert/has-own-property"),EV=require("@stdlib/constants/float64/max"),_V=Q().factory,NV=require("@stdlib/symbol/iterator"),LV=require("@stdlib/string/format");function RV(r){var e,t,i,n,a;if(arguments.length>0){if(!vwe(r))throw new TypeError(LV("invalid argument. Options argument must be an object. Value: `%s`.",r));if(e=owe({},r),fwe(e,"iter")){if(!gwe(e.iter))throw new TypeError(LV("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",e.iter))}else e.iter=EV;i=_V(e),e.prng===void 0&&e.copy!==!1&&(e.state=i.state)}else i=_V(),e={iter:EV,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),OV(t,"state",swe(null),uwe),$t(t,"stateLength",null),$t(t,"byteLength",null)):(yg(t,"seed",g),yg(t,"seedLength",c),OV(t,"state",h,p),yg(t,"stateLength",l),yg(t,"byteLength",m)),$t(t,"PRNG",i.PRNG),NV&&$t(t,NV,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 RV(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}}PV.exports=RV});var MV=s(function(XQe,jV){"use strict";var dwe=TV();jV.exports=dwe});var kV=s(function(YQe,IV){"use strict";var Kt=require("@stdlib/utils/define-nonenumerable-read-only-property"),qg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),xV=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),lwe=require("@stdlib/utils/constant-function"),cwe=require("@stdlib/utils/noop"),mwe=require("@stdlib/object/assign"),AV=require("@stdlib/assert/is-positive-number").isPrimitive,hwe=require("@stdlib/assert/is-plain-object"),pwe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,ywe=require("@stdlib/assert/has-own-property"),GV=require("@stdlib/constants/float64/max"),VV=fn().factory,FV=require("@stdlib/symbol/iterator"),bg=require("@stdlib/string/format");function WV(r,e,t){var i,n,a,u,o;if(!AV(r))throw new TypeError(bg("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!AV(e))throw new TypeError(bg("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!hwe(t))throw new TypeError(bg("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=mwe({},t),ywe(i,"iter")){if(!pwe(i.iter))throw new TypeError(bg("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=GV;a=VV(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=VV(r,e),i={iter:GV,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),xV(n,"state",lwe(null),cwe),Kt(n,"stateLength",null),Kt(n,"byteLength",null)):(qg(n,"seed",l),qg(n,"seedLength",m),xV(n,"state",d,f),qg(n,"stateLength",h),qg(n,"byteLength",p)),Kt(n,"PRNG",a.PRNG),FV&&Kt(n,FV,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 WV(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}}IV.exports=WV});var JV=s(function(HQe,zV){"use strict";var qwe=kV();zV.exports=qwe});var ZV=s(function(ZQe,HV){"use strict";var ei=require("@stdlib/utils/define-nonenumerable-read-only-property"),wg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),UV=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),bwe=require("@stdlib/utils/constant-function"),wwe=require("@stdlib/utils/noop"),Swe=require("@stdlib/object/assign"),CV=require("@stdlib/assert/is-positive-number").isPrimitive,Owe=require("@stdlib/assert/is-plain-object"),Ewe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,_we=require("@stdlib/assert/has-own-property"),BV=require("@stdlib/constants/float64/max"),DV=Pa().factory,XV=require("@stdlib/symbol/iterator"),Sg=require("@stdlib/string/format");function YV(r,e,t){var i,n,a,u,o;if(!CV(r))throw new TypeError(Sg("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!CV(e))throw new TypeError(Sg("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!Owe(t))throw new TypeError(Sg("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=Swe({},t),_we(i,"iter")){if(!Ewe(i.iter))throw new TypeError(Sg("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=BV;a=DV(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=DV(r,e),i={iter:BV,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),UV(n,"state",bwe(null),wwe),ei(n,"stateLength",null),ei(n,"byteLength",null)):(wg(n,"seed",l),wg(n,"seedLength",m),UV(n,"state",d,f),wg(n,"stateLength",h),wg(n,"byteLength",p)),ei(n,"PRNG",a.PRNG),XV&&ei(n,XV,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 YV(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=YV});var $V=s(function(QQe,QV){"use strict";var Nwe=ZV();QV.exports=Nwe});var a2=s(function($Qe,n2){"use strict";var ri=require("@stdlib/utils/define-nonenumerable-read-only-property"),Og=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),KV=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Lwe=require("@stdlib/utils/constant-function"),Rwe=require("@stdlib/utils/noop"),Pwe=require("@stdlib/object/assign"),Twe=require("@stdlib/assert/is-number").isPrimitive,jwe=require("@stdlib/math/base/assert/is-nan"),Mwe=require("@stdlib/assert/is-plain-object"),xwe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Awe=require("@stdlib/assert/is-positive-number").isPrimitive,Gwe=require("@stdlib/assert/has-own-property"),e2=require("@stdlib/constants/float64/max"),r2=Ta().factory,t2=require("@stdlib/symbol/iterator"),Eg=require("@stdlib/string/format");function i2(r,e,t){var i,n,a,u,o;if(!Twe(r)||jwe(r))throw new TypeError(Eg("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!Awe(e))throw new TypeError(Eg("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!Mwe(t))throw new TypeError(Eg("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=Pwe({},t),Gwe(i,"iter")){if(!xwe(i.iter))throw new TypeError(Eg("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=e2;a=r2(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=r2(r,e),i={iter:e2,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),KV(n,"state",Lwe(null),Rwe),ri(n,"stateLength",null),ri(n,"byteLength",null)):(Og(n,"seed",l),Og(n,"seedLength",m),KV(n,"state",d,f),Og(n,"stateLength",h),Og(n,"byteLength",p)),ri(n,"PRNG",a.PRNG),t2&&ri(n,t2,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 i2(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}}n2.exports=i2});var u2=s(function(KQe,s2){"use strict";var Vwe=a2();s2.exports=Vwe});var c2=s(function(e$e,l2){"use strict";var ti=require("@stdlib/utils/define-nonenumerable-read-only-property"),_g=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),o2=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Fwe=require("@stdlib/utils/constant-function"),Wwe=require("@stdlib/utils/noop"),Iwe=require("@stdlib/object/assign"),kwe=require("@stdlib/assert/is-number").isPrimitive,zwe=require("@stdlib/math/base/assert/is-nan"),Jwe=require("@stdlib/assert/is-plain-object"),Uwe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Cwe=require("@stdlib/assert/is-positive-number").isPrimitive,Bwe=require("@stdlib/assert/has-own-property"),v2=require("@stdlib/constants/float64/max"),g2=ja().factory,f2=require("@stdlib/symbol/iterator"),Ng=require("@stdlib/string/format");function d2(r,e,t){var i,n,a,u,o;if(!kwe(r)||zwe(r))throw new TypeError(Ng("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!Cwe(e))throw new TypeError(Ng("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!Jwe(t))throw new TypeError(Ng("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=Iwe({},t),Bwe(i,"iter")){if(!Uwe(i.iter))throw new TypeError(Ng("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=v2;a=g2(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=g2(r,e),i={iter:v2,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),o2(n,"state",Fwe(null),Wwe),ti(n,"stateLength",null),ti(n,"byteLength",null)):(_g(n,"seed",l),_g(n,"seedLength",m),o2(n,"state",d,f),_g(n,"stateLength",h),_g(n,"byteLength",p)),ti(n,"PRNG",a.PRNG),f2&&ti(n,f2,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 d2(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=d2});var h2=s(function(r$e,m2){"use strict";var Dwe=c2();m2.exports=Dwe});var O2=s(function(t$e,S2){"use strict";var ii=require("@stdlib/utils/define-nonenumerable-read-only-property"),Lg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),p2=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Xwe=require("@stdlib/utils/constant-function"),Ywe=require("@stdlib/utils/noop"),Hwe=require("@stdlib/object/assign"),Zwe=require("@stdlib/assert/is-number").isPrimitive,Qwe=require("@stdlib/math/base/assert/is-nan"),$we=require("@stdlib/assert/is-plain-object"),Kwe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,eSe=require("@stdlib/assert/is-positive-number").isPrimitive,rSe=require("@stdlib/assert/has-own-property"),y2=require("@stdlib/constants/float64/max"),q2=Ma().factory,b2=require("@stdlib/symbol/iterator"),Rg=require("@stdlib/string/format");function w2(r,e,t){var i,n,a,u,o;if(!Zwe(r)||Qwe(r))throw new TypeError(Rg("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!eSe(e))throw new TypeError(Rg("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!$we(t))throw new TypeError(Rg("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=Hwe({},t),rSe(i,"iter")){if(!Kwe(i.iter))throw new TypeError(Rg("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=y2;a=q2(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=q2(r,e),i={iter:y2,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),p2(n,"state",Xwe(null),Ywe),ii(n,"stateLength",null),ii(n,"byteLength",null)):(Lg(n,"seed",l),Lg(n,"seedLength",m),p2(n,"state",d,f),Lg(n,"stateLength",h),Lg(n,"byteLength",p)),ii(n,"PRNG",a.PRNG),b2&&ii(n,b2,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 w2(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}}S2.exports=w2});var _2=s(function(i$e,E2){"use strict";var tSe=O2();E2.exports=tSe});var M2=s(function(n$e,j2){"use strict";var ni=require("@stdlib/utils/define-nonenumerable-read-only-property"),Pg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),N2=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),iSe=require("@stdlib/utils/constant-function"),nSe=require("@stdlib/utils/noop"),aSe=require("@stdlib/object/assign"),sSe=require("@stdlib/assert/is-number").isPrimitive,uSe=require("@stdlib/math/base/assert/is-nan"),oSe=require("@stdlib/assert/is-plain-object"),vSe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,gSe=require("@stdlib/assert/is-positive-number").isPrimitive,fSe=require("@stdlib/assert/has-own-property"),L2=require("@stdlib/constants/float64/max"),R2=dn().factory,P2=require("@stdlib/symbol/iterator"),Tg=require("@stdlib/string/format");function T2(r,e,t){var i,n,a,u,o;if(!sSe(r)||uSe(r))throw new TypeError(Tg("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!gSe(e))throw new TypeError(Tg("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!oSe(t))throw new TypeError(Tg("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=aSe({},t),fSe(i,"iter")){if(!vSe(i.iter))throw new TypeError(Tg("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=L2;a=R2(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=R2(r,e),i={iter:L2,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),N2(n,"state",iSe(null),nSe),ni(n,"stateLength",null),ni(n,"byteLength",null)):(Pg(n,"seed",l),Pg(n,"seedLength",m),N2(n,"state",d,f),Pg(n,"stateLength",h),Pg(n,"byteLength",p)),ni(n,"PRNG",a.PRNG),P2&&ni(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 T2(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}}j2.exports=T2});var A2=s(function(a$e,x2){"use strict";var dSe=M2();x2.exports=dSe});var z2=s(function(s$e,k2){"use strict";var nm=require("@stdlib/utils/define-nonenumerable-read-only-property"),jg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),lSe=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),cSe=require("@stdlib/object/assign"),mSe=require("@stdlib/assert/is-plain-object"),hSe=require("@stdlib/assert/is-boolean").isPrimitive,pSe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,G2=require("@stdlib/assert/has-own-property"),V2=require("@stdlib/constants/float64/max"),F2=$().factory,W2=require("@stdlib/symbol/iterator"),am=require("@stdlib/string/format");function I2(r){var e,t,i,n,a;if(arguments.length>0){if(!mSe(r))throw new TypeError(am("invalid argument. Options argument must be an object. Value: `%s`.",r));if(e=cSe({},r),G2(e,"normalized")&&!hSe(e.normalized))throw new TypeError(am("invalid option. `%s` option must be a boolean. Option: `%s`.","normalized",e.normalized));if(G2(e,"iter")){if(!pSe(e.iter))throw new TypeError(am("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",e.iter))}else e.iter=V2;i=F2(e),e.copy!==!1&&(e.state=i.state)}else i=F2(),e={iter:V2,state:i.state};return e.normalized&&(i=i.normalized),a=0,t={},nm(t,"next",u),nm(t,"return",o),jg(t,"seed",g),jg(t,"seedLength",c),lSe(t,"state",h,p),jg(t,"stateLength",l),jg(t,"byteLength",m),W2&&nm(t,W2,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 I2(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}}k2.exports=I2});var U2=s(function(u$e,J2){"use strict";var ySe=z2();J2.exports=ySe});var Z2=s(function(o$e,H2){"use strict";var sm=require("@stdlib/utils/define-nonenumerable-read-only-property"),Mg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),qSe=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),bSe=require("@stdlib/object/assign"),wSe=require("@stdlib/assert/is-plain-object"),SSe=require("@stdlib/assert/is-boolean").isPrimitive,OSe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,C2=require("@stdlib/assert/has-own-property"),B2=require("@stdlib/constants/float64/max"),D2=ee().factory,X2=require("@stdlib/symbol/iterator"),um=require("@stdlib/string/format");function Y2(r){var e,t,i,n,a;if(arguments.length>0){if(!wSe(r))throw new TypeError(um("invalid argument. Options argument must be an object. Value: `%s`.",r));if(e=bSe({},r),C2(e,"normalized")&&!SSe(e.normalized))throw new TypeError(um("invalid option. `%s` option must be a boolean. Option: `%s`.","normalized",e.normalized));if(C2(e,"iter")){if(!OSe(e.iter))throw new TypeError(um("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",e.iter))}else e.iter=B2;i=D2(e),e.copy!==!1&&(e.state=i.state)}else i=D2(),e={iter:B2,state:i.state};return e.normalized&&(i=i.normalized),a=0,t={},sm(t,"next",u),sm(t,"return",o),Mg(t,"seed",g),Mg(t,"seedLength",c),qSe(t,"state",h,p),Mg(t,"stateLength",l),Mg(t,"byteLength",m),X2&&sm(t,X2,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 Y2(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}}H2.exports=Y2});var $2=s(function(v$e,Q2){"use strict";var ESe=Z2();Q2.exports=ESe});var aF=s(function(g$e,nF){"use strict";var om=require("@stdlib/utils/define-nonenumerable-read-only-property"),xg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),_Se=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),NSe=require("@stdlib/object/assign"),LSe=require("@stdlib/assert/is-plain-object"),RSe=require("@stdlib/assert/is-boolean").isPrimitive,PSe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,K2=require("@stdlib/assert/has-own-property"),eF=require("@stdlib/constants/float64/max"),rF=T().factory,tF=require("@stdlib/symbol/iterator"),vm=require("@stdlib/string/format");function iF(r){var e,t,i,n,a;if(arguments.length>0){if(!LSe(r))throw new TypeError(vm("invalid argument. Options argument must be an object. Value: `%s`.",r));if(e=NSe({},r),K2(e,"normalized")&&!RSe(e.normalized))throw new TypeError(vm("invalid option. `%s` option must be a boolean. Option: `%s`.","normalized",e.normalized));if(K2(e,"iter")){if(!PSe(e.iter))throw new TypeError(vm("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",e.iter))}else e.iter=eF;i=rF(e),e.copy!==!1&&(e.state=i.state)}else i=rF(),e={iter:eF,state:i.state};return e.normalized&&(i=i.normalized),a=0,t={},om(t,"next",u),om(t,"return",o),xg(t,"seed",g),xg(t,"seedLength",c),_Se(t,"state",h,p),xg(t,"stateLength",l),xg(t,"byteLength",m),tF&&om(t,tF,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 iF(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}}nF.exports=iF});var uF=s(function(f$e,sF){"use strict";var TSe=aF();sF.exports=TSe});var cF=s(function(d$e,lF){"use strict";var ai=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ag=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),oF=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-probability").isPrimitive,GSe=require("@stdlib/assert/is-plain-object"),VSe=require("@stdlib/assert/is-positive-number").isPrimitive,FSe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,WSe=require("@stdlib/assert/has-own-property"),vF=require("@stdlib/constants/float64/max"),gF=Ia().factory,fF=require("@stdlib/symbol/iterator"),Gg=require("@stdlib/string/format");function dF(r,e,t){var i,n,a,u,o;if(!VSe(r))throw new TypeError(Gg("invalid argument. First argument must be a positive integer. Value: `%s`.",r));if(!ASe(e))throw new TypeError(Gg("invalid argument. Second argument must be a probability. Value: `%s`.",e));if(arguments.length>2){if(!GSe(t))throw new TypeError(Gg("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=xSe({},t),WSe(i,"iter")){if(!FSe(i.iter))throw new TypeError(Gg("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=vF;a=gF(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=gF(r,e),i={iter:vF,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),oF(n,"state",jSe(null),MSe),ai(n,"stateLength",null),ai(n,"byteLength",null)):(Ag(n,"seed",l),Ag(n,"seedLength",m),oF(n,"state",d,f),Ag(n,"stateLength",h),Ag(n,"byteLength",p)),ai(n,"PRNG",a.PRNG),fF&&ai(n,fF,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 dF(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=dF});var hF=s(function(l$e,mF){"use strict";var ISe=cF();mF.exports=ISe});var OF=s(function(c$e,SF){"use strict";var si=require("@stdlib/utils/define-nonenumerable-read-only-property"),Vg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),pF=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),kSe=require("@stdlib/utils/constant-function"),zSe=require("@stdlib/utils/noop"),JSe=require("@stdlib/object/assign"),USe=require("@stdlib/assert/is-number").isPrimitive,CSe=require("@stdlib/math/base/assert/is-nan"),BSe=require("@stdlib/assert/is-plain-object"),DSe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,XSe=require("@stdlib/assert/is-positive-number").isPrimitive,YSe=require("@stdlib/assert/has-own-property"),yF=require("@stdlib/constants/float64/max"),qF=cn().factory,bF=require("@stdlib/symbol/iterator"),Fg=require("@stdlib/string/format");function wF(r,e,t){var i,n,a,u,o;if(!USe(r)||CSe(r))throw new TypeError(Fg("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!XSe(e))throw new TypeError(Fg("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!BSe(t))throw new TypeError(Fg("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=JSe({},t),YSe(i,"iter")){if(!DSe(i.iter))throw new TypeError(Fg("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=yF;a=qF(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=qF(r,e),i={iter:yF,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),pF(n,"state",kSe(null),zSe),si(n,"stateLength",null),si(n,"byteLength",null)):(Vg(n,"seed",l),Vg(n,"seedLength",m),pF(n,"state",d,f),Vg(n,"stateLength",h),Vg(n,"byteLength",p)),si(n,"PRNG",a.PRNG),bF&&si(n,bF,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 wF(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}}SF.exports=wF});var _F=s(function(m$e,EF){"use strict";var HSe=OF();EF.exports=HSe});var xF=s(function(h$e,MF){"use strict";var ui=require("@stdlib/utils/define-nonenumerable-read-only-property"),Wg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),NF=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),ZSe=require("@stdlib/utils/constant-function"),QSe=require("@stdlib/utils/noop"),$Se=require("@stdlib/object/assign"),LF=require("@stdlib/assert/is-positive-number").isPrimitive,KSe=require("@stdlib/assert/is-plain-object"),eOe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,rOe=require("@stdlib/assert/has-own-property"),RF=require("@stdlib/constants/float64/max"),PF=za().factory,TF=require("@stdlib/symbol/iterator"),Ig=require("@stdlib/string/format");function jF(r,e,t){var i,n,a,u,o;if(!LF(r))throw new TypeError(Ig("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!LF(e))throw new TypeError(Ig("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!KSe(t))throw new TypeError(Ig("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=$Se({},t),rOe(i,"iter")){if(!eOe(i.iter))throw new TypeError(Ig("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=RF;a=PF(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=PF(r,e),i={iter:RF,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),NF(n,"state",ZSe(null),QSe),ui(n,"stateLength",null),ui(n,"byteLength",null)):(Wg(n,"seed",l),Wg(n,"seedLength",m),NF(n,"state",d,f),Wg(n,"stateLength",h),Wg(n,"byteLength",p)),ui(n,"PRNG",a.PRNG),TF&&ui(n,TF,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 jF(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}}MF.exports=jF});var GF=s(function(p$e,AF){"use strict";var tOe=xF();AF.exports=tOe});var JF=s(function(y$e,zF){"use strict";var oi=require("@stdlib/utils/define-nonenumerable-read-only-property"),kg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),VF=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),iOe=require("@stdlib/utils/constant-function"),nOe=require("@stdlib/utils/noop"),aOe=require("@stdlib/object/assign"),sOe=require("@stdlib/assert/is-positive-number").isPrimitive,uOe=require("@stdlib/assert/is-plain-object"),oOe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,vOe=require("@stdlib/assert/has-own-property"),FF=require("@stdlib/constants/float64/max"),WF=ln().factory,IF=require("@stdlib/symbol/iterator"),gm=require("@stdlib/string/format");function kF(r,e){var t,i,n,a,u;if(!sOe(r))throw new TypeError(gm("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(arguments.length>1){if(!uOe(e))throw new TypeError(gm("invalid argument. Options argument must be an object. Value: `%s`.",e));if(t=aOe({},e),vOe(t,"iter")){if(!oOe(t.iter))throw new TypeError(gm("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=FF;n=WF(r,t),t.prng===void 0&&t.copy!==!1&&(t.state=n.state)}else n=WF(r),t={iter:FF,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),VF(i,"state",iOe(null),nOe),oi(i,"stateLength",null),oi(i,"byteLength",null)):(kg(i,"seed",c),kg(i,"seedLength",l),VF(i,"state",p,d),kg(i,"stateLength",m),kg(i,"byteLength",h)),oi(i,"PRNG",n.PRNG),IF&&oi(i,IF,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 kF(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}}zF.exports=kF});var CF=s(function(q$e,UF){"use strict";var gOe=JF();UF.exports=gOe});var QF=s(function(b$e,ZF){"use strict";var zg=require("@stdlib/utils/define-nonenumerable-read-only-property"),Jg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),fOe=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),dOe=require("@stdlib/object/assign"),lOe=require("@stdlib/assert/is-plain-object"),cOe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,mOe=require("@stdlib/assert/has-own-property"),BF=require("@stdlib/constants/float64/max"),DF=hu().factory,XF=require("@stdlib/symbol/iterator"),YF=require("@stdlib/string/format");function HF(r){var e,t,i,n,a;if(arguments.length>0){if(!lOe(r))throw new TypeError(YF("invalid argument. Options argument must be an object. Value: `%s`.",r));if(e=dOe({},r),mOe(e,"iter")){if(!cOe(e.iter))throw new TypeError(YF("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",e.iter))}else e.iter=BF;i=DF(e),e.copy!==!1&&(e.state=i.state)}else i=DF(),e={iter:BF,state:i.state};return a=0,t={},zg(t,"next",u),zg(t,"return",o),Jg(t,"seed",g),Jg(t,"seedLength",c),fOe(t,"state",h,p),Jg(t,"stateLength",l),Jg(t,"byteLength",m),zg(t,"PRNG",i.PRNG),XF&&zg(t,XF,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 HF(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}}ZF.exports=HF});var KF=s(function(w$e,$F){"use strict";var hOe=QF();$F.exports=hOe});var uW=s(function(S$e,sW){"use strict";var vi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ug=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),eW=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),pOe=require("@stdlib/utils/constant-function"),yOe=require("@stdlib/utils/noop"),qOe=require("@stdlib/object/assign"),bOe=require("@stdlib/assert/is-plain-object"),wOe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,SOe=require("@stdlib/assert/has-own-property"),rW=require("@stdlib/constants/float64/max"),tW=yu().factory,iW=require("@stdlib/symbol/iterator"),nW=require("@stdlib/string/format");function aW(r){var e,t,i,n,a;if(arguments.length>0){if(!bOe(r))throw new TypeError(nW("invalid argument. Options argument must be an object. Value: `%s`.",r));if(e=qOe({},r),SOe(e,"iter")){if(!wOe(e.iter))throw new TypeError(nW("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",e.iter))}else e.iter=rW;i=tW(e),e.prng===void 0&&e.copy!==!1&&(e.state=i.state)}else i=tW(),e={iter:rW,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),eW(t,"state",pOe(null),yOe),vi(t,"stateLength",null),vi(t,"byteLength",null)):(Ug(t,"seed",g),Ug(t,"seedLength",c),eW(t,"state",h,p),Ug(t,"stateLength",l),Ug(t,"byteLength",m)),vi(t,"PRNG",i.PRNG),iW&&vi(t,iW,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 aW(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}}sW.exports=aW});var vW=s(function(O$e,oW){"use strict";var OOe=uW();oW.exports=OOe});var hW=s(function(E$e,mW){"use strict";var Cg=require("@stdlib/utils/define-nonenumerable-read-only-property"),Bg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),EOe=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),_Oe=require("@stdlib/object/assign"),NOe=require("@stdlib/assert/is-plain-object"),LOe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,ROe=require("@stdlib/assert/has-own-property"),gW=require("@stdlib/constants/float64/max"),fW=Tt().factory,dW=require("@stdlib/symbol/iterator"),lW=require("@stdlib/string/format");function cW(r){var e,t,i,n,a;if(arguments.length>0){if(!NOe(r))throw new TypeError(lW("invalid argument. Options argument must be an object. Value: `%s`.",r));if(e=_Oe({},r),ROe(e,"iter")){if(!LOe(e.iter))throw new TypeError(lW("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",e.iter))}else e.iter=gW;i=fW(e),e.copy!==!1&&(e.state=i.state)}else i=fW(),e={iter:gW,state:i.state};return a=0,t={},Cg(t,"next",u),Cg(t,"return",o),Bg(t,"seed",g),Bg(t,"seedLength",c),EOe(t,"state",h,p),Bg(t,"stateLength",l),Bg(t,"byteLength",m),Cg(t,"PRNG",i.PRNG),dW&&Cg(t,dW,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 cW(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}}mW.exports=cW});var yW=s(function(_$e,pW){"use strict";var POe=hW();pW.exports=POe});var _W=s(function(N$e,EW){"use strict";var gi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Dg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),qW=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),TOe=require("@stdlib/utils/constant-function"),jOe=require("@stdlib/utils/noop"),MOe=require("@stdlib/object/assign"),xOe=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"),bW=require("@stdlib/constants/float64/max"),wW=Ja().factory,SW=require("@stdlib/symbol/iterator"),fm=require("@stdlib/string/format");function OW(r,e){var t,i,n,a,u;if(!xOe(r))throw new TypeError(fm("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(arguments.length>1){if(!AOe(e))throw new TypeError(fm("invalid argument. Options argument must be an object. Value: `%s`.",e));if(t=MOe({},e),VOe(t,"iter")){if(!GOe(t.iter))throw new TypeError(fm("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=bW;n=wW(r,t),t.prng===void 0&&t.copy!==!1&&(t.state=n.state)}else n=wW(r),t={iter:bW,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),qW(i,"state",TOe(null),jOe),gi(i,"stateLength",null),gi(i,"byteLength",null)):(Dg(i,"seed",c),Dg(i,"seedLength",l),qW(i,"state",p,d),Dg(i,"stateLength",m),Dg(i,"byteLength",h)),gi(i,"PRNG",n.PRNG),SW&&gi(i,SW,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 OW(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}}EW.exports=OW});var LW=s(function(L$e,NW){"use strict";var FOe=_W();NW.exports=FOe});var AW=s(function(R$e,xW){"use strict";var fi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Xg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),RW=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"),PW=require("@stdlib/constants/float64/max"),TW=Ba().factory,jW=require("@stdlib/symbol/iterator"),dm=require("@stdlib/string/format");function MW(r,e){var t,i,n,a,u;if(!zOe(r))throw new TypeError(dm("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(arguments.length>1){if(!JOe(e))throw new TypeError(dm("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(dm("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=PW;n=TW(r,t),t.prng===void 0&&t.copy!==!1&&(t.state=n.state)}else n=TW(r),t={iter:PW,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),RW(i,"state",WOe(null),IOe),fi(i,"stateLength",null),fi(i,"byteLength",null)):(Xg(i,"seed",c),Xg(i,"seedLength",l),RW(i,"state",p,d),Xg(i,"stateLength",m),Xg(i,"byteLength",h)),fi(i,"PRNG",n.PRNG),jW&&fi(i,jW,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 MW(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}}xW.exports=MW});var VW=s(function(P$e,GW){"use strict";var BOe=AW();GW.exports=BOe});var UW=s(function(T$e,JW){"use strict";var di=require("@stdlib/utils/define-nonenumerable-read-only-property"),Yg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),FW=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),DOe=require("@stdlib/utils/constant-function"),XOe=require("@stdlib/utils/noop"),YOe=require("@stdlib/object/assign"),lm=require("@stdlib/assert/is-number").isPrimitive,cm=require("@stdlib/math/base/assert/is-nan"),HOe=require("@stdlib/assert/is-plain-object"),ZOe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,QOe=require("@stdlib/assert/has-own-property"),WW=require("@stdlib/constants/float64/max"),IW=Da().factory,kW=require("@stdlib/symbol/iterator"),Ha=require("@stdlib/string/format");function zW(r,e,t,i){var n,a,u,o,v;if(!lm(r)||cm(r))throw new TypeError(Ha("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!lm(e)||cm(e))throw new TypeError(Ha("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e));if(!lm(t)||cm(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(!HOe(i))throw new TypeError(Ha("invalid argument. Options argument must be an object. Value: `%s`.",i));if(n=YOe({},i),QOe(n,"iter")){if(!ZOe(n.iter))throw new TypeError(Ha("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",n.iter))}else n.iter=WW;u=IW(r,e,t,n),n.prng===void 0&&n.copy!==!1&&(n.state=u.state)}else u=IW(r,e,t),n={iter:WW,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),FW(a,"state",DOe(null),XOe),di(a,"stateLength",null),di(a,"byteLength",null)):(Yg(a,"seed",m),Yg(a,"seedLength",h),FW(a,"state",f,y),Yg(a,"stateLength",p),Yg(a,"byteLength",d)),di(a,"PRNG",u.PRNG),kW&&di(a,kW,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 zW(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}}JW.exports=zW});var BW=s(function(j$e,CW){"use strict";var $Oe=UW();CW.exports=$Oe});var eI=s(function(M$e,KW){"use strict";var li=require("@stdlib/utils/define-nonenumerable-read-only-property"),Hg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),DW=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),KOe=require("@stdlib/utils/constant-function"),eEe=require("@stdlib/utils/noop"),rEe=require("@stdlib/object/assign"),XW=require("@stdlib/assert/is-number").isPrimitive,YW=require("@stdlib/math/base/assert/is-nan"),tEe=require("@stdlib/assert/is-plain-object"),iEe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,nEe=require("@stdlib/assert/has-own-property"),HW=require("@stdlib/constants/float64/max"),ZW=mn().factory,QW=require("@stdlib/symbol/iterator"),Su=require("@stdlib/string/format");function $W(r,e,t){var i,n,a,u,o;if(!XW(r)||YW(r))throw new TypeError(Su("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!XW(e)||YW(e))throw new TypeError(Su("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e));if(r>=e)throw new RangeError(Su("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(Su("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=rEe({},t),nEe(i,"iter")){if(!iEe(i.iter))throw new TypeError(Su("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=HW;a=ZW(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=ZW(r,e),i={iter:HW,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),DW(n,"state",KOe(null),eEe),li(n,"stateLength",null),li(n,"byteLength",null)):(Hg(n,"seed",l),Hg(n,"seedLength",m),DW(n,"state",d,f),Hg(n,"stateLength",h),Hg(n,"byteLength",p)),li(n,"PRNG",a.PRNG),QW&&li(n,QW,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 $W(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}}KW.exports=$W});var tI=s(function(x$e,rI){"use strict";var aEe=eI();rI.exports=aEe});var gI=s(function(A$e,vI){"use strict";var ci=require("@stdlib/utils/define-nonenumerable-read-only-property"),Zg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),iI=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),sEe=require("@stdlib/utils/constant-function"),uEe=require("@stdlib/utils/noop"),oEe=require("@stdlib/object/assign"),nI=require("@stdlib/assert/is-positive-number").isPrimitive,vEe=require("@stdlib/assert/is-plain-object"),gEe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,fEe=require("@stdlib/assert/has-own-property"),aI=require("@stdlib/constants/float64/max"),sI=hn().factory,uI=require("@stdlib/symbol/iterator"),Qg=require("@stdlib/string/format");function oI(r,e,t){var i,n,a,u,o;if(!nI(r))throw new TypeError(Qg("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!nI(e))throw new TypeError(Qg("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!vEe(t))throw new TypeError(Qg("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=oEe({},t),fEe(i,"iter")){if(!gEe(i.iter))throw new TypeError(Qg("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=aI;a=sI(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=sI(r,e),i={iter:aI,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),iI(n,"state",sEe(null),uEe),ci(n,"stateLength",null),ci(n,"byteLength",null)):(Zg(n,"seed",l),Zg(n,"seedLength",m),iI(n,"state",d,f),Zg(n,"stateLength",h),Zg(n,"byteLength",p)),ci(n,"PRNG",a.PRNG),uI&&ci(n,uI,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 oI(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}}vI.exports=oI});var dI=s(function(G$e,fI){"use strict";var dEe=gI();fI.exports=dEe});var cI=s(function(V$e,lI){"use strict";var R=require("@stdlib/utils/define-read-only-property"),N={};R(N,"arcsine",m1());R(N,"bernoulli",E1());R(N,"beta",A1());R(N,"betaprime",C1());R(N,"binomial",K1());R(N,"boxMuller",vA());R(N,"cauchy",yA());R(N,"chi",LA());R(N,"chisquare",VA());R(N,"cosine",BA());R(N,"discreteUniform",rG());R(N,"erlang",gG());R(N,"exponential",qG());R(N,"f",PG());R(N,"frechet",IG());R(N,"gamma",HG());R(N,"geometric",nV());R(N,"gumbel",lV());R(N,"hypergeometric",SV());R(N,"improvedZiggurat",MV());R(N,"invgamma",JV());R(N,"kumaraswamy",$V());R(N,"laplace",u2());R(N,"levy",h2());R(N,"logistic",_2());R(N,"lognormal",A2());R(N,"minstd",U2());R(N,"minstdShuffle",$2());R(N,"mt19937",uF());R(N,"negativeBinomial",hF());R(N,"normal",_F());R(N,"pareto1",GF());R(N,"poisson",CF());R(N,"randi",KF());R(N,"randn",vW());R(N,"randu",yW());R(N,"rayleigh",LW());R(N,"t",VW());R(N,"triangular",BW());R(N,"uniform",tI());R(N,"weibull",dI());lI.exports=N});var hI=s(function(F$e,mI){"use strict";var lEe=require("@stdlib/math/base/special/floor");function cEe(r,e,t){var i,n,a,u;for(a=r.length,n=new Array(e),u=0;u0;a--)u=hEe(t()*(a+1)),i=r[a],r[a]=r[u],r[u]=i;return pEe.call(r,0,e)}qI.exports=yEe});var SI=s(function(k$e,wI){"use strict";var qEe=require("@stdlib/math/base/special/floor");function bEe(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],!(mm(e)||hm(e)))throw new TypeError(Kg("invalid argument. `%s` argument must be array-like. Value: `%s`.","pool",e));n=ef(t,r)}if(n)throw n;return r&&r.seed?i=PI({seed:r.seed}):i=PI(),e===void 0?a=u:(RI(e)?e=e.split(""):e=TI(e),a=o),LI(a,"seed",i.seed),LI(a,"PRNG",i),i=i.normalized,a;function u(v,g){var c,l,m,h,p,d;if(!(mm(v)||hm(v)))throw new TypeError(Kg("invalid argument. First argument must be array-like. Value: `%s`.",v));if(RI(v)&&(v=v.split("")),h={},arguments.length>1&&(d=ef(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(Kg("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?LEe(v,p,i,m):NEe(v,p,i,m):c?jI(v,p,i):(l=PEe.call(v),MI(l,p,i))}function o(v){var g,c,l,m,h,p;if(e.length===0)return null;if(l={},arguments.length&&(h=ef(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(Kg("invalid option. `size` option must be less than or equal to the population size when `replace` is `false`. Option: `%s`.",m));return g?jI(e,m,i):(p=MI(e,m,i),c&&(e=e.slice(m,e.length)),p)}}xI.exports=TEe});var GI=s(function(C$e,AI){"use strict";var jEe=pm(),MEe=jEe();AI.exports=MEe});var WI=s(function(B$e,FI){"use strict";var xEe=require("@stdlib/utils/define-nonenumerable-read-only-property"),VI=GI(),AEe=pm();xEe(VI,"factory",AEe);FI.exports=VI});var II=s(function(D$e,GEe){GEe.exports={copy:"shallow"}});var JI=s(function(X$e,zI){"use strict";var VEe=require("@stdlib/assert/has-own-property"),FEe=require("@stdlib/assert/is-string").isPrimitive,WEe=require("@stdlib/assert/is-plain-object"),IEe=require("@stdlib/utils/index-of"),ym=require("@stdlib/string/format"),kI=["deep","shallow","none"];function kEe(r,e){if(!WEe(e))return new TypeError(ym("invalid argument. Options argument must be an object. Value: `%s`.",e));if(VEe(e,"copy")){if(r.copy=e.copy,!FEe(r.copy))return new TypeError(ym("invalid option. `%s` option must be a string. Option: `%s`.","copy",r.copy));if(IEe(kI,r.copy)===-1)return new TypeError(ym('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"copy",kI.join('", "'),r.copy))}return null}zI.exports=kEe});var qm=s(function(Y$e,XI){"use strict";var UI=require("@stdlib/utils/define-nonenumerable-read-only-property"),zEe=require("@stdlib/assert/is-array-like"),JEe=require("@stdlib/assert/is-typed-array-like"),UEe=require("@stdlib/assert/is-string").isPrimitive,CI=require("@stdlib/utils/copy"),CEe=require("@stdlib/math/base/special/floor"),BI=T().factory,BEe=require("@stdlib/string/format"),DEe=II(),DI=JI();function XEe(r){var e,t,i;if(e=CI(DEe),arguments.length&&(i=DI(e,r),i))throw i;return r&&r.seed?t=BI({seed:r.seed}):t=BI(),UI(n,"seed",t.seed),UI(n,"PRNG",t),t=t.normalized,n;function n(a,u){var o,v,g,c,l,m,h,p,d,f;if(!(zEe(a)||JEe(a)))throw new TypeError(BEe("invalid argument. First argument must be array-like. Value: `%s`.",a));if(arguments.length>1&&(c={},l=DI(c,u),l))throw l;for(g=c&&c.copy?c.copy:e.copy,o=UEe(a),o&&(a=a.split(""),g="none"),v=0,g==="shallow"?v+=1:g==="deep"&&(v+=2),p=a.length,m=CI(a,v),d=p-1;d>0;d--)f=CEe(t()*(d+1)),h=m[d],m[d]=m[f],m[f]=h;return o&&(m=a.join("")),m}}XI.exports=XEe});var HI=s(function(H$e,YI){"use strict";var YEe=qm(),HEe=YEe();YI.exports=HEe});var $I=s(function(Z$e,QI){"use strict";var ZEe=require("@stdlib/utils/define-nonenumerable-read-only-property"),ZI=HI(),QEe=qm();ZEe(ZI,"factory",QEe);QI.exports=ZI});var KI=s(function(Q$e,$Ee){$Ee.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var tk=s(function($$e,rk){"use strict";var KEe=require("@stdlib/assert/is-plain-object"),Ye=require("@stdlib/assert/has-own-property"),e_e=require("@stdlib/assert/is-boolean").isPrimitive,r_e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,ek=require("@stdlib/assert/is-string").isPrimitive,t_e=require("@stdlib/assert/is-positive-integer").isPrimitive,i_e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,yn=require("@stdlib/string/format");function n_e(r,e){return KEe(e)?Ye(e,"sep")&&(r.sep=e.sep,!ek(r.sep))?new TypeError(yn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Ye(e,"objectMode")&&(r.objectMode=e.objectMode,!e_e(r.objectMode))?new TypeError(yn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Ye(e,"encoding")&&(r.encoding=e.encoding,!ek(r.encoding)&&r.encoding!==null)?new TypeError(yn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Ye(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!r_e(r.highWaterMark))?new TypeError(yn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Ye(e,"iter")&&(r.iter=e.iter,!i_e(r.iter))?new TypeError(yn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Ye(e,"siter")&&(r.siter=e.siter,!t_e(r.siter))?new TypeError(yn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(Ye(e,"prng")&&(r.prng=e.prng),Ye(e,"seed")&&(r.seed=e.seed),Ye(e,"state")&&(r.state=e.state),Ye(e,"copy")&&(r.copy=e.copy),null):new TypeError(yn("invalid argument. Options argument must be an object. Value: `%s`.",e))}rk.exports=n_e});var nk=s(function(K$e,ik){"use strict";var a_e=require("debug"),s_e=a_e("random:streams:arcsine");ik.exports=s_e});var tf=s(function(eKe,gk){"use strict";var vk=require("readable-stream").Readable,ak=require("@stdlib/assert/is-number").isPrimitive,sk=require("@stdlib/math/base/assert/is-nan"),u_e=require("@stdlib/assert/is-error"),o_e=require("@stdlib/object/assign"),v_e=require("@stdlib/utils/inherit"),uk=require("@stdlib/utils/define-nonenumerable-property"),mi=require("@stdlib/utils/define-nonenumerable-read-only-property"),rf=require("@stdlib/utils/define-read-only-accessor"),g_e=require("@stdlib/utils/define-read-write-accessor"),f_e=nn().factory,ok=require("@stdlib/buffer/from-string"),d_e=require("@stdlib/utils/next-tick"),bm=require("@stdlib/string/format"),l_e=KI(),c_e=tk(),Za=nk();function m_e(){return this._prng.seed}function h_e(){return this._prng.seedLength}function p_e(){return this._prng.stateLength}function y_e(){return this._prng.byteLength}function q_e(){return this._prng.state}function b_e(r){this._prng.state=r}function w_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=ok(e):e=ok(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function S_e(r){var e;if(this._destroyed)return Za("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,d_e(t),this;function t(){r&&(Za("Stream was destroyed due to an error. Error: %s.",u_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(!ak(r)||sk(r))throw new TypeError(bm("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!ak(e)||sk(e))throw new TypeError(bm("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e));if(r>=e)throw new RangeError(bm("invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.",r,e));if(i=o_e({},l_e),arguments.length>2&&(n=c_e(i,t),n))throw n;return Za("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),vk.call(this,i),uk(this,"_destroyed",!1),mi(this,"_objectMode",i.objectMode),mi(this,"_sep",i.sep),mi(this,"_iter",i.iter),mi(this,"_siter",i.siter),uk(this,"_i",0),mi(this,"_prng",f_e(r,e,i)),mi(this,"PRNG",this._prng.PRNG),this}v_e(te,vk);rf(te.prototype,"seed",m_e);rf(te.prototype,"seedLength",h_e);g_e(te.prototype,"state",q_e,b_e);rf(te.prototype,"stateLength",p_e);rf(te.prototype,"byteLength",y_e);mi(te.prototype,"_read",w_e);mi(te.prototype,"destroy",S_e);gk.exports=te});var dk=s(function(rKe,fk){"use strict";var O_e=require("@stdlib/assert/is-plain-object"),E_e=require("@stdlib/string/format"),__e=require("@stdlib/object/assign"),N_e=tf();function L_e(r,e,t){var i;if(arguments.length>2){if(i=t,!O_e(i))throw new TypeError(E_e("invalid argument. Options argument must be an object. Value: `%s`.",i));i=__e({},t)}else i={};return i.objectMode=!0,new N_e(r,e,i)}fk.exports=L_e});var yk=s(function(tKe,pk){"use strict";var lk=require("@stdlib/assert/is-plain-object"),ck=require("@stdlib/object/assign"),mk=require("@stdlib/string/format"),hk=tf();function R_e(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!lk(r))throw new TypeError(mk("invalid argument. Options argument must be an object. Value: `%s`.",r));n=ck({},r)}else if(i>2){if(!lk(t))throw new TypeError(mk("invalid argument. Options argument must be an object. Value: `%s`.",t));n=ck({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new hk(v,g,n)}function o(){return new hk(r,e,n)}}pk.exports=R_e});var wk=s(function(iKe,bk){"use strict";var qk=require("@stdlib/utils/define-nonenumerable-read-only-property"),wm=tf(),P_e=dk(),T_e=yk();qk(wm,"objectMode",P_e);qk(wm,"factory",T_e);bk.exports=wm});var Sk=s(function(nKe,j_e){j_e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var _k=s(function(aKe,Ek){"use strict";var M_e=require("@stdlib/assert/is-plain-object"),He=require("@stdlib/assert/has-own-property"),x_e=require("@stdlib/assert/is-boolean").isPrimitive,A_e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,Ok=require("@stdlib/assert/is-string").isPrimitive,G_e=require("@stdlib/assert/is-positive-integer").isPrimitive,V_e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,qn=require("@stdlib/string/format");function F_e(r,e){return M_e(e)?He(e,"sep")&&(r.sep=e.sep,!Ok(r.sep))?new TypeError(qn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):He(e,"objectMode")&&(r.objectMode=e.objectMode,!x_e(r.objectMode))?new TypeError(qn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):He(e,"encoding")&&(r.encoding=e.encoding,!Ok(r.encoding)&&r.encoding!==null)?new TypeError(qn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):He(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!A_e(r.highWaterMark))?new TypeError(qn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):He(e,"iter")&&(r.iter=e.iter,!V_e(r.iter))?new TypeError(qn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):He(e,"siter")&&(r.siter=e.siter,!G_e(r.siter))?new TypeError(qn("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(qn("invalid argument. Options argument must be an object. Value: `%s`.",e))}Ek.exports=F_e});var Lk=s(function(sKe,Nk){"use strict";var W_e=require("debug"),I_e=W_e("random:streams:bernoulli");Nk.exports=I_e});var af=s(function(uKe,jk){"use strict";var Tk=require("readable-stream").Readable,k_e=require("@stdlib/assert/is-probability").isPrimitive,z_e=require("@stdlib/assert/is-error"),J_e=require("@stdlib/object/assign"),U_e=require("@stdlib/utils/inherit"),Rk=require("@stdlib/utils/define-nonenumerable-property"),hi=require("@stdlib/utils/define-nonenumerable-read-only-property"),nf=require("@stdlib/utils/define-read-only-accessor"),C_e=require("@stdlib/utils/define-read-write-accessor"),B_e=va().factory,Pk=require("@stdlib/buffer/from-string"),D_e=require("@stdlib/utils/next-tick"),X_e=require("@stdlib/string/format"),Y_e=Sk(),H_e=_k(),Qa=Lk();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=Pk(e):e=Pk(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,D_e(t),this;function t(){r&&(Qa("Stream was destroyed due to an error. Error: %s.",z_e(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(!k_e(r))throw new TypeError(X_e("invalid argument. First argument must be a probability. Value: `%s`.",r));if(t=J_e({},Y_e),arguments.length>1&&(i=H_e(t,e),i))throw i;return Qa("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),Tk.call(this,t),Rk(this,"_destroyed",!1),hi(this,"_objectMode",t.objectMode),hi(this,"_sep",t.sep),hi(this,"_iter",t.iter),hi(this,"_siter",t.siter),Rk(this,"_i",0),hi(this,"_prng",B_e(r,t)),hi(this,"PRNG",this._prng.PRNG),this}U_e(ie,Tk);nf(ie.prototype,"seed",Z_e);nf(ie.prototype,"seedLength",Q_e);C_e(ie.prototype,"state",eNe,rNe);nf(ie.prototype,"stateLength",$_e);nf(ie.prototype,"byteLength",K_e);hi(ie.prototype,"_read",tNe);hi(ie.prototype,"destroy",iNe);jk.exports=ie});var xk=s(function(oKe,Mk){"use strict";var nNe=require("@stdlib/assert/is-plain-object"),aNe=require("@stdlib/string/format"),sNe=require("@stdlib/object/assign"),uNe=af();function oNe(r,e){var t;if(arguments.length>1){if(t=e,!nNe(t))throw new TypeError(aNe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=sNe({},e)}else t={};return t.objectMode=!0,new uNe(r,t)}Mk.exports=oNe});var Ik=s(function(vKe,Wk){"use strict";var Ak=require("@stdlib/assert/is-plain-object"),vNe=require("@stdlib/assert/is-probability").isPrimitive,Gk=require("@stdlib/string/format"),Vk=require("@stdlib/object/assign"),Fk=af();function gNe(r,e){var t,i,n;if(t=arguments.length,t>1){if(!Ak(e))throw new TypeError(Gk("invalid argument. Options argument must be an object. Value: `%s`.",e));n=u,i=Vk({},e)}else if(t===1)if(vNe(r))n=u,i={};else{if(!Ak(r))throw new TypeError(Gk("invalid argument. Options argument must be an object. Value: `%s`.",r));i=Vk({},r),n=a}else i={},n=a;return n;function a(o){return new Fk(o,i)}function u(){return new Fk(r,i)}}Wk.exports=gNe});var Jk=s(function(gKe,zk){"use strict";var kk=require("@stdlib/utils/define-nonenumerable-read-only-property"),Sm=af(),fNe=xk(),dNe=Ik();kk(Sm,"objectMode",fNe);kk(Sm,"factory",dNe);zk.exports=Sm});var Uk=s(function(fKe,lNe){lNe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var Dk=s(function(dKe,Bk){"use strict";var cNe=require("@stdlib/assert/is-plain-object"),Ze=require("@stdlib/assert/has-own-property"),mNe=require("@stdlib/assert/is-boolean").isPrimitive,hNe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,Ck=require("@stdlib/assert/is-string").isPrimitive,pNe=require("@stdlib/assert/is-positive-integer").isPrimitive,yNe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,bn=require("@stdlib/string/format");function qNe(r,e){return cNe(e)?Ze(e,"sep")&&(r.sep=e.sep,!Ck(r.sep))?new TypeError(bn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Ze(e,"objectMode")&&(r.objectMode=e.objectMode,!mNe(r.objectMode))?new TypeError(bn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Ze(e,"encoding")&&(r.encoding=e.encoding,!Ck(r.encoding)&&r.encoding!==null)?new TypeError(bn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Ze(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!hNe(r.highWaterMark))?new TypeError(bn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Ze(e,"iter")&&(r.iter=e.iter,!yNe(r.iter))?new TypeError(bn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Ze(e,"siter")&&(r.siter=e.siter,!pNe(r.siter))?new TypeError(bn("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(bn("invalid argument. Options argument must be an object. Value: `%s`.",e))}Bk.exports=qNe});var Yk=s(function(lKe,Xk){"use strict";var bNe=require("debug"),wNe=bNe("random:streams:beta");Xk.exports=wNe});var uf=s(function(cKe,ez){"use strict";var Kk=require("readable-stream").Readable,Hk=require("@stdlib/assert/is-positive-number").isPrimitive,SNe=require("@stdlib/assert/is-error"),ONe=require("@stdlib/object/assign"),ENe=require("@stdlib/utils/inherit"),Zk=require("@stdlib/utils/define-nonenumerable-property"),pi=require("@stdlib/utils/define-nonenumerable-read-only-property"),sf=require("@stdlib/utils/define-read-only-accessor"),_Ne=require("@stdlib/utils/define-read-write-accessor"),NNe=sn().factory,Qk=require("@stdlib/buffer/from-string"),LNe=require("@stdlib/utils/next-tick"),$k=require("@stdlib/string/format"),RNe=Uk(),PNe=Dk(),$a=Yk();function TNe(){return this._prng.seed}function jNe(){return this._prng.seedLength}function MNe(){return this._prng.stateLength}function xNe(){return this._prng.byteLength}function ANe(){return this._prng.state}function GNe(r){this._prng.state=r}function VNe(){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=Qk(e):e=Qk(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function FNe(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 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(!Hk(r))throw new TypeError($k("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!Hk(e))throw new TypeError($k("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=ONe({},RNe),arguments.length>2&&(n=PNe(i,t),n))throw n;return $a("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),Kk.call(this,i),Zk(this,"_destroyed",!1),pi(this,"_objectMode",i.objectMode),pi(this,"_sep",i.sep),pi(this,"_iter",i.iter),pi(this,"_siter",i.siter),Zk(this,"_i",0),pi(this,"_prng",NNe(r,e,i)),pi(this,"PRNG",this._prng.PRNG),this}ENe(ne,Kk);sf(ne.prototype,"seed",TNe);sf(ne.prototype,"seedLength",jNe);_Ne(ne.prototype,"state",ANe,GNe);sf(ne.prototype,"stateLength",MNe);sf(ne.prototype,"byteLength",xNe);pi(ne.prototype,"_read",VNe);pi(ne.prototype,"destroy",FNe);ez.exports=ne});var tz=s(function(mKe,rz){"use strict";var WNe=require("@stdlib/assert/is-plain-object"),INe=require("@stdlib/string/format"),kNe=require("@stdlib/object/assign"),zNe=uf();function JNe(r,e,t){var i;if(arguments.length>2){if(i=t,!WNe(i))throw new TypeError(INe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=kNe({},t)}else i={};return i.objectMode=!0,new zNe(r,e,i)}rz.exports=JNe});var oz=s(function(hKe,uz){"use strict";var iz=require("@stdlib/assert/is-plain-object"),nz=require("@stdlib/object/assign"),az=require("@stdlib/string/format"),sz=uf();function UNe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!iz(r))throw new TypeError(az("invalid argument. Options argument must be an object. Value: `%s`.",r));n=nz({},r)}else if(i>2){if(!iz(t))throw new TypeError(az("invalid argument. Options argument must be an object. Value: `%s`.",t));n=nz({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new sz(v,g,n)}function o(){return new sz(r,e,n)}}uz.exports=UNe});var fz=s(function(pKe,gz){"use strict";var vz=require("@stdlib/utils/define-nonenumerable-read-only-property"),Om=uf(),CNe=tz(),BNe=oz();vz(Om,"objectMode",CNe);vz(Om,"factory",BNe);gz.exports=Om});var dz=s(function(yKe,DNe){DNe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var mz=s(function(qKe,cz){"use strict";var XNe=require("@stdlib/assert/is-plain-object"),Qe=require("@stdlib/assert/has-own-property"),YNe=require("@stdlib/assert/is-boolean").isPrimitive,HNe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,lz=require("@stdlib/assert/is-string").isPrimitive,ZNe=require("@stdlib/assert/is-positive-integer").isPrimitive,QNe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,wn=require("@stdlib/string/format");function $Ne(r,e){return XNe(e)?Qe(e,"sep")&&(r.sep=e.sep,!lz(r.sep))?new TypeError(wn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Qe(e,"objectMode")&&(r.objectMode=e.objectMode,!YNe(r.objectMode))?new TypeError(wn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Qe(e,"encoding")&&(r.encoding=e.encoding,!lz(r.encoding)&&r.encoding!==null)?new TypeError(wn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Qe(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!HNe(r.highWaterMark))?new TypeError(wn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Qe(e,"iter")&&(r.iter=e.iter,!QNe(r.iter))?new TypeError(wn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Qe(e,"siter")&&(r.siter=e.siter,!ZNe(r.siter))?new TypeError(wn("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(wn("invalid argument. Options argument must be an object. Value: `%s`.",e))}cz.exports=$Ne});var pz=s(function(bKe,hz){"use strict";var KNe=require("debug"),eLe=KNe("random:streams:betaprime");hz.exports=eLe});var vf=s(function(wKe,Oz){"use strict";var Sz=require("readable-stream").Readable,yz=require("@stdlib/assert/is-positive-number").isPrimitive,rLe=require("@stdlib/assert/is-error"),tLe=require("@stdlib/object/assign"),iLe=require("@stdlib/utils/inherit"),qz=require("@stdlib/utils/define-nonenumerable-property"),yi=require("@stdlib/utils/define-nonenumerable-read-only-property"),of=require("@stdlib/utils/define-read-only-accessor"),nLe=require("@stdlib/utils/define-read-write-accessor"),aLe=un().factory,bz=require("@stdlib/buffer/from-string"),sLe=require("@stdlib/utils/next-tick"),wz=require("@stdlib/string/format"),uLe=dz(),oLe=mz(),Ka=pz();function vLe(){return this._prng.seed}function gLe(){return this._prng.seedLength}function fLe(){return this._prng.stateLength}function dLe(){return this._prng.byteLength}function lLe(){return this._prng.state}function cLe(r){this._prng.state=r}function mLe(){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=bz(e):e=bz(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function hLe(r){var e;if(this._destroyed)return Ka("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,sLe(t),this;function t(){r&&(Ka("Stream was destroyed due to an error. Error: %s.",rLe(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(!yz(r))throw new TypeError(wz("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!yz(e))throw new TypeError(wz("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=tLe({},uLe),arguments.length>2&&(n=oLe(i,t),n))throw n;return Ka("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),Sz.call(this,i),qz(this,"_destroyed",!1),yi(this,"_objectMode",i.objectMode),yi(this,"_sep",i.sep),yi(this,"_iter",i.iter),yi(this,"_siter",i.siter),qz(this,"_i",0),yi(this,"_prng",aLe(r,e,i)),yi(this,"PRNG",this._prng.PRNG),this}iLe(ae,Sz);of(ae.prototype,"seed",vLe);of(ae.prototype,"seedLength",gLe);nLe(ae.prototype,"state",lLe,cLe);of(ae.prototype,"stateLength",fLe);of(ae.prototype,"byteLength",dLe);yi(ae.prototype,"_read",mLe);yi(ae.prototype,"destroy",hLe);Oz.exports=ae});var _z=s(function(SKe,Ez){"use strict";var pLe=require("@stdlib/assert/is-plain-object"),yLe=require("@stdlib/string/format"),qLe=require("@stdlib/object/assign"),bLe=vf();function wLe(r,e,t){var i;if(arguments.length>2){if(i=t,!pLe(i))throw new TypeError(yLe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=qLe({},t)}else i={};return i.objectMode=!0,new bLe(r,e,i)}Ez.exports=wLe});var jz=s(function(OKe,Tz){"use strict";var Nz=require("@stdlib/assert/is-plain-object"),Lz=require("@stdlib/object/assign"),Rz=require("@stdlib/string/format"),Pz=vf();function SLe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!Nz(r))throw new TypeError(Rz("invalid argument. Options argument must be an object. Value: `%s`.",r));n=Lz({},r)}else if(i>2){if(!Nz(t))throw new TypeError(Rz("invalid argument. Options argument must be an object. Value: `%s`.",t));n=Lz({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new Pz(v,g,n)}function o(){return new Pz(r,e,n)}}Tz.exports=SLe});var Az=s(function(EKe,xz){"use strict";var Mz=require("@stdlib/utils/define-nonenumerable-read-only-property"),Em=vf(),OLe=_z(),ELe=jz();Mz(Em,"objectMode",OLe);Mz(Em,"factory",ELe);xz.exports=Em});var Gz=s(function(_Ke,_Le){_Le.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var Wz=s(function(NKe,Fz){"use strict";var NLe=require("@stdlib/assert/is-plain-object"),$e=require("@stdlib/assert/has-own-property"),LLe=require("@stdlib/assert/is-boolean").isPrimitive,RLe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,Vz=require("@stdlib/assert/is-string").isPrimitive,PLe=require("@stdlib/assert/is-positive-integer").isPrimitive,TLe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Sn=require("@stdlib/string/format");function jLe(r,e){return NLe(e)?$e(e,"sep")&&(r.sep=e.sep,!Vz(r.sep))?new TypeError(Sn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):$e(e,"objectMode")&&(r.objectMode=e.objectMode,!LLe(r.objectMode))?new TypeError(Sn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):$e(e,"encoding")&&(r.encoding=e.encoding,!Vz(r.encoding)&&r.encoding!==null)?new TypeError(Sn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):$e(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!RLe(r.highWaterMark))?new TypeError(Sn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):$e(e,"iter")&&(r.iter=e.iter,!TLe(r.iter))?new TypeError(Sn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):$e(e,"siter")&&(r.siter=e.siter,!PLe(r.siter))?new TypeError(Sn("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(Sn("invalid argument. Options argument must be an object. Value: `%s`.",e))}Fz.exports=jLe});var kz=s(function(LKe,Iz){"use strict";var MLe=require("debug"),xLe=MLe("random:streams:binomial");Iz.exports=xLe});var ff=s(function(RKe,Bz){"use strict";var Cz=require("readable-stream").Readable,ALe=require("@stdlib/assert/is-positive-integer").isPrimitive,GLe=require("@stdlib/assert/is-probability").isPrimitive,VLe=require("@stdlib/assert/is-error"),FLe=require("@stdlib/object/assign"),WLe=require("@stdlib/utils/inherit"),zz=require("@stdlib/utils/define-nonenumerable-property"),qi=require("@stdlib/utils/define-nonenumerable-read-only-property"),gf=require("@stdlib/utils/define-read-only-accessor"),ILe=require("@stdlib/utils/define-read-write-accessor"),kLe=da().factory,Jz=require("@stdlib/buffer/from-string"),zLe=require("@stdlib/utils/next-tick"),Uz=require("@stdlib/string/format"),JLe=Gz(),ULe=Wz(),es=kz();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=Jz(e):e=Jz(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 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(!ALe(r))throw new TypeError(Uz("invalid argument. First argument must be a positive integer. Value: `%s`.",r));if(!GLe(e))throw new TypeError(Uz("invalid argument. Second argument must be a probability. 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)),Cz.call(this,i),zz(this,"_destroyed",!1),qi(this,"_objectMode",i.objectMode),qi(this,"_sep",i.sep),qi(this,"_iter",i.iter),qi(this,"_siter",i.siter),zz(this,"_i",0),qi(this,"_prng",kLe(r,e,i)),qi(this,"PRNG",this._prng.PRNG),this}WLe(se,Cz);gf(se.prototype,"seed",CLe);gf(se.prototype,"seedLength",BLe);ILe(se.prototype,"state",YLe,HLe);gf(se.prototype,"stateLength",DLe);gf(se.prototype,"byteLength",XLe);qi(se.prototype,"_read",ZLe);qi(se.prototype,"destroy",QLe);Bz.exports=se});var Xz=s(function(PKe,Dz){"use strict";var $Le=require("@stdlib/assert/is-plain-object"),KLe=require("@stdlib/object/assign"),eRe=require("@stdlib/string/format"),rRe=ff();function tRe(r,e,t){var i;if(arguments.length>2){if(i=t,!$Le(i))throw new TypeError(eRe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=KLe({},t)}else i={};return i.objectMode=!0,new rRe(r,e,i)}Dz.exports=tRe});var Kz=s(function(TKe,$z){"use strict";var Yz=require("@stdlib/assert/is-plain-object"),Hz=require("@stdlib/object/assign"),Zz=require("@stdlib/string/format"),Qz=ff();function iRe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!Yz(r))throw new TypeError(Zz("invalid argument. Options argument must be an object. Value: `%s`.",r));n=Hz({},r)}else if(i>2){if(!Yz(t))throw new TypeError(Zz("invalid argument. Options argument must be an object. Value: `%s`.",t));n=Hz({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new Qz(v,g,n)}function o(){return new Qz(r,e,n)}}$z.exports=iRe});var t3=s(function(jKe,r3){"use strict";var e3=require("@stdlib/utils/define-nonenumerable-read-only-property"),_m=ff(),nRe=Xz(),aRe=Kz();e3(_m,"objectMode",nRe);e3(_m,"factory",aRe);r3.exports=_m});var i3=s(function(MKe,sRe){sRe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var s3=s(function(xKe,a3){"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,n3=require("@stdlib/assert/is-string").isPrimitive,gRe=require("@stdlib/assert/is-positive-integer").isPrimitive,fRe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,On=require("@stdlib/string/format");function dRe(r,e){return uRe(e)?Ke(e,"sep")&&(r.sep=e.sep,!n3(r.sep))?new TypeError(On("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(On("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Ke(e,"encoding")&&(r.encoding=e.encoding,!n3(r.encoding)&&r.encoding!==null)?new TypeError(On("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(On("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(On("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(On("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(On("invalid argument. Options argument must be an object. Value: `%s`.",e))}a3.exports=dRe});var o3=s(function(AKe,u3){"use strict";var lRe=require("debug"),cRe=lRe("random:streams:box-muller");u3.exports=cRe});var lf=s(function(GKe,d3){"use strict";var f3=require("readable-stream").Readable,mRe=require("@stdlib/assert/is-error"),hRe=require("@stdlib/object/assign"),pRe=require("@stdlib/utils/inherit"),v3=require("@stdlib/utils/define-nonenumerable-property"),bi=require("@stdlib/utils/define-nonenumerable-read-only-property"),df=require("@stdlib/utils/define-read-only-accessor"),yRe=require("@stdlib/utils/define-read-write-accessor"),qRe=Xa().factory,g3=require("@stdlib/buffer/from-string"),bRe=require("@stdlib/utils/next-tick"),wRe=i3(),SRe=s3(),rs=o3();function ORe(){return this._prng.seed}function ERe(){return this._prng.seedLength}function _Re(){return this._prng.stateLength}function NRe(){return this._prng.byteLength}function LRe(){return this._prng.state}function RRe(r){this._prng.state=r}function PRe(){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=g3(e):e=g3(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function TRe(r){var e;if(this._destroyed)return rs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,bRe(t),this;function t(){r&&(rs("Stream was destroyed due to an error. Error: %s.",mRe(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=hRe({},wRe),arguments.length>0&&(t=SRe(e,r),t))throw t;return rs("Creating a readable stream configured with the following options: %s.",JSON.stringify(e)),f3.call(this,e),v3(this,"_destroyed",!1),bi(this,"_objectMode",e.objectMode),bi(this,"_sep",e.sep),bi(this,"_iter",e.iter),bi(this,"_siter",e.siter),v3(this,"_i",0),bi(this,"_prng",qRe(e)),bi(this,"PRNG",this._prng.PRNG),this}pRe(ue,f3);df(ue.prototype,"seed",ORe);df(ue.prototype,"seedLength",ERe);yRe(ue.prototype,"state",LRe,RRe);df(ue.prototype,"stateLength",_Re);df(ue.prototype,"byteLength",NRe);bi(ue.prototype,"_read",PRe);bi(ue.prototype,"destroy",TRe);d3.exports=ue});var c3=s(function(VKe,l3){"use strict";var jRe=require("@stdlib/assert/is-plain-object"),MRe=require("@stdlib/object/assign"),xRe=require("@stdlib/string/format"),ARe=lf();function GRe(r){var e;if(arguments.length>0){if(e=r,!jRe(e))throw new TypeError(xRe("invalid argument. Options argument must be an object. Value: `%s`.",e));e=MRe({},r)}else e={};return e.objectMode=!0,new ARe(e)}l3.exports=GRe});var h3=s(function(FKe,m3){"use strict";var VRe=require("@stdlib/assert/is-plain-object"),FRe=require("@stdlib/object/assign"),WRe=require("@stdlib/string/format"),IRe=lf();function kRe(r){var e;if(arguments.length>0){if(!VRe(r))throw new TypeError(WRe("invalid argument. Options argument must be an object. Value: `%s`.",r));e=FRe({},r)}else e={};return t;function t(){return new IRe(e)}}m3.exports=kRe});var q3=s(function(WKe,y3){"use strict";var p3=require("@stdlib/utils/define-nonenumerable-read-only-property"),Nm=lf(),zRe=c3(),JRe=h3();p3(Nm,"objectMode",zRe);p3(Nm,"factory",JRe);y3.exports=Nm});var b3=s(function(IKe,URe){URe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var O3=s(function(kKe,S3){"use strict";var CRe=require("@stdlib/assert/is-plain-object"),er=require("@stdlib/assert/has-own-property"),BRe=require("@stdlib/assert/is-boolean").isPrimitive,DRe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,w3=require("@stdlib/assert/is-string").isPrimitive,XRe=require("@stdlib/assert/is-positive-integer").isPrimitive,YRe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,En=require("@stdlib/string/format");function HRe(r,e){return CRe(e)?er(e,"sep")&&(r.sep=e.sep,!w3(r.sep))?new TypeError(En("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):er(e,"objectMode")&&(r.objectMode=e.objectMode,!BRe(r.objectMode))?new TypeError(En("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):er(e,"encoding")&&(r.encoding=e.encoding,!w3(r.encoding)&&r.encoding!==null)?new TypeError(En("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):er(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!DRe(r.highWaterMark))?new TypeError(En("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):er(e,"iter")&&(r.iter=e.iter,!YRe(r.iter))?new TypeError(En("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):er(e,"siter")&&(r.siter=e.siter,!XRe(r.siter))?new TypeError(En("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(En("invalid argument. Options argument must be an object. Value: `%s`.",e))}S3.exports=HRe});var _3=s(function(zKe,E3){"use strict";var ZRe=require("debug"),QRe=ZRe("random:streams:cauchy");E3.exports=QRe});var mf=s(function(JKe,T3){"use strict";var P3=require("readable-stream").Readable,$Re=require("@stdlib/assert/is-positive-number").isPrimitive,KRe=require("@stdlib/assert/is-number").isPrimitive,ePe=require("@stdlib/math/base/assert/is-nan"),rPe=require("@stdlib/assert/is-error"),tPe=require("@stdlib/object/assign"),iPe=require("@stdlib/utils/inherit"),N3=require("@stdlib/utils/define-nonenumerable-property"),wi=require("@stdlib/utils/define-nonenumerable-read-only-property"),cf=require("@stdlib/utils/define-read-only-accessor"),nPe=require("@stdlib/utils/define-read-write-accessor"),aPe=ca().factory,L3=require("@stdlib/buffer/from-string"),sPe=require("@stdlib/utils/next-tick"),R3=require("@stdlib/string/format"),uPe=b3(),oPe=O3(),ts=_3();function vPe(){return this._prng.seed}function gPe(){return this._prng.seedLength}function fPe(){return this._prng.stateLength}function dPe(){return this._prng.byteLength}function lPe(){return this._prng.state}function cPe(r){this._prng.state=r}function mPe(){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=L3(e):e=L3(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function hPe(r){var e;if(this._destroyed)return ts("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,sPe(t),this;function t(){r&&(ts("Stream was destroyed due to an error. Error: %s.",rPe(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(!KRe(r)||ePe(r))throw new TypeError(R3("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!$Re(e))throw new TypeError(R3("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=tPe({},uPe),arguments.length>2&&(n=oPe(i,t),n))throw n;return ts("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),P3.call(this,i),N3(this,"_destroyed",!1),wi(this,"_objectMode",i.objectMode),wi(this,"_sep",i.sep),wi(this,"_iter",i.iter),wi(this,"_siter",i.siter),N3(this,"_i",0),wi(this,"_prng",aPe(r,e,i)),wi(this,"PRNG",this._prng.PRNG),this}iPe(oe,P3);cf(oe.prototype,"seed",vPe);cf(oe.prototype,"seedLength",gPe);nPe(oe.prototype,"state",lPe,cPe);cf(oe.prototype,"stateLength",fPe);cf(oe.prototype,"byteLength",dPe);wi(oe.prototype,"_read",mPe);wi(oe.prototype,"destroy",hPe);T3.exports=oe});var M3=s(function(UKe,j3){"use strict";var pPe=require("@stdlib/assert/is-plain-object"),yPe=require("@stdlib/object/assign"),qPe=require("@stdlib/string/format"),bPe=mf();function wPe(r,e,t){var i;if(arguments.length>2){if(i=t,!pPe(i))throw new TypeError(qPe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=yPe({},t)}else i={};return i.objectMode=!0,new bPe(r,e,i)}j3.exports=wPe});var W3=s(function(CKe,F3){"use strict";var x3=require("@stdlib/assert/is-plain-object"),A3=require("@stdlib/object/assign"),G3=require("@stdlib/string/format"),V3=mf();function SPe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!x3(r))throw new TypeError(G3("invalid argument. Options argument must be an object. Value: `%s`.",r));n=A3({},r)}else if(i>2){if(!x3(t))throw new TypeError(G3("invalid argument. Options argument must be an object. Value: `%s`.",t));n=A3({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new V3(v,g,n)}function o(){return new V3(r,e,n)}}F3.exports=SPe});var z3=s(function(BKe,k3){"use strict";var I3=require("@stdlib/utils/define-nonenumerable-read-only-property"),Lm=mf(),OPe=M3(),EPe=W3();I3(Lm,"objectMode",OPe);I3(Lm,"factory",EPe);k3.exports=Lm});var J3=s(function(DKe,_Pe){_Pe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var B3=s(function(XKe,C3){"use strict";var NPe=require("@stdlib/assert/is-plain-object"),rr=require("@stdlib/assert/has-own-property"),LPe=require("@stdlib/assert/is-boolean").isPrimitive,RPe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,U3=require("@stdlib/assert/is-string").isPrimitive,PPe=require("@stdlib/assert/is-positive-integer").isPrimitive,TPe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,_n=require("@stdlib/string/format");function jPe(r,e){return NPe(e)?rr(e,"sep")&&(r.sep=e.sep,!U3(r.sep))?new TypeError(_n("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):rr(e,"objectMode")&&(r.objectMode=e.objectMode,!LPe(r.objectMode))?new TypeError(_n("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):rr(e,"encoding")&&(r.encoding=e.encoding,!U3(r.encoding)&&r.encoding!==null)?new TypeError(_n("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):rr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!RPe(r.highWaterMark))?new TypeError(_n("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):rr(e,"iter")&&(r.iter=e.iter,!TPe(r.iter))?new TypeError(_n("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):rr(e,"siter")&&(r.siter=e.siter,!PPe(r.siter))?new TypeError(_n("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(_n("invalid argument. Options argument must be an object. Value: `%s`.",e))}C3.exports=jPe});var X3=s(function(YKe,D3){"use strict";var MPe=require("debug"),xPe=MPe("random:streams:chi");D3.exports=xPe});var pf=s(function(HKe,Q3){"use strict";var Z3=require("readable-stream").Readable,APe=require("@stdlib/assert/is-positive-number").isPrimitive,GPe=require("@stdlib/assert/is-error"),VPe=require("@stdlib/object/assign"),FPe=require("@stdlib/utils/inherit"),Y3=require("@stdlib/utils/define-nonenumerable-property"),Si=require("@stdlib/utils/define-nonenumerable-read-only-property"),hf=require("@stdlib/utils/define-read-only-accessor"),WPe=require("@stdlib/utils/define-read-write-accessor"),IPe=pa().factory,H3=require("@stdlib/buffer/from-string"),kPe=require("@stdlib/utils/next-tick"),zPe=require("@stdlib/string/format"),JPe=J3(),UPe=B3(),is=X3();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=H3(e):e=H3(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,kPe(t),this;function t(){r&&(is("Stream was destroyed due to an error. Error: %s.",GPe(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(!APe(r))throw new TypeError(zPe("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(t=VPe({},JPe),arguments.length>1&&(i=UPe(t,e),i))throw i;return is("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),Z3.call(this,t),Y3(this,"_destroyed",!1),Si(this,"_objectMode",t.objectMode),Si(this,"_sep",t.sep),Si(this,"_iter",t.iter),Si(this,"_siter",t.siter),Y3(this,"_i",0),Si(this,"_prng",IPe(r,t)),Si(this,"PRNG",this._prng.PRNG),this}FPe(ve,Z3);hf(ve.prototype,"seed",CPe);hf(ve.prototype,"seedLength",BPe);WPe(ve.prototype,"state",YPe,HPe);hf(ve.prototype,"stateLength",DPe);hf(ve.prototype,"byteLength",XPe);Si(ve.prototype,"_read",ZPe);Si(ve.prototype,"destroy",QPe);Q3.exports=ve});var K3=s(function(ZKe,$3){"use strict";var $Pe=require("@stdlib/assert/is-plain-object"),KPe=require("@stdlib/object/assign"),eTe=require("@stdlib/string/format"),rTe=pf();function tTe(r,e){var t;if(arguments.length>1){if(t=e,!$Pe(t))throw new TypeError(eTe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=KPe({},e)}else t={};return t.objectMode=!0,new rTe(r,t)}$3.exports=tTe});var aJ=s(function(QKe,nJ){"use strict";var eJ=require("@stdlib/assert/is-plain-object"),iTe=require("@stdlib/assert/is-positive-number").isPrimitive,rJ=require("@stdlib/object/assign"),tJ=require("@stdlib/string/format"),iJ=pf();function nTe(r,e){var t,i,n;if(t=arguments.length,t>1){if(!eJ(e))throw new TypeError(tJ("invalid argument. Options argument must be an object. Value: `%s`.",e));n=u,i=rJ({},e)}else if(t===1)if(iTe(r))n=u,i={};else{if(!eJ(r))throw new TypeError(tJ("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 iJ(o,i)}function u(){return new iJ(r,i)}}nJ.exports=nTe});var oJ=s(function($Ke,uJ){"use strict";var sJ=require("@stdlib/utils/define-nonenumerable-read-only-property"),Rm=pf(),aTe=K3(),sTe=aJ();sJ(Rm,"objectMode",aTe);sJ(Rm,"factory",sTe);uJ.exports=Rm});var vJ=s(function(KKe,uTe){uTe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var dJ=s(function(eer,fJ){"use strict";var oTe=require("@stdlib/assert/is-plain-object"),tr=require("@stdlib/assert/has-own-property"),vTe=require("@stdlib/assert/is-boolean").isPrimitive,gTe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,gJ=require("@stdlib/assert/is-string").isPrimitive,fTe=require("@stdlib/assert/is-positive-integer").isPrimitive,dTe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Nn=require("@stdlib/string/format");function lTe(r,e){return oTe(e)?tr(e,"sep")&&(r.sep=e.sep,!gJ(r.sep))?new TypeError(Nn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):tr(e,"objectMode")&&(r.objectMode=e.objectMode,!vTe(r.objectMode))?new TypeError(Nn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):tr(e,"encoding")&&(r.encoding=e.encoding,!gJ(r.encoding)&&r.encoding!==null)?new TypeError(Nn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):tr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!gTe(r.highWaterMark))?new TypeError(Nn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):tr(e,"iter")&&(r.iter=e.iter,!dTe(r.iter))?new TypeError(Nn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):tr(e,"siter")&&(r.siter=e.siter,!fTe(r.siter))?new TypeError(Nn("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(Nn("invalid argument. Options argument must be an object. Value: `%s`.",e))}fJ.exports=lTe});var cJ=s(function(rer,lJ){"use strict";var cTe=require("debug"),mTe=cTe("random:streams:chisquare");lJ.exports=mTe});var qf=s(function(ter,yJ){"use strict";var pJ=require("readable-stream").Readable,hTe=require("@stdlib/assert/is-positive-number").isPrimitive,pTe=require("@stdlib/assert/is-error"),yTe=require("@stdlib/object/assign"),qTe=require("@stdlib/utils/inherit"),mJ=require("@stdlib/utils/define-nonenumerable-property"),Oi=require("@stdlib/utils/define-nonenumerable-read-only-property"),yf=require("@stdlib/utils/define-read-only-accessor"),bTe=require("@stdlib/utils/define-read-write-accessor"),wTe=Ur().factory,hJ=require("@stdlib/buffer/from-string"),STe=require("@stdlib/utils/next-tick"),OTe=require("@stdlib/string/format"),ETe=vJ(),_Te=dJ(),ns=cJ();function NTe(){return this._prng.seed}function LTe(){return this._prng.seedLength}function RTe(){return this._prng.stateLength}function PTe(){return this._prng.byteLength}function TTe(){return this._prng.state}function jTe(r){this._prng.state=r}function MTe(){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=hJ(e):e=hJ(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function xTe(r){var e;if(this._destroyed)return ns("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,STe(t),this;function t(){r&&(ns("Stream was destroyed due to an error. Error: %s.",pTe(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(!hTe(r))throw new TypeError(OTe("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(t=yTe({},ETe),arguments.length>1&&(i=_Te(t,e),i))throw i;return ns("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),pJ.call(this,t),mJ(this,"_destroyed",!1),Oi(this,"_objectMode",t.objectMode),Oi(this,"_sep",t.sep),Oi(this,"_iter",t.iter),Oi(this,"_siter",t.siter),mJ(this,"_i",0),Oi(this,"_prng",wTe(r,t)),Oi(this,"PRNG",this._prng.PRNG),this}qTe(ge,pJ);yf(ge.prototype,"seed",NTe);yf(ge.prototype,"seedLength",LTe);bTe(ge.prototype,"state",TTe,jTe);yf(ge.prototype,"stateLength",RTe);yf(ge.prototype,"byteLength",PTe);Oi(ge.prototype,"_read",MTe);Oi(ge.prototype,"destroy",xTe);yJ.exports=ge});var bJ=s(function(ier,qJ){"use strict";var ATe=require("@stdlib/assert/is-plain-object"),GTe=require("@stdlib/object/assign"),VTe=require("@stdlib/string/format"),FTe=qf();function WTe(r,e){var t;if(arguments.length>1){if(t=e,!ATe(t))throw new TypeError(VTe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=GTe({},t)}else t={};return t.objectMode=!0,new FTe(r,t)}qJ.exports=WTe});var NJ=s(function(ner,_J){"use strict";var ITe=require("@stdlib/assert/is-positive-number").isPrimitive,wJ=require("@stdlib/assert/is-plain-object"),SJ=require("@stdlib/object/assign"),OJ=require("@stdlib/string/format"),EJ=qf();function kTe(r,e){var t,i,n;if(t=arguments.length,t>1){if(!wJ(e))throw new TypeError(OJ("invalid argument. Options argument must be an object. Value: `%s`.",e));n=u,i=SJ({},e)}else if(t===1)if(ITe(r))n=u,i={};else{if(!wJ(r))throw new TypeError(OJ("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 EJ(o,i)}function u(){return new EJ(r,i)}}_J.exports=kTe});var PJ=s(function(aer,RJ){"use strict";var LJ=require("@stdlib/utils/define-nonenumerable-read-only-property"),Pm=qf(),zTe=bJ(),JTe=NJ();LJ(Pm,"objectMode",zTe);LJ(Pm,"factory",JTe);RJ.exports=Pm});var TJ=s(function(ser,UTe){UTe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var xJ=s(function(uer,MJ){"use strict";var CTe=require("@stdlib/assert/is-plain-object"),ir=require("@stdlib/assert/has-own-property"),BTe=require("@stdlib/assert/is-boolean").isPrimitive,DTe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,jJ=require("@stdlib/assert/is-string").isPrimitive,XTe=require("@stdlib/assert/is-positive-integer").isPrimitive,YTe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Ln=require("@stdlib/string/format");function HTe(r,e){return CTe(e)?ir(e,"sep")&&(r.sep=e.sep,!jJ(r.sep))?new TypeError(Ln("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):ir(e,"objectMode")&&(r.objectMode=e.objectMode,!BTe(r.objectMode))?new TypeError(Ln("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):ir(e,"encoding")&&(r.encoding=e.encoding,!jJ(r.encoding)&&r.encoding!==null)?new TypeError(Ln("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):ir(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!DTe(r.highWaterMark))?new TypeError(Ln("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):ir(e,"iter")&&(r.iter=e.iter,!YTe(r.iter))?new TypeError(Ln("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):ir(e,"siter")&&(r.siter=e.siter,!XTe(r.siter))?new TypeError(Ln("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(Ln("invalid argument. Options argument must be an object. Value: `%s`.",e))}MJ.exports=HTe});var GJ=s(function(oer,AJ){"use strict";var ZTe=require("debug"),QTe=ZTe("random:streams:cosine");AJ.exports=QTe});var wf=s(function(ver,kJ){"use strict";var IJ=require("readable-stream").Readable,$Te=require("@stdlib/assert/is-positive-number").isPrimitive,KTe=require("@stdlib/assert/is-number").isPrimitive,eje=require("@stdlib/math/base/assert/is-nan"),rje=require("@stdlib/assert/is-error"),tje=require("@stdlib/object/assign"),ije=require("@stdlib/utils/inherit"),VJ=require("@stdlib/utils/define-nonenumerable-property"),Ei=require("@stdlib/utils/define-nonenumerable-read-only-property"),bf=require("@stdlib/utils/define-read-only-accessor"),nje=require("@stdlib/utils/define-read-write-accessor"),aje=on().factory,FJ=require("@stdlib/buffer/from-string"),sje=require("@stdlib/utils/next-tick"),WJ=require("@stdlib/string/format"),uje=TJ(),oje=xJ(),as=GJ();function vje(){return this._prng.seed}function gje(){return this._prng.seedLength}function fje(){return this._prng.stateLength}function dje(){return this._prng.byteLength}function lje(){return this._prng.state}function cje(r){this._prng.state=r}function mje(){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=FJ(e):e=FJ(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function hje(r){var e;if(this._destroyed)return as("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,sje(t),this;function t(){r&&(as("Stream was destroyed due to an error. Error: %s.",rje(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(!KTe(r)||eje(r))throw new TypeError(WJ("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!$Te(e))throw new TypeError(WJ("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=tje({},uje),arguments.length>2&&(n=oje(i,t),n))throw n;return as("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),IJ.call(this,i),VJ(this,"_destroyed",!1),Ei(this,"_objectMode",i.objectMode),Ei(this,"_sep",i.sep),Ei(this,"_iter",i.iter),Ei(this,"_siter",i.siter),VJ(this,"_i",0),Ei(this,"_prng",aje(r,e,i)),Ei(this,"PRNG",this._prng.PRNG),this}ije(fe,IJ);bf(fe.prototype,"seed",vje);bf(fe.prototype,"seedLength",gje);nje(fe.prototype,"state",lje,cje);bf(fe.prototype,"stateLength",fje);bf(fe.prototype,"byteLength",dje);Ei(fe.prototype,"_read",mje);Ei(fe.prototype,"destroy",hje);kJ.exports=fe});var JJ=s(function(ger,zJ){"use strict";var pje=require("@stdlib/assert/is-plain-object"),yje=require("@stdlib/object/assign"),qje=require("@stdlib/string/format"),bje=wf();function wje(r,e,t){var i;if(arguments.length>2){if(i=t,!pje(i))throw new TypeError(qje("invalid argument. Options argument must be an object. Value: `%s`.",i));i=yje({},t)}else i={};return i.objectMode=!0,new bje(r,e,i)}zJ.exports=wje});var YJ=s(function(fer,XJ){"use strict";var UJ=require("@stdlib/assert/is-plain-object"),CJ=require("@stdlib/object/assign"),BJ=require("@stdlib/string/format"),DJ=wf();function Sje(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!UJ(r))throw new TypeError(BJ("invalid argument. Options argument must be an object. Value: `%s`.",r));n=CJ({},r)}else if(i>2){if(!UJ(t))throw new TypeError(BJ("invalid argument. Options argument must be an object. Value: `%s`.",t));n=CJ({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new DJ(v,g,n)}function o(){return new DJ(r,e,n)}}XJ.exports=Sje});var QJ=s(function(der,ZJ){"use strict";var HJ=require("@stdlib/utils/define-nonenumerable-read-only-property"),Tm=wf(),Oje=JJ(),Eje=YJ();HJ(Tm,"objectMode",Oje);HJ(Tm,"factory",Eje);ZJ.exports=Tm});var $J=s(function(ler,_je){_je.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var rU=s(function(cer,eU){"use strict";var Nje=require("@stdlib/assert/is-plain-object"),nr=require("@stdlib/assert/has-own-property"),Lje=require("@stdlib/assert/is-boolean").isPrimitive,Rje=require("@stdlib/assert/is-nonnegative-number").isPrimitive,KJ=require("@stdlib/assert/is-string").isPrimitive,Pje=require("@stdlib/assert/is-positive-integer").isPrimitive,Tje=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Rn=require("@stdlib/string/format");function jje(r,e){return Nje(e)?nr(e,"sep")&&(r.sep=e.sep,!KJ(r.sep))?new TypeError(Rn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):nr(e,"objectMode")&&(r.objectMode=e.objectMode,!Lje(r.objectMode))?new TypeError(Rn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):nr(e,"encoding")&&(r.encoding=e.encoding,!KJ(r.encoding)&&r.encoding!==null)?new TypeError(Rn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):nr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!Rje(r.highWaterMark))?new TypeError(Rn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):nr(e,"iter")&&(r.iter=e.iter,!Tje(r.iter))?new TypeError(Rn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):nr(e,"siter")&&(r.siter=e.siter,!Pje(r.siter))?new TypeError(Rn("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(Rn("invalid argument. Options argument must be an object. Value: `%s`.",e))}eU.exports=jje});var iU=s(function(mer,tU){"use strict";var Mje=require("debug"),xje=Mje("random:streams:discrete-uniform");tU.exports=xje});var Of=s(function(her,oU){"use strict";var uU=require("readable-stream").Readable,nU=require("@stdlib/assert/is-integer").isPrimitive,Aje=require("@stdlib/assert/is-error"),Gje=require("@stdlib/object/assign"),Vje=require("@stdlib/utils/inherit"),aU=require("@stdlib/utils/define-nonenumerable-property"),_i=require("@stdlib/utils/define-nonenumerable-read-only-property"),Sf=require("@stdlib/utils/define-read-only-accessor"),Fje=require("@stdlib/utils/define-read-write-accessor"),Wje=vn().factory,sU=require("@stdlib/buffer/from-string"),Ije=require("@stdlib/utils/next-tick"),jm=require("@stdlib/string/format"),kje=$J(),zje=rU(),ss=iU();function Jje(){return this._prng.seed}function Uje(){return this._prng.seedLength}function Cje(){return this._prng.stateLength}function Bje(){return this._prng.byteLength}function Dje(){return this._prng.state}function Xje(r){this._prng.state=r}function Yje(){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=sU(e):e=sU(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function Hje(r){var e;if(this._destroyed)return ss("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,Ije(t),this;function t(){r&&(ss("Stream was destroyed due to an error. Error: %s.",Aje(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(!nU(r))throw new TypeError(jm("invalid argument. First argument must be an integer. Value: `%s`.",r));if(!nU(e))throw new TypeError(jm("invalid argument. Second argument must be an integer. Value: `%s`.",e));if(r>e)throw new RangeError(jm("invalid argument. Minimum support must be less than or equal to maximum support. Value: `[%d, %d]`.",r,e));if(i=Gje({},kje),arguments.length>2&&(n=zje(i,t),n))throw n;return ss("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),uU.call(this,i),aU(this,"_destroyed",!1),_i(this,"_objectMode",i.objectMode),_i(this,"_sep",i.sep),_i(this,"_iter",i.iter),_i(this,"_siter",i.siter),aU(this,"_i",0),_i(this,"_prng",Wje(r,e,i)),_i(this,"PRNG",this._prng.PRNG),this}Vje(de,uU);Sf(de.prototype,"seed",Jje);Sf(de.prototype,"seedLength",Uje);Fje(de.prototype,"state",Dje,Xje);Sf(de.prototype,"stateLength",Cje);Sf(de.prototype,"byteLength",Bje);_i(de.prototype,"_read",Yje);_i(de.prototype,"destroy",Hje);oU.exports=de});var gU=s(function(per,vU){"use strict";var Zje=require("@stdlib/assert/is-plain-object"),Qje=require("@stdlib/object/assign"),$je=require("@stdlib/string/format"),Kje=Of();function e0e(r,e,t){var i;if(arguments.length>2){if(i=t,!Zje(i))throw new TypeError($je("invalid argument. Options argument must be an object. Value: `%s`.",i));i=Qje({},t)}else i={};return i.objectMode=!0,new Kje(r,e,i)}vU.exports=e0e});var hU=s(function(yer,mU){"use strict";var fU=require("@stdlib/assert/is-plain-object"),dU=require("@stdlib/object/assign"),lU=require("@stdlib/string/format"),cU=Of();function r0e(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!fU(r))throw new TypeError(lU("invalid argument. Options argument must be an object. Value: `%s`.",r));n=dU({},r)}else if(i>2){if(!fU(t))throw new TypeError(lU("invalid argument. Options argument must be an object. Value: `%s`.",t));n=dU({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new cU(v,g,n)}function o(){return new cU(r,e,n)}}mU.exports=r0e});var qU=s(function(qer,yU){"use strict";var pU=require("@stdlib/utils/define-nonenumerable-read-only-property"),Mm=Of(),t0e=gU(),i0e=hU();pU(Mm,"objectMode",t0e);pU(Mm,"factory",i0e);yU.exports=Mm});var bU=s(function(ber,n0e){n0e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var OU=s(function(wer,SU){"use strict";var a0e=require("@stdlib/assert/is-plain-object"),ar=require("@stdlib/assert/has-own-property"),s0e=require("@stdlib/assert/is-boolean").isPrimitive,u0e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,wU=require("@stdlib/assert/is-string").isPrimitive,o0e=require("@stdlib/assert/is-positive-integer").isPrimitive,v0e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Pn=require("@stdlib/string/format");function g0e(r,e){return a0e(e)?ar(e,"sep")&&(r.sep=e.sep,!wU(r.sep))?new TypeError(Pn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):ar(e,"objectMode")&&(r.objectMode=e.objectMode,!s0e(r.objectMode))?new TypeError(Pn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):ar(e,"encoding")&&(r.encoding=e.encoding,!wU(r.encoding)&&r.encoding!==null)?new TypeError(Pn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):ar(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!u0e(r.highWaterMark))?new TypeError(Pn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):ar(e,"iter")&&(r.iter=e.iter,!v0e(r.iter))?new TypeError(Pn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):ar(e,"siter")&&(r.siter=e.siter,!o0e(r.siter))?new TypeError(Pn("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(Pn("invalid argument. Options argument must be an object. Value: `%s`.",e))}SU.exports=g0e});var _U=s(function(Ser,EU){"use strict";var f0e=require("debug"),d0e=f0e("random:streams:erlang");EU.exports=d0e});var _f=s(function(Oer,TU){"use strict";var PU=require("readable-stream").Readable,l0e=require("@stdlib/assert/is-positive-integer").isPrimitive,c0e=require("@stdlib/assert/is-positive-number").isPrimitive,m0e=require("@stdlib/assert/is-error"),h0e=require("@stdlib/object/assign"),p0e=require("@stdlib/utils/inherit"),NU=require("@stdlib/utils/define-nonenumerable-property"),Ni=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ef=require("@stdlib/utils/define-read-only-accessor"),y0e=require("@stdlib/utils/define-read-write-accessor"),q0e=ba().factory,LU=require("@stdlib/buffer/from-string"),b0e=require("@stdlib/utils/next-tick"),RU=require("@stdlib/string/format"),w0e=bU(),S0e=OU(),us=_U();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=LU(e):e=LU(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 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(!l0e(r))throw new TypeError(RU("invalid argument. First argument must be a positive integer. Value: `%s`.",r));if(!c0e(e))throw new TypeError(RU("invalid argument. Second argument must be a positive number. Value: `%s`.",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)),PU.call(this,i),NU(this,"_destroyed",!1),Ni(this,"_objectMode",i.objectMode),Ni(this,"_sep",i.sep),Ni(this,"_iter",i.iter),Ni(this,"_siter",i.siter),NU(this,"_i",0),Ni(this,"_prng",q0e(r,e,i)),Ni(this,"PRNG",this._prng.PRNG),this}p0e(le,PU);Ef(le.prototype,"seed",O0e);Ef(le.prototype,"seedLength",E0e);y0e(le.prototype,"state",L0e,R0e);Ef(le.prototype,"stateLength",_0e);Ef(le.prototype,"byteLength",N0e);Ni(le.prototype,"_read",P0e);Ni(le.prototype,"destroy",T0e);TU.exports=le});var MU=s(function(Eer,jU){"use strict";var j0e=require("@stdlib/assert/is-plain-object"),M0e=require("@stdlib/object/assign"),x0e=require("@stdlib/string/format"),A0e=_f();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)}jU.exports=G0e});var WU=s(function(_er,FU){"use strict";var xU=require("@stdlib/assert/is-plain-object"),AU=require("@stdlib/object/assign"),GU=require("@stdlib/string/format"),VU=_f();function V0e(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!xU(r))throw new TypeError(GU("invalid argument. Options argument must be an object. Value: `%s`.",r));n=AU({},r)}else if(i>2){if(!xU(t))throw new TypeError(GU("invalid argument. Options argument must be an object. Value: `%s`.",t));n=AU({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new VU(v,g,n)}function o(){return new VU(r,e,n)}}FU.exports=V0e});var zU=s(function(Ner,kU){"use strict";var IU=require("@stdlib/utils/define-nonenumerable-read-only-property"),xm=_f(),F0e=MU(),W0e=WU();IU(xm,"objectMode",F0e);IU(xm,"factory",W0e);kU.exports=xm});var JU=s(function(Ler,I0e){I0e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var BU=s(function(Rer,CU){"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,UU=require("@stdlib/assert/is-string").isPrimitive,U0e=require("@stdlib/assert/is-positive-integer").isPrimitive,C0e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Tn=require("@stdlib/string/format");function B0e(r,e){return k0e(e)?sr(e,"sep")&&(r.sep=e.sep,!UU(r.sep))?new TypeError(Tn("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(Tn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):sr(e,"encoding")&&(r.encoding=e.encoding,!UU(r.encoding)&&r.encoding!==null)?new TypeError(Tn("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(Tn("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(Tn("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(Tn("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(Tn("invalid argument. Options argument must be an object. Value: `%s`.",e))}CU.exports=B0e});var XU=s(function(Per,DU){"use strict";var D0e=require("debug"),X0e=D0e("random:streams:exponential");DU.exports=X0e});var Lf=s(function(Ter,QU){"use strict";var ZU=require("readable-stream").Readable,Y0e=require("@stdlib/assert/is-positive-number").isPrimitive,H0e=require("@stdlib/assert/is-error"),Z0e=require("@stdlib/object/assign"),Q0e=require("@stdlib/utils/inherit"),YU=require("@stdlib/utils/define-nonenumerable-property"),Li=require("@stdlib/utils/define-nonenumerable-read-only-property"),Nf=require("@stdlib/utils/define-read-only-accessor"),$0e=require("@stdlib/utils/define-read-write-accessor"),K0e=gn().factory,HU=require("@stdlib/buffer/from-string"),eMe=require("@stdlib/utils/next-tick"),rMe=require("@stdlib/string/format"),tMe=JU(),iMe=BU(),os=XU();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=HU(e):e=HU(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,eMe(t),this;function t(){r&&(os("Stream was destroyed due to an error. Error: %s.",H0e(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(!Y0e(r))throw new TypeError(rMe("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(t=Z0e({},tMe),arguments.length>1&&(i=iMe(t,e),i))throw i;return os("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),ZU.call(this,t),YU(this,"_destroyed",!1),Li(this,"_objectMode",t.objectMode),Li(this,"_sep",t.sep),Li(this,"_iter",t.iter),Li(this,"_siter",t.siter),YU(this,"_i",0),Li(this,"_prng",K0e(r,t)),Li(this,"PRNG",this._prng.PRNG),this}Q0e(ce,ZU);Nf(ce.prototype,"seed",nMe);Nf(ce.prototype,"seedLength",aMe);$0e(ce.prototype,"state",oMe,vMe);Nf(ce.prototype,"stateLength",sMe);Nf(ce.prototype,"byteLength",uMe);Li(ce.prototype,"_read",gMe);Li(ce.prototype,"destroy",fMe);QU.exports=ce});var KU=s(function(jer,$U){"use strict";var dMe=require("@stdlib/assert/is-plain-object"),lMe=require("@stdlib/object/assign"),cMe=require("@stdlib/string/format"),mMe=Lf();function hMe(r,e){var t;if(arguments.length>1){if(t=e,!dMe(t))throw new TypeError(cMe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=lMe({},e)}else t={};return t.objectMode=!0,new mMe(r,t)}$U.exports=hMe});var aC=s(function(Mer,nC){"use strict";var pMe=require("@stdlib/assert/is-positive-number").isPrimitive,eC=require("@stdlib/assert/is-plain-object"),rC=require("@stdlib/object/assign"),tC=require("@stdlib/string/format"),iC=Lf();function yMe(r,e){var t,i,n;if(t=arguments.length,t>1){if(!eC(e))throw new TypeError(tC("invalid argument. Options argument must be an object. Value: `%s`.",e));n=u,i=rC({},e)}else if(t===1)if(pMe(r))n=u,i={};else{if(!eC(r))throw new TypeError(tC("invalid argument. Options argument must be an object. Value: `%s`.",r));i=rC({},r),n=a}else i={},n=a;return n;function a(o){return new iC(o,i)}function u(){return new iC(r,i)}}nC.exports=yMe});var oC=s(function(xer,uC){"use strict";var sC=require("@stdlib/utils/define-nonenumerable-read-only-property"),Am=Lf(),qMe=KU(),bMe=aC();sC(Am,"objectMode",qMe);sC(Am,"factory",bMe);uC.exports=Am});var vC=s(function(Aer,wMe){wMe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var dC=s(function(Ger,fC){"use strict";var SMe=require("@stdlib/assert/is-plain-object"),ur=require("@stdlib/assert/has-own-property"),OMe=require("@stdlib/assert/is-boolean").isPrimitive,EMe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,gC=require("@stdlib/assert/is-string").isPrimitive,_Me=require("@stdlib/assert/is-positive-integer").isPrimitive,NMe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,jn=require("@stdlib/string/format");function LMe(r,e){return SMe(e)?ur(e,"sep")&&(r.sep=e.sep,!gC(r.sep))?new TypeError(jn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):ur(e,"objectMode")&&(r.objectMode=e.objectMode,!OMe(r.objectMode))?new TypeError(jn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):ur(e,"encoding")&&(r.encoding=e.encoding,!gC(r.encoding)&&r.encoding!==null)?new TypeError(jn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):ur(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!EMe(r.highWaterMark))?new TypeError(jn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):ur(e,"iter")&&(r.iter=e.iter,!NMe(r.iter))?new TypeError(jn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):ur(e,"siter")&&(r.siter=e.siter,!_Me(r.siter))?new TypeError(jn("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(jn("invalid argument. Options argument must be an object. Value: `%s`.",e))}fC.exports=LMe});var cC=s(function(Ver,lC){"use strict";var RMe=require("debug"),PMe=RMe("random:streams:f");lC.exports=PMe});var Pf=s(function(Fer,bC){"use strict";var qC=require("readable-stream").Readable,mC=require("@stdlib/assert/is-positive-number").isPrimitive,TMe=require("@stdlib/assert/is-error"),jMe=require("@stdlib/object/assign"),MMe=require("@stdlib/utils/inherit"),hC=require("@stdlib/utils/define-nonenumerable-property"),Ri=require("@stdlib/utils/define-nonenumerable-read-only-property"),Rf=require("@stdlib/utils/define-read-only-accessor"),xMe=require("@stdlib/utils/define-read-write-accessor"),AMe=Sa().factory,pC=require("@stdlib/buffer/from-string"),GMe=require("@stdlib/utils/next-tick"),yC=require("@stdlib/string/format"),VMe=vC(),FMe=dC(),vs=cC();function WMe(){return this._prng.seed}function IMe(){return this._prng.seedLength}function kMe(){return this._prng.stateLength}function zMe(){return this._prng.byteLength}function JMe(){return this._prng.state}function UMe(r){this._prng.state=r}function CMe(){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=pC(e):e=pC(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function BMe(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 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(!mC(r))throw new TypeError(yC("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!mC(e))throw new TypeError(yC("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=jMe({},VMe),arguments.length>2&&(n=FMe(i,t),n))throw n;return vs("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),qC.call(this,i),hC(this,"_destroyed",!1),Ri(this,"_objectMode",i.objectMode),Ri(this,"_sep",i.sep),Ri(this,"_iter",i.iter),Ri(this,"_siter",i.siter),hC(this,"_i",0),Ri(this,"_prng",AMe(r,e,i)),Ri(this,"PRNG",this._prng.PRNG),this}MMe(me,qC);Rf(me.prototype,"seed",WMe);Rf(me.prototype,"seedLength",IMe);xMe(me.prototype,"state",JMe,UMe);Rf(me.prototype,"stateLength",kMe);Rf(me.prototype,"byteLength",zMe);Ri(me.prototype,"_read",CMe);Ri(me.prototype,"destroy",BMe);bC.exports=me});var SC=s(function(Wer,wC){"use strict";var DMe=require("@stdlib/assert/is-plain-object"),XMe=require("@stdlib/object/assign"),YMe=require("@stdlib/string/format"),HMe=Pf();function ZMe(r,e,t){var i;if(arguments.length>2){if(i=t,!DMe(i))throw new TypeError(YMe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=XMe({},t)}else i={};return i.objectMode=!0,new HMe(r,e,i)}wC.exports=ZMe});var RC=s(function(Ier,LC){"use strict";var OC=require("@stdlib/assert/is-plain-object"),EC=require("@stdlib/object/assign"),_C=require("@stdlib/string/format"),NC=Pf();function QMe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!OC(r))throw new TypeError(_C("invalid argument. Options argument must be an object. Value: `%s`.",r));n=EC({},r)}else if(i>2){if(!OC(t))throw new TypeError(_C("invalid argument. Options argument must be an object. Value: `%s`.",t));n=EC({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new NC(v,g,n)}function o(){return new NC(r,e,n)}}LC.exports=QMe});var jC=s(function(ker,TC){"use strict";var PC=require("@stdlib/utils/define-nonenumerable-read-only-property"),Gm=Pf(),$Me=SC(),KMe=RC();PC(Gm,"objectMode",$Me);PC(Gm,"factory",KMe);TC.exports=Gm});var MC=s(function(zer,exe){exe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var GC=s(function(Jer,AC){"use strict";var rxe=require("@stdlib/assert/is-plain-object"),or=require("@stdlib/assert/has-own-property"),txe=require("@stdlib/assert/is-boolean").isPrimitive,ixe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,xC=require("@stdlib/assert/is-string").isPrimitive,nxe=require("@stdlib/assert/is-positive-integer").isPrimitive,axe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Mn=require("@stdlib/string/format");function sxe(r,e){return rxe(e)?or(e,"sep")&&(r.sep=e.sep,!xC(r.sep))?new TypeError(Mn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):or(e,"objectMode")&&(r.objectMode=e.objectMode,!txe(r.objectMode))?new TypeError(Mn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):or(e,"encoding")&&(r.encoding=e.encoding,!xC(r.encoding)&&r.encoding!==null)?new TypeError(Mn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):or(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!ixe(r.highWaterMark))?new TypeError(Mn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):or(e,"iter")&&(r.iter=e.iter,!axe(r.iter))?new TypeError(Mn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):or(e,"siter")&&(r.siter=e.siter,!nxe(r.siter))?new TypeError(Mn("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(Mn("invalid argument. Options argument must be an object. Value: `%s`.",e))}AC.exports=sxe});var FC=s(function(Uer,VC){"use strict";var uxe=require("debug"),oxe=uxe("random:streams:frechet");VC.exports=oxe});var jf=s(function(Cer,JC){"use strict";var zC=require("readable-stream").Readable,WC=require("@stdlib/assert/is-positive-number"),vxe=require("@stdlib/assert/is-number").isPrimitive,gxe=require("@stdlib/math/base/assert/is-nan"),fxe=require("@stdlib/assert/is-error"),dxe=require("@stdlib/object/assign"),lxe=require("@stdlib/utils/inherit"),IC=require("@stdlib/utils/define-nonenumerable-property"),Pi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Tf=require("@stdlib/utils/define-read-only-accessor"),cxe=require("@stdlib/utils/define-read-write-accessor"),mxe=Ea().factory,kC=require("@stdlib/buffer/from-string"),hxe=require("@stdlib/utils/next-tick"),Vm=require("@stdlib/string/format"),pxe=MC(),yxe=GC(),gs=FC();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=kC(e):e=kC(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 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(!WC(r))throw new TypeError(Vm("invalid argument. First argument must be a positive number and not NaN. Value: `%s`.",r));if(!WC(e))throw new TypeError(Vm("invalid argument. Second argument must be a positive number and not NaN. Value: `%s`.",e));if(!vxe(t)||gxe(t))throw new TypeError(Vm("invalid argument. Third argument must be a number. Value: `%s`.",t));if(n=dxe({},pxe),arguments.length>3&&(a=yxe(n,i),a))throw a;return gs("Creating a readable stream configured with the following options: %s.",JSON.stringify(n)),zC.call(this,n),IC(this,"_destroyed",!1),Pi(this,"_objectMode",n.objectMode),Pi(this,"_sep",n.sep),Pi(this,"_iter",n.iter),Pi(this,"_siter",n.siter),IC(this,"_i",0),Pi(this,"_prng",mxe(r,e,t,n)),Pi(this,"PRNG",this._prng.PRNG),this}lxe(he,zC);Tf(he.prototype,"seed",qxe);Tf(he.prototype,"seedLength",bxe);cxe(he.prototype,"state",Oxe,Exe);Tf(he.prototype,"stateLength",wxe);Tf(he.prototype,"byteLength",Sxe);Pi(he.prototype,"_read",_xe);Pi(he.prototype,"destroy",Nxe);JC.exports=he});var CC=s(function(Ber,UC){"use strict";var Lxe=require("@stdlib/assert/is-plain-object"),Rxe=require("@stdlib/object/assign"),Pxe=require("@stdlib/string/format"),Txe=jf();function jxe(r,e,t,i){var n;if(arguments.length>3){if(n=i,!Lxe(n))throw new TypeError(Pxe("invalid argument. Options argument must be an object. Value: `%s`.",n));n=Rxe({},i)}else n={};return n.objectMode=!0,new Txe(r,e,t,n)}UC.exports=jxe});var ZC=s(function(Der,HC){"use strict";var BC=require("@stdlib/assert/is-plain-object"),DC=require("@stdlib/object/assign"),XC=require("@stdlib/string/format"),YC=jf();function Mxe(r,e,t,i){var n,a,u;if(n=arguments.length,n===1){if(!BC(r))throw new TypeError(XC("invalid argument. Options argument must be an object. Value: `%s`.",r));a=DC({},r)}else if(n>3){if(!BC(i))throw new TypeError(XC("invalid argument. Options argument must be an object. Value: `%s`.",i));a=DC({},i)}else a={};return n<3?u=o:u=v,u;function o(g,c,l){return new YC(g,c,l,a)}function v(){return new YC(r,e,t,a)}}HC.exports=Mxe});var KC=s(function(Xer,$C){"use strict";var QC=require("@stdlib/utils/define-nonenumerable-read-only-property"),Fm=jf(),xxe=CC(),Axe=ZC();QC(Fm,"objectMode",xxe);QC(Fm,"factory",Axe);$C.exports=Fm});var eB=s(function(Yer,Gxe){Gxe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var iB=s(function(Her,tB){"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,rB=require("@stdlib/assert/is-string").isPrimitive,Ixe=require("@stdlib/assert/is-positive-integer").isPrimitive,kxe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,xn=require("@stdlib/string/format");function zxe(r,e){return Vxe(e)?vr(e,"sep")&&(r.sep=e.sep,!rB(r.sep))?new TypeError(xn("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(xn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):vr(e,"encoding")&&(r.encoding=e.encoding,!rB(r.encoding)&&r.encoding!==null)?new TypeError(xn("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(xn("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(xn("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(xn("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(xn("invalid argument. Options argument must be an object. Value: `%s`.",e))}tB.exports=zxe});var aB=s(function(Zer,nB){"use strict";var Jxe=require("debug"),Uxe=Jxe("random:streams:gamma");nB.exports=Uxe});var xf=s(function(Qer,fB){"use strict";var gB=require("readable-stream").Readable,sB=require("@stdlib/assert/is-positive-number").isPrimitive,Cxe=require("@stdlib/assert/is-error"),Bxe=require("@stdlib/object/assign"),Dxe=require("@stdlib/utils/inherit"),uB=require("@stdlib/utils/define-nonenumerable-property"),Ti=require("@stdlib/utils/define-nonenumerable-read-only-property"),Mf=require("@stdlib/utils/define-read-only-accessor"),Xxe=require("@stdlib/utils/define-read-write-accessor"),Yxe=Ce().factory,oB=require("@stdlib/buffer/from-string"),Hxe=require("@stdlib/utils/next-tick"),vB=require("@stdlib/string/format"),Zxe=eB(),Qxe=iB(),fs=aB();function $xe(){return this._prng.seed}function Kxe(){return this._prng.seedLength}function e1e(){return this._prng.stateLength}function r1e(){return this._prng.byteLength}function t1e(){return this._prng.state}function i1e(r){this._prng.state=r}function n1e(){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=oB(e):e=oB(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function a1e(r){var e;if(this._destroyed)return fs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,Hxe(t),this;function t(){r&&(fs("Stream was destroyed due to an error. Error: %s.",Cxe(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(!sB(r))throw new TypeError(vB("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!sB(e))throw new TypeError(vB("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=Bxe({},Zxe),arguments.length>2&&(n=Qxe(i,t),n))throw n;return fs("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),gB.call(this,i),uB(this,"_destroyed",!1),Ti(this,"_objectMode",i.objectMode),Ti(this,"_sep",i.sep),Ti(this,"_iter",i.iter),Ti(this,"_siter",i.siter),uB(this,"_i",0),Ti(this,"_prng",Yxe(r,e,i)),Ti(this,"PRNG",this._prng.PRNG),this}Dxe(pe,gB);Mf(pe.prototype,"seed",$xe);Mf(pe.prototype,"seedLength",Kxe);Xxe(pe.prototype,"state",t1e,i1e);Mf(pe.prototype,"stateLength",e1e);Mf(pe.prototype,"byteLength",r1e);Ti(pe.prototype,"_read",n1e);Ti(pe.prototype,"destroy",a1e);fB.exports=pe});var lB=s(function($er,dB){"use strict";var s1e=require("@stdlib/assert/is-plain-object"),u1e=require("@stdlib/object/assign"),o1e=require("@stdlib/string/format"),v1e=xf();function g1e(r,e,t){var i;if(arguments.length>2){if(i=t,!s1e(i))throw new TypeError(o1e("invalid argument. Options argument must be an object. Value: `%s`.",i));i=u1e({},t)}else i={};return i.objectMode=!0,new v1e(r,e,i)}dB.exports=g1e});var qB=s(function(Ker,yB){"use strict";var cB=require("@stdlib/assert/is-plain-object"),mB=require("@stdlib/object/assign"),hB=require("@stdlib/string/format"),pB=xf();function f1e(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!cB(r))throw new TypeError(hB("invalid argument. Options argument must be an object. Value: `%s`.",r));n=mB({},r)}else if(i>2){if(!cB(t))throw new TypeError(hB("invalid argument. Options argument must be an object. Value: `%s`.",t));n=mB({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new pB(v,g,n)}function o(){return new pB(r,e,n)}}yB.exports=f1e});var SB=s(function(err,wB){"use strict";var bB=require("@stdlib/utils/define-nonenumerable-read-only-property"),Wm=xf(),d1e=lB(),l1e=qB();bB(Wm,"objectMode",d1e);bB(Wm,"factory",l1e);wB.exports=Wm});var OB=s(function(rrr,c1e){c1e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var NB=s(function(trr,_B){"use strict";var m1e=require("@stdlib/assert/is-plain-object"),gr=require("@stdlib/assert/has-own-property"),h1e=require("@stdlib/assert/is-boolean").isPrimitive,p1e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,EB=require("@stdlib/assert/is-string").isPrimitive,y1e=require("@stdlib/assert/is-positive-integer").isPrimitive,q1e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,An=require("@stdlib/string/format");function b1e(r,e){return m1e(e)?gr(e,"sep")&&(r.sep=e.sep,!EB(r.sep))?new TypeError(An("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):gr(e,"objectMode")&&(r.objectMode=e.objectMode,!h1e(r.objectMode))?new TypeError(An("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):gr(e,"encoding")&&(r.encoding=e.encoding,!EB(r.encoding)&&r.encoding!==null)?new TypeError(An("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):gr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!p1e(r.highWaterMark))?new TypeError(An("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):gr(e,"iter")&&(r.iter=e.iter,!q1e(r.iter))?new TypeError(An("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):gr(e,"siter")&&(r.siter=e.siter,!y1e(r.siter))?new TypeError(An("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(An("invalid argument. Options argument must be an object. Value: `%s`.",e))}_B.exports=b1e});var RB=s(function(irr,LB){"use strict";var w1e=require("debug"),S1e=w1e("random:streams:geometric");LB.exports=S1e});var Gf=s(function(nrr,MB){"use strict";var jB=require("readable-stream").Readable,O1e=require("@stdlib/assert/is-probability").isPrimitive,E1e=require("@stdlib/assert/is-error"),_1e=require("@stdlib/object/assign"),N1e=require("@stdlib/utils/inherit"),PB=require("@stdlib/utils/define-nonenumerable-property"),ji=require("@stdlib/utils/define-nonenumerable-read-only-property"),Af=require("@stdlib/utils/define-read-only-accessor"),L1e=require("@stdlib/utils/define-read-write-accessor"),R1e=_a().factory,TB=require("@stdlib/buffer/from-string"),P1e=require("@stdlib/utils/next-tick"),T1e=require("@stdlib/string/format"),j1e=OB(),M1e=NB(),ds=RB();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=TB(e):e=TB(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,P1e(t),this;function t(){r&&(ds("Stream was destroyed due to an error. Error: %s.",E1e(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(!O1e(r))throw new TypeError(T1e("invalid argument. First argument must be a probability. Value: `%s`.",r));if(t=_1e({},j1e),arguments.length>1&&(i=M1e(t,e),i))throw i;return ds("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),jB.call(this,t),PB(this,"_destroyed",!1),ji(this,"_objectMode",t.objectMode),ji(this,"_sep",t.sep),ji(this,"_iter",t.iter),ji(this,"_siter",t.siter),PB(this,"_i",0),ji(this,"_prng",R1e(r,t)),ji(this,"PRNG",this._prng.PRNG),this}N1e(ye,jB);Af(ye.prototype,"seed",x1e);Af(ye.prototype,"seedLength",A1e);L1e(ye.prototype,"state",F1e,W1e);Af(ye.prototype,"stateLength",G1e);Af(ye.prototype,"byteLength",V1e);ji(ye.prototype,"_read",I1e);ji(ye.prototype,"destroy",k1e);MB.exports=ye});var AB=s(function(arr,xB){"use strict";var z1e=require("@stdlib/assert/is-plain-object"),J1e=require("@stdlib/object/assign"),U1e=require("@stdlib/string/format"),C1e=Gf();function B1e(r,e){var t;if(arguments.length>1){if(t=e,!z1e(t))throw new TypeError(U1e("invalid argument. Options argument must be an object. Value: `%s`.",t));t=J1e({},e)}else t={};return t.objectMode=!0,new C1e(r,t)}xB.exports=B1e});var kB=s(function(srr,IB){"use strict";var D1e=require("@stdlib/assert/is-probability").isPrimitive,GB=require("@stdlib/assert/is-plain-object"),VB=require("@stdlib/object/assign"),FB=require("@stdlib/string/format"),WB=Gf();function X1e(r,e){var t,i,n;if(t=arguments.length,t>1){if(!GB(e))throw new TypeError(FB("invalid argument. Options argument must be an object. Value: `%s`.",e));n=u,i=VB({},e)}else if(t===1)if(D1e(r))n=u,i={};else{if(!GB(r))throw new TypeError(FB("invalid argument. Options argument must be an object. Value: `%s`.",r));i=VB({},r),n=a}else i={},n=a;return n;function a(o){return new WB(o,i)}function u(){return new WB(r,i)}}IB.exports=X1e});var UB=s(function(urr,JB){"use strict";var zB=require("@stdlib/utils/define-nonenumerable-read-only-property"),Im=Gf(),Y1e=AB(),H1e=kB();zB(Im,"objectMode",Y1e);zB(Im,"factory",H1e);JB.exports=Im});var CB=s(function(orr,Z1e){Z1e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var XB=s(function(vrr,DB){"use strict";var Q1e=require("@stdlib/assert/is-plain-object"),fr=require("@stdlib/assert/has-own-property"),$1e=require("@stdlib/assert/is-boolean").isPrimitive,K1e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,BB=require("@stdlib/assert/is-string").isPrimitive,eAe=require("@stdlib/assert/is-positive-integer").isPrimitive,rAe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Gn=require("@stdlib/string/format");function tAe(r,e){return Q1e(e)?fr(e,"sep")&&(r.sep=e.sep,!BB(r.sep))?new TypeError(Gn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):fr(e,"objectMode")&&(r.objectMode=e.objectMode,!$1e(r.objectMode))?new TypeError(Gn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):fr(e,"encoding")&&(r.encoding=e.encoding,!BB(r.encoding)&&r.encoding!==null)?new TypeError(Gn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):fr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!K1e(r.highWaterMark))?new TypeError(Gn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):fr(e,"iter")&&(r.iter=e.iter,!rAe(r.iter))?new TypeError(Gn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):fr(e,"siter")&&(r.siter=e.siter,!eAe(r.siter))?new TypeError(Gn("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(Gn("invalid argument. Options argument must be an object. Value: `%s`.",e))}DB.exports=tAe});var HB=s(function(grr,YB){"use strict";var iAe=require("debug"),nAe=iAe("random:streams:gumbel");YB.exports=nAe});var Ff=s(function(frr,e9){"use strict";var KB=require("readable-stream").Readable,aAe=require("@stdlib/assert/is-positive-number").isPrimitive,sAe=require("@stdlib/assert/is-number").isPrimitive,uAe=require("@stdlib/math/base/assert/is-nan"),oAe=require("@stdlib/assert/is-error"),vAe=require("@stdlib/object/assign"),gAe=require("@stdlib/utils/inherit"),ZB=require("@stdlib/utils/define-nonenumerable-property"),Mi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Vf=require("@stdlib/utils/define-read-only-accessor"),fAe=require("@stdlib/utils/define-read-write-accessor"),dAe=Na().factory,QB=require("@stdlib/buffer/from-string"),lAe=require("@stdlib/utils/next-tick"),$B=require("@stdlib/string/format"),cAe=CB(),mAe=XB(),ls=HB();function hAe(){return this._prng.seed}function pAe(){return this._prng.seedLength}function yAe(){return this._prng.stateLength}function qAe(){return this._prng.byteLength}function bAe(){return this._prng.state}function wAe(r){this._prng.state=r}function SAe(){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=QB(e):e=QB(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function OAe(r){var e;if(this._destroyed)return ls("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,lAe(t),this;function t(){r&&(ls("Stream was destroyed due to an error. Error: %s.",oAe(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(!sAe(r)||uAe(r))throw new TypeError($B("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!aAe(e))throw new TypeError($B("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=vAe({},cAe),arguments.length>2&&(n=mAe(i,t),n))throw n;return ls("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),KB.call(this,i),ZB(this,"_destroyed",!1),Mi(this,"_objectMode",i.objectMode),Mi(this,"_sep",i.sep),Mi(this,"_iter",i.iter),Mi(this,"_siter",i.siter),ZB(this,"_i",0),Mi(this,"_prng",dAe(r,e,i)),Mi(this,"PRNG",this._prng.PRNG),this}gAe(qe,KB);Vf(qe.prototype,"seed",hAe);Vf(qe.prototype,"seedLength",pAe);fAe(qe.prototype,"state",bAe,wAe);Vf(qe.prototype,"stateLength",yAe);Vf(qe.prototype,"byteLength",qAe);Mi(qe.prototype,"_read",SAe);Mi(qe.prototype,"destroy",OAe);e9.exports=qe});var t9=s(function(drr,r9){"use strict";var EAe=require("@stdlib/assert/is-plain-object"),_Ae=require("@stdlib/object/assign"),NAe=require("@stdlib/string/format"),LAe=Ff();function RAe(r,e,t){var i;if(arguments.length>2){if(i=t,!EAe(i))throw new TypeError(NAe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=_Ae({},t)}else i={};return i.objectMode=!0,new LAe(r,e,i)}r9.exports=RAe});var o9=s(function(lrr,u9){"use strict";var i9=require("@stdlib/assert/is-plain-object"),n9=require("@stdlib/object/assign"),a9=require("@stdlib/string/format"),s9=Ff();function PAe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!i9(r))throw new TypeError(a9("invalid argument. Options argument must be an object. Value: `%s`.",r));n=n9({},r)}else if(i>2){if(!i9(t))throw new TypeError(a9("invalid argument. Options argument must be an object. Value: `%s`.",t));n=n9({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new s9(v,g,n)}function o(){return new s9(r,e,n)}}u9.exports=PAe});var f9=s(function(crr,g9){"use strict";var v9=require("@stdlib/utils/define-nonenumerable-read-only-property"),km=Ff(),TAe=t9(),jAe=o9();v9(km,"objectMode",TAe);v9(km,"factory",jAe);g9.exports=km});var d9=s(function(mrr,MAe){MAe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var m9=s(function(hrr,c9){"use strict";var xAe=require("@stdlib/assert/is-plain-object"),dr=require("@stdlib/assert/has-own-property"),AAe=require("@stdlib/assert/is-boolean").isPrimitive,GAe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,l9=require("@stdlib/assert/is-string").isPrimitive,VAe=require("@stdlib/assert/is-positive-integer").isPrimitive,FAe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Vn=require("@stdlib/string/format");function WAe(r,e){return xAe(e)?dr(e,"sep")&&(r.sep=e.sep,!l9(r.sep))?new TypeError(Vn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):dr(e,"objectMode")&&(r.objectMode=e.objectMode,!AAe(r.objectMode))?new TypeError(Vn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):dr(e,"encoding")&&(r.encoding=e.encoding,!l9(r.encoding)&&r.encoding!==null)?new TypeError(Vn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):dr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!GAe(r.highWaterMark))?new TypeError(Vn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):dr(e,"iter")&&(r.iter=e.iter,!FAe(r.iter))?new TypeError(Vn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):dr(e,"siter")&&(r.siter=e.siter,!VAe(r.siter))?new TypeError(Vn("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(Vn("invalid argument. Options argument must be an object. Value: `%s`.",e))}c9.exports=WAe});var p9=s(function(prr,h9){"use strict";var IAe=require("debug"),kAe=IAe("random:streams:hypergeometric");h9.exports=kAe});var If=s(function(yrr,w9){"use strict";var b9=require("readable-stream").Readable,zm=require("@stdlib/assert/is-nonnegative-integer"),zAe=require("@stdlib/assert/is-error"),JAe=require("@stdlib/object/assign"),UAe=require("@stdlib/utils/inherit"),y9=require("@stdlib/utils/define-nonenumerable-property"),xi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Wf=require("@stdlib/utils/define-read-only-accessor"),CAe=require("@stdlib/utils/define-read-write-accessor"),BAe=La().factory,q9=require("@stdlib/buffer/from-string"),DAe=require("@stdlib/utils/next-tick"),Jm=require("@stdlib/string/format"),XAe=d9(),YAe=m9(),cs=p9();function HAe(){return this._prng.seed}function ZAe(){return this._prng.seedLength}function QAe(){return this._prng.stateLength}function $Ae(){return this._prng.byteLength}function KAe(){return this._prng.state}function eGe(r){this._prng.state=r}function rGe(){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=q9(e):e=q9(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,DAe(t),this;function t(){r&&(cs("Stream was destroyed due to an error. Error: %s.",zAe(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(!zm(r))throw new TypeError(Jm("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",r));if(!zm(e))throw new TypeError(Jm("invalid argument. Second argument must be a nonnegative integer. Value: `%s`.",e));if(!zm(t))throw new TypeError(Jm("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=JAe({},XAe),arguments.length>3&&(a=YAe(n,i),a))throw a;return cs("Creating a readable stream configured with the following options: %s.",JSON.stringify(n)),b9.call(this,n),y9(this,"_destroyed",!1),xi(this,"_objectMode",n.objectMode),xi(this,"_sep",n.sep),xi(this,"_iter",n.iter),xi(this,"_siter",n.siter),y9(this,"_i",0),xi(this,"_prng",BAe(r,e,t,n)),xi(this,"PRNG",this._prng.PRNG),this}UAe(be,b9);Wf(be.prototype,"seed",HAe);Wf(be.prototype,"seedLength",ZAe);CAe(be.prototype,"state",KAe,eGe);Wf(be.prototype,"stateLength",QAe);Wf(be.prototype,"byteLength",$Ae);xi(be.prototype,"_read",rGe);xi(be.prototype,"destroy",tGe);w9.exports=be});var O9=s(function(qrr,S9){"use strict";var iGe=require("@stdlib/assert/is-plain-object"),nGe=require("@stdlib/object/assign"),aGe=require("@stdlib/string/format"),sGe=If();function uGe(r,e,t,i){var n;if(arguments.length>3){if(n=i,!iGe(n))throw new TypeError(aGe("invalid argument. Options argument must be an object. Value: `%s`.",n));n=nGe({},i)}else n={};return n.objectMode=!0,new sGe(r,e,t,n)}S9.exports=uGe});var P9=s(function(brr,R9){"use strict";var E9=require("@stdlib/assert/is-plain-object"),_9=require("@stdlib/object/assign"),N9=require("@stdlib/string/format"),L9=If();function oGe(r,e,t,i){var n,a,u;if(n=arguments.length,n===1){if(!E9(r))throw new TypeError(N9("invalid argument. Options argument must be an object. Value: `%s`.",r));a=_9({},r)}else if(n>3){if(!E9(i))throw new TypeError(N9("invalid argument. Options argument must be an object. Value: `%s`.",i));a=_9({},i)}else a={};return n<3?u=o:u=v,u;function o(g,c,l){return new L9(g,c,l,a)}function v(){return new L9(r,e,t,a)}}R9.exports=oGe});var M9=s(function(wrr,j9){"use strict";var T9=require("@stdlib/utils/define-nonenumerable-read-only-property"),Um=If(),vGe=O9(),gGe=P9();T9(Um,"objectMode",vGe);T9(Um,"factory",gGe);j9.exports=Um});var x9=s(function(Srr,fGe){fGe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var V9=s(function(Orr,G9){"use strict";var dGe=require("@stdlib/assert/is-plain-object"),lr=require("@stdlib/assert/has-own-property"),lGe=require("@stdlib/assert/is-boolean").isPrimitive,cGe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,A9=require("@stdlib/assert/is-string").isPrimitive,mGe=require("@stdlib/assert/is-positive-integer").isPrimitive,hGe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Fn=require("@stdlib/string/format");function pGe(r,e){return dGe(e)?lr(e,"sep")&&(r.sep=e.sep,!A9(r.sep))?new TypeError(Fn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):lr(e,"objectMode")&&(r.objectMode=e.objectMode,!lGe(r.objectMode))?new TypeError(Fn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):lr(e,"encoding")&&(r.encoding=e.encoding,!A9(r.encoding)&&r.encoding!==null)?new TypeError(Fn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):lr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!cGe(r.highWaterMark))?new TypeError(Fn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):lr(e,"iter")&&(r.iter=e.iter,!hGe(r.iter))?new TypeError(Fn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):lr(e,"siter")&&(r.siter=e.siter,!mGe(r.siter))?new TypeError(Fn("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(Fn("invalid argument. Options argument must be an object. Value: `%s`.",e))}G9.exports=pGe});var W9=s(function(Err,F9){"use strict";var yGe=require("debug"),qGe=yGe("random:streams:improved-ziggurat");F9.exports=qGe});var zf=s(function(_rr,J9){"use strict";var z9=require("readable-stream").Readable,bGe=require("@stdlib/assert/is-error"),wGe=require("@stdlib/object/assign"),SGe=require("@stdlib/utils/inherit"),I9=require("@stdlib/utils/define-nonenumerable-property"),Ai=require("@stdlib/utils/define-nonenumerable-read-only-property"),kf=require("@stdlib/utils/define-read-only-accessor"),OGe=require("@stdlib/utils/define-read-write-accessor"),EGe=Q().factory,k9=require("@stdlib/buffer/from-string"),_Ge=require("@stdlib/utils/next-tick"),NGe=x9(),LGe=V9(),ms=W9();function RGe(){return this._prng.seed}function PGe(){return this._prng.seedLength}function TGe(){return this._prng.stateLength}function jGe(){return this._prng.byteLength}function MGe(){return this._prng.state}function xGe(r){this._prng.state=r}function AGe(){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=k9(e):e=k9(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function GGe(r){var e;if(this._destroyed)return ms("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,_Ge(t),this;function t(){r&&(ms("Stream was destroyed due to an error. Error: %s.",bGe(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=wGe({},NGe),arguments.length>0&&(t=LGe(e,r),t))throw t;return ms("Creating a readable stream configured with the following options: %s.",JSON.stringify(e)),z9.call(this,e),I9(this,"_destroyed",!1),Ai(this,"_objectMode",e.objectMode),Ai(this,"_sep",e.sep),Ai(this,"_iter",e.iter),Ai(this,"_siter",e.siter),I9(this,"_i",0),Ai(this,"_prng",EGe(e)),Ai(this,"PRNG",this._prng.PRNG),this}SGe(we,z9);kf(we.prototype,"seed",RGe);kf(we.prototype,"seedLength",PGe);OGe(we.prototype,"state",MGe,xGe);kf(we.prototype,"stateLength",TGe);kf(we.prototype,"byteLength",jGe);Ai(we.prototype,"_read",AGe);Ai(we.prototype,"destroy",GGe);J9.exports=we});var C9=s(function(Nrr,U9){"use strict";var VGe=require("@stdlib/assert/is-plain-object"),FGe=require("@stdlib/object/assign"),WGe=require("@stdlib/string/format"),IGe=zf();function kGe(r){var e;if(arguments.length>0){if(e=r,!VGe(e))throw new TypeError(WGe("invalid argument. Options argument must be an object. Value: `%s`.",e));e=FGe({},r)}else e={};return e.objectMode=!0,new IGe(e)}U9.exports=kGe});var D9=s(function(Lrr,B9){"use strict";var zGe=require("@stdlib/assert/is-plain-object"),JGe=require("@stdlib/object/assign"),UGe=require("@stdlib/string/format"),CGe=zf();function BGe(r){var e;if(arguments.length>0){if(!zGe(r))throw new TypeError(UGe("invalid argument. Options argument must be an object. Value: `%s`.",r));e=JGe({},r)}else e={};return t;function t(){return new CGe(e)}}B9.exports=BGe});var H9=s(function(Rrr,Y9){"use strict";var X9=require("@stdlib/utils/define-nonenumerable-read-only-property"),Cm=zf(),DGe=C9(),XGe=D9();X9(Cm,"objectMode",DGe);X9(Cm,"factory",XGe);Y9.exports=Cm});var Z9=s(function(Prr,YGe){YGe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var K9=s(function(Trr,$9){"use strict";var HGe=require("@stdlib/assert/is-plain-object"),cr=require("@stdlib/assert/has-own-property"),ZGe=require("@stdlib/assert/is-boolean").isPrimitive,QGe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,Q9=require("@stdlib/assert/is-string").isPrimitive,$Ge=require("@stdlib/assert/is-positive-integer").isPrimitive,KGe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Wn=require("@stdlib/string/format");function eVe(r,e){return HGe(e)?cr(e,"sep")&&(r.sep=e.sep,!Q9(r.sep))?new TypeError(Wn("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(Wn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):cr(e,"encoding")&&(r.encoding=e.encoding,!Q9(r.encoding)&&r.encoding!==null)?new TypeError(Wn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):cr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!QGe(r.highWaterMark))?new TypeError(Wn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):cr(e,"iter")&&(r.iter=e.iter,!KGe(r.iter))?new TypeError(Wn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):cr(e,"siter")&&(r.siter=e.siter,!$Ge(r.siter))?new TypeError(Wn("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(Wn("invalid argument. Options argument must be an object. Value: `%s`.",e))}$9.exports=eVe});var rD=s(function(jrr,eD){"use strict";var rVe=require("debug"),tVe=rVe("random:streams:invgamma");eD.exports=tVe});var Uf=s(function(Mrr,uD){"use strict";var sD=require("readable-stream").Readable,tD=require("@stdlib/assert/is-positive-number").isPrimitive,iVe=require("@stdlib/assert/is-error"),nVe=require("@stdlib/object/assign"),aVe=require("@stdlib/utils/inherit"),iD=require("@stdlib/utils/define-nonenumerable-property"),Gi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Jf=require("@stdlib/utils/define-read-only-accessor"),sVe=require("@stdlib/utils/define-read-write-accessor"),uVe=fn().factory,nD=require("@stdlib/buffer/from-string"),oVe=require("@stdlib/utils/next-tick"),aD=require("@stdlib/string/format"),vVe=Z9(),gVe=K9(),hs=rD();function fVe(){return this._prng.seed}function dVe(){return this._prng.seedLength}function lVe(){return this._prng.stateLength}function cVe(){return this._prng.byteLength}function mVe(){return this._prng.state}function hVe(r){this._prng.state=r}function pVe(){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=nD(e):e=nD(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function yVe(r){var e;if(this._destroyed)return hs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,oVe(t),this;function t(){r&&(hs("Stream was destroyed due to an error. Error: %s.",iVe(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(!tD(r))throw new TypeError(aD("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!tD(e))throw new TypeError(aD("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=nVe({},vVe),arguments.length>2&&(n=gVe(i,t),n))throw n;return hs("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),sD.call(this,i),iD(this,"_destroyed",!1),Gi(this,"_objectMode",i.objectMode),Gi(this,"_sep",i.sep),Gi(this,"_iter",i.iter),Gi(this,"_siter",i.siter),iD(this,"_i",0),Gi(this,"_prng",uVe(r,e,i)),Gi(this,"PRNG",this._prng.PRNG),this}aVe(Se,sD);Jf(Se.prototype,"seed",fVe);Jf(Se.prototype,"seedLength",dVe);sVe(Se.prototype,"state",mVe,hVe);Jf(Se.prototype,"stateLength",lVe);Jf(Se.prototype,"byteLength",cVe);Gi(Se.prototype,"_read",pVe);Gi(Se.prototype,"destroy",yVe);uD.exports=Se});var vD=s(function(xrr,oD){"use strict";var qVe=require("@stdlib/assert/is-plain-object"),bVe=require("@stdlib/object/assign"),wVe=require("@stdlib/string/format"),SVe=Uf();function OVe(r,e,t){var i;if(arguments.length>2){if(i=t,!qVe(i))throw new TypeError(wVe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=bVe({},t)}else i={};return i.objectMode=!0,new SVe(r,e,i)}oD.exports=OVe});var mD=s(function(Arr,cD){"use strict";var gD=require("@stdlib/assert/is-plain-object"),fD=require("@stdlib/object/assign"),dD=require("@stdlib/string/format"),lD=Uf();function EVe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!gD(r))throw new TypeError(dD("invalid argument. Options argument must be an object. Value: `%s`.",r));n=fD({},r)}else if(i>2){if(!gD(t))throw new TypeError(dD("invalid argument. Options argument must be an object. Value: `%s`.",t));n=fD({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new lD(v,g,n)}function o(){return new lD(r,e,n)}}cD.exports=EVe});var yD=s(function(Grr,pD){"use strict";var hD=require("@stdlib/utils/define-nonenumerable-read-only-property"),Bm=Uf(),_Ve=vD(),NVe=mD();hD(Bm,"objectMode",_Ve);hD(Bm,"factory",NVe);pD.exports=Bm});var qD=s(function(Vrr,LVe){LVe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var SD=s(function(Frr,wD){"use strict";var RVe=require("@stdlib/assert/is-plain-object"),mr=require("@stdlib/assert/has-own-property"),PVe=require("@stdlib/assert/is-boolean").isPrimitive,TVe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,bD=require("@stdlib/assert/is-string").isPrimitive,jVe=require("@stdlib/assert/is-positive-integer").isPrimitive,MVe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,In=require("@stdlib/string/format");function xVe(r,e){return RVe(e)?mr(e,"sep")&&(r.sep=e.sep,!bD(r.sep))?new TypeError(In("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):mr(e,"objectMode")&&(r.objectMode=e.objectMode,!PVe(r.objectMode))?new TypeError(In("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):mr(e,"encoding")&&(r.encoding=e.encoding,!bD(r.encoding)&&r.encoding!==null)?new TypeError(In("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):mr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!TVe(r.highWaterMark))?new TypeError(In("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):mr(e,"iter")&&(r.iter=e.iter,!MVe(r.iter))?new TypeError(In("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):mr(e,"siter")&&(r.siter=e.siter,!jVe(r.siter))?new TypeError(In("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(In("invalid argument. Options argument must be an object. Value: `%s`.",e))}wD.exports=xVe});var ED=s(function(Wrr,OD){"use strict";var AVe=require("debug"),GVe=AVe("random:streams:kumaraswamy");OD.exports=GVe});var Bf=s(function(Irr,TD){"use strict";var PD=require("readable-stream").Readable,_D=require("@stdlib/assert/is-positive-number").isPrimitive,VVe=require("@stdlib/assert/is-error"),FVe=require("@stdlib/object/assign"),WVe=require("@stdlib/utils/inherit"),ND=require("@stdlib/utils/define-nonenumerable-property"),Vi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Cf=require("@stdlib/utils/define-read-only-accessor"),IVe=require("@stdlib/utils/define-read-write-accessor"),kVe=Pa().factory,LD=require("@stdlib/buffer/from-string"),zVe=require("@stdlib/utils/next-tick"),RD=require("@stdlib/string/format"),JVe=qD(),UVe=SD(),ps=ED();function CVe(){return this._prng.seed}function BVe(){return this._prng.seedLength}function DVe(){return this._prng.stateLength}function XVe(){return this._prng.byteLength}function YVe(){return this._prng.state}function HVe(r){this._prng.state=r}function ZVe(){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=LD(e):e=LD(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function QVe(r){var e;if(this._destroyed)return ps("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,zVe(t),this;function t(){r&&(ps("Stream was destroyed due to an error. Error: %s.",VVe(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(!_D(r))throw new TypeError(RD("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!_D(e))throw new TypeError(RD("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=FVe({},JVe),arguments.length>2&&(n=UVe(i,t),n))throw n;return ps("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),PD.call(this,i),ND(this,"_destroyed",!1),Vi(this,"_objectMode",i.objectMode),Vi(this,"_sep",i.sep),Vi(this,"_iter",i.iter),Vi(this,"_siter",i.siter),ND(this,"_i",0),Vi(this,"_prng",kVe(r,e,i)),Vi(this,"PRNG",this._prng.PRNG),this}WVe(Oe,PD);Cf(Oe.prototype,"seed",CVe);Cf(Oe.prototype,"seedLength",BVe);IVe(Oe.prototype,"state",YVe,HVe);Cf(Oe.prototype,"stateLength",DVe);Cf(Oe.prototype,"byteLength",XVe);Vi(Oe.prototype,"_read",ZVe);Vi(Oe.prototype,"destroy",QVe);TD.exports=Oe});var MD=s(function(krr,jD){"use strict";var $Ve=require("@stdlib/assert/is-plain-object"),KVe=require("@stdlib/object/assign"),e2e=require("@stdlib/string/format"),r2e=Bf();function t2e(r,e,t){var i;if(arguments.length>2){if(i=t,!$Ve(i))throw new TypeError(e2e("invalid argument. Options argument must be an object. Value: `%s`.",i));i=KVe({},t)}else i={};return i.objectMode=!0,new r2e(r,e,i)}jD.exports=t2e});var WD=s(function(zrr,FD){"use strict";var xD=require("@stdlib/assert/is-plain-object"),AD=require("@stdlib/object/assign"),GD=require("@stdlib/string/format"),VD=Bf();function i2e(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!xD(r))throw new TypeError(GD("invalid argument. Options argument must be an object. Value: `%s`.",r));n=AD({},r)}else if(i>2){if(!xD(t))throw new TypeError(GD("invalid argument. Options argument must be an object. Value: `%s`.",t));n=AD({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new VD(v,g,n)}function o(){return new VD(r,e,n)}}FD.exports=i2e});var zD=s(function(Jrr,kD){"use strict";var ID=require("@stdlib/utils/define-nonenumerable-read-only-property"),Dm=Bf(),n2e=MD(),a2e=WD();ID(Dm,"objectMode",n2e);ID(Dm,"factory",a2e);kD.exports=Dm});var JD=s(function(Urr,s2e){s2e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var BD=s(function(Crr,CD){"use strict";var u2e=require("@stdlib/assert/is-plain-object"),hr=require("@stdlib/assert/has-own-property"),o2e=require("@stdlib/assert/is-boolean").isPrimitive,v2e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,UD=require("@stdlib/assert/is-string").isPrimitive,g2e=require("@stdlib/assert/is-positive-integer").isPrimitive,f2e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,kn=require("@stdlib/string/format");function d2e(r,e){return u2e(e)?hr(e,"sep")&&(r.sep=e.sep,!UD(r.sep))?new TypeError(kn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):hr(e,"objectMode")&&(r.objectMode=e.objectMode,!o2e(r.objectMode))?new TypeError(kn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):hr(e,"encoding")&&(r.encoding=e.encoding,!UD(r.encoding)&&r.encoding!==null)?new TypeError(kn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):hr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!v2e(r.highWaterMark))?new TypeError(kn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):hr(e,"iter")&&(r.iter=e.iter,!f2e(r.iter))?new TypeError(kn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):hr(e,"siter")&&(r.siter=e.siter,!g2e(r.siter))?new TypeError(kn("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(kn("invalid argument. Options argument must be an object. Value: `%s`.",e))}CD.exports=d2e});var XD=s(function(Brr,DD){"use strict";var l2e=require("debug"),c2e=l2e("random:streams:laplace");DD.exports=c2e});var Xf=s(function(Drr,$D){"use strict";var QD=require("readable-stream").Readable,m2e=require("@stdlib/assert/is-positive-number").isPrimitive,h2e=require("@stdlib/assert/is-number").isPrimitive,p2e=require("@stdlib/math/base/assert/is-nan"),y2e=require("@stdlib/assert/is-error"),q2e=require("@stdlib/object/assign"),b2e=require("@stdlib/utils/inherit"),YD=require("@stdlib/utils/define-nonenumerable-property"),Fi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Df=require("@stdlib/utils/define-read-only-accessor"),w2e=require("@stdlib/utils/define-read-write-accessor"),S2e=Ta().factory,HD=require("@stdlib/buffer/from-string"),ZD=require("@stdlib/string/format"),O2e=require("@stdlib/utils/next-tick"),E2e=JD(),_2e=BD(),ys=XD();function N2e(){return this._prng.seed}function L2e(){return this._prng.seedLength}function R2e(){return this._prng.stateLength}function P2e(){return this._prng.byteLength}function T2e(){return this._prng.state}function j2e(r){this._prng.state=r}function M2e(){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=HD(e):e=HD(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function x2e(r){var e;if(this._destroyed)return ys("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,O2e(t),this;function t(){r&&(ys("Stream was destroyed due to an error. Error: %s.",y2e(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(!h2e(r)||p2e(r))throw new TypeError(ZD("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!m2e(e))throw new TypeError(ZD("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=q2e({},E2e),arguments.length>2&&(n=_2e(i,t),n))throw n;return ys("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),QD.call(this,i),YD(this,"_destroyed",!1),Fi(this,"_objectMode",i.objectMode),Fi(this,"_sep",i.sep),Fi(this,"_iter",i.iter),Fi(this,"_siter",i.siter),YD(this,"_i",0),Fi(this,"_prng",S2e(r,e,i)),Fi(this,"PRNG",this._prng.PRNG),this}b2e(Ee,QD);Df(Ee.prototype,"seed",N2e);Df(Ee.prototype,"seedLength",L2e);w2e(Ee.prototype,"state",T2e,j2e);Df(Ee.prototype,"stateLength",R2e);Df(Ee.prototype,"byteLength",P2e);Fi(Ee.prototype,"_read",M2e);Fi(Ee.prototype,"destroy",x2e);$D.exports=Ee});var e8=s(function(Xrr,KD){"use strict";var A2e=require("@stdlib/assert/is-plain-object"),G2e=require("@stdlib/object/assign"),V2e=require("@stdlib/string/format"),F2e=Xf();function W2e(r,e,t){var i;if(arguments.length>2){if(i=t,!A2e(i))throw new TypeError(V2e("invalid argument. Options argument must be an object. Value: `%s`.",i));i=G2e({},t)}else i={};return i.objectMode=!0,new F2e(r,e,i)}KD.exports=W2e});var s8=s(function(Yrr,a8){"use strict";var r8=require("@stdlib/assert/is-plain-object"),t8=require("@stdlib/object/assign"),i8=require("@stdlib/string/format"),n8=Xf();function I2e(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!r8(r))throw new TypeError(i8("invalid argument. Options argument must be an object. Value: `%s`.",r));n=t8({},r)}else if(i>2){if(!r8(t))throw new TypeError(i8("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 n8(v,g,n)}function o(){return new n8(r,e,n)}}a8.exports=I2e});var v8=s(function(Hrr,o8){"use strict";var u8=require("@stdlib/utils/define-nonenumerable-read-only-property"),Xm=Xf(),k2e=e8(),z2e=s8();u8(Xm,"objectMode",k2e);u8(Xm,"factory",z2e);o8.exports=Xm});var g8=s(function(Zrr,J2e){J2e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var l8=s(function(Qrr,d8){"use strict";var U2e=require("@stdlib/assert/is-plain-object"),pr=require("@stdlib/assert/has-own-property"),C2e=require("@stdlib/assert/is-boolean").isPrimitive,B2e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,f8=require("@stdlib/assert/is-string").isPrimitive,D2e=require("@stdlib/assert/is-positive-integer").isPrimitive,X2e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,zn=require("@stdlib/string/format");function Y2e(r,e){return U2e(e)?pr(e,"sep")&&(r.sep=e.sep,!f8(r.sep))?new TypeError(zn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):pr(e,"objectMode")&&(r.objectMode=e.objectMode,!C2e(r.objectMode))?new TypeError(zn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):pr(e,"encoding")&&(r.encoding=e.encoding,!f8(r.encoding)&&r.encoding!==null)?new TypeError(zn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):pr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!B2e(r.highWaterMark))?new TypeError(zn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):pr(e,"iter")&&(r.iter=e.iter,!X2e(r.iter))?new TypeError(zn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):pr(e,"siter")&&(r.siter=e.siter,!D2e(r.siter))?new TypeError(zn("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(zn("invalid argument. Options argument must be an object. Value: `%s`.",e))}d8.exports=Y2e});var m8=s(function($rr,c8){"use strict";var H2e=require("debug"),Z2e=H2e("random:streams:levy");c8.exports=Z2e});var Hf=s(function(Krr,b8){"use strict";var q8=require("readable-stream").Readable,Q2e=require("@stdlib/assert/is-positive-number").isPrimitive,$2e=require("@stdlib/assert/is-number").isPrimitive,K2e=require("@stdlib/math/base/assert/is-nan"),eFe=require("@stdlib/assert/is-error"),rFe=require("@stdlib/object/assign"),tFe=require("@stdlib/utils/inherit"),h8=require("@stdlib/utils/define-nonenumerable-property"),Wi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Yf=require("@stdlib/utils/define-read-only-accessor"),iFe=require("@stdlib/utils/define-read-write-accessor"),nFe=ja().factory,p8=require("@stdlib/buffer/from-string"),aFe=require("@stdlib/utils/next-tick"),y8=require("@stdlib/string/format"),sFe=g8(),uFe=l8(),qs=m8();function oFe(){return this._prng.seed}function vFe(){return this._prng.seedLength}function gFe(){return this._prng.stateLength}function fFe(){return this._prng.byteLength}function dFe(){return this._prng.state}function lFe(r){this._prng.state=r}function cFe(){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=p8(e):e=p8(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function mFe(r){var e;if(this._destroyed)return qs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,aFe(t),this;function t(){r&&(qs("Stream was destroyed due to an error. Error: %s.",eFe(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(!$2e(r)||K2e(r))throw new TypeError(y8("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!Q2e(e))throw new TypeError(y8("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=rFe({},sFe),arguments.length>2&&(n=uFe(i,t),n))throw n;return qs("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),q8.call(this,i),h8(this,"_destroyed",!1),Wi(this,"_objectMode",i.objectMode),Wi(this,"_sep",i.sep),Wi(this,"_iter",i.iter),Wi(this,"_siter",i.siter),h8(this,"_i",0),Wi(this,"_prng",nFe(r,e,i)),Wi(this,"PRNG",this._prng.PRNG),this}tFe(_e,q8);Yf(_e.prototype,"seed",oFe);Yf(_e.prototype,"seedLength",vFe);iFe(_e.prototype,"state",dFe,lFe);Yf(_e.prototype,"stateLength",gFe);Yf(_e.prototype,"byteLength",fFe);Wi(_e.prototype,"_read",cFe);Wi(_e.prototype,"destroy",mFe);b8.exports=_e});var S8=s(function(etr,w8){"use strict";var hFe=require("@stdlib/assert/is-plain-object"),pFe=require("@stdlib/object/assign"),yFe=require("@stdlib/string/format"),qFe=Hf();function bFe(r,e,t){var i;if(arguments.length>2){if(i=t,!hFe(i))throw new TypeError(yFe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=pFe({},t)}else i={};return i.objectMode=!0,new qFe(r,e,i)}w8.exports=bFe});var R8=s(function(rtr,L8){"use strict";var O8=require("@stdlib/assert/is-plain-object"),E8=require("@stdlib/object/assign"),_8=require("@stdlib/string/format"),N8=Hf();function wFe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!O8(r))throw new TypeError(_8("invalid argument. Options argument must be an object. Value: `%s`.",r));n=E8({},r)}else if(i>2){if(!O8(t))throw new TypeError(_8("invalid argument. Options argument must be an object. Value: `%s`.",t));n=E8({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new N8(v,g,n)}function o(){return new N8(r,e,n)}}L8.exports=wFe});var j8=s(function(ttr,T8){"use strict";var P8=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ym=Hf(),SFe=S8(),OFe=R8();P8(Ym,"objectMode",SFe);P8(Ym,"factory",OFe);T8.exports=Ym});var M8=s(function(itr,EFe){EFe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var G8=s(function(ntr,A8){"use strict";var _Fe=require("@stdlib/assert/is-plain-object"),yr=require("@stdlib/assert/has-own-property"),NFe=require("@stdlib/assert/is-boolean").isPrimitive,LFe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,x8=require("@stdlib/assert/is-string").isPrimitive,RFe=require("@stdlib/assert/is-positive-integer").isPrimitive,PFe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Jn=require("@stdlib/string/format");function TFe(r,e){return _Fe(e)?yr(e,"sep")&&(r.sep=e.sep,!x8(r.sep))?new TypeError(Jn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):yr(e,"objectMode")&&(r.objectMode=e.objectMode,!NFe(r.objectMode))?new TypeError(Jn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):yr(e,"encoding")&&(r.encoding=e.encoding,!x8(r.encoding)&&r.encoding!==null)?new TypeError(Jn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):yr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!LFe(r.highWaterMark))?new TypeError(Jn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):yr(e,"iter")&&(r.iter=e.iter,!PFe(r.iter))?new TypeError(Jn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):yr(e,"siter")&&(r.siter=e.siter,!RFe(r.siter))?new TypeError(Jn("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(Jn("invalid argument. Options argument must be an object. Value: `%s`.",e))}A8.exports=TFe});var F8=s(function(atr,V8){"use strict";var jFe=require("debug"),MFe=jFe("random:streams:logistic");V8.exports=MFe});var Qf=s(function(str,J8){"use strict";var z8=require("readable-stream").Readable,xFe=require("@stdlib/assert/is-positive-number").isPrimitive,AFe=require("@stdlib/assert/is-number").isPrimitive,GFe=require("@stdlib/math/base/assert/is-nan"),VFe=require("@stdlib/assert/is-error"),FFe=require("@stdlib/object/assign"),WFe=require("@stdlib/utils/inherit"),W8=require("@stdlib/utils/define-nonenumerable-property"),Ii=require("@stdlib/utils/define-nonenumerable-read-only-property"),Zf=require("@stdlib/utils/define-read-only-accessor"),IFe=require("@stdlib/utils/define-read-write-accessor"),kFe=Ma().factory,I8=require("@stdlib/buffer/from-string"),zFe=require("@stdlib/utils/next-tick"),k8=require("@stdlib/string/format"),JFe=M8(),UFe=G8(),bs=F8();function CFe(){return this._prng.seed}function BFe(){return this._prng.seedLength}function DFe(){return this._prng.stateLength}function XFe(){return this._prng.byteLength}function YFe(){return this._prng.state}function HFe(r){this._prng.state=r}function ZFe(){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=I8(e):e=I8(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function QFe(r){var e;if(this._destroyed)return bs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,zFe(t),this;function t(){r&&(bs("Stream was destroyed due to an error. Error: %s.",VFe(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(!AFe(r)||GFe(r))throw new TypeError(k8("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!xFe(e))throw new TypeError(k8("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=FFe({},JFe),arguments.length>2&&(n=UFe(i,t),n))throw n;return bs("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),z8.call(this,i),W8(this,"_destroyed",!1),Ii(this,"_objectMode",i.objectMode),Ii(this,"_sep",i.sep),Ii(this,"_iter",i.iter),Ii(this,"_siter",i.siter),W8(this,"_i",0),Ii(this,"_prng",kFe(r,e,i)),Ii(this,"PRNG",this._prng.PRNG),this}WFe(Ne,z8);Zf(Ne.prototype,"seed",CFe);Zf(Ne.prototype,"seedLength",BFe);IFe(Ne.prototype,"state",YFe,HFe);Zf(Ne.prototype,"stateLength",DFe);Zf(Ne.prototype,"byteLength",XFe);Ii(Ne.prototype,"_read",ZFe);Ii(Ne.prototype,"destroy",QFe);J8.exports=Ne});var C8=s(function(utr,U8){"use strict";var $Fe=require("@stdlib/assert/is-plain-object"),KFe=require("@stdlib/object/assign"),eWe=require("@stdlib/string/format"),rWe=Qf();function tWe(r,e,t){var i;if(arguments.length>2){if(i=t,!$Fe(i))throw new TypeError(eWe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=KFe({},t)}else i={};return i.objectMode=!0,new rWe(r,e,i)}U8.exports=tWe});var Z8=s(function(otr,H8){"use strict";var B8=require("@stdlib/assert/is-plain-object"),D8=require("@stdlib/object/assign"),X8=require("@stdlib/string/format"),Y8=Qf();function iWe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!B8(r))throw new TypeError(X8("invalid argument. Options argument must be an object. Value: `%s`.",r));n=D8({},r)}else if(i>2){if(!B8(t))throw new TypeError(X8("invalid argument. Options argument must be an object. Value: `%s`.",t));n=D8({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new Y8(v,g,n)}function o(){return new Y8(r,e,n)}}H8.exports=iWe});var K8=s(function(vtr,$8){"use strict";var Q8=require("@stdlib/utils/define-nonenumerable-read-only-property"),Hm=Qf(),nWe=C8(),aWe=Z8();Q8(Hm,"objectMode",nWe);Q8(Hm,"factory",aWe);$8.exports=Hm});var eX=s(function(gtr,sWe){sWe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var iX=s(function(ftr,tX){"use strict";var uWe=require("@stdlib/assert/is-plain-object"),qr=require("@stdlib/assert/has-own-property"),oWe=require("@stdlib/assert/is-boolean").isPrimitive,vWe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,rX=require("@stdlib/assert/is-string").isPrimitive,gWe=require("@stdlib/assert/is-positive-integer").isPrimitive,fWe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Un=require("@stdlib/string/format");function dWe(r,e){return uWe(e)?qr(e,"sep")&&(r.sep=e.sep,!rX(r.sep))?new TypeError(Un("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):qr(e,"objectMode")&&(r.objectMode=e.objectMode,!oWe(r.objectMode))?new TypeError(Un("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):qr(e,"encoding")&&(r.encoding=e.encoding,!rX(r.encoding)&&r.encoding!==null)?new TypeError(Un("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):qr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!vWe(r.highWaterMark))?new TypeError(Un("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):qr(e,"iter")&&(r.iter=e.iter,!fWe(r.iter))?new TypeError(Un("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):qr(e,"siter")&&(r.siter=e.siter,!gWe(r.siter))?new TypeError(Un("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(Un("invalid argument. Options argument must be an object. Value: `%s`.",e))}tX.exports=dWe});var aX=s(function(dtr,nX){"use strict";var lWe=require("debug"),cWe=lWe("random:streams:lognormal");nX.exports=cWe});var Kf=s(function(ltr,gX){"use strict";var vX=require("readable-stream").Readable,mWe=require("@stdlib/assert/is-positive-number").isPrimitive,hWe=require("@stdlib/assert/is-number").isPrimitive,pWe=require("@stdlib/math/base/assert/is-nan"),yWe=require("@stdlib/assert/is-error"),qWe=require("@stdlib/object/assign"),bWe=require("@stdlib/utils/inherit"),sX=require("@stdlib/utils/define-nonenumerable-property"),ki=require("@stdlib/utils/define-nonenumerable-read-only-property"),$f=require("@stdlib/utils/define-read-only-accessor"),wWe=require("@stdlib/utils/define-read-write-accessor"),SWe=dn().factory,uX=require("@stdlib/buffer/from-string"),OWe=require("@stdlib/utils/next-tick"),oX=require("@stdlib/string/format"),EWe=eX(),_We=iX(),ws=aX();function NWe(){return this._prng.seed}function LWe(){return this._prng.seedLength}function RWe(){return this._prng.stateLength}function PWe(){return this._prng.byteLength}function TWe(){return this._prng.state}function jWe(r){this._prng.state=r}function MWe(){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=uX(e):e=uX(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function xWe(r){var e;if(this._destroyed)return ws("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,OWe(t),this;function t(){r&&(ws("Stream was destroyed due to an error. Error: %s.",yWe(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(!hWe(r)||pWe(r))throw new TypeError(oX("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!mWe(e))throw new TypeError(oX("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=qWe({},EWe),arguments.length>2&&(n=_We(i,t),n))throw n;return ws("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),vX.call(this,i),sX(this,"_destroyed",!1),ki(this,"_objectMode",i.objectMode),ki(this,"_sep",i.sep),ki(this,"_iter",i.iter),ki(this,"_siter",i.siter),sX(this,"_i",0),ki(this,"_prng",SWe(r,e,i)),ki(this,"PRNG",this._prng.PRNG),this}bWe(Le,vX);$f(Le.prototype,"seed",NWe);$f(Le.prototype,"seedLength",LWe);wWe(Le.prototype,"state",TWe,jWe);$f(Le.prototype,"stateLength",RWe);$f(Le.prototype,"byteLength",PWe);ki(Le.prototype,"_read",MWe);ki(Le.prototype,"destroy",xWe);gX.exports=Le});var dX=s(function(ctr,fX){"use strict";var AWe=require("@stdlib/assert/is-plain-object"),GWe=require("@stdlib/object/assign"),VWe=require("@stdlib/string/format"),FWe=Kf();function WWe(r,e,t){var i;if(arguments.length>2){if(i=t,!AWe(i))throw new TypeError(VWe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=GWe({},t)}else i={};return i.objectMode=!0,new FWe(r,e,i)}fX.exports=WWe});var yX=s(function(mtr,pX){"use strict";var lX=require("@stdlib/assert/is-plain-object"),cX=require("@stdlib/object/assign"),mX=require("@stdlib/string/format"),hX=Kf();function IWe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!lX(r))throw new TypeError(mX("invalid argument. Options argument must be an object. Value: `%s`.",r));n=cX({},r)}else if(i>2){if(!lX(t))throw new TypeError(mX("invalid argument. Options argument must be an object. Value: `%s`.",t));n=cX({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new hX(v,g,n)}function o(){return new hX(r,e,n)}}pX.exports=IWe});var wX=s(function(htr,bX){"use strict";var qX=require("@stdlib/utils/define-nonenumerable-read-only-property"),Zm=Kf(),kWe=dX(),zWe=yX();qX(Zm,"objectMode",kWe);qX(Zm,"factory",zWe);bX.exports=Zm});var SX=s(function(ptr,JWe){JWe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308,normalized:!1}});var NX=s(function(ytr,_X){"use strict";var UWe=require("@stdlib/assert/is-plain-object"),br=require("@stdlib/assert/has-own-property"),OX=require("@stdlib/assert/is-boolean").isPrimitive,CWe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,EX=require("@stdlib/assert/is-string").isPrimitive,BWe=require("@stdlib/assert/is-positive-integer").isPrimitive,DWe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,zi=require("@stdlib/string/format");function XWe(r,e){return UWe(e)?br(e,"sep")&&(r.sep=e.sep,!EX(r.sep))?new TypeError(zi("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):br(e,"objectMode")&&(r.objectMode=e.objectMode,!OX(r.objectMode))?new TypeError(zi("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):br(e,"encoding")&&(r.encoding=e.encoding,!EX(r.encoding)&&r.encoding!==null)?new TypeError(zi("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(zi("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(zi("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(zi("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):br(e,"normalized")&&(r.normalized=e.normalized,!OX(r.normalized))?new TypeError(zi("invalid option. `%s` option must be a boolean. Option: `%s`.","normalized",r.normalized)):(br(e,"seed")&&(r.seed=e.seed),br(e,"state")&&(r.state=e.state),br(e,"copy")&&(r.copy=e.copy),null):new TypeError(zi("invalid argument. Options argument must be an object. Value: `%s`.",e))}_X.exports=XWe});var RX=s(function(qtr,LX){"use strict";var YWe=require("debug"),HWe=YWe("random:streams:minstd");LX.exports=HWe});var rd=s(function(btr,MX){"use strict";var jX=require("readable-stream").Readable,ZWe=require("@stdlib/assert/is-error"),QWe=require("@stdlib/object/assign"),$We=require("@stdlib/utils/inherit"),PX=require("@stdlib/utils/define-nonenumerable-property"),Cn=require("@stdlib/utils/define-nonenumerable-read-only-property"),ed=require("@stdlib/utils/define-read-only-accessor"),KWe=require("@stdlib/utils/define-read-write-accessor"),eIe=$().factory,TX=require("@stdlib/buffer/from-string"),rIe=require("@stdlib/utils/next-tick"),tIe=SX(),iIe=NX(),Ss=RX();function nIe(){return this._prng.seed}function aIe(){return this._prng.seedLength}function sIe(){return this._prng.stateLength}function uIe(){return this._prng.byteLength}function oIe(){return this._prng.state}function vIe(r){this._prng.state=r}function gIe(){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=TX(e):e=TX(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function fIe(r){var e;if(this._destroyed)return Ss("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,rIe(t),this;function t(){r&&(Ss("Stream was destroyed due to an error. Error: %s.",ZWe(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=QWe({},tIe),arguments.length>0&&(i=iIe(t,r),i))throw i;return Ss("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),jX.call(this,t),PX(this,"_destroyed",!1),Cn(this,"_objectMode",t.objectMode),Cn(this,"_sep",t.sep),Cn(this,"_iter",t.iter),Cn(this,"_siter",t.siter),PX(this,"_i",0),e=eIe(t),t.normalized&&(e=e.normalized),Cn(this,"_prng",e),this}$We(Re,jX);ed(Re.prototype,"seed",nIe);ed(Re.prototype,"seedLength",aIe);KWe(Re.prototype,"state",oIe,vIe);ed(Re.prototype,"stateLength",sIe);ed(Re.prototype,"byteLength",uIe);Cn(Re.prototype,"_read",gIe);Cn(Re.prototype,"destroy",fIe);MX.exports=Re});var AX=s(function(wtr,xX){"use strict";var dIe=require("@stdlib/assert/is-plain-object"),lIe=require("@stdlib/object/assign"),cIe=require("@stdlib/string/format"),mIe=rd();function hIe(r){var e;if(arguments.length>0){if(e=r,!dIe(e))throw new TypeError(cIe("invalid argument. Options argument must be an object. Value: `%s`.",e));e=lIe({},r)}else e={};return e.objectMode=!0,new mIe(e)}xX.exports=hIe});var VX=s(function(Str,GX){"use strict";var pIe=require("@stdlib/assert/is-plain-object"),yIe=require("@stdlib/object/assign"),qIe=require("@stdlib/string/format"),bIe=rd();function wIe(r){var e;if(arguments.length>0){if(!pIe(r))throw new TypeError(qIe("invalid argument. Options argument must be an object. Value: `%s`.",r));e=yIe({},r)}else e={};return t;function t(){return new bIe(e)}}GX.exports=wIe});var IX=s(function(Otr,WX){"use strict";var FX=require("@stdlib/utils/define-nonenumerable-read-only-property"),Qm=rd(),SIe=AX(),OIe=VX();FX(Qm,"objectMode",SIe);FX(Qm,"factory",OIe);WX.exports=Qm});var kX=s(function(Etr,EIe){EIe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308,normalized:!1}});var CX=s(function(_tr,UX){"use strict";var _Ie=require("@stdlib/assert/is-plain-object"),wr=require("@stdlib/assert/has-own-property"),zX=require("@stdlib/assert/is-boolean").isPrimitive,NIe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,JX=require("@stdlib/assert/is-string").isPrimitive,LIe=require("@stdlib/assert/is-positive-integer").isPrimitive,RIe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Ji=require("@stdlib/string/format");function PIe(r,e){return _Ie(e)?wr(e,"sep")&&(r.sep=e.sep,!JX(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,!zX(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,!JX(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,!NIe(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,!RIe(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,!LIe(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,!zX(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))}UX.exports=PIe});var DX=s(function(Ntr,BX){"use strict";var TIe=require("debug"),jIe=TIe("random:streams:minstd-shuffle");BX.exports=jIe});var id=s(function(Ltr,ZX){"use strict";var HX=require("readable-stream").Readable,MIe=require("@stdlib/assert/is-error"),xIe=require("@stdlib/object/assign"),AIe=require("@stdlib/utils/inherit"),XX=require("@stdlib/utils/define-nonenumerable-property"),Bn=require("@stdlib/utils/define-nonenumerable-read-only-property"),td=require("@stdlib/utils/define-read-only-accessor"),GIe=require("@stdlib/utils/define-read-write-accessor"),VIe=ee().factory,YX=require("@stdlib/buffer/from-string"),FIe=require("@stdlib/utils/next-tick"),WIe=kX(),IIe=CX(),Os=DX();function kIe(){return this._prng.seed}function zIe(){return this._prng.seedLength}function JIe(){return this._prng.stateLength}function UIe(){return this._prng.byteLength}function CIe(){return this._prng.state}function BIe(r){this._prng.state=r}function DIe(){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=YX(e):e=YX(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function XIe(r){var e;if(this._destroyed)return Os("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,FIe(t),this;function t(){r&&(Os("Stream was destroyed due to an error. Error: %s.",MIe(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=xIe({},WIe),arguments.length>0&&(i=IIe(t,r),i))throw i;return Os("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),HX.call(this,t),XX(this,"_destroyed",!1),Bn(this,"_objectMode",t.objectMode),Bn(this,"_sep",t.sep),Bn(this,"_iter",t.iter),Bn(this,"_siter",t.siter),XX(this,"_i",0),e=VIe(t),t.normalized&&(e=e.normalized),Bn(this,"_prng",e),this}AIe(Pe,HX);td(Pe.prototype,"seed",kIe);td(Pe.prototype,"seedLength",zIe);GIe(Pe.prototype,"state",CIe,BIe);td(Pe.prototype,"stateLength",JIe);td(Pe.prototype,"byteLength",UIe);Bn(Pe.prototype,"_read",DIe);Bn(Pe.prototype,"destroy",XIe);ZX.exports=Pe});var $X=s(function(Rtr,QX){"use strict";var YIe=require("@stdlib/assert/is-plain-object"),HIe=require("@stdlib/object/assign"),ZIe=require("@stdlib/string/format"),QIe=id();function $Ie(r){var e;if(arguments.length>0){if(e=r,!YIe(e))throw new TypeError(ZIe("invalid argument. Options argument must be an object. Value: `%s`.",e));e=HIe({},r)}else e={};return e.objectMode=!0,new QIe(e)}QX.exports=$Ie});var e7=s(function(Ptr,KX){"use strict";var KIe=require("@stdlib/assert/is-plain-object"),eke=require("@stdlib/object/assign"),rke=require("@stdlib/string/format"),tke=id();function ike(r){var e;if(arguments.length>0){if(!KIe(r))throw new TypeError(rke("invalid argument. Options argument must be an object. Value: `%s`.",r));e=eke({},r)}else e={};return t;function t(){return new tke(e)}}KX.exports=ike});var i7=s(function(Ttr,t7){"use strict";var r7=require("@stdlib/utils/define-nonenumerable-read-only-property"),$m=id(),nke=$X(),ake=e7();r7($m,"objectMode",nke);r7($m,"factory",ake);t7.exports=$m});var n7=s(function(jtr,ske){ske.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308,normalized:!1}});var o7=s(function(Mtr,u7){"use strict";var uke=require("@stdlib/assert/is-plain-object"),Sr=require("@stdlib/assert/has-own-property"),a7=require("@stdlib/assert/is-boolean").isPrimitive,oke=require("@stdlib/assert/is-nonnegative-number").isPrimitive,s7=require("@stdlib/assert/is-string").isPrimitive,vke=require("@stdlib/assert/is-positive-integer").isPrimitive,gke=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Ui=require("@stdlib/string/format");function fke(r,e){return uke(e)?Sr(e,"sep")&&(r.sep=e.sep,!s7(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,!a7(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,!s7(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,!oke(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,!gke(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,!vke(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,!a7(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))}u7.exports=fke});var g7=s(function(xtr,v7){"use strict";var dke=require("debug"),lke=dke("random:streams:mt19937");v7.exports=lke});var ad=s(function(Atr,c7){"use strict";var l7=require("readable-stream").Readable,cke=require("@stdlib/assert/is-error"),mke=require("@stdlib/object/assign"),hke=require("@stdlib/utils/inherit"),f7=require("@stdlib/utils/define-nonenumerable-property"),Dn=require("@stdlib/utils/define-nonenumerable-read-only-property"),nd=require("@stdlib/utils/define-read-only-accessor"),pke=require("@stdlib/utils/define-read-write-accessor"),yke=T().factory,d7=require("@stdlib/buffer/from-string"),qke=require("@stdlib/utils/next-tick"),bke=n7(),wke=o7(),Es=g7();function Ske(){return this._prng.seed}function Oke(){return this._prng.seedLength}function Eke(){return this._prng.stateLength}function _ke(){return this._prng.byteLength}function Nke(){return this._prng.state}function Lke(r){this._prng.state=r}function Rke(){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=d7(e):e=d7(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function Pke(r){var e;if(this._destroyed)return Es("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,qke(t),this;function t(){r&&(Es("Stream was destroyed due to an error. Error: %s.",cke(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=mke({},bke),arguments.length>0&&(i=wke(t,r),i))throw i;return Es("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),l7.call(this,t),f7(this,"_destroyed",!1),Dn(this,"_objectMode",t.objectMode),Dn(this,"_sep",t.sep),Dn(this,"_iter",t.iter),Dn(this,"_siter",t.siter),f7(this,"_i",0),e=yke(t),t.normalized&&(e=e.normalized),Dn(this,"_prng",e),this}hke(Te,l7);nd(Te.prototype,"seed",Ske);nd(Te.prototype,"seedLength",Oke);pke(Te.prototype,"state",Nke,Lke);nd(Te.prototype,"stateLength",Eke);nd(Te.prototype,"byteLength",_ke);Dn(Te.prototype,"_read",Rke);Dn(Te.prototype,"destroy",Pke);c7.exports=Te});var h7=s(function(Gtr,m7){"use strict";var Tke=require("@stdlib/assert/is-plain-object"),jke=require("@stdlib/object/assign"),Mke=require("@stdlib/string/format"),xke=ad();function Ake(r){var e;if(arguments.length>0){if(e=r,!Tke(e))throw new TypeError(Mke("invalid argument. Options argument must be an object. Value: `%s`.",e));e=jke({},r)}else e={};return e.objectMode=!0,new xke(e)}m7.exports=Ake});var y7=s(function(Vtr,p7){"use strict";var Gke=require("@stdlib/assert/is-plain-object"),Vke=require("@stdlib/object/assign"),Fke=require("@stdlib/string/format"),Wke=ad();function Ike(r){var e;if(arguments.length>0){if(!Gke(r))throw new TypeError(Fke("invalid argument. Options argument must be an object. Value: `%s`.",r));e=Vke({},r)}else e={};return t;function t(){return new Wke(e)}}p7.exports=Ike});var w7=s(function(Ftr,b7){"use strict";var q7=require("@stdlib/utils/define-nonenumerable-read-only-property"),Km=ad(),kke=h7(),zke=y7();q7(Km,"objectMode",kke);q7(Km,"factory",zke);b7.exports=Km});var S7=s(function(Wtr,Jke){Jke.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var _7=s(function(Itr,E7){"use strict";var Uke=require("@stdlib/assert/is-plain-object"),Or=require("@stdlib/assert/has-own-property"),Cke=require("@stdlib/assert/is-boolean").isPrimitive,Bke=require("@stdlib/assert/is-nonnegative-number").isPrimitive,O7=require("@stdlib/assert/is-string").isPrimitive,Dke=require("@stdlib/assert/is-positive-integer").isPrimitive,Xke=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Xn=require("@stdlib/string/format");function Yke(r,e){return Uke(e)?Or(e,"sep")&&(r.sep=e.sep,!O7(r.sep))?new TypeError(Xn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Or(e,"objectMode")&&(r.objectMode=e.objectMode,!Cke(r.objectMode))?new TypeError(Xn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Or(e,"encoding")&&(r.encoding=e.encoding,!O7(r.encoding)&&r.encoding!==null)?new TypeError(Xn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Or(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!Bke(r.highWaterMark))?new TypeError(Xn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Or(e,"iter")&&(r.iter=e.iter,!Xke(r.iter))?new TypeError(Xn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Or(e,"siter")&&(r.siter=e.siter,!Dke(r.siter))?new TypeError(Xn("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(Xn("invalid argument. Options argument must be an object. Value: `%s`.",e))}E7.exports=Yke});var L7=s(function(ktr,N7){"use strict";var Hke=require("debug"),Zke=Hke("random:streams:negative-binomial");N7.exports=Zke});var ud=s(function(ztr,M7){"use strict";var j7=require("readable-stream").Readable,Qke=require("@stdlib/assert/is-positive-number").isPrimitive,$ke=require("@stdlib/assert/is-probability").isPrimitive,Kke=require("@stdlib/assert/is-error"),eze=require("@stdlib/object/assign"),rze=require("@stdlib/utils/inherit"),R7=require("@stdlib/utils/define-nonenumerable-property"),Ci=require("@stdlib/utils/define-nonenumerable-read-only-property"),sd=require("@stdlib/utils/define-read-only-accessor"),tze=require("@stdlib/utils/define-read-write-accessor"),ize=Ia().factory,P7=require("@stdlib/buffer/from-string"),nze=require("@stdlib/utils/next-tick"),T7=require("@stdlib/string/format"),aze=S7(),sze=_7(),_s=L7();function uze(){return this._prng.seed}function oze(){return this._prng.seedLength}function vze(){return this._prng.stateLength}function gze(){return this._prng.byteLength}function fze(){return this._prng.state}function dze(r){this._prng.state=r}function lze(){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=P7(e):e=P7(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function cze(r){var e;if(this._destroyed)return _s("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,nze(t),this;function t(){r&&(_s("Stream was destroyed due to an error. Error: %s.",Kke(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(!Qke(r))throw new TypeError(T7("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!$ke(e))throw new TypeError(T7("invalid argument. Second argument must be a probability. Value: `%s`.",e));if(i=eze({},aze),arguments.length>2&&(n=sze(i,t),n))throw n;return _s("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),j7.call(this,i),R7(this,"_destroyed",!1),Ci(this,"_objectMode",i.objectMode),Ci(this,"_sep",i.sep),Ci(this,"_iter",i.iter),Ci(this,"_siter",i.siter),R7(this,"_i",0),Ci(this,"_prng",ize(r,e,i)),Ci(this,"PRNG",this._prng.PRNG),this}rze(je,j7);sd(je.prototype,"seed",uze);sd(je.prototype,"seedLength",oze);tze(je.prototype,"state",fze,dze);sd(je.prototype,"stateLength",vze);sd(je.prototype,"byteLength",gze);Ci(je.prototype,"_read",lze);Ci(je.prototype,"destroy",cze);M7.exports=je});var A7=s(function(Jtr,x7){"use strict";var mze=require("@stdlib/assert/is-plain-object"),hze=require("@stdlib/object/assign"),pze=require("@stdlib/string/format"),yze=ud();function qze(r,e,t){var i;if(arguments.length>2){if(i=t,!mze(i))throw new TypeError(pze("invalid argument. Options argument must be an object. Value: `%s`.",i));i=hze({},t)}else i={};return i.objectMode=!0,new yze(r,e,i)}x7.exports=qze});var k7=s(function(Utr,I7){"use strict";var G7=require("@stdlib/assert/is-plain-object"),V7=require("@stdlib/object/assign"),F7=require("@stdlib/string/format"),W7=ud();function bze(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!G7(r))throw new TypeError(F7("invalid argument. Options argument must be an object. Value: `%s`.",r));n=V7({},r)}else if(i>2){if(!G7(t))throw new TypeError(F7("invalid argument. Options argument must be an object. Value: `%s`.",t));n=V7({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new W7(v,g,n)}function o(){return new W7(r,e,n)}}I7.exports=bze});var U7=s(function(Ctr,J7){"use strict";var z7=require("@stdlib/utils/define-nonenumerable-read-only-property"),eh=ud(),wze=A7(),Sze=k7();z7(eh,"objectMode",wze);z7(eh,"factory",Sze);J7.exports=eh});var C7=s(function(Btr,Oze){Oze.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var X7=s(function(Dtr,D7){"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,B7=require("@stdlib/assert/is-string").isPrimitive,Lze=require("@stdlib/assert/is-positive-integer").isPrimitive,Rze=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Yn=require("@stdlib/string/format");function Pze(r,e){return Eze(e)?Er(e,"sep")&&(r.sep=e.sep,!B7(r.sep))?new TypeError(Yn("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(Yn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Er(e,"encoding")&&(r.encoding=e.encoding,!B7(r.encoding)&&r.encoding!==null)?new TypeError(Yn("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(Yn("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(Yn("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(Yn("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(Yn("invalid argument. Options argument must be an object. Value: `%s`.",e))}D7.exports=Pze});var H7=s(function(Xtr,Y7){"use strict";var Tze=require("debug"),jze=Tze("random:streams:normal");Y7.exports=jze});var vd=s(function(Ytr,e5){"use strict";var K7=require("readable-stream").Readable,Mze=require("@stdlib/assert/is-positive-number").isPrimitive,xze=require("@stdlib/assert/is-number").isPrimitive,Aze=require("@stdlib/math/base/assert/is-nan"),Gze=require("@stdlib/assert/is-error"),Vze=require("@stdlib/object/assign"),Fze=require("@stdlib/utils/inherit"),Z7=require("@stdlib/utils/define-nonenumerable-property"),Bi=require("@stdlib/utils/define-nonenumerable-read-only-property"),od=require("@stdlib/utils/define-read-only-accessor"),Wze=require("@stdlib/utils/define-read-write-accessor"),Ize=cn().factory,Q7=require("@stdlib/buffer/from-string"),kze=require("@stdlib/utils/next-tick"),$7=require("@stdlib/string/format"),zze=C7(),Jze=X7(),Ns=H7();function Uze(){return this._prng.seed}function Cze(){return this._prng.seedLength}function Bze(){return this._prng.stateLength}function Dze(){return this._prng.byteLength}function Xze(){return this._prng.state}function Yze(r){this._prng.state=r}function Hze(){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=Q7(e):e=Q7(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function Zze(r){var e;if(this._destroyed)return Ns("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,kze(t),this;function t(){r&&(Ns("Stream was destroyed due to an error. Error: %s.",Gze(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(!xze(r)||Aze(r))throw new TypeError($7("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!Mze(e))throw new TypeError($7("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=Vze({},zze),arguments.length>2&&(n=Jze(i,t),n))throw n;return Ns("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),K7.call(this,i),Z7(this,"_destroyed",!1),Bi(this,"_objectMode",i.objectMode),Bi(this,"_sep",i.sep),Bi(this,"_iter",i.iter),Bi(this,"_siter",i.siter),Z7(this,"_i",0),Bi(this,"_prng",Ize(r,e,i)),Bi(this,"PRNG",this._prng.PRNG),this}Fze(Me,K7);od(Me.prototype,"seed",Uze);od(Me.prototype,"seedLength",Cze);Wze(Me.prototype,"state",Xze,Yze);od(Me.prototype,"stateLength",Bze);od(Me.prototype,"byteLength",Dze);Bi(Me.prototype,"_read",Hze);Bi(Me.prototype,"destroy",Zze);e5.exports=Me});var t5=s(function(Htr,r5){"use strict";var Qze=require("@stdlib/assert/is-plain-object"),$ze=require("@stdlib/object/assign"),Kze=require("@stdlib/string/format"),e3e=vd();function r3e(r,e,t){var i;if(arguments.length>2){if(i=t,!Qze(i))throw new TypeError(Kze("invalid argument. Options argument must be an object. Value: `%s`.",i));i=$ze({},t)}else i={};return i.objectMode=!0,new e3e(r,e,i)}r5.exports=r3e});var o5=s(function(Ztr,u5){"use strict";var i5=require("@stdlib/assert/is-plain-object"),n5=require("@stdlib/object/assign"),a5=require("@stdlib/string/format"),s5=vd();function t3e(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!i5(r))throw new TypeError(a5("invalid argument. Options argument must be an object. Value: `%s`.",r));n=n5({},r)}else if(i>2){if(!i5(t))throw new TypeError(a5("invalid argument. Options argument must be an object. Value: `%s`.",t));n=n5({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new s5(v,g,n)}function o(){return new s5(r,e,n)}}u5.exports=t3e});var f5=s(function(Qtr,g5){"use strict";var v5=require("@stdlib/utils/define-nonenumerable-read-only-property"),rh=vd(),i3e=t5(),n3e=o5();v5(rh,"objectMode",i3e);v5(rh,"factory",n3e);g5.exports=rh});var d5=s(function($tr,a3e){a3e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var m5=s(function(Ktr,c5){"use strict";var s3e=require("@stdlib/assert/is-plain-object"),_r=require("@stdlib/assert/has-own-property"),u3e=require("@stdlib/assert/is-boolean").isPrimitive,o3e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,l5=require("@stdlib/assert/is-string").isPrimitive,v3e=require("@stdlib/assert/is-positive-integer").isPrimitive,g3e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Hn=require("@stdlib/string/format");function f3e(r,e){return s3e(e)?_r(e,"sep")&&(r.sep=e.sep,!l5(r.sep))?new TypeError(Hn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):_r(e,"objectMode")&&(r.objectMode=e.objectMode,!u3e(r.objectMode))?new TypeError(Hn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):_r(e,"encoding")&&(r.encoding=e.encoding,!l5(r.encoding)&&r.encoding!==null)?new TypeError(Hn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):_r(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!o3e(r.highWaterMark))?new TypeError(Hn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):_r(e,"iter")&&(r.iter=e.iter,!g3e(r.iter))?new TypeError(Hn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):_r(e,"siter")&&(r.siter=e.siter,!v3e(r.siter))?new TypeError(Hn("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(Hn("invalid argument. Options argument must be an object. Value: `%s`.",e))}c5.exports=f3e});var p5=s(function(eir,h5){"use strict";var d3e=require("debug"),l3e=d3e("random:streams:pareto1");h5.exports=l3e});var fd=s(function(rir,O5){"use strict";var S5=require("readable-stream").Readable,y5=require("@stdlib/assert/is-positive-number").isPrimitive,c3e=require("@stdlib/assert/is-error"),m3e=require("@stdlib/object/assign"),h3e=require("@stdlib/utils/inherit"),q5=require("@stdlib/utils/define-nonenumerable-property"),Di=require("@stdlib/utils/define-nonenumerable-read-only-property"),gd=require("@stdlib/utils/define-read-only-accessor"),p3e=require("@stdlib/utils/define-read-write-accessor"),y3e=za().factory,b5=require("@stdlib/buffer/from-string"),q3e=require("@stdlib/utils/next-tick"),w5=require("@stdlib/string/format"),b3e=d5(),w3e=m5(),Ls=p5();function S3e(){return this._prng.seed}function O3e(){return this._prng.seedLength}function E3e(){return this._prng.stateLength}function _3e(){return this._prng.byteLength}function N3e(){return this._prng.state}function L3e(r){this._prng.state=r}function R3e(){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=b5(e):e=b5(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function P3e(r){var e;if(this._destroyed)return Ls("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,q3e(t),this;function t(){r&&(Ls("Stream was destroyed due to an error. Error: %s.",c3e(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(!y5(r))throw new TypeError(w5("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!y5(e))throw new TypeError(w5("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=m3e({},b3e),arguments.length>2&&(n=w3e(i,t),n))throw n;return Ls("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),S5.call(this,i),q5(this,"_destroyed",!1),Di(this,"_objectMode",i.objectMode),Di(this,"_sep",i.sep),Di(this,"_iter",i.iter),Di(this,"_siter",i.siter),q5(this,"_i",0),Di(this,"_prng",y3e(r,e,i)),Di(this,"PRNG",this._prng.PRNG),this}h3e(xe,S5);gd(xe.prototype,"seed",S3e);gd(xe.prototype,"seedLength",O3e);p3e(xe.prototype,"state",N3e,L3e);gd(xe.prototype,"stateLength",E3e);gd(xe.prototype,"byteLength",_3e);Di(xe.prototype,"_read",R3e);Di(xe.prototype,"destroy",P3e);O5.exports=xe});var _5=s(function(tir,E5){"use strict";var T3e=require("@stdlib/assert/is-plain-object"),j3e=require("@stdlib/object/assign"),M3e=require("@stdlib/string/format"),x3e=fd();function A3e(r,e,t){var i;if(arguments.length>2){if(i=t,!T3e(i))throw new TypeError(M3e("invalid argument. Options argument must be an object. Value: `%s`.",i));i=j3e({},t)}else i={};return i.objectMode=!0,new x3e(r,e,i)}E5.exports=A3e});var j5=s(function(iir,T5){"use strict";var N5=require("@stdlib/assert/is-plain-object"),L5=require("@stdlib/object/assign"),R5=require("@stdlib/string/format"),P5=fd();function G3e(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!N5(r))throw new TypeError(R5("invalid argument. Options argument must be an object. Value: `%s`.",r));n=L5({},r)}else if(i>2){if(!N5(t))throw new TypeError(R5("invalid argument. Options argument must be an object. Value: `%s`.",t));n=L5({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new P5(v,g,n)}function o(){return new P5(r,e,n)}}T5.exports=G3e});var A5=s(function(nir,x5){"use strict";var M5=require("@stdlib/utils/define-nonenumerable-read-only-property"),th=fd(),V3e=_5(),F3e=j5();M5(th,"objectMode",V3e);M5(th,"factory",F3e);x5.exports=th});var G5=s(function(air,W3e){W3e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var W5=s(function(sir,F5){"use strict";var I3e=require("@stdlib/assert/is-plain-object"),Nr=require("@stdlib/assert/has-own-property"),k3e=require("@stdlib/assert/is-boolean").isPrimitive,z3e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,V5=require("@stdlib/assert/is-string").isPrimitive,J3e=require("@stdlib/assert/is-positive-integer").isPrimitive,U3e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Zn=require("@stdlib/string/format");function C3e(r,e){return I3e(e)?Nr(e,"sep")&&(r.sep=e.sep,!V5(r.sep))?new TypeError(Zn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Nr(e,"objectMode")&&(r.objectMode=e.objectMode,!k3e(r.objectMode))?new TypeError(Zn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Nr(e,"encoding")&&(r.encoding=e.encoding,!V5(r.encoding)&&r.encoding!==null)?new TypeError(Zn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Nr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!z3e(r.highWaterMark))?new TypeError(Zn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Nr(e,"iter")&&(r.iter=e.iter,!U3e(r.iter))?new TypeError(Zn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Nr(e,"siter")&&(r.siter=e.siter,!J3e(r.siter))?new TypeError(Zn("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(Zn("invalid argument. Options argument must be an object. Value: `%s`.",e))}F5.exports=C3e});var k5=s(function(uir,I5){"use strict";var B3e=require("debug"),D3e=B3e("random:streams:poisson");I5.exports=D3e});var ld=s(function(oir,C5){"use strict";var U5=require("readable-stream").Readable,X3e=require("@stdlib/assert/is-positive-number").isPrimitive,Y3e=require("@stdlib/assert/is-error"),H3e=require("@stdlib/object/assign"),Z3e=require("@stdlib/utils/inherit"),z5=require("@stdlib/utils/define-nonenumerable-property"),Xi=require("@stdlib/utils/define-nonenumerable-read-only-property"),dd=require("@stdlib/utils/define-read-only-accessor"),Q3e=require("@stdlib/utils/define-read-write-accessor"),$3e=ln().factory,J5=require("@stdlib/buffer/from-string"),K3e=require("@stdlib/string/format"),eJe=require("@stdlib/utils/next-tick"),rJe=G5(),tJe=W5(),Rs=k5();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=J5(e):e=J5(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.",Y3e(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(!X3e(r))throw new TypeError(K3e("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(t=H3e({},rJe),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)),U5.call(this,t),z5(this,"_destroyed",!1),Xi(this,"_objectMode",t.objectMode),Xi(this,"_sep",t.sep),Xi(this,"_iter",t.iter),Xi(this,"_siter",t.siter),z5(this,"_i",0),Xi(this,"_prng",$3e(r,t)),Xi(this,"PRNG",this._prng.PRNG),this}Z3e(Ae,U5);dd(Ae.prototype,"seed",iJe);dd(Ae.prototype,"seedLength",nJe);Q3e(Ae.prototype,"state",uJe,oJe);dd(Ae.prototype,"stateLength",aJe);dd(Ae.prototype,"byteLength",sJe);Xi(Ae.prototype,"_read",vJe);Xi(Ae.prototype,"destroy",gJe);C5.exports=Ae});var D5=s(function(vir,B5){"use strict";var fJe=require("@stdlib/assert/is-plain-object"),dJe=require("@stdlib/object/assign"),lJe=require("@stdlib/string/format"),cJe=ld();function mJe(r,e){var t;if(arguments.length>1){if(t=e,!fJe(t))throw new TypeError(lJe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=dJe({},e)}else t={};return t.objectMode=!0,new cJe(r,t)}B5.exports=mJe});var $5=s(function(gir,Q5){"use strict";var hJe=require("@stdlib/assert/is-positive-number").isPrimitive,X5=require("@stdlib/assert/is-plain-object"),Y5=require("@stdlib/object/assign"),H5=require("@stdlib/string/format"),Z5=ld();function pJe(r,e){var t,i,n;if(t=arguments.length,t>1){if(!X5(e))throw new TypeError(H5("invalid argument. Options argument must be an object. Value: `%s`.",e));n=u,i=Y5({},e)}else if(t===1)if(hJe(r))n=u,i={};else{if(!X5(r))throw new TypeError(H5("invalid argument. Options argument must be an object. Value: `%s`.",r));i=Y5({},r),n=a}else i={},n=a;return n;function a(o){return new Z5(o,i)}function u(){return new Z5(r,i)}}Q5.exports=pJe});var rY=s(function(fir,eY){"use strict";var K5=require("@stdlib/utils/define-nonenumerable-read-only-property"),ih=ld(),yJe=D5(),qJe=$5();K5(ih,"objectMode",yJe);K5(ih,"factory",qJe);eY.exports=ih});var tY=s(function(dir,bJe){bJe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308,name:"mt19937"}});var aY=s(function(lir,nY){"use strict";var wJe=require("@stdlib/assert/is-plain-object"),Lr=require("@stdlib/assert/has-own-property"),SJe=require("@stdlib/assert/is-boolean").isPrimitive,OJe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,iY=require("@stdlib/assert/is-string").isPrimitive,EJe=require("@stdlib/assert/is-positive-integer").isPrimitive,_Je=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Qn=require("@stdlib/string/format");function NJe(r,e){return wJe(e)?Lr(e,"sep")&&(r.sep=e.sep,!iY(r.sep))?new TypeError(Qn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Lr(e,"objectMode")&&(r.objectMode=e.objectMode,!SJe(r.objectMode))?new TypeError(Qn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Lr(e,"encoding")&&(r.encoding=e.encoding,!iY(r.encoding)&&r.encoding!==null)?new TypeError(Qn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Lr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!OJe(r.highWaterMark))?new TypeError(Qn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Lr(e,"iter")&&(r.iter=e.iter,!_Je(r.iter))?new TypeError(Qn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Lr(e,"siter")&&(r.siter=e.siter,!EJe(r.siter))?new TypeError(Qn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(Lr(e,"name")&&(r.name=e.name),Lr(e,"seed")&&(r.seed=e.seed),Lr(e,"state")&&(r.state=e.state),Lr(e,"copy")&&(r.copy=e.copy),null):new TypeError(Qn("invalid argument. Options argument must be an object. Value: `%s`.",e))}nY.exports=NJe});var uY=s(function(cir,sY){"use strict";var LJe=require("debug"),RJe=LJe("random:streams:randi");sY.exports=RJe});var md=s(function(mir,fY){"use strict";var gY=require("readable-stream").Readable,PJe=require("@stdlib/assert/is-error"),TJe=require("@stdlib/object/assign"),jJe=require("@stdlib/utils/inherit"),oY=require("@stdlib/utils/define-nonenumerable-property"),Yi=require("@stdlib/utils/define-nonenumerable-read-only-property"),cd=require("@stdlib/utils/define-read-only-accessor"),MJe=require("@stdlib/utils/define-read-write-accessor"),xJe=hu().factory,vY=require("@stdlib/buffer/from-string"),AJe=require("@stdlib/utils/next-tick"),GJe=tY(),VJe=aY(),Ps=uY();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 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=vY(e):e=vY(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 Ps("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,AJe(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 Ge(r){var e,t;if(!(this instanceof Ge))return arguments.length>0?new Ge(r):new Ge;if(e=TJe({},GJe),arguments.length>0&&(t=VJe(e,r),t))throw t;return Ps("Creating a readable stream configured with the following options: %s.",JSON.stringify(e)),gY.call(this,e),oY(this,"_destroyed",!1),Yi(this,"_objectMode",e.objectMode),Yi(this,"_sep",e.sep),Yi(this,"_iter",e.iter),Yi(this,"_siter",e.siter),oY(this,"_i",0),Yi(this,"_prng",xJe(e)),Yi(this,"PRNG",this._prng.PRNG),this}jJe(Ge,gY);cd(Ge.prototype,"seed",FJe);cd(Ge.prototype,"seedLength",WJe);MJe(Ge.prototype,"state",zJe,JJe);cd(Ge.prototype,"stateLength",IJe);cd(Ge.prototype,"byteLength",kJe);Yi(Ge.prototype,"_read",UJe);Yi(Ge.prototype,"destroy",CJe);fY.exports=Ge});var lY=s(function(hir,dY){"use strict";var BJe=require("@stdlib/assert/is-plain-object"),DJe=require("@stdlib/object/assign"),XJe=require("@stdlib/string/format"),YJe=md();function HJe(r){var e;if(arguments.length>0){if(e=r,!BJe(e))throw new TypeError(XJe("invalid argument. Options argument must be an object. Value: `%s`.",e));e=DJe({},r)}else e={};return e.objectMode=!0,new YJe(e)}dY.exports=HJe});var mY=s(function(pir,cY){"use strict";var ZJe=require("@stdlib/assert/is-plain-object"),QJe=require("@stdlib/object/assign"),$Je=require("@stdlib/string/format"),KJe=md();function eUe(r){var e;if(arguments.length>0){if(!ZJe(r))throw new TypeError($Je("invalid argument. Options argument must be an object. Value: `%s`.",r));e=QJe({},r)}else e={};return t;function t(){return new KJe(e)}}cY.exports=eUe});var yY=s(function(yir,pY){"use strict";var hY=require("@stdlib/utils/define-nonenumerable-read-only-property"),nh=md(),rUe=lY(),tUe=mY();hY(nh,"objectMode",rUe);hY(nh,"factory",tUe);pY.exports=nh});var qY=s(function(qir,iUe){iUe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308,name:"improved-ziggurat"}});var SY=s(function(bir,wY){"use strict";var nUe=require("@stdlib/assert/is-plain-object"),De=require("@stdlib/assert/has-own-property"),aUe=require("@stdlib/assert/is-boolean").isPrimitive,sUe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,bY=require("@stdlib/assert/is-string").isPrimitive,uUe=require("@stdlib/assert/is-positive-integer").isPrimitive,oUe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,$n=require("@stdlib/string/format");function vUe(r,e){return nUe(e)?De(e,"sep")&&(r.sep=e.sep,!bY(r.sep))?new TypeError($n("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):De(e,"objectMode")&&(r.objectMode=e.objectMode,!aUe(r.objectMode))?new TypeError($n("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):De(e,"encoding")&&(r.encoding=e.encoding,!bY(r.encoding)&&r.encoding!==null)?new TypeError($n("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):De(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!sUe(r.highWaterMark))?new TypeError($n("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):De(e,"iter")&&(r.iter=e.iter,!oUe(r.iter))?new TypeError($n("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):De(e,"siter")&&(r.siter=e.siter,!uUe(r.siter))?new TypeError($n("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($n("invalid argument. Options argument must be an object. Value: `%s`.",e))}wY.exports=vUe});var EY=s(function(wir,OY){"use strict";var gUe=require("debug"),fUe=gUe("random:streams:randn");OY.exports=fUe});var pd=s(function(Sir,RY){"use strict";var LY=require("readable-stream").Readable,dUe=require("@stdlib/assert/is-error"),lUe=require("@stdlib/object/assign"),cUe=require("@stdlib/utils/inherit"),_Y=require("@stdlib/utils/define-nonenumerable-property"),Hi=require("@stdlib/utils/define-nonenumerable-read-only-property"),hd=require("@stdlib/utils/define-read-only-accessor"),mUe=require("@stdlib/utils/define-read-write-accessor"),hUe=yu().factory,NY=require("@stdlib/buffer/from-string"),pUe=require("@stdlib/utils/next-tick"),yUe=qY(),qUe=SY(),Ts=EY();function bUe(){return this._prng.seed}function wUe(){return this._prng.seedLength}function SUe(){return this._prng.stateLength}function OUe(){return this._prng.byteLength}function EUe(){return this._prng.state}function _Ue(r){this._prng.state=r}function NUe(){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=NY(e):e=NY(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function LUe(r){var e;if(this._destroyed)return Ts("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,pUe(t),this;function t(){r&&(Ts("Stream was destroyed due to an error. Error: %s.",dUe(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=lUe({},yUe),arguments.length>0&&(t=qUe(e,r),t))throw t;return Ts("Creating a readable stream configured with the following options: %s.",JSON.stringify(e)),LY.call(this,e),_Y(this,"_destroyed",!1),Hi(this,"_objectMode",e.objectMode),Hi(this,"_sep",e.sep),Hi(this,"_iter",e.iter),Hi(this,"_siter",e.siter),_Y(this,"_i",0),Hi(this,"_prng",hUe(e)),Hi(this,"PRNG",this._prng.PRNG),this}cUe(Ve,LY);hd(Ve.prototype,"seed",bUe);hd(Ve.prototype,"seedLength",wUe);mUe(Ve.prototype,"state",EUe,_Ue);hd(Ve.prototype,"stateLength",SUe);hd(Ve.prototype,"byteLength",OUe);Hi(Ve.prototype,"_read",NUe);Hi(Ve.prototype,"destroy",LUe);RY.exports=Ve});var TY=s(function(Oir,PY){"use strict";var RUe=require("@stdlib/assert/is-plain-object"),PUe=require("@stdlib/object/assign"),TUe=require("@stdlib/string/format"),jUe=pd();function MUe(r){var e;if(arguments.length>0){if(e=r,!RUe(e))throw new TypeError(TUe("invalid argument. Options argument must be an object. Value: `%s`.",e));e=PUe({},r)}else e={};return e.objectMode=!0,new jUe(e)}PY.exports=MUe});var MY=s(function(Eir,jY){"use strict";var xUe=require("@stdlib/assert/is-plain-object"),AUe=require("@stdlib/object/assign"),GUe=require("@stdlib/string/format"),VUe=pd();function FUe(r){var e;if(arguments.length>0){if(!xUe(r))throw new TypeError(GUe("invalid argument. Options argument must be an object. Value: `%s`.",r));e=AUe({},r)}else e={};return t;function t(){return new VUe(e)}}jY.exports=FUe});var GY=s(function(_ir,AY){"use strict";var xY=require("@stdlib/utils/define-nonenumerable-read-only-property"),ah=pd(),WUe=TY(),IUe=MY();xY(ah,"objectMode",WUe);xY(ah,"factory",IUe);AY.exports=ah});var VY=s(function(Nir,kUe){kUe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308,name:"mt19937"}});var IY=s(function(Lir,WY){"use strict";var zUe=require("@stdlib/assert/is-plain-object"),Rr=require("@stdlib/assert/has-own-property"),JUe=require("@stdlib/assert/is-boolean").isPrimitive,UUe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,FY=require("@stdlib/assert/is-string").isPrimitive,CUe=require("@stdlib/assert/is-positive-integer").isPrimitive,BUe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Kn=require("@stdlib/string/format");function DUe(r,e){return zUe(e)?Rr(e,"sep")&&(r.sep=e.sep,!FY(r.sep))?new TypeError(Kn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Rr(e,"objectMode")&&(r.objectMode=e.objectMode,!JUe(r.objectMode))?new TypeError(Kn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Rr(e,"encoding")&&(r.encoding=e.encoding,!FY(r.encoding)&&r.encoding!==null)?new TypeError(Kn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Rr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!UUe(r.highWaterMark))?new TypeError(Kn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Rr(e,"iter")&&(r.iter=e.iter,!BUe(r.iter))?new TypeError(Kn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Rr(e,"siter")&&(r.siter=e.siter,!CUe(r.siter))?new TypeError(Kn("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(Kn("invalid argument. Options argument must be an object. Value: `%s`.",e))}WY.exports=DUe});var zY=s(function(Rir,kY){"use strict";var XUe=require("debug"),YUe=XUe("random:streams:randu");kY.exports=YUe});var qd=s(function(Pir,BY){"use strict";var CY=require("readable-stream").Readable,HUe=require("@stdlib/assert/is-error"),ZUe=require("@stdlib/object/assign"),QUe=require("@stdlib/utils/inherit"),JY=require("@stdlib/utils/define-nonenumerable-property"),Zi=require("@stdlib/utils/define-nonenumerable-read-only-property"),yd=require("@stdlib/utils/define-read-only-accessor"),$Ue=require("@stdlib/utils/define-read-write-accessor"),KUe=Tt().factory,UY=require("@stdlib/buffer/from-string"),eCe=require("@stdlib/utils/next-tick"),rCe=VY(),tCe=IY(),js=zY();function iCe(){return this._prng.seed}function nCe(){return this._prng.seedLength}function aCe(){return this._prng.stateLength}function sCe(){return this._prng.byteLength}function uCe(){return this._prng.state}function oCe(r){this._prng.state=r}function vCe(){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=UY(e):e=UY(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function gCe(r){var e;if(this._destroyed)return js("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,eCe(t),this;function t(){r&&(js("Stream was destroyed due to an error. Error: %s.",HUe(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=ZUe({},rCe),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)),CY.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",KUe(e)),Zi(this,"PRNG",this._prng.PRNG),this}QUe(Fe,CY);yd(Fe.prototype,"seed",iCe);yd(Fe.prototype,"seedLength",nCe);$Ue(Fe.prototype,"state",uCe,oCe);yd(Fe.prototype,"stateLength",aCe);yd(Fe.prototype,"byteLength",sCe);Zi(Fe.prototype,"_read",vCe);Zi(Fe.prototype,"destroy",gCe);BY.exports=Fe});var XY=s(function(Tir,DY){"use strict";var fCe=require("@stdlib/assert/is-plain-object"),dCe=require("@stdlib/object/assign"),lCe=require("@stdlib/string/format"),cCe=qd();function mCe(r){var e;if(arguments.length>0){if(e=r,!fCe(e))throw new TypeError(lCe("invalid argument. Options argument must be an object. Value: `%s`.",e));e=dCe({},r)}else e={};return e.objectMode=!0,new cCe(e)}DY.exports=mCe});var HY=s(function(jir,YY){"use strict";var hCe=require("@stdlib/assert/is-plain-object"),pCe=require("@stdlib/object/assign"),yCe=require("@stdlib/string/format"),qCe=qd();function bCe(r){var e;if(arguments.length>0){if(!hCe(r))throw new TypeError(yCe("invalid argument. Options argument must be an object. Value: `%s`.",r));e=pCe({},r)}else e={};return t;function t(){return new qCe(e)}}YY.exports=bCe});var $Y=s(function(Mir,QY){"use strict";var ZY=require("@stdlib/utils/define-nonenumerable-read-only-property"),sh=qd(),wCe=XY(),SCe=HY();ZY(sh,"objectMode",wCe);ZY(sh,"factory",SCe);QY.exports=sh});var KY=s(function(xir,OCe){OCe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var t6=s(function(Air,r6){"use strict";var ECe=require("@stdlib/assert/is-plain-object"),Pr=require("@stdlib/assert/has-own-property"),_Ce=require("@stdlib/assert/is-boolean").isPrimitive,NCe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,e6=require("@stdlib/assert/is-string").isPrimitive,LCe=require("@stdlib/assert/is-positive-integer").isPrimitive,RCe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,ea=require("@stdlib/string/format");function PCe(r,e){return ECe(e)?Pr(e,"sep")&&(r.sep=e.sep,!e6(r.sep))?new TypeError(ea("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Pr(e,"objectMode")&&(r.objectMode=e.objectMode,!_Ce(r.objectMode))?new TypeError(ea("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Pr(e,"encoding")&&(r.encoding=e.encoding,!e6(r.encoding)&&r.encoding!==null)?new TypeError(ea("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Pr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!NCe(r.highWaterMark))?new TypeError(ea("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Pr(e,"iter")&&(r.iter=e.iter,!RCe(r.iter))?new TypeError(ea("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Pr(e,"siter")&&(r.siter=e.siter,!LCe(r.siter))?new TypeError(ea("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(ea("invalid argument. Options argument must be an object. Value: `%s`.",e))}r6.exports=PCe});var n6=s(function(Gir,i6){"use strict";var TCe=require("debug"),jCe=TCe("random:streams:rayleigh");i6.exports=jCe});var wd=s(function(Vir,o6){"use strict";var u6=require("readable-stream").Readable,MCe=require("@stdlib/assert/is-positive-number").isPrimitive,xCe=require("@stdlib/assert/is-error"),ACe=require("@stdlib/object/assign"),GCe=require("@stdlib/utils/inherit"),a6=require("@stdlib/utils/define-nonenumerable-property"),Qi=require("@stdlib/utils/define-nonenumerable-read-only-property"),bd=require("@stdlib/utils/define-read-only-accessor"),VCe=require("@stdlib/utils/define-read-write-accessor"),FCe=Ja().factory,s6=require("@stdlib/buffer/from-string"),WCe=require("@stdlib/utils/next-tick"),ICe=require("@stdlib/string/format"),kCe=KY(),zCe=t6(),Ms=n6();function JCe(){return this._prng.seed}function UCe(){return this._prng.seedLength}function CCe(){return this._prng.stateLength}function BCe(){return this._prng.byteLength}function DCe(){return this._prng.state}function XCe(r){this._prng.state=r}function YCe(){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=s6(e):e=s6(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function HCe(r){var e;if(this._destroyed)return Ms("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,WCe(t),this;function t(){r&&(Ms("Stream was destroyed due to an error. Error: %s.",xCe(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(!MCe(r))throw new TypeError(ICe("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(t=ACe({},kCe),arguments.length>1&&(i=zCe(t,e),i))throw i;return Ms("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),u6.call(this,t),a6(this,"_destroyed",!1),Qi(this,"_objectMode",t.objectMode),Qi(this,"_sep",t.sep),Qi(this,"_iter",t.iter),Qi(this,"_siter",t.siter),a6(this,"_i",0),Qi(this,"_prng",FCe(r,t)),Qi(this,"PRNG",this._prng.PRNG),this}GCe(We,u6);bd(We.prototype,"seed",JCe);bd(We.prototype,"seedLength",UCe);VCe(We.prototype,"state",DCe,XCe);bd(We.prototype,"stateLength",CCe);bd(We.prototype,"byteLength",BCe);Qi(We.prototype,"_read",YCe);Qi(We.prototype,"destroy",HCe);o6.exports=We});var g6=s(function(Fir,v6){"use strict";var ZCe=require("@stdlib/assert/is-plain-object"),QCe=require("@stdlib/object/assign"),$Ce=require("@stdlib/string/format"),KCe=wd();function eBe(r,e){var t;if(arguments.length>1){if(t=e,!ZCe(t))throw new TypeError($Ce("invalid argument. Options argument must be an object. Value: `%s`.",t));t=QCe({},e)}else t={};return t.objectMode=!0,new KCe(r,t)}v6.exports=eBe});var h6=s(function(Wir,m6){"use strict";var rBe=require("@stdlib/assert/is-positive-number").isPrimitive,f6=require("@stdlib/assert/is-plain-object"),d6=require("@stdlib/object/assign"),l6=require("@stdlib/string/format"),c6=wd();function tBe(r,e){var t,i,n;if(t=arguments.length,t>1){if(!f6(e))throw new TypeError(l6("invalid argument. Options argument must be an object. Value: `%s`.",e));n=u,i=d6({},e)}else if(t===1)if(rBe(r))n=u,i={};else{if(!f6(r))throw new TypeError(l6("invalid argument. Options argument must be an object. Value: `%s`.",r));i=d6({},r),n=a}else i={},n=a;return n;function a(o){return new c6(o,i)}function u(){return new c6(r,i)}}m6.exports=tBe});var q6=s(function(Iir,y6){"use strict";var p6=require("@stdlib/utils/define-nonenumerable-read-only-property"),uh=wd(),iBe=g6(),nBe=h6();p6(uh,"objectMode",iBe);p6(uh,"factory",nBe);y6.exports=uh});var b6=s(function(kir,aBe){aBe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var O6=s(function(zir,S6){"use strict";var sBe=require("@stdlib/assert/is-plain-object"),Tr=require("@stdlib/assert/has-own-property"),uBe=require("@stdlib/assert/is-boolean").isPrimitive,oBe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,w6=require("@stdlib/assert/is-string").isPrimitive,vBe=require("@stdlib/assert/is-positive-integer").isPrimitive,gBe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,ra=require("@stdlib/string/format");function fBe(r,e){return sBe(e)?Tr(e,"sep")&&(r.sep=e.sep,!w6(r.sep))?new TypeError(ra("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Tr(e,"objectMode")&&(r.objectMode=e.objectMode,!uBe(r.objectMode))?new TypeError(ra("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Tr(e,"encoding")&&(r.encoding=e.encoding,!w6(r.encoding)&&r.encoding!==null)?new TypeError(ra("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Tr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!oBe(r.highWaterMark))?new TypeError(ra("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Tr(e,"iter")&&(r.iter=e.iter,!gBe(r.iter))?new TypeError(ra("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Tr(e,"siter")&&(r.siter=e.siter,!vBe(r.siter))?new TypeError(ra("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(ra("invalid argument. Options argument must be an object. Value: `%s`.",e))}S6.exports=fBe});var _6=s(function(Jir,E6){"use strict";var dBe=require("debug"),lBe=dBe("random:streams:t");E6.exports=lBe});var Od=s(function(Uir,P6){"use strict";var R6=require("readable-stream").Readable,cBe=require("@stdlib/assert/is-positive-number").isPrimitive,mBe=require("@stdlib/assert/is-error"),hBe=require("@stdlib/object/assign"),pBe=require("@stdlib/utils/inherit"),N6=require("@stdlib/utils/define-nonenumerable-property"),$i=require("@stdlib/utils/define-nonenumerable-read-only-property"),Sd=require("@stdlib/utils/define-read-only-accessor"),yBe=require("@stdlib/utils/define-read-write-accessor"),qBe=Ba().factory,L6=require("@stdlib/buffer/from-string"),bBe=require("@stdlib/utils/next-tick"),wBe=require("@stdlib/string/format"),SBe=b6(),OBe=O6(),xs=_6();function EBe(){return this._prng.seed}function _Be(){return this._prng.seedLength}function NBe(){return this._prng.stateLength}function LBe(){return this._prng.byteLength}function RBe(){return this._prng.state}function PBe(r){this._prng.state=r}function TBe(){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=L6(e):e=L6(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function jBe(r){var e;if(this._destroyed)return xs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,bBe(t),this;function t(){r&&(xs("Stream was destroyed due to an error. Error: %s.",mBe(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(!cBe(r))throw new TypeError(wBe("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(t=hBe({},SBe),arguments.length>1&&(i=OBe(t,e),i))throw i;return xs("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),R6.call(this,t),N6(this,"_destroyed",!1),$i(this,"_objectMode",t.objectMode),$i(this,"_sep",t.sep),$i(this,"_iter",t.iter),$i(this,"_siter",t.siter),N6(this,"_i",0),$i(this,"_prng",qBe(r,t)),$i(this,"PRNG",this._prng.PRNG),this}pBe(Ie,R6);Sd(Ie.prototype,"seed",EBe);Sd(Ie.prototype,"seedLength",_Be);yBe(Ie.prototype,"state",RBe,PBe);Sd(Ie.prototype,"stateLength",NBe);Sd(Ie.prototype,"byteLength",LBe);$i(Ie.prototype,"_read",TBe);$i(Ie.prototype,"destroy",jBe);P6.exports=Ie});var j6=s(function(Cir,T6){"use strict";var MBe=require("@stdlib/assert/is-plain-object"),xBe=require("@stdlib/object/assign"),ABe=require("@stdlib/string/format"),GBe=Od();function VBe(r,e){var t;if(arguments.length>1){if(t=e,!MBe(t))throw new TypeError(ABe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=xBe({},e)}else t={};return t.objectMode=!0,new GBe(r,t)}T6.exports=VBe});var F6=s(function(Bir,V6){"use strict";var FBe=require("@stdlib/assert/is-positive-number").isPrimitive,M6=require("@stdlib/assert/is-plain-object"),x6=require("@stdlib/object/assign"),A6=require("@stdlib/string/format"),G6=Od();function WBe(r,e){var t,i,n;if(t=arguments.length,t>1){if(!M6(e))throw new TypeError(A6("invalid argument. Options argument must be an object. Value: `%s`.",e));n=u,i=x6({},e)}else if(t===1)if(FBe(r))n=u,i={};else{if(!M6(r))throw new TypeError(A6("invalid argument. Options argument must be an object. Value: `%s`.",r));i=x6({},r),n=a}else i={},n=a;return n;function a(o){return new G6(o,i)}function u(){return new G6(r,i)}}V6.exports=WBe});var k6=s(function(Dir,I6){"use strict";var W6=require("@stdlib/utils/define-nonenumerable-read-only-property"),oh=Od(),IBe=j6(),kBe=F6();W6(oh,"objectMode",IBe);W6(oh,"factory",kBe);I6.exports=oh});var z6=s(function(Xir,zBe){zBe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var C6=s(function(Yir,U6){"use strict";var JBe=require("@stdlib/assert/is-plain-object"),jr=require("@stdlib/assert/has-own-property"),UBe=require("@stdlib/assert/is-boolean").isPrimitive,CBe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,J6=require("@stdlib/assert/is-string").isPrimitive,BBe=require("@stdlib/assert/is-positive-integer").isPrimitive,DBe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,ta=require("@stdlib/string/format");function XBe(r,e){return JBe(e)?jr(e,"sep")&&(r.sep=e.sep,!J6(r.sep))?new TypeError(ta("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):jr(e,"objectMode")&&(r.objectMode=e.objectMode,!UBe(r.objectMode))?new TypeError(ta("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):jr(e,"encoding")&&(r.encoding=e.encoding,!J6(r.encoding)&&r.encoding!==null)?new TypeError(ta("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):jr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!CBe(r.highWaterMark))?new TypeError(ta("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):jr(e,"iter")&&(r.iter=e.iter,!DBe(r.iter))?new TypeError(ta("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):jr(e,"siter")&&(r.siter=e.siter,!BBe(r.siter))?new TypeError(ta("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(ta("invalid argument. Options argument must be an object. Value: `%s`.",e))}U6.exports=XBe});var D6=s(function(Hir,B6){"use strict";var YBe=require("debug"),HBe=YBe("random:streams:triangular");B6.exports=HBe});var Nd=s(function(Zir,Z6){"use strict";var H6=require("readable-stream").Readable,vh=require("@stdlib/assert/is-number").isPrimitive,gh=require("@stdlib/math/base/assert/is-nan"),ZBe=require("@stdlib/assert/is-error"),QBe=require("@stdlib/object/assign"),$Be=require("@stdlib/utils/inherit"),X6=require("@stdlib/utils/define-nonenumerable-property"),Ki=require("@stdlib/utils/define-nonenumerable-read-only-property"),_d=require("@stdlib/utils/define-read-only-accessor"),KBe=require("@stdlib/utils/define-read-write-accessor"),e9e=Da().factory,Y6=require("@stdlib/buffer/from-string"),r9e=require("@stdlib/utils/next-tick"),Ed=require("@stdlib/string/format"),t9e=z6(),i9e=C6(),As=D6();function n9e(){return this._prng.seed}function a9e(){return this._prng.seedLength}function s9e(){return this._prng.stateLength}function u9e(){return this._prng.byteLength}function o9e(){return this._prng.state}function v9e(r){this._prng.state=r}function g9e(){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=Y6(e):e=Y6(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function f9e(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 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(!vh(r)||gh(r))throw new TypeError(Ed("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!vh(e)||gh(e))throw new TypeError(Ed("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e));if(!vh(t)||gh(t))throw new TypeError(Ed("invalid argument. Third argument must be a number and not NaN. Value: `%s`.",t));if(!(r<=t&&t<=e))throw new RangeError(Ed("invalid arguments. Parameters must satisfy the following condition: %s. a: `%f`. b: `%f`. c: `%f`.","a <= c <= b",r,e,t));if(n=QBe({},t9e),arguments.length>3&&(a=i9e(n,i),a))throw a;return As("Creating a readable stream configured with the following options: %s.",JSON.stringify(n)),H6.call(this,n),X6(this,"_destroyed",!1),Ki(this,"_objectMode",n.objectMode),Ki(this,"_sep",n.sep),Ki(this,"_iter",n.iter),Ki(this,"_siter",n.siter),X6(this,"_i",0),Ki(this,"_prng",e9e(r,e,t,n)),Ki(this,"PRNG",this._prng.PRNG),this}$Be(ke,H6);_d(ke.prototype,"seed",n9e);_d(ke.prototype,"seedLength",a9e);KBe(ke.prototype,"state",o9e,v9e);_d(ke.prototype,"stateLength",s9e);_d(ke.prototype,"byteLength",u9e);Ki(ke.prototype,"_read",g9e);Ki(ke.prototype,"destroy",f9e);Z6.exports=ke});var $6=s(function(Qir,Q6){"use strict";var d9e=require("@stdlib/assert/is-plain-object"),l9e=require("@stdlib/object/assign"),c9e=require("@stdlib/string/format"),m9e=Nd();function h9e(r,e,t,i){var n;if(arguments.length>3){if(n=i,!d9e(n))throw new TypeError(c9e("invalid argument. Options argument must be an object. Value: `%s`.",n));n=l9e({},i)}else n={};return n.objectMode=!0,new m9e(r,e,t,n)}Q6.exports=h9e});var n4=s(function($ir,i4){"use strict";var K6=require("@stdlib/assert/is-plain-object"),e4=require("@stdlib/object/assign"),r4=require("@stdlib/string/format"),t4=Nd();function p9e(r,e,t,i){var n,a,u;if(n=arguments.length,n===1){if(!K6(r))throw new TypeError(r4("invalid argument. Options argument must be an object. Value: `%s`.",r));a=e4({},r)}else if(n>3){if(!K6(i))throw new TypeError(r4("invalid argument. Options argument must be an object. Value: `%s`.",i));a=e4({},i)}else a={};return n<3?u=o:u=v,u;function o(g,c,l){return new t4(g,c,l,a)}function v(){return new t4(r,e,t,a)}}i4.exports=p9e});var u4=s(function(Kir,s4){"use strict";var a4=require("@stdlib/utils/define-nonenumerable-read-only-property"),fh=Nd(),y9e=$6(),q9e=n4();a4(fh,"objectMode",y9e);a4(fh,"factory",q9e);s4.exports=fh});var o4=s(function(enr,b9e){b9e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var f4=s(function(rnr,g4){"use strict";var w9e=require("@stdlib/assert/is-plain-object"),Mr=require("@stdlib/assert/has-own-property"),S9e=require("@stdlib/assert/is-boolean").isPrimitive,O9e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,v4=require("@stdlib/assert/is-string").isPrimitive,E9e=require("@stdlib/assert/is-positive-integer").isPrimitive,_9e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,ia=require("@stdlib/string/format");function N9e(r,e){return w9e(e)?Mr(e,"sep")&&(r.sep=e.sep,!v4(r.sep))?new TypeError(ia("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Mr(e,"objectMode")&&(r.objectMode=e.objectMode,!S9e(r.objectMode))?new TypeError(ia("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Mr(e,"encoding")&&(r.encoding=e.encoding,!v4(r.encoding)&&r.encoding!==null)?new TypeError(ia("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Mr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!O9e(r.highWaterMark))?new TypeError(ia("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Mr(e,"iter")&&(r.iter=e.iter,!_9e(r.iter))?new TypeError(ia("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Mr(e,"siter")&&(r.siter=e.siter,!E9e(r.siter))?new TypeError(ia("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(ia("invalid argument. Options argument must be an object. Value: `%s`.",e))}g4.exports=N9e});var l4=s(function(tnr,d4){"use strict";var L9e=require("debug"),R9e=L9e("random:streams:uniform");d4.exports=R9e});var Rd=s(function(inr,q4){"use strict";var y4=require("readable-stream").Readable,c4=require("@stdlib/assert/is-number").isPrimitive,m4=require("@stdlib/math/base/assert/is-nan"),P9e=require("@stdlib/assert/is-error"),T9e=require("@stdlib/object/assign"),j9e=require("@stdlib/utils/inherit"),h4=require("@stdlib/utils/define-nonenumerable-property"),en=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ld=require("@stdlib/utils/define-read-only-accessor"),M9e=require("@stdlib/utils/define-read-write-accessor"),x9e=mn().factory,p4=require("@stdlib/buffer/from-string"),A9e=require("@stdlib/utils/next-tick"),dh=require("@stdlib/string/format"),G9e=o4(),V9e=f4(),Gs=l4();function F9e(){return this._prng.seed}function W9e(){return this._prng.seedLength}function I9e(){return this._prng.stateLength}function k9e(){return this._prng.byteLength}function z9e(){return this._prng.state}function J9e(r){this._prng.state=r}function U9e(){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=p4(e):e=p4(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function C9e(r){var e;if(this._destroyed)return Gs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,A9e(t),this;function t(){r&&(Gs("Stream was destroyed due to an error. Error: %s.",P9e(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(!c4(r)||m4(r))throw new TypeError(dh("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!c4(e)||m4(e))throw new TypeError(dh("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e));if(r>=e)throw new RangeError(dh("invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.",r,e));if(i=T9e({},G9e),arguments.length>2&&(n=V9e(i,t),n))throw n;return Gs("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),y4.call(this,i),h4(this,"_destroyed",!1),en(this,"_objectMode",i.objectMode),en(this,"_sep",i.sep),en(this,"_iter",i.iter),en(this,"_siter",i.siter),h4(this,"_i",0),en(this,"_prng",x9e(r,e,i)),en(this,"PRNG",this._prng.PRNG),this}j9e(ze,y4);Ld(ze.prototype,"seed",F9e);Ld(ze.prototype,"seedLength",W9e);M9e(ze.prototype,"state",z9e,J9e);Ld(ze.prototype,"stateLength",I9e);Ld(ze.prototype,"byteLength",k9e);en(ze.prototype,"_read",U9e);en(ze.prototype,"destroy",C9e);q4.exports=ze});var w4=s(function(nnr,b4){"use strict";var B9e=require("@stdlib/assert/is-plain-object"),D9e=require("@stdlib/object/assign"),X9e=require("@stdlib/string/format"),Y9e=Rd();function H9e(r,e,t){var i;if(arguments.length>2){if(i=t,!B9e(i))throw new TypeError(X9e("invalid argument. Options argument must be an object. Value: `%s`.",i));i=D9e({},t)}else i={};return i.objectMode=!0,new Y9e(r,e,i)}b4.exports=H9e});var L4=s(function(anr,N4){"use strict";var S4=require("@stdlib/assert/is-plain-object"),O4=require("@stdlib/object/assign"),E4=require("@stdlib/string/format"),_4=Rd();function Z9e(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!S4(r))throw new TypeError(E4("invalid argument. Options argument must be an object. Value: `%s`.",r));n=O4({},r)}else if(i>2){if(!S4(t))throw new TypeError(E4("invalid argument. Options argument must be an object. Value: `%s`.",t));n=O4({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new _4(v,g,n)}function o(){return new _4(r,e,n)}}N4.exports=Z9e});var T4=s(function(snr,P4){"use strict";var R4=require("@stdlib/utils/define-nonenumerable-read-only-property"),lh=Rd(),Q9e=w4(),$9e=L4();R4(lh,"objectMode",Q9e);R4(lh,"factory",$9e);P4.exports=lh});var j4=s(function(unr,K9e){K9e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var A4=s(function(onr,x4){"use strict";var eDe=require("@stdlib/assert/is-plain-object"),xr=require("@stdlib/assert/has-own-property"),rDe=require("@stdlib/assert/is-boolean").isPrimitive,tDe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,M4=require("@stdlib/assert/is-string").isPrimitive,iDe=require("@stdlib/assert/is-positive-integer").isPrimitive,nDe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,na=require("@stdlib/string/format");function aDe(r,e){return eDe(e)?xr(e,"sep")&&(r.sep=e.sep,!M4(r.sep))?new TypeError(na("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):xr(e,"objectMode")&&(r.objectMode=e.objectMode,!rDe(r.objectMode))?new TypeError(na("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(na("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):xr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!tDe(r.highWaterMark))?new TypeError(na("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):xr(e,"iter")&&(r.iter=e.iter,!nDe(r.iter))?new TypeError(na("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):xr(e,"siter")&&(r.siter=e.siter,!iDe(r.siter))?new TypeError(na("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(na("invalid argument. Options argument must be an object. Value: `%s`.",e))}x4.exports=aDe});var V4=s(function(vnr,G4){"use strict";var sDe=require("debug"),uDe=sDe("random:streams:weibull");G4.exports=uDe});var Td=s(function(gnr,J4){"use strict";var z4=require("readable-stream").Readable,F4=require("@stdlib/assert/is-positive-number").isPrimitive,oDe=require("@stdlib/assert/is-error"),vDe=require("@stdlib/object/assign"),gDe=require("@stdlib/utils/inherit"),W4=require("@stdlib/utils/define-nonenumerable-property"),rn=require("@stdlib/utils/define-nonenumerable-read-only-property"),Pd=require("@stdlib/utils/define-read-only-accessor"),fDe=require("@stdlib/utils/define-read-write-accessor"),dDe=hn().factory,I4=require("@stdlib/buffer/from-string"),k4=require("@stdlib/string/format"),lDe=require("@stdlib/utils/next-tick"),cDe=j4(),mDe=A4(),Vs=V4();function hDe(){return this._prng.seed}function pDe(){return this._prng.seedLength}function yDe(){return this._prng.stateLength}function qDe(){return this._prng.byteLength}function bDe(){return this._prng.state}function wDe(r){this._prng.state=r}function SDe(){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=I4(e):e=I4(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function ODe(r){var e;if(this._destroyed)return Vs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,lDe(t),this;function t(){r&&(Vs("Stream was destroyed due to an error. Error: %s.",oDe(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(!F4(r))throw new TypeError(k4("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!F4(e))throw new TypeError(k4("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=vDe({},cDe),arguments.length>2&&(n=mDe(i,t),n))throw n;return Vs("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),z4.call(this,i),W4(this,"_destroyed",!1),rn(this,"_objectMode",i.objectMode),rn(this,"_sep",i.sep),rn(this,"_iter",i.iter),rn(this,"_siter",i.siter),W4(this,"_i",0),rn(this,"_prng",dDe(r,e,i)),rn(this,"PRNG",this._prng.PRNG),this}gDe(Je,z4);Pd(Je.prototype,"seed",hDe);Pd(Je.prototype,"seedLength",pDe);fDe(Je.prototype,"state",bDe,wDe);Pd(Je.prototype,"stateLength",yDe);Pd(Je.prototype,"byteLength",qDe);rn(Je.prototype,"_read",SDe);rn(Je.prototype,"destroy",ODe);J4.exports=Je});var C4=s(function(fnr,U4){"use strict";var EDe=require("@stdlib/assert/is-plain-object"),_De=require("@stdlib/object/assign"),NDe=require("@stdlib/string/format"),LDe=Td();function RDe(r,e,t){var i;if(arguments.length>2){if(i=t,!EDe(i))throw new TypeError(NDe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=_De({},t)}else i={};return i.objectMode=!0,new LDe(r,e,i)}U4.exports=RDe});var Z4=s(function(dnr,H4){"use strict";var B4=require("@stdlib/assert/is-plain-object"),D4=require("@stdlib/object/assign"),X4=require("@stdlib/string/format"),Y4=Td();function PDe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!B4(r))throw new TypeError(X4("invalid argument. Options argument must be an object. Value: `%s`.",r));n=D4({},r)}else if(i>2){if(!B4(t))throw new TypeError(X4("invalid argument. Options argument must be an object. Value: `%s`.",t));n=D4({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new Y4(v,g,n)}function o(){return new Y4(r,e,n)}}H4.exports=PDe});var K4=s(function(lnr,$4){"use strict";var Q4=require("@stdlib/utils/define-nonenumerable-read-only-property"),ch=Td(),TDe=C4(),jDe=Z4();Q4(ch,"objectMode",TDe);Q4(ch,"factory",jDe);$4.exports=ch});var rH=s(function(cnr,eH){"use strict";var P=require("@stdlib/utils/define-read-only-property"),L={};P(L,"arcsine",wk());P(L,"bernoulli",Jk());P(L,"beta",fz());P(L,"betaprime",Az());P(L,"binomial",t3());P(L,"boxMuller",q3());P(L,"cauchy",z3());P(L,"chi",oJ());P(L,"chisquare",PJ());P(L,"cosine",QJ());P(L,"discreteUniform",qU());P(L,"erlang",zU());P(L,"exponential",oC());P(L,"f",jC());P(L,"frechet",KC());P(L,"gamma",SB());P(L,"geometric",UB());P(L,"gumbel",f9());P(L,"hypergeometric",M9());P(L,"improvedZiggurat",H9());P(L,"invgamma",yD());P(L,"kumaraswamy",zD());P(L,"laplace",v8());P(L,"levy",j8());P(L,"logistic",K8());P(L,"lognormal",wX());P(L,"minstd",IX());P(L,"minstdShuffle",i7());P(L,"mt19937",w7());P(L,"negativeBinomial",U7());P(L,"normal",f5());P(L,"pareto1",A5());P(L,"poisson",rY());P(L,"randi",yY());P(L,"randn",GY());P(L,"randu",$Y());P(L,"rayleigh",q6());P(L,"t",k6());P(L,"triangular",u4());P(L,"uniform",T4());P(L,"weibull",K4());eH.exports=L});var hh=s(function(mnr,iH){"use strict";var tH=require("@stdlib/array/base/assert/is-accessor-array"),mh=nn();function MDe(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 tH(r)?g=r.get(t):g=r[t],tH(i)?c=i.get(a):c=i[a],v.fcn=mh.factory(g,c,o),v;v.fcn=mh.factory(o)}else v.fcn=mh;return v.arity+=2,v}iH.exports=MDe});var aH=s(function(hnr,nH){"use strict";var xDe=require("@stdlib/strided/base/nullary"),ADe=require("@stdlib/strided/base/binary"),GDe=hh();function VDe(r,e,t,i,n,a,u,o){var v=GDe(e,t,0,i,n,0,arguments.length>7,o);return v.arity===0?(xDe([a],[r],[u],v.fcn),a):(ADe([e,i,a],[r],[t,n,u],v.fcn),a)}nH.exports=VDe});var uH=s(function(pnr,sH){"use strict";var FDe=require("@stdlib/strided/base/nullary").ndarray,WDe=require("@stdlib/strided/base/binary").ndarray,IDe=hh();function kDe(r,e,t,i,n,a,u,o,v,g,c){var l=IDe(e,t,i,n,a,u,arguments.length>10,c);return l.arity===0?(FDe([o],[r],[v],[g],l.fcn),o):(WDe([e,n,o],[r],[t,a,v],[i,u,g],l.fcn),o)}sH.exports=kDe});var gH=s(function(ynr,vH){"use strict";var zDe=require("@stdlib/utils/define-nonenumerable-read-only-property"),oH=aH(),JDe=uH();zDe(oH,"ndarray",JDe);vH.exports=oH});var yh=s(function(qnr,dH){"use strict";var fH=require("@stdlib/array/base/assert/is-accessor-array"),ph=sn();function UDe(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=ph.factory(g,c,o),v;v.fcn=ph.factory(o)}else v.fcn=ph;return v.arity+=2,v}dH.exports=UDe});var cH=s(function(bnr,lH){"use strict";var CDe=require("@stdlib/strided/base/nullary"),BDe=require("@stdlib/strided/base/binary"),DDe=yh();function XDe(r,e,t,i,n,a,u,o){var v=DDe(e,t,0,i,n,0,arguments.length>7,o);return v.arity===0?(CDe([a],[r],[u],v.fcn),a):(BDe([e,i,a],[r],[t,n,u],v.fcn),a)}lH.exports=XDe});var hH=s(function(wnr,mH){"use strict";var YDe=require("@stdlib/strided/base/nullary").ndarray,HDe=require("@stdlib/strided/base/binary").ndarray,ZDe=yh();function QDe(r,e,t,i,n,a,u,o,v,g,c){var l=ZDe(e,t,i,n,a,u,arguments.length>10,c);return l.arity===0?(YDe([o],[r],[v],[g],l.fcn),o):(HDe([e,n,o],[r],[t,a,v],[i,u,g],l.fcn),o)}mH.exports=QDe});var qH=s(function(Snr,yH){"use strict";var $De=require("@stdlib/utils/define-nonenumerable-read-only-property"),pH=cH(),KDe=hH();$De(pH,"ndarray",KDe);yH.exports=pH});var bh=s(function(Onr,wH){"use strict";var bH=require("@stdlib/array/base/assert/is-accessor-array"),qh=un();function e8e(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 bH(r)?g=r.get(t):g=r[t],bH(i)?c=i.get(a):c=i[a],v.fcn=qh.factory(g,c,o),v;v.fcn=qh.factory(o)}else v.fcn=qh;return v.arity+=2,v}wH.exports=e8e});var OH=s(function(Enr,SH){"use strict";var r8e=require("@stdlib/strided/base/nullary"),t8e=require("@stdlib/strided/base/binary"),i8e=bh();function n8e(r,e,t,i,n,a,u,o){var v=i8e(e,t,0,i,n,0,arguments.length>7,o);return v.arity===0?(r8e([a],[r],[u],v.fcn),a):(t8e([e,i,a],[r],[t,n,u],v.fcn),a)}SH.exports=n8e});var _H=s(function(_nr,EH){"use strict";var a8e=require("@stdlib/strided/base/nullary").ndarray,s8e=require("@stdlib/strided/base/binary").ndarray,u8e=bh();function o8e(r,e,t,i,n,a,u,o,v,g,c){var l=u8e(e,t,i,n,a,u,arguments.length>10,c);return l.arity===0?(a8e([o],[r],[v],[g],l.fcn),o):(s8e([e,n,o],[r],[t,a,v],[i,u,g],l.fcn),o)}EH.exports=o8e});var RH=s(function(Nnr,LH){"use strict";var v8e=require("@stdlib/utils/define-nonenumerable-read-only-property"),NH=OH(),g8e=_H();v8e(NH,"ndarray",g8e);LH.exports=NH});var Sh=s(function(Lnr,TH){"use strict";var PH=require("@stdlib/array/base/assert/is-accessor-array"),wh=on();function f8e(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 PH(r)?g=r.get(t):g=r[t],PH(i)?c=i.get(a):c=i[a],v.fcn=wh.factory(g,c,o),v;v.fcn=wh.factory(o)}else v.fcn=wh;return v.arity+=2,v}TH.exports=f8e});var MH=s(function(Rnr,jH){"use strict";var d8e=require("@stdlib/strided/base/nullary"),l8e=require("@stdlib/strided/base/binary"),c8e=Sh();function m8e(r,e,t,i,n,a,u,o){var v=c8e(e,t,0,i,n,0,arguments.length>7,o);return v.arity===0?(d8e([a],[r],[u],v.fcn),a):(l8e([e,i,a],[r],[t,n,u],v.fcn),a)}jH.exports=m8e});var AH=s(function(Pnr,xH){"use strict";var h8e=require("@stdlib/strided/base/nullary").ndarray,p8e=require("@stdlib/strided/base/binary").ndarray,y8e=Sh();function q8e(r,e,t,i,n,a,u,o,v,g,c){var l=y8e(e,t,i,n,a,u,arguments.length>10,c);return l.arity===0?(h8e([o],[r],[v],[g],l.fcn),o):(p8e([e,n,o],[r],[t,a,v],[i,u,g],l.fcn),o)}xH.exports=q8e});var FH=s(function(Tnr,VH){"use strict";var b8e=require("@stdlib/utils/define-nonenumerable-read-only-property"),GH=MH(),w8e=AH();b8e(GH,"ndarray",w8e);VH.exports=GH});var Eh=s(function(jnr,IH){"use strict";var WH=require("@stdlib/array/base/assert/is-accessor-array"),Oh=vn();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 WH(r)?g=r.get(t):g=r[t],WH(i)?c=i.get(a):c=i[a],v.fcn=Oh.factory(g,c,o),v;v.fcn=Oh.factory(o)}else v.fcn=Oh;return v.arity+=2,v}IH.exports=S8e});var zH=s(function(Mnr,kH){"use strict";var O8e=require("@stdlib/strided/base/nullary"),E8e=require("@stdlib/strided/base/binary"),_8e=Eh();function N8e(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?(O8e([a],[r],[u],v.fcn),a):(E8e([e,i,a],[r],[t,n,u],v.fcn),a)}kH.exports=N8e});var UH=s(function(xnr,JH){"use strict";var L8e=require("@stdlib/strided/base/nullary").ndarray,R8e=require("@stdlib/strided/base/binary").ndarray,P8e=Eh();function T8e(r,e,t,i,n,a,u,o,v,g,c){var l=P8e(e,t,i,n,a,u,arguments.length>10,c);return l.arity===0?(L8e([o],[r],[v],[g],l.fcn),o):(R8e([e,n,o],[r],[t,a,v],[i,u,g],l.fcn),o)}JH.exports=T8e});var DH=s(function(Anr,BH){"use strict";var j8e=require("@stdlib/utils/define-nonenumerable-read-only-property"),CH=zH(),M8e=UH();j8e(CH,"ndarray",M8e);BH.exports=CH});var ZH=s(function(Gnr,HH){"use strict";var XH=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),jd=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Fs=require("@stdlib/utils/define-nonenumerable-read-only-property"),x8e=require("@stdlib/assert/is-function"),A8e=require("@stdlib/assert/is-method-in"),G8e=require("@stdlib/assert/is-plain-object"),V8e=require("@stdlib/utils/constant-function"),F8e=require("@stdlib/utils/noop"),YH=require("@stdlib/strided/base/unary"),_h=require("@stdlib/string/format");function W8e(r){if(!x8e(r))throw new TypeError(_h("invalid argument. First argument must be a function. Value: `%s`.",r));if(!A8e(r,"factory"))throw new TypeError(_h("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],!G8e(i))throw new TypeError(_h("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),XH(n,"state",V8e(null),F8e),Fs(n,"stateLength",null),Fs(n,"byteLength",null)):(jd(n,"seed",u),jd(n,"seedLength",o),XH(n,"state",c,l),jd(n,"stateLength",v),jd(n,"byteLength",g)),Fs(n,"PRNG",t.PRNG),Fs(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}}}HH.exports=W8e});var $H=s(function(Vnr,QH){"use strict";var I8e=ZH();QH.exports=I8e});var Nh=s(function(Fnr,KH){"use strict";var k8e=$H(),z8e=gn(),J8e=k8e(z8e);KH.exports=J8e});var rZ=s(function(Wnr,eZ){"use strict";var U8e=Nh(),C8e=U8e();eZ.exports=C8e});var nZ=s(function(Inr,iZ){"use strict";var B8e=require("@stdlib/utils/define-nonenumerable-read-only-property"),tZ=rZ(),D8e=Nh();B8e(tZ,"factory",D8e);iZ.exports=tZ});var Rh=s(function(knr,sZ){"use strict";var aZ=require("@stdlib/array/base/assert/is-accessor-array"),Lh=Ce();function X8e(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 aZ(r)?g=r.get(t):g=r[t],aZ(i)?c=i.get(a):c=i[a],v.fcn=Lh.factory(g,c,o),v;v.fcn=Lh.factory(o)}else v.fcn=Lh;return v.arity+=2,v}sZ.exports=X8e});var oZ=s(function(znr,uZ){"use strict";var Y8e=require("@stdlib/strided/base/nullary"),H8e=require("@stdlib/strided/base/binary"),Z8e=Rh();function Q8e(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?(Y8e([a],[r],[u],v.fcn),a):(H8e([e,i,a],[r],[t,n,u],v.fcn),a)}uZ.exports=Q8e});var gZ=s(function(Jnr,vZ){"use strict";var $8e=require("@stdlib/strided/base/nullary").ndarray,K8e=require("@stdlib/strided/base/binary").ndarray,eXe=Rh();function rXe(r,e,t,i,n,a,u,o,v,g,c){var l=eXe(e,t,i,n,a,u,arguments.length>10,c);return l.arity===0?($8e([o],[r],[v],[g],l.fcn),o):(K8e([e,n,o],[r],[t,a,v],[i,u,g],l.fcn),o)}vZ.exports=rXe});var lZ=s(function(Unr,dZ){"use strict";var tXe=require("@stdlib/utils/define-nonenumerable-read-only-property"),fZ=oZ(),iXe=gZ();tXe(fZ,"ndarray",iXe);dZ.exports=fZ});var Th=s(function(Cnr,mZ){"use strict";var cZ=require("@stdlib/array/base/assert/is-accessor-array"),Ph=fn();function nXe(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 cZ(r)?g=r.get(t):g=r[t],cZ(i)?c=i.get(a):c=i[a],v.fcn=Ph.factory(g,c,o),v;v.fcn=Ph.factory(o)}else v.fcn=Ph;return v.arity+=2,v}mZ.exports=nXe});var pZ=s(function(Bnr,hZ){"use strict";var aXe=require("@stdlib/strided/base/nullary"),sXe=require("@stdlib/strided/base/binary"),uXe=Th();function oXe(r,e,t,i,n,a,u,o){var v=uXe(e,t,0,i,n,0,arguments.length>7,o);return v.arity===0?(aXe([a],[r],[u],v.fcn),a):(sXe([e,i,a],[r],[t,n,u],v.fcn),a)}hZ.exports=oXe});var qZ=s(function(Dnr,yZ){"use strict";var vXe=require("@stdlib/strided/base/nullary").ndarray,gXe=require("@stdlib/strided/base/binary").ndarray,fXe=Th();function dXe(r,e,t,i,n,a,u,o,v,g,c){var l=fXe(e,t,i,n,a,u,arguments.length>10,c);return l.arity===0?(vXe([o],[r],[v],[g],l.fcn),o):(gXe([e,n,o],[r],[t,a,v],[i,u,g],l.fcn),o)}yZ.exports=dXe});var SZ=s(function(Xnr,wZ){"use strict";var lXe=require("@stdlib/utils/define-nonenumerable-read-only-property"),bZ=pZ(),cXe=qZ();lXe(bZ,"ndarray",cXe);wZ.exports=bZ});var Mh=s(function(Ynr,EZ){"use strict";var OZ=require("@stdlib/array/base/assert/is-accessor-array"),jh=dn();function mXe(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 OZ(r)?g=r.get(t):g=r[t],OZ(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}EZ.exports=mXe});var NZ=s(function(Hnr,_Z){"use strict";var hXe=require("@stdlib/strided/base/nullary"),pXe=require("@stdlib/strided/base/binary"),yXe=Mh();function qXe(r,e,t,i,n,a,u,o){var v=yXe(e,t,0,i,n,0,arguments.length>7,o);return v.arity===0?(hXe([a],[r],[u],v.fcn),a):(pXe([e,i,a],[r],[t,n,u],v.fcn),a)}_Z.exports=qXe});var RZ=s(function(Znr,LZ){"use strict";var bXe=require("@stdlib/strided/base/nullary").ndarray,wXe=require("@stdlib/strided/base/binary").ndarray,SXe=Mh();function OXe(r,e,t,i,n,a,u,o,v,g,c){var l=SXe(e,t,i,n,a,u,arguments.length>10,c);return l.arity===0?(bXe([o],[r],[v],[g],l.fcn),o):(wXe([e,n,o],[r],[t,a,v],[i,u,g],l.fcn),o)}LZ.exports=OXe});var jZ=s(function(Qnr,TZ){"use strict";var EXe=require("@stdlib/utils/define-nonenumerable-read-only-property"),PZ=NZ(),_Xe=RZ();EXe(PZ,"ndarray",_Xe);TZ.exports=PZ});var AZ=s(function($nr,xZ){"use strict";var NXe=require("@stdlib/strided/base/nullary"),MZ=$();function LXe(r,e,t,i){var n;return arguments.length>3?n=MZ.factory(i):n=MZ,NXe([e],[r],[t],n),e}xZ.exports=LXe});var FZ=s(function(Knr,VZ){"use strict";var RXe=require("@stdlib/strided/base/nullary").ndarray,GZ=$();function PXe(r,e,t,i,n){var a;return arguments.length>4?a=GZ.factory(n):a=GZ,RXe([e],[r],[t],[i],a),e}VZ.exports=PXe});var kZ=s(function(ear,IZ){"use strict";var TXe=require("@stdlib/strided/base/nullary"),WZ=$();function jXe(r,e,t,i){var n;return arguments.length>3?n=WZ.factory(i):n=WZ,TXe([e],[r],[t],n.normalized),e}IZ.exports=jXe});var UZ=s(function(rar,JZ){"use strict";var MXe=require("@stdlib/strided/base/nullary").ndarray,zZ=$();function xXe(r,e,t,i,n){var a;return arguments.length>4?a=zZ.factory(n):a=zZ,MXe([e],[r],[t],[i],a.normalized),e}JZ.exports=xXe});var DZ=s(function(tar,BZ){"use strict";var xh=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ah=AZ(),AXe=FZ(),CZ=kZ(),GXe=UZ();xh(Ah,"ndarray",AXe);xh(Ah,"normalized",CZ);xh(CZ,"ndarray",GXe);BZ.exports=Ah});var HZ=s(function(iar,YZ){"use strict";var VXe=require("@stdlib/strided/base/nullary"),XZ=ee();function FXe(r,e,t,i){var n;return arguments.length>3?n=XZ.factory(i):n=XZ,VXe([e],[r],[t],n),e}YZ.exports=FXe});var $Z=s(function(nar,QZ){"use strict";var WXe=require("@stdlib/strided/base/nullary").ndarray,ZZ=ee();function IXe(r,e,t,i,n){var a;return arguments.length>4?a=ZZ.factory(n):a=ZZ,WXe([e],[r],[t],[i],a),e}QZ.exports=IXe});var rQ=s(function(aar,eQ){"use strict";var kXe=require("@stdlib/strided/base/nullary"),KZ=ee();function zXe(r,e,t,i){var n;return arguments.length>3?n=KZ.factory(i):n=KZ,kXe([e],[r],[t],n.normalized),e}eQ.exports=zXe});var nQ=s(function(sar,iQ){"use strict";var JXe=require("@stdlib/strided/base/nullary").ndarray,tQ=ee();function UXe(r,e,t,i,n){var a;return arguments.length>4?a=tQ.factory(n):a=tQ,JXe([e],[r],[t],[i],a.normalized),e}iQ.exports=UXe});var uQ=s(function(uar,sQ){"use strict";var Gh=require("@stdlib/utils/define-nonenumerable-read-only-property"),Vh=HZ(),CXe=$Z(),aQ=rQ(),BXe=nQ();Gh(Vh,"ndarray",CXe);Gh(Vh,"normalized",aQ);Gh(aQ,"ndarray",BXe);sQ.exports=Vh});var gQ=s(function(oar,vQ){"use strict";var DXe=require("@stdlib/strided/base/nullary"),oQ=T();function XXe(r,e,t,i){var n;return arguments.length>3?n=oQ.factory(i):n=oQ,DXe([e],[r],[t],n),e}vQ.exports=XXe});var lQ=s(function(gar,dQ){"use strict";var YXe=require("@stdlib/strided/base/nullary").ndarray,fQ=T();function HXe(r,e,t,i,n){var a;return arguments.length>4?a=fQ.factory(n):a=fQ,YXe([e],[r],[t],[i],a),e}dQ.exports=HXe});var hQ=s(function(far,mQ){"use strict";var ZXe=require("@stdlib/strided/base/nullary"),cQ=T();function QXe(r,e,t,i){var n;return arguments.length>3?n=cQ.factory(i):n=cQ,ZXe([e],[r],[t],n.normalized),e}mQ.exports=QXe});var qQ=s(function(dar,yQ){"use strict";var $Xe=require("@stdlib/strided/base/nullary").ndarray,pQ=T();function KXe(r,e,t,i,n){var a;return arguments.length>4?a=pQ.factory(n):a=pQ,$Xe([e],[r],[t],[i],a.normalized),e}yQ.exports=KXe});var SQ=s(function(lar,wQ){"use strict";var Fh=require("@stdlib/utils/define-nonenumerable-read-only-property"),Wh=gQ(),e7e=lQ(),bQ=hQ(),r7e=qQ();Fh(Wh,"ndarray",e7e);Fh(Wh,"normalized",bQ);Fh(bQ,"ndarray",r7e);wQ.exports=Wh});var kh=s(function(car,EQ){"use strict";var OQ=require("@stdlib/array/base/assert/is-accessor-array"),Ih=cn();function t7e(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 OQ(r)?g=r.get(t):g=r[t],OQ(i)?c=i.get(a):c=i[a],v.fcn=Ih.factory(g,c,o),v;v.fcn=Ih.factory(o)}else v.fcn=Ih;return v.arity+=2,v}EQ.exports=t7e});var NQ=s(function(mar,_Q){"use strict";var i7e=require("@stdlib/strided/base/nullary"),n7e=require("@stdlib/strided/base/binary"),a7e=kh();function s7e(r,e,t,i,n,a,u,o){var v=a7e(e,t,0,i,n,0,arguments.length>7,o);return v.arity===0?(i7e([a],[r],[u],v.fcn),a):(n7e([e,i,a],[r],[t,n,u],v.fcn),a)}_Q.exports=s7e});var RQ=s(function(har,LQ){"use strict";var u7e=require("@stdlib/strided/base/nullary").ndarray,o7e=require("@stdlib/strided/base/binary").ndarray,v7e=kh();function g7e(r,e,t,i,n,a,u,o,v,g,c){var l=v7e(e,t,i,n,a,u,arguments.length>10,c);return l.arity===0?(u7e([o],[r],[v],[g],l.fcn),o):(o7e([e,n,o],[r],[t,a,v],[i,u,g],l.fcn),o)}LQ.exports=g7e});var jQ=s(function(par,TQ){"use strict";var f7e=require("@stdlib/utils/define-nonenumerable-read-only-property"),PQ=NQ(),d7e=RQ();f7e(PQ,"ndarray",d7e);TQ.exports=PQ});var AQ=s(function(yar,xQ){"use strict";var l7e=require("@stdlib/strided/base/nullary"),MQ=Tt();function c7e(r,e,t,i){var n;return arguments.length>3?n=MQ.factory(i):n=MQ,l7e([e],[r],[t],n),e}xQ.exports=c7e});var FQ=s(function(qar,VQ){"use strict";var m7e=require("@stdlib/strided/base/nullary").ndarray,GQ=Tt();function h7e(r,e,t,i,n){var a;return arguments.length>4?a=GQ.factory(n):a=GQ,m7e([e],[r],[t],[i],a),e}VQ.exports=h7e});var kQ=s(function(bar,IQ){"use strict";var p7e=require("@stdlib/utils/define-nonenumerable-read-only-property"),WQ=AQ(),y7e=FQ();p7e(WQ,"ndarray",y7e);IQ.exports=WQ});var Jh=s(function(war,JQ){"use strict";var zQ=require("@stdlib/array/base/assert/is-accessor-array"),zh=mn();function q7e(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 zQ(r)?g=r.get(t):g=r[t],zQ(i)?c=i.get(a):c=i[a],v.fcn=zh.factory(g,c,o),v;v.fcn=zh.factory(o)}else v.fcn=zh;return v.arity+=2,v}JQ.exports=q7e});var CQ=s(function(Sar,UQ){"use strict";var b7e=require("@stdlib/strided/base/nullary"),w7e=require("@stdlib/strided/base/binary"),S7e=Jh();function O7e(r,e,t,i,n,a,u,o){var v=S7e(e,t,0,i,n,0,arguments.length>7,o);return v.arity===0?(b7e([a],[r],[u],v.fcn),a):(w7e([e,i,a],[r],[t,n,u],v.fcn),a)}UQ.exports=O7e});var DQ=s(function(Oar,BQ){"use strict";var E7e=require("@stdlib/strided/base/nullary").ndarray,_7e=require("@stdlib/strided/base/binary").ndarray,N7e=Jh();function L7e(r,e,t,i,n,a,u,o,v,g,c){var l=N7e(e,t,i,n,a,u,arguments.length>10,c);return l.arity===0?(E7e([o],[r],[v],[g],l.fcn),o):(_7e([e,n,o],[r],[t,a,v],[i,u,g],l.fcn),o)}BQ.exports=L7e});var HQ=s(function(Ear,YQ){"use strict";var R7e=require("@stdlib/utils/define-nonenumerable-read-only-property"),XQ=CQ(),P7e=DQ();R7e(XQ,"ndarray",P7e);YQ.exports=XQ});var Ch=s(function(_ar,QQ){"use strict";var ZQ=require("@stdlib/array/base/assert/is-accessor-array"),Uh=hn();function T7e(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 ZQ(r)?g=r.get(t):g=r[t],ZQ(i)?c=i.get(a):c=i[a],v.fcn=Uh.factory(g,c,o),v;v.fcn=Uh.factory(o)}else v.fcn=Uh;return v.arity+=2,v}QQ.exports=T7e});var KQ=s(function(Nar,$Q){"use strict";var j7e=require("@stdlib/strided/base/nullary"),M7e=require("@stdlib/strided/base/binary"),x7e=Ch();function A7e(r,e,t,i,n,a,u,o){var v=x7e(e,t,0,i,n,0,arguments.length>7,o);return v.arity===0?(j7e([a],[r],[u],v.fcn),a):(M7e([e,i,a],[r],[t,n,u],v.fcn),a)}$Q.exports=A7e});var r$=s(function(Lar,e$){"use strict";var G7e=require("@stdlib/strided/base/nullary").ndarray,V7e=require("@stdlib/strided/base/binary").ndarray,F7e=Ch();function W7e(r,e,t,i,n,a,u,o,v,g,c){var l=F7e(e,t,i,n,a,u,arguments.length>10,c);return l.arity===0?(G7e([o],[r],[v],[g],l.fcn),o):(V7e([e,n,o],[r],[t,a,v],[i,u,g],l.fcn),o)}e$.exports=W7e});var n$=s(function(Rar,i$){"use strict";var I7e=require("@stdlib/utils/define-nonenumerable-read-only-property"),t$=KQ(),k7e=r$();I7e(t$,"ndarray",k7e);i$.exports=t$});var s$=s(function(Par,a$){"use strict";var z=require("@stdlib/utils/define-read-only-property"),k={};z(k,"arcsine",gH());z(k,"beta",qH());z(k,"betaprime",RH());z(k,"cosine",FH());z(k,"discreteUniform",DH());z(k,"exponential",nZ());z(k,"gamma",lZ());z(k,"invgamma",SZ());z(k,"lognormal",jZ());z(k,"minstd",DZ());z(k,"minstdShuffle",uQ());z(k,"mt19937",SQ());z(k,"normal",jQ());z(k,"randu",kQ());z(k,"uniform",HQ());z(k,"weibull",n$());a$.exports=k});var aa=require("@stdlib/utils/define-read-only-property"),tn={};aa(tn,"array",lx());aa(tn,"base",n1());aa(tn,"iterators",cI());aa(tn,"sample",WI());aa(tn,"shuffle",$I());aa(tn,"streams",rH());aa(tn,"strided",s$());module.exports=tn; +"use strict";var s=function(r,e){return function(){return e||r((e={exports:{}}).exports,e),e.exports}};var Hh=s(function(t5e,Yh){"use strict";var m$=require("@stdlib/assert/is-plain-object"),h$=require("@stdlib/assert/has-own-property"),p$=require("@stdlib/array/base/assert/contains"),Xh=require("@stdlib/string/format");function y$(r,e,t){return m$(t)?h$(t,"dtype")&&(r.dtype=t.dtype,!p$(e,r.dtype))?new TypeError(Xh('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",e.join('", "'),r.dtype)):null:new TypeError(Xh("invalid argument. Options argument must be an object. Value: `%s`.",t))}Yh.exports=y$});var Kh=s(function(i5e,$h){"use strict";var Zh=require("@stdlib/utils/define-nonenumerable-read-only-property"),q$=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,b$=require("@stdlib/assert/is-function"),w$=require("@stdlib/assert/is-string-array").primitives,S$=require("@stdlib/assert/is-collection"),O$=require("@stdlib/array/base/assert/contains"),E$=require("@stdlib/array/base/filled-by"),Qh=require("@stdlib/strided/base/binary"),_$=require("@stdlib/array/ctors"),Ws=require("@stdlib/string/format"),N$=Hh();function Is(r,e,t){if(!(this instanceof Is))return new Is(r,e,t);if(!b$(r))throw new TypeError(Ws("invalid argument. First argument must be a function. Value: `%s`.",r));if(!w$(e))throw new TypeError(Ws("invalid argument. Second argument must be an array of strings. Value: `%s`.",e));if(!O$(e,t))throw new TypeError(Ws("invalid argument. Third argument must be a supported data type. Value: `%s`.",t));return this._prng=r,this._dtypes=e,this._dtype=t,this}Zh(Is.prototype,"generate",function(e,t,i,n){var a,u,o,v,g,c;if(!q$(e))throw new TypeError(Ws("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",e));if(u={},arguments.length>3&&(g=N$(u,this._dtypes,n),g))throw g;if(o=this._prng,c=u.dtype||this._dtype,c==="generic")return E$(e,l);return a=_$(c),v=new a(e),Qh([[t],[i],v],[e],[0,0,1],o),v;function l(){return o(t,i)}});Zh(Is.prototype,"assign",function(e,t,i){if(!S$(i))throw new TypeError(Ws("invalid argument. Third argument must be an array-like object. Value: `%s`.",i));return Qh([[e],[t],i],[i.length],[0,0,1],this._prng),i});$h.exports=Is});var rp=s(function(n5e,ep){"use strict";var L$=Kh();ep.exports=L$});var np=s(function(a5e,ip){"use strict";var R$=require("@stdlib/assert/is-plain-object"),P$=require("@stdlib/assert/has-own-property"),T$=require("@stdlib/array/base/assert/contains"),tp=require("@stdlib/string/format");function j$(r,e,t){return R$(t)?P$(t,"dtype")&&(r.dtype=t.dtype,!T$(e,r.dtype))?new TypeError(tp('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",e.join('", "'),r.dtype)):null:new TypeError(tp("invalid argument. Options argument must be an object. Value: `%s`.",t))}ip.exports=j$});var op=s(function(s5e,up){"use strict";var ap=require("@stdlib/utils/define-nonenumerable-read-only-property"),M$=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,x$=require("@stdlib/assert/is-function"),A$=require("@stdlib/assert/is-string-array").primitives,G$=require("@stdlib/assert/is-collection"),V$=require("@stdlib/array/base/assert/contains"),F$=require("@stdlib/array/base/filled-by"),sp=require("@stdlib/strided/base/nullary"),W$=require("@stdlib/array/ctors"),ks=require("@stdlib/string/format"),I$=np();function zs(r,e,t){if(!(this instanceof zs))return new zs(r,e,t);if(!x$(r))throw new TypeError(ks("invalid argument. First argument must be a function. Value: `%s`.",r));if(!A$(e))throw new TypeError(ks("invalid argument. Second argument must be an array of strings. Value: `%s`.",e));if(!V$(e,t))throw new TypeError(ks("invalid argument. Third argument must be a supported data type. Value: `%s`.",t));return this._prng=r,this._dtypes=e,this._dtype=t,this}ap(zs.prototype,"generate",function(e,t){var i,n,a,u,o;if(!M$(e))throw new TypeError(ks("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",e));if(n={},arguments.length>1&&(u=I$(n,this._dtypes,t),u))throw u;return o=n.dtype||this._dtype,o==="generic"?F$(e,this._prng):(i=W$(o),a=new i(e),sp([a],[e],[1],this._prng),a)});ap(zs.prototype,"assign",function(e){if(!G$(e))throw new TypeError(ks("invalid argument. First argument must be an array-like object. Value: `%s`.",e));return sp([e],[e.length],[1],this._prng),e});up.exports=zs});var _u=s(function(u5e,vp){"use strict";var k$=op();vp.exports=k$});var lp=s(function(o5e,dp){"use strict";var gp=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Nu=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),ua=require("@stdlib/utils/define-nonenumerable-read-only-property"),z$=require("@stdlib/assert/is-string-array").primitives,J$=require("@stdlib/assert/is-function"),U$=require("@stdlib/assert/is-method-in"),C$=require("@stdlib/assert/has-own-property"),fp=require("@stdlib/array/base/assert/contains").factory,B$=require("@stdlib/utils/constant-function"),D$=require("@stdlib/utils/noop"),X$=rp(),Y$=_u(),Js=require("@stdlib/string/format");function H$(r,e,t){var i;if(!J$(r))throw new TypeError(Js("invalid argument. First argument must be a function. Value: `%s`.",r));if(!U$(r,"factory"))throw new TypeError(Js("invalid argument. First argument must have a `%s` method.","factory"));if(!z$(e))throw new TypeError(Js("invalid argument. Second argument must an array of strings. Value: `%s`.",e));if(!fp(e,t))throw new TypeError(Js("invalid argument. Third argument must be a supported data type. Value: `%s`.",t));return i=fp(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),C$(m,"dtype")){if(p=m.dtype,!i(p))throw new TypeError(Js('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=X$):(g=q,a=Y$),u=new a(l,e,p),m&&m.prng?(ua(h,"seed",null),ua(h,"seedLength",null),gp(h,"state",B$(null),D$),ua(h,"stateLength",null),ua(h,"byteLength",null)):(Nu(h,"seed",b),Nu(h,"seedLength",w),gp(h,"state",J,x),Nu(h,"stateLength",S),Nu(h,"byteLength",W)),ua(h,"PRNG",l.PRNG),ua(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}}}dp.exports=H$});var F=s(function(v5e,cp){"use strict";var Z$=lp();cp.exports=Z$});var Md=s(function(g5e,mp){"use strict";var Q$=require("@stdlib/constants/uint32/max"),$$=require("@stdlib/math/base/special/floor"),K$=Q$-1;function eK(){var r=$$(1+K$*Math.random());return r>>>0}mp.exports=eK});var kd=s(function(f5e,Np){"use strict";var Ar=require("@stdlib/utils/define-nonenumerable-read-only-property"),ft=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),hp=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),xd=require("@stdlib/assert/has-own-property"),rK=require("@stdlib/assert/is-plain-object"),tK=require("@stdlib/assert/is-collection"),pp=require("@stdlib/assert/is-uint32array"),iK=require("@stdlib/assert/is-boolean").isPrimitive,yp=require("@stdlib/assert/is-positive-integer").isPrimitive,Op=require("@stdlib/constants/float64/max-safe-integer"),Ep=require("@stdlib/constants/uint32/max"),U=require("@stdlib/array/uint32"),nK=require("@stdlib/math/base/special/max"),Id=require("@stdlib/math/base/ops/umul"),oa=require("@stdlib/blas/base/gcopy"),aK=require("@stdlib/array/to-json"),B=require("@stdlib/string/format"),qp=Md(),I=624,Ad=397,bp=Ep>>>0,sK=19650218,Gd=2147483648,Vd=2147483647,uK=1812433253,oK=1664525,vK=1566083941,gK=2636928640,fK=4022730752,dK=2567483615,Fd=[0,dK>>>0],_p=1/(Op+1),lK=67108864,cK=2147483648,Wd=1,mK=Op*_p,Lu=1,Ru=3,dt=2,lt=I+3,C=I+5,Us=I+6;function wp(r,e){var t;return e?t="option":t="argument",r.length>>0,i=1;i>>0,t=(t^t>>>30)>>>0,r[i]=Id(t,uK)+i>>>0;return r}function hK(r,e,t,i){var n,a,u,o;for(a=1,u=0,o=nK(e,i);o>0;o--)n=r[a-1]>>>0,n=(n^n>>>30)>>>0,n=Id(n,oK)>>>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=Id(n,vK)>>>0,r[a]=(r[a]>>>0^n)-a>>>0,a+=1,a>=e&&(r[0]=r[e-1],a=1);return r[0]=cK,r}function pK(r){var e,t,i,n;for(n=I-Ad,t=0;t>>1^Fd[e&Wd];for(i=I-1;t>>1^Fd[e&Wd];return e=r[i]&Gd|r[0]&Vd,r[i]=r[Ad-1]^e>>>1^Fd[e&Wd],r}function yK(r){var e,t,i,n,a,u;if(i={},arguments.length){if(!rK(r))throw new TypeError(B("invalid argument. Options argument must be an object. Value: `%s`.",r));if(xd(r,"copy")&&(i.copy=r.copy,!iK(r.copy)))throw new TypeError(B("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",r.copy));if(xd(r,"state")){if(t=r.state,i.state=!0,!pp(t))throw new TypeError(B("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",t));if(u=wp(t,!0),u)throw u;i.copy===!1?e=t:(e=new U(t.length),oa(t.length,t,1,e,1)),t=new U(e.buffer,e.byteOffset+(dt+1)*e.BYTES_PER_ELEMENT,I),n=new U(e.buffer,e.byteOffset+(C+1)*e.BYTES_PER_ELEMENT,t[C])}if(n===void 0)if(xd(r,"seed"))if(n=r.seed,i.seed=!0,yp(n)){if(n>bp)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],!yp(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>bp)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(Us+a),e[0]=Lu,e[1]=Ru,e[dt]=I,e[lt]=1,e[lt+1]=I,e[C]=a,oa.ndarray(a,n,1,0,e,1,C+1),t=new U(e.buffer,e.byteOffset+(dt+1)*e.BYTES_PER_ELEMENT,I),n=new U(e.buffer,e.byteOffset+(C+1)*e.BYTES_PER_ELEMENT,a),t=Sp(t,I,sK),t=hK(t,I,n,a)}else n=qp()>>>0}else n=qp()>>>0;return t===void 0&&(e=new U(Us+1),e[0]=Lu,e[1]=Ru,e[dt]=I,e[lt]=1,e[lt+1]=I,e[C]=1,e[C+1]=n,t=new U(e.buffer,e.byteOffset+(dt+1)*e.BYTES_PER_ELEMENT,I),n=new U(e.buffer,e.byteOffset+(C+1)*e.BYTES_PER_ELEMENT,1),t=Sp(t,I,n)),Ar(p,"NAME","mt19937"),ft(p,"seed",o),ft(p,"seedLength",v),hp(p,"state",l,m),ft(p,"stateLength",g),ft(p,"byteLength",c),Ar(p,"toJSON",h),Ar(p,"MIN",0),Ar(p,"MAX",Ep),Ar(p,"normalized",d),Ar(d,"NAME",p.NAME),ft(d,"seed",o),ft(d,"seedLength",v),hp(d,"state",l,m),ft(d,"stateLength",g),ft(d,"byteLength",c),Ar(d,"toJSON",h),Ar(d,"MIN",0),Ar(d,"MAX",mK),p;function o(){var f=e[C];return oa(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 oa(f,e,1,new U(f),1)}function m(f){var y;if(!pp(f))throw new TypeError(B("invalid argument. Must provide a Uint32Array. Value: `%s`.",f));if(y=wp(f,!1),y)throw y;i.copy===!1?i.state&&f.length===e.length?oa(f.length,f,1,e,1):(e=f,i.state=!0):(f.length!==e.length&&(e=new U(f.length)),oa(f.length,f,1,e,1)),t=new U(e.buffer,e.byteOffset+(dt+1)*e.BYTES_PER_ELEMENT,I),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=aK(e),f.params=[],f}function p(){var f,y;return y=e[lt+1],y>=I&&(t=pK(t),y=0),f=t[y],e[lt+1]=y+1,f^=f>>>11,f^=f<<7&gK,f^=f<<15&fK,f^=f>>>18,f>>>0}function d(){var f=p()>>>5,y=p()>>>6;return(f*lK+y)*_p}}Np.exports=yK});var Rp=s(function(d5e,Lp){"use strict";var qK=kd(),bK=Md(),wK=qK({seed:bK()});Lp.exports=wK});var T=s(function(l5e,Tp){"use strict";var SK=require("@stdlib/utils/define-nonenumerable-read-only-property"),Pp=Rp(),OK=kd();SK(Pp,"factory",OK);Tp.exports=Pp});var Ap=s(function(c5e,xp){"use strict";var jp=require("@stdlib/assert/is-number").isPrimitive,zd=require("@stdlib/string/format"),Mp=require("@stdlib/assert/is-nan");function EK(r,e){return!jp(r)||Mp(r)?new TypeError(zd("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):!jp(e)||Mp(e)?new TypeError(zd("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e)):r>=e?new RangeError(zd("invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.",r,e)):null}xp.exports=EK});var Vp=s(function(m5e,Gp){"use strict";var _K=require("@stdlib/math/base/special/pow"),NK=require("@stdlib/math/base/special/sin"),LK=require("@stdlib/constants/float64/half-pi");function RK(r,e,t){return e+_K(NK(LK*r()),2)*(t-e)}Gp.exports=RK});var Jd=s(function(h5e,Cp){"use strict";var Gr=require("@stdlib/utils/define-nonenumerable-read-only-property"),Pu=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Fp=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Wp=require("@stdlib/assert/is-plain-object"),Ip=require("@stdlib/assert/is-function"),kp=require("@stdlib/assert/has-own-property"),zp=require("@stdlib/utils/constant-function"),PK=require("@stdlib/utils/noop"),Tu=T().factory,Jp=require("@stdlib/math/base/assert/is-nan"),TK=require("@stdlib/array/to-json"),ju=require("@stdlib/string/format"),jK=Ap(),Up=Vp();function MK(){var r,e,t,i,n,a;if(arguments.length===0)e=Tu();else if(arguments.length===1){if(r=arguments[0],!Wp(r))throw new TypeError(ju("invalid argument. Options argument must be an object. Value: `%s`.",r));if(kp(r,"prng")){if(!Ip(r.prng))throw new TypeError(ju("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Tu(r)}else{if(n=arguments[0],a=arguments[1],i=jK(n,a),i)throw i;if(arguments.length>2){if(r=arguments[2],!Wp(r))throw new TypeError(ju("invalid argument. Options argument must be an object. Value: `%s`.",r));if(kp(r,"prng")){if(!Ip(r.prng))throw new TypeError(ju("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Tu(r)}else e=Tu()}return n===void 0?t=p:t=h,Gr(t,"NAME","arcsine"),r&&r.prng?(Gr(t,"seed",null),Gr(t,"seedLength",null),Fp(t,"state",zp(null),PK),Gr(t,"stateLength",null),Gr(t,"byteLength",null),Gr(t,"toJSON",zp(null)),Gr(t,"PRNG",e)):(Pu(t,"seed",u),Pu(t,"seedLength",o),Fp(t,"state",c,l),Pu(t,"stateLength",v),Pu(t,"byteLength",g),Gr(t,"toJSON",m),Gr(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=TK(e.state),n===void 0?d.params=[]:d.params=[n,a],d}function h(){return Up(e,n,a)}function p(d,f){return Jp(d)||Jp(f)||d>=f?NaN:Up(e,d,f)}}Cp.exports=MK});var Dp=s(function(p5e,Bp){"use strict";var xK=Jd(),AK=xK();Bp.exports=AK});var nn=s(function(y5e,Yp){"use strict";var GK=require("@stdlib/utils/define-nonenumerable-read-only-property"),Xp=Dp(),VK=Jd();GK(Xp,"factory",VK);Yp.exports=Xp});var Ud=s(function(q5e,Hp){"use strict";var FK=F(),WK=require("@stdlib/array/dtypes"),IK=require("@stdlib/array/defaults"),kK=nn(),zK=WK("real_floating_point_and_generic"),JK=FK(kK,zK,IK.get("dtypes.real_floating_point"));Hp.exports=JK});var Qp=s(function(b5e,Zp){"use strict";var UK=Ud(),CK=UK();Zp.exports=CK});var ey=s(function(w5e,Kp){"use strict";var BK=require("@stdlib/utils/define-nonenumerable-read-only-property"),$p=Qp(),DK=Ud();BK($p,"factory",DK);Kp.exports=$p});var iy=s(function(S5e,ty){"use strict";var XK=require("@stdlib/assert/is-plain-object"),YK=require("@stdlib/assert/has-own-property"),HK=require("@stdlib/array/base/assert/contains"),ry=require("@stdlib/string/format");function ZK(r,e,t){return XK(t)?YK(t,"dtype")&&(r.dtype=t.dtype,!HK(e,r.dtype))?new TypeError(ry('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",e.join('", "'),r.dtype)):null:new TypeError(ry("invalid argument. Options argument must be an object. Value: `%s`.",t))}ty.exports=ZK});var uy=s(function(O5e,sy){"use strict";var ny=require("@stdlib/utils/define-nonenumerable-read-only-property"),QK=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,$K=require("@stdlib/assert/is-function"),KK=require("@stdlib/assert/is-string-array").primitives,eee=require("@stdlib/assert/is-collection"),ree=require("@stdlib/array/base/assert/contains"),tee=require("@stdlib/array/base/filled-by"),ay=require("@stdlib/strided/base/unary"),iee=require("@stdlib/array/ctors"),Cs=require("@stdlib/string/format"),nee=iy();function Bs(r,e,t){if(!(this instanceof Bs))return new Bs(r,e,t);if(!$K(r))throw new TypeError(Cs("invalid argument. First argument must be a function. Value: `%s`.",r));if(!KK(e))throw new TypeError(Cs("invalid argument. Second argument must be an array of strings. Value: `%s`.",e));if(!ree(e,t))throw new TypeError(Cs("invalid argument. Third argument must be a supported data type. Value: `%s`.",t));return this._prng=r,this._dtypes=e,this._dtype=t,this}ny(Bs.prototype,"generate",function(e,t,i){var n,a,u,o,v,g;if(!QK(e))throw new TypeError(Cs("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",e));if(a={},arguments.length>2&&(v=nee(a,this._dtypes,i),v))throw v;if(u=this._prng,g=a.dtype||this._dtype,g==="generic")return tee(e,c);return n=iee(g),o=new n(e),ay([[t],o],[e],[0,1],u),o;function c(){return u(t)}});ny(Bs.prototype,"assign",function(e,t){if(!eee(t))throw new TypeError(Cs("invalid argument. Second argument must be an array-like object. Value: `%s`.",t));return ay([[e],t],[t.length],[0,1],this._prng),t});sy.exports=Bs});var vy=s(function(E5e,oy){"use strict";var aee=uy();oy.exports=aee});var ly=s(function(_5e,dy){"use strict";var gy=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Mu=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),va=require("@stdlib/utils/define-nonenumerable-read-only-property"),see=require("@stdlib/assert/is-string-array").primitives,uee=require("@stdlib/assert/is-function"),oee=require("@stdlib/assert/is-method-in"),vee=require("@stdlib/assert/is-plain-object"),gee=require("@stdlib/assert/has-own-property"),fy=require("@stdlib/array/base/assert/contains").factory,fee=require("@stdlib/utils/constant-function"),dee=require("@stdlib/utils/noop"),lee=vy(),cee=_u(),Ds=require("@stdlib/string/format");function mee(r,e,t){var i;if(!uee(r))throw new TypeError(Ds("invalid argument. First argument must be a function. Value: `%s`.",r));if(!oee(r,"factory"))throw new TypeError(Ds("invalid argument. First argument must have a `%s` method.","factory"));if(!see(e))throw new TypeError(Ds("invalid argument. Second argument must an array of strings. Value: `%s`.",e));if(!fy(e,t))throw new TypeError(Ds("invalid argument. Third argument must be a supported data type. Value: `%s`.",t));return i=fy(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):vee(arguments[0])?(l=arguments[0],c=r.factory(l),m=p):(o=arguments[0],l={},c=r.factory(o),m=d),gee(l,"dtype")){if(h=l.dtype,!i(h))throw new TypeError(Ds('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=lee):(v=y,a=cee),u=new a(c,e,h),l&&l.prng?(va(m,"seed",null),va(m,"seedLength",null),gy(m,"state",fee(null),dee),va(m,"stateLength",null),va(m,"byteLength",null)):(Mu(m,"seed",q),Mu(m,"seedLength",b),gy(m,"state",W,J),Mu(m,"stateLength",w),Mu(m,"byteLength",S)),va(m,"PRNG",c.PRNG),va(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}}}dy.exports=mee});var Vr=s(function(N5e,cy){"use strict";var hee=ly();cy.exports=hee});var Cd=s(function(L5e,by){"use strict";var Fr=require("@stdlib/utils/define-nonenumerable-read-only-property"),xu=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),my=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),hy=require("@stdlib/assert/is-plain-object"),pee=require("@stdlib/assert/is-probability").isPrimitive,py=require("@stdlib/assert/is-function"),yy=require("@stdlib/assert/has-own-property"),qy=require("@stdlib/utils/constant-function"),yee=require("@stdlib/utils/noop"),Au=T().factory,qee=require("@stdlib/math/base/assert/is-nan"),bee=require("@stdlib/array/to-json"),Gu=require("@stdlib/string/format");function wee(){var r,e,t,i;if(arguments.length===0)e=Au();else if(arguments.length===1&&hy(arguments[0]))if(r=arguments[0],yy(r,"prng")){if(!py(r.prng))throw new TypeError(Gu("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Au(r);else{if(i=arguments[0],!pee(i))throw new TypeError(Gu("invalid argument. First argument must be a probability. Value: `%s`.",i));if(arguments.length>1){if(r=arguments[1],!hy(r))throw new TypeError(Gu("invalid argument. Options argument must be an object. Value: `%s`.",r));if(yy(r,"prng")){if(!py(r.prng))throw new TypeError(Gu("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Au(r)}else e=Au()}return i===void 0?t=m:t=l,Fr(t,"NAME","bernoulli"),r&&r.prng?(Fr(t,"seed",null),Fr(t,"seedLength",null),my(t,"state",qy(null),yee),Fr(t,"stateLength",null),Fr(t,"byteLength",null),Fr(t,"toJSON",qy(null)),Fr(t,"PRNG",e)):(xu(t,"seed",n),xu(t,"seedLength",a),my(t,"state",v,g),xu(t,"stateLength",u),xu(t,"byteLength",o),Fr(t,"toJSON",c),Fr(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=bee(e.state),i===void 0?h.params=[]:h.params=[i],h}function l(){return e()<=i?1:0}function m(h){return qee(h)||h<0||h>1?NaN:e()<=h?1:0}}by.exports=wee});var Sy=s(function(R5e,wy){"use strict";var See=Cd(),Oee=See();wy.exports=Oee});var an=s(function(P5e,Ey){"use strict";var Eee=require("@stdlib/utils/define-nonenumerable-read-only-property"),Oy=Sy(),_ee=Cd();Eee(Oy,"factory",_ee);Ey.exports=Oy});var Bd=s(function(T5e,_y){"use strict";var Nee=Vr(),Lee=require("@stdlib/array/dtypes"),Ree=require("@stdlib/array/defaults"),Pee=an(),Tee=Lee("real_and_generic"),jee=Nee(Pee,Tee,Ree.get("dtypes.real"));_y.exports=jee});var Ly=s(function(j5e,Ny){"use strict";var Mee=Bd(),xee=Mee();Ny.exports=xee});var Ty=s(function(M5e,Py){"use strict";var Aee=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ry=Ly(),Gee=Bd();Aee(Ry,"factory",Gee);Py.exports=Ry});var Ay=s(function(x5e,xy){"use strict";var Vee=require("@stdlib/math/base/special/sqrt"),jy=require("@stdlib/math/base/special/exp"),Fee=require("@stdlib/math/base/special/ln"),My=.00991256303526217;function Wee(r,e){var t,i,n;for(i=jy(-.5*e*e),t=[],t.push(My/i),t.push(e),n=2;n=0&&g<=1&&(v=r(),n=Yd(u,4),c=8*t-12,c=1-n/c,v<=c?i=!1:(c+=.5*Yd(n/(8*t-8),2),v=sq(v)&&(i=!1))));return g}uq.exports=dre});var gq=s(function(U5e,vq){"use strict";var lre=require("@stdlib/math/base/special/pow"),Wu=require("@stdlib/math/base/special/ln");function cre(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*Wu(g),u=o/g,n=.5/lre(g,.5),a=!0;a===!0;)l=e(),h=u+l*n,h>=0&&h<=1&&(m=r(),p=o*Wu(h/o),p+=v*Wu((1-h)/v),p+=c+.5*l*l,p>=Wu(m)&&(a=!1));return h}vq.exports=cre});var lq=s(function(C5e,dq){"use strict";var Hd=require("@stdlib/math/base/special/exp"),fq=require("@stdlib/math/base/special/pow"),Zd=require("@stdlib/math/base/special/ln");function mre(r,e,t){for(var i,n,a,u,o,v,g;;)if(u=r(),o=r(),v=fq(u,1/e),g=fq(o,1/t),a=v+g,a<=1)return a>0?v/a:(i=Zd(u)/e,n=Zd(o)/t,i>n?(n-=i,i=0):(i-=n,n=0),Hd(i-Zd(Hd(i)+Hd(n))))}dq.exports=mre});var hq=s(function(B5e,mq){"use strict";var cq=aq(),hre=oq(),pre=gq(),yre=lq();function qre(r,e,t,i){var n,a;return t===i&&t>1.5?hre(r,e,t):t>1&&i>1?pre(r,e,t,i):t<1&&i<1?yre(r,t,i):(n=cq(r,e,t),a=cq(r,e,i),n/(n+a))}mq.exports=qre});var el=s(function(D5e,Nq){"use strict";var Wr=require("@stdlib/utils/define-nonenumerable-read-only-property"),Iu=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),pq=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),yq=require("@stdlib/assert/is-plain-object"),qq=require("@stdlib/assert/is-boolean").isPrimitive,bq=require("@stdlib/assert/is-function"),ga=require("@stdlib/assert/has-own-property"),wq=require("@stdlib/utils/constant-function"),bre=require("@stdlib/utils/noop"),Sq=Q().factory,ku=T().factory,Oq=require("@stdlib/math/base/assert/is-nan"),Qd=require("@stdlib/blas/base/gcopy"),$d=require("@stdlib/array/uint32"),Kd=require("@stdlib/assert/is-uint32array"),Eq=require("@stdlib/object/assign"),wre=require("@stdlib/array/to-json"),Ir=require("@stdlib/string/format"),Sre=eq(),_q=hq();function Ore(){var r,e,t,i,n,a,u,o,v;if(o=!0,arguments.length===0)n={copy:!1},a=ku(n);else if(arguments.length===1){if(n=arguments[0],!yq(n))throw new TypeError(Ir("invalid argument. Options argument must be an object. Value: `%s`.",n));if(ga(n,"copy")&&!qq(n.copy))throw new TypeError(Ir("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",n.copy));if(ga(n,"prng")){if(!bq(n.prng))throw new TypeError(Ir("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",n.prng));a=n.prng}else{if(ga(n,"state")&&!Kd(n.state))throw new TypeError(Ir("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",n.state));n=Eq({},n),n.copy===!1?o=!1:n.state&&(n.state=Qd(n.state.length,n.state,1,new $d(n.state.length),1)),n.copy=!1,a=ku(n)}}else{if(t=arguments[0],i=arguments[1],v=Sre(t,i),v)throw v;if(arguments.length>2){if(n=arguments[2],!yq(n))throw new TypeError(Ir("invalid argument. Options argument must be an object. Value: `%s`.",n));if(ga(n,"copy")&&!qq(n.copy))throw new TypeError(Ir("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",n.copy));if(ga(n,"prng")){if(!bq(n.prng))throw new TypeError(Ir("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",n.prng));a=n.prng}else{if(ga(n,"state")&&!Kd(n.state))throw new TypeError(Ir("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",n.state));n=Eq({},n),n.copy===!1?o=!1:n.state&&(n.state=Qd(n.state.length,n.state,1,new $d(n.state.length),1)),n.copy=!1,a=ku(n)}}else n={copy:!1},a=ku(n)}return n&&n.prng?e=Sq({prng:n.prng}):(n.state?r=n.state:(r=a.state,a.state=r),e=Sq({state:r,copy:!1})),t===void 0?u=y:u=f,Wr(u,"NAME","beta"),n&&n.prng?(Wr(u,"seed",null),Wr(u,"seedLength",null),pq(u,"state",wq(null),bre),Wr(u,"stateLength",null),Wr(u,"byteLength",null),Wr(u,"toJSON",wq(null)),Wr(u,"PRNG",a)):(Iu(u,"seed",g),Iu(u,"seedLength",c),pq(u,"state",h,p),Iu(u,"stateLength",l),Iu(u,"byteLength",m),Wr(u,"toJSON",d),Wr(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(!Kd(q))throw new TypeError(Ir("invalid argument. Must provide a Uint32Array. Value: `%s`.",q));o&&(q=Qd(q.length,q,1,new $d(q.length),1)),a.state=q}function d(){var q={};return q.type="PRNG",q.name=u.NAME,q.state=wre(a.state),t===void 0?q.params=[]:q.params=[t,i],q}function f(){return _q(a,e,t,i)}function y(q,b){return Oq(q)||Oq(b)||q<=0||b<=0?NaN:_q(a,e,q,b)}}Nq.exports=Ore});var Rq=s(function(X5e,Lq){"use strict";var Ere=el(),_re=Ere();Lq.exports=_re});var un=s(function(Y5e,Tq){"use strict";var Nre=require("@stdlib/utils/define-nonenumerable-read-only-property"),Pq=Rq(),Lre=el();Nre(Pq,"factory",Lre);Tq.exports=Pq});var rl=s(function(H5e,jq){"use strict";var Rre=F(),Pre=require("@stdlib/array/dtypes"),Tre=require("@stdlib/array/defaults"),jre=un(),Mre=Pre("real_floating_point_and_generic"),xre=Rre(jre,Mre,Tre.get("dtypes.real_floating_point"));jq.exports=xre});var xq=s(function(Z5e,Mq){"use strict";var Are=rl(),Gre=Are();Mq.exports=Gre});var Vq=s(function(Q5e,Gq){"use strict";var Vre=require("@stdlib/utils/define-nonenumerable-read-only-property"),Aq=xq(),Fre=rl();Vre(Aq,"factory",Fre);Gq.exports=Aq});var kq=s(function($5e,Iq){"use strict";var Fq=require("@stdlib/assert/is-positive-number").isPrimitive,Wq=require("@stdlib/string/format");function Wre(r,e){return Fq(r)?Fq(e)?null:new TypeError(Wq("invalid argument. Second argument must be a positive number. Value: `%s`.",e)):new TypeError(Wq("invalid argument. First argument must be a positive number. Value: `%s`.",r))}Iq.exports=Wre});var Uq=s(function(K5e,Jq){"use strict";var zq=require("@stdlib/math/base/special/ln");function Ire(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+zq(l)),c=r(),(c2){if(n=arguments[2],!Bq(n))throw new TypeError(zr("invalid argument. Options argument must be an object. Value: `%s`.",n));if(fa(n,"copy")&&!Dq(n.copy))throw new TypeError(zr("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",n.copy));if(fa(n,"prng")){if(!Xq(n.prng))throw new TypeError(zr("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",n.prng));a=n.prng}else{if(fa(n,"state")&&!tl(n.state))throw new TypeError(zr("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",n.state));n=$q({},n),n.copy===!1?o=!1:n.state&&(n.state=nl(n.state.length,n.state,1,new al(n.state.length),1)),n.copy=!1,a=Ju(n)}}else n={copy:!1},a=Ju(n)}return n&&n.prng?t=Hq({prng:n.prng}):(n.state?r=n.state:(r=a.state,a.state=r),t=Hq({state:r,copy:!1})),e===void 0?u=w:(e>=1?(u=q,c=e-Cu):(u=b,c=e+1-Cu),g=1/il(9*c)),kr(u,"NAME","gamma"),n&&n.prng?(kr(u,"seed",null),kr(u,"seedLength",null),Cq(u,"state",Yq(null),kre),kr(u,"stateLength",null),kr(u,"byteLength",null),kr(u,"toJSON",Yq(null)),kr(u,"PRNG",a)):(zu(u,"seed",l),zu(u,"seedLength",m),Cq(u,"state",d,f),zu(u,"stateLength",h),zu(u,"byteLength",p),kr(u,"toJSON",y),kr(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(!tl(S))throw new TypeError(zr("invalid argument. Must provide a Uint32Array. Value: `%s`.",S));o&&(S=nl(S.length,S,1,new al(S.length),1)),a.state=S}function y(){var S={};return S.type="PRNG",S.name=u.NAME,S.state=zre(a.state),e===void 0?S.params=[]:S.params=[e,i],S}function q(){return Uu(a,t,i,c,g)}function b(){return Uu(a,t,i,c,g)*Qq(a(),1/e)}function w(S,W){var J,x;return Zq(S)||Zq(W)||S<=0||W<=0?NaN:S<1?(x=S+1-Cu,J=1/il(9*x),Uu(a,t,W,x,J)*Qq(a(),1/S)):(x=S-Cu,J=1/il(9*x),Uu(a,t,W,x,J))}}Kq.exports=Ure});var rb=s(function(rYe,eb){"use strict";var Cre=sl(),Bre=Cre();eb.exports=Bre});var Ce=s(function(tYe,ib){"use strict";var Dre=require("@stdlib/utils/define-nonenumerable-read-only-property"),tb=rb(),Xre=sl();Dre(tb,"factory",Xre);ib.exports=tb});var ub=s(function(iYe,sb){"use strict";var nb=require("@stdlib/assert/is-positive-number").isPrimitive,ab=require("@stdlib/string/format");function Yre(r,e){return nb(r)?nb(e)?null:new TypeError(ab("invalid argument. Second argument must be a positive number. Value: `%s`.",e)):new TypeError(ab("invalid argument. First argument must be a positive number. Value: `%s`.",r))}sb.exports=Yre});var vb=s(function(nYe,ob){"use strict";function Hre(r,e,t){return r(e,1)/r(t,1)}ob.exports=Hre});var ul=s(function(aYe,hb){"use strict";var mt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Bu=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),gb=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),fb=require("@stdlib/assert/is-plain-object"),db=require("@stdlib/utils/constant-function"),Zre=require("@stdlib/utils/noop"),Du=Ce().factory,lb=require("@stdlib/math/base/assert/is-nan"),Qre=require("@stdlib/array/to-json"),cb=require("@stdlib/string/format"),$re=ub(),mb=vb();function Kre(){var r,e,t,i,n,a,u;if(arguments.length===0)r=Du();else if(arguments.length===1){if(i=arguments[0],!fb(i))throw new TypeError(cb("invalid argument. Options argument must be an object. Value: `%s`.",i));r=Du(i)}else{if(e=arguments[0],t=arguments[1],u=$re(e,t),u)throw u;if(arguments.length>2){if(i=arguments[2],!fb(i))throw new TypeError(cb("invalid argument. Options argument must be an object. Value: `%s`.",i));r=Du(i)}else r=Du()}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),gb(a,"state",db(null),Zre),mt(a,"stateLength",null),mt(a,"byteLength",null),mt(a,"toJSON",db(null))):(Bu(a,"seed",o),Bu(a,"seedLength",v),gb(a,"state",l,m),Bu(a,"stateLength",g),Bu(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=Qre(n.state),e===void 0?f.params=[]:f.params=[e,t],f}function p(){return mb(r,e,t)}function d(f,y){return lb(f)||lb(y)||f<=0||y<=0?NaN:mb(r,f,y)}}hb.exports=Kre});var yb=s(function(sYe,pb){"use strict";var ete=ul(),rte=ete();pb.exports=rte});var on=s(function(uYe,bb){"use strict";var tte=require("@stdlib/utils/define-nonenumerable-read-only-property"),qb=yb(),ite=ul();tte(qb,"factory",ite);bb.exports=qb});var ol=s(function(oYe,wb){"use strict";var nte=F(),ate=require("@stdlib/array/dtypes"),ste=require("@stdlib/array/defaults"),ute=on(),ote=ate("real_floating_point_and_generic"),vte=nte(ute,ote,ste.get("dtypes.real_floating_point"));wb.exports=vte});var Ob=s(function(vYe,Sb){"use strict";var gte=ol(),fte=gte();Sb.exports=fte});var Nb=s(function(gYe,_b){"use strict";var dte=require("@stdlib/utils/define-nonenumerable-read-only-property"),Eb=Ob(),lte=ol();dte(Eb,"factory",lte);_b.exports=Eb});var Pb=s(function(fYe,Rb){"use strict";var cte=require("@stdlib/assert/is-positive-integer").isPrimitive,mte=require("@stdlib/assert/is-probability").isPrimitive,Lb=require("@stdlib/string/format");function hte(r,e){return cte(r)?mte(e)?null:new TypeError(Lb("invalid argument. Second argument must be a probability. Value: `%s`.",e)):new TypeError(Lb("invalid argument. First argument must be a positive integer. Value: `%s`.",e))}Rb.exports=hte});var jb=s(function(dYe,Tb){"use strict";function pte(r,e,t){var i=0,n;for(n=0;n=p?A=r()-.5:(A=G/p-.93,A=Ote(A)*.5-A,G=p*r()),l=.5-gl(A),S=vl(A*(2*d/l+f)+y),!(S<0||S>e))if(G=G*i/(d/(l*l)+f),m=gl(S-W),m>15){if(G=Xu(G),o=m/u,v=(m/3+.625)*m,v+=_te,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}}}Ab.exports=Nte});var Wb=s(function(mYe,Fb){"use strict";var Lte=jb(),Rte=Gb();function Vb(r,e,t){return t>.5?e-Vb(r,e,1-t):e*t<10?Lte(r,e,t):Rte(r,e,t)}Fb.exports=Vb});var fl=s(function(hYe,Db){"use strict";var Jr=require("@stdlib/utils/define-nonenumerable-read-only-property"),Hu=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Ib=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),kb=require("@stdlib/assert/is-plain-object"),zb=require("@stdlib/assert/is-function"),Jb=require("@stdlib/assert/has-own-property"),Ub=require("@stdlib/utils/constant-function"),Pte=require("@stdlib/utils/noop"),Cb=require("@stdlib/math/base/assert/is-nan"),Tte=require("@stdlib/math/base/assert/is-positive-integer"),jte=require("@stdlib/math/base/assert/is-probability"),Zu=T().factory,Mte=require("@stdlib/array/to-json"),Qu=require("@stdlib/string/format"),xte=Pb(),Bb=Wb();function Ate(){var r,e,t,i,n,a;if(arguments.length===0)e=Zu();else if(arguments.length===1){if(r=arguments[0],!kb(r))throw new TypeError(Qu("invalid argument. Options argument must be an object. Value: `%s`.",r));if(Jb(r,"prng")){if(!zb(r.prng))throw new TypeError(Qu("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Zu(r)}else{if(n=arguments[0],a=arguments[1],i=xte(n,a),i)throw i;if(arguments.length>2){if(r=arguments[2],!kb(r))throw new TypeError(Qu("invalid argument. Options argument must be an object. Value: `%s`.",r));if(Jb(r,"prng")){if(!zb(r.prng))throw new TypeError(Qu("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Zu(r)}else e=Zu()}return n===void 0?t=p:t=h,Jr(t,"NAME","binomial"),r&&r.prng?(Jr(t,"seed",null),Jr(t,"seedLength",null),Ib(t,"state",Ub(null),Pte),Jr(t,"stateLength",null),Jr(t,"byteLength",null),Jr(t,"toJSON",Ub(null)),Jr(t,"PRNG",e)):(Hu(t,"seed",u),Hu(t,"seedLength",o),Ib(t,"state",c,l),Hu(t,"stateLength",v),Hu(t,"byteLength",g),Jr(t,"toJSON",m),Jr(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=Mte(e.state),n===void 0?d.params=[]:d.params=[n,a],d}function h(){return Bb(e,n,a)}function p(d,f){return Cb(d)||Cb(f)||!Tte(d)||!jte(f)?NaN:Bb(e,d,f)}}Db.exports=Ate});var Yb=s(function(pYe,Xb){"use strict";var Gte=fl(),Vte=Gte();Xb.exports=Vte});var da=s(function(yYe,Zb){"use strict";var Fte=require("@stdlib/utils/define-nonenumerable-read-only-property"),Hb=Yb(),Wte=fl();Fte(Hb,"factory",Wte);Zb.exports=Hb});var dl=s(function(qYe,Qb){"use strict";var Ite=F(),kte=require("@stdlib/array/dtypes"),zte=require("@stdlib/array/defaults"),Jte=da(),Ute=kte("real_and_generic"),Cte=Ite(Jte,Ute,zte.get("dtypes.real"));Qb.exports=Cte});var Kb=s(function(bYe,$b){"use strict";var Bte=dl(),Dte=Bte();$b.exports=Dte});var tw=s(function(wYe,rw){"use strict";var Xte=require("@stdlib/utils/define-nonenumerable-read-only-property"),ew=Kb(),Yte=dl();Xte(ew,"factory",Yte);rw.exports=ew});var aw=s(function(SYe,nw){"use strict";var Hte=require("@stdlib/assert/is-number").isPrimitive,Zte=require("@stdlib/assert/is-positive-number").isPrimitive,iw=require("@stdlib/string/format"),Qte=require("@stdlib/assert/is-nan");function $te(r,e){return!Hte(r)||Qte(r)?new TypeError(iw("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):Zte(e)?null:new TypeError(iw("invalid argument. Second argument must be a positive number. Value: `%s`.",e))}nw.exports=$te});var uw=s(function(OYe,sw){"use strict";var Kte=require("@stdlib/math/base/special/tan"),eie=require("@stdlib/constants/float64/pi");function rie(r,e,t){return e+t*Kte(eie*(r()-.5))}sw.exports=rie});var ll=s(function(EYe,mw){"use strict";var ht=require("@stdlib/utils/define-nonenumerable-read-only-property"),$u=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),ow=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),vw=require("@stdlib/assert/is-plain-object"),gw=require("@stdlib/assert/is-function"),fw=require("@stdlib/assert/has-own-property"),dw=require("@stdlib/utils/constant-function"),tie=require("@stdlib/utils/noop"),lw=require("@stdlib/math/base/assert/is-nan"),la=Q().factory,iie=require("@stdlib/array/to-json"),Ku=require("@stdlib/string/format"),nie=aw(),cw=uw();function aie(){var r,e,t,i,n,a,u;if(arguments.length===0)e=la();else if(arguments.length===1){if(t=arguments[0],!vw(t))throw new TypeError(Ku("invalid argument. Options argument must be an object. Value: `%s`.",t));if(fw(t,"prng")){if(!gw(t.prng))throw new TypeError(Ku("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",t.prng));e=la({prng:t.prng})}else e=la(t)}else{if(u=arguments[0],r=arguments[1],a=nie(u,r),a)throw a;if(arguments.length>2){if(t=arguments[2],!vw(t))throw new TypeError(Ku("invalid argument. Options argument must be an object. Value: `%s`.",t));if(fw(t,"prng")){if(!gw(t.prng))throw new TypeError(Ku("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",t.prng));e=la({prng:t.prng})}else e=la(t)}else e=la()}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),ow(n,"state",dw(null),tie),ht(n,"stateLength",null),ht(n,"byteLength",null),ht(n,"toJSON",dw(null))):($u(n,"seed",o),$u(n,"seedLength",v),ow(n,"state",l,m),$u(n,"stateLength",g),$u(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=iie(i.state),u===void 0?f.params=[]:f.params=[u,r],f}function p(){return cw(e,u,r)}function d(f,y){return lw(f)||lw(y)||y<=0?NaN:cw(e,f,y)}}mw.exports=aie});var pw=s(function(_Ye,hw){"use strict";var sie=ll(),uie=sie();hw.exports=uie});var ca=s(function(NYe,qw){"use strict";var oie=require("@stdlib/utils/define-nonenumerable-read-only-property"),yw=pw(),vie=ll();oie(yw,"factory",vie);qw.exports=yw});var cl=s(function(LYe,bw){"use strict";var gie=F(),fie=require("@stdlib/array/dtypes"),die=require("@stdlib/array/defaults"),lie=ca(),cie=fie("real_floating_point_and_generic"),mie=gie(lie,cie,die.get("dtypes.real_floating_point"));bw.exports=mie});var Sw=s(function(RYe,ww){"use strict";var hie=cl(),pie=hie();ww.exports=pie});var _w=s(function(PYe,Ew){"use strict";var yie=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ow=Sw(),qie=cl();yie(Ow,"factory",qie);Ew.exports=Ow});var ml=s(function(TYe,jw){"use strict";var pt=require("@stdlib/utils/define-nonenumerable-read-only-property"),eo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Nw=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),bie=require("@stdlib/assert/is-positive-number").isPrimitive,Lw=require("@stdlib/assert/is-plain-object"),Rw=require("@stdlib/assert/is-function"),Pw=require("@stdlib/assert/has-own-property"),Tw=require("@stdlib/utils/constant-function"),wie=require("@stdlib/utils/noop"),Sie=require("@stdlib/math/base/assert/is-nan"),ma=Ce().factory,Oie=require("@stdlib/array/to-json"),ro=require("@stdlib/string/format");function Eie(){var r,e,t,i,n;if(arguments.length===0)r=ma();else if(arguments.length===1&&Lw(arguments[0]))if(t=arguments[0],Pw(t,"prng")){if(!Rw(t.prng))throw new TypeError(ro("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",t.prng));r=ma({prng:t.prng})}else r=ma(t);else{if(n=arguments[0],!bie(n))throw new TypeError(ro("invalid argument. First argument must be a positive number. Value: `%s`.",n));if(arguments.length>1){if(t=arguments[1],!Lw(t))throw new TypeError(ro("invalid argument. Options argument must be an object. Value: `%s`.",t));if(Pw(t,"prng")){if(!Rw(t.prng))throw new TypeError(ro("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",t.prng));r=ma(n/2,.5,{prng:t.prng})}else r=ma(n/2,.5,t)}else r=ma(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),Nw(i,"state",Tw(null),wie),pt(i,"stateLength",null),pt(i,"byteLength",null),pt(i,"toJSON",Tw(null))):(eo(i,"seed",a),eo(i,"seedLength",u),Nw(i,"state",g,c),eo(i,"stateLength",o),eo(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=Oie(e.state),n===void 0?p.params=[]:p.params=[n],p}function m(){return r()}function h(p){return Sie(p)||p<=0?NaN:r(p/2,.5)}}jw.exports=Eie});var xw=s(function(jYe,Mw){"use strict";var _ie=ml(),Nie=_ie();Mw.exports=Nie});var Ur=s(function(MYe,Gw){"use strict";var Lie=require("@stdlib/utils/define-nonenumerable-read-only-property"),Aw=xw(),Rie=ml();Lie(Aw,"factory",Rie);Gw.exports=Aw});var hl=s(function(xYe,Jw){"use strict";var yt=require("@stdlib/utils/define-nonenumerable-read-only-property"),to=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Vw=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Pie=require("@stdlib/assert/is-positive-number").isPrimitive,Fw=require("@stdlib/assert/is-plain-object"),Ww=require("@stdlib/assert/is-function"),Iw=require("@stdlib/assert/has-own-property"),kw=require("@stdlib/utils/constant-function"),Tie=require("@stdlib/utils/noop"),jie=require("@stdlib/math/base/assert/is-nan"),ha=Ur().factory,Mie=require("@stdlib/array/to-json"),zw=require("@stdlib/math/base/special/sqrt"),io=require("@stdlib/string/format");function xie(){var r,e,t,i,n;if(arguments.length===0)r=ha();else if(arguments.length===1&&Fw(arguments[0]))if(t=arguments[0],Iw(t,"prng")){if(!Ww(t.prng))throw new TypeError(io("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",t.prng));r=ha({prng:t.prng})}else r=ha(t);else{if(n=arguments[0],!Pie(n))throw new TypeError(io("invalid argument. First argument must be a positive number. Value: `%s`.",n));if(arguments.length>1){if(t=arguments[1],!Fw(t))throw new TypeError(io("invalid argument. Options argument must be an object. Value: `%s`.",t));if(Iw(t,"prng")){if(!Ww(t.prng))throw new TypeError(io("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",t.prng));r=ha(n,{prng:t.prng})}else r=ha(n,t)}else r=ha(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),Vw(i,"state",kw(null),Tie),yt(i,"stateLength",null),yt(i,"byteLength",null),yt(i,"toJSON",kw(null))):(to(i,"seed",a),to(i,"seedLength",u),Vw(i,"state",g,c),to(i,"stateLength",o),to(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=Mie(e.state),n===void 0?p.params=[]:p.params=[n],p}function m(){return zw(r())}function h(p){return jie(p)||p<=0?NaN:zw(r(p))}}Jw.exports=xie});var Cw=s(function(AYe,Uw){"use strict";var Aie=hl(),Gie=Aie();Uw.exports=Gie});var pa=s(function(GYe,Dw){"use strict";var Vie=require("@stdlib/utils/define-nonenumerable-read-only-property"),Bw=Cw(),Fie=hl();Vie(Bw,"factory",Fie);Dw.exports=Bw});var pl=s(function(VYe,Xw){"use strict";var Wie=Vr(),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"));Xw.exports=Uie});var Hw=s(function(FYe,Yw){"use strict";var Cie=pl(),Bie=Cie();Yw.exports=Bie});var $w=s(function(WYe,Qw){"use strict";var Die=require("@stdlib/utils/define-nonenumerable-read-only-property"),Zw=Hw(),Xie=pl();Die(Zw,"factory",Xie);Qw.exports=Zw});var yl=s(function(IYe,Kw){"use strict";var Yie=Vr(),Hie=require("@stdlib/array/dtypes"),Zie=require("@stdlib/array/defaults"),Qie=Ur(),$ie=Hie("real_floating_point_and_generic"),Kie=Yie(Qie,$ie,Zie.get("dtypes.real_floating_point"));Kw.exports=Kie});var rS=s(function(kYe,eS){"use strict";var ene=yl(),rne=ene();eS.exports=rne});var nS=s(function(zYe,iS){"use strict";var tne=require("@stdlib/utils/define-nonenumerable-read-only-property"),tS=rS(),ine=yl();tne(tS,"factory",ine);iS.exports=tS});var uS=s(function(JYe,sS){"use strict";var nne=require("@stdlib/assert/is-number").isPrimitive,ane=require("@stdlib/assert/is-positive-number").isPrimitive,aS=require("@stdlib/string/format"),sne=require("@stdlib/assert/is-nan");function une(r,e){return!nne(r)||sne(r)?new TypeError(aS("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):ane(e)?null:new TypeError(aS("invalid argument. Second argument must be a positive number. Value: `%s`.",e))}sS.exports=une});var vS=s(function(UYe,oS){"use strict";var one=require("@stdlib/stats/base/dists/cosine/quantile");function vne(r,e,t){return one(r(),e,t)}oS.exports=vne});var ql=s(function(CYe,pS){"use strict";var Cr=require("@stdlib/utils/define-nonenumerable-read-only-property"),no=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),gS=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),fS=require("@stdlib/assert/is-plain-object"),dS=require("@stdlib/assert/is-function"),lS=require("@stdlib/assert/has-own-property"),cS=require("@stdlib/utils/constant-function"),gne=require("@stdlib/utils/noop"),ao=T().factory,mS=require("@stdlib/math/base/assert/is-nan"),fne=require("@stdlib/array/to-json"),so=require("@stdlib/string/format"),dne=uS(),hS=vS();function lne(){var r,e,t,i,n,a;if(arguments.length===0)e=ao();else if(arguments.length===1){if(r=arguments[0],!fS(r))throw new TypeError(so("invalid argument. Options argument must be an object. Value: `%s`.",r));if(lS(r,"prng")){if(!dS(r.prng))throw new TypeError(so("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=ao(r)}else{if(n=arguments[0],a=arguments[1],i=dne(n,a),i)throw i;if(arguments.length>2){if(r=arguments[2],!fS(r))throw new TypeError(so("invalid argument. Options argument must be an object. Value: `%s`.",r));if(lS(r,"prng")){if(!dS(r.prng))throw new TypeError(so("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=ao(r)}else e=ao()}return n===void 0?t=p:t=h,Cr(t,"NAME","cosine"),r&&r.prng?(Cr(t,"seed",null),Cr(t,"seedLength",null),gS(t,"state",cS(null),gne),Cr(t,"stateLength",null),Cr(t,"byteLength",null),Cr(t,"toJSON",cS(null)),Cr(t,"PRNG",e)):(no(t,"seed",u),no(t,"seedLength",o),gS(t,"state",c,l),no(t,"stateLength",v),no(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=fne(e.state),n===void 0?d.params=[]:d.params=[n,a],d}function h(){return hS(e,n,a)}function p(d,f){return mS(d)||mS(f)||f<=0?NaN:hS(e,d,f)}}pS.exports=lne});var qS=s(function(BYe,yS){"use strict";var cne=ql(),mne=cne();yS.exports=mne});var vn=s(function(DYe,wS){"use strict";var hne=require("@stdlib/utils/define-nonenumerable-read-only-property"),bS=qS(),pne=ql();hne(bS,"factory",pne);wS.exports=bS});var bl=s(function(XYe,SS){"use strict";var yne=F(),qne=require("@stdlib/array/dtypes"),bne=require("@stdlib/array/defaults"),wne=vn(),Sne=qne("real_floating_point_and_generic"),One=yne(wne,Sne,bne.get("dtypes.real_floating_point"));SS.exports=One});var ES=s(function(YYe,OS){"use strict";var Ene=bl(),_ne=Ene();OS.exports=_ne});var LS=s(function(HYe,NS){"use strict";var Nne=require("@stdlib/utils/define-nonenumerable-read-only-property"),_S=ES(),Lne=bl();Nne(_S,"factory",Lne);NS.exports=_S});var jS=s(function(ZYe,TS){"use strict";var RS=require("@stdlib/assert/is-integer").isPrimitive,wl=require("@stdlib/string/format"),PS=require("@stdlib/assert/is-nan");function Rne(r,e){return!RS(r)||PS(r)?new TypeError(wl("invalid argument. First argument must be an integer and not NaN. Value: `%s`.",r)):!RS(e)||PS(e)?new TypeError(wl("invalid argument. Second argument must be an integer and not NaN. Value: `%s`.",e)):r>e?new RangeError(wl("invalid argument. Minimum support must be less than or equal to maximum support. Value: `[%d, %d]`.",r,e)):null}TS.exports=Rne});var AS=s(function(QYe,xS){"use strict";var Sl=require("@stdlib/constants/float64/max-safe-integer"),ya=require("@stdlib/math/base/special/floor");function MS(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(nSl/v)&&(l*=v,i+=l,!(i>a)))return i+e}for(n===Sl?(o=ya(n/(a+1)),n%(a+1)===a&&(o+=1)):o=ya((n+1)/(a+1));;)if(i=r()-g,i=ya(i/o),i<=a)return i+e}xS.exports=MS});var Ol=s(function($Ye,JS){"use strict";var Br=require("@stdlib/utils/define-nonenumerable-read-only-property"),uo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),GS=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),VS=require("@stdlib/assert/is-plain-object"),FS=require("@stdlib/assert/is-function"),WS=require("@stdlib/assert/has-own-property"),IS=require("@stdlib/utils/constant-function"),Pne=require("@stdlib/utils/noop"),oo=T().factory,kS=require("@stdlib/math/base/assert/is-nan"),qa=require("@stdlib/math/base/assert/is-integer"),Tne=require("@stdlib/array/to-json"),qt=require("@stdlib/string/format"),jne=jS(),zS=AS();function Mne(){var r,e,t,i,n,a;if(arguments.length===0)e=oo();else if(arguments.length===1){if(r=arguments[0],!VS(r))throw new TypeError(qt("invalid argument. Options argument must be an object. Value: `%s`.",r));if(WS(r,"prng")){if(!FS(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,!qa(e.MIN))throw new TypeError(qt("invalid option. `%s` option must have a `MIN` property specifying the minimum possible pseudorandom integer value.","prng"));if(!qa(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=oo(r)}else{if(n=arguments[0],a=arguments[1],i=jne(n,a),i)throw i;if(arguments.length>2){if(r=arguments[2],!VS(r))throw new TypeError(qt("invalid argument. Options argument must be an object. Value: `%s`.",r));if(WS(r,"prng")){if(!FS(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,!qa(e.MIN))throw new TypeError(qt("invalid option. `%s` option must have a `MIN` property specifying the minimum possible pseudorandom integer value.","prng"));if(!qa(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=oo(r)}else e=oo()}return n===void 0?t=p:t=h,Br(t,"NAME","discrete-uniform"),r&&r.prng?(Br(t,"seed",null),Br(t,"seedLength",null),GS(t,"state",IS(null),Pne),Br(t,"stateLength",null),Br(t,"byteLength",null),Br(t,"toJSON",IS(null)),Br(t,"PRNG",e)):(uo(t,"seed",u),uo(t,"seedLength",o),GS(t,"state",c,l),uo(t,"stateLength",v),uo(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=Tne(e.state),n===void 0?d.params=[]:d.params=[n,a],d}function h(){return zS(e,n,a)}function p(d,f){return kS(d)||kS(f)||!qa(d)||!qa(f)||d>f?NaN:zS(e,d,f)}}JS.exports=Mne});var CS=s(function(KYe,US){"use strict";var xne=Ol(),Ane=xne();US.exports=Ane});var gn=s(function(e6e,DS){"use strict";var Gne=require("@stdlib/utils/define-nonenumerable-read-only-property"),BS=CS(),Vne=Ol();Gne(BS,"factory",Vne);DS.exports=BS});var El=s(function(r6e,XS){"use strict";var Fne=F(),Wne=require("@stdlib/array/dtypes"),Ine=require("@stdlib/array/defaults"),kne=gn(),zne=Wne("real_and_generic"),Jne=Fne(kne,zne,Ine.get("dtypes.real"));XS.exports=Jne});var HS=s(function(t6e,YS){"use strict";var Une=El(),Cne=Une();YS.exports=Cne});var $S=s(function(i6e,QS){"use strict";var Bne=require("@stdlib/utils/define-nonenumerable-read-only-property"),ZS=HS(),Dne=El();Bne(ZS,"factory",Dne);QS.exports=ZS});var rO=s(function(n6e,eO){"use strict";var Xne=require("@stdlib/assert/is-positive-number").isPrimitive,Yne=require("@stdlib/assert/is-positive-integer").isPrimitive,KS=require("@stdlib/string/format");function Hne(r,e){return Yne(r)?Xne(e)?null:new TypeError(KS("invalid argument. Second argument must be a positive number. Value: `%s`.",e)):new TypeError(KS("invalid argument. First argument must be a positive integer. Value: `%s`.",r))}eO.exports=Hne});var iO=s(function(a6e,tO){"use strict";var Zne=require("@stdlib/math/base/special/ln");function Qne(r,e,t){var i,n;for(i=1,n=0;n2){if(t=arguments[2],!aO(t))throw new TypeError(fo("invalid argument. Options argument must be an object. Value: `%s`.",t));if(uO(t,"prng")){if(!sO(t.prng))throw new TypeError(fo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",t.prng));e=t.prng}else e=go(t)}else e=go()}return a===void 0?i=p:i=h,Dr(i,"NAME","erlang"),t&&t.prng?(Dr(i,"seed",null),Dr(i,"seedLength",null),nO(i,"state",oO(null),$ne),Dr(i,"stateLength",null),Dr(i,"byteLength",null),Dr(i,"toJSON",oO(null)),Dr(i,"PRNG",e)):(vo(i,"seed",u),vo(i,"seedLength",o),nO(i,"state",c,l),vo(i,"stateLength",v),vo(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=eae(e.state),a===void 0?d.params=[]:d.params=[a,r],d}function h(){return gO(e,a,r)}function p(d,f){return vO(d)||vO(f)||!Kne(d)||f<=0?NaN:gO(e,d,f)}}fO.exports=tae});var lO=s(function(u6e,dO){"use strict";var iae=_l(),nae=iae();dO.exports=nae});var ba=s(function(o6e,mO){"use strict";var aae=require("@stdlib/utils/define-nonenumerable-read-only-property"),cO=lO(),sae=_l();aae(cO,"factory",sae);mO.exports=cO});var Nl=s(function(v6e,hO){"use strict";var uae=F(),oae=require("@stdlib/array/dtypes"),vae=require("@stdlib/array/defaults"),gae=ba(),fae=oae("real_floating_point_and_generic"),dae=uae(gae,fae,vae.get("dtypes.real_floating_point"));hO.exports=dae});var yO=s(function(g6e,pO){"use strict";var lae=Nl(),cae=lae();pO.exports=cae});var wO=s(function(f6e,bO){"use strict";var mae=require("@stdlib/utils/define-nonenumerable-read-only-property"),qO=yO(),hae=Nl();mae(qO,"factory",hae);bO.exports=qO});var OO=s(function(d6e,SO){"use strict";var pae=require("@stdlib/math/base/special/ln");function yae(r,e){return-pae(1-r())/e}SO.exports=yae});var Ll=s(function(l6e,TO){"use strict";var Xr=require("@stdlib/utils/define-nonenumerable-read-only-property"),lo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),EO=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),qae=require("@stdlib/assert/is-positive-number").isPrimitive,_O=require("@stdlib/assert/is-plain-object"),NO=require("@stdlib/assert/is-function"),LO=require("@stdlib/assert/has-own-property"),RO=require("@stdlib/utils/constant-function"),bae=require("@stdlib/utils/noop"),co=T().factory,wae=require("@stdlib/math/base/assert/is-nan"),Sae=require("@stdlib/array/to-json"),mo=require("@stdlib/string/format"),PO=OO();function Oae(){var r,e,t,i;if(arguments.length===0)t=co();else if(arguments.length===1&&_O(arguments[0]))if(e=arguments[0],LO(e,"prng")){if(!NO(e.prng))throw new TypeError(mo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));t=e.prng}else t=co(e);else{if(r=arguments[0],!qae(r))throw new TypeError(mo("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(arguments.length>1){if(e=arguments[1],!_O(e))throw new TypeError(mo("invalid argument. Options argument must be an object. Value: `%s`.",e));if(LO(e,"prng")){if(!NO(e.prng))throw new TypeError(mo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));t=e.prng}else t=co(e)}else t=co()}return r===void 0?i=m:i=l,Xr(i,"NAME","exponential"),e&&e.prng?(Xr(i,"seed",null),Xr(i,"seedLength",null),EO(i,"state",RO(null),bae),Xr(i,"stateLength",null),Xr(i,"byteLength",null),Xr(i,"toJSON",RO(null)),Xr(i,"PRNG",t)):(lo(i,"seed",n),lo(i,"seedLength",a),EO(i,"state",v,g),lo(i,"stateLength",u),lo(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=Sae(t.state),r===void 0?h.params=[]:h.params=[r],h}function l(){return PO(t,r)}function m(h){return wae(h)||h<=0?NaN:PO(t,h)}}TO.exports=Oae});var MO=s(function(c6e,jO){"use strict";var Eae=Ll(),_ae=Eae();jO.exports=_ae});var fn=s(function(m6e,AO){"use strict";var Nae=require("@stdlib/utils/define-nonenumerable-read-only-property"),xO=MO(),Lae=Ll();Nae(xO,"factory",Lae);AO.exports=xO});var Rl=s(function(h6e,GO){"use strict";var Rae=Vr(),Pae=require("@stdlib/array/dtypes"),Tae=require("@stdlib/array/defaults"),jae=fn(),Mae=Pae("real_floating_point_and_generic"),xae=Rae(jae,Mae,Tae.get("dtypes.real_floating_point"));GO.exports=xae});var FO=s(function(p6e,VO){"use strict";var Aae=Rl(),Gae=Aae();VO.exports=Gae});var kO=s(function(y6e,IO){"use strict";var Vae=require("@stdlib/utils/define-nonenumerable-read-only-property"),WO=FO(),Fae=Rl();Vae(WO,"factory",Fae);IO.exports=WO});var CO=s(function(q6e,UO){"use strict";var zO=require("@stdlib/assert/is-positive-number").isPrimitive,JO=require("@stdlib/string/format");function Wae(r,e){return zO(r)?zO(e)?null:new TypeError(JO("invalid argument. Second argument must be a positive number. Value: `%s`.",e)):new TypeError(JO("invalid argument. First argument must be a positive number. Value: `%s`.",r))}UO.exports=Wae});var DO=s(function(b6e,BO){"use strict";function Iae(r,e,t){var i=r(e)/e,n=r(t)/t;return i/n}BO.exports=Iae});var Pl=s(function(w6e,eE){"use strict";var bt=require("@stdlib/utils/define-nonenumerable-read-only-property"),ho=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),XO=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),YO=require("@stdlib/assert/is-plain-object"),HO=require("@stdlib/assert/is-function"),ZO=require("@stdlib/assert/has-own-property"),QO=require("@stdlib/utils/constant-function"),kae=require("@stdlib/utils/noop"),wa=Ur().factory,$O=require("@stdlib/math/base/assert/is-nan"),zae=require("@stdlib/array/to-json"),po=require("@stdlib/string/format"),Jae=CO(),KO=DO();function Uae(){var r,e,t,i,n,a,u;if(arguments.length===0)r=wa();else if(arguments.length===1){if(e=arguments[0],!YO(e))throw new TypeError(po("invalid argument. Options argument must be an object. Value: `%s`.",e));if(ZO(e,"prng")){if(!HO(e.prng))throw new TypeError(po("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));r=wa({prng:e.prng})}else r=wa(e)}else{if(a=arguments[0],u=arguments[1],n=Jae(a,u),n)throw n;if(arguments.length>2){if(e=arguments[2],!YO(e))throw new TypeError(po("invalid argument. Options argument must be an object. Value: `%s`.",e));if(ZO(e,"prng")){if(!HO(e.prng))throw new TypeError(po("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));r=wa({prng:e.prng})}else r=wa(e)}else r=wa()}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),XO(i,"state",QO(null),kae),bt(i,"stateLength",null),bt(i,"byteLength",null),bt(i,"toJSON",QO(null))):(ho(i,"seed",o),ho(i,"seedLength",v),XO(i,"state",l,m),ho(i,"stateLength",g),ho(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=zae(t.state),a===void 0?f.params=[]:f.params=[a,u],f}function p(){return KO(r,a,u)}function d(f,y){return $O(f)||$O(y)||f<=0||y<=0?NaN:KO(r,f,y)}}eE.exports=Uae});var tE=s(function(S6e,rE){"use strict";var Cae=Pl(),Bae=Cae();rE.exports=Bae});var Sa=s(function(O6e,nE){"use strict";var Dae=require("@stdlib/utils/define-nonenumerable-read-only-property"),iE=tE(),Xae=Pl();Dae(iE,"factory",Xae);nE.exports=iE});var Tl=s(function(E6e,aE){"use strict";var Yae=F(),Hae=require("@stdlib/array/dtypes"),Zae=require("@stdlib/array/defaults"),Qae=Sa(),$ae=Hae("real_floating_point_and_generic"),Kae=Yae(Qae,$ae,Zae.get("dtypes.real_floating_point"));aE.exports=Kae});var uE=s(function(_6e,sE){"use strict";var ese=Tl(),rse=ese();sE.exports=rse});var gE=s(function(N6e,vE){"use strict";var tse=require("@stdlib/utils/define-nonenumerable-read-only-property"),oE=uE(),ise=Tl();tse(oE,"factory",ise);vE.exports=oE});var lE=s(function(L6e,dE){"use strict";var nse=require("@stdlib/assert/is-plain-object"),ase=require("@stdlib/assert/has-own-property"),sse=require("@stdlib/array/base/assert/contains"),fE=require("@stdlib/string/format");function use(r,e,t){return nse(t)?ase(t,"dtype")&&(r.dtype=t.dtype,!sse(e,r.dtype))?new TypeError(fE('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",e.join('", "'),r.dtype)):null:new TypeError(fE("invalid argument. Options argument must be an object. Value: `%s`.",t))}dE.exports=use});var pE=s(function(R6e,hE){"use strict";var cE=require("@stdlib/utils/define-nonenumerable-read-only-property"),ose=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,vse=require("@stdlib/assert/is-function"),gse=require("@stdlib/assert/is-string-array").primitives,fse=require("@stdlib/assert/is-collection"),dse=require("@stdlib/array/base/assert/contains"),lse=require("@stdlib/array/base/filled-by"),mE=require("@stdlib/strided/base/ternary"),cse=require("@stdlib/array/ctors"),Ys=require("@stdlib/string/format"),mse=lE();function Hs(r,e,t){if(!(this instanceof Hs))return new Hs(r,e,t);if(!vse(r))throw new TypeError(Ys("invalid argument. First argument must be a function. Value: `%s`.",r));if(!gse(e))throw new TypeError(Ys("invalid argument. Second argument must be an array of strings. Value: `%s`.",e));if(!dse(e,t))throw new TypeError(Ys("invalid argument. Third argument must be a supported data type. Value: `%s`.",t));return this._prng=r,this._dtypes=e,this._dtype=t,this}cE(Hs.prototype,"generate",function(e,t,i,n,a){var u,o,v,g,c,l;if(!ose(e))throw new TypeError(Ys("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",e));if(o={},arguments.length>4&&(c=mse(o,this._dtypes,a),c))throw c;if(v=this._prng,l=o.dtype||this._dtype,l==="generic")return lse(e,m);return u=cse(l),g=new u(e),mE([[t],[i],[n],g],[e],[0,0,0,1],v),g;function m(){return v(t,i,n)}});cE(Hs.prototype,"assign",function(e,t,i,n){if(!fse(n))throw new TypeError(Ys("invalid argument. Third argument must be an array-like object. Value: `%s`.",n));return mE([[e],[t],[i],n],[n.length],[0,0,0,1],this._prng),n});hE.exports=Hs});var qE=s(function(P6e,yE){"use strict";var hse=pE();yE.exports=hse});var OE=s(function(T6e,SE){"use strict";var bE=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),yo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Oa=require("@stdlib/utils/define-nonenumerable-read-only-property"),pse=require("@stdlib/assert/is-string-array").primitives,yse=require("@stdlib/assert/is-function"),qse=require("@stdlib/assert/is-method-in"),bse=require("@stdlib/assert/has-own-property"),wE=require("@stdlib/array/base/assert/contains").factory,wse=require("@stdlib/utils/constant-function"),Sse=require("@stdlib/utils/noop"),Ose=qE(),Ese=_u(),Zs=require("@stdlib/string/format");function _se(r,e,t){var i;if(!yse(r))throw new TypeError(Zs("invalid argument. First argument must be a function. Value: `%s`.",r));if(!qse(r,"factory"))throw new TypeError(Zs("invalid argument. First argument must have a `%s` method.","factory"));if(!pse(e))throw new TypeError(Zs("invalid argument. Second argument must an array of strings. Value: `%s`.",e));if(!wE(e,t))throw new TypeError(Zs("invalid argument. Third argument must be a supported data type. Value: `%s`.",t));return i=wE(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),bse(h,"dtype")){if(d=h.dtype,!i(d))throw new TypeError(Zs('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=Ose):(c=b,a=Ese),u=new a(m,e,d),h&&h.prng?(Oa(p,"seed",null),Oa(p,"seedLength",null),bE(p,"state",wse(null),Sse),Oa(p,"stateLength",null),Oa(p,"byteLength",null)):(yo(p,"seed",w),yo(p,"seedLength",S),bE(p,"state",x,V),yo(p,"stateLength",W),yo(p,"byteLength",J)),Oa(p,"PRNG",m.PRNG),Oa(p,"assign",c),p;function f(A,G,Ue,Eu,c$){return arguments.length<5?u.generate(A,G,Ue,Eu):u.generate(A,G,Ue,Eu,c$)}function y(A,G){return arguments.length<2?u.generate(A):u.generate(A,G)}function q(A,G,Ue,Eu){return u.assign(A,G,Ue,Eu)}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}}}SE.exports=_se});var qo=s(function(j6e,EE){"use strict";var Nse=OE();EE.exports=Nse});var LE=s(function(M6e,NE){"use strict";var _E=require("@stdlib/assert/is-positive-number").isPrimitive,Lse=require("@stdlib/assert/is-number").isPrimitive,jl=require("@stdlib/assert/is-nan"),Ml=require("@stdlib/string/format");function Rse(r,e,t){return!_E(r)||jl(r)?new TypeError(Ml("invalid argument. First argument must be a positive number and not NaN. Value: `%s`.",r)):!_E(e)||jl(e)?new TypeError(Ml("invalid argument. Second argument must be a positive number and not NaN. Value: `%s`.",e)):!Lse(t)||jl(t)?new TypeError(Ml("invalid argument. Third argument must be a number and not NaN. Value: `%s`.",t)):null}NE.exports=Rse});var PE=s(function(x6e,RE){"use strict";var Pse=require("@stdlib/math/base/special/pow"),Tse=require("@stdlib/math/base/special/ln");function jse(r,e,t,i){return i+t*Pse(-Tse(r()),-1/e)}RE.exports=jse});var Al=s(function(A6e,VE){"use strict";var Yr=require("@stdlib/utils/define-nonenumerable-read-only-property"),bo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),TE=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),jE=require("@stdlib/assert/is-plain-object"),ME=require("@stdlib/assert/is-function"),xE=require("@stdlib/assert/has-own-property"),AE=require("@stdlib/utils/constant-function"),Mse=require("@stdlib/utils/noop"),wo=T().factory,xl=require("@stdlib/math/base/assert/is-nan"),xse=require("@stdlib/array/to-json"),So=require("@stdlib/string/format"),Ase=LE(),GE=PE();function Gse(){var r,e,t,i,n,a,u;if(arguments.length===0)t=wo();else if(arguments.length===1){if(e=arguments[0],!jE(e))throw new TypeError(So("invalid argument. Options argument must be an object. Value: `%s`.",e));if(xE(e,"prng")){if(!ME(e.prng))throw new TypeError(So("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));t=e.prng}else t=wo(e)}else{if(r=arguments[0],a=arguments[1],u=arguments[2],n=Ase(r,a,u),n)throw n;if(arguments.length>3){if(e=arguments[3],!jE(e))throw new TypeError(So("invalid argument. Options argument must be an object. Value: `%s`.",e));if(xE(e,"prng")){if(!ME(e.prng))throw new TypeError(So("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));t=e.prng}else t=wo(e)}else t=wo()}return r===void 0?i=d:i=p,Yr(i,"NAME","frechet"),e&&e.prng?(Yr(i,"seed",null),Yr(i,"seedLength",null),TE(i,"state",AE(null),Mse),Yr(i,"stateLength",null),Yr(i,"byteLength",null),Yr(i,"toJSON",AE(null)),Yr(i,"PRNG",t)):(bo(i,"seed",o),bo(i,"seedLength",v),TE(i,"state",l,m),bo(i,"stateLength",g),bo(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=xse(t.state),r===void 0?f.params=[]:f.params=[r,a,u],f}function p(){return GE(t,r,a,u)}function d(f,y,q){return xl(f)||xl(y)||xl(q)||f<=0||y<=0?NaN:GE(t,f,y,q)}}VE.exports=Gse});var WE=s(function(G6e,FE){"use strict";var Vse=Al(),Fse=Vse();FE.exports=Fse});var Ea=s(function(V6e,kE){"use strict";var Wse=require("@stdlib/utils/define-nonenumerable-read-only-property"),IE=WE(),Ise=Al();Wse(IE,"factory",Ise);kE.exports=IE});var Gl=s(function(F6e,zE){"use strict";var kse=qo(),zse=require("@stdlib/array/dtypes"),Jse=require("@stdlib/array/defaults"),Use=Ea(),Cse=zse("real_floating_point_and_generic"),Bse=kse(Use,Cse,Jse.get("dtypes.real_floating_point"));zE.exports=Bse});var UE=s(function(W6e,JE){"use strict";var Dse=Gl(),Xse=Dse();JE.exports=Xse});var DE=s(function(I6e,BE){"use strict";var Yse=require("@stdlib/utils/define-nonenumerable-read-only-property"),CE=UE(),Hse=Gl();Yse(CE,"factory",Hse);BE.exports=CE});var Vl=s(function(k6e,XE){"use strict";var Zse=F(),Qse=require("@stdlib/array/dtypes"),$se=require("@stdlib/array/defaults"),Kse=Ce(),eue=Qse("real_floating_point_and_generic"),rue=Zse(Kse,eue,$se.get("dtypes.real_floating_point"));XE.exports=rue});var HE=s(function(z6e,YE){"use strict";var tue=Vl(),iue=tue();YE.exports=iue});var $E=s(function(J6e,QE){"use strict";var nue=require("@stdlib/utils/define-nonenumerable-read-only-property"),ZE=HE(),aue=Vl();nue(ZE,"factory",aue);QE.exports=ZE});var r_=s(function(U6e,e_){"use strict";var sue=require("@stdlib/math/base/special/floor"),KE=require("@stdlib/math/base/special/ln");function uue(r,e){var t=r();return t===0&&(t=r()),sue(KE(t)/KE(1-e))}e_.exports=uue});var Fl=s(function(C6e,o_){"use strict";var Hr=require("@stdlib/utils/define-nonenumerable-read-only-property"),Oo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),t_=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),i_=require("@stdlib/assert/is-plain-object"),oue=require("@stdlib/assert/is-probability").isPrimitive,n_=require("@stdlib/assert/is-function"),a_=require("@stdlib/assert/has-own-property"),s_=require("@stdlib/utils/constant-function"),vue=require("@stdlib/utils/noop"),Eo=T().factory,gue=require("@stdlib/math/base/assert/is-nan"),fue=require("@stdlib/array/to-json"),_o=require("@stdlib/string/format"),u_=r_();function due(){var r,e,t,i;if(arguments.length===0)e=Eo();else if(arguments.length===1&&i_(arguments[0]))if(r=arguments[0],a_(r,"prng")){if(!n_(r.prng))throw new TypeError(_o("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Eo(r);else{if(i=arguments[0],!oue(i))throw new TypeError(_o("invalid argument. First argument must be a probability. Value: `%s`.",i));if(arguments.length>1){if(r=arguments[1],!i_(r))throw new TypeError(_o("invalid argument. Options argument must be an object. Value: `%s`.",r));if(a_(r,"prng")){if(!n_(r.prng))throw new TypeError(_o("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Eo(r)}else e=Eo()}return i===void 0?t=m:t=l,Hr(t,"NAME","geometric"),r&&r.prng?(Hr(t,"seed",null),Hr(t,"seedLength",null),t_(t,"state",s_(null),vue),Hr(t,"stateLength",null),Hr(t,"byteLength",null),Hr(t,"toJSON",s_(null)),Hr(t,"PRNG",e)):(Oo(t,"seed",n),Oo(t,"seedLength",a),t_(t,"state",v,g),Oo(t,"stateLength",u),Oo(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=fue(e.state),i===void 0?h.params=[]:h.params=[i],h}function l(){return u_(e,i)}function m(h){return gue(h)||h<0||h>1?NaN:u_(e,h)}}o_.exports=due});var g_=s(function(B6e,v_){"use strict";var lue=Fl(),cue=lue();v_.exports=cue});var _a=s(function(D6e,d_){"use strict";var mue=require("@stdlib/utils/define-nonenumerable-read-only-property"),f_=g_(),hue=Fl();mue(f_,"factory",hue);d_.exports=f_});var Wl=s(function(X6e,l_){"use strict";var pue=Vr(),yue=require("@stdlib/array/dtypes"),que=require("@stdlib/array/defaults"),bue=_a(),wue=yue("real_and_generic"),Sue=pue(bue,wue,que.get("dtypes.real"));l_.exports=Sue});var m_=s(function(Y6e,c_){"use strict";var Oue=Wl(),Eue=Oue();c_.exports=Eue});var y_=s(function(H6e,p_){"use strict";var _ue=require("@stdlib/utils/define-nonenumerable-read-only-property"),h_=m_(),Nue=Wl();_ue(h_,"factory",Nue);p_.exports=h_});var w_=s(function(Z6e,b_){"use strict";var Lue=require("@stdlib/assert/is-number").isPrimitive,Rue=require("@stdlib/assert/is-positive-number").isPrimitive,q_=require("@stdlib/string/format"),Pue=require("@stdlib/assert/is-nan");function Tue(r,e){return!Lue(r)||Pue(r)?new TypeError(q_("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):Rue(e)?null:new TypeError(q_("invalid argument. Second argument must be a positive number. Value: `%s`.",e))}b_.exports=Tue});var E_=s(function(Q6e,O_){"use strict";var S_=require("@stdlib/math/base/special/ln");function jue(r,e,t){return e-t*S_(-S_(r()))}O_.exports=jue});var Il=s(function($6e,M_){"use strict";var Zr=require("@stdlib/utils/define-nonenumerable-read-only-property"),No=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),__=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),N_=require("@stdlib/assert/is-plain-object"),L_=require("@stdlib/assert/is-function"),R_=require("@stdlib/assert/has-own-property"),P_=require("@stdlib/utils/constant-function"),Mue=require("@stdlib/utils/noop"),Lo=T().factory,T_=require("@stdlib/math/base/assert/is-nan"),xue=require("@stdlib/array/to-json"),Ro=require("@stdlib/string/format"),Aue=w_(),j_=E_();function Gue(){var r,e,t,i,n,a;if(arguments.length===0)t=Lo();else if(arguments.length===1){if(e=arguments[0],!N_(e))throw new TypeError(Ro("invalid argument. Options argument must be an object. Value: `%s`.",e));if(R_(e,"prng")){if(!L_(e.prng))throw new TypeError(Ro("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));t=e.prng}else t=Lo(e)}else{if(a=arguments[0],r=arguments[1],n=Aue(a,r),n)throw n;if(arguments.length>2){if(e=arguments[2],!N_(e))throw new TypeError(Ro("invalid argument. Options argument must be an object. Value: `%s`.",e));if(R_(e,"prng")){if(!L_(e.prng))throw new TypeError(Ro("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));t=e.prng}else t=Lo(e)}else t=Lo()}return a===void 0?i=p:i=h,Zr(i,"NAME","gumbel"),e&&e.prng?(Zr(i,"seed",null),Zr(i,"seedLength",null),__(i,"state",P_(null),Mue),Zr(i,"stateLength",null),Zr(i,"byteLength",null),Zr(i,"toJSON",P_(null)),Zr(i,"PRNG",t)):(No(i,"seed",u),No(i,"seedLength",o),__(i,"state",c,l),No(i,"stateLength",v),No(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=xue(t.state),a===void 0?d.params=[]:d.params=[a,r],d}function h(){return j_(t,a,r)}function p(d,f){return T_(d)||T_(f)||f<=0?NaN:j_(t,d,f)}}M_.exports=Gue});var A_=s(function(K6e,x_){"use strict";var Vue=Il(),Fue=Vue();x_.exports=Fue});var Na=s(function(e4e,V_){"use strict";var Wue=require("@stdlib/utils/define-nonenumerable-read-only-property"),G_=A_(),Iue=Il();Wue(G_,"factory",Iue);V_.exports=G_});var kl=s(function(r4e,F_){"use strict";var kue=F(),zue=require("@stdlib/array/dtypes"),Jue=require("@stdlib/array/defaults"),Uue=Na(),Cue=zue("real_floating_point_and_generic"),Bue=kue(Uue,Cue,Jue.get("dtypes.real_floating_point"));F_.exports=Bue});var I_=s(function(t4e,W_){"use strict";var Due=kl(),Xue=Due();W_.exports=Xue});var J_=s(function(i4e,z_){"use strict";var Yue=require("@stdlib/utils/define-nonenumerable-read-only-property"),k_=I_(),Hue=kl();Yue(k_,"factory",Hue);z_.exports=k_});var C_=s(function(n4e,U_){"use strict";var zl=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Qs=require("@stdlib/string/format");function Zue(r,e,t){return zl(r)?zl(e)?zl(t)?t>r?new RangeError(Qs("invalid argument. Third argument must be less than or equal to the first argument. Value: `%u`.",t)):e>r?new RangeError(Qs("invalid argument. Second argument must be less than or equal to the first argument. Value: `%u`.",e)):null:new TypeError(Qs("invalid argument. Third argument must be a nonnegative integer. Value: `%s`.",t)):new TypeError(Qs("invalid argument. Second argument must be a nonnegative integer. Value: `%s`.",e)):new TypeError(Qs("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",r))}U_.exports=Zue});var D_=s(function(a4e,B_){"use strict";var wt=require("@stdlib/math/base/special/factorial");function Que(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}B_.exports=Que});var Y_=s(function(s4e,X_){"use strict";var Po=D_();function $ue(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=Po(r,n,a,u),t-o):(a=t,n=e-t,o=Po(r,n,a,u),i-e+t+o)):(u=i,2*t<=e?(n=t,a=e-t,o=Po(r,n,a,u),o):(n=e-t,a=t,o=Po(r,n,a,u),i-o))}X_.exports=$ue});var Ul=s(function(u4e,tN){"use strict";var Qr=require("@stdlib/utils/define-nonenumerable-read-only-property"),To=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),H_=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Z_=require("@stdlib/assert/is-plain-object"),Q_=require("@stdlib/assert/is-function"),$_=require("@stdlib/assert/has-own-property"),K_=require("@stdlib/utils/constant-function"),Kue=require("@stdlib/utils/noop"),jo=T().factory,Jl=require("@stdlib/math/base/assert/is-nonnegative-integer"),eN=require("@stdlib/constants/float64/pinf"),eoe=require("@stdlib/array/to-json"),Mo=require("@stdlib/string/format"),roe=C_(),rN=Y_();function toe(){var r,e,t,i,n,a,u;if(arguments.length===0)e=jo();else if(arguments.length===1){if(r=arguments[0],!Z_(r))throw new TypeError(Mo("invalid argument. Options argument must be an object. Value: `%s`.",r));if($_(r,"prng")){if(!Q_(r.prng))throw new TypeError(Mo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=jo(r)}else{if(n=arguments[0],a=arguments[1],u=arguments[2],i=roe(n,a,u),i)throw i;if(arguments.length>3){if(r=arguments[3],!Z_(r))throw new TypeError(Mo("invalid argument. Options argument must be an object. Value: `%s`.",r));if($_(r,"prng")){if(!Q_(r.prng))throw new TypeError(Mo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=jo(r)}else e=jo()}return n===void 0?t=d:t=p,Qr(t,"NAME","hypergeometric"),r&&r.prng?(Qr(t,"seed",null),Qr(t,"seedLength",null),H_(t,"state",K_(null),Kue),Qr(t,"stateLength",null),Qr(t,"byteLength",null),Qr(t,"toJSON",K_(null)),Qr(t,"PRNG",e)):(To(t,"seed",o),To(t,"seedLength",v),H_(t,"state",l,m),To(t,"stateLength",g),To(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=eoe(e.state),n===void 0?f.params=[]:f.params=[n,a,u],f}function p(){return rN(e,n,a,u)}function d(f,y,q){return f===eN||y===eN||!Jl(f)||!Jl(y)||!Jl(q)||q>f?NaN:rN(e,f,y,q)}}tN.exports=toe});var nN=s(function(o4e,iN){"use strict";var ioe=Ul(),noe=ioe();iN.exports=noe});var La=s(function(v4e,sN){"use strict";var aoe=require("@stdlib/utils/define-nonenumerable-read-only-property"),aN=nN(),soe=Ul();aoe(aN,"factory",soe);sN.exports=aN});var Cl=s(function(g4e,uN){"use strict";var uoe=qo(),ooe=require("@stdlib/array/dtypes"),voe=require("@stdlib/array/defaults"),goe=La(),foe=ooe("real_and_generic"),doe=uoe(goe,foe,voe.get("dtypes.real"));uN.exports=doe});var vN=s(function(f4e,oN){"use strict";var loe=Cl(),coe=loe();oN.exports=coe});var dN=s(function(d4e,fN){"use strict";var moe=require("@stdlib/utils/define-nonenumerable-read-only-property"),gN=vN(),hoe=Cl();moe(gN,"factory",hoe);fN.exports=gN});var hN=s(function(l4e,mN){"use strict";var lN=require("@stdlib/assert/is-positive-number").isPrimitive,cN=require("@stdlib/string/format");function poe(r,e){return lN(r)?lN(e)?null:new TypeError(cN("invalid argument. Second argument must be a positive number. Value: `%s`.",e)):new TypeError(cN("invalid argument. First argument must be a positive number. Value: `%s`.",r))}mN.exports=poe});var Bl=s(function(c4e,ON){"use strict";var St=require("@stdlib/utils/define-nonenumerable-read-only-property"),xo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),pN=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),yN=require("@stdlib/assert/is-plain-object"),qN=require("@stdlib/assert/is-function"),bN=require("@stdlib/assert/has-own-property"),wN=require("@stdlib/utils/constant-function"),yoe=require("@stdlib/utils/noop"),Ra=Ce().factory,SN=require("@stdlib/math/base/assert/is-nan"),qoe=require("@stdlib/array/to-json"),Ao=require("@stdlib/string/format"),boe=hN();function woe(){var r,e,t,i,n,a,u;if(arguments.length===0)r=Ra();else if(arguments.length===1){if(i=arguments[0],!yN(i))throw new TypeError(Ao("invalid argument. Options argument must be an object. Value: `%s`.",i));if(bN(i,"prng")){if(!qN(i.prng))throw new TypeError(Ao("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=boe(e,t),u)throw u;if(arguments.length>2){if(i=arguments[2],!yN(i))throw new TypeError(Ao("invalid argument. Options argument must be an object. Value: `%s`.",i));if(bN(i,"prng")){if(!qN(i.prng))throw new TypeError(Ao("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),pN(a,"state",wN(null),yoe),St(a,"stateLength",null),St(a,"byteLength",null),St(a,"toJSON",wN(null))):(xo(a,"seed",o),xo(a,"seedLength",v),pN(a,"state",l,m),xo(a,"stateLength",g),xo(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=qoe(n.state),e===void 0?f.params=[]:f.params=[e,t],f}function p(){return 1/r()}function d(f,y){return SN(f)||SN(y)||f<=0||y<=0?NaN:1/r(f,y)}}ON.exports=woe});var _N=s(function(m4e,EN){"use strict";var Soe=Bl(),Ooe=Soe();EN.exports=Ooe});var dn=s(function(h4e,LN){"use strict";var Eoe=require("@stdlib/utils/define-nonenumerable-read-only-property"),NN=_N(),_oe=Bl();Eoe(NN,"factory",_oe);LN.exports=NN});var Dl=s(function(p4e,RN){"use strict";var Noe=F(),Loe=require("@stdlib/array/dtypes"),Roe=require("@stdlib/array/defaults"),Poe=dn(),Toe=Loe("real_floating_point_and_generic"),joe=Noe(Poe,Toe,Roe.get("dtypes.real_floating_point"));RN.exports=joe});var TN=s(function(y4e,PN){"use strict";var Moe=Dl(),xoe=Moe();PN.exports=xoe});var xN=s(function(q4e,MN){"use strict";var Aoe=require("@stdlib/utils/define-nonenumerable-read-only-property"),jN=TN(),Goe=Dl();Aoe(jN,"factory",Goe);MN.exports=jN});var FN=s(function(b4e,VN){"use strict";var AN=require("@stdlib/assert/is-positive-number").isPrimitive,GN=require("@stdlib/string/format");function Voe(r,e){return AN(r)?AN(e)?null:new TypeError(GN("invalid argument. Second argument must be a positive number. Value: `%s`.",e)):new TypeError(GN("invalid argument. First argument must be a positive number. Value: `%s`.",r))}VN.exports=Voe});var kN=s(function(w4e,IN){"use strict";var WN=require("@stdlib/math/base/special/pow");function Foe(r,e,t){var i=r();return WN(1-WN(1-i,1/t),1/e)}IN.exports=Foe});var Xl=s(function(S4e,YN){"use strict";var $r=require("@stdlib/utils/define-nonenumerable-read-only-property"),Go=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),zN=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),JN=require("@stdlib/assert/is-plain-object"),UN=require("@stdlib/assert/is-function"),CN=require("@stdlib/assert/has-own-property"),BN=require("@stdlib/utils/constant-function"),Woe=require("@stdlib/utils/noop"),Vo=T().factory,DN=require("@stdlib/math/base/assert/is-nan"),Ioe=require("@stdlib/array/to-json"),Fo=require("@stdlib/string/format"),koe=FN(),XN=kN();function zoe(){var r,e,t,i,n,a;if(arguments.length===0)e=Vo();else if(arguments.length===1){if(r=arguments[0],!JN(r))throw new TypeError(Fo("invalid argument. Options argument must be an object. Value: `%s`.",r));if(CN(r,"prng")){if(!UN(r.prng))throw new TypeError(Fo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Vo(r)}else{if(n=arguments[0],a=arguments[1],i=koe(n,a),i)throw i;if(arguments.length>2){if(r=arguments[2],!JN(r))throw new TypeError(Fo("invalid argument. Options argument must be an object. Value: `%s`.",r));if(CN(r,"prng")){if(!UN(r.prng))throw new TypeError(Fo("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Vo(r)}else e=Vo()}return n===void 0?t=p:t=h,$r(t,"NAME","kumaraswamy"),r&&r.prng?($r(t,"seed",null),$r(t,"seedLength",null),zN(t,"state",BN(null),Woe),$r(t,"stateLength",null),$r(t,"byteLength",null),$r(t,"toJSON",BN(null)),$r(t,"PRNG",e)):(Go(t,"seed",u),Go(t,"seedLength",o),zN(t,"state",c,l),Go(t,"stateLength",v),Go(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=Ioe(e.state),n===void 0?d.params=[]:d.params=[n,a],d}function h(){return XN(e,n,a)}function p(d,f){return DN(d)||DN(f)||d<=0||f<=0?NaN:XN(e,d,f)}}YN.exports=zoe});var ZN=s(function(O4e,HN){"use strict";var Joe=Xl(),Uoe=Joe();HN.exports=Uoe});var Pa=s(function(E4e,$N){"use strict";var Coe=require("@stdlib/utils/define-nonenumerable-read-only-property"),QN=ZN(),Boe=Xl();Coe(QN,"factory",Boe);$N.exports=QN});var Yl=s(function(_4e,KN){"use strict";var Doe=F(),Xoe=require("@stdlib/array/dtypes"),Yoe=require("@stdlib/array/defaults"),Hoe=Pa(),Zoe=Xoe("real_floating_point_and_generic"),Qoe=Doe(Hoe,Zoe,Yoe.get("dtypes.real_floating_point"));KN.exports=Qoe});var rL=s(function(N4e,eL){"use strict";var $oe=Yl(),Koe=$oe();eL.exports=Koe});var nL=s(function(L4e,iL){"use strict";var eve=require("@stdlib/utils/define-nonenumerable-read-only-property"),tL=rL(),rve=Yl();eve(tL,"factory",rve);iL.exports=tL});var uL=s(function(R4e,sL){"use strict";var tve=require("@stdlib/assert/is-number").isPrimitive,ive=require("@stdlib/assert/is-positive-number").isPrimitive,aL=require("@stdlib/string/format"),nve=require("@stdlib/assert/is-nan");function ave(r,e){return!tve(r)||nve(r)?new TypeError(aL("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):ive(e)?null:new TypeError(aL("invalid argument. Second argument must be a positive number. Value: `%s`.",e))}sL.exports=ave});var vL=s(function(P4e,oL){"use strict";var sve=require("@stdlib/math/base/special/signum"),uve=require("@stdlib/math/base/special/abs"),ove=require("@stdlib/math/base/special/ln");function vve(r,e,t){var i=r()-.5;return e-t*sve(i)*ove(1-2*uve(i))}oL.exports=vve});var Hl=s(function(T4e,pL){"use strict";var Kr=require("@stdlib/utils/define-nonenumerable-read-only-property"),Wo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),gL=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),fL=require("@stdlib/assert/is-plain-object"),dL=require("@stdlib/assert/is-function"),lL=require("@stdlib/assert/has-own-property"),cL=require("@stdlib/utils/constant-function"),gve=require("@stdlib/utils/noop"),Io=T().factory,mL=require("@stdlib/math/base/assert/is-nan"),fve=require("@stdlib/array/to-json"),ko=require("@stdlib/string/format"),dve=uL(),hL=vL();function lve(){var r,e,t,i,n,a;if(arguments.length===0)e=Io();else if(arguments.length===1){if(r=arguments[0],!fL(r))throw new TypeError(ko("invalid argument. Options argument must be an object. Value: `%s`.",r));if(lL(r,"prng")){if(!dL(r.prng))throw new TypeError(ko("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Io(r)}else{if(n=arguments[0],a=arguments[1],i=dve(n,a),i)throw i;if(arguments.length>2){if(r=arguments[2],!fL(r))throw new TypeError(ko("invalid argument. Options argument must be an object. Value: `%s`.",r));if(lL(r,"prng")){if(!dL(r.prng))throw new TypeError(ko("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Io(r)}else e=Io()}return n===void 0?t=p:t=h,Kr(t,"NAME","laplace"),r&&r.prng?(Kr(t,"seed",null),Kr(t,"seedLength",null),gL(t,"state",cL(null),gve),Kr(t,"stateLength",null),Kr(t,"byteLength",null),Kr(t,"toJSON",cL(null)),Kr(t,"PRNG",e)):(Wo(t,"seed",u),Wo(t,"seedLength",o),gL(t,"state",c,l),Wo(t,"stateLength",v),Wo(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=fve(e.state),n===void 0?d.params=[]:d.params=[n,a],d}function h(){return hL(e,n,a)}function p(d,f){return mL(d)||mL(f)||f<=0?NaN:hL(e,d,f)}}pL.exports=lve});var qL=s(function(j4e,yL){"use strict";var cve=Hl(),mve=cve();yL.exports=mve});var Ta=s(function(M4e,wL){"use strict";var hve=require("@stdlib/utils/define-nonenumerable-read-only-property"),bL=qL(),pve=Hl();hve(bL,"factory",pve);wL.exports=bL});var Zl=s(function(x4e,SL){"use strict";var yve=F(),qve=require("@stdlib/array/dtypes"),bve=require("@stdlib/array/defaults"),wve=Ta(),Sve=qve("real_floating_point_and_generic"),Ove=yve(wve,Sve,bve.get("dtypes.real_floating_point"));SL.exports=Ove});var EL=s(function(A4e,OL){"use strict";var Eve=Zl(),_ve=Eve();OL.exports=_ve});var LL=s(function(G4e,NL){"use strict";var Nve=require("@stdlib/utils/define-nonenumerable-read-only-property"),_L=EL(),Lve=Zl();Nve(_L,"factory",Lve);NL.exports=_L});var TL=s(function(V4e,PL){"use strict";var Rve=require("@stdlib/assert/is-number").isPrimitive,Pve=require("@stdlib/assert/is-positive-number").isPrimitive,RL=require("@stdlib/string/format"),Tve=require("@stdlib/assert/is-nan");function jve(r,e){return!Rve(r)||Tve(r)?new TypeError(RL("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):Pve(e)?null:new TypeError(RL("invalid argument. Second argument must be a positive number. Value: `%s`.",e))}PL.exports=jve});var ML=s(function(F4e,jL){"use strict";var Mve=require("@stdlib/stats/base/dists/normal/quantile");function xve(r,e,t){var i=Mve(1-r()/2,0,1);return e+t/(i*i)}jL.exports=xve});var Ql=s(function(W4e,kL){"use strict";var et=require("@stdlib/utils/define-nonenumerable-read-only-property"),zo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),xL=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),AL=require("@stdlib/assert/is-plain-object"),GL=require("@stdlib/assert/is-function"),VL=require("@stdlib/assert/has-own-property"),FL=require("@stdlib/utils/constant-function"),Ave=require("@stdlib/utils/noop"),Jo=T().factory,WL=require("@stdlib/math/base/assert/is-nan"),Gve=require("@stdlib/array/to-json"),Uo=require("@stdlib/string/format"),Vve=TL(),IL=ML();function Fve(){var r,e,t,i,n,a;if(arguments.length===0)e=Jo();else if(arguments.length===1){if(r=arguments[0],!AL(r))throw new TypeError(Uo("invalid argument. Options argument must be an object. Value: `%s`.",r));if(VL(r,"prng")){if(!GL(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=Jo(r)}else{if(n=arguments[0],a=arguments[1],i=Vve(n,a),i)throw i;if(arguments.length>2){if(r=arguments[2],!AL(r))throw new TypeError(Uo("invalid argument. Options argument must be an object. Value: `%s`.",r));if(VL(r,"prng")){if(!GL(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=Jo(r)}else e=Jo()}return n===void 0?t=p:t=h,et(t,"NAME","levy"),r&&r.prng?(et(t,"seed",null),et(t,"seedLength",null),xL(t,"state",FL(null),Ave),et(t,"stateLength",null),et(t,"byteLength",null),et(t,"toJSON",FL(null)),et(t,"PRNG",e)):(zo(t,"seed",u),zo(t,"seedLength",o),xL(t,"state",c,l),zo(t,"stateLength",v),zo(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=Gve(e.state),n===void 0?d.params=[]:d.params=[n,a],d}function h(){return IL(e,n,a)}function p(d,f){return WL(d)||WL(f)||f<=0?NaN:IL(e,d,f)}}kL.exports=Fve});var JL=s(function(I4e,zL){"use strict";var Wve=Ql(),Ive=Wve();zL.exports=Ive});var ja=s(function(k4e,CL){"use strict";var kve=require("@stdlib/utils/define-nonenumerable-read-only-property"),UL=JL(),zve=Ql();kve(UL,"factory",zve);CL.exports=UL});var $l=s(function(z4e,BL){"use strict";var Jve=F(),Uve=require("@stdlib/array/dtypes"),Cve=require("@stdlib/array/defaults"),Bve=ja(),Dve=Uve("real_floating_point_and_generic"),Xve=Jve(Bve,Dve,Cve.get("dtypes.real_floating_point"));BL.exports=Xve});var XL=s(function(J4e,DL){"use strict";var Yve=$l(),Hve=Yve();DL.exports=Hve});var ZL=s(function(U4e,HL){"use strict";var Zve=require("@stdlib/utils/define-nonenumerable-read-only-property"),YL=XL(),Qve=$l();Zve(YL,"factory",Qve);HL.exports=YL});var KL=s(function(C4e,$L){"use strict";var $ve=require("@stdlib/assert/is-number").isPrimitive,Kve=require("@stdlib/assert/is-positive-number").isPrimitive,ege=require("@stdlib/assert/is-nan"),QL=require("@stdlib/string/format");function rge(r,e){return!$ve(r)||ege(r)?new TypeError(QL("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):Kve(e)?null:new TypeError(QL("invalid argument. Second argument must be a positive number. Value: `%s`.",e))}$L.exports=rge});var rR=s(function(B4e,eR){"use strict";var tge=require("@stdlib/math/base/special/ln");function ige(r,e,t){var i=r();return e+t*tge(i/(1-i))}eR.exports=ige});var Kl=s(function(D4e,vR){"use strict";var rt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Co=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),tR=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),iR=require("@stdlib/assert/is-plain-object"),nR=require("@stdlib/assert/is-function"),aR=require("@stdlib/assert/has-own-property"),sR=require("@stdlib/utils/constant-function"),nge=require("@stdlib/utils/noop"),Bo=T().factory,uR=require("@stdlib/math/base/assert/is-nan"),age=require("@stdlib/array/to-json"),Do=require("@stdlib/string/format"),sge=KL(),oR=rR();function uge(){var r,e,t,i,n,a;if(arguments.length===0)e=Bo();else if(arguments.length===1){if(r=arguments[0],!iR(r))throw new TypeError(Do("invalid argument. Options argument must be an object. Value: `%s`.",r));if(aR(r,"prng")){if(!nR(r.prng))throw new TypeError(Do("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Bo(r)}else{if(n=arguments[0],a=arguments[1],i=sge(n,a),i)throw i;if(arguments.length>2){if(r=arguments[2],!iR(r))throw new TypeError(Do("invalid argument. Options argument must be an object. Value: `%s`.",r));if(aR(r,"prng")){if(!nR(r.prng))throw new TypeError(Do("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Bo(r)}else e=Bo()}return n===void 0?t=p:t=h,rt(t,"NAME","logistic"),r&&r.prng?(rt(t,"seed",null),rt(t,"seedLength",null),tR(t,"state",sR(null),nge),rt(t,"stateLength",null),rt(t,"byteLength",null),rt(t,"toJSON",sR(null)),rt(t,"PRNG",e)):(Co(t,"seed",u),Co(t,"seedLength",o),tR(t,"state",c,l),Co(t,"stateLength",v),Co(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=age(e.state),n===void 0?d.params=[]:d.params=[n,a],d}function h(){return oR(e,n,a)}function p(d,f){return uR(d)||uR(f)||f<=0?NaN:oR(e,d,f)}}vR.exports=uge});var fR=s(function(X4e,gR){"use strict";var oge=Kl(),vge=oge();gR.exports=vge});var Ma=s(function(Y4e,lR){"use strict";var gge=require("@stdlib/utils/define-nonenumerable-read-only-property"),dR=fR(),fge=Kl();gge(dR,"factory",fge);lR.exports=dR});var ec=s(function(H4e,cR){"use strict";var dge=F(),lge=require("@stdlib/array/dtypes"),cge=require("@stdlib/array/defaults"),mge=Ma(),hge=lge("real_floating_point_and_generic"),pge=dge(mge,hge,cge.get("dtypes.real_floating_point"));cR.exports=pge});var hR=s(function(Z4e,mR){"use strict";var yge=ec(),qge=yge();mR.exports=qge});var qR=s(function(Q4e,yR){"use strict";var bge=require("@stdlib/utils/define-nonenumerable-read-only-property"),pR=hR(),wge=ec();bge(pR,"factory",wge);yR.exports=pR});var SR=s(function($4e,wR){"use strict";var Sge=require("@stdlib/assert/is-number").isPrimitive,Oge=require("@stdlib/assert/is-positive-number").isPrimitive,bR=require("@stdlib/string/format"),Ege=require("@stdlib/assert/is-nan");function _ge(r,e){return!Sge(r)||Ege(r)?new TypeError(bR("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):Oge(e)?null:new TypeError(bR("invalid argument. Second argument must be a positive number. Value: `%s`.",e))}wR.exports=_ge});var ER=s(function(K4e,OR){"use strict";var Nge=require("@stdlib/math/base/special/exp");function Lge(r,e,t){return Nge(e+t*r())}OR.exports=Lge});var rc=s(function(eHe,MR){"use strict";var Ot=require("@stdlib/utils/define-nonenumerable-read-only-property"),Xo=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),_R=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),NR=require("@stdlib/assert/is-plain-object"),LR=require("@stdlib/assert/is-function"),RR=require("@stdlib/assert/has-own-property"),PR=require("@stdlib/utils/constant-function"),Rge=require("@stdlib/utils/noop"),xa=Q().factory,TR=require("@stdlib/math/base/assert/is-nan"),Pge=require("@stdlib/array/to-json"),Yo=require("@stdlib/string/format"),Tge=SR(),jR=ER();function jge(){var r,e,t,i,n,a,u;if(arguments.length===0)e=xa();else if(arguments.length===1){if(t=arguments[0],!NR(t))throw new TypeError(Yo("invalid argument. Options argument must be an object. Value: `%s`.",t));if(RR(t,"prng")){if(!LR(t.prng))throw new TypeError(Yo("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=Tge(u,r),a)throw a;if(arguments.length>2){if(t=arguments[2],!NR(t))throw new TypeError(Yo("invalid argument. Options argument must be an object. Value: `%s`.",t));if(RR(t,"prng")){if(!LR(t.prng))throw new TypeError(Yo("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),_R(n,"state",PR(null),Rge),Ot(n,"stateLength",null),Ot(n,"byteLength",null),Ot(n,"toJSON",PR(null))):(Xo(n,"seed",o),Xo(n,"seedLength",v),_R(n,"state",l,m),Xo(n,"stateLength",g),Xo(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=Pge(i.state),u===void 0?f.params=[]:f.params=[u,r],f}function p(){return jR(e,u,r)}function d(f,y){return TR(f)||TR(y)||y<=0?NaN:jR(e,f,y)}}MR.exports=jge});var AR=s(function(rHe,xR){"use strict";var Mge=rc(),xge=Mge();xR.exports=xge});var ln=s(function(tHe,VR){"use strict";var Age=require("@stdlib/utils/define-nonenumerable-read-only-property"),GR=AR(),Gge=rc();Age(GR,"factory",Gge);VR.exports=GR});var tc=s(function(iHe,FR){"use strict";var Vge=F(),Fge=require("@stdlib/array/dtypes"),Wge=require("@stdlib/array/defaults"),Ige=ln(),kge=Fge("real_floating_point_and_generic"),zge=Vge(Ige,kge,Wge.get("dtypes.real_floating_point"));FR.exports=zge});var IR=s(function(nHe,WR){"use strict";var Jge=tc(),Uge=Jge();WR.exports=Uge});var JR=s(function(aHe,zR){"use strict";var Cge=require("@stdlib/utils/define-nonenumerable-read-only-property"),kR=IR(),Bge=tc();Cge(kR,"factory",Bge);zR.exports=kR});var ic=s(function(sHe,UR){"use strict";var Dge=require("@stdlib/constants/int32/max"),Xge=require("@stdlib/math/base/special/floor"),Yge=Dge-1;function Hge(){var r=Xge(1+Yge*Math.random());return r|0}UR.exports=Hge});var sc=s(function(uHe,YR){"use strict";var tt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Et=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),CR=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),nc=require("@stdlib/assert/has-own-property"),Zge=require("@stdlib/assert/is-plain-object"),Qge=require("@stdlib/assert/is-boolean").isPrimitive,$ge=require("@stdlib/assert/is-collection"),Kge=require("@stdlib/assert/is-positive-integer").isPrimitive,BR=require("@stdlib/assert/is-int32array"),Be=require("@stdlib/string/format"),Ho=require("@stdlib/constants/int32/max"),D=require("@stdlib/array/int32"),Aa=require("@stdlib/blas/base/gcopy"),efe=require("@stdlib/array/to-json"),DR=ic(),ac=Ho-1|0,rfe=Ho-1|0,tfe=16807,Zo=1,Qo=2,_t=2,X=4,$s=5;function XR(r,e){var t;return e?t="option":t="argument",r.length<$s+1?new RangeError(Be("invalid %s. State array has insufficient length.",t)):r[0]!==Zo?new RangeError(Be("invalid %s. State array has an incompatible schema version. Expected: `%s`. Actual: `%s`.",t,Zo,r[0])):r[1]!==Qo?new RangeError(Be("invalid %s. State array has an incompatible number of sections. Expected: `%s`. Actual: `%s`.",t,Qo,r[1])):r[_t]!==1?new RangeError(Be("invalid %s. State array has an incompatible state length. Expected: `%u`. Actual: `%u`.",t,1,r[_t])):r[X]!==r.length-$s?new RangeError(Be("invalid %s. State array length is incompatible with seed section length. Expected: `%u`. Actual: `%u`.",t,r.length-$s,r[X])):null}function ife(r){var e,t,i,n,a,u;if(i={},arguments.length){if(!Zge(r))throw new TypeError(Be("invalid argument. Options argument must be an object. Value: `%s`.",r));if(nc(r,"copy")&&(i.copy=r.copy,!Qge(r.copy)))throw new TypeError(Be("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",r.copy));if(nc(r,"state")){if(t=r.state,i.state=!0,!BR(t))throw new TypeError(Be("invalid option. `%s` option must be an Int32Array. Option: `%s`.","state",t));if(u=XR(t,!0),u)throw u;i.copy===!1?e=t:(e=new D(t.length),Aa(t.length,t,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,t[X])}if(n===void 0)if(nc(r,"seed"))if(n=r.seed,i.seed=!0,Kge(n)){if(n>rfe)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($ge(n)&&n.length>0)a=n.length,e=new D($s+a),e[0]=Zo,e[1]=Qo,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=DR()|0}else n=DR()|0;return t===void 0&&(e=new D($s+1),e[0]=Zo,e[1]=Qo,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),CR(p,"state",l,m),Et(p,"stateLength",g),Et(p,"byteLength",c),tt(p,"toJSON",h),tt(p,"MIN",1),tt(p,"MAX",Ho-1),tt(p,"normalized",d),tt(d,"NAME",p.NAME),Et(d,"seed",o),Et(d,"seedLength",v),CR(d,"state",l,m),Et(d,"stateLength",g),Et(d,"byteLength",c),tt(d,"toJSON",h),tt(d,"MIN",(p.MIN-1)/ac),tt(d,"MAX",(p.MAX-1)/ac),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(!BR(f))throw new TypeError(Be("invalid argument. Must provide an Int32Array. Value: `%s`.",f));if(y=XR(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=efe(e),f.params=[],f}function p(){var f=t[0]|0;return f=tfe*f%Ho|0,t[0]=f,f|0}function d(){return(p()-1)/ac}}YR.exports=ife});var ZR=s(function(oHe,HR){"use strict";var nfe=sc(),afe=ic(),sfe=nfe({seed:afe()});HR.exports=sfe});var $=s(function(vHe,$R){"use strict";var ufe=require("@stdlib/utils/define-nonenumerable-read-only-property"),QR=ZR(),ofe=sc();ufe(QR,"factory",ofe);$R.exports=QR});var KR=s(function(gHe,vfe){vfe.exports={idtype:"float64",ndtype:"float64"}});var rP=s(function(fHe,eP){"use strict";var gfe=require("@stdlib/array/typed-real-float-dtypes"),ffe=require("@stdlib/array/typed-real-dtypes"),dfe=require("@stdlib/assert/is-plain-object"),$o=require("@stdlib/assert/has-own-property"),Ks=require("@stdlib/string/format"),eu=ffe(),ru=gfe();eu.push("generic");ru.push("generic");function lfe(r,e,t){if(!dfe(e))return new TypeError(Ks("invalid argument. Options argument must be an object. Value: `%s`.",e));if(t===0){if($o(e,"idtype")&&(r.idtype=e.idtype,eu.indexOf(r.idtype)<0))return new TypeError(Ks('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"idtype",eu.join('", "'),r.idtype));if($o(e,"ndtype")&&(r.ndtype=e.ndtype,ru.indexOf(r.ndtype)<0))return new TypeError(Ks('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"ndtype",ru.join('", "'),r.ndtype))}else if(t===1&&$o(e,"dtype")){if(r.dtype=e.dtype,eu.indexOf(r.dtype)<0)return new TypeError(Ks('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",eu.join('", "'),r.dtype))}else if($o(e,"dtype")&&(r.dtype=e.dtype,ru.indexOf(r.dtype)<0))return new TypeError(Ks('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",ru.join('", "'),r.dtype));return null}eP.exports=lfe});var oc=s(function(dHe,gP){"use strict";var tP=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,iP=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ko=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),cfe=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),nP=$(),aP=require("@stdlib/array/typed-real-ctors"),sP=require("@stdlib/array/base/filled-by"),uP=require("@stdlib/strided/base/nullary"),oP=require("@stdlib/string/format"),vP=KR(),uc=rP();function mfe(){var r,e,t,i,n,a;if(t={idtype:vP.idtype,ndtype:vP.ndtype},e=arguments.length,i=u,e===0)n=nP;else if(e===1&&(r=arguments[0],n=nP.factory(r),a=uc(t,r,0),a))throw a;return Ko(i,"seed",v),Ko(i,"seedLength",g),cfe(i,"state",m,h),Ko(i,"stateLength",c),Ko(i,"byteLength",l),iP(i,"PRNG",n),iP(i,"normalized",o),i;function u(p,d){var f,y,q,b,w;if(!tP(p))throw new TypeError(oP("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",p));if(w={},arguments.length>1&&(q=uc(w,d,1),q))throw q;return b=w.dtype||t.idtype,b==="generic"?sP(p,n):(f=aP(b),y=new f(p),uP([y],[p],[1],n),y)}function o(p,d){var f,y,q,b,w;if(!tP(p))throw new TypeError(oP("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",p));if(w={},arguments.length>1&&(q=uc(w,d,2),q))throw q;return b=w.dtype||t.ndtype,b==="generic"?sP(p,n.normalized):(f=aP(b),y=new f(p),uP([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}}gP.exports=mfe});var dP=s(function(lHe,fP){"use strict";var hfe=oc(),pfe=hfe();fP.exports=pfe});var mP=s(function(cHe,cP){"use strict";var yfe=require("@stdlib/utils/define-nonenumerable-read-only-property"),lP=dP(),qfe=oc();yfe(lP,"factory",qfe);cP.exports=lP});var pP=s(function(mHe,hP){"use strict";var bfe=require("@stdlib/math/base/assert/is-nan"),wfe=8;function Sfe(r,e,t){var i,n;for(n=0;n=0;n--)e[n]=r();return e}hP.exports=Sfe});var vc=s(function(hHe,yP){"use strict";var Ofe=require("@stdlib/constants/int32/max"),Efe=require("@stdlib/math/base/special/floor"),_fe=Ofe-1;function Nfe(){var r=Efe(1+_fe*Math.random());return r|0}yP.exports=Nfe});var dc=s(function(pHe,EP){"use strict";var it=require("@stdlib/utils/define-nonenumerable-read-only-property"),Nt=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),qP=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),gc=require("@stdlib/assert/has-own-property"),Lfe=require("@stdlib/assert/is-plain-object"),Rfe=require("@stdlib/assert/is-boolean").isPrimitive,Pfe=require("@stdlib/assert/is-collection"),Tfe=require("@stdlib/assert/is-positive-integer").isPrimitive,bP=require("@stdlib/assert/is-int32array"),Ga=require("@stdlib/blas/base/gcopy"),jfe=require("@stdlib/math/base/special/floor"),Y=require("@stdlib/array/int32"),tu=require("@stdlib/constants/int32/max"),Mfe=require("@stdlib/array/to-json"),K=require("@stdlib/string/format"),wP=pP(),SP=vc(),fc=tu-1|0,xfe=tu-1|0,Afe=16807,Z=32,tv=1,iv=3,Lt=2,Va=Z+3,H=Z+6,iu=Z+7,ev=Va+1,rv=Va+2;function OP(r,e){var t;return e?t="option":t="argument",r.lengthxfe)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(Pfe(n)&&n.length>0)a=n.length,e=new Y(iu+a),e[0]=tv,e[1]=iv,e[Lt]=Z,e[Va]=2,e[rv]=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=wP(p,t,Z),e[ev]=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=SP()|0}else n=SP()|0;return t===void 0&&(e=new Y(iu+1),e[0]=tv,e[1]=iv,e[Lt]=Z,e[Va]=2,e[rv]=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=wP(p,t,Z),e[ev]=t[0]),it(d,"NAME","minstd-shuffle"),Nt(d,"seed",o),Nt(d,"seedLength",v),qP(d,"state",l,m),Nt(d,"stateLength",g),Nt(d,"byteLength",c),it(d,"toJSON",h),it(d,"MIN",1),it(d,"MAX",tu-1),it(d,"normalized",f),it(f,"NAME",d.NAME),Nt(f,"seed",o),Nt(f,"seedLength",v),qP(f,"state",l,m),Nt(f,"stateLength",g),Nt(f,"byteLength",c),it(f,"toJSON",h),it(f,"MIN",(d.MIN-1)/fc),it(f,"MAX",(d.MAX-1)/fc),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(!bP(y))throw new TypeError(K("invalid argument. Must provide an Int32Array. Value: `%s`.",y));if(q=OP(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=Mfe(e),y.params=[],y}function p(){var y=e[rv]|0;return y=Afe*y%tu|0,e[rv]=y,y|0}function d(){var y,q;return y=e[ev],q=jfe(Z*(y/tu)),y=t[q],e[ev]=y,t[q]=p(),y}function f(){return(d()-1)/fc}}EP.exports=Gfe});var NP=s(function(yHe,_P){"use strict";var Vfe=dc(),Ffe=vc(),Wfe=Vfe({seed:Ffe()});_P.exports=Wfe});var ee=s(function(qHe,RP){"use strict";var Ife=require("@stdlib/utils/define-nonenumerable-read-only-property"),LP=NP(),kfe=dc();Ife(LP,"factory",kfe);RP.exports=LP});var PP=s(function(bHe,zfe){zfe.exports={idtype:"float64",ndtype:"float64"}});var jP=s(function(wHe,TP){"use strict";var Jfe=require("@stdlib/array/typed-real-float-dtypes"),Ufe=require("@stdlib/array/typed-real-dtypes"),Cfe=require("@stdlib/assert/is-plain-object"),nv=require("@stdlib/assert/has-own-property"),nu=require("@stdlib/string/format"),au=Ufe(),su=Jfe();au.push("generic");su.push("generic");function Bfe(r,e,t){if(!Cfe(e))return new TypeError(nu("invalid argument. Options argument must be an object. Value: `%s`.",e));if(t===0){if(nv(e,"idtype")&&(r.idtype=e.idtype,au.indexOf(r.idtype)<0))return new TypeError(nu('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"idtype",au.join('", "'),r.idtype));if(nv(e,"ndtype")&&(r.ndtype=e.ndtype,su.indexOf(r.ndtype)<0))return new TypeError(nu('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"ndtype",su.join('", "'),r.ndtype))}else if(t===1&&nv(e,"dtype")){if(r.dtype=e.dtype,au.indexOf(r.dtype)<0)return new TypeError(nu('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",au.join('", "'),r.dtype))}else if(nv(e,"dtype")&&(r.dtype=e.dtype,su.indexOf(r.dtype)<0))return new TypeError(nu('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",su.join('", "'),r.dtype));return null}TP.exports=Bfe});var cc=s(function(SHe,kP){"use strict";var MP=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,xP=require("@stdlib/utils/define-nonenumerable-read-only-property"),av=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Dfe=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),AP=ee(),GP=require("@stdlib/array/typed-real-ctors"),VP=require("@stdlib/array/base/filled-by"),FP=require("@stdlib/strided/base/nullary"),WP=require("@stdlib/string/format"),IP=PP(),lc=jP();function Xfe(){var r,e,t,i,n,a;if(t={idtype:IP.idtype,ndtype:IP.ndtype},e=arguments.length,i=u,e===0)n=AP;else if(e===1&&(r=arguments[0],n=AP.factory(r),a=lc(t,r,0),a))throw a;return av(i,"seed",v),av(i,"seedLength",g),Dfe(i,"state",m,h),av(i,"stateLength",c),av(i,"byteLength",l),xP(i,"PRNG",n),xP(i,"normalized",o),i;function u(p,d){var f,y,q,b,w;if(!MP(p))throw new TypeError(WP("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",p));if(w={},arguments.length>1&&(q=lc(w,d,1),q))throw q;return b=w.dtype||t.idtype,b==="generic"?VP(p,n):(f=GP(b),y=new f(p),FP([y],[p],[1],n),y)}function o(p,d){var f,y,q,b,w;if(!MP(p))throw new TypeError(WP("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",p));if(w={},arguments.length>1&&(q=lc(w,d,2),q))throw q;return b=w.dtype||t.ndtype,b==="generic"?VP(p,n.normalized):(f=GP(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}}kP.exports=Xfe});var JP=s(function(OHe,zP){"use strict";var Yfe=cc(),Hfe=Yfe();zP.exports=Hfe});var BP=s(function(EHe,CP){"use strict";var Zfe=require("@stdlib/utils/define-nonenumerable-read-only-property"),UP=JP(),Qfe=cc();Zfe(UP,"factory",Qfe);CP.exports=UP});var DP=s(function(_He,$fe){$fe.exports={idtype:"float64",ndtype:"float64"}});var YP=s(function(NHe,XP){"use strict";var Kfe=require("@stdlib/array/typed-real-float-dtypes"),ede=require("@stdlib/array/typed-real-dtypes"),rde=require("@stdlib/assert/is-plain-object"),sv=require("@stdlib/assert/has-own-property"),uu=require("@stdlib/string/format"),ou=ede(),vu=Kfe();ou.push("generic");vu.push("generic");function tde(r,e,t){if(!rde(e))return new TypeError(uu("invalid argument. Options argument must be an object. Value: `%s`.",e));if(t===0){if(sv(e,"idtype")&&(r.idtype=e.idtype,ou.indexOf(r.idtype)<0))return new TypeError(uu('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"idtype",ou.join('", "'),r.idtype));if(sv(e,"ndtype")&&(r.ndtype=e.ndtype,vu.indexOf(r.ndtype)<0))return new TypeError(uu('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"ndtype",vu.join('", "'),r.ndtype))}else if(t===1&&sv(e,"dtype")){if(r.dtype=e.dtype,ou.indexOf(r.dtype)<0)return new TypeError(uu('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",ou.join('", "'),r.dtype))}else if(sv(e,"dtype")&&(r.dtype=e.dtype,vu.indexOf(r.dtype)<0))return new TypeError(uu('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",vu.join('", "'),r.dtype));return null}XP.exports=tde});var hc=s(function(LHe,iT){"use strict";var HP=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,ZP=require("@stdlib/utils/define-nonenumerable-read-only-property"),uv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),ide=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),QP=T(),$P=require("@stdlib/array/typed-real-ctors"),KP=require("@stdlib/array/base/filled-by"),eT=require("@stdlib/strided/base/nullary"),rT=require("@stdlib/string/format"),tT=DP(),mc=YP();function nde(){var r,e,t,i,n,a;if(t={idtype:tT.idtype,ndtype:tT.ndtype},e=arguments.length,i=u,e===0)n=QP;else if(e===1&&(r=arguments[0],n=QP.factory(r),a=mc(t,r,0),a))throw a;return uv(i,"seed",v),uv(i,"seedLength",g),ide(i,"state",m,h),uv(i,"stateLength",c),uv(i,"byteLength",l),ZP(i,"PRNG",n),ZP(i,"normalized",o),i;function u(p,d){var f,y,q,b,w;if(!HP(p))throw new TypeError(rT("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",p));if(w={},arguments.length>1&&(q=mc(w,d,1),q))throw q;return b=w.dtype||t.idtype,b==="generic"?KP(p,n):(f=$P(b),y=new f(p),eT([y],[p],[1],n),y)}function o(p,d){var f,y,q,b,w;if(!HP(p))throw new TypeError(rT("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",p));if(w={},arguments.length>1&&(q=mc(w,d,2),q))throw q;return b=w.dtype||t.ndtype,b==="generic"?KP(p,n.normalized):(f=$P(b),y=new f(p),eT([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}}iT.exports=nde});var aT=s(function(RHe,nT){"use strict";var ade=hc(),sde=ade();nT.exports=sde});var oT=s(function(PHe,uT){"use strict";var ude=require("@stdlib/utils/define-nonenumerable-read-only-property"),sT=aT(),ode=hc();ude(sT,"factory",ode);uT.exports=sT});var gT=s(function(THe,vT){"use strict";var vde=require("@stdlib/math/base/special/exp");function gde(r,e){for(var t=r(),i=1;t>vde(-e);)i+=1,t*=r();return i-1}vT.exports=gde});var cT=s(function(jHe,lT){"use strict";var fde=require("@stdlib/math/base/special/factorialln"),fT=require("@stdlib/math/base/special/floor"),dde=require("@stdlib/math/base/special/signum"),lde=require("@stdlib/math/base/special/sqrt"),dT=require("@stdlib/math/base/special/abs"),ov=require("@stdlib/math/base/special/ln"),cde=require("@stdlib/constants/float64/ln-sqrt-two-pi"),mde=1/12,hde=1/360;function pde(r,e){var t,i,n,a,u,o,v,g,c,l;for(t=lde(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-dT(c))+v,c+=e+.445,fT(c);if(l>=u?c=r()-.5:(c=l/u-.93,c=dde(c)*.5-c,l=u*r()),a=.5-dT(c),(a>=.013||a>=l)&&(g=fT((2*o/a+v)*c+e+.445),l*=i/(o/(a*a)+v),c=(g+.5)*ov(e/g),c+=-e-cde+g,c-=(mde-hde/(g*g))/g,g>=10&&c>=ov(l*t)||(c=g*ov(e)-e-fde(g),g>=0&&g<=9&&c>=ov(l))))return g}}lT.exports=pde});var hT=s(function(MHe,mT){"use strict";var yde=gT(),qde=cT();function bde(r,e){return e<30?yde(r,e):qde(r,e)}mT.exports=bde});var pc=s(function(xHe,OT){"use strict";var nt=require("@stdlib/utils/define-nonenumerable-read-only-property"),vv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),pT=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),wde=require("@stdlib/assert/is-positive-number").isPrimitive,yT=require("@stdlib/assert/is-plain-object"),qT=require("@stdlib/assert/is-function"),bT=require("@stdlib/assert/has-own-property"),wT=require("@stdlib/utils/constant-function"),Sde=require("@stdlib/utils/noop"),gv=T().factory,Ode=require("@stdlib/math/base/assert/is-nan"),Ede=require("@stdlib/array/to-json"),fv=require("@stdlib/string/format"),ST=hT();function _de(){var r,e,t,i;if(arguments.length===0)t=gv();else if(arguments.length===1&&yT(arguments[0]))if(e=arguments[0],bT(e,"prng")){if(!qT(e.prng))throw new TypeError(fv("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));t=e.prng}else t=gv(e);else{if(r=arguments[0],!wde(r))throw new TypeError(fv("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(arguments.length>1){if(e=arguments[1],!yT(e))throw new TypeError(fv("invalid argument. Options argument must be an object. Value: `%s`.",e));if(bT(e,"prng")){if(!qT(e.prng))throw new TypeError(fv("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));t=e.prng}else t=gv(e)}else t=gv()}return r===void 0?i=m:i=l,nt(i,"NAME","poisson"),e&&e.prng?(nt(i,"seed",null),nt(i,"seedLength",null),pT(i,"state",wT(null),Sde),nt(i,"stateLength",null),nt(i,"byteLength",null),nt(i,"toJSON",wT(null)),nt(i,"PRNG",t)):(vv(i,"seed",n),vv(i,"seedLength",a),pT(i,"state",v,g),vv(i,"stateLength",u),vv(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=Ede(t.state),r===void 0?h.params=[]:h.params=[r],h}function l(){return ST(t,r)}function m(h){return Ode(h)||h<=0?NaN:ST(t,h)}}OT.exports=_de});var _T=s(function(AHe,ET){"use strict";var Nde=pc(),Lde=Nde();ET.exports=Lde});var cn=s(function(GHe,LT){"use strict";var Rde=require("@stdlib/utils/define-nonenumerable-read-only-property"),NT=_T(),Pde=pc();Rde(NT,"factory",Pde);LT.exports=NT});var PT=s(function(VHe,RT){"use strict";var Tde=require("@stdlib/assert/is-positive-number").isPrimitive,jde=require("@stdlib/assert/is-number").isPrimitive,yc=require("@stdlib/string/format"),Mde=require("@stdlib/assert/is-nan");function xde(r,e){return Tde(r)?!jde(e)||Mde(e)?new TypeError(yc("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e)):e<=0||e>=1?new RangeError(yc("invalid argument. Second argument must be on the interval: (0, 1). Value: `%f`.",e)):null:new TypeError(yc("invalid argument. First argument must be a positive number. Value: `%s`.",r))}RT.exports=xde});var Sc=s(function(FHe,FT){"use strict";var Rt=require("@stdlib/utils/define-nonenumerable-read-only-property"),dv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),TT=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Fa=require("@stdlib/assert/has-own-property"),jT=require("@stdlib/assert/is-plain-object"),qc=require("@stdlib/assert/is-uint32array"),MT=require("@stdlib/assert/is-boolean").isPrimitive,xT=require("@stdlib/assert/is-function"),AT=require("@stdlib/utils/constant-function"),Ade=require("@stdlib/utils/noop"),GT=require("@stdlib/math/base/assert/is-nan"),Wa=cn().factory,lv=Ce().factory,bc=require("@stdlib/blas/base/gcopy"),wc=require("@stdlib/array/uint32"),VT=require("@stdlib/object/assign"),Gde=require("@stdlib/array/to-json"),at=require("@stdlib/string/format"),Vde=PT();function Fde(){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],!jT(i))throw new TypeError(at("invalid argument. Options argument must be an object. Value: `%s`.",i));if(Fa(i,"copy")&&!MT(i.copy))throw new TypeError(at("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",i.copy));if(Fa(i,"prng")){if(!xT(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")&&!qc(i.state))throw new TypeError(at("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",i.state));i=VT({},i),i.copy===!1?u=!1:i.state&&(i.state=bc(i.state.length,i.state,1,new wc(i.state.length),1)),i.copy=!1,t=Wa(i)}}else{if(g=arguments[0],v=arguments[1],o=Vde(g,v),o)throw o;if(arguments.length>2){if(i=arguments[2],!jT(i))throw new TypeError(at("invalid argument. Options argument must be an object. Value: `%s`.",i));if(Fa(i,"copy")&&!MT(i.copy))throw new TypeError(at("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",i.copy));if(Fa(i,"prng")){if(!xT(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")&&!qc(i.state))throw new TypeError(at("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",i.state));i=VT({},i),i.copy===!1?u=!1:i.state&&(i.state=bc(i.state.length,i.state,1,new wc(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=lv({prng:i.prng}):r=lv(g,v/(1-v),{prng:i.prng}):(i.state?e=i.state:(e=t.state,t.state=e),g===void 0?r=lv({state:e,copy:!1}):r=lv(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),TT(n,"state",AT(null),Ade),Rt(n,"stateLength",null),Rt(n,"byteLength",null),Rt(n,"toJSON",AT(null))):(dv(n,"seed",c),dv(n,"seedLength",l),TT(n,"state",p,d),dv(n,"stateLength",m),dv(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(!qc(b))throw new TypeError(at("invalid argument. Must provide a Uint32Array. Value: `%s`.",b));u&&(b=bc(b.length,b,1,new wc(b.length),1)),a.state=b}function f(){var b={};return b.type="PRNG",b.name=n.NAME,b.state=Gde(a.state),g===void 0?b.params=[]:b.params=[g,v],b}function y(){return t(r())}function q(b,w){return GT(b)||GT(w)||w<=0||w>=1?NaN:t(r(b,w/(1-w)))}}FT.exports=Fde});var IT=s(function(WHe,WT){"use strict";var Wde=Sc(),Ide=Wde();WT.exports=Ide});var Ia=s(function(IHe,zT){"use strict";var kde=require("@stdlib/utils/define-nonenumerable-read-only-property"),kT=IT(),zde=Sc();kde(kT,"factory",zde);zT.exports=kT});var Oc=s(function(kHe,JT){"use strict";var Jde=F(),Ude=require("@stdlib/array/dtypes"),Cde=require("@stdlib/array/defaults"),Bde=Ia(),Dde=Ude("real_and_generic"),Xde=Jde(Bde,Dde,Cde.get("dtypes.real"));JT.exports=Xde});var CT=s(function(zHe,UT){"use strict";var Yde=Oc(),Hde=Yde();UT.exports=Hde});var XT=s(function(JHe,DT){"use strict";var Zde=require("@stdlib/utils/define-nonenumerable-read-only-property"),BT=CT(),Qde=Oc();Zde(BT,"factory",Qde);DT.exports=BT});var ZT=s(function(UHe,HT){"use strict";var $de=require("@stdlib/assert/is-number").isPrimitive,Kde=require("@stdlib/assert/is-positive-number").isPrimitive,YT=require("@stdlib/string/format"),ele=require("@stdlib/assert/is-nan");function rle(r,e){return!$de(r)||ele(r)?new TypeError(YT("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):Kde(e)?null:new TypeError(YT("invalid argument. Second argument must be a positive number. Value: `%s`.",e))}HT.exports=rle});var $T=s(function(CHe,QT){"use strict";function tle(r,e,t){return e+t*r()}QT.exports=tle});var Ec=s(function(BHe,sj){"use strict";var Pt=require("@stdlib/utils/define-nonenumerable-read-only-property"),cv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),KT=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),ej=require("@stdlib/assert/is-plain-object"),rj=require("@stdlib/assert/is-function"),tj=require("@stdlib/assert/has-own-property"),ij=require("@stdlib/utils/constant-function"),ile=require("@stdlib/utils/noop"),ka=Q().factory,nj=require("@stdlib/math/base/assert/is-nan"),nle=require("@stdlib/array/to-json"),mv=require("@stdlib/string/format"),ale=ZT(),aj=$T();function sle(){var r,e,t,i,n,a,u;if(arguments.length===0)e=ka();else if(arguments.length===1){if(t=arguments[0],!ej(t))throw new TypeError(mv("invalid argument. Options argument must be an object. Value: `%s`.",t));if(tj(t,"prng")){if(!rj(t.prng))throw new TypeError(mv("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=ale(u,r),a)throw a;if(arguments.length>2){if(t=arguments[2],!ej(t))throw new TypeError(mv("invalid argument. Options argument must be an object. Value: `%s`.",t));if(tj(t,"prng")){if(!rj(t.prng))throw new TypeError(mv("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),KT(n,"state",ij(null),ile),Pt(n,"stateLength",null),Pt(n,"byteLength",null),Pt(n,"toJSON",ij(null))):(cv(n,"seed",o),cv(n,"seedLength",v),KT(n,"state",l,m),cv(n,"stateLength",g),cv(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=nle(i.state),u===void 0?f.params=[]:f.params=[u,r],f}function p(){return aj(e,u,r)}function d(f,y){return nj(f)||nj(y)||y<=0?NaN:aj(e,f,y)}}sj.exports=sle});var oj=s(function(DHe,uj){"use strict";var ule=Ec(),ole=ule();uj.exports=ole});var mn=s(function(XHe,gj){"use strict";var vle=require("@stdlib/utils/define-nonenumerable-read-only-property"),vj=oj(),gle=Ec();vle(vj,"factory",gle);gj.exports=vj});var _c=s(function(YHe,fj){"use strict";var fle=F(),dle=require("@stdlib/array/dtypes"),lle=require("@stdlib/array/defaults"),cle=mn(),mle=dle("real_floating_point_and_generic"),hle=fle(cle,mle,lle.get("dtypes.real_floating_point"));fj.exports=hle});var lj=s(function(HHe,dj){"use strict";var ple=_c(),yle=ple();dj.exports=yle});var hj=s(function(ZHe,mj){"use strict";var qle=require("@stdlib/utils/define-nonenumerable-read-only-property"),cj=lj(),ble=_c();qle(cj,"factory",ble);mj.exports=cj});var bj=s(function(QHe,qj){"use strict";var pj=require("@stdlib/assert/is-positive-number").isPrimitive,yj=require("@stdlib/string/format");function wle(r,e){return pj(r)?pj(e)?null:new TypeError(yj("invalid argument. Second argument must be a positive number. Value: `%s`.",e)):new TypeError(yj("invalid argument. First argument must be a positive number. Value: `%s`.",r))}qj.exports=wle});var Sj=s(function($He,wj){"use strict";var Sle=require("@stdlib/math/base/special/pow");function Ole(r,e,t){return t/Sle(r(),1/e)}wj.exports=Ole});var Nc=s(function(KHe,Tj){"use strict";var st=require("@stdlib/utils/define-nonenumerable-read-only-property"),hv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Oj=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Ej=require("@stdlib/assert/is-plain-object"),_j=require("@stdlib/assert/is-function"),Nj=require("@stdlib/assert/has-own-property"),Lj=require("@stdlib/utils/constant-function"),Ele=require("@stdlib/utils/noop"),pv=T().factory,Rj=require("@stdlib/math/base/assert/is-nan"),_le=require("@stdlib/array/to-json"),yv=require("@stdlib/string/format"),Nle=bj(),Pj=Sj();function Lle(){var r,e,t,i,n,a;if(arguments.length===0)i=pv();else if(arguments.length===1){if(t=arguments[0],!Ej(t))throw new TypeError(yv("invalid argument. Options argument must be an object. Value: `%s`.",t));if(Nj(t,"prng")){if(!_j(t.prng))throw new TypeError(yv("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",t.prng));i=t.prng}else i=pv(t)}else{if(r=arguments[0],e=arguments[1],a=Nle(r,e),a)throw a;if(arguments.length>2){if(t=arguments[2],!Ej(t))throw new TypeError(yv("invalid argument. Options argument must be an object. Value: `%s`.",t));if(Nj(t,"prng")){if(!_j(t.prng))throw new TypeError(yv("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",t.prng));i=t.prng}else i=pv(t)}else i=pv()}return r===void 0?n=p:n=h,st(n,"NAME","pareto-type1"),t&&t.prng?(st(n,"seed",null),st(n,"seedLength",null),Oj(n,"state",Lj(null),Ele),st(n,"stateLength",null),st(n,"byteLength",null),st(n,"toJSON",Lj(null)),st(n,"PRNG",i)):(hv(n,"seed",u),hv(n,"seedLength",o),Oj(n,"state",c,l),hv(n,"stateLength",v),hv(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=_le(i.state),r===void 0?d.params=[]:d.params=[r,e],d}function h(){return Pj(i,r,e)}function p(d,f){return Rj(d)||Rj(f)||d<=0||f<=0?NaN:Pj(i,d,f)}}Tj.exports=Lle});var Mj=s(function(eZe,jj){"use strict";var Rle=Nc(),Ple=Rle();jj.exports=Ple});var za=s(function(rZe,Aj){"use strict";var Tle=require("@stdlib/utils/define-nonenumerable-read-only-property"),xj=Mj(),jle=Nc();Tle(xj,"factory",jle);Aj.exports=xj});var Lc=s(function(tZe,Gj){"use strict";var Mle=F(),xle=require("@stdlib/array/dtypes"),Ale=require("@stdlib/array/defaults"),Gle=za(),Vle=xle("real_floating_point_and_generic"),Fle=Mle(Gle,Vle,Ale.get("dtypes.real_floating_point"));Gj.exports=Fle});var Fj=s(function(iZe,Vj){"use strict";var Wle=Lc(),Ile=Wle();Vj.exports=Ile});var kj=s(function(nZe,Ij){"use strict";var kle=require("@stdlib/utils/define-nonenumerable-read-only-property"),Wj=Fj(),zle=Lc();kle(Wj,"factory",zle);Ij.exports=Wj});var Rc=s(function(aZe,zj){"use strict";var Jle=Vr(),Ule=require("@stdlib/array/dtypes"),Cle=require("@stdlib/array/defaults"),Ble=cn(),Dle=Ule("real_and_generic"),Xle=Jle(Ble,Dle,Cle.get("dtypes.real"));zj.exports=Xle});var Uj=s(function(sZe,Jj){"use strict";var Yle=Rc(),Hle=Yle();Jj.exports=Hle});var Dj=s(function(uZe,Bj){"use strict";var Zle=require("@stdlib/utils/define-nonenumerable-read-only-property"),Cj=Uj(),Qle=Rc();Zle(Cj,"factory",Qle);Bj.exports=Cj});var Xj=s(function(oZe,$le){$le.exports={name:"mt19937",copy:!0}});var Hj=s(function(vZe,Yj){"use strict";var Kle=$(),ece=ee(),rce=T(),qv={};qv.minstd=Kle;qv["minstd-shuffle"]=ece;qv.mt19937=rce;Yj.exports=qv});var Pc=s(function(gZe,Qj){"use strict";var gu=require("@stdlib/utils/define-nonenumerable-read-only-property"),bv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),tce=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),ice=require("@stdlib/assert/is-plain-object"),nce=require("@stdlib/assert/is-boolean").isPrimitive,wv=require("@stdlib/assert/has-own-property"),ace=require("@stdlib/array/to-json"),fu=require("@stdlib/string/format"),Zj=Xj(),sce=Hj();function uce(r){var e,t,i;if(e={name:Zj.name,copy:Zj.copy},arguments.length){if(!ice(r))throw new TypeError(fu("invalid argument. Must provide an object. Value: `%s`.",r));if(wv(r,"name")&&(e.name=r.name),wv(r,"state")){if(e.state=r.state,e.state===void 0)throw new TypeError(fu("invalid option. `%s` option cannot be undefined. Option: `%s`.","state",e.state))}else if(wv(r,"seed")&&(e.seed=r.seed,e.seed===void 0))throw new TypeError(fu("invalid option. `%s` option cannot be undefined. Option: `%s`.","seed",e.seed));if(wv(r,"copy")&&(e.copy=r.copy,!nce(e.copy)))throw new TypeError(fu("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",e.copy))}if(i=sce[e.name],i===void 0)throw new Error(fu("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}),gu(l,"NAME","randu"),bv(l,"seed",n),bv(l,"seedLength",a),tce(l,"state",v,g),bv(l,"stateLength",u),bv(l,"byteLength",o),gu(l,"toJSON",c),gu(l,"PRNG",t),gu(l,"MIN",t.normalized.MIN),gu(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=ace(t.state),m.params=[],m}function l(){return t.normalized()}}Qj.exports=uce});var Kj=s(function(fZe,$j){"use strict";var oce=Pc(),vce=oce();$j.exports=vce});var Tt=s(function(dZe,r0){"use strict";var gce=require("@stdlib/utils/define-nonenumerable-read-only-property"),e0=Kj(),fce=Pc();gce(e0,"factory",fce);r0.exports=e0});var t0=s(function(lZe,dce){dce.exports={dtype:"float64"}});var a0=s(function(cZe,n0){"use strict";var lce=require("@stdlib/array/typed-real-float-dtypes"),cce=require("@stdlib/assert/is-plain-object"),mce=require("@stdlib/assert/has-own-property"),i0=require("@stdlib/string/format"),Tc=lce();Tc.push("generic");function hce(r,e){return cce(e)?mce(e,"dtype")&&(r.dtype=e.dtype,Tc.indexOf(r.dtype)<0)?new TypeError(i0('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"dtype",Tc.join('", "'),r.dtype)):null:new TypeError(i0("invalid argument. Options argument must be an object. Value: `%s`.",e))}n0.exports=hce});var jc=s(function(mZe,o0){"use strict";var pce=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,yce=require("@stdlib/utils/define-nonenumerable-read-only-property"),Sv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),qce=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),s0=Tt(),bce=require("@stdlib/array/typed-real-float-ctors"),wce=require("@stdlib/array/base/filled-by"),Sce=require("@stdlib/strided/base/nullary"),Oce=require("@stdlib/string/format"),Ece=t0(),u0=a0();function _ce(){var r,e,t,i,n,a;if(t={dtype:Ece.dtype},e=arguments.length,i=u,e===0)n=s0;else if(e===1&&(r=arguments[0],n=s0.factory(r),a=u0(t,r),a))throw a;return Sv(i,"seed",o),Sv(i,"seedLength",v),qce(i,"state",l,m),Sv(i,"stateLength",g),Sv(i,"byteLength",c),yce(i,"PRNG",n.PRNG),i;function u(h,p){var d,f,y,q,b;if(!pce(h))throw new TypeError(Oce("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",h));if(b={},arguments.length>1&&(y=u0(b,p),y))throw y;return q=b.dtype||t.dtype,q==="generic"?wce(h,n):(d=bce(q),f=new d(h),Sce([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}}o0.exports=_ce});var g0=s(function(hZe,v0){"use strict";var Nce=jc(),Lce=Nce();v0.exports=Lce});var l0=s(function(pZe,d0){"use strict";var Rce=require("@stdlib/utils/define-nonenumerable-read-only-property"),f0=g0(),Pce=jc();Rce(f0,"factory",Pce);d0.exports=f0});var m0=s(function(yZe,c0){"use strict";var Tce=require("@stdlib/math/base/special/sqrt"),jce=require("@stdlib/math/base/special/ln");function Mce(r,e){return e*Tce(-2*jce(r()))}c0.exports=Mce});var Mc=s(function(qZe,S0){"use strict";var ut=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ov=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),h0=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),xce=require("@stdlib/assert/is-positive-number").isPrimitive,p0=require("@stdlib/assert/is-plain-object"),y0=require("@stdlib/assert/is-function"),q0=require("@stdlib/assert/has-own-property"),b0=require("@stdlib/utils/constant-function"),Ace=require("@stdlib/utils/noop"),Ev=T().factory,Gce=require("@stdlib/math/base/assert/is-nan"),Vce=require("@stdlib/array/to-json"),_v=require("@stdlib/string/format"),w0=m0();function Fce(){var r,e,t,i;if(arguments.length===0)t=Ev();else if(arguments.length===1&&p0(arguments[0]))if(e=arguments[0],q0(e,"prng")){if(!y0(e.prng))throw new TypeError(_v("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));t=e.prng}else t=Ev(e);else{if(r=arguments[0],!xce(r))throw new TypeError(_v("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(arguments.length>1){if(e=arguments[1],!p0(e))throw new TypeError(_v("invalid argument. Options argument must be an object. Value: `%s`.",e));if(q0(e,"prng")){if(!y0(e.prng))throw new TypeError(_v("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));t=e.prng}else t=Ev(e)}else t=Ev()}return r===void 0?i=m:i=l,ut(i,"NAME","rayleigh"),e&&e.prng?(ut(i,"seed",null),ut(i,"seedLength",null),h0(i,"state",b0(null),Ace),ut(i,"stateLength",null),ut(i,"byteLength",null),ut(i,"toJSON",b0(null)),ut(i,"PRNG",t)):(Ov(i,"seed",n),Ov(i,"seedLength",a),h0(i,"state",v,g),Ov(i,"stateLength",u),Ov(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=Vce(t.state),r===void 0?h.params=[]:h.params=[r],h}function l(){return w0(t,r)}function m(h){return Gce(h)||h<=0?NaN:w0(t,h)}}S0.exports=Fce});var E0=s(function(bZe,O0){"use strict";var Wce=Mc(),Ice=Wce();O0.exports=Ice});var Ja=s(function(wZe,N0){"use strict";var kce=require("@stdlib/utils/define-nonenumerable-read-only-property"),_0=E0(),zce=Mc();kce(_0,"factory",zce);N0.exports=_0});var xc=s(function(SZe,L0){"use strict";var Jce=Vr(),Uce=require("@stdlib/array/dtypes"),Cce=require("@stdlib/array/defaults"),Bce=Ja(),Dce=Uce("real_floating_point_and_generic"),Xce=Jce(Bce,Dce,Cce.get("dtypes.real_floating_point"));L0.exports=Xce});var P0=s(function(OZe,R0){"use strict";var Yce=xc(),Hce=Yce();R0.exports=Hce});var M0=s(function(EZe,j0){"use strict";var Zce=require("@stdlib/utils/define-nonenumerable-read-only-property"),T0=P0(),Qce=xc();Zce(T0,"factory",Qce);j0.exports=T0});var Fc=s(function(_Ze,z0){"use strict";var jt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Nv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),x0=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Ua=require("@stdlib/assert/has-own-property"),A0=require("@stdlib/assert/is-positive-number").isPrimitive,G0=require("@stdlib/assert/is-plain-object"),Ac=require("@stdlib/assert/is-uint32array"),V0=require("@stdlib/assert/is-boolean").isPrimitive,$ce=require("@stdlib/math/base/assert/is-nan"),F0=require("@stdlib/assert/is-function"),W0=require("@stdlib/utils/constant-function"),Kce=require("@stdlib/utils/noop"),Lv=Ur().factory,Ca=Q().factory,Gc=require("@stdlib/blas/base/gcopy"),Vc=require("@stdlib/array/uint32"),I0=require("@stdlib/object/assign"),eme=require("@stdlib/array/to-json"),Xe=require("@stdlib/string/format"),k0=require("@stdlib/math/base/special/sqrt");function rme(){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(G0(arguments[0])){if(n=arguments[0],Ua(n,"copy")&&!V0(n.copy))throw new TypeError(Xe("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",n.copy));if(Ua(n,"prng")){if(!F0(n.prng))throw new TypeError(Xe("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")&&!Ac(n.state))throw new TypeError(Xe("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",n.state));n=I0({},n),n.copy===!1?u=!1:n.state&&(n.state=Gc(n.state.length,n.state,1,new Vc(n.state.length),1)),n.copy=!1,t=Ca(n)}}else{if(o=arguments[0],!A0(o))throw new TypeError(Xe("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],!A0(o))throw new TypeError(Xe("invalid argument. First argument must be a positive number. Value: `%s`.",o));if(n=arguments[1],!G0(n))throw new TypeError(Xe("invalid argument. Options argument must be an object. Value: `%s`.",n));if(Ua(n,"copy")&&!V0(n.copy))throw new TypeError(Xe("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",n.copy));if(Ua(n,"prng")){if(!F0(n.prng))throw new TypeError(Xe("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")&&!Ac(n.state))throw new TypeError(Xe("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",n.state));n=I0({},n),n.copy===!1?u=!1:n.state&&(n.state=Gc(n.state.length,n.state,1,new Vc(n.state.length),1)),n.copy=!1,t=Ca(n)}}return n&&n.prng?o===void 0?r=Lv({prng:n.prng}):r=Lv(o,{prng:n.prng}):(n.state?e=n.state:(e=t.state,t.state=e),o===void 0?r=Lv({state:e,copy:!1}):r=Lv(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),x0(a,"state",W0(null),Kce),jt(a,"stateLength",null),jt(a,"byteLength",null),jt(a,"toJSON",W0(null))):(Nv(a,"seed",v),Nv(a,"seedLength",g),x0(a,"state",m,h),Nv(a,"stateLength",c),Nv(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(!Ac(y))throw new TypeError(Xe("invalid argument. Must provide a Uint32Array. Value: `%s`.",y));u&&(y=Gc(y.length,y,1,new Vc(y.length),1)),i.state=y}function p(){var y={};return y.type="PRNG",y.name=a.NAME,y.state=eme(i.state),o===void 0?y.params=[]:y.params=[o],y}function d(){return t()/k0(r()/o)}function f(y){return $ce(y)||y<=0?NaN:t()/k0(r(y)/y)}}z0.exports=rme});var U0=s(function(NZe,J0){"use strict";var tme=Fc(),ime=tme();J0.exports=ime});var Ba=s(function(LZe,B0){"use strict";var nme=require("@stdlib/utils/define-nonenumerable-read-only-property"),C0=U0(),ame=Fc();nme(C0,"factory",ame);B0.exports=C0});var Wc=s(function(RZe,D0){"use strict";var sme=Vr(),ume=require("@stdlib/array/dtypes"),ome=require("@stdlib/array/defaults"),vme=Ba(),gme=ume("real_floating_point_and_generic"),fme=sme(vme,gme,ome.get("dtypes.real_floating_point"));D0.exports=fme});var Y0=s(function(PZe,X0){"use strict";var dme=Wc(),lme=dme();X0.exports=lme});var Q0=s(function(TZe,Z0){"use strict";var cme=require("@stdlib/utils/define-nonenumerable-read-only-property"),H0=Y0(),mme=Wc();cme(H0,"factory",mme);Z0.exports=H0});var K0=s(function(jZe,$0){"use strict";var Ic=require("@stdlib/assert/is-number").isPrimitive,Rv=require("@stdlib/string/format"),kc=require("@stdlib/assert/is-nan");function hme(r,e,t){return!Ic(r)||kc(r)?new TypeError(Rv("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):!Ic(e)||kc(e)?new TypeError(Rv("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e)):!Ic(t)||kc(t)?new TypeError(Rv("invalid argument. Third argument must be a number and not NaN. Value: `%s`.",t)):r<=t&&t<=e?null:new RangeError(Rv("invalid arguments. Parameters must satisfy the following condition: %s. a: `%f`. b: `%f`. c: `%f`.","a <= c <= b",r,e,t))}$0.exports=hme});var tM=s(function(MZe,rM){"use strict";var eM=require("@stdlib/math/base/special/sqrt");function pme(r,e,t,i){var n,a,u;return n=(i-e)/(t-e),u=r(),u3){if(r=arguments[3],!nM(r))throw new TypeError(jv("invalid argument. Options argument must be an object. Value: `%s`.",r));if(sM(r,"prng")){if(!aM(r.prng))throw new TypeError(jv("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=Tv(r)}else e=Tv()}return n===void 0?t=d:t=p,ot(t,"NAME","triangular"),r&&r.prng?(ot(t,"seed",null),ot(t,"seedLength",null),iM(t,"state",uM(null),yme),ot(t,"stateLength",null),ot(t,"byteLength",null),ot(t,"toJSON",uM(null)),ot(t,"PRNG",e)):(Pv(t,"seed",o),Pv(t,"seedLength",v),iM(t,"state",l,m),Pv(t,"stateLength",g),Pv(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=qme(e.state),n===void 0?f.params=[]:f.params=[n,a,u],f}function p(){return oM(e,n,a,u)}function d(f,y,q){return zc(f)||zc(y)||zc(q)||!(f<=q&&q<=y)?NaN:oM(e,f,y,q)}}vM.exports=wme});var fM=s(function(AZe,gM){"use strict";var Sme=Jc(),Ome=Sme();gM.exports=Ome});var Da=s(function(GZe,lM){"use strict";var Eme=require("@stdlib/utils/define-nonenumerable-read-only-property"),dM=fM(),_me=Jc();Eme(dM,"factory",_me);lM.exports=dM});var Uc=s(function(VZe,cM){"use strict";var Nme=qo(),Lme=require("@stdlib/array/dtypes"),Rme=require("@stdlib/array/defaults"),Pme=Da(),Tme=Lme("real_floating_point_and_generic"),jme=Nme(Pme,Tme,Rme.get("dtypes.real_floating_point"));cM.exports=jme});var hM=s(function(FZe,mM){"use strict";var Mme=Uc(),xme=Mme();mM.exports=xme});var qM=s(function(WZe,yM){"use strict";var Ame=require("@stdlib/utils/define-nonenumerable-read-only-property"),pM=hM(),Gme=Uc();Ame(pM,"factory",Gme);yM.exports=pM});var OM=s(function(IZe,SM){"use strict";var bM=require("@stdlib/assert/is-number").isPrimitive,Cc=require("@stdlib/string/format"),wM=require("@stdlib/assert/is-nan");function Vme(r,e){return!bM(r)||wM(r)?new TypeError(Cc("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r)):!bM(e)||wM(e)?new TypeError(Cc("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e)):r>=e?new RangeError(Cc("invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.",r,e)):null}SM.exports=Vme});var _M=s(function(kZe,EM){"use strict";function Fme(r,e,t){var i=r();return t*i+(1-i)*e}EM.exports=Fme});var Bc=s(function(zZe,xM){"use strict";var vt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Mv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),NM=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),LM=require("@stdlib/assert/is-plain-object"),RM=require("@stdlib/assert/is-function"),PM=require("@stdlib/assert/has-own-property"),TM=require("@stdlib/utils/constant-function"),Wme=require("@stdlib/utils/noop"),xv=T().factory,jM=require("@stdlib/math/base/assert/is-nan"),Ime=require("@stdlib/array/to-json"),Av=require("@stdlib/string/format"),kme=OM(),MM=_M();function zme(){var r,e,t,i,n,a;if(arguments.length===0)e=xv();else if(arguments.length===1){if(r=arguments[0],!LM(r))throw new TypeError(Av("invalid argument. Options argument must be an object. Value: `%s`.",r));if(PM(r,"prng")){if(!RM(r.prng))throw new TypeError(Av("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=xv(r)}else{if(n=arguments[0],a=arguments[1],i=kme(n,a),i)throw i;if(arguments.length>2){if(r=arguments[2],!LM(r))throw new TypeError(Av("invalid argument. Options argument must be an object. Value: `%s`.",r));if(PM(r,"prng")){if(!RM(r.prng))throw new TypeError(Av("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else e=xv(r)}else e=xv()}return n===void 0?t=p:t=h,vt(t,"NAME","uniform"),r&&r.prng?(vt(t,"seed",null),vt(t,"seedLength",null),NM(t,"state",TM(null),Wme),vt(t,"stateLength",null),vt(t,"byteLength",null),vt(t,"toJSON",TM(null)),vt(t,"PRNG",e)):(Mv(t,"seed",u),Mv(t,"seedLength",o),NM(t,"state",c,l),Mv(t,"stateLength",v),Mv(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=Ime(e.state),n===void 0?d.params=[]:d.params=[n,a],d}function h(){return MM(e,n,a)}function p(d,f){return jM(d)||jM(f)||d>=f?NaN:MM(e,d,f)}}xM.exports=zme});var GM=s(function(JZe,AM){"use strict";var Jme=Bc(),Ume=Jme();AM.exports=Ume});var hn=s(function(UZe,FM){"use strict";var Cme=require("@stdlib/utils/define-nonenumerable-read-only-property"),VM=GM(),Bme=Bc();Cme(VM,"factory",Bme);FM.exports=VM});var Dc=s(function(CZe,WM){"use strict";var Dme=F(),Xme=require("@stdlib/array/dtypes"),Yme=require("@stdlib/array/defaults"),Hme=hn(),Zme=Xme("real_floating_point_and_generic"),Qme=Dme(Hme,Zme,Yme.get("dtypes.real_floating_point"));WM.exports=Qme});var kM=s(function(BZe,IM){"use strict";var $me=Dc(),Kme=$me();IM.exports=Kme});var UM=s(function(DZe,JM){"use strict";var ehe=require("@stdlib/utils/define-nonenumerable-read-only-property"),zM=kM(),rhe=Dc();ehe(zM,"factory",rhe);JM.exports=zM});var XM=s(function(XZe,DM){"use strict";var CM=require("@stdlib/assert/is-positive-number").isPrimitive,BM=require("@stdlib/string/format");function the(r,e){return CM(r)?CM(e)?null:new TypeError(BM("invalid argument. Shape parameter must be a positive number. Value: `%s`.",e)):new TypeError(BM("invalid argument. Scale parameter must be a positive number. Value: `%s`.",r))}DM.exports=the});var HM=s(function(YZe,YM){"use strict";var ihe=require("@stdlib/math/base/special/pow"),nhe=require("@stdlib/math/base/special/ln");function ahe(r,e,t){return t*ihe(-nhe(1-r()),1/e)}YM.exports=ahe});var Xc=s(function(HZe,ix){"use strict";var gt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Gv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),ZM=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),QM=require("@stdlib/assert/is-plain-object"),$M=require("@stdlib/assert/is-function"),KM=require("@stdlib/assert/has-own-property"),ex=require("@stdlib/utils/constant-function"),she=require("@stdlib/utils/noop"),Vv=T().factory,rx=require("@stdlib/math/base/assert/is-nan"),uhe=require("@stdlib/array/to-json"),Fv=require("@stdlib/string/format"),ohe=XM(),tx=HM();function vhe(){var r,e,t,i,n,a;if(arguments.length===0)t=Vv();else if(arguments.length===1){if(e=arguments[0],!QM(e))throw new TypeError(Fv("invalid argument. Options argument must be an object. Value: `%s`.",e));if(KM(e,"prng")){if(!$M(e.prng))throw new TypeError(Fv("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));t=e.prng}else t=Vv(e)}else{if(a=arguments[0],r=arguments[1],n=ohe(r,a),n)throw n;if(arguments.length>2){if(e=arguments[2],!QM(e))throw new TypeError(Fv("invalid argument. Options argument must be an object. Value: `%s`.",e));if(KM(e,"prng")){if(!$M(e.prng))throw new TypeError(Fv("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",e.prng));t=e.prng}else t=Vv(e)}else t=Vv()}return r===void 0?i=p:i=h,gt(i,"NAME","weibull"),e&&e.prng?(gt(i,"seed",null),gt(i,"seedLength",null),ZM(i,"state",ex(null),she),gt(i,"stateLength",null),gt(i,"byteLength",null),gt(i,"toJSON",ex(null)),gt(i,"PRNG",t)):(Gv(i,"seed",u),Gv(i,"seedLength",o),ZM(i,"state",c,l),Gv(i,"stateLength",v),Gv(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=uhe(t.state),a===void 0?d.params=[]:d.params=[a,r],d}function h(){return tx(t,a,r)}function p(d,f){return rx(d)||rx(f)||d<=0||f<=0?NaN:tx(t,d,f)}}ix.exports=vhe});var ax=s(function(ZZe,nx){"use strict";var ghe=Xc(),fhe=ghe();nx.exports=fhe});var pn=s(function(QZe,ux){"use strict";var dhe=require("@stdlib/utils/define-nonenumerable-read-only-property"),sx=ax(),lhe=Xc();dhe(sx,"factory",lhe);ux.exports=sx});var Yc=s(function($Ze,ox){"use strict";var che=F(),mhe=require("@stdlib/array/dtypes"),hhe=require("@stdlib/array/defaults"),phe=pn(),yhe=mhe("real_floating_point_and_generic"),qhe=che(phe,yhe,hhe.get("dtypes.real_floating_point"));ox.exports=qhe});var gx=s(function(KZe,vx){"use strict";var bhe=Yc(),whe=bhe();vx.exports=whe});var lx=s(function(eQe,dx){"use strict";var She=require("@stdlib/utils/define-nonenumerable-read-only-property"),fx=gx(),Ohe=Yc();She(fx,"factory",Ohe);dx.exports=fx});var mx=s(function(rQe,cx){"use strict";var M=require("@stdlib/utils/define-read-only-property"),j={};M(j,"arcsine",ey());M(j,"bernoulli",Ty());M(j,"beta",Vq());M(j,"betaprime",Nb());M(j,"binomial",tw());M(j,"cauchy",_w());M(j,"chi",$w());M(j,"chisquare",nS());M(j,"cosine",LS());M(j,"discreteUniform",$S());M(j,"erlang",wO());M(j,"exponential",kO());M(j,"f",gE());M(j,"frechet",DE());M(j,"gamma",$E());M(j,"geometric",y_());M(j,"gumbel",J_());M(j,"hypergeometric",dN());M(j,"invgamma",xN());M(j,"kumaraswamy",nL());M(j,"laplace",LL());M(j,"levy",ZL());M(j,"logistic",qR());M(j,"lognormal",JR());M(j,"minstd",mP());M(j,"minstdShuffle",BP());M(j,"mt19937",oT());M(j,"negativeBinomial",XT());M(j,"normal",hj());M(j,"pareto1",kj());M(j,"poisson",Dj());M(j,"randu",l0());M(j,"rayleigh",M0());M(j,"t",Q0());M(j,"triangular",qM());M(j,"uniform",UM());M(j,"weibull",lx());cx.exports=j});var px=s(function(tQe,hx){"use strict";var Ehe=require("@stdlib/math/base/special/sqrt"),_he=require("@stdlib/math/base/special/ln"),Nhe=require("@stdlib/math/base/special/sin"),Lhe=require("@stdlib/math/base/special/cos"),Rhe=require("@stdlib/constants/float64/two-pi");function Phe(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=Ehe(-2*_he(n)),o=Rhe*a,t=u*Lhe(o),e=!1,u*Nhe(o)}return e=!0,t}}hx.exports=Phe});var qx=s(function(iQe,yx){"use strict";var The=require("@stdlib/math/base/special/sqrt"),jhe=require("@stdlib/math/base/special/ln"),Mhe=require("@stdlib/math/base/special/cos"),xhe=require("@stdlib/constants/float64/pi"),Ahe=Mhe(xhe);function Ghe(r){var e=The(-2*jhe(r));return e*Ahe}yx.exports=Ghe});var wx=s(function(nQe,bx){"use strict";var Vhe=require("@stdlib/math/base/special/sqrt"),Fhe=require("@stdlib/math/base/special/ln"),Whe=require("@stdlib/math/base/special/cos"),Ihe=require("@stdlib/constants/float64/two-pi");function khe(r){var e=Vhe(-2*Fhe(r)),t=Ihe*r;return e*Whe(t)}bx.exports=khe});var Hc=s(function(aQe,_x){"use strict";var re=require("@stdlib/utils/define-nonenumerable-read-only-property"),Wv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Sx=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),zhe=require("@stdlib/assert/is-plain-object"),Jhe=require("@stdlib/assert/is-function"),Uhe=require("@stdlib/assert/is-boolean").isPrimitive,du=require("@stdlib/assert/has-own-property"),Che=require("@stdlib/assert/is-uint32array"),Ox=T().factory,Ex=require("@stdlib/utils/constant-function"),Bhe=require("@stdlib/utils/noop"),Dhe=require("@stdlib/array/to-json"),lu=require("@stdlib/string/format"),Xhe=px(),Yhe=qx(),Hhe=wx();function Zhe(r){var e,t,i,n;if(n={copy:!0},arguments.length){if(!zhe(r))throw new TypeError(lu("invalid argument. Must provide an object. Value: `%s`.",r));if(du(r,"copy")&&(n.copy=r.copy,!Uhe(r.copy)))throw new TypeError(lu("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",r.copy));if(du(r,"prng")){if(!Jhe(r.prng))throw new TypeError(lu("invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.","prng",r.prng));e=r.prng}else if(du(r,"state")){if(n.state=r.state,!Che(r.state))throw new TypeError(lu("invalid option. `%s` option must be a Uint32Array. Option: `%s`.","state",r.state))}else if(du(r,"seed")&&(n.seed=r.seed,r.seed===void 0))throw new TypeError(lu("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=Ox(n),e=i.normalized):n.seed=null:(i=Ox(n),e=i.normalized),t=Xhe(e),re(t,"NAME","box-muller"),n.seed===null?(re(t,"seed",null),re(t,"seedLength",null)):(Wv(t,"seed",a),Wv(t,"seedLength",u)),r&&r.prng?(Sx(t,"state",Ex(null),Bhe),re(t,"stateLength",null),re(t,"byteLength",null),re(t,"toJSON",Ex(null))):(Sx(t,"state",g,c),Wv(t,"stateLength",o),Wv(t,"byteLength",v),re(t,"toJSON",l)),re(t,"PRNG",e),du(e,"MIN")?(re(t,"MIN",Yhe(e.MIN)),re(t,"MAX",Hhe(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=Dhe(i.state),m.params=[],m}}_x.exports=Zhe});var Lx=s(function(sQe,Nx){"use strict";var Qhe=Hc(),$he=Qhe();Nx.exports=$he});var Xa=s(function(uQe,Px){"use strict";var Khe=require("@stdlib/utils/define-nonenumerable-read-only-property"),Rx=Lx(),epe=Hc();Khe(Rx,"factory",epe);Px.exports=Rx});var Tx=s(function(oQe,rpe){rpe.exports={name:"mt19937",copy:!0}});var Mx=s(function(vQe,jx){"use strict";var tpe=$(),ipe=ee(),npe=T(),Iv={};Iv.minstd=tpe;Iv["minstd-shuffle"]=ipe;Iv.mt19937=npe;jx.exports=Iv});var Zc=s(function(gQe,Ax){"use strict";var cu=require("@stdlib/utils/define-nonenumerable-read-only-property"),kv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),ape=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),spe=require("@stdlib/assert/is-plain-object"),upe=require("@stdlib/assert/is-boolean").isPrimitive,zv=require("@stdlib/assert/has-own-property"),ope=require("@stdlib/array/to-json"),mu=require("@stdlib/string/format"),xx=Tx(),vpe=Mx();function gpe(r){var e,t,i;if(e={name:xx.name,copy:xx.copy},arguments.length){if(!spe(r))throw new TypeError(mu("invalid argument. Must provide an object. Value: `%s`.",r));if(zv(r,"name")&&(e.name=r.name),zv(r,"state")){if(e.state=r.state,e.state===void 0)throw new TypeError(mu("invalid option. `%s` option cannot be undefined. Option: `%s`.","state",e.state))}else if(zv(r,"seed")&&(e.seed=r.seed,e.seed===void 0))throw new TypeError(mu("invalid option. `%s` option cannot be undefined. Option: `%s`.","seed",e.seed));if(zv(r,"copy")&&(e.copy=r.copy,!upe(e.copy)))throw new TypeError(mu("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",e.copy))}if(i=vpe[e.name],i===void 0)throw new Error(mu("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}),cu(l,"NAME","randi"),kv(l,"seed",n),kv(l,"seedLength",a),ape(l,"state",v,g),kv(l,"stateLength",u),kv(l,"byteLength",o),cu(l,"toJSON",c),cu(l,"PRNG",t),cu(l,"MIN",t.MIN),cu(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=ope(t.state),m.params=[],m}function l(){return t()}}Ax.exports=gpe});var Vx=s(function(fQe,Gx){"use strict";var fpe=Zc(),dpe=fpe();Gx.exports=dpe});var hu=s(function(dQe,Wx){"use strict";var lpe=require("@stdlib/utils/define-nonenumerable-read-only-property"),Fx=Vx(),cpe=Zc();lpe(Fx,"factory",cpe);Wx.exports=Fx});var Ix=s(function(lQe,mpe){mpe.exports={name:"improved-ziggurat",copy:!0}});var zx=s(function(cQe,kx){"use strict";var hpe=Xa(),ppe=Q(),Qc={};Qc["box-muller"]=hpe;Qc["improved-ziggurat"]=ppe;kx.exports=Qc});var $c=s(function(mQe,Bx){"use strict";var Mt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Jv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Jx=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),ype=require("@stdlib/assert/is-plain-object"),qpe=require("@stdlib/assert/is-boolean").isPrimitive,pu=require("@stdlib/assert/has-own-property"),Ux=require("@stdlib/utils/constant-function"),Ya=require("@stdlib/string/format"),bpe=require("@stdlib/utils/noop"),wpe=require("@stdlib/array/to-json"),Cx=Ix(),Spe=zx();function Ope(r){var e,t,i;if(e={name:Cx.name,copy:Cx.copy},arguments.length){if(!ype(r))throw new TypeError(Ya("invalid argument. Must provide an object. Value: `%s`.",r));if(pu(r,"name")&&(e.name=r.name),pu(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(pu(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(pu(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(pu(r,"copy")&&(e.copy=r.copy,!qpe(e.copy)))throw new TypeError(Ya("invalid option. `%s` option must be a boolean. Option: `%s`.","copy",e.copy))}if(i=Spe[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),Jx(l,"state",Ux(null),bpe),Mt(l,"stateLength",null),Mt(l,"byteLength",null),Mt(l,"toJSON",Ux(null))):(Jv(l,"seed",n),Jv(l,"seedLength",a),Jx(l,"state",v,g),Jv(l,"stateLength",u),Jv(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=wpe(t.state),m.params=[],m}function l(){return t()}}Bx.exports=Ope});var Xx=s(function(hQe,Dx){"use strict";var Epe=$c(),_pe=Epe();Dx.exports=_pe});var yu=s(function(pQe,Hx){"use strict";var Npe=require("@stdlib/utils/define-nonenumerable-read-only-property"),Yx=Xx(),Lpe=$c();Npe(Yx,"factory",Lpe);Hx.exports=Yx});var Qx=s(function(yQe,Zx){"use strict";var Rpe=nn(),Ppe=an(),Tpe=un(),jpe=on(),Mpe=da(),xpe=Xa(),Ape=ca(),Gpe=pa(),Vpe=Ur(),Fpe=vn(),Wpe=gn(),Ipe=ba(),kpe=fn(),zpe=Sa(),Jpe=Ea(),Upe=Ce(),Cpe=_a(),Bpe=Na(),Dpe=La(),Xpe=Q(),Ype=dn(),Hpe=Pa(),Zpe=Ta(),Qpe=ja(),$pe=Ma(),Kpe=ln(),eye=$(),rye=ee(),tye=T(),iye=Ia(),nye=mn(),aye=za(),sye=cn(),uye=hu(),oye=yu(),vye=Tt(),gye=Ja(),fye=Ba(),dye=Da(),lye=hn(),cye=pn(),E={};E.arcsine=Rpe.factory;E.bernoulli=Ppe.factory;E.beta=Tpe.factory;E.betaprime=jpe.factory;E.binomial=Mpe.factory;E["box-muller"]=xpe.factory;E.cauchy=Ape.factory;E.chi=Gpe.factory;E.chisquare=Vpe.factory;E.cosine=Fpe.factory;E["discrete-uniform"]=Wpe.factory;E.erlang=Ipe.factory;E.exponential=kpe.factory;E.f=zpe.factory;E.frechet=Jpe.factory;E.gamma=Upe.factory;E.geometric=Cpe.factory;E.gumbel=Bpe.factory;E.hypergeometric=Dpe.factory;E["improved-ziggurat"]=Xpe.factory;E.invgamma=Ype.factory;E.kumaraswamy=Hpe.factory;E.laplace=Zpe.factory;E.levy=Qpe.factory;E.logistic=$pe.factory;E.lognormal=Kpe.factory;E.minstd=eye.factory;E["minstd-shuffle"]=rye.factory;E.mt19937=tye.factory;E["negative-binomial"]=iye.factory;E.normal=nye.factory;E["pareto-type1"]=aye.factory;E.poisson=sye.factory;E.randi=uye.factory;E.randn=oye.factory;E.randu=vye.factory;E.rayleigh=gye.factory;E.t=fye.factory;E.triangular=dye.factory;E.uniform=lye.factory;E.weibull=cye.factory;Zx.exports=E});var t1=s(function(qQe,r1){"use strict";var $x=require("@stdlib/assert/is-string").isPrimitive,mye=require("@stdlib/assert/is-plain-object"),Kx=require("@stdlib/assert/is-array"),hye=require("@stdlib/assert/contains"),pye=require("@stdlib/array/int32"),yye=require("@stdlib/array/uint32"),e1=Qx(),qye={Int32Array:pye,Uint32Array:yye},bye=["randi","randn","randu"];function wye(r,e){var t,i,n,a,u;if(e&&e.type==="PRNG"&&$x(e.name)&&mye(e.state)&&Kx(e.params)&&$x(e.state.type)&&Kx(e.state.data)&&(i={},t=e1[e.name],t===void 0&&(u=e.name.split("-"),hye(bye,u[0])&&(t=e1[u[0]],i.name=u.slice(1).join("-"))),t&&(a=qye[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}r1.exports=wye});var n1=s(function(bQe,i1){"use strict";var Sye=t1();i1.exports=Sye});var s1=s(function(wQe,a1){"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",da());_(O,"boxMuller",Xa());_(O,"cauchy",ca());_(O,"chi",pa());_(O,"chisquare",Ur());_(O,"cosine",vn());_(O,"discreteUniform",gn());_(O,"erlang",ba());_(O,"exponential",fn());_(O,"f",Sa());_(O,"frechet",Ea());_(O,"gamma",Ce());_(O,"geometric",_a());_(O,"gumbel",Na());_(O,"hypergeometric",La());_(O,"improvedZiggurat",Q());_(O,"invgamma",dn());_(O,"kumaraswamy",Pa());_(O,"laplace",Ta());_(O,"levy",ja());_(O,"logistic",Ma());_(O,"lognormal",ln());_(O,"minstd",$());_(O,"minstdShuffle",ee());_(O,"mt19937",T());_(O,"negativeBinomial",Ia());_(O,"normal",mn());_(O,"pareto1",za());_(O,"poisson",cn());_(O,"randi",hu());_(O,"randn",yu());_(O,"randu",Tt());_(O,"rayleigh",Ja());_(O,"reviveBasePRNG",n1());_(O,"t",Ba());_(O,"triangular",Da());_(O,"uniform",hn());_(O,"weibull",pn());a1.exports=O});var m1=s(function(SQe,c1){"use strict";var xt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Uv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),u1=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Oye=require("@stdlib/utils/constant-function"),Eye=require("@stdlib/utils/noop"),_ye=require("@stdlib/object/assign"),o1=require("@stdlib/assert/is-number").isPrimitive,v1=require("@stdlib/math/base/assert/is-nan"),Nye=require("@stdlib/assert/is-plain-object"),Lye=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Rye=require("@stdlib/assert/has-own-property"),g1=require("@stdlib/constants/float64/max"),f1=nn().factory,d1=require("@stdlib/symbol/iterator"),qu=require("@stdlib/string/format");function l1(r,e,t){var i,n,a,u,o;if(!o1(r)||v1(r))throw new TypeError(qu("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!o1(e)||v1(e))throw new TypeError(qu("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e));if(r>=e)throw new RangeError(qu("invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.",r,e));if(arguments.length>2){if(!Nye(t))throw new TypeError(qu("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=_ye({},t),Rye(i,"iter")){if(!Lye(i.iter))throw new TypeError(qu("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=g1;a=f1(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=f1(r,e),i={iter:g1,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),u1(n,"state",Oye(null),Eye),xt(n,"stateLength",null),xt(n,"byteLength",null)):(Uv(n,"seed",l),Uv(n,"seedLength",m),u1(n,"state",d,f),Uv(n,"stateLength",h),Uv(n,"byteLength",p)),xt(n,"PRNG",a.PRNG),d1&&xt(n,d1,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 l1(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}}c1.exports=l1});var p1=s(function(OQe,h1){"use strict";var Pye=m1();h1.exports=Pye});var E1=s(function(EQe,O1){"use strict";var At=require("@stdlib/utils/define-nonenumerable-read-only-property"),Cv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),y1=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Tye=require("@stdlib/utils/constant-function"),jye=require("@stdlib/utils/noop"),Mye=require("@stdlib/object/assign"),xye=require("@stdlib/assert/is-probability").isPrimitive,Aye=require("@stdlib/assert/is-plain-object"),Gye=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Vye=require("@stdlib/assert/has-own-property"),q1=require("@stdlib/constants/float64/max"),b1=an().factory,w1=require("@stdlib/symbol/iterator"),Kc=require("@stdlib/string/format");function S1(r,e){var t,i,n,a,u;if(!xye(r))throw new TypeError(Kc("invalid argument. First argument must be a probability. Value: `%s`.",r));if(arguments.length>1){if(!Aye(e))throw new TypeError(Kc("invalid argument. Options argument must be an object. Value: `%s`.",e));if(t=Mye({},e),Vye(t,"iter")){if(!Gye(t.iter))throw new TypeError(Kc("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=q1;n=b1(r,t),t.prng===void 0&&t.copy!==!1&&(t.state=n.state)}else n=b1(r),t={iter:q1,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),y1(i,"state",Tye(null),jye),At(i,"stateLength",null),At(i,"byteLength",null)):(Cv(i,"seed",c),Cv(i,"seedLength",l),y1(i,"state",p,d),Cv(i,"stateLength",m),Cv(i,"byteLength",h)),At(i,"PRNG",n.PRNG),w1&&At(i,w1,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 S1(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}}O1.exports=S1});var N1=s(function(_Qe,_1){"use strict";var Fye=E1();_1.exports=Fye});var A1=s(function(NQe,x1){"use strict";var Gt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Bv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),L1=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Wye=require("@stdlib/utils/constant-function"),Iye=require("@stdlib/utils/noop"),kye=require("@stdlib/object/assign"),R1=require("@stdlib/assert/is-positive-number").isPrimitive,zye=require("@stdlib/assert/is-plain-object"),Jye=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Uye=require("@stdlib/assert/has-own-property"),P1=require("@stdlib/constants/float64/max"),T1=un().factory,j1=require("@stdlib/symbol/iterator"),Dv=require("@stdlib/string/format");function M1(r,e,t){var i,n,a,u,o;if(!R1(r))throw new TypeError(Dv("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!R1(e))throw new TypeError(Dv("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!zye(t))throw new TypeError(Dv("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=kye({},t),Uye(i,"iter")){if(!Jye(i.iter))throw new TypeError(Dv("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=P1;a=T1(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=T1(r,e),i={iter:P1,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),L1(n,"state",Wye(null),Iye),Gt(n,"stateLength",null),Gt(n,"byteLength",null)):(Bv(n,"seed",l),Bv(n,"seedLength",m),L1(n,"state",d,f),Bv(n,"stateLength",h),Bv(n,"byteLength",p)),Gt(n,"PRNG",a.PRNG),j1&&Gt(n,j1,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 M1(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=M1});var V1=s(function(LQe,G1){"use strict";var Cye=A1();G1.exports=Cye});var C1=s(function(RQe,U1){"use strict";var Vt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Xv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),F1=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Bye=require("@stdlib/utils/constant-function"),Dye=require("@stdlib/utils/noop"),Xye=require("@stdlib/object/assign"),W1=require("@stdlib/assert/is-positive-number").isPrimitive,Yye=require("@stdlib/assert/is-plain-object"),Hye=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Zye=require("@stdlib/assert/has-own-property"),I1=require("@stdlib/constants/float64/max"),k1=on().factory,z1=require("@stdlib/symbol/iterator"),Yv=require("@stdlib/string/format");function J1(r,e,t){var i,n,a,u,o;if(!W1(r))throw new TypeError(Yv("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!W1(e))throw new TypeError(Yv("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!Yye(t))throw new TypeError(Yv("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=Xye({},t),Zye(i,"iter")){if(!Hye(i.iter))throw new TypeError(Yv("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=I1;a=k1(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=k1(r,e),i={iter:I1,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),F1(n,"state",Bye(null),Dye),Vt(n,"stateLength",null),Vt(n,"byteLength",null)):(Xv(n,"seed",l),Xv(n,"seedLength",m),F1(n,"state",d,f),Xv(n,"stateLength",h),Xv(n,"byteLength",p)),Vt(n,"PRNG",a.PRNG),z1&&Vt(n,z1,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 J1(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}}U1.exports=J1});var D1=s(function(PQe,B1){"use strict";var Qye=C1();B1.exports=Qye});var K1=s(function(TQe,$1){"use strict";var Ft=require("@stdlib/utils/define-nonenumerable-read-only-property"),Hv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),X1=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),$ye=require("@stdlib/utils/constant-function"),Kye=require("@stdlib/utils/noop"),eqe=require("@stdlib/object/assign"),rqe=require("@stdlib/assert/is-probability").isPrimitive,tqe=require("@stdlib/assert/is-plain-object"),iqe=require("@stdlib/assert/is-positive-integer").isPrimitive,nqe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,aqe=require("@stdlib/assert/has-own-property"),Y1=require("@stdlib/constants/float64/max"),H1=da().factory,Z1=require("@stdlib/symbol/iterator"),Zv=require("@stdlib/string/format");function Q1(r,e,t){var i,n,a,u,o;if(!iqe(r))throw new TypeError(Zv("invalid argument. First argument must be a positive integer. Value: `%s`.",r));if(!rqe(e))throw new TypeError(Zv("invalid argument. Second argument must be a probability. Value: `%s`.",e));if(arguments.length>2){if(!tqe(t))throw new TypeError(Zv("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=eqe({},t),aqe(i,"iter")){if(!nqe(i.iter))throw new TypeError(Zv("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=Y1;a=H1(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=H1(r,e),i={iter:Y1,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),X1(n,"state",$ye(null),Kye),Ft(n,"stateLength",null),Ft(n,"byteLength",null)):(Hv(n,"seed",l),Hv(n,"seedLength",m),X1(n,"state",d,f),Hv(n,"stateLength",h),Hv(n,"byteLength",p)),Ft(n,"PRNG",a.PRNG),Z1&&Ft(n,Z1,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 Q1(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}}$1.exports=Q1});var rA=s(function(jQe,eA){"use strict";var sqe=K1();eA.exports=sqe});var vA=s(function(MQe,oA){"use strict";var Wt=require("@stdlib/utils/define-nonenumerable-read-only-property"),Qv=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),tA=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),uqe=require("@stdlib/utils/constant-function"),oqe=require("@stdlib/utils/noop"),vqe=require("@stdlib/object/assign"),gqe=require("@stdlib/assert/is-plain-object"),fqe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,dqe=require("@stdlib/assert/has-own-property"),iA=require("@stdlib/constants/float64/max"),nA=Xa().factory,aA=require("@stdlib/symbol/iterator"),sA=require("@stdlib/string/format");function uA(r){var e,t,i,n,a;if(arguments.length>0){if(!gqe(r))throw new TypeError(sA("invalid argument. Options argument must be an object. Value: `%s`.",r));if(e=vqe({},r),dqe(e,"iter")){if(!fqe(e.iter))throw new TypeError(sA("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",e.iter))}else e.iter=iA;i=nA(e),e.prng===void 0&&e.copy!==!1&&(e.state=i.state)}else i=nA(),e={iter:iA,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),tA(t,"state",uqe(null),oqe),Wt(t,"stateLength",null),Wt(t,"byteLength",null)):(Qv(t,"seed",g),Qv(t,"seedLength",c),tA(t,"state",h,p),Qv(t,"stateLength",l),Qv(t,"byteLength",m)),Wt(t,"PRNG",i.PRNG),aA&&Wt(t,aA,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 uA(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}}oA.exports=uA});var fA=s(function(xQe,gA){"use strict";var lqe=vA();gA.exports=lqe});var yA=s(function(AQe,pA){"use strict";var It=require("@stdlib/utils/define-nonenumerable-read-only-property"),$v=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),dA=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),cqe=require("@stdlib/utils/constant-function"),mqe=require("@stdlib/utils/noop"),hqe=require("@stdlib/object/assign"),pqe=require("@stdlib/assert/is-number").isPrimitive,yqe=require("@stdlib/math/base/assert/is-nan"),qqe=require("@stdlib/assert/is-plain-object"),bqe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,wqe=require("@stdlib/assert/is-positive-number").isPrimitive,Sqe=require("@stdlib/assert/has-own-property"),lA=require("@stdlib/constants/float64/max"),cA=ca().factory,mA=require("@stdlib/symbol/iterator"),Kv=require("@stdlib/string/format");function hA(r,e,t){var i,n,a,u,o;if(!pqe(r)||yqe(r))throw new TypeError(Kv("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!wqe(e))throw new TypeError(Kv("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!qqe(t))throw new TypeError(Kv("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=hqe({},t),Sqe(i,"iter")){if(!bqe(i.iter))throw new TypeError(Kv("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=lA;a=cA(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=cA(r,e),i={iter:lA,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),dA(n,"state",cqe(null),mqe),It(n,"stateLength",null),It(n,"byteLength",null)):($v(n,"seed",l),$v(n,"seedLength",m),dA(n,"state",d,f),$v(n,"stateLength",h),$v(n,"byteLength",p)),It(n,"PRNG",a.PRNG),mA&&It(n,mA,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 hA(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}}pA.exports=hA});var bA=s(function(GQe,qA){"use strict";var Oqe=yA();qA.exports=Oqe});var LA=s(function(VQe,NA){"use strict";var kt=require("@stdlib/utils/define-nonenumerable-read-only-property"),eg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),wA=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Eqe=require("@stdlib/utils/constant-function"),_qe=require("@stdlib/utils/noop"),Nqe=require("@stdlib/object/assign"),Lqe=require("@stdlib/assert/is-positive-number").isPrimitive,Rqe=require("@stdlib/assert/is-plain-object"),Pqe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Tqe=require("@stdlib/assert/has-own-property"),SA=require("@stdlib/constants/float64/max"),OA=pa().factory,EA=require("@stdlib/symbol/iterator"),em=require("@stdlib/string/format");function _A(r,e){var t,i,n,a,u;if(!Lqe(r))throw new TypeError(em("invalid argument. First argument must be a positive number. 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=Nqe({},e),Tqe(t,"iter")){if(!Pqe(t.iter))throw new TypeError(em("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=SA;n=OA(r,t),t.prng===void 0&&t.copy!==!1&&(t.state=n.state)}else n=OA(r),t={iter:SA,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),wA(i,"state",Eqe(null),_qe),kt(i,"stateLength",null),kt(i,"byteLength",null)):(eg(i,"seed",c),eg(i,"seedLength",l),wA(i,"state",p,d),eg(i,"stateLength",m),eg(i,"byteLength",h)),kt(i,"PRNG",n.PRNG),EA&&kt(i,EA,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 _A(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}}NA.exports=_A});var PA=s(function(FQe,RA){"use strict";var jqe=LA();RA.exports=jqe});var VA=s(function(WQe,GA){"use strict";var zt=require("@stdlib/utils/define-nonenumerable-read-only-property"),rg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),TA=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Mqe=require("@stdlib/utils/constant-function"),xqe=require("@stdlib/utils/noop"),Aqe=require("@stdlib/object/assign"),Gqe=require("@stdlib/assert/is-positive-number").isPrimitive,Vqe=require("@stdlib/assert/is-plain-object"),Fqe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Wqe=require("@stdlib/assert/has-own-property"),jA=require("@stdlib/constants/float64/max"),MA=Ur().factory,xA=require("@stdlib/symbol/iterator"),rm=require("@stdlib/string/format");function AA(r,e){var t,i,n,a,u;if(!Gqe(r))throw new TypeError(rm("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(arguments.length>1){if(!Vqe(e))throw new TypeError(rm("invalid argument. Options argument must be an object. Value: `%s`.",e));if(t=Aqe({},e),Wqe(t,"iter")){if(!Fqe(t.iter))throw new TypeError(rm("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=jA;n=MA(r,t),t.prng===void 0&&t.copy!==!1&&(t.state=n.state)}else n=MA(r),t={iter:jA,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),TA(i,"state",Mqe(null),xqe),zt(i,"stateLength",null),zt(i,"byteLength",null)):(rg(i,"seed",c),rg(i,"seedLength",l),TA(i,"state",p,d),rg(i,"stateLength",m),rg(i,"byteLength",h)),zt(i,"PRNG",n.PRNG),xA&&zt(i,xA,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 AA(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}}GA.exports=AA});var WA=s(function(IQe,FA){"use strict";var Iqe=VA();FA.exports=Iqe});var BA=s(function(kQe,CA){"use strict";var Jt=require("@stdlib/utils/define-nonenumerable-read-only-property"),tg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),IA=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),kqe=require("@stdlib/utils/constant-function"),zqe=require("@stdlib/utils/noop"),Jqe=require("@stdlib/object/assign"),Uqe=require("@stdlib/assert/is-number").isPrimitive,Cqe=require("@stdlib/math/base/assert/is-nan"),Bqe=require("@stdlib/assert/is-plain-object"),Dqe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Xqe=require("@stdlib/assert/is-positive-number").isPrimitive,Yqe=require("@stdlib/assert/has-own-property"),kA=require("@stdlib/constants/float64/max"),zA=vn().factory,JA=require("@stdlib/symbol/iterator"),ig=require("@stdlib/string/format");function UA(r,e,t){var i,n,a,u,o;if(!Uqe(r)||Cqe(r))throw new TypeError(ig("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!Xqe(e))throw new TypeError(ig("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!Bqe(t))throw new TypeError(ig("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=Jqe({},t),Yqe(i,"iter")){if(!Dqe(i.iter))throw new TypeError(ig("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=kA;a=zA(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=zA(r,e),i={iter:kA,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),IA(n,"state",kqe(null),zqe),Jt(n,"stateLength",null),Jt(n,"byteLength",null)):(tg(n,"seed",l),tg(n,"seedLength",m),IA(n,"state",d,f),tg(n,"stateLength",h),tg(n,"byteLength",p)),Jt(n,"PRNG",a.PRNG),JA&&Jt(n,JA,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 UA(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}}CA.exports=UA});var XA=s(function(zQe,DA){"use strict";var Hqe=BA();DA.exports=Hqe});var rG=s(function(JQe,eG){"use strict";var Ut=require("@stdlib/utils/define-nonenumerable-read-only-property"),ng=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),YA=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Zqe=require("@stdlib/utils/constant-function"),Qqe=require("@stdlib/utils/noop"),$qe=require("@stdlib/object/assign"),HA=require("@stdlib/assert/is-number").isPrimitive,Kqe=require("@stdlib/assert/is-plain-object"),ebe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,rbe=require("@stdlib/assert/has-own-property"),ZA=require("@stdlib/constants/float64/max"),QA=gn().factory,$A=require("@stdlib/symbol/iterator"),bu=require("@stdlib/string/format");function KA(r,e,t){var i,n,a,u,o;if(!HA(r))throw new TypeError(bu("invalid argument. First argument must be an integer. Value: `%s`.",r));if(!HA(e))throw new TypeError(bu("invalid argument. Second argument must be an integer. Value: `%s`.",e));if(r>e)throw new RangeError(bu("invalid argument. Minimum support must be less than or equal to maximum support. Value: `[%d,%d]`.",r,e));if(arguments.length>2){if(!Kqe(t))throw new TypeError(bu("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=$qe({},t),rbe(i,"iter")){if(!ebe(i.iter))throw new TypeError(bu("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=ZA;a=QA(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=QA(r,e),i={iter:ZA,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),YA(n,"state",Zqe(null),Qqe),Ut(n,"stateLength",null),Ut(n,"byteLength",null)):(ng(n,"seed",l),ng(n,"seedLength",m),YA(n,"state",d,f),ng(n,"stateLength",h),ng(n,"byteLength",p)),Ut(n,"PRNG",a.PRNG),$A&&Ut(n,$A,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 KA(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}}eG.exports=KA});var iG=s(function(UQe,tG){"use strict";var tbe=rG();tG.exports=tbe});var gG=s(function(CQe,vG){"use strict";var Ct=require("@stdlib/utils/define-nonenumerable-read-only-property"),ag=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),nG=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),ibe=require("@stdlib/utils/constant-function"),nbe=require("@stdlib/utils/noop"),abe=require("@stdlib/object/assign"),sbe=require("@stdlib/assert/is-positive-number").isPrimitive,ube=require("@stdlib/assert/is-plain-object"),obe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,vbe=require("@stdlib/assert/is-positive-integer").isPrimitive,gbe=require("@stdlib/assert/has-own-property"),aG=require("@stdlib/constants/float64/max"),sG=ba().factory,uG=require("@stdlib/symbol/iterator"),sg=require("@stdlib/string/format");function oG(r,e,t){var i,n,a,u,o;if(!vbe(r))throw new TypeError(sg("invalid argument. First argument must be a positive integer. Value: `%s`.",r));if(!sbe(e))throw new TypeError(sg("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!ube(t))throw new TypeError(sg("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=abe({},t),gbe(i,"iter")){if(!obe(i.iter))throw new TypeError(sg("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=aG;a=sG(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=sG(r,e),i={iter:aG,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),nG(n,"state",ibe(null),nbe),Ct(n,"stateLength",null),Ct(n,"byteLength",null)):(ag(n,"seed",l),ag(n,"seedLength",m),nG(n,"state",d,f),ag(n,"stateLength",h),ag(n,"byteLength",p)),Ct(n,"PRNG",a.PRNG),uG&&Ct(n,uG,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 oG(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}}vG.exports=oG});var dG=s(function(BQe,fG){"use strict";var fbe=gG();fG.exports=fbe});var qG=s(function(DQe,yG){"use strict";var Bt=require("@stdlib/utils/define-nonenumerable-read-only-property"),ug=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),lG=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),dbe=require("@stdlib/utils/constant-function"),lbe=require("@stdlib/utils/noop"),cbe=require("@stdlib/object/assign"),mbe=require("@stdlib/assert/is-positive-number").isPrimitive,hbe=require("@stdlib/assert/is-plain-object"),pbe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,ybe=require("@stdlib/assert/has-own-property"),cG=require("@stdlib/constants/float64/max"),mG=fn().factory,hG=require("@stdlib/symbol/iterator"),tm=require("@stdlib/string/format");function pG(r,e){var t,i,n,a,u;if(!mbe(r))throw new TypeError(tm("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(arguments.length>1){if(!hbe(e))throw new TypeError(tm("invalid argument. Options argument must be an object. Value: `%s`.",e));if(t=cbe({},e),ybe(t,"iter")){if(!pbe(t.iter))throw new TypeError(tm("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=cG;n=mG(r,t),t.prng===void 0&&t.copy!==!1&&(t.state=n.state)}else n=mG(r),t={iter:cG,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),lG(i,"state",dbe(null),lbe),Bt(i,"stateLength",null),Bt(i,"byteLength",null)):(ug(i,"seed",c),ug(i,"seedLength",l),lG(i,"state",p,d),ug(i,"stateLength",m),ug(i,"byteLength",h)),Bt(i,"PRNG",n.PRNG),hG&&Bt(i,hG,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 pG(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}}yG.exports=pG});var wG=s(function(XQe,bG){"use strict";var qbe=qG();bG.exports=qbe});var PG=s(function(YQe,RG){"use strict";var Dt=require("@stdlib/utils/define-nonenumerable-read-only-property"),og=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),SG=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),bbe=require("@stdlib/utils/constant-function"),wbe=require("@stdlib/utils/noop"),Sbe=require("@stdlib/object/assign"),OG=require("@stdlib/assert/is-positive-number").isPrimitive,Obe=require("@stdlib/assert/is-plain-object"),Ebe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,_be=require("@stdlib/assert/has-own-property"),EG=require("@stdlib/constants/float64/max"),_G=Sa().factory,NG=require("@stdlib/symbol/iterator"),vg=require("@stdlib/string/format");function LG(r,e,t){var i,n,a,u,o;if(!OG(r))throw new TypeError(vg("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!OG(e))throw new TypeError(vg("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!Obe(t))throw new TypeError(vg("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=Sbe({},t),_be(i,"iter")){if(!Ebe(i.iter))throw new TypeError(vg("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=EG;a=_G(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=_G(r,e),i={iter:EG,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),SG(n,"state",bbe(null),wbe),Dt(n,"stateLength",null),Dt(n,"byteLength",null)):(og(n,"seed",l),og(n,"seedLength",m),SG(n,"state",d,f),og(n,"stateLength",h),og(n,"byteLength",p)),Dt(n,"PRNG",a.PRNG),NG&&Dt(n,NG,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 LG(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}}RG.exports=LG});var jG=s(function(HQe,TG){"use strict";var Nbe=PG();TG.exports=Nbe});var IG=s(function(ZQe,WG){"use strict";var Xt=require("@stdlib/utils/define-nonenumerable-read-only-property"),gg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),MG=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Lbe=require("@stdlib/utils/constant-function"),Rbe=require("@stdlib/utils/noop"),Pbe=require("@stdlib/object/assign"),xG=require("@stdlib/assert/is-positive-number").isPrimitive,Tbe=require("@stdlib/assert/is-plain-object"),jbe=require("@stdlib/assert/is-number").isPrimitive,Mbe=require("@stdlib/math/base/assert/is-nan"),xbe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Abe=require("@stdlib/assert/has-own-property"),AG=require("@stdlib/constants/float64/max"),GG=Ea().factory,VG=require("@stdlib/symbol/iterator"),wu=require("@stdlib/string/format");function FG(r,e,t,i){var n,a,u,o,v;if(!xG(r))throw new TypeError(wu("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!xG(e))throw new TypeError(wu("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(!jbe(t)||Mbe(t))throw new TypeError(wu("invalid argument. Third argument must be a number. Value: `%s`.",t));if(arguments.length>3){if(!Tbe(i))throw new TypeError(wu("invalid argument. Options argument must be an object. Value: `%s`.",i));if(n=Pbe({},i),Abe(n,"iter")){if(!xbe(n.iter))throw new TypeError(wu("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",n.iter))}else n.iter=AG;u=GG(r,e,t,n),n.prng===void 0&&n.copy!==!1&&(n.state=u.state)}else u=GG(r,e,t),n={iter:AG,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),MG(a,"state",Lbe(null),Rbe),Xt(a,"stateLength",null),Xt(a,"byteLength",null)):(gg(a,"seed",m),gg(a,"seedLength",h),MG(a,"state",f,y),gg(a,"stateLength",p),gg(a,"byteLength",d)),Xt(a,"PRNG",u.PRNG),VG&&Xt(a,VG,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 FG(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}}WG.exports=FG});var zG=s(function(QQe,kG){"use strict";var Gbe=IG();kG.exports=Gbe});var HG=s(function($Qe,YG){"use strict";var Yt=require("@stdlib/utils/define-nonenumerable-read-only-property"),fg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),JG=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Vbe=require("@stdlib/utils/constant-function"),Fbe=require("@stdlib/utils/noop"),Wbe=require("@stdlib/object/assign"),UG=require("@stdlib/assert/is-positive-number").isPrimitive,Ibe=require("@stdlib/assert/is-plain-object"),kbe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,zbe=require("@stdlib/assert/has-own-property"),CG=require("@stdlib/constants/float64/max"),BG=Ce().factory,DG=require("@stdlib/symbol/iterator"),dg=require("@stdlib/string/format");function XG(r,e,t){var i,n,a,u,o;if(!UG(r))throw new TypeError(dg("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!UG(e))throw new TypeError(dg("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!Ibe(t))throw new TypeError(dg("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=Wbe({},t),zbe(i,"iter")){if(!kbe(i.iter))throw new TypeError(dg("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=CG;a=BG(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=BG(r,e),i={iter:CG,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),JG(n,"state",Vbe(null),Fbe),Yt(n,"stateLength",null),Yt(n,"byteLength",null)):(fg(n,"seed",l),fg(n,"seedLength",m),JG(n,"state",d,f),fg(n,"stateLength",h),fg(n,"byteLength",p)),Yt(n,"PRNG",a.PRNG),DG&&Yt(n,DG,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 XG(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}}YG.exports=XG});var QG=s(function(KQe,ZG){"use strict";var Jbe=HG();ZG.exports=Jbe});var nV=s(function(e$e,iV){"use strict";var Ht=require("@stdlib/utils/define-nonenumerable-read-only-property"),lg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),$G=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Ube=require("@stdlib/utils/constant-function"),Cbe=require("@stdlib/utils/noop"),Bbe=require("@stdlib/object/assign"),Dbe=require("@stdlib/assert/is-probability").isPrimitive,Xbe=require("@stdlib/assert/is-plain-object"),Ybe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Hbe=require("@stdlib/assert/has-own-property"),KG=require("@stdlib/constants/float64/max"),eV=_a().factory,rV=require("@stdlib/symbol/iterator"),im=require("@stdlib/string/format");function tV(r,e){var t,i,n,a,u;if(!Dbe(r))throw new TypeError(im("invalid argument. First argument must be a probability. Value: `%s`.",r));if(arguments.length>1){if(!Xbe(e))throw new TypeError(im("invalid argument. Options argument must be an object. Value: `%s`.",e));if(t=Bbe({},e),Hbe(t,"iter")){if(!Ybe(t.iter))throw new TypeError(im("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=KG;n=eV(r,t),t.prng===void 0&&t.copy!==!1&&(t.state=n.state)}else n=eV(r),t={iter:KG,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),$G(i,"state",Ube(null),Cbe),Ht(i,"stateLength",null),Ht(i,"byteLength",null)):(lg(i,"seed",c),lg(i,"seedLength",l),$G(i,"state",p,d),lg(i,"stateLength",m),lg(i,"byteLength",h)),Ht(i,"PRNG",n.PRNG),rV&&Ht(i,rV,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 tV(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}}iV.exports=tV});var sV=s(function(r$e,aV){"use strict";var Zbe=nV();aV.exports=Zbe});var lV=s(function(t$e,dV){"use strict";var Zt=require("@stdlib/utils/define-nonenumerable-read-only-property"),cg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),uV=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Qbe=require("@stdlib/utils/constant-function"),$be=require("@stdlib/utils/noop"),Kbe=require("@stdlib/object/assign"),ewe=require("@stdlib/assert/is-number").isPrimitive,rwe=require("@stdlib/math/base/assert/is-nan"),twe=require("@stdlib/assert/is-plain-object"),iwe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,nwe=require("@stdlib/assert/is-positive-number").isPrimitive,awe=require("@stdlib/assert/has-own-property"),oV=require("@stdlib/constants/float64/max"),vV=Na().factory,gV=require("@stdlib/symbol/iterator"),mg=require("@stdlib/string/format");function fV(r,e,t){var i,n,a,u,o;if(!ewe(r)||rwe(r))throw new TypeError(mg("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!nwe(e))throw new TypeError(mg("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!twe(t))throw new TypeError(mg("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=Kbe({},t),awe(i,"iter")){if(!iwe(i.iter))throw new TypeError(mg("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=oV;a=vV(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=vV(r,e),i={iter:oV,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),uV(n,"state",Qbe(null),$be),Zt(n,"stateLength",null),Zt(n,"byteLength",null)):(cg(n,"seed",l),cg(n,"seedLength",m),uV(n,"state",d,f),cg(n,"stateLength",h),cg(n,"byteLength",p)),Zt(n,"PRNG",a.PRNG),gV&&Zt(n,gV,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 fV(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}}dV.exports=fV});var mV=s(function(i$e,cV){"use strict";var swe=lV();cV.exports=swe});var SV=s(function(n$e,wV){"use strict";var Qt=require("@stdlib/utils/define-nonenumerable-read-only-property"),hg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),hV=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),uwe=require("@stdlib/utils/constant-function"),owe=require("@stdlib/utils/noop"),vwe=require("@stdlib/object/assign"),gwe=require("@stdlib/assert/is-plain-object"),pg=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,fwe=require("@stdlib/assert/has-own-property"),pV=require("@stdlib/constants/float64/max"),yV=La().factory,qV=require("@stdlib/symbol/iterator"),yn=require("@stdlib/string/format");function bV(r,e,t,i){var n,a,u,o,v;if(!pg(r))throw new TypeError(yn("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",r));if(!pg(e))throw new TypeError(yn("invalid argument. Second argument must be a nonnegative integer. Value: `%s`.",e));if(!pg(t))throw new TypeError(yn("invalid argument. Third argument must be a nonnegative integer. Value: `%s`.",t));if(t>r)throw new RangeError(yn("invalid argument. Number of draws must be less than or equal to the population size. Value: `%u`.",t));if(e>r)throw new RangeError(yn("invalid argument. Subpopulation size must be less than or equal to the population size. Value: `%u`.",e));if(arguments.length>3){if(!gwe(i))throw new TypeError(yn("invalid argument. Options argument must be an object. Value: `%s`.",i));if(n=vwe({},i),fwe(n,"iter")){if(!pg(n.iter))throw new TypeError(yn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",n.iter))}else n.iter=pV;u=yV(r,e,t,n),n.prng===void 0&&n.copy!==!1&&(n.state=u.state)}else u=yV(r,e,t),n={iter:pV,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),hV(a,"state",uwe(null),owe),Qt(a,"stateLength",null),Qt(a,"byteLength",null)):(hg(a,"seed",m),hg(a,"seedLength",h),hV(a,"state",f,y),hg(a,"stateLength",p),hg(a,"byteLength",d)),Qt(a,"PRNG",u.PRNG),qV&&Qt(a,qV,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 bV(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}}wV.exports=bV});var EV=s(function(a$e,OV){"use strict";var dwe=SV();OV.exports=dwe});var MV=s(function(s$e,jV){"use strict";var $t=require("@stdlib/utils/define-nonenumerable-read-only-property"),yg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),_V=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),lwe=require("@stdlib/utils/constant-function"),cwe=require("@stdlib/utils/noop"),mwe=require("@stdlib/object/assign"),hwe=require("@stdlib/assert/is-plain-object"),pwe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,ywe=require("@stdlib/assert/has-own-property"),NV=require("@stdlib/constants/float64/max"),LV=Q().factory,RV=require("@stdlib/symbol/iterator"),PV=require("@stdlib/string/format");function TV(r){var e,t,i,n,a;if(arguments.length>0){if(!hwe(r))throw new TypeError(PV("invalid argument. Options argument must be an object. Value: `%s`.",r));if(e=mwe({},r),ywe(e,"iter")){if(!pwe(e.iter))throw new TypeError(PV("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",e.iter))}else e.iter=NV;i=LV(e),e.prng===void 0&&e.copy!==!1&&(e.state=i.state)}else i=LV(),e={iter:NV,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),_V(t,"state",lwe(null),cwe),$t(t,"stateLength",null),$t(t,"byteLength",null)):(yg(t,"seed",g),yg(t,"seedLength",c),_V(t,"state",h,p),yg(t,"stateLength",l),yg(t,"byteLength",m)),$t(t,"PRNG",i.PRNG),RV&&$t(t,RV,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 TV(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}}jV.exports=TV});var AV=s(function(u$e,xV){"use strict";var qwe=MV();xV.exports=qwe});var JV=s(function(o$e,zV){"use strict";var Kt=require("@stdlib/utils/define-nonenumerable-read-only-property"),qg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),GV=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),bwe=require("@stdlib/utils/constant-function"),wwe=require("@stdlib/utils/noop"),Swe=require("@stdlib/object/assign"),VV=require("@stdlib/assert/is-positive-number").isPrimitive,Owe=require("@stdlib/assert/is-plain-object"),Ewe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,_we=require("@stdlib/assert/has-own-property"),FV=require("@stdlib/constants/float64/max"),WV=dn().factory,IV=require("@stdlib/symbol/iterator"),bg=require("@stdlib/string/format");function kV(r,e,t){var i,n,a,u,o;if(!VV(r))throw new TypeError(bg("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!VV(e))throw new TypeError(bg("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!Owe(t))throw new TypeError(bg("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=Swe({},t),_we(i,"iter")){if(!Ewe(i.iter))throw new TypeError(bg("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=FV;a=WV(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=WV(r,e),i={iter:FV,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),GV(n,"state",bwe(null),wwe),Kt(n,"stateLength",null),Kt(n,"byteLength",null)):(qg(n,"seed",l),qg(n,"seedLength",m),GV(n,"state",d,f),qg(n,"stateLength",h),qg(n,"byteLength",p)),Kt(n,"PRNG",a.PRNG),IV&&Kt(n,IV,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}}zV.exports=kV});var CV=s(function(v$e,UV){"use strict";var Nwe=JV();UV.exports=Nwe});var $V=s(function(g$e,QV){"use strict";var ei=require("@stdlib/utils/define-nonenumerable-read-only-property"),wg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),BV=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Lwe=require("@stdlib/utils/constant-function"),Rwe=require("@stdlib/utils/noop"),Pwe=require("@stdlib/object/assign"),DV=require("@stdlib/assert/is-positive-number").isPrimitive,Twe=require("@stdlib/assert/is-plain-object"),jwe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Mwe=require("@stdlib/assert/has-own-property"),XV=require("@stdlib/constants/float64/max"),YV=Pa().factory,HV=require("@stdlib/symbol/iterator"),Sg=require("@stdlib/string/format");function ZV(r,e,t){var i,n,a,u,o;if(!DV(r))throw new TypeError(Sg("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!DV(e))throw new TypeError(Sg("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!Twe(t))throw new TypeError(Sg("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=Pwe({},t),Mwe(i,"iter")){if(!jwe(i.iter))throw new TypeError(Sg("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=XV;a=YV(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=YV(r,e),i={iter:XV,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),BV(n,"state",Lwe(null),Rwe),ei(n,"stateLength",null),ei(n,"byteLength",null)):(wg(n,"seed",l),wg(n,"seedLength",m),BV(n,"state",d,f),wg(n,"stateLength",h),wg(n,"byteLength",p)),ei(n,"PRNG",a.PRNG),HV&&ei(n,HV,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 ZV(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}}QV.exports=ZV});var e2=s(function(f$e,KV){"use strict";var xwe=$V();KV.exports=xwe});var u2=s(function(d$e,s2){"use strict";var ri=require("@stdlib/utils/define-nonenumerable-read-only-property"),Og=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),r2=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-number").isPrimitive,Wwe=require("@stdlib/math/base/assert/is-nan"),Iwe=require("@stdlib/assert/is-plain-object"),kwe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,zwe=require("@stdlib/assert/is-positive-number").isPrimitive,Jwe=require("@stdlib/assert/has-own-property"),t2=require("@stdlib/constants/float64/max"),i2=Ta().factory,n2=require("@stdlib/symbol/iterator"),Eg=require("@stdlib/string/format");function a2(r,e,t){var i,n,a,u,o;if(!Fwe(r)||Wwe(r))throw new TypeError(Eg("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!zwe(e))throw new TypeError(Eg("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!Iwe(t))throw new TypeError(Eg("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=Vwe({},t),Jwe(i,"iter")){if(!kwe(i.iter))throw new TypeError(Eg("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=t2;a=i2(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=i2(r,e),i={iter:t2,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),r2(n,"state",Awe(null),Gwe),ri(n,"stateLength",null),ri(n,"byteLength",null)):(Og(n,"seed",l),Og(n,"seedLength",m),r2(n,"state",d,f),Og(n,"stateLength",h),Og(n,"byteLength",p)),ri(n,"PRNG",a.PRNG),n2&&ri(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 a2(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}}s2.exports=a2});var v2=s(function(l$e,o2){"use strict";var Uwe=u2();o2.exports=Uwe});var h2=s(function(c$e,m2){"use strict";var ti=require("@stdlib/utils/define-nonenumerable-read-only-property"),_g=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),g2=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),Cwe=require("@stdlib/utils/constant-function"),Bwe=require("@stdlib/utils/noop"),Dwe=require("@stdlib/object/assign"),Xwe=require("@stdlib/assert/is-number").isPrimitive,Ywe=require("@stdlib/math/base/assert/is-nan"),Hwe=require("@stdlib/assert/is-plain-object"),Zwe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Qwe=require("@stdlib/assert/is-positive-number").isPrimitive,$we=require("@stdlib/assert/has-own-property"),f2=require("@stdlib/constants/float64/max"),d2=ja().factory,l2=require("@stdlib/symbol/iterator"),Ng=require("@stdlib/string/format");function c2(r,e,t){var i,n,a,u,o;if(!Xwe(r)||Ywe(r))throw new TypeError(Ng("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!Qwe(e))throw new TypeError(Ng("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!Hwe(t))throw new TypeError(Ng("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=Dwe({},t),$we(i,"iter")){if(!Zwe(i.iter))throw new TypeError(Ng("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=f2;a=d2(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=d2(r,e),i={iter:f2,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),g2(n,"state",Cwe(null),Bwe),ti(n,"stateLength",null),ti(n,"byteLength",null)):(_g(n,"seed",l),_g(n,"seedLength",m),g2(n,"state",d,f),_g(n,"stateLength",h),_g(n,"byteLength",p)),ti(n,"PRNG",a.PRNG),l2&&ti(n,l2,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 c2(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}}m2.exports=c2});var y2=s(function(m$e,p2){"use strict";var Kwe=h2();p2.exports=Kwe});var _2=s(function(h$e,E2){"use strict";var ii=require("@stdlib/utils/define-nonenumerable-read-only-property"),Lg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),q2=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),eSe=require("@stdlib/utils/constant-function"),rSe=require("@stdlib/utils/noop"),tSe=require("@stdlib/object/assign"),iSe=require("@stdlib/assert/is-number").isPrimitive,nSe=require("@stdlib/math/base/assert/is-nan"),aSe=require("@stdlib/assert/is-plain-object"),sSe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,uSe=require("@stdlib/assert/is-positive-number").isPrimitive,oSe=require("@stdlib/assert/has-own-property"),b2=require("@stdlib/constants/float64/max"),w2=Ma().factory,S2=require("@stdlib/symbol/iterator"),Rg=require("@stdlib/string/format");function O2(r,e,t){var i,n,a,u,o;if(!iSe(r)||nSe(r))throw new TypeError(Rg("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!uSe(e))throw new TypeError(Rg("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!aSe(t))throw new TypeError(Rg("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=tSe({},t),oSe(i,"iter")){if(!sSe(i.iter))throw new TypeError(Rg("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=b2;a=w2(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=w2(r,e),i={iter:b2,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),q2(n,"state",eSe(null),rSe),ii(n,"stateLength",null),ii(n,"byteLength",null)):(Lg(n,"seed",l),Lg(n,"seedLength",m),q2(n,"state",d,f),Lg(n,"stateLength",h),Lg(n,"byteLength",p)),ii(n,"PRNG",a.PRNG),S2&&ii(n,S2,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}}E2.exports=O2});var L2=s(function(p$e,N2){"use strict";var vSe=_2();N2.exports=vSe});var A2=s(function(y$e,x2){"use strict";var ni=require("@stdlib/utils/define-nonenumerable-read-only-property"),Pg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),R2=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),gSe=require("@stdlib/utils/constant-function"),fSe=require("@stdlib/utils/noop"),dSe=require("@stdlib/object/assign"),lSe=require("@stdlib/assert/is-number").isPrimitive,cSe=require("@stdlib/math/base/assert/is-nan"),mSe=require("@stdlib/assert/is-plain-object"),hSe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,pSe=require("@stdlib/assert/is-positive-number").isPrimitive,ySe=require("@stdlib/assert/has-own-property"),P2=require("@stdlib/constants/float64/max"),T2=ln().factory,j2=require("@stdlib/symbol/iterator"),Tg=require("@stdlib/string/format");function M2(r,e,t){var i,n,a,u,o;if(!lSe(r)||cSe(r))throw new TypeError(Tg("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!pSe(e))throw new TypeError(Tg("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!mSe(t))throw new TypeError(Tg("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=dSe({},t),ySe(i,"iter")){if(!hSe(i.iter))throw new TypeError(Tg("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=P2;a=T2(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=T2(r,e),i={iter:P2,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),R2(n,"state",gSe(null),fSe),ni(n,"stateLength",null),ni(n,"byteLength",null)):(Pg(n,"seed",l),Pg(n,"seedLength",m),R2(n,"state",d,f),Pg(n,"stateLength",h),Pg(n,"byteLength",p)),ni(n,"PRNG",a.PRNG),j2&&ni(n,j2,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 M2(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}}x2.exports=M2});var V2=s(function(q$e,G2){"use strict";var qSe=A2();G2.exports=qSe});var U2=s(function(b$e,J2){"use strict";var nm=require("@stdlib/utils/define-nonenumerable-read-only-property"),jg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),bSe=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),wSe=require("@stdlib/object/assign"),SSe=require("@stdlib/assert/is-plain-object"),OSe=require("@stdlib/assert/is-boolean").isPrimitive,ESe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,F2=require("@stdlib/assert/has-own-property"),W2=require("@stdlib/constants/float64/max"),I2=$().factory,k2=require("@stdlib/symbol/iterator"),am=require("@stdlib/string/format");function z2(r){var e,t,i,n,a;if(arguments.length>0){if(!SSe(r))throw new TypeError(am("invalid argument. Options argument must be an object. Value: `%s`.",r));if(e=wSe({},r),F2(e,"normalized")&&!OSe(e.normalized))throw new TypeError(am("invalid option. `%s` option must be a boolean. Option: `%s`.","normalized",e.normalized));if(F2(e,"iter")){if(!ESe(e.iter))throw new TypeError(am("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",e.iter))}else e.iter=W2;i=I2(e),e.copy!==!1&&(e.state=i.state)}else i=I2(),e={iter:W2,state:i.state};return e.normalized&&(i=i.normalized),a=0,t={},nm(t,"next",u),nm(t,"return",o),jg(t,"seed",g),jg(t,"seedLength",c),bSe(t,"state",h,p),jg(t,"stateLength",l),jg(t,"byteLength",m),k2&&nm(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 z2(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}}J2.exports=z2});var B2=s(function(w$e,C2){"use strict";var _Se=U2();C2.exports=_Se});var $2=s(function(S$e,Q2){"use strict";var sm=require("@stdlib/utils/define-nonenumerable-read-only-property"),Mg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),NSe=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),LSe=require("@stdlib/object/assign"),RSe=require("@stdlib/assert/is-plain-object"),PSe=require("@stdlib/assert/is-boolean").isPrimitive,TSe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,D2=require("@stdlib/assert/has-own-property"),X2=require("@stdlib/constants/float64/max"),Y2=ee().factory,H2=require("@stdlib/symbol/iterator"),um=require("@stdlib/string/format");function Z2(r){var e,t,i,n,a;if(arguments.length>0){if(!RSe(r))throw new TypeError(um("invalid argument. Options argument must be an object. Value: `%s`.",r));if(e=LSe({},r),D2(e,"normalized")&&!PSe(e.normalized))throw new TypeError(um("invalid option. `%s` option must be a boolean. Option: `%s`.","normalized",e.normalized));if(D2(e,"iter")){if(!TSe(e.iter))throw new TypeError(um("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",e.iter))}else e.iter=X2;i=Y2(e),e.copy!==!1&&(e.state=i.state)}else i=Y2(),e={iter:X2,state:i.state};return e.normalized&&(i=i.normalized),a=0,t={},sm(t,"next",u),sm(t,"return",o),Mg(t,"seed",g),Mg(t,"seedLength",c),NSe(t,"state",h,p),Mg(t,"stateLength",l),Mg(t,"byteLength",m),H2&&sm(t,H2,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 Z2(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}}Q2.exports=Z2});var eF=s(function(O$e,K2){"use strict";var jSe=$2();K2.exports=jSe});var uF=s(function(E$e,sF){"use strict";var om=require("@stdlib/utils/define-nonenumerable-read-only-property"),xg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),MSe=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),xSe=require("@stdlib/object/assign"),ASe=require("@stdlib/assert/is-plain-object"),GSe=require("@stdlib/assert/is-boolean").isPrimitive,VSe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,rF=require("@stdlib/assert/has-own-property"),tF=require("@stdlib/constants/float64/max"),iF=T().factory,nF=require("@stdlib/symbol/iterator"),vm=require("@stdlib/string/format");function aF(r){var e,t,i,n,a;if(arguments.length>0){if(!ASe(r))throw new TypeError(vm("invalid argument. Options argument must be an object. Value: `%s`.",r));if(e=xSe({},r),rF(e,"normalized")&&!GSe(e.normalized))throw new TypeError(vm("invalid option. `%s` option must be a boolean. Option: `%s`.","normalized",e.normalized));if(rF(e,"iter")){if(!VSe(e.iter))throw new TypeError(vm("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",e.iter))}else e.iter=tF;i=iF(e),e.copy!==!1&&(e.state=i.state)}else i=iF(),e={iter:tF,state:i.state};return e.normalized&&(i=i.normalized),a=0,t={},om(t,"next",u),om(t,"return",o),xg(t,"seed",g),xg(t,"seedLength",c),MSe(t,"state",h,p),xg(t,"stateLength",l),xg(t,"byteLength",m),nF&&om(t,nF,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 aF(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}}sF.exports=aF});var vF=s(function(_$e,oF){"use strict";var FSe=uF();oF.exports=FSe});var hF=s(function(N$e,mF){"use strict";var ai=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ag=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),gF=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-probability").isPrimitive,JSe=require("@stdlib/assert/is-plain-object"),USe=require("@stdlib/assert/is-positive-number").isPrimitive,CSe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,BSe=require("@stdlib/assert/has-own-property"),fF=require("@stdlib/constants/float64/max"),dF=Ia().factory,lF=require("@stdlib/symbol/iterator"),Gg=require("@stdlib/string/format");function cF(r,e,t){var i,n,a,u,o;if(!USe(r))throw new TypeError(Gg("invalid argument. First argument must be a positive integer. Value: `%s`.",r));if(!zSe(e))throw new TypeError(Gg("invalid argument. Second argument must be a probability. Value: `%s`.",e));if(arguments.length>2){if(!JSe(t))throw new TypeError(Gg("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=kSe({},t),BSe(i,"iter")){if(!CSe(i.iter))throw new TypeError(Gg("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=fF;a=dF(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=dF(r,e),i={iter:fF,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),gF(n,"state",WSe(null),ISe),ai(n,"stateLength",null),ai(n,"byteLength",null)):(Ag(n,"seed",l),Ag(n,"seedLength",m),gF(n,"state",d,f),Ag(n,"stateLength",h),Ag(n,"byteLength",p)),ai(n,"PRNG",a.PRNG),lF&&ai(n,lF,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 cF(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}}mF.exports=cF});var yF=s(function(L$e,pF){"use strict";var DSe=hF();pF.exports=DSe});var _F=s(function(R$e,EF){"use strict";var si=require("@stdlib/utils/define-nonenumerable-read-only-property"),Vg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),qF=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),XSe=require("@stdlib/utils/constant-function"),YSe=require("@stdlib/utils/noop"),HSe=require("@stdlib/object/assign"),ZSe=require("@stdlib/assert/is-number").isPrimitive,QSe=require("@stdlib/math/base/assert/is-nan"),$Se=require("@stdlib/assert/is-plain-object"),KSe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,eOe=require("@stdlib/assert/is-positive-number").isPrimitive,rOe=require("@stdlib/assert/has-own-property"),bF=require("@stdlib/constants/float64/max"),wF=mn().factory,SF=require("@stdlib/symbol/iterator"),Fg=require("@stdlib/string/format");function OF(r,e,t){var i,n,a,u,o;if(!ZSe(r)||QSe(r))throw new TypeError(Fg("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!eOe(e))throw new TypeError(Fg("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!$Se(t))throw new TypeError(Fg("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=HSe({},t),rOe(i,"iter")){if(!KSe(i.iter))throw new TypeError(Fg("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=bF;a=wF(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=wF(r,e),i={iter:bF,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),qF(n,"state",XSe(null),YSe),si(n,"stateLength",null),si(n,"byteLength",null)):(Vg(n,"seed",l),Vg(n,"seedLength",m),qF(n,"state",d,f),Vg(n,"stateLength",h),Vg(n,"byteLength",p)),si(n,"PRNG",a.PRNG),SF&&si(n,SF,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 OF(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}}EF.exports=OF});var LF=s(function(P$e,NF){"use strict";var tOe=_F();NF.exports=tOe});var GF=s(function(T$e,AF){"use strict";var ui=require("@stdlib/utils/define-nonenumerable-read-only-property"),Wg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),RF=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),iOe=require("@stdlib/utils/constant-function"),nOe=require("@stdlib/utils/noop"),aOe=require("@stdlib/object/assign"),PF=require("@stdlib/assert/is-positive-number").isPrimitive,sOe=require("@stdlib/assert/is-plain-object"),uOe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,oOe=require("@stdlib/assert/has-own-property"),TF=require("@stdlib/constants/float64/max"),jF=za().factory,MF=require("@stdlib/symbol/iterator"),Ig=require("@stdlib/string/format");function xF(r,e,t){var i,n,a,u,o;if(!PF(r))throw new TypeError(Ig("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!PF(e))throw new TypeError(Ig("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!sOe(t))throw new TypeError(Ig("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=aOe({},t),oOe(i,"iter")){if(!uOe(i.iter))throw new TypeError(Ig("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=TF;a=jF(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=jF(r,e),i={iter:TF,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),RF(n,"state",iOe(null),nOe),ui(n,"stateLength",null),ui(n,"byteLength",null)):(Wg(n,"seed",l),Wg(n,"seedLength",m),RF(n,"state",d,f),Wg(n,"stateLength",h),Wg(n,"byteLength",p)),ui(n,"PRNG",a.PRNG),MF&&ui(n,MF,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 xF(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}}AF.exports=xF});var FF=s(function(j$e,VF){"use strict";var vOe=GF();VF.exports=vOe});var CF=s(function(M$e,UF){"use strict";var oi=require("@stdlib/utils/define-nonenumerable-read-only-property"),kg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),WF=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),gOe=require("@stdlib/utils/constant-function"),fOe=require("@stdlib/utils/noop"),dOe=require("@stdlib/object/assign"),lOe=require("@stdlib/assert/is-positive-number").isPrimitive,cOe=require("@stdlib/assert/is-plain-object"),mOe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,hOe=require("@stdlib/assert/has-own-property"),IF=require("@stdlib/constants/float64/max"),kF=cn().factory,zF=require("@stdlib/symbol/iterator"),gm=require("@stdlib/string/format");function JF(r,e){var t,i,n,a,u;if(!lOe(r))throw new TypeError(gm("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(arguments.length>1){if(!cOe(e))throw new TypeError(gm("invalid argument. Options argument must be an object. Value: `%s`.",e));if(t=dOe({},e),hOe(t,"iter")){if(!mOe(t.iter))throw new TypeError(gm("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=IF;n=kF(r,t),t.prng===void 0&&t.copy!==!1&&(t.state=n.state)}else n=kF(r),t={iter:IF,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),WF(i,"state",gOe(null),fOe),oi(i,"stateLength",null),oi(i,"byteLength",null)):(kg(i,"seed",c),kg(i,"seedLength",l),WF(i,"state",p,d),kg(i,"stateLength",m),kg(i,"byteLength",h)),oi(i,"PRNG",n.PRNG),zF&&oi(i,zF,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 JF(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}}UF.exports=JF});var DF=s(function(x$e,BF){"use strict";var pOe=CF();BF.exports=pOe});var KF=s(function(A$e,$F){"use strict";var zg=require("@stdlib/utils/define-nonenumerable-read-only-property"),Jg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),yOe=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),qOe=require("@stdlib/object/assign"),bOe=require("@stdlib/assert/is-plain-object"),wOe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,SOe=require("@stdlib/assert/has-own-property"),XF=require("@stdlib/constants/float64/max"),YF=hu().factory,HF=require("@stdlib/symbol/iterator"),ZF=require("@stdlib/string/format");function QF(r){var e,t,i,n,a;if(arguments.length>0){if(!bOe(r))throw new TypeError(ZF("invalid argument. Options argument must be an object. Value: `%s`.",r));if(e=qOe({},r),SOe(e,"iter")){if(!wOe(e.iter))throw new TypeError(ZF("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",e.iter))}else e.iter=XF;i=YF(e),e.copy!==!1&&(e.state=i.state)}else i=YF(),e={iter:XF,state:i.state};return a=0,t={},zg(t,"next",u),zg(t,"return",o),Jg(t,"seed",g),Jg(t,"seedLength",c),yOe(t,"state",h,p),Jg(t,"stateLength",l),Jg(t,"byteLength",m),zg(t,"PRNG",i.PRNG),HF&&zg(t,HF,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 QF(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}}$F.exports=QF});var rW=s(function(G$e,eW){"use strict";var OOe=KF();eW.exports=OOe});var vW=s(function(V$e,oW){"use strict";var vi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ug=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),tW=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),EOe=require("@stdlib/utils/constant-function"),_Oe=require("@stdlib/utils/noop"),NOe=require("@stdlib/object/assign"),LOe=require("@stdlib/assert/is-plain-object"),ROe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,POe=require("@stdlib/assert/has-own-property"),iW=require("@stdlib/constants/float64/max"),nW=yu().factory,aW=require("@stdlib/symbol/iterator"),sW=require("@stdlib/string/format");function uW(r){var e,t,i,n,a;if(arguments.length>0){if(!LOe(r))throw new TypeError(sW("invalid argument. Options argument must be an object. Value: `%s`.",r));if(e=NOe({},r),POe(e,"iter")){if(!ROe(e.iter))throw new TypeError(sW("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",e.iter))}else e.iter=iW;i=nW(e),e.prng===void 0&&e.copy!==!1&&(e.state=i.state)}else i=nW(),e={iter:iW,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),tW(t,"state",EOe(null),_Oe),vi(t,"stateLength",null),vi(t,"byteLength",null)):(Ug(t,"seed",g),Ug(t,"seedLength",c),tW(t,"state",h,p),Ug(t,"stateLength",l),Ug(t,"byteLength",m)),vi(t,"PRNG",i.PRNG),aW&&vi(t,aW,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 uW(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}}oW.exports=uW});var fW=s(function(F$e,gW){"use strict";var TOe=vW();gW.exports=TOe});var yW=s(function(W$e,pW){"use strict";var Cg=require("@stdlib/utils/define-nonenumerable-read-only-property"),Bg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),jOe=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),MOe=require("@stdlib/object/assign"),xOe=require("@stdlib/assert/is-plain-object"),AOe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,GOe=require("@stdlib/assert/has-own-property"),dW=require("@stdlib/constants/float64/max"),lW=Tt().factory,cW=require("@stdlib/symbol/iterator"),mW=require("@stdlib/string/format");function hW(r){var e,t,i,n,a;if(arguments.length>0){if(!xOe(r))throw new TypeError(mW("invalid argument. Options argument must be an object. Value: `%s`.",r));if(e=MOe({},r),GOe(e,"iter")){if(!AOe(e.iter))throw new TypeError(mW("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",e.iter))}else e.iter=dW;i=lW(e),e.copy!==!1&&(e.state=i.state)}else i=lW(),e={iter:dW,state:i.state};return a=0,t={},Cg(t,"next",u),Cg(t,"return",o),Bg(t,"seed",g),Bg(t,"seedLength",c),jOe(t,"state",h,p),Bg(t,"stateLength",l),Bg(t,"byteLength",m),Cg(t,"PRNG",i.PRNG),cW&&Cg(t,cW,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 hW(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}}pW.exports=hW});var bW=s(function(I$e,qW){"use strict";var VOe=yW();qW.exports=VOe});var LW=s(function(k$e,NW){"use strict";var gi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Dg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),wW=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),FOe=require("@stdlib/utils/constant-function"),WOe=require("@stdlib/utils/noop"),IOe=require("@stdlib/object/assign"),kOe=require("@stdlib/assert/is-positive-number").isPrimitive,zOe=require("@stdlib/assert/is-plain-object"),JOe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,UOe=require("@stdlib/assert/has-own-property"),SW=require("@stdlib/constants/float64/max"),OW=Ja().factory,EW=require("@stdlib/symbol/iterator"),fm=require("@stdlib/string/format");function _W(r,e){var t,i,n,a,u;if(!kOe(r))throw new TypeError(fm("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(arguments.length>1){if(!zOe(e))throw new TypeError(fm("invalid argument. Options argument must be an object. Value: `%s`.",e));if(t=IOe({},e),UOe(t,"iter")){if(!JOe(t.iter))throw new TypeError(fm("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=SW;n=OW(r,t),t.prng===void 0&&t.copy!==!1&&(t.state=n.state)}else n=OW(r),t={iter:SW,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),wW(i,"state",FOe(null),WOe),gi(i,"stateLength",null),gi(i,"byteLength",null)):(Dg(i,"seed",c),Dg(i,"seedLength",l),wW(i,"state",p,d),Dg(i,"stateLength",m),Dg(i,"byteLength",h)),gi(i,"PRNG",n.PRNG),EW&&gi(i,EW,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 _W(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}}NW.exports=_W});var PW=s(function(z$e,RW){"use strict";var COe=LW();RW.exports=COe});var VW=s(function(J$e,GW){"use strict";var fi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Xg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),TW=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-positive-number").isPrimitive,HOe=require("@stdlib/assert/is-plain-object"),ZOe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,QOe=require("@stdlib/assert/has-own-property"),jW=require("@stdlib/constants/float64/max"),MW=Ba().factory,xW=require("@stdlib/symbol/iterator"),dm=require("@stdlib/string/format");function AW(r,e){var t,i,n,a,u;if(!YOe(r))throw new TypeError(dm("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(arguments.length>1){if(!HOe(e))throw new TypeError(dm("invalid argument. Options argument must be an object. Value: `%s`.",e));if(t=XOe({},e),QOe(t,"iter")){if(!ZOe(t.iter))throw new TypeError(dm("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",t.iter))}else t.iter=jW;n=MW(r,t),t.prng===void 0&&t.copy!==!1&&(t.state=n.state)}else n=MW(r),t={iter:jW,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),TW(i,"state",BOe(null),DOe),fi(i,"stateLength",null),fi(i,"byteLength",null)):(Xg(i,"seed",c),Xg(i,"seedLength",l),TW(i,"state",p,d),Xg(i,"stateLength",m),Xg(i,"byteLength",h)),fi(i,"PRNG",n.PRNG),xW&&fi(i,xW,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 AW(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}}GW.exports=AW});var WW=s(function(U$e,FW){"use strict";var $Oe=VW();FW.exports=$Oe});var BW=s(function(C$e,CW){"use strict";var di=require("@stdlib/utils/define-nonenumerable-read-only-property"),Yg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),IW=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),KOe=require("@stdlib/utils/constant-function"),eEe=require("@stdlib/utils/noop"),rEe=require("@stdlib/object/assign"),lm=require("@stdlib/assert/is-number").isPrimitive,cm=require("@stdlib/math/base/assert/is-nan"),tEe=require("@stdlib/assert/is-plain-object"),iEe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,nEe=require("@stdlib/assert/has-own-property"),kW=require("@stdlib/constants/float64/max"),zW=Da().factory,JW=require("@stdlib/symbol/iterator"),Ha=require("@stdlib/string/format");function UW(r,e,t,i){var n,a,u,o,v;if(!lm(r)||cm(r))throw new TypeError(Ha("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!lm(e)||cm(e))throw new TypeError(Ha("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e));if(!lm(t)||cm(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(!tEe(i))throw new TypeError(Ha("invalid argument. Options argument must be an object. Value: `%s`.",i));if(n=rEe({},i),nEe(n,"iter")){if(!iEe(n.iter))throw new TypeError(Ha("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",n.iter))}else n.iter=kW;u=zW(r,e,t,n),n.prng===void 0&&n.copy!==!1&&(n.state=u.state)}else u=zW(r,e,t),n={iter:kW,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),IW(a,"state",KOe(null),eEe),di(a,"stateLength",null),di(a,"byteLength",null)):(Yg(a,"seed",m),Yg(a,"seedLength",h),IW(a,"state",f,y),Yg(a,"stateLength",p),Yg(a,"byteLength",d)),di(a,"PRNG",u.PRNG),JW&&di(a,JW,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 UW(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}}CW.exports=UW});var XW=s(function(B$e,DW){"use strict";var aEe=BW();DW.exports=aEe});var tI=s(function(D$e,rI){"use strict";var li=require("@stdlib/utils/define-nonenumerable-read-only-property"),Hg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),YW=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),sEe=require("@stdlib/utils/constant-function"),uEe=require("@stdlib/utils/noop"),oEe=require("@stdlib/object/assign"),HW=require("@stdlib/assert/is-number").isPrimitive,ZW=require("@stdlib/math/base/assert/is-nan"),vEe=require("@stdlib/assert/is-plain-object"),gEe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,fEe=require("@stdlib/assert/has-own-property"),QW=require("@stdlib/constants/float64/max"),$W=hn().factory,KW=require("@stdlib/symbol/iterator"),Su=require("@stdlib/string/format");function eI(r,e,t){var i,n,a,u,o;if(!HW(r)||ZW(r))throw new TypeError(Su("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!HW(e)||ZW(e))throw new TypeError(Su("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e));if(r>=e)throw new RangeError(Su("invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.",r,e));if(arguments.length>2){if(!vEe(t))throw new TypeError(Su("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=oEe({},t),fEe(i,"iter")){if(!gEe(i.iter))throw new TypeError(Su("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=QW;a=$W(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=$W(r,e),i={iter:QW,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),YW(n,"state",sEe(null),uEe),li(n,"stateLength",null),li(n,"byteLength",null)):(Hg(n,"seed",l),Hg(n,"seedLength",m),YW(n,"state",d,f),Hg(n,"stateLength",h),Hg(n,"byteLength",p)),li(n,"PRNG",a.PRNG),KW&&li(n,KW,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 eI(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}}rI.exports=eI});var nI=s(function(X$e,iI){"use strict";var dEe=tI();iI.exports=dEe});var dI=s(function(Y$e,fI){"use strict";var ci=require("@stdlib/utils/define-nonenumerable-read-only-property"),Zg=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),aI=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),lEe=require("@stdlib/utils/constant-function"),cEe=require("@stdlib/utils/noop"),mEe=require("@stdlib/object/assign"),sI=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"),uI=require("@stdlib/constants/float64/max"),oI=pn().factory,vI=require("@stdlib/symbol/iterator"),Qg=require("@stdlib/string/format");function gI(r,e,t){var i,n,a,u,o;if(!sI(r))throw new TypeError(Qg("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!sI(e))throw new TypeError(Qg("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(arguments.length>2){if(!hEe(t))throw new TypeError(Qg("invalid argument. Options argument must be an object. Value: `%s`.",t));if(i=mEe({},t),yEe(i,"iter")){if(!pEe(i.iter))throw new TypeError(Qg("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",i.iter))}else i.iter=uI;a=oI(r,e,i),i.prng===void 0&&i.copy!==!1&&(i.state=a.state)}else a=oI(r,e),i={iter:uI,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),aI(n,"state",lEe(null),cEe),ci(n,"stateLength",null),ci(n,"byteLength",null)):(Zg(n,"seed",l),Zg(n,"seedLength",m),aI(n,"state",d,f),Zg(n,"stateLength",h),Zg(n,"byteLength",p)),ci(n,"PRNG",a.PRNG),vI&&ci(n,vI,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 gI(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}}fI.exports=gI});var cI=s(function(H$e,lI){"use strict";var qEe=dI();lI.exports=qEe});var hI=s(function(Z$e,mI){"use strict";var R=require("@stdlib/utils/define-read-only-property"),N={};R(N,"arcsine",p1());R(N,"bernoulli",N1());R(N,"beta",V1());R(N,"betaprime",D1());R(N,"binomial",rA());R(N,"boxMuller",fA());R(N,"cauchy",bA());R(N,"chi",PA());R(N,"chisquare",WA());R(N,"cosine",XA());R(N,"discreteUniform",iG());R(N,"erlang",dG());R(N,"exponential",wG());R(N,"f",jG());R(N,"frechet",zG());R(N,"gamma",QG());R(N,"geometric",sV());R(N,"gumbel",mV());R(N,"hypergeometric",EV());R(N,"improvedZiggurat",AV());R(N,"invgamma",CV());R(N,"kumaraswamy",e2());R(N,"laplace",v2());R(N,"levy",y2());R(N,"logistic",L2());R(N,"lognormal",V2());R(N,"minstd",B2());R(N,"minstdShuffle",eF());R(N,"mt19937",vF());R(N,"negativeBinomial",yF());R(N,"normal",LF());R(N,"pareto1",FF());R(N,"poisson",DF());R(N,"randi",rW());R(N,"randn",fW());R(N,"randu",bW());R(N,"rayleigh",PW());R(N,"t",WW());R(N,"triangular",XW());R(N,"uniform",nI());R(N,"weibull",cI());mI.exports=N});var yI=s(function(Q$e,pI){"use strict";var bEe=require("@stdlib/math/base/special/floor");function wEe(r,e,t){var i,n,a,u;for(a=r.length,n=new Array(e),u=0;u0;a--)u=OEe(t()*(a+1)),i=r[a],r[a]=r[u],r[u]=i;return EEe.call(r,0,e)}wI.exports=_Ee});var EI=s(function(eKe,OI){"use strict";var NEe=require("@stdlib/math/base/special/floor");function LEe(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],!(mm(e)||hm(e)))throw new TypeError(Kg("invalid argument. `%s` argument must be array-like. Value: `%s`.","pool",e));n=ef(t,r)}if(n)throw n;return r&&r.seed?i=jI({seed:r.seed}):i=jI(),e===void 0?a=u:(TI(e)?e=e.split(""):e=MI(e),a=o),PI(a,"seed",i.seed),PI(a,"PRNG",i),i=i.normalized,a;function u(v,g){var c,l,m,h,p,d;if(!(mm(v)||hm(v)))throw new TypeError(Kg("invalid argument. First argument must be array-like. Value: `%s`.",v));if(TI(v)&&(v=v.split("")),h={},arguments.length>1&&(d=ef(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(Kg("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?AEe(v,p,i,m):xEe(v,p,i,m):c?xI(v,p,i):(l=VEe.call(v),AI(l,p,i))}function o(v){var g,c,l,m,h,p;if(e.length===0)return null;if(l={},arguments.length&&(h=ef(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(Kg("invalid option. `size` option must be less than or equal to the population size when `replace` is `false`. Option: `%s`.",m));return g?xI(e,m,i):(p=AI(e,m,i),c&&(e=e.slice(m,e.length)),p)}}GI.exports=FEe});var FI=s(function(nKe,VI){"use strict";var WEe=pm(),IEe=WEe();VI.exports=IEe});var kI=s(function(aKe,II){"use strict";var kEe=require("@stdlib/utils/define-nonenumerable-read-only-property"),WI=FI(),zEe=pm();kEe(WI,"factory",zEe);II.exports=WI});var zI=s(function(sKe,JEe){JEe.exports={copy:"shallow"}});var CI=s(function(uKe,UI){"use strict";var UEe=require("@stdlib/assert/has-own-property"),CEe=require("@stdlib/assert/is-string").isPrimitive,BEe=require("@stdlib/assert/is-plain-object"),DEe=require("@stdlib/utils/index-of"),ym=require("@stdlib/string/format"),JI=["deep","shallow","none"];function XEe(r,e){if(!BEe(e))return new TypeError(ym("invalid argument. Options argument must be an object. Value: `%s`.",e));if(UEe(e,"copy")){if(r.copy=e.copy,!CEe(r.copy))return new TypeError(ym("invalid option. `%s` option must be a string. Option: `%s`.","copy",r.copy));if(DEe(JI,r.copy)===-1)return new TypeError(ym('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"copy",JI.join('", "'),r.copy))}return null}UI.exports=XEe});var qm=s(function(oKe,HI){"use strict";var BI=require("@stdlib/utils/define-nonenumerable-read-only-property"),YEe=require("@stdlib/assert/is-array-like"),HEe=require("@stdlib/assert/is-typed-array-like"),ZEe=require("@stdlib/assert/is-string").isPrimitive,DI=require("@stdlib/utils/copy"),QEe=require("@stdlib/math/base/special/floor"),XI=T().factory,$Ee=require("@stdlib/string/format"),KEe=zI(),YI=CI();function e_e(r){var e,t,i;if(e=DI(KEe),arguments.length&&(i=YI(e,r),i))throw i;return r&&r.seed?t=XI({seed:r.seed}):t=XI(),BI(n,"seed",t.seed),BI(n,"PRNG",t),t=t.normalized,n;function n(a,u){var o,v,g,c,l,m,h,p,d,f;if(!(YEe(a)||HEe(a)))throw new TypeError($Ee("invalid argument. First argument must be array-like. Value: `%s`.",a));if(arguments.length>1&&(c={},l=YI(c,u),l))throw l;for(g=c&&c.copy?c.copy:e.copy,o=ZEe(a),o&&(a=a.split(""),g="none"),v=0,g==="shallow"?v+=1:g==="deep"&&(v+=2),p=a.length,m=DI(a,v),d=p-1;d>0;d--)f=QEe(t()*(d+1)),h=m[d],m[d]=m[f],m[f]=h;return o&&(m=a.join("")),m}}HI.exports=e_e});var QI=s(function(vKe,ZI){"use strict";var r_e=qm(),t_e=r_e();ZI.exports=t_e});var ek=s(function(gKe,KI){"use strict";var i_e=require("@stdlib/utils/define-nonenumerable-read-only-property"),$I=QI(),n_e=qm();i_e($I,"factory",n_e);KI.exports=$I});var rk=s(function(fKe,a_e){a_e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var nk=s(function(dKe,ik){"use strict";var s_e=require("@stdlib/assert/is-plain-object"),Ye=require("@stdlib/assert/has-own-property"),u_e=require("@stdlib/assert/is-boolean").isPrimitive,o_e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,tk=require("@stdlib/assert/is-string").isPrimitive,v_e=require("@stdlib/assert/is-positive-integer").isPrimitive,g_e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,qn=require("@stdlib/string/format");function f_e(r,e){return s_e(e)?Ye(e,"sep")&&(r.sep=e.sep,!tk(r.sep))?new TypeError(qn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Ye(e,"objectMode")&&(r.objectMode=e.objectMode,!u_e(r.objectMode))?new TypeError(qn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Ye(e,"encoding")&&(r.encoding=e.encoding,!tk(r.encoding)&&r.encoding!==null)?new TypeError(qn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Ye(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!o_e(r.highWaterMark))?new TypeError(qn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Ye(e,"iter")&&(r.iter=e.iter,!g_e(r.iter))?new TypeError(qn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Ye(e,"siter")&&(r.siter=e.siter,!v_e(r.siter))?new TypeError(qn("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(Ye(e,"prng")&&(r.prng=e.prng),Ye(e,"seed")&&(r.seed=e.seed),Ye(e,"state")&&(r.state=e.state),Ye(e,"copy")&&(r.copy=e.copy),null):new TypeError(qn("invalid argument. Options argument must be an object. Value: `%s`.",e))}ik.exports=f_e});var sk=s(function(lKe,ak){"use strict";var d_e=require("debug"),l_e=d_e("random:streams:arcsine");ak.exports=l_e});var tf=s(function(cKe,dk){"use strict";var fk=require("readable-stream").Readable,uk=require("@stdlib/assert/is-number").isPrimitive,ok=require("@stdlib/math/base/assert/is-nan"),c_e=require("@stdlib/assert/is-error"),m_e=require("@stdlib/object/assign"),h_e=require("@stdlib/utils/inherit"),vk=require("@stdlib/utils/define-nonenumerable-property"),mi=require("@stdlib/utils/define-nonenumerable-read-only-property"),rf=require("@stdlib/utils/define-read-only-accessor"),p_e=require("@stdlib/utils/define-read-write-accessor"),y_e=nn().factory,gk=require("@stdlib/buffer/from-string"),q_e=require("@stdlib/utils/next-tick"),bm=require("@stdlib/string/format"),b_e=rk(),w_e=nk(),Za=sk();function S_e(){return this._prng.seed}function O_e(){return this._prng.seedLength}function E_e(){return this._prng.stateLength}function __e(){return this._prng.byteLength}function N_e(){return this._prng.state}function L_e(r){this._prng.state=r}function R_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=gk(e):e=gk(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function P_e(r){var e;if(this._destroyed)return Za("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,q_e(t),this;function t(){r&&(Za("Stream was destroyed due to an error. Error: %s.",c_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(!uk(r)||ok(r))throw new TypeError(bm("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!uk(e)||ok(e))throw new TypeError(bm("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e));if(r>=e)throw new RangeError(bm("invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.",r,e));if(i=m_e({},b_e),arguments.length>2&&(n=w_e(i,t),n))throw n;return Za("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),fk.call(this,i),vk(this,"_destroyed",!1),mi(this,"_objectMode",i.objectMode),mi(this,"_sep",i.sep),mi(this,"_iter",i.iter),mi(this,"_siter",i.siter),vk(this,"_i",0),mi(this,"_prng",y_e(r,e,i)),mi(this,"PRNG",this._prng.PRNG),this}h_e(te,fk);rf(te.prototype,"seed",S_e);rf(te.prototype,"seedLength",O_e);p_e(te.prototype,"state",N_e,L_e);rf(te.prototype,"stateLength",E_e);rf(te.prototype,"byteLength",__e);mi(te.prototype,"_read",R_e);mi(te.prototype,"destroy",P_e);dk.exports=te});var ck=s(function(mKe,lk){"use strict";var T_e=require("@stdlib/assert/is-plain-object"),j_e=require("@stdlib/string/format"),M_e=require("@stdlib/object/assign"),x_e=tf();function A_e(r,e,t){var i;if(arguments.length>2){if(i=t,!T_e(i))throw new TypeError(j_e("invalid argument. Options argument must be an object. Value: `%s`.",i));i=M_e({},t)}else i={};return i.objectMode=!0,new x_e(r,e,i)}lk.exports=A_e});var bk=s(function(hKe,qk){"use strict";var mk=require("@stdlib/assert/is-plain-object"),hk=require("@stdlib/object/assign"),pk=require("@stdlib/string/format"),yk=tf();function G_e(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!mk(r))throw new TypeError(pk("invalid argument. Options argument must be an object. Value: `%s`.",r));n=hk({},r)}else if(i>2){if(!mk(t))throw new TypeError(pk("invalid argument. Options argument must be an object. Value: `%s`.",t));n=hk({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new yk(v,g,n)}function o(){return new yk(r,e,n)}}qk.exports=G_e});var Ok=s(function(pKe,Sk){"use strict";var wk=require("@stdlib/utils/define-nonenumerable-read-only-property"),wm=tf(),V_e=ck(),F_e=bk();wk(wm,"objectMode",V_e);wk(wm,"factory",F_e);Sk.exports=wm});var Ek=s(function(yKe,W_e){W_e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var Lk=s(function(qKe,Nk){"use strict";var I_e=require("@stdlib/assert/is-plain-object"),He=require("@stdlib/assert/has-own-property"),k_e=require("@stdlib/assert/is-boolean").isPrimitive,z_e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,_k=require("@stdlib/assert/is-string").isPrimitive,J_e=require("@stdlib/assert/is-positive-integer").isPrimitive,U_e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,bn=require("@stdlib/string/format");function C_e(r,e){return I_e(e)?He(e,"sep")&&(r.sep=e.sep,!_k(r.sep))?new TypeError(bn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):He(e,"objectMode")&&(r.objectMode=e.objectMode,!k_e(r.objectMode))?new TypeError(bn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):He(e,"encoding")&&(r.encoding=e.encoding,!_k(r.encoding)&&r.encoding!==null)?new TypeError(bn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):He(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!z_e(r.highWaterMark))?new TypeError(bn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):He(e,"iter")&&(r.iter=e.iter,!U_e(r.iter))?new TypeError(bn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):He(e,"siter")&&(r.siter=e.siter,!J_e(r.siter))?new TypeError(bn("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(bn("invalid argument. Options argument must be an object. Value: `%s`.",e))}Nk.exports=C_e});var Pk=s(function(bKe,Rk){"use strict";var B_e=require("debug"),D_e=B_e("random:streams:bernoulli");Rk.exports=D_e});var af=s(function(wKe,xk){"use strict";var Mk=require("readable-stream").Readable,X_e=require("@stdlib/assert/is-probability").isPrimitive,Y_e=require("@stdlib/assert/is-error"),H_e=require("@stdlib/object/assign"),Z_e=require("@stdlib/utils/inherit"),Tk=require("@stdlib/utils/define-nonenumerable-property"),hi=require("@stdlib/utils/define-nonenumerable-read-only-property"),nf=require("@stdlib/utils/define-read-only-accessor"),Q_e=require("@stdlib/utils/define-read-write-accessor"),$_e=an().factory,jk=require("@stdlib/buffer/from-string"),K_e=require("@stdlib/utils/next-tick"),eNe=require("@stdlib/string/format"),rNe=Ek(),tNe=Lk(),Qa=Pk();function iNe(){return this._prng.seed}function nNe(){return this._prng.seedLength}function aNe(){return this._prng.stateLength}function sNe(){return this._prng.byteLength}function uNe(){return this._prng.state}function oNe(r){this._prng.state=r}function vNe(){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=jk(e):e=jk(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function gNe(r){var e;if(this._destroyed)return Qa("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,K_e(t),this;function t(){r&&(Qa("Stream was destroyed due to an error. Error: %s.",Y_e(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(!X_e(r))throw new TypeError(eNe("invalid argument. First argument must be a probability. Value: `%s`.",r));if(t=H_e({},rNe),arguments.length>1&&(i=tNe(t,e),i))throw i;return Qa("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),Mk.call(this,t),Tk(this,"_destroyed",!1),hi(this,"_objectMode",t.objectMode),hi(this,"_sep",t.sep),hi(this,"_iter",t.iter),hi(this,"_siter",t.siter),Tk(this,"_i",0),hi(this,"_prng",$_e(r,t)),hi(this,"PRNG",this._prng.PRNG),this}Z_e(ie,Mk);nf(ie.prototype,"seed",iNe);nf(ie.prototype,"seedLength",nNe);Q_e(ie.prototype,"state",uNe,oNe);nf(ie.prototype,"stateLength",aNe);nf(ie.prototype,"byteLength",sNe);hi(ie.prototype,"_read",vNe);hi(ie.prototype,"destroy",gNe);xk.exports=ie});var Gk=s(function(SKe,Ak){"use strict";var fNe=require("@stdlib/assert/is-plain-object"),dNe=require("@stdlib/string/format"),lNe=require("@stdlib/object/assign"),cNe=af();function mNe(r,e){var t;if(arguments.length>1){if(t=e,!fNe(t))throw new TypeError(dNe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=lNe({},e)}else t={};return t.objectMode=!0,new cNe(r,t)}Ak.exports=mNe});var zk=s(function(OKe,kk){"use strict";var Vk=require("@stdlib/assert/is-plain-object"),hNe=require("@stdlib/assert/is-probability").isPrimitive,Fk=require("@stdlib/string/format"),Wk=require("@stdlib/object/assign"),Ik=af();function pNe(r,e){var t,i,n;if(t=arguments.length,t>1){if(!Vk(e))throw new TypeError(Fk("invalid argument. Options argument must be an object. Value: `%s`.",e));n=u,i=Wk({},e)}else if(t===1)if(hNe(r))n=u,i={};else{if(!Vk(r))throw new TypeError(Fk("invalid argument. Options argument must be an object. Value: `%s`.",r));i=Wk({},r),n=a}else i={},n=a;return n;function a(o){return new Ik(o,i)}function u(){return new Ik(r,i)}}kk.exports=pNe});var Ck=s(function(EKe,Uk){"use strict";var Jk=require("@stdlib/utils/define-nonenumerable-read-only-property"),Sm=af(),yNe=Gk(),qNe=zk();Jk(Sm,"objectMode",yNe);Jk(Sm,"factory",qNe);Uk.exports=Sm});var Bk=s(function(_Ke,bNe){bNe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var Yk=s(function(NKe,Xk){"use strict";var wNe=require("@stdlib/assert/is-plain-object"),Ze=require("@stdlib/assert/has-own-property"),SNe=require("@stdlib/assert/is-boolean").isPrimitive,ONe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,Dk=require("@stdlib/assert/is-string").isPrimitive,ENe=require("@stdlib/assert/is-positive-integer").isPrimitive,_Ne=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,wn=require("@stdlib/string/format");function NNe(r,e){return wNe(e)?Ze(e,"sep")&&(r.sep=e.sep,!Dk(r.sep))?new TypeError(wn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Ze(e,"objectMode")&&(r.objectMode=e.objectMode,!SNe(r.objectMode))?new TypeError(wn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Ze(e,"encoding")&&(r.encoding=e.encoding,!Dk(r.encoding)&&r.encoding!==null)?new TypeError(wn("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(wn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Ze(e,"iter")&&(r.iter=e.iter,!_Ne(r.iter))?new TypeError(wn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Ze(e,"siter")&&(r.siter=e.siter,!ENe(r.siter))?new TypeError(wn("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(wn("invalid argument. Options argument must be an object. Value: `%s`.",e))}Xk.exports=NNe});var Zk=s(function(LKe,Hk){"use strict";var LNe=require("debug"),RNe=LNe("random:streams:beta");Hk.exports=RNe});var uf=s(function(RKe,tz){"use strict";var rz=require("readable-stream").Readable,Qk=require("@stdlib/assert/is-positive-number").isPrimitive,PNe=require("@stdlib/assert/is-error"),TNe=require("@stdlib/object/assign"),jNe=require("@stdlib/utils/inherit"),$k=require("@stdlib/utils/define-nonenumerable-property"),pi=require("@stdlib/utils/define-nonenumerable-read-only-property"),sf=require("@stdlib/utils/define-read-only-accessor"),MNe=require("@stdlib/utils/define-read-write-accessor"),xNe=un().factory,Kk=require("@stdlib/buffer/from-string"),ANe=require("@stdlib/utils/next-tick"),ez=require("@stdlib/string/format"),GNe=Bk(),VNe=Yk(),$a=Zk();function FNe(){return this._prng.seed}function WNe(){return this._prng.seedLength}function INe(){return this._prng.stateLength}function kNe(){return this._prng.byteLength}function zNe(){return this._prng.state}function JNe(r){this._prng.state=r}function UNe(){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=Kk(e):e=Kk(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function CNe(r){var e;if(this._destroyed)return $a("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,ANe(t),this;function t(){r&&($a("Stream was destroyed due to an error. Error: %s.",PNe(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(!Qk(r))throw new TypeError(ez("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!Qk(e))throw new TypeError(ez("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=TNe({},GNe),arguments.length>2&&(n=VNe(i,t),n))throw n;return $a("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),rz.call(this,i),$k(this,"_destroyed",!1),pi(this,"_objectMode",i.objectMode),pi(this,"_sep",i.sep),pi(this,"_iter",i.iter),pi(this,"_siter",i.siter),$k(this,"_i",0),pi(this,"_prng",xNe(r,e,i)),pi(this,"PRNG",this._prng.PRNG),this}jNe(ne,rz);sf(ne.prototype,"seed",FNe);sf(ne.prototype,"seedLength",WNe);MNe(ne.prototype,"state",zNe,JNe);sf(ne.prototype,"stateLength",INe);sf(ne.prototype,"byteLength",kNe);pi(ne.prototype,"_read",UNe);pi(ne.prototype,"destroy",CNe);tz.exports=ne});var nz=s(function(PKe,iz){"use strict";var BNe=require("@stdlib/assert/is-plain-object"),DNe=require("@stdlib/string/format"),XNe=require("@stdlib/object/assign"),YNe=uf();function HNe(r,e,t){var i;if(arguments.length>2){if(i=t,!BNe(i))throw new TypeError(DNe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=XNe({},t)}else i={};return i.objectMode=!0,new YNe(r,e,i)}iz.exports=HNe});var gz=s(function(TKe,vz){"use strict";var az=require("@stdlib/assert/is-plain-object"),sz=require("@stdlib/object/assign"),uz=require("@stdlib/string/format"),oz=uf();function ZNe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!az(r))throw new TypeError(uz("invalid argument. Options argument must be an object. Value: `%s`.",r));n=sz({},r)}else if(i>2){if(!az(t))throw new TypeError(uz("invalid argument. Options argument must be an object. Value: `%s`.",t));n=sz({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new oz(v,g,n)}function o(){return new oz(r,e,n)}}vz.exports=ZNe});var lz=s(function(jKe,dz){"use strict";var fz=require("@stdlib/utils/define-nonenumerable-read-only-property"),Om=uf(),QNe=nz(),$Ne=gz();fz(Om,"objectMode",QNe);fz(Om,"factory",$Ne);dz.exports=Om});var cz=s(function(MKe,KNe){KNe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var pz=s(function(xKe,hz){"use strict";var eLe=require("@stdlib/assert/is-plain-object"),Qe=require("@stdlib/assert/has-own-property"),rLe=require("@stdlib/assert/is-boolean").isPrimitive,tLe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,mz=require("@stdlib/assert/is-string").isPrimitive,iLe=require("@stdlib/assert/is-positive-integer").isPrimitive,nLe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Sn=require("@stdlib/string/format");function aLe(r,e){return eLe(e)?Qe(e,"sep")&&(r.sep=e.sep,!mz(r.sep))?new TypeError(Sn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Qe(e,"objectMode")&&(r.objectMode=e.objectMode,!rLe(r.objectMode))?new TypeError(Sn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Qe(e,"encoding")&&(r.encoding=e.encoding,!mz(r.encoding)&&r.encoding!==null)?new TypeError(Sn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Qe(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!tLe(r.highWaterMark))?new TypeError(Sn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Qe(e,"iter")&&(r.iter=e.iter,!nLe(r.iter))?new TypeError(Sn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Qe(e,"siter")&&(r.siter=e.siter,!iLe(r.siter))?new TypeError(Sn("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(Sn("invalid argument. Options argument must be an object. Value: `%s`.",e))}hz.exports=aLe});var qz=s(function(AKe,yz){"use strict";var sLe=require("debug"),uLe=sLe("random:streams:betaprime");yz.exports=uLe});var vf=s(function(GKe,_z){"use strict";var Ez=require("readable-stream").Readable,bz=require("@stdlib/assert/is-positive-number").isPrimitive,oLe=require("@stdlib/assert/is-error"),vLe=require("@stdlib/object/assign"),gLe=require("@stdlib/utils/inherit"),wz=require("@stdlib/utils/define-nonenumerable-property"),yi=require("@stdlib/utils/define-nonenumerable-read-only-property"),of=require("@stdlib/utils/define-read-only-accessor"),fLe=require("@stdlib/utils/define-read-write-accessor"),dLe=on().factory,Sz=require("@stdlib/buffer/from-string"),lLe=require("@stdlib/utils/next-tick"),Oz=require("@stdlib/string/format"),cLe=cz(),mLe=pz(),Ka=qz();function hLe(){return this._prng.seed}function pLe(){return this._prng.seedLength}function yLe(){return this._prng.stateLength}function qLe(){return this._prng.byteLength}function bLe(){return this._prng.state}function wLe(r){this._prng.state=r}function SLe(){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=Sz(e):e=Sz(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function OLe(r){var e;if(this._destroyed)return Ka("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,lLe(t),this;function t(){r&&(Ka("Stream was destroyed due to an error. Error: %s.",oLe(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(!bz(r))throw new TypeError(Oz("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!bz(e))throw new TypeError(Oz("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=vLe({},cLe),arguments.length>2&&(n=mLe(i,t),n))throw n;return Ka("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),Ez.call(this,i),wz(this,"_destroyed",!1),yi(this,"_objectMode",i.objectMode),yi(this,"_sep",i.sep),yi(this,"_iter",i.iter),yi(this,"_siter",i.siter),wz(this,"_i",0),yi(this,"_prng",dLe(r,e,i)),yi(this,"PRNG",this._prng.PRNG),this}gLe(ae,Ez);of(ae.prototype,"seed",hLe);of(ae.prototype,"seedLength",pLe);fLe(ae.prototype,"state",bLe,wLe);of(ae.prototype,"stateLength",yLe);of(ae.prototype,"byteLength",qLe);yi(ae.prototype,"_read",SLe);yi(ae.prototype,"destroy",OLe);_z.exports=ae});var Lz=s(function(VKe,Nz){"use strict";var ELe=require("@stdlib/assert/is-plain-object"),_Le=require("@stdlib/string/format"),NLe=require("@stdlib/object/assign"),LLe=vf();function RLe(r,e,t){var i;if(arguments.length>2){if(i=t,!ELe(i))throw new TypeError(_Le("invalid argument. Options argument must be an object. Value: `%s`.",i));i=NLe({},t)}else i={};return i.objectMode=!0,new LLe(r,e,i)}Nz.exports=RLe});var xz=s(function(FKe,Mz){"use strict";var Rz=require("@stdlib/assert/is-plain-object"),Pz=require("@stdlib/object/assign"),Tz=require("@stdlib/string/format"),jz=vf();function PLe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!Rz(r))throw new TypeError(Tz("invalid argument. Options argument must be an object. Value: `%s`.",r));n=Pz({},r)}else if(i>2){if(!Rz(t))throw new TypeError(Tz("invalid argument. Options argument must be an object. Value: `%s`.",t));n=Pz({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new jz(v,g,n)}function o(){return new jz(r,e,n)}}Mz.exports=PLe});var Vz=s(function(WKe,Gz){"use strict";var Az=require("@stdlib/utils/define-nonenumerable-read-only-property"),Em=vf(),TLe=Lz(),jLe=xz();Az(Em,"objectMode",TLe);Az(Em,"factory",jLe);Gz.exports=Em});var Fz=s(function(IKe,MLe){MLe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var kz=s(function(kKe,Iz){"use strict";var xLe=require("@stdlib/assert/is-plain-object"),$e=require("@stdlib/assert/has-own-property"),ALe=require("@stdlib/assert/is-boolean").isPrimitive,GLe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,Wz=require("@stdlib/assert/is-string").isPrimitive,VLe=require("@stdlib/assert/is-positive-integer").isPrimitive,FLe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,On=require("@stdlib/string/format");function WLe(r,e){return xLe(e)?$e(e,"sep")&&(r.sep=e.sep,!Wz(r.sep))?new TypeError(On("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):$e(e,"objectMode")&&(r.objectMode=e.objectMode,!ALe(r.objectMode))?new TypeError(On("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):$e(e,"encoding")&&(r.encoding=e.encoding,!Wz(r.encoding)&&r.encoding!==null)?new TypeError(On("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):$e(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!GLe(r.highWaterMark))?new TypeError(On("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):$e(e,"iter")&&(r.iter=e.iter,!FLe(r.iter))?new TypeError(On("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):$e(e,"siter")&&(r.siter=e.siter,!VLe(r.siter))?new TypeError(On("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(On("invalid argument. Options argument must be an object. Value: `%s`.",e))}Iz.exports=WLe});var Jz=s(function(zKe,zz){"use strict";var ILe=require("debug"),kLe=ILe("random:streams:binomial");zz.exports=kLe});var ff=s(function(JKe,Xz){"use strict";var Dz=require("readable-stream").Readable,zLe=require("@stdlib/assert/is-positive-integer").isPrimitive,JLe=require("@stdlib/assert/is-probability").isPrimitive,ULe=require("@stdlib/assert/is-error"),CLe=require("@stdlib/object/assign"),BLe=require("@stdlib/utils/inherit"),Uz=require("@stdlib/utils/define-nonenumerable-property"),qi=require("@stdlib/utils/define-nonenumerable-read-only-property"),gf=require("@stdlib/utils/define-read-only-accessor"),DLe=require("@stdlib/utils/define-read-write-accessor"),XLe=da().factory,Cz=require("@stdlib/buffer/from-string"),YLe=require("@stdlib/utils/next-tick"),Bz=require("@stdlib/string/format"),HLe=Fz(),ZLe=kz(),es=Jz();function QLe(){return this._prng.seed}function $Le(){return this._prng.seedLength}function KLe(){return this._prng.stateLength}function eRe(){return this._prng.byteLength}function rRe(){return this._prng.state}function tRe(r){this._prng.state=r}function iRe(){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=Cz(e):e=Cz(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function nRe(r){var e;if(this._destroyed)return es("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,YLe(t),this;function t(){r&&(es("Stream was destroyed due to an error. Error: %s.",ULe(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(!zLe(r))throw new TypeError(Bz("invalid argument. First argument must be a positive integer. Value: `%s`.",r));if(!JLe(e))throw new TypeError(Bz("invalid argument. Second argument must be a probability. Value: `%s`.",e));if(i=CLe({},HLe),arguments.length>2&&(n=ZLe(i,t),n))throw n;return es("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),Dz.call(this,i),Uz(this,"_destroyed",!1),qi(this,"_objectMode",i.objectMode),qi(this,"_sep",i.sep),qi(this,"_iter",i.iter),qi(this,"_siter",i.siter),Uz(this,"_i",0),qi(this,"_prng",XLe(r,e,i)),qi(this,"PRNG",this._prng.PRNG),this}BLe(se,Dz);gf(se.prototype,"seed",QLe);gf(se.prototype,"seedLength",$Le);DLe(se.prototype,"state",rRe,tRe);gf(se.prototype,"stateLength",KLe);gf(se.prototype,"byteLength",eRe);qi(se.prototype,"_read",iRe);qi(se.prototype,"destroy",nRe);Xz.exports=se});var Hz=s(function(UKe,Yz){"use strict";var aRe=require("@stdlib/assert/is-plain-object"),sRe=require("@stdlib/object/assign"),uRe=require("@stdlib/string/format"),oRe=ff();function vRe(r,e,t){var i;if(arguments.length>2){if(i=t,!aRe(i))throw new TypeError(uRe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=sRe({},t)}else i={};return i.objectMode=!0,new oRe(r,e,i)}Yz.exports=vRe});var r3=s(function(CKe,e3){"use strict";var Zz=require("@stdlib/assert/is-plain-object"),Qz=require("@stdlib/object/assign"),$z=require("@stdlib/string/format"),Kz=ff();function gRe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!Zz(r))throw new TypeError($z("invalid argument. Options argument must be an object. Value: `%s`.",r));n=Qz({},r)}else if(i>2){if(!Zz(t))throw new TypeError($z("invalid argument. Options argument must be an object. Value: `%s`.",t));n=Qz({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new Kz(v,g,n)}function o(){return new Kz(r,e,n)}}e3.exports=gRe});var n3=s(function(BKe,i3){"use strict";var t3=require("@stdlib/utils/define-nonenumerable-read-only-property"),_m=ff(),fRe=Hz(),dRe=r3();t3(_m,"objectMode",fRe);t3(_m,"factory",dRe);i3.exports=_m});var a3=s(function(DKe,lRe){lRe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var o3=s(function(XKe,u3){"use strict";var cRe=require("@stdlib/assert/is-plain-object"),Ke=require("@stdlib/assert/has-own-property"),mRe=require("@stdlib/assert/is-boolean").isPrimitive,hRe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,s3=require("@stdlib/assert/is-string").isPrimitive,pRe=require("@stdlib/assert/is-positive-integer").isPrimitive,yRe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,En=require("@stdlib/string/format");function qRe(r,e){return cRe(e)?Ke(e,"sep")&&(r.sep=e.sep,!s3(r.sep))?new TypeError(En("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Ke(e,"objectMode")&&(r.objectMode=e.objectMode,!mRe(r.objectMode))?new TypeError(En("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Ke(e,"encoding")&&(r.encoding=e.encoding,!s3(r.encoding)&&r.encoding!==null)?new TypeError(En("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Ke(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!hRe(r.highWaterMark))?new TypeError(En("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Ke(e,"iter")&&(r.iter=e.iter,!yRe(r.iter))?new TypeError(En("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Ke(e,"siter")&&(r.siter=e.siter,!pRe(r.siter))?new TypeError(En("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(En("invalid argument. Options argument must be an object. Value: `%s`.",e))}u3.exports=qRe});var g3=s(function(YKe,v3){"use strict";var bRe=require("debug"),wRe=bRe("random:streams:box-muller");v3.exports=wRe});var lf=s(function(HKe,c3){"use strict";var l3=require("readable-stream").Readable,SRe=require("@stdlib/assert/is-error"),ORe=require("@stdlib/object/assign"),ERe=require("@stdlib/utils/inherit"),f3=require("@stdlib/utils/define-nonenumerable-property"),bi=require("@stdlib/utils/define-nonenumerable-read-only-property"),df=require("@stdlib/utils/define-read-only-accessor"),_Re=require("@stdlib/utils/define-read-write-accessor"),NRe=Xa().factory,d3=require("@stdlib/buffer/from-string"),LRe=require("@stdlib/utils/next-tick"),RRe=a3(),PRe=o3(),rs=g3();function TRe(){return this._prng.seed}function jRe(){return this._prng.seedLength}function MRe(){return this._prng.stateLength}function xRe(){return this._prng.byteLength}function ARe(){return this._prng.state}function GRe(r){this._prng.state=r}function VRe(){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=d3(e):e=d3(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function FRe(r){var e;if(this._destroyed)return rs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,LRe(t),this;function t(){r&&(rs("Stream was destroyed due to an error. Error: %s.",SRe(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=ORe({},RRe),arguments.length>0&&(t=PRe(e,r),t))throw t;return rs("Creating a readable stream configured with the following options: %s.",JSON.stringify(e)),l3.call(this,e),f3(this,"_destroyed",!1),bi(this,"_objectMode",e.objectMode),bi(this,"_sep",e.sep),bi(this,"_iter",e.iter),bi(this,"_siter",e.siter),f3(this,"_i",0),bi(this,"_prng",NRe(e)),bi(this,"PRNG",this._prng.PRNG),this}ERe(ue,l3);df(ue.prototype,"seed",TRe);df(ue.prototype,"seedLength",jRe);_Re(ue.prototype,"state",ARe,GRe);df(ue.prototype,"stateLength",MRe);df(ue.prototype,"byteLength",xRe);bi(ue.prototype,"_read",VRe);bi(ue.prototype,"destroy",FRe);c3.exports=ue});var h3=s(function(ZKe,m3){"use strict";var WRe=require("@stdlib/assert/is-plain-object"),IRe=require("@stdlib/object/assign"),kRe=require("@stdlib/string/format"),zRe=lf();function JRe(r){var e;if(arguments.length>0){if(e=r,!WRe(e))throw new TypeError(kRe("invalid argument. Options argument must be an object. Value: `%s`.",e));e=IRe({},r)}else e={};return e.objectMode=!0,new zRe(e)}m3.exports=JRe});var y3=s(function(QKe,p3){"use strict";var URe=require("@stdlib/assert/is-plain-object"),CRe=require("@stdlib/object/assign"),BRe=require("@stdlib/string/format"),DRe=lf();function XRe(r){var e;if(arguments.length>0){if(!URe(r))throw new TypeError(BRe("invalid argument. Options argument must be an object. Value: `%s`.",r));e=CRe({},r)}else e={};return t;function t(){return new DRe(e)}}p3.exports=XRe});var w3=s(function($Ke,b3){"use strict";var q3=require("@stdlib/utils/define-nonenumerable-read-only-property"),Nm=lf(),YRe=h3(),HRe=y3();q3(Nm,"objectMode",YRe);q3(Nm,"factory",HRe);b3.exports=Nm});var S3=s(function(KKe,ZRe){ZRe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var _3=s(function(eer,E3){"use strict";var QRe=require("@stdlib/assert/is-plain-object"),er=require("@stdlib/assert/has-own-property"),$Re=require("@stdlib/assert/is-boolean").isPrimitive,KRe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,O3=require("@stdlib/assert/is-string").isPrimitive,ePe=require("@stdlib/assert/is-positive-integer").isPrimitive,rPe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,_n=require("@stdlib/string/format");function tPe(r,e){return QRe(e)?er(e,"sep")&&(r.sep=e.sep,!O3(r.sep))?new TypeError(_n("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):er(e,"objectMode")&&(r.objectMode=e.objectMode,!$Re(r.objectMode))?new TypeError(_n("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):er(e,"encoding")&&(r.encoding=e.encoding,!O3(r.encoding)&&r.encoding!==null)?new TypeError(_n("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):er(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!KRe(r.highWaterMark))?new TypeError(_n("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):er(e,"iter")&&(r.iter=e.iter,!rPe(r.iter))?new TypeError(_n("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):er(e,"siter")&&(r.siter=e.siter,!ePe(r.siter))?new TypeError(_n("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(_n("invalid argument. Options argument must be an object. Value: `%s`.",e))}E3.exports=tPe});var L3=s(function(rer,N3){"use strict";var iPe=require("debug"),nPe=iPe("random:streams:cauchy");N3.exports=nPe});var mf=s(function(ter,M3){"use strict";var j3=require("readable-stream").Readable,aPe=require("@stdlib/assert/is-positive-number").isPrimitive,sPe=require("@stdlib/assert/is-number").isPrimitive,uPe=require("@stdlib/math/base/assert/is-nan"),oPe=require("@stdlib/assert/is-error"),vPe=require("@stdlib/object/assign"),gPe=require("@stdlib/utils/inherit"),R3=require("@stdlib/utils/define-nonenumerable-property"),wi=require("@stdlib/utils/define-nonenumerable-read-only-property"),cf=require("@stdlib/utils/define-read-only-accessor"),fPe=require("@stdlib/utils/define-read-write-accessor"),dPe=ca().factory,P3=require("@stdlib/buffer/from-string"),lPe=require("@stdlib/utils/next-tick"),T3=require("@stdlib/string/format"),cPe=S3(),mPe=_3(),ts=L3();function hPe(){return this._prng.seed}function pPe(){return this._prng.seedLength}function yPe(){return this._prng.stateLength}function qPe(){return this._prng.byteLength}function bPe(){return this._prng.state}function wPe(r){this._prng.state=r}function SPe(){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=P3(e):e=P3(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function OPe(r){var e;if(this._destroyed)return ts("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,lPe(t),this;function t(){r&&(ts("Stream was destroyed due to an error. Error: %s.",oPe(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(!sPe(r)||uPe(r))throw new TypeError(T3("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!aPe(e))throw new TypeError(T3("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=vPe({},cPe),arguments.length>2&&(n=mPe(i,t),n))throw n;return ts("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),j3.call(this,i),R3(this,"_destroyed",!1),wi(this,"_objectMode",i.objectMode),wi(this,"_sep",i.sep),wi(this,"_iter",i.iter),wi(this,"_siter",i.siter),R3(this,"_i",0),wi(this,"_prng",dPe(r,e,i)),wi(this,"PRNG",this._prng.PRNG),this}gPe(oe,j3);cf(oe.prototype,"seed",hPe);cf(oe.prototype,"seedLength",pPe);fPe(oe.prototype,"state",bPe,wPe);cf(oe.prototype,"stateLength",yPe);cf(oe.prototype,"byteLength",qPe);wi(oe.prototype,"_read",SPe);wi(oe.prototype,"destroy",OPe);M3.exports=oe});var A3=s(function(ier,x3){"use strict";var EPe=require("@stdlib/assert/is-plain-object"),_Pe=require("@stdlib/object/assign"),NPe=require("@stdlib/string/format"),LPe=mf();function RPe(r,e,t){var i;if(arguments.length>2){if(i=t,!EPe(i))throw new TypeError(NPe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=_Pe({},t)}else i={};return i.objectMode=!0,new LPe(r,e,i)}x3.exports=RPe});var k3=s(function(ner,I3){"use strict";var G3=require("@stdlib/assert/is-plain-object"),V3=require("@stdlib/object/assign"),F3=require("@stdlib/string/format"),W3=mf();function PPe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!G3(r))throw new TypeError(F3("invalid argument. Options argument must be an object. Value: `%s`.",r));n=V3({},r)}else if(i>2){if(!G3(t))throw new TypeError(F3("invalid argument. Options argument must be an object. Value: `%s`.",t));n=V3({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new W3(v,g,n)}function o(){return new W3(r,e,n)}}I3.exports=PPe});var U3=s(function(aer,J3){"use strict";var z3=require("@stdlib/utils/define-nonenumerable-read-only-property"),Lm=mf(),TPe=A3(),jPe=k3();z3(Lm,"objectMode",TPe);z3(Lm,"factory",jPe);J3.exports=Lm});var C3=s(function(ser,MPe){MPe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var X3=s(function(uer,D3){"use strict";var xPe=require("@stdlib/assert/is-plain-object"),rr=require("@stdlib/assert/has-own-property"),APe=require("@stdlib/assert/is-boolean").isPrimitive,GPe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,B3=require("@stdlib/assert/is-string").isPrimitive,VPe=require("@stdlib/assert/is-positive-integer").isPrimitive,FPe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Nn=require("@stdlib/string/format");function WPe(r,e){return xPe(e)?rr(e,"sep")&&(r.sep=e.sep,!B3(r.sep))?new TypeError(Nn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):rr(e,"objectMode")&&(r.objectMode=e.objectMode,!APe(r.objectMode))?new TypeError(Nn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):rr(e,"encoding")&&(r.encoding=e.encoding,!B3(r.encoding)&&r.encoding!==null)?new TypeError(Nn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):rr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!GPe(r.highWaterMark))?new TypeError(Nn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):rr(e,"iter")&&(r.iter=e.iter,!FPe(r.iter))?new TypeError(Nn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):rr(e,"siter")&&(r.siter=e.siter,!VPe(r.siter))?new TypeError(Nn("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(Nn("invalid argument. Options argument must be an object. Value: `%s`.",e))}D3.exports=WPe});var H3=s(function(oer,Y3){"use strict";var IPe=require("debug"),kPe=IPe("random:streams:chi");Y3.exports=kPe});var pf=s(function(ver,K3){"use strict";var $3=require("readable-stream").Readable,zPe=require("@stdlib/assert/is-positive-number").isPrimitive,JPe=require("@stdlib/assert/is-error"),UPe=require("@stdlib/object/assign"),CPe=require("@stdlib/utils/inherit"),Z3=require("@stdlib/utils/define-nonenumerable-property"),Si=require("@stdlib/utils/define-nonenumerable-read-only-property"),hf=require("@stdlib/utils/define-read-only-accessor"),BPe=require("@stdlib/utils/define-read-write-accessor"),DPe=pa().factory,Q3=require("@stdlib/buffer/from-string"),XPe=require("@stdlib/utils/next-tick"),YPe=require("@stdlib/string/format"),HPe=C3(),ZPe=X3(),is=H3();function QPe(){return this._prng.seed}function $Pe(){return this._prng.seedLength}function KPe(){return this._prng.stateLength}function eTe(){return this._prng.byteLength}function rTe(){return this._prng.state}function tTe(r){this._prng.state=r}function iTe(){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=Q3(e):e=Q3(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function nTe(r){var e;if(this._destroyed)return is("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,XPe(t),this;function t(){r&&(is("Stream was destroyed due to an error. Error: %s.",JPe(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(!zPe(r))throw new TypeError(YPe("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(t=UPe({},HPe),arguments.length>1&&(i=ZPe(t,e),i))throw i;return is("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),$3.call(this,t),Z3(this,"_destroyed",!1),Si(this,"_objectMode",t.objectMode),Si(this,"_sep",t.sep),Si(this,"_iter",t.iter),Si(this,"_siter",t.siter),Z3(this,"_i",0),Si(this,"_prng",DPe(r,t)),Si(this,"PRNG",this._prng.PRNG),this}CPe(ve,$3);hf(ve.prototype,"seed",QPe);hf(ve.prototype,"seedLength",$Pe);BPe(ve.prototype,"state",rTe,tTe);hf(ve.prototype,"stateLength",KPe);hf(ve.prototype,"byteLength",eTe);Si(ve.prototype,"_read",iTe);Si(ve.prototype,"destroy",nTe);K3.exports=ve});var rJ=s(function(ger,eJ){"use strict";var aTe=require("@stdlib/assert/is-plain-object"),sTe=require("@stdlib/object/assign"),uTe=require("@stdlib/string/format"),oTe=pf();function vTe(r,e){var t;if(arguments.length>1){if(t=e,!aTe(t))throw new TypeError(uTe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=sTe({},e)}else t={};return t.objectMode=!0,new oTe(r,t)}eJ.exports=vTe});var uJ=s(function(fer,sJ){"use strict";var tJ=require("@stdlib/assert/is-plain-object"),gTe=require("@stdlib/assert/is-positive-number").isPrimitive,iJ=require("@stdlib/object/assign"),nJ=require("@stdlib/string/format"),aJ=pf();function fTe(r,e){var t,i,n;if(t=arguments.length,t>1){if(!tJ(e))throw new TypeError(nJ("invalid argument. Options argument must be an object. Value: `%s`.",e));n=u,i=iJ({},e)}else if(t===1)if(gTe(r))n=u,i={};else{if(!tJ(r))throw new TypeError(nJ("invalid argument. Options argument must be an object. Value: `%s`.",r));i=iJ({},r),n=a}else i={},n=a;return n;function a(o){return new aJ(o,i)}function u(){return new aJ(r,i)}}sJ.exports=fTe});var gJ=s(function(der,vJ){"use strict";var oJ=require("@stdlib/utils/define-nonenumerable-read-only-property"),Rm=pf(),dTe=rJ(),lTe=uJ();oJ(Rm,"objectMode",dTe);oJ(Rm,"factory",lTe);vJ.exports=Rm});var fJ=s(function(ler,cTe){cTe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var cJ=s(function(cer,lJ){"use strict";var mTe=require("@stdlib/assert/is-plain-object"),tr=require("@stdlib/assert/has-own-property"),hTe=require("@stdlib/assert/is-boolean").isPrimitive,pTe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,dJ=require("@stdlib/assert/is-string").isPrimitive,yTe=require("@stdlib/assert/is-positive-integer").isPrimitive,qTe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Ln=require("@stdlib/string/format");function bTe(r,e){return mTe(e)?tr(e,"sep")&&(r.sep=e.sep,!dJ(r.sep))?new TypeError(Ln("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):tr(e,"objectMode")&&(r.objectMode=e.objectMode,!hTe(r.objectMode))?new TypeError(Ln("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):tr(e,"encoding")&&(r.encoding=e.encoding,!dJ(r.encoding)&&r.encoding!==null)?new TypeError(Ln("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):tr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!pTe(r.highWaterMark))?new TypeError(Ln("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):tr(e,"iter")&&(r.iter=e.iter,!qTe(r.iter))?new TypeError(Ln("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):tr(e,"siter")&&(r.siter=e.siter,!yTe(r.siter))?new TypeError(Ln("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(Ln("invalid argument. Options argument must be an object. Value: `%s`.",e))}lJ.exports=bTe});var hJ=s(function(mer,mJ){"use strict";var wTe=require("debug"),STe=wTe("random:streams:chisquare");mJ.exports=STe});var qf=s(function(her,bJ){"use strict";var qJ=require("readable-stream").Readable,OTe=require("@stdlib/assert/is-positive-number").isPrimitive,ETe=require("@stdlib/assert/is-error"),_Te=require("@stdlib/object/assign"),NTe=require("@stdlib/utils/inherit"),pJ=require("@stdlib/utils/define-nonenumerable-property"),Oi=require("@stdlib/utils/define-nonenumerable-read-only-property"),yf=require("@stdlib/utils/define-read-only-accessor"),LTe=require("@stdlib/utils/define-read-write-accessor"),RTe=Ur().factory,yJ=require("@stdlib/buffer/from-string"),PTe=require("@stdlib/utils/next-tick"),TTe=require("@stdlib/string/format"),jTe=fJ(),MTe=cJ(),ns=hJ();function xTe(){return this._prng.seed}function ATe(){return this._prng.seedLength}function GTe(){return this._prng.stateLength}function VTe(){return this._prng.byteLength}function FTe(){return this._prng.state}function WTe(r){this._prng.state=r}function ITe(){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=yJ(e):e=yJ(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function kTe(r){var e;if(this._destroyed)return ns("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,PTe(t),this;function t(){r&&(ns("Stream was destroyed due to an error. Error: %s.",ETe(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(!OTe(r))throw new TypeError(TTe("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(t=_Te({},jTe),arguments.length>1&&(i=MTe(t,e),i))throw i;return ns("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),qJ.call(this,t),pJ(this,"_destroyed",!1),Oi(this,"_objectMode",t.objectMode),Oi(this,"_sep",t.sep),Oi(this,"_iter",t.iter),Oi(this,"_siter",t.siter),pJ(this,"_i",0),Oi(this,"_prng",RTe(r,t)),Oi(this,"PRNG",this._prng.PRNG),this}NTe(ge,qJ);yf(ge.prototype,"seed",xTe);yf(ge.prototype,"seedLength",ATe);LTe(ge.prototype,"state",FTe,WTe);yf(ge.prototype,"stateLength",GTe);yf(ge.prototype,"byteLength",VTe);Oi(ge.prototype,"_read",ITe);Oi(ge.prototype,"destroy",kTe);bJ.exports=ge});var SJ=s(function(per,wJ){"use strict";var zTe=require("@stdlib/assert/is-plain-object"),JTe=require("@stdlib/object/assign"),UTe=require("@stdlib/string/format"),CTe=qf();function BTe(r,e){var t;if(arguments.length>1){if(t=e,!zTe(t))throw new TypeError(UTe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=JTe({},t)}else t={};return t.objectMode=!0,new CTe(r,t)}wJ.exports=BTe});var RJ=s(function(yer,LJ){"use strict";var DTe=require("@stdlib/assert/is-positive-number").isPrimitive,OJ=require("@stdlib/assert/is-plain-object"),EJ=require("@stdlib/object/assign"),_J=require("@stdlib/string/format"),NJ=qf();function XTe(r,e){var t,i,n;if(t=arguments.length,t>1){if(!OJ(e))throw new TypeError(_J("invalid argument. Options argument must be an object. Value: `%s`.",e));n=u,i=EJ({},e)}else if(t===1)if(DTe(r))n=u,i={};else{if(!OJ(r))throw new TypeError(_J("invalid argument. Options argument must be an object. Value: `%s`.",r));i=EJ({},r),n=a}else i={},n=a;return n;function a(o){return new NJ(o,i)}function u(){return new NJ(r,i)}}LJ.exports=XTe});var jJ=s(function(qer,TJ){"use strict";var PJ=require("@stdlib/utils/define-nonenumerable-read-only-property"),Pm=qf(),YTe=SJ(),HTe=RJ();PJ(Pm,"objectMode",YTe);PJ(Pm,"factory",HTe);TJ.exports=Pm});var MJ=s(function(ber,ZTe){ZTe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var GJ=s(function(wer,AJ){"use strict";var QTe=require("@stdlib/assert/is-plain-object"),ir=require("@stdlib/assert/has-own-property"),$Te=require("@stdlib/assert/is-boolean").isPrimitive,KTe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,xJ=require("@stdlib/assert/is-string").isPrimitive,eje=require("@stdlib/assert/is-positive-integer").isPrimitive,rje=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Rn=require("@stdlib/string/format");function tje(r,e){return QTe(e)?ir(e,"sep")&&(r.sep=e.sep,!xJ(r.sep))?new TypeError(Rn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):ir(e,"objectMode")&&(r.objectMode=e.objectMode,!$Te(r.objectMode))?new TypeError(Rn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):ir(e,"encoding")&&(r.encoding=e.encoding,!xJ(r.encoding)&&r.encoding!==null)?new TypeError(Rn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):ir(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!KTe(r.highWaterMark))?new TypeError(Rn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):ir(e,"iter")&&(r.iter=e.iter,!rje(r.iter))?new TypeError(Rn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):ir(e,"siter")&&(r.siter=e.siter,!eje(r.siter))?new TypeError(Rn("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(Rn("invalid argument. Options argument must be an object. Value: `%s`.",e))}AJ.exports=tje});var FJ=s(function(Ser,VJ){"use strict";var ije=require("debug"),nje=ije("random:streams:cosine");VJ.exports=nje});var wf=s(function(Oer,JJ){"use strict";var zJ=require("readable-stream").Readable,aje=require("@stdlib/assert/is-positive-number").isPrimitive,sje=require("@stdlib/assert/is-number").isPrimitive,uje=require("@stdlib/math/base/assert/is-nan"),oje=require("@stdlib/assert/is-error"),vje=require("@stdlib/object/assign"),gje=require("@stdlib/utils/inherit"),WJ=require("@stdlib/utils/define-nonenumerable-property"),Ei=require("@stdlib/utils/define-nonenumerable-read-only-property"),bf=require("@stdlib/utils/define-read-only-accessor"),fje=require("@stdlib/utils/define-read-write-accessor"),dje=vn().factory,IJ=require("@stdlib/buffer/from-string"),lje=require("@stdlib/utils/next-tick"),kJ=require("@stdlib/string/format"),cje=MJ(),mje=GJ(),as=FJ();function hje(){return this._prng.seed}function pje(){return this._prng.seedLength}function yje(){return this._prng.stateLength}function qje(){return this._prng.byteLength}function bje(){return this._prng.state}function wje(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 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=IJ(e):e=IJ(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function Oje(r){var e;if(this._destroyed)return as("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,lje(t),this;function t(){r&&(as("Stream was destroyed due to an error. Error: %s.",oje(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(!sje(r)||uje(r))throw new TypeError(kJ("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!aje(e))throw new TypeError(kJ("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=vje({},cje),arguments.length>2&&(n=mje(i,t),n))throw n;return as("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),zJ.call(this,i),WJ(this,"_destroyed",!1),Ei(this,"_objectMode",i.objectMode),Ei(this,"_sep",i.sep),Ei(this,"_iter",i.iter),Ei(this,"_siter",i.siter),WJ(this,"_i",0),Ei(this,"_prng",dje(r,e,i)),Ei(this,"PRNG",this._prng.PRNG),this}gje(fe,zJ);bf(fe.prototype,"seed",hje);bf(fe.prototype,"seedLength",pje);fje(fe.prototype,"state",bje,wje);bf(fe.prototype,"stateLength",yje);bf(fe.prototype,"byteLength",qje);Ei(fe.prototype,"_read",Sje);Ei(fe.prototype,"destroy",Oje);JJ.exports=fe});var CJ=s(function(Eer,UJ){"use strict";var Eje=require("@stdlib/assert/is-plain-object"),_je=require("@stdlib/object/assign"),Nje=require("@stdlib/string/format"),Lje=wf();function Rje(r,e,t){var i;if(arguments.length>2){if(i=t,!Eje(i))throw new TypeError(Nje("invalid argument. Options argument must be an object. Value: `%s`.",i));i=_je({},t)}else i={};return i.objectMode=!0,new Lje(r,e,i)}UJ.exports=Rje});var ZJ=s(function(_er,HJ){"use strict";var BJ=require("@stdlib/assert/is-plain-object"),DJ=require("@stdlib/object/assign"),XJ=require("@stdlib/string/format"),YJ=wf();function Pje(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!BJ(r))throw new TypeError(XJ("invalid argument. Options argument must be an object. Value: `%s`.",r));n=DJ({},r)}else if(i>2){if(!BJ(t))throw new TypeError(XJ("invalid argument. Options argument must be an object. Value: `%s`.",t));n=DJ({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new YJ(v,g,n)}function o(){return new YJ(r,e,n)}}HJ.exports=Pje});var KJ=s(function(Ner,$J){"use strict";var QJ=require("@stdlib/utils/define-nonenumerable-read-only-property"),Tm=wf(),Tje=CJ(),jje=ZJ();QJ(Tm,"objectMode",Tje);QJ(Tm,"factory",jje);$J.exports=Tm});var eU=s(function(Ler,Mje){Mje.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var iU=s(function(Rer,tU){"use strict";var xje=require("@stdlib/assert/is-plain-object"),nr=require("@stdlib/assert/has-own-property"),Aje=require("@stdlib/assert/is-boolean").isPrimitive,Gje=require("@stdlib/assert/is-nonnegative-number").isPrimitive,rU=require("@stdlib/assert/is-string").isPrimitive,Vje=require("@stdlib/assert/is-positive-integer").isPrimitive,Fje=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Pn=require("@stdlib/string/format");function Wje(r,e){return xje(e)?nr(e,"sep")&&(r.sep=e.sep,!rU(r.sep))?new TypeError(Pn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):nr(e,"objectMode")&&(r.objectMode=e.objectMode,!Aje(r.objectMode))?new TypeError(Pn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):nr(e,"encoding")&&(r.encoding=e.encoding,!rU(r.encoding)&&r.encoding!==null)?new TypeError(Pn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):nr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!Gje(r.highWaterMark))?new TypeError(Pn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):nr(e,"iter")&&(r.iter=e.iter,!Fje(r.iter))?new TypeError(Pn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):nr(e,"siter")&&(r.siter=e.siter,!Vje(r.siter))?new TypeError(Pn("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(Pn("invalid argument. Options argument must be an object. Value: `%s`.",e))}tU.exports=Wje});var aU=s(function(Per,nU){"use strict";var Ije=require("debug"),kje=Ije("random:streams:discrete-uniform");nU.exports=kje});var Of=s(function(Ter,gU){"use strict";var vU=require("readable-stream").Readable,sU=require("@stdlib/assert/is-integer").isPrimitive,zje=require("@stdlib/assert/is-error"),Jje=require("@stdlib/object/assign"),Uje=require("@stdlib/utils/inherit"),uU=require("@stdlib/utils/define-nonenumerable-property"),_i=require("@stdlib/utils/define-nonenumerable-read-only-property"),Sf=require("@stdlib/utils/define-read-only-accessor"),Cje=require("@stdlib/utils/define-read-write-accessor"),Bje=gn().factory,oU=require("@stdlib/buffer/from-string"),Dje=require("@stdlib/utils/next-tick"),jm=require("@stdlib/string/format"),Xje=eU(),Yje=iU(),ss=aU();function Hje(){return this._prng.seed}function Zje(){return this._prng.seedLength}function Qje(){return this._prng.stateLength}function $je(){return this._prng.byteLength}function Kje(){return this._prng.state}function e0e(r){this._prng.state=r}function r0e(){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=oU(e):e=oU(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 ss("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,Dje(t),this;function t(){r&&(ss("Stream was destroyed due to an error. Error: %s.",zje(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(!sU(r))throw new TypeError(jm("invalid argument. First argument must be an integer. Value: `%s`.",r));if(!sU(e))throw new TypeError(jm("invalid argument. Second argument must be an integer. Value: `%s`.",e));if(r>e)throw new RangeError(jm("invalid argument. Minimum support must be less than or equal to maximum support. Value: `[%d, %d]`.",r,e));if(i=Jje({},Xje),arguments.length>2&&(n=Yje(i,t),n))throw n;return ss("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),vU.call(this,i),uU(this,"_destroyed",!1),_i(this,"_objectMode",i.objectMode),_i(this,"_sep",i.sep),_i(this,"_iter",i.iter),_i(this,"_siter",i.siter),uU(this,"_i",0),_i(this,"_prng",Bje(r,e,i)),_i(this,"PRNG",this._prng.PRNG),this}Uje(de,vU);Sf(de.prototype,"seed",Hje);Sf(de.prototype,"seedLength",Zje);Cje(de.prototype,"state",Kje,e0e);Sf(de.prototype,"stateLength",Qje);Sf(de.prototype,"byteLength",$je);_i(de.prototype,"_read",r0e);_i(de.prototype,"destroy",t0e);gU.exports=de});var dU=s(function(jer,fU){"use strict";var i0e=require("@stdlib/assert/is-plain-object"),n0e=require("@stdlib/object/assign"),a0e=require("@stdlib/string/format"),s0e=Of();function u0e(r,e,t){var i;if(arguments.length>2){if(i=t,!i0e(i))throw new TypeError(a0e("invalid argument. Options argument must be an object. Value: `%s`.",i));i=n0e({},t)}else i={};return i.objectMode=!0,new s0e(r,e,i)}fU.exports=u0e});var yU=s(function(Mer,pU){"use strict";var lU=require("@stdlib/assert/is-plain-object"),cU=require("@stdlib/object/assign"),mU=require("@stdlib/string/format"),hU=Of();function o0e(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!lU(r))throw new TypeError(mU("invalid argument. Options argument must be an object. Value: `%s`.",r));n=cU({},r)}else if(i>2){if(!lU(t))throw new TypeError(mU("invalid argument. Options argument must be an object. Value: `%s`.",t));n=cU({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new hU(v,g,n)}function o(){return new hU(r,e,n)}}pU.exports=o0e});var wU=s(function(xer,bU){"use strict";var qU=require("@stdlib/utils/define-nonenumerable-read-only-property"),Mm=Of(),v0e=dU(),g0e=yU();qU(Mm,"objectMode",v0e);qU(Mm,"factory",g0e);bU.exports=Mm});var SU=s(function(Aer,f0e){f0e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var _U=s(function(Ger,EU){"use strict";var d0e=require("@stdlib/assert/is-plain-object"),ar=require("@stdlib/assert/has-own-property"),l0e=require("@stdlib/assert/is-boolean").isPrimitive,c0e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,OU=require("@stdlib/assert/is-string").isPrimitive,m0e=require("@stdlib/assert/is-positive-integer").isPrimitive,h0e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Tn=require("@stdlib/string/format");function p0e(r,e){return d0e(e)?ar(e,"sep")&&(r.sep=e.sep,!OU(r.sep))?new TypeError(Tn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):ar(e,"objectMode")&&(r.objectMode=e.objectMode,!l0e(r.objectMode))?new TypeError(Tn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):ar(e,"encoding")&&(r.encoding=e.encoding,!OU(r.encoding)&&r.encoding!==null)?new TypeError(Tn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):ar(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!c0e(r.highWaterMark))?new TypeError(Tn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):ar(e,"iter")&&(r.iter=e.iter,!h0e(r.iter))?new TypeError(Tn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):ar(e,"siter")&&(r.siter=e.siter,!m0e(r.siter))?new TypeError(Tn("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(Tn("invalid argument. Options argument must be an object. Value: `%s`.",e))}EU.exports=p0e});var LU=s(function(Ver,NU){"use strict";var y0e=require("debug"),q0e=y0e("random:streams:erlang");NU.exports=q0e});var _f=s(function(Fer,MU){"use strict";var jU=require("readable-stream").Readable,b0e=require("@stdlib/assert/is-positive-integer").isPrimitive,w0e=require("@stdlib/assert/is-positive-number").isPrimitive,S0e=require("@stdlib/assert/is-error"),O0e=require("@stdlib/object/assign"),E0e=require("@stdlib/utils/inherit"),RU=require("@stdlib/utils/define-nonenumerable-property"),Ni=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ef=require("@stdlib/utils/define-read-only-accessor"),_0e=require("@stdlib/utils/define-read-write-accessor"),N0e=ba().factory,PU=require("@stdlib/buffer/from-string"),L0e=require("@stdlib/utils/next-tick"),TU=require("@stdlib/string/format"),R0e=SU(),P0e=_U(),us=LU();function T0e(){return this._prng.seed}function j0e(){return this._prng.seedLength}function M0e(){return this._prng.stateLength}function x0e(){return this._prng.byteLength}function A0e(){return this._prng.state}function G0e(r){this._prng.state=r}function V0e(){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=PU(e):e=PU(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function F0e(r){var e;if(this._destroyed)return us("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,L0e(t),this;function t(){r&&(us("Stream was destroyed due to an error. Error: %s.",S0e(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(!b0e(r))throw new TypeError(TU("invalid argument. First argument must be a positive integer. Value: `%s`.",r));if(!w0e(e))throw new TypeError(TU("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=O0e({},R0e),arguments.length>2&&(n=P0e(i,t),n))throw n;return us("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),jU.call(this,i),RU(this,"_destroyed",!1),Ni(this,"_objectMode",i.objectMode),Ni(this,"_sep",i.sep),Ni(this,"_iter",i.iter),Ni(this,"_siter",i.siter),RU(this,"_i",0),Ni(this,"_prng",N0e(r,e,i)),Ni(this,"PRNG",this._prng.PRNG),this}E0e(le,jU);Ef(le.prototype,"seed",T0e);Ef(le.prototype,"seedLength",j0e);_0e(le.prototype,"state",A0e,G0e);Ef(le.prototype,"stateLength",M0e);Ef(le.prototype,"byteLength",x0e);Ni(le.prototype,"_read",V0e);Ni(le.prototype,"destroy",F0e);MU.exports=le});var AU=s(function(Wer,xU){"use strict";var W0e=require("@stdlib/assert/is-plain-object"),I0e=require("@stdlib/object/assign"),k0e=require("@stdlib/string/format"),z0e=_f();function J0e(r,e,t){var i;if(arguments.length>2){if(i=t,!W0e(i))throw new TypeError(k0e("invalid argument. Options argument must be an object. Value: `%s`.",i));i=I0e({},t)}else i={};return i.objectMode=!0,new z0e(r,e,i)}xU.exports=J0e});var kU=s(function(Ier,IU){"use strict";var GU=require("@stdlib/assert/is-plain-object"),VU=require("@stdlib/object/assign"),FU=require("@stdlib/string/format"),WU=_f();function U0e(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!GU(r))throw new TypeError(FU("invalid argument. Options argument must be an object. Value: `%s`.",r));n=VU({},r)}else if(i>2){if(!GU(t))throw new TypeError(FU("invalid argument. Options argument must be an object. Value: `%s`.",t));n=VU({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new WU(v,g,n)}function o(){return new WU(r,e,n)}}IU.exports=U0e});var UU=s(function(ker,JU){"use strict";var zU=require("@stdlib/utils/define-nonenumerable-read-only-property"),xm=_f(),C0e=AU(),B0e=kU();zU(xm,"objectMode",C0e);zU(xm,"factory",B0e);JU.exports=xm});var CU=s(function(zer,D0e){D0e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var XU=s(function(Jer,DU){"use strict";var X0e=require("@stdlib/assert/is-plain-object"),sr=require("@stdlib/assert/has-own-property"),Y0e=require("@stdlib/assert/is-boolean").isPrimitive,H0e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,BU=require("@stdlib/assert/is-string").isPrimitive,Z0e=require("@stdlib/assert/is-positive-integer").isPrimitive,Q0e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,jn=require("@stdlib/string/format");function $0e(r,e){return X0e(e)?sr(e,"sep")&&(r.sep=e.sep,!BU(r.sep))?new TypeError(jn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):sr(e,"objectMode")&&(r.objectMode=e.objectMode,!Y0e(r.objectMode))?new TypeError(jn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):sr(e,"encoding")&&(r.encoding=e.encoding,!BU(r.encoding)&&r.encoding!==null)?new TypeError(jn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):sr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!H0e(r.highWaterMark))?new TypeError(jn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):sr(e,"iter")&&(r.iter=e.iter,!Q0e(r.iter))?new TypeError(jn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):sr(e,"siter")&&(r.siter=e.siter,!Z0e(r.siter))?new TypeError(jn("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(jn("invalid argument. Options argument must be an object. Value: `%s`.",e))}DU.exports=$0e});var HU=s(function(Uer,YU){"use strict";var K0e=require("debug"),eMe=K0e("random:streams:exponential");YU.exports=eMe});var Lf=s(function(Cer,KU){"use strict";var $U=require("readable-stream").Readable,rMe=require("@stdlib/assert/is-positive-number").isPrimitive,tMe=require("@stdlib/assert/is-error"),iMe=require("@stdlib/object/assign"),nMe=require("@stdlib/utils/inherit"),ZU=require("@stdlib/utils/define-nonenumerable-property"),Li=require("@stdlib/utils/define-nonenumerable-read-only-property"),Nf=require("@stdlib/utils/define-read-only-accessor"),aMe=require("@stdlib/utils/define-read-write-accessor"),sMe=fn().factory,QU=require("@stdlib/buffer/from-string"),uMe=require("@stdlib/utils/next-tick"),oMe=require("@stdlib/string/format"),vMe=CU(),gMe=XU(),os=HU();function fMe(){return this._prng.seed}function dMe(){return this._prng.seedLength}function lMe(){return this._prng.stateLength}function cMe(){return this._prng.byteLength}function mMe(){return this._prng.state}function hMe(r){this._prng.state=r}function pMe(){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=QU(e):e=QU(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function yMe(r){var e;if(this._destroyed)return os("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,uMe(t),this;function t(){r&&(os("Stream was destroyed due to an error. Error: %s.",tMe(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(!rMe(r))throw new TypeError(oMe("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(t=iMe({},vMe),arguments.length>1&&(i=gMe(t,e),i))throw i;return os("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),$U.call(this,t),ZU(this,"_destroyed",!1),Li(this,"_objectMode",t.objectMode),Li(this,"_sep",t.sep),Li(this,"_iter",t.iter),Li(this,"_siter",t.siter),ZU(this,"_i",0),Li(this,"_prng",sMe(r,t)),Li(this,"PRNG",this._prng.PRNG),this}nMe(ce,$U);Nf(ce.prototype,"seed",fMe);Nf(ce.prototype,"seedLength",dMe);aMe(ce.prototype,"state",mMe,hMe);Nf(ce.prototype,"stateLength",lMe);Nf(ce.prototype,"byteLength",cMe);Li(ce.prototype,"_read",pMe);Li(ce.prototype,"destroy",yMe);KU.exports=ce});var rC=s(function(Ber,eC){"use strict";var qMe=require("@stdlib/assert/is-plain-object"),bMe=require("@stdlib/object/assign"),wMe=require("@stdlib/string/format"),SMe=Lf();function OMe(r,e){var t;if(arguments.length>1){if(t=e,!qMe(t))throw new TypeError(wMe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=bMe({},e)}else t={};return t.objectMode=!0,new SMe(r,t)}eC.exports=OMe});var uC=s(function(Der,sC){"use strict";var EMe=require("@stdlib/assert/is-positive-number").isPrimitive,tC=require("@stdlib/assert/is-plain-object"),iC=require("@stdlib/object/assign"),nC=require("@stdlib/string/format"),aC=Lf();function _Me(r,e){var t,i,n;if(t=arguments.length,t>1){if(!tC(e))throw new TypeError(nC("invalid argument. Options argument must be an object. Value: `%s`.",e));n=u,i=iC({},e)}else if(t===1)if(EMe(r))n=u,i={};else{if(!tC(r))throw new TypeError(nC("invalid argument. Options argument must be an object. Value: `%s`.",r));i=iC({},r),n=a}else i={},n=a;return n;function a(o){return new aC(o,i)}function u(){return new aC(r,i)}}sC.exports=_Me});var gC=s(function(Xer,vC){"use strict";var oC=require("@stdlib/utils/define-nonenumerable-read-only-property"),Am=Lf(),NMe=rC(),LMe=uC();oC(Am,"objectMode",NMe);oC(Am,"factory",LMe);vC.exports=Am});var fC=s(function(Yer,RMe){RMe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var cC=s(function(Her,lC){"use strict";var PMe=require("@stdlib/assert/is-plain-object"),ur=require("@stdlib/assert/has-own-property"),TMe=require("@stdlib/assert/is-boolean").isPrimitive,jMe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,dC=require("@stdlib/assert/is-string").isPrimitive,MMe=require("@stdlib/assert/is-positive-integer").isPrimitive,xMe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Mn=require("@stdlib/string/format");function AMe(r,e){return PMe(e)?ur(e,"sep")&&(r.sep=e.sep,!dC(r.sep))?new TypeError(Mn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):ur(e,"objectMode")&&(r.objectMode=e.objectMode,!TMe(r.objectMode))?new TypeError(Mn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):ur(e,"encoding")&&(r.encoding=e.encoding,!dC(r.encoding)&&r.encoding!==null)?new TypeError(Mn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):ur(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!jMe(r.highWaterMark))?new TypeError(Mn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):ur(e,"iter")&&(r.iter=e.iter,!xMe(r.iter))?new TypeError(Mn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):ur(e,"siter")&&(r.siter=e.siter,!MMe(r.siter))?new TypeError(Mn("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(Mn("invalid argument. Options argument must be an object. Value: `%s`.",e))}lC.exports=AMe});var hC=s(function(Zer,mC){"use strict";var GMe=require("debug"),VMe=GMe("random:streams:f");mC.exports=VMe});var Pf=s(function(Qer,SC){"use strict";var wC=require("readable-stream").Readable,pC=require("@stdlib/assert/is-positive-number").isPrimitive,FMe=require("@stdlib/assert/is-error"),WMe=require("@stdlib/object/assign"),IMe=require("@stdlib/utils/inherit"),yC=require("@stdlib/utils/define-nonenumerable-property"),Ri=require("@stdlib/utils/define-nonenumerable-read-only-property"),Rf=require("@stdlib/utils/define-read-only-accessor"),kMe=require("@stdlib/utils/define-read-write-accessor"),zMe=Sa().factory,qC=require("@stdlib/buffer/from-string"),JMe=require("@stdlib/utils/next-tick"),bC=require("@stdlib/string/format"),UMe=fC(),CMe=cC(),vs=hC();function BMe(){return this._prng.seed}function DMe(){return this._prng.seedLength}function XMe(){return this._prng.stateLength}function YMe(){return this._prng.byteLength}function HMe(){return this._prng.state}function ZMe(r){this._prng.state=r}function QMe(){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=qC(e):e=qC(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function $Me(r){var e;if(this._destroyed)return vs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,JMe(t),this;function t(){r&&(vs("Stream was destroyed due to an error. Error: %s.",FMe(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(!pC(r))throw new TypeError(bC("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!pC(e))throw new TypeError(bC("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=WMe({},UMe),arguments.length>2&&(n=CMe(i,t),n))throw n;return vs("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),wC.call(this,i),yC(this,"_destroyed",!1),Ri(this,"_objectMode",i.objectMode),Ri(this,"_sep",i.sep),Ri(this,"_iter",i.iter),Ri(this,"_siter",i.siter),yC(this,"_i",0),Ri(this,"_prng",zMe(r,e,i)),Ri(this,"PRNG",this._prng.PRNG),this}IMe(me,wC);Rf(me.prototype,"seed",BMe);Rf(me.prototype,"seedLength",DMe);kMe(me.prototype,"state",HMe,ZMe);Rf(me.prototype,"stateLength",XMe);Rf(me.prototype,"byteLength",YMe);Ri(me.prototype,"_read",QMe);Ri(me.prototype,"destroy",$Me);SC.exports=me});var EC=s(function($er,OC){"use strict";var KMe=require("@stdlib/assert/is-plain-object"),exe=require("@stdlib/object/assign"),rxe=require("@stdlib/string/format"),txe=Pf();function ixe(r,e,t){var i;if(arguments.length>2){if(i=t,!KMe(i))throw new TypeError(rxe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=exe({},t)}else i={};return i.objectMode=!0,new txe(r,e,i)}OC.exports=ixe});var TC=s(function(Ker,PC){"use strict";var _C=require("@stdlib/assert/is-plain-object"),NC=require("@stdlib/object/assign"),LC=require("@stdlib/string/format"),RC=Pf();function nxe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!_C(r))throw new TypeError(LC("invalid argument. Options argument must be an object. Value: `%s`.",r));n=NC({},r)}else if(i>2){if(!_C(t))throw new TypeError(LC("invalid argument. Options argument must be an object. Value: `%s`.",t));n=NC({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new RC(v,g,n)}function o(){return new RC(r,e,n)}}PC.exports=nxe});var xC=s(function(err,MC){"use strict";var jC=require("@stdlib/utils/define-nonenumerable-read-only-property"),Gm=Pf(),axe=EC(),sxe=TC();jC(Gm,"objectMode",axe);jC(Gm,"factory",sxe);MC.exports=Gm});var AC=s(function(rrr,uxe){uxe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var FC=s(function(trr,VC){"use strict";var oxe=require("@stdlib/assert/is-plain-object"),or=require("@stdlib/assert/has-own-property"),vxe=require("@stdlib/assert/is-boolean").isPrimitive,gxe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,GC=require("@stdlib/assert/is-string").isPrimitive,fxe=require("@stdlib/assert/is-positive-integer").isPrimitive,dxe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,xn=require("@stdlib/string/format");function lxe(r,e){return oxe(e)?or(e,"sep")&&(r.sep=e.sep,!GC(r.sep))?new TypeError(xn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):or(e,"objectMode")&&(r.objectMode=e.objectMode,!vxe(r.objectMode))?new TypeError(xn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):or(e,"encoding")&&(r.encoding=e.encoding,!GC(r.encoding)&&r.encoding!==null)?new TypeError(xn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):or(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!gxe(r.highWaterMark))?new TypeError(xn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):or(e,"iter")&&(r.iter=e.iter,!dxe(r.iter))?new TypeError(xn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):or(e,"siter")&&(r.siter=e.siter,!fxe(r.siter))?new TypeError(xn("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(xn("invalid argument. Options argument must be an object. Value: `%s`.",e))}VC.exports=lxe});var IC=s(function(irr,WC){"use strict";var cxe=require("debug"),mxe=cxe("random:streams:frechet");WC.exports=mxe});var jf=s(function(nrr,CC){"use strict";var UC=require("readable-stream").Readable,kC=require("@stdlib/assert/is-positive-number"),hxe=require("@stdlib/assert/is-number").isPrimitive,pxe=require("@stdlib/math/base/assert/is-nan"),yxe=require("@stdlib/assert/is-error"),qxe=require("@stdlib/object/assign"),bxe=require("@stdlib/utils/inherit"),zC=require("@stdlib/utils/define-nonenumerable-property"),Pi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Tf=require("@stdlib/utils/define-read-only-accessor"),wxe=require("@stdlib/utils/define-read-write-accessor"),Sxe=Ea().factory,JC=require("@stdlib/buffer/from-string"),Oxe=require("@stdlib/utils/next-tick"),Vm=require("@stdlib/string/format"),Exe=AC(),_xe=FC(),gs=IC();function Nxe(){return this._prng.seed}function Lxe(){return this._prng.seedLength}function Rxe(){return this._prng.stateLength}function Pxe(){return this._prng.byteLength}function Txe(){return this._prng.state}function jxe(r){this._prng.state=r}function Mxe(){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=JC(e):e=JC(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function xxe(r){var e;if(this._destroyed)return gs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,Oxe(t),this;function t(){r&&(gs("Stream was destroyed due to an error. Error: %s.",yxe(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(!kC(r))throw new TypeError(Vm("invalid argument. First argument must be a positive number and not NaN. Value: `%s`.",r));if(!kC(e))throw new TypeError(Vm("invalid argument. Second argument must be a positive number and not NaN. Value: `%s`.",e));if(!hxe(t)||pxe(t))throw new TypeError(Vm("invalid argument. Third argument must be a number. Value: `%s`.",t));if(n=qxe({},Exe),arguments.length>3&&(a=_xe(n,i),a))throw a;return gs("Creating a readable stream configured with the following options: %s.",JSON.stringify(n)),UC.call(this,n),zC(this,"_destroyed",!1),Pi(this,"_objectMode",n.objectMode),Pi(this,"_sep",n.sep),Pi(this,"_iter",n.iter),Pi(this,"_siter",n.siter),zC(this,"_i",0),Pi(this,"_prng",Sxe(r,e,t,n)),Pi(this,"PRNG",this._prng.PRNG),this}bxe(he,UC);Tf(he.prototype,"seed",Nxe);Tf(he.prototype,"seedLength",Lxe);wxe(he.prototype,"state",Txe,jxe);Tf(he.prototype,"stateLength",Rxe);Tf(he.prototype,"byteLength",Pxe);Pi(he.prototype,"_read",Mxe);Pi(he.prototype,"destroy",xxe);CC.exports=he});var DC=s(function(arr,BC){"use strict";var Axe=require("@stdlib/assert/is-plain-object"),Gxe=require("@stdlib/object/assign"),Vxe=require("@stdlib/string/format"),Fxe=jf();function Wxe(r,e,t,i){var n;if(arguments.length>3){if(n=i,!Axe(n))throw new TypeError(Vxe("invalid argument. Options argument must be an object. Value: `%s`.",n));n=Gxe({},i)}else n={};return n.objectMode=!0,new Fxe(r,e,t,n)}BC.exports=Wxe});var $C=s(function(srr,QC){"use strict";var XC=require("@stdlib/assert/is-plain-object"),YC=require("@stdlib/object/assign"),HC=require("@stdlib/string/format"),ZC=jf();function Ixe(r,e,t,i){var n,a,u;if(n=arguments.length,n===1){if(!XC(r))throw new TypeError(HC("invalid argument. Options argument must be an object. Value: `%s`.",r));a=YC({},r)}else if(n>3){if(!XC(i))throw new TypeError(HC("invalid argument. Options argument must be an object. Value: `%s`.",i));a=YC({},i)}else a={};return n<3?u=o:u=v,u;function o(g,c,l){return new ZC(g,c,l,a)}function v(){return new ZC(r,e,t,a)}}QC.exports=Ixe});var rB=s(function(urr,eB){"use strict";var KC=require("@stdlib/utils/define-nonenumerable-read-only-property"),Fm=jf(),kxe=DC(),zxe=$C();KC(Fm,"objectMode",kxe);KC(Fm,"factory",zxe);eB.exports=Fm});var tB=s(function(orr,Jxe){Jxe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var aB=s(function(vrr,nB){"use strict";var Uxe=require("@stdlib/assert/is-plain-object"),vr=require("@stdlib/assert/has-own-property"),Cxe=require("@stdlib/assert/is-boolean").isPrimitive,Bxe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,iB=require("@stdlib/assert/is-string").isPrimitive,Dxe=require("@stdlib/assert/is-positive-integer").isPrimitive,Xxe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,An=require("@stdlib/string/format");function Yxe(r,e){return Uxe(e)?vr(e,"sep")&&(r.sep=e.sep,!iB(r.sep))?new TypeError(An("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):vr(e,"objectMode")&&(r.objectMode=e.objectMode,!Cxe(r.objectMode))?new TypeError(An("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):vr(e,"encoding")&&(r.encoding=e.encoding,!iB(r.encoding)&&r.encoding!==null)?new TypeError(An("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):vr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!Bxe(r.highWaterMark))?new TypeError(An("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(An("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):vr(e,"siter")&&(r.siter=e.siter,!Dxe(r.siter))?new TypeError(An("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(An("invalid argument. Options argument must be an object. Value: `%s`.",e))}nB.exports=Yxe});var uB=s(function(grr,sB){"use strict";var Hxe=require("debug"),Zxe=Hxe("random:streams:gamma");sB.exports=Zxe});var xf=s(function(frr,lB){"use strict";var dB=require("readable-stream").Readable,oB=require("@stdlib/assert/is-positive-number").isPrimitive,Qxe=require("@stdlib/assert/is-error"),$xe=require("@stdlib/object/assign"),Kxe=require("@stdlib/utils/inherit"),vB=require("@stdlib/utils/define-nonenumerable-property"),Ti=require("@stdlib/utils/define-nonenumerable-read-only-property"),Mf=require("@stdlib/utils/define-read-only-accessor"),e1e=require("@stdlib/utils/define-read-write-accessor"),r1e=Ce().factory,gB=require("@stdlib/buffer/from-string"),t1e=require("@stdlib/utils/next-tick"),fB=require("@stdlib/string/format"),i1e=tB(),n1e=aB(),fs=uB();function a1e(){return this._prng.seed}function s1e(){return this._prng.seedLength}function u1e(){return this._prng.stateLength}function o1e(){return this._prng.byteLength}function v1e(){return this._prng.state}function g1e(r){this._prng.state=r}function f1e(){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=gB(e):e=gB(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function d1e(r){var e;if(this._destroyed)return fs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,t1e(t),this;function t(){r&&(fs("Stream was destroyed due to an error. Error: %s.",Qxe(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(!oB(r))throw new TypeError(fB("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!oB(e))throw new TypeError(fB("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=$xe({},i1e),arguments.length>2&&(n=n1e(i,t),n))throw n;return fs("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),dB.call(this,i),vB(this,"_destroyed",!1),Ti(this,"_objectMode",i.objectMode),Ti(this,"_sep",i.sep),Ti(this,"_iter",i.iter),Ti(this,"_siter",i.siter),vB(this,"_i",0),Ti(this,"_prng",r1e(r,e,i)),Ti(this,"PRNG",this._prng.PRNG),this}Kxe(pe,dB);Mf(pe.prototype,"seed",a1e);Mf(pe.prototype,"seedLength",s1e);e1e(pe.prototype,"state",v1e,g1e);Mf(pe.prototype,"stateLength",u1e);Mf(pe.prototype,"byteLength",o1e);Ti(pe.prototype,"_read",f1e);Ti(pe.prototype,"destroy",d1e);lB.exports=pe});var mB=s(function(drr,cB){"use strict";var l1e=require("@stdlib/assert/is-plain-object"),c1e=require("@stdlib/object/assign"),m1e=require("@stdlib/string/format"),h1e=xf();function p1e(r,e,t){var i;if(arguments.length>2){if(i=t,!l1e(i))throw new TypeError(m1e("invalid argument. Options argument must be an object. Value: `%s`.",i));i=c1e({},t)}else i={};return i.objectMode=!0,new h1e(r,e,i)}cB.exports=p1e});var wB=s(function(lrr,bB){"use strict";var hB=require("@stdlib/assert/is-plain-object"),pB=require("@stdlib/object/assign"),yB=require("@stdlib/string/format"),qB=xf();function y1e(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!hB(r))throw new TypeError(yB("invalid argument. Options argument must be an object. Value: `%s`.",r));n=pB({},r)}else if(i>2){if(!hB(t))throw new TypeError(yB("invalid argument. Options argument must be an object. Value: `%s`.",t));n=pB({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new qB(v,g,n)}function o(){return new qB(r,e,n)}}bB.exports=y1e});var EB=s(function(crr,OB){"use strict";var SB=require("@stdlib/utils/define-nonenumerable-read-only-property"),Wm=xf(),q1e=mB(),b1e=wB();SB(Wm,"objectMode",q1e);SB(Wm,"factory",b1e);OB.exports=Wm});var _B=s(function(mrr,w1e){w1e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var RB=s(function(hrr,LB){"use strict";var S1e=require("@stdlib/assert/is-plain-object"),gr=require("@stdlib/assert/has-own-property"),O1e=require("@stdlib/assert/is-boolean").isPrimitive,E1e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,NB=require("@stdlib/assert/is-string").isPrimitive,_1e=require("@stdlib/assert/is-positive-integer").isPrimitive,N1e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Gn=require("@stdlib/string/format");function L1e(r,e){return S1e(e)?gr(e,"sep")&&(r.sep=e.sep,!NB(r.sep))?new TypeError(Gn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):gr(e,"objectMode")&&(r.objectMode=e.objectMode,!O1e(r.objectMode))?new TypeError(Gn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):gr(e,"encoding")&&(r.encoding=e.encoding,!NB(r.encoding)&&r.encoding!==null)?new TypeError(Gn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):gr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!E1e(r.highWaterMark))?new TypeError(Gn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):gr(e,"iter")&&(r.iter=e.iter,!N1e(r.iter))?new TypeError(Gn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):gr(e,"siter")&&(r.siter=e.siter,!_1e(r.siter))?new TypeError(Gn("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(Gn("invalid argument. Options argument must be an object. Value: `%s`.",e))}LB.exports=L1e});var TB=s(function(prr,PB){"use strict";var R1e=require("debug"),P1e=R1e("random:streams:geometric");PB.exports=P1e});var Gf=s(function(yrr,AB){"use strict";var xB=require("readable-stream").Readable,T1e=require("@stdlib/assert/is-probability").isPrimitive,j1e=require("@stdlib/assert/is-error"),M1e=require("@stdlib/object/assign"),x1e=require("@stdlib/utils/inherit"),jB=require("@stdlib/utils/define-nonenumerable-property"),ji=require("@stdlib/utils/define-nonenumerable-read-only-property"),Af=require("@stdlib/utils/define-read-only-accessor"),A1e=require("@stdlib/utils/define-read-write-accessor"),G1e=_a().factory,MB=require("@stdlib/buffer/from-string"),V1e=require("@stdlib/utils/next-tick"),F1e=require("@stdlib/string/format"),W1e=_B(),I1e=RB(),ds=TB();function k1e(){return this._prng.seed}function z1e(){return this._prng.seedLength}function J1e(){return this._prng.stateLength}function U1e(){return this._prng.byteLength}function C1e(){return this._prng.state}function B1e(r){this._prng.state=r}function D1e(){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=MB(e):e=MB(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 ds("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,V1e(t),this;function t(){r&&(ds("Stream was destroyed due to an error. Error: %s.",j1e(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(!T1e(r))throw new TypeError(F1e("invalid argument. First argument must be a probability. Value: `%s`.",r));if(t=M1e({},W1e),arguments.length>1&&(i=I1e(t,e),i))throw i;return ds("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),xB.call(this,t),jB(this,"_destroyed",!1),ji(this,"_objectMode",t.objectMode),ji(this,"_sep",t.sep),ji(this,"_iter",t.iter),ji(this,"_siter",t.siter),jB(this,"_i",0),ji(this,"_prng",G1e(r,t)),ji(this,"PRNG",this._prng.PRNG),this}x1e(ye,xB);Af(ye.prototype,"seed",k1e);Af(ye.prototype,"seedLength",z1e);A1e(ye.prototype,"state",C1e,B1e);Af(ye.prototype,"stateLength",J1e);Af(ye.prototype,"byteLength",U1e);ji(ye.prototype,"_read",D1e);ji(ye.prototype,"destroy",X1e);AB.exports=ye});var VB=s(function(qrr,GB){"use strict";var Y1e=require("@stdlib/assert/is-plain-object"),H1e=require("@stdlib/object/assign"),Z1e=require("@stdlib/string/format"),Q1e=Gf();function $1e(r,e){var t;if(arguments.length>1){if(t=e,!Y1e(t))throw new TypeError(Z1e("invalid argument. Options argument must be an object. Value: `%s`.",t));t=H1e({},e)}else t={};return t.objectMode=!0,new Q1e(r,t)}GB.exports=$1e});var JB=s(function(brr,zB){"use strict";var K1e=require("@stdlib/assert/is-probability").isPrimitive,FB=require("@stdlib/assert/is-plain-object"),WB=require("@stdlib/object/assign"),IB=require("@stdlib/string/format"),kB=Gf();function eAe(r,e){var t,i,n;if(t=arguments.length,t>1){if(!FB(e))throw new TypeError(IB("invalid argument. Options argument must be an object. Value: `%s`.",e));n=u,i=WB({},e)}else if(t===1)if(K1e(r))n=u,i={};else{if(!FB(r))throw new TypeError(IB("invalid argument. Options argument must be an object. Value: `%s`.",r));i=WB({},r),n=a}else i={},n=a;return n;function a(o){return new kB(o,i)}function u(){return new kB(r,i)}}zB.exports=eAe});var BB=s(function(wrr,CB){"use strict";var UB=require("@stdlib/utils/define-nonenumerable-read-only-property"),Im=Gf(),rAe=VB(),tAe=JB();UB(Im,"objectMode",rAe);UB(Im,"factory",tAe);CB.exports=Im});var DB=s(function(Srr,iAe){iAe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var HB=s(function(Orr,YB){"use strict";var nAe=require("@stdlib/assert/is-plain-object"),fr=require("@stdlib/assert/has-own-property"),aAe=require("@stdlib/assert/is-boolean").isPrimitive,sAe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,XB=require("@stdlib/assert/is-string").isPrimitive,uAe=require("@stdlib/assert/is-positive-integer").isPrimitive,oAe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Vn=require("@stdlib/string/format");function vAe(r,e){return nAe(e)?fr(e,"sep")&&(r.sep=e.sep,!XB(r.sep))?new TypeError(Vn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):fr(e,"objectMode")&&(r.objectMode=e.objectMode,!aAe(r.objectMode))?new TypeError(Vn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):fr(e,"encoding")&&(r.encoding=e.encoding,!XB(r.encoding)&&r.encoding!==null)?new TypeError(Vn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):fr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!sAe(r.highWaterMark))?new TypeError(Vn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):fr(e,"iter")&&(r.iter=e.iter,!oAe(r.iter))?new TypeError(Vn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):fr(e,"siter")&&(r.siter=e.siter,!uAe(r.siter))?new TypeError(Vn("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(Vn("invalid argument. Options argument must be an object. Value: `%s`.",e))}YB.exports=vAe});var QB=s(function(Err,ZB){"use strict";var gAe=require("debug"),fAe=gAe("random:streams:gumbel");ZB.exports=fAe});var Ff=s(function(_rr,t9){"use strict";var r9=require("readable-stream").Readable,dAe=require("@stdlib/assert/is-positive-number").isPrimitive,lAe=require("@stdlib/assert/is-number").isPrimitive,cAe=require("@stdlib/math/base/assert/is-nan"),mAe=require("@stdlib/assert/is-error"),hAe=require("@stdlib/object/assign"),pAe=require("@stdlib/utils/inherit"),$B=require("@stdlib/utils/define-nonenumerable-property"),Mi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Vf=require("@stdlib/utils/define-read-only-accessor"),yAe=require("@stdlib/utils/define-read-write-accessor"),qAe=Na().factory,KB=require("@stdlib/buffer/from-string"),bAe=require("@stdlib/utils/next-tick"),e9=require("@stdlib/string/format"),wAe=DB(),SAe=HB(),ls=QB();function OAe(){return this._prng.seed}function EAe(){return this._prng.seedLength}function _Ae(){return this._prng.stateLength}function NAe(){return this._prng.byteLength}function LAe(){return this._prng.state}function RAe(r){this._prng.state=r}function PAe(){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=KB(e):e=KB(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function TAe(r){var e;if(this._destroyed)return ls("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,bAe(t),this;function t(){r&&(ls("Stream was destroyed due to an error. Error: %s.",mAe(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(!lAe(r)||cAe(r))throw new TypeError(e9("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!dAe(e))throw new TypeError(e9("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=hAe({},wAe),arguments.length>2&&(n=SAe(i,t),n))throw n;return ls("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),r9.call(this,i),$B(this,"_destroyed",!1),Mi(this,"_objectMode",i.objectMode),Mi(this,"_sep",i.sep),Mi(this,"_iter",i.iter),Mi(this,"_siter",i.siter),$B(this,"_i",0),Mi(this,"_prng",qAe(r,e,i)),Mi(this,"PRNG",this._prng.PRNG),this}pAe(qe,r9);Vf(qe.prototype,"seed",OAe);Vf(qe.prototype,"seedLength",EAe);yAe(qe.prototype,"state",LAe,RAe);Vf(qe.prototype,"stateLength",_Ae);Vf(qe.prototype,"byteLength",NAe);Mi(qe.prototype,"_read",PAe);Mi(qe.prototype,"destroy",TAe);t9.exports=qe});var n9=s(function(Nrr,i9){"use strict";var jAe=require("@stdlib/assert/is-plain-object"),MAe=require("@stdlib/object/assign"),xAe=require("@stdlib/string/format"),AAe=Ff();function GAe(r,e,t){var i;if(arguments.length>2){if(i=t,!jAe(i))throw new TypeError(xAe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=MAe({},t)}else i={};return i.objectMode=!0,new AAe(r,e,i)}i9.exports=GAe});var g9=s(function(Lrr,v9){"use strict";var a9=require("@stdlib/assert/is-plain-object"),s9=require("@stdlib/object/assign"),u9=require("@stdlib/string/format"),o9=Ff();function VAe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!a9(r))throw new TypeError(u9("invalid argument. Options argument must be an object. Value: `%s`.",r));n=s9({},r)}else if(i>2){if(!a9(t))throw new TypeError(u9("invalid argument. Options argument must be an object. Value: `%s`.",t));n=s9({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new o9(v,g,n)}function o(){return new o9(r,e,n)}}v9.exports=VAe});var l9=s(function(Rrr,d9){"use strict";var f9=require("@stdlib/utils/define-nonenumerable-read-only-property"),km=Ff(),FAe=n9(),WAe=g9();f9(km,"objectMode",FAe);f9(km,"factory",WAe);d9.exports=km});var c9=s(function(Prr,IAe){IAe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var p9=s(function(Trr,h9){"use strict";var kAe=require("@stdlib/assert/is-plain-object"),dr=require("@stdlib/assert/has-own-property"),zAe=require("@stdlib/assert/is-boolean").isPrimitive,JAe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,m9=require("@stdlib/assert/is-string").isPrimitive,UAe=require("@stdlib/assert/is-positive-integer").isPrimitive,CAe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Fn=require("@stdlib/string/format");function BAe(r,e){return kAe(e)?dr(e,"sep")&&(r.sep=e.sep,!m9(r.sep))?new TypeError(Fn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):dr(e,"objectMode")&&(r.objectMode=e.objectMode,!zAe(r.objectMode))?new TypeError(Fn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):dr(e,"encoding")&&(r.encoding=e.encoding,!m9(r.encoding)&&r.encoding!==null)?new TypeError(Fn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):dr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!JAe(r.highWaterMark))?new TypeError(Fn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):dr(e,"iter")&&(r.iter=e.iter,!CAe(r.iter))?new TypeError(Fn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):dr(e,"siter")&&(r.siter=e.siter,!UAe(r.siter))?new TypeError(Fn("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(Fn("invalid argument. Options argument must be an object. Value: `%s`.",e))}h9.exports=BAe});var q9=s(function(jrr,y9){"use strict";var DAe=require("debug"),XAe=DAe("random:streams:hypergeometric");y9.exports=XAe});var If=s(function(Mrr,O9){"use strict";var S9=require("readable-stream").Readable,zm=require("@stdlib/assert/is-nonnegative-integer"),YAe=require("@stdlib/assert/is-error"),HAe=require("@stdlib/object/assign"),ZAe=require("@stdlib/utils/inherit"),b9=require("@stdlib/utils/define-nonenumerable-property"),xi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Wf=require("@stdlib/utils/define-read-only-accessor"),QAe=require("@stdlib/utils/define-read-write-accessor"),$Ae=La().factory,w9=require("@stdlib/buffer/from-string"),KAe=require("@stdlib/utils/next-tick"),Jm=require("@stdlib/string/format"),eGe=c9(),rGe=p9(),cs=q9();function tGe(){return this._prng.seed}function iGe(){return this._prng.seedLength}function nGe(){return this._prng.stateLength}function aGe(){return this._prng.byteLength}function sGe(){return this._prng.state}function uGe(r){this._prng.state=r}function oGe(){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=w9(e):e=w9(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function vGe(r){var e;if(this._destroyed)return cs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,KAe(t),this;function t(){r&&(cs("Stream was destroyed due to an error. Error: %s.",YAe(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(!zm(r))throw new TypeError(Jm("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",r));if(!zm(e))throw new TypeError(Jm("invalid argument. Second argument must be a nonnegative integer. Value: `%s`.",e));if(!zm(t))throw new TypeError(Jm("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=HAe({},eGe),arguments.length>3&&(a=rGe(n,i),a))throw a;return cs("Creating a readable stream configured with the following options: %s.",JSON.stringify(n)),S9.call(this,n),b9(this,"_destroyed",!1),xi(this,"_objectMode",n.objectMode),xi(this,"_sep",n.sep),xi(this,"_iter",n.iter),xi(this,"_siter",n.siter),b9(this,"_i",0),xi(this,"_prng",$Ae(r,e,t,n)),xi(this,"PRNG",this._prng.PRNG),this}ZAe(be,S9);Wf(be.prototype,"seed",tGe);Wf(be.prototype,"seedLength",iGe);QAe(be.prototype,"state",sGe,uGe);Wf(be.prototype,"stateLength",nGe);Wf(be.prototype,"byteLength",aGe);xi(be.prototype,"_read",oGe);xi(be.prototype,"destroy",vGe);O9.exports=be});var _9=s(function(xrr,E9){"use strict";var gGe=require("@stdlib/assert/is-plain-object"),fGe=require("@stdlib/object/assign"),dGe=require("@stdlib/string/format"),lGe=If();function cGe(r,e,t,i){var n;if(arguments.length>3){if(n=i,!gGe(n))throw new TypeError(dGe("invalid argument. Options argument must be an object. Value: `%s`.",n));n=fGe({},i)}else n={};return n.objectMode=!0,new lGe(r,e,t,n)}E9.exports=cGe});var j9=s(function(Arr,T9){"use strict";var N9=require("@stdlib/assert/is-plain-object"),L9=require("@stdlib/object/assign"),R9=require("@stdlib/string/format"),P9=If();function mGe(r,e,t,i){var n,a,u;if(n=arguments.length,n===1){if(!N9(r))throw new TypeError(R9("invalid argument. Options argument must be an object. Value: `%s`.",r));a=L9({},r)}else if(n>3){if(!N9(i))throw new TypeError(R9("invalid argument. Options argument must be an object. Value: `%s`.",i));a=L9({},i)}else a={};return n<3?u=o:u=v,u;function o(g,c,l){return new P9(g,c,l,a)}function v(){return new P9(r,e,t,a)}}T9.exports=mGe});var A9=s(function(Grr,x9){"use strict";var M9=require("@stdlib/utils/define-nonenumerable-read-only-property"),Um=If(),hGe=_9(),pGe=j9();M9(Um,"objectMode",hGe);M9(Um,"factory",pGe);x9.exports=Um});var G9=s(function(Vrr,yGe){yGe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var W9=s(function(Frr,F9){"use strict";var qGe=require("@stdlib/assert/is-plain-object"),lr=require("@stdlib/assert/has-own-property"),bGe=require("@stdlib/assert/is-boolean").isPrimitive,wGe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,V9=require("@stdlib/assert/is-string").isPrimitive,SGe=require("@stdlib/assert/is-positive-integer").isPrimitive,OGe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Wn=require("@stdlib/string/format");function EGe(r,e){return qGe(e)?lr(e,"sep")&&(r.sep=e.sep,!V9(r.sep))?new TypeError(Wn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):lr(e,"objectMode")&&(r.objectMode=e.objectMode,!bGe(r.objectMode))?new TypeError(Wn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):lr(e,"encoding")&&(r.encoding=e.encoding,!V9(r.encoding)&&r.encoding!==null)?new TypeError(Wn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):lr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!wGe(r.highWaterMark))?new TypeError(Wn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):lr(e,"iter")&&(r.iter=e.iter,!OGe(r.iter))?new TypeError(Wn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):lr(e,"siter")&&(r.siter=e.siter,!SGe(r.siter))?new TypeError(Wn("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(Wn("invalid argument. Options argument must be an object. Value: `%s`.",e))}F9.exports=EGe});var k9=s(function(Wrr,I9){"use strict";var _Ge=require("debug"),NGe=_Ge("random:streams:improved-ziggurat");I9.exports=NGe});var zf=s(function(Irr,C9){"use strict";var U9=require("readable-stream").Readable,LGe=require("@stdlib/assert/is-error"),RGe=require("@stdlib/object/assign"),PGe=require("@stdlib/utils/inherit"),z9=require("@stdlib/utils/define-nonenumerable-property"),Ai=require("@stdlib/utils/define-nonenumerable-read-only-property"),kf=require("@stdlib/utils/define-read-only-accessor"),TGe=require("@stdlib/utils/define-read-write-accessor"),jGe=Q().factory,J9=require("@stdlib/buffer/from-string"),MGe=require("@stdlib/utils/next-tick"),xGe=G9(),AGe=W9(),ms=k9();function GGe(){return this._prng.seed}function VGe(){return this._prng.seedLength}function FGe(){return this._prng.stateLength}function WGe(){return this._prng.byteLength}function IGe(){return this._prng.state}function kGe(r){this._prng.state=r}function zGe(){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=J9(e):e=J9(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function JGe(r){var e;if(this._destroyed)return ms("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,MGe(t),this;function t(){r&&(ms("Stream was destroyed due to an error. Error: %s.",LGe(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=RGe({},xGe),arguments.length>0&&(t=AGe(e,r),t))throw t;return ms("Creating a readable stream configured with the following options: %s.",JSON.stringify(e)),U9.call(this,e),z9(this,"_destroyed",!1),Ai(this,"_objectMode",e.objectMode),Ai(this,"_sep",e.sep),Ai(this,"_iter",e.iter),Ai(this,"_siter",e.siter),z9(this,"_i",0),Ai(this,"_prng",jGe(e)),Ai(this,"PRNG",this._prng.PRNG),this}PGe(we,U9);kf(we.prototype,"seed",GGe);kf(we.prototype,"seedLength",VGe);TGe(we.prototype,"state",IGe,kGe);kf(we.prototype,"stateLength",FGe);kf(we.prototype,"byteLength",WGe);Ai(we.prototype,"_read",zGe);Ai(we.prototype,"destroy",JGe);C9.exports=we});var D9=s(function(krr,B9){"use strict";var UGe=require("@stdlib/assert/is-plain-object"),CGe=require("@stdlib/object/assign"),BGe=require("@stdlib/string/format"),DGe=zf();function XGe(r){var e;if(arguments.length>0){if(e=r,!UGe(e))throw new TypeError(BGe("invalid argument. Options argument must be an object. Value: `%s`.",e));e=CGe({},r)}else e={};return e.objectMode=!0,new DGe(e)}B9.exports=XGe});var Y9=s(function(zrr,X9){"use strict";var YGe=require("@stdlib/assert/is-plain-object"),HGe=require("@stdlib/object/assign"),ZGe=require("@stdlib/string/format"),QGe=zf();function $Ge(r){var e;if(arguments.length>0){if(!YGe(r))throw new TypeError(ZGe("invalid argument. Options argument must be an object. Value: `%s`.",r));e=HGe({},r)}else e={};return t;function t(){return new QGe(e)}}X9.exports=$Ge});var Q9=s(function(Jrr,Z9){"use strict";var H9=require("@stdlib/utils/define-nonenumerable-read-only-property"),Cm=zf(),KGe=D9(),eVe=Y9();H9(Cm,"objectMode",KGe);H9(Cm,"factory",eVe);Z9.exports=Cm});var $9=s(function(Urr,rVe){rVe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var rD=s(function(Crr,eD){"use strict";var tVe=require("@stdlib/assert/is-plain-object"),cr=require("@stdlib/assert/has-own-property"),iVe=require("@stdlib/assert/is-boolean").isPrimitive,nVe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,K9=require("@stdlib/assert/is-string").isPrimitive,aVe=require("@stdlib/assert/is-positive-integer").isPrimitive,sVe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,In=require("@stdlib/string/format");function uVe(r,e){return tVe(e)?cr(e,"sep")&&(r.sep=e.sep,!K9(r.sep))?new TypeError(In("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):cr(e,"objectMode")&&(r.objectMode=e.objectMode,!iVe(r.objectMode))?new TypeError(In("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(In("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):cr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!nVe(r.highWaterMark))?new TypeError(In("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):cr(e,"iter")&&(r.iter=e.iter,!sVe(r.iter))?new TypeError(In("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):cr(e,"siter")&&(r.siter=e.siter,!aVe(r.siter))?new TypeError(In("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(In("invalid argument. Options argument must be an object. Value: `%s`.",e))}eD.exports=uVe});var iD=s(function(Brr,tD){"use strict";var oVe=require("debug"),vVe=oVe("random:streams:invgamma");tD.exports=vVe});var Uf=s(function(Drr,vD){"use strict";var oD=require("readable-stream").Readable,nD=require("@stdlib/assert/is-positive-number").isPrimitive,gVe=require("@stdlib/assert/is-error"),fVe=require("@stdlib/object/assign"),dVe=require("@stdlib/utils/inherit"),aD=require("@stdlib/utils/define-nonenumerable-property"),Gi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Jf=require("@stdlib/utils/define-read-only-accessor"),lVe=require("@stdlib/utils/define-read-write-accessor"),cVe=dn().factory,sD=require("@stdlib/buffer/from-string"),mVe=require("@stdlib/utils/next-tick"),uD=require("@stdlib/string/format"),hVe=$9(),pVe=rD(),hs=iD();function yVe(){return this._prng.seed}function qVe(){return this._prng.seedLength}function bVe(){return this._prng.stateLength}function wVe(){return this._prng.byteLength}function SVe(){return this._prng.state}function OVe(r){this._prng.state=r}function EVe(){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=sD(e):e=sD(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function _Ve(r){var e;if(this._destroyed)return hs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,mVe(t),this;function t(){r&&(hs("Stream was destroyed due to an error. Error: %s.",gVe(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(!nD(r))throw new TypeError(uD("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!nD(e))throw new TypeError(uD("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=fVe({},hVe),arguments.length>2&&(n=pVe(i,t),n))throw n;return hs("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),oD.call(this,i),aD(this,"_destroyed",!1),Gi(this,"_objectMode",i.objectMode),Gi(this,"_sep",i.sep),Gi(this,"_iter",i.iter),Gi(this,"_siter",i.siter),aD(this,"_i",0),Gi(this,"_prng",cVe(r,e,i)),Gi(this,"PRNG",this._prng.PRNG),this}dVe(Se,oD);Jf(Se.prototype,"seed",yVe);Jf(Se.prototype,"seedLength",qVe);lVe(Se.prototype,"state",SVe,OVe);Jf(Se.prototype,"stateLength",bVe);Jf(Se.prototype,"byteLength",wVe);Gi(Se.prototype,"_read",EVe);Gi(Se.prototype,"destroy",_Ve);vD.exports=Se});var fD=s(function(Xrr,gD){"use strict";var NVe=require("@stdlib/assert/is-plain-object"),LVe=require("@stdlib/object/assign"),RVe=require("@stdlib/string/format"),PVe=Uf();function TVe(r,e,t){var i;if(arguments.length>2){if(i=t,!NVe(i))throw new TypeError(RVe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=LVe({},t)}else i={};return i.objectMode=!0,new PVe(r,e,i)}gD.exports=TVe});var pD=s(function(Yrr,hD){"use strict";var dD=require("@stdlib/assert/is-plain-object"),lD=require("@stdlib/object/assign"),cD=require("@stdlib/string/format"),mD=Uf();function jVe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!dD(r))throw new TypeError(cD("invalid argument. Options argument must be an object. Value: `%s`.",r));n=lD({},r)}else if(i>2){if(!dD(t))throw new TypeError(cD("invalid argument. Options argument must be an object. Value: `%s`.",t));n=lD({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new mD(v,g,n)}function o(){return new mD(r,e,n)}}hD.exports=jVe});var bD=s(function(Hrr,qD){"use strict";var yD=require("@stdlib/utils/define-nonenumerable-read-only-property"),Bm=Uf(),MVe=fD(),xVe=pD();yD(Bm,"objectMode",MVe);yD(Bm,"factory",xVe);qD.exports=Bm});var wD=s(function(Zrr,AVe){AVe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var ED=s(function(Qrr,OD){"use strict";var GVe=require("@stdlib/assert/is-plain-object"),mr=require("@stdlib/assert/has-own-property"),VVe=require("@stdlib/assert/is-boolean").isPrimitive,FVe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,SD=require("@stdlib/assert/is-string").isPrimitive,WVe=require("@stdlib/assert/is-positive-integer").isPrimitive,IVe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,kn=require("@stdlib/string/format");function kVe(r,e){return GVe(e)?mr(e,"sep")&&(r.sep=e.sep,!SD(r.sep))?new TypeError(kn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):mr(e,"objectMode")&&(r.objectMode=e.objectMode,!VVe(r.objectMode))?new TypeError(kn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):mr(e,"encoding")&&(r.encoding=e.encoding,!SD(r.encoding)&&r.encoding!==null)?new TypeError(kn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):mr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!FVe(r.highWaterMark))?new TypeError(kn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):mr(e,"iter")&&(r.iter=e.iter,!IVe(r.iter))?new TypeError(kn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):mr(e,"siter")&&(r.siter=e.siter,!WVe(r.siter))?new TypeError(kn("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(kn("invalid argument. Options argument must be an object. Value: `%s`.",e))}OD.exports=kVe});var ND=s(function($rr,_D){"use strict";var zVe=require("debug"),JVe=zVe("random:streams:kumaraswamy");_D.exports=JVe});var Bf=s(function(Krr,MD){"use strict";var jD=require("readable-stream").Readable,LD=require("@stdlib/assert/is-positive-number").isPrimitive,UVe=require("@stdlib/assert/is-error"),CVe=require("@stdlib/object/assign"),BVe=require("@stdlib/utils/inherit"),RD=require("@stdlib/utils/define-nonenumerable-property"),Vi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Cf=require("@stdlib/utils/define-read-only-accessor"),DVe=require("@stdlib/utils/define-read-write-accessor"),XVe=Pa().factory,PD=require("@stdlib/buffer/from-string"),YVe=require("@stdlib/utils/next-tick"),TD=require("@stdlib/string/format"),HVe=wD(),ZVe=ED(),ps=ND();function QVe(){return this._prng.seed}function $Ve(){return this._prng.seedLength}function KVe(){return this._prng.stateLength}function e2e(){return this._prng.byteLength}function r2e(){return this._prng.state}function t2e(r){this._prng.state=r}function i2e(){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=PD(e):e=PD(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function n2e(r){var e;if(this._destroyed)return ps("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,YVe(t),this;function t(){r&&(ps("Stream was destroyed due to an error. Error: %s.",UVe(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(!LD(r))throw new TypeError(TD("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!LD(e))throw new TypeError(TD("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=CVe({},HVe),arguments.length>2&&(n=ZVe(i,t),n))throw n;return ps("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),jD.call(this,i),RD(this,"_destroyed",!1),Vi(this,"_objectMode",i.objectMode),Vi(this,"_sep",i.sep),Vi(this,"_iter",i.iter),Vi(this,"_siter",i.siter),RD(this,"_i",0),Vi(this,"_prng",XVe(r,e,i)),Vi(this,"PRNG",this._prng.PRNG),this}BVe(Oe,jD);Cf(Oe.prototype,"seed",QVe);Cf(Oe.prototype,"seedLength",$Ve);DVe(Oe.prototype,"state",r2e,t2e);Cf(Oe.prototype,"stateLength",KVe);Cf(Oe.prototype,"byteLength",e2e);Vi(Oe.prototype,"_read",i2e);Vi(Oe.prototype,"destroy",n2e);MD.exports=Oe});var AD=s(function(etr,xD){"use strict";var a2e=require("@stdlib/assert/is-plain-object"),s2e=require("@stdlib/object/assign"),u2e=require("@stdlib/string/format"),o2e=Bf();function v2e(r,e,t){var i;if(arguments.length>2){if(i=t,!a2e(i))throw new TypeError(u2e("invalid argument. Options argument must be an object. Value: `%s`.",i));i=s2e({},t)}else i={};return i.objectMode=!0,new o2e(r,e,i)}xD.exports=v2e});var kD=s(function(rtr,ID){"use strict";var GD=require("@stdlib/assert/is-plain-object"),VD=require("@stdlib/object/assign"),FD=require("@stdlib/string/format"),WD=Bf();function g2e(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!GD(r))throw new TypeError(FD("invalid argument. Options argument must be an object. Value: `%s`.",r));n=VD({},r)}else if(i>2){if(!GD(t))throw new TypeError(FD("invalid argument. Options argument must be an object. Value: `%s`.",t));n=VD({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new WD(v,g,n)}function o(){return new WD(r,e,n)}}ID.exports=g2e});var UD=s(function(ttr,JD){"use strict";var zD=require("@stdlib/utils/define-nonenumerable-read-only-property"),Dm=Bf(),f2e=AD(),d2e=kD();zD(Dm,"objectMode",f2e);zD(Dm,"factory",d2e);JD.exports=Dm});var CD=s(function(itr,l2e){l2e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var XD=s(function(ntr,DD){"use strict";var c2e=require("@stdlib/assert/is-plain-object"),hr=require("@stdlib/assert/has-own-property"),m2e=require("@stdlib/assert/is-boolean").isPrimitive,h2e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,BD=require("@stdlib/assert/is-string").isPrimitive,p2e=require("@stdlib/assert/is-positive-integer").isPrimitive,y2e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,zn=require("@stdlib/string/format");function q2e(r,e){return c2e(e)?hr(e,"sep")&&(r.sep=e.sep,!BD(r.sep))?new TypeError(zn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):hr(e,"objectMode")&&(r.objectMode=e.objectMode,!m2e(r.objectMode))?new TypeError(zn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):hr(e,"encoding")&&(r.encoding=e.encoding,!BD(r.encoding)&&r.encoding!==null)?new TypeError(zn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):hr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!h2e(r.highWaterMark))?new TypeError(zn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):hr(e,"iter")&&(r.iter=e.iter,!y2e(r.iter))?new TypeError(zn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):hr(e,"siter")&&(r.siter=e.siter,!p2e(r.siter))?new TypeError(zn("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(zn("invalid argument. Options argument must be an object. Value: `%s`.",e))}DD.exports=q2e});var HD=s(function(atr,YD){"use strict";var b2e=require("debug"),w2e=b2e("random:streams:laplace");YD.exports=w2e});var Xf=s(function(str,e8){"use strict";var KD=require("readable-stream").Readable,S2e=require("@stdlib/assert/is-positive-number").isPrimitive,O2e=require("@stdlib/assert/is-number").isPrimitive,E2e=require("@stdlib/math/base/assert/is-nan"),_2e=require("@stdlib/assert/is-error"),N2e=require("@stdlib/object/assign"),L2e=require("@stdlib/utils/inherit"),ZD=require("@stdlib/utils/define-nonenumerable-property"),Fi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Df=require("@stdlib/utils/define-read-only-accessor"),R2e=require("@stdlib/utils/define-read-write-accessor"),P2e=Ta().factory,QD=require("@stdlib/buffer/from-string"),$D=require("@stdlib/string/format"),T2e=require("@stdlib/utils/next-tick"),j2e=CD(),M2e=XD(),ys=HD();function x2e(){return this._prng.seed}function A2e(){return this._prng.seedLength}function G2e(){return this._prng.stateLength}function V2e(){return this._prng.byteLength}function F2e(){return this._prng.state}function W2e(r){this._prng.state=r}function I2e(){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=QD(e):e=QD(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function k2e(r){var e;if(this._destroyed)return ys("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,T2e(t),this;function t(){r&&(ys("Stream was destroyed due to an error. Error: %s.",_2e(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(!O2e(r)||E2e(r))throw new TypeError($D("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!S2e(e))throw new TypeError($D("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=N2e({},j2e),arguments.length>2&&(n=M2e(i,t),n))throw n;return ys("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),KD.call(this,i),ZD(this,"_destroyed",!1),Fi(this,"_objectMode",i.objectMode),Fi(this,"_sep",i.sep),Fi(this,"_iter",i.iter),Fi(this,"_siter",i.siter),ZD(this,"_i",0),Fi(this,"_prng",P2e(r,e,i)),Fi(this,"PRNG",this._prng.PRNG),this}L2e(Ee,KD);Df(Ee.prototype,"seed",x2e);Df(Ee.prototype,"seedLength",A2e);R2e(Ee.prototype,"state",F2e,W2e);Df(Ee.prototype,"stateLength",G2e);Df(Ee.prototype,"byteLength",V2e);Fi(Ee.prototype,"_read",I2e);Fi(Ee.prototype,"destroy",k2e);e8.exports=Ee});var t8=s(function(utr,r8){"use strict";var z2e=require("@stdlib/assert/is-plain-object"),J2e=require("@stdlib/object/assign"),U2e=require("@stdlib/string/format"),C2e=Xf();function B2e(r,e,t){var i;if(arguments.length>2){if(i=t,!z2e(i))throw new TypeError(U2e("invalid argument. Options argument must be an object. Value: `%s`.",i));i=J2e({},t)}else i={};return i.objectMode=!0,new C2e(r,e,i)}r8.exports=B2e});var o8=s(function(otr,u8){"use strict";var i8=require("@stdlib/assert/is-plain-object"),n8=require("@stdlib/object/assign"),a8=require("@stdlib/string/format"),s8=Xf();function D2e(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!i8(r))throw new TypeError(a8("invalid argument. Options argument must be an object. Value: `%s`.",r));n=n8({},r)}else if(i>2){if(!i8(t))throw new TypeError(a8("invalid argument. Options argument must be an object. Value: `%s`.",t));n=n8({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new s8(v,g,n)}function o(){return new s8(r,e,n)}}u8.exports=D2e});var f8=s(function(vtr,g8){"use strict";var v8=require("@stdlib/utils/define-nonenumerable-read-only-property"),Xm=Xf(),X2e=t8(),Y2e=o8();v8(Xm,"objectMode",X2e);v8(Xm,"factory",Y2e);g8.exports=Xm});var d8=s(function(gtr,H2e){H2e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var m8=s(function(ftr,c8){"use strict";var Z2e=require("@stdlib/assert/is-plain-object"),pr=require("@stdlib/assert/has-own-property"),Q2e=require("@stdlib/assert/is-boolean").isPrimitive,$2e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,l8=require("@stdlib/assert/is-string").isPrimitive,K2e=require("@stdlib/assert/is-positive-integer").isPrimitive,eFe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Jn=require("@stdlib/string/format");function rFe(r,e){return Z2e(e)?pr(e,"sep")&&(r.sep=e.sep,!l8(r.sep))?new TypeError(Jn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):pr(e,"objectMode")&&(r.objectMode=e.objectMode,!Q2e(r.objectMode))?new TypeError(Jn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):pr(e,"encoding")&&(r.encoding=e.encoding,!l8(r.encoding)&&r.encoding!==null)?new TypeError(Jn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):pr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!$2e(r.highWaterMark))?new TypeError(Jn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):pr(e,"iter")&&(r.iter=e.iter,!eFe(r.iter))?new TypeError(Jn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):pr(e,"siter")&&(r.siter=e.siter,!K2e(r.siter))?new TypeError(Jn("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(Jn("invalid argument. Options argument must be an object. Value: `%s`.",e))}c8.exports=rFe});var p8=s(function(dtr,h8){"use strict";var tFe=require("debug"),iFe=tFe("random:streams:levy");h8.exports=iFe});var Hf=s(function(ltr,S8){"use strict";var w8=require("readable-stream").Readable,nFe=require("@stdlib/assert/is-positive-number").isPrimitive,aFe=require("@stdlib/assert/is-number").isPrimitive,sFe=require("@stdlib/math/base/assert/is-nan"),uFe=require("@stdlib/assert/is-error"),oFe=require("@stdlib/object/assign"),vFe=require("@stdlib/utils/inherit"),y8=require("@stdlib/utils/define-nonenumerable-property"),Wi=require("@stdlib/utils/define-nonenumerable-read-only-property"),Yf=require("@stdlib/utils/define-read-only-accessor"),gFe=require("@stdlib/utils/define-read-write-accessor"),fFe=ja().factory,q8=require("@stdlib/buffer/from-string"),dFe=require("@stdlib/utils/next-tick"),b8=require("@stdlib/string/format"),lFe=d8(),cFe=m8(),qs=p8();function mFe(){return this._prng.seed}function hFe(){return this._prng.seedLength}function pFe(){return this._prng.stateLength}function yFe(){return this._prng.byteLength}function qFe(){return this._prng.state}function bFe(r){this._prng.state=r}function wFe(){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=q8(e):e=q8(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function SFe(r){var e;if(this._destroyed)return qs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,dFe(t),this;function t(){r&&(qs("Stream was destroyed due to an error. Error: %s.",uFe(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(!aFe(r)||sFe(r))throw new TypeError(b8("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!nFe(e))throw new TypeError(b8("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=oFe({},lFe),arguments.length>2&&(n=cFe(i,t),n))throw n;return qs("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),w8.call(this,i),y8(this,"_destroyed",!1),Wi(this,"_objectMode",i.objectMode),Wi(this,"_sep",i.sep),Wi(this,"_iter",i.iter),Wi(this,"_siter",i.siter),y8(this,"_i",0),Wi(this,"_prng",fFe(r,e,i)),Wi(this,"PRNG",this._prng.PRNG),this}vFe(_e,w8);Yf(_e.prototype,"seed",mFe);Yf(_e.prototype,"seedLength",hFe);gFe(_e.prototype,"state",qFe,bFe);Yf(_e.prototype,"stateLength",pFe);Yf(_e.prototype,"byteLength",yFe);Wi(_e.prototype,"_read",wFe);Wi(_e.prototype,"destroy",SFe);S8.exports=_e});var E8=s(function(ctr,O8){"use strict";var OFe=require("@stdlib/assert/is-plain-object"),EFe=require("@stdlib/object/assign"),_Fe=require("@stdlib/string/format"),NFe=Hf();function LFe(r,e,t){var i;if(arguments.length>2){if(i=t,!OFe(i))throw new TypeError(_Fe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=EFe({},t)}else i={};return i.objectMode=!0,new NFe(r,e,i)}O8.exports=LFe});var T8=s(function(mtr,P8){"use strict";var _8=require("@stdlib/assert/is-plain-object"),N8=require("@stdlib/object/assign"),L8=require("@stdlib/string/format"),R8=Hf();function RFe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!_8(r))throw new TypeError(L8("invalid argument. Options argument must be an object. Value: `%s`.",r));n=N8({},r)}else if(i>2){if(!_8(t))throw new TypeError(L8("invalid argument. Options argument must be an object. Value: `%s`.",t));n=N8({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new R8(v,g,n)}function o(){return new R8(r,e,n)}}P8.exports=RFe});var x8=s(function(htr,M8){"use strict";var j8=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ym=Hf(),PFe=E8(),TFe=T8();j8(Ym,"objectMode",PFe);j8(Ym,"factory",TFe);M8.exports=Ym});var A8=s(function(ptr,jFe){jFe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var F8=s(function(ytr,V8){"use strict";var MFe=require("@stdlib/assert/is-plain-object"),yr=require("@stdlib/assert/has-own-property"),xFe=require("@stdlib/assert/is-boolean").isPrimitive,AFe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,G8=require("@stdlib/assert/is-string").isPrimitive,GFe=require("@stdlib/assert/is-positive-integer").isPrimitive,VFe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Un=require("@stdlib/string/format");function FFe(r,e){return MFe(e)?yr(e,"sep")&&(r.sep=e.sep,!G8(r.sep))?new TypeError(Un("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):yr(e,"objectMode")&&(r.objectMode=e.objectMode,!xFe(r.objectMode))?new TypeError(Un("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):yr(e,"encoding")&&(r.encoding=e.encoding,!G8(r.encoding)&&r.encoding!==null)?new TypeError(Un("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):yr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!AFe(r.highWaterMark))?new TypeError(Un("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):yr(e,"iter")&&(r.iter=e.iter,!VFe(r.iter))?new TypeError(Un("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):yr(e,"siter")&&(r.siter=e.siter,!GFe(r.siter))?new TypeError(Un("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(Un("invalid argument. Options argument must be an object. Value: `%s`.",e))}V8.exports=FFe});var I8=s(function(qtr,W8){"use strict";var WFe=require("debug"),IFe=WFe("random:streams:logistic");W8.exports=IFe});var Qf=s(function(btr,C8){"use strict";var U8=require("readable-stream").Readable,kFe=require("@stdlib/assert/is-positive-number").isPrimitive,zFe=require("@stdlib/assert/is-number").isPrimitive,JFe=require("@stdlib/math/base/assert/is-nan"),UFe=require("@stdlib/assert/is-error"),CFe=require("@stdlib/object/assign"),BFe=require("@stdlib/utils/inherit"),k8=require("@stdlib/utils/define-nonenumerable-property"),Ii=require("@stdlib/utils/define-nonenumerable-read-only-property"),Zf=require("@stdlib/utils/define-read-only-accessor"),DFe=require("@stdlib/utils/define-read-write-accessor"),XFe=Ma().factory,z8=require("@stdlib/buffer/from-string"),YFe=require("@stdlib/utils/next-tick"),J8=require("@stdlib/string/format"),HFe=A8(),ZFe=F8(),bs=I8();function QFe(){return this._prng.seed}function $Fe(){return this._prng.seedLength}function KFe(){return this._prng.stateLength}function eWe(){return this._prng.byteLength}function rWe(){return this._prng.state}function tWe(r){this._prng.state=r}function iWe(){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=z8(e):e=z8(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function nWe(r){var e;if(this._destroyed)return bs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,YFe(t),this;function t(){r&&(bs("Stream was destroyed due to an error. Error: %s.",UFe(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(!zFe(r)||JFe(r))throw new TypeError(J8("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!kFe(e))throw new TypeError(J8("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=CFe({},HFe),arguments.length>2&&(n=ZFe(i,t),n))throw n;return bs("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),U8.call(this,i),k8(this,"_destroyed",!1),Ii(this,"_objectMode",i.objectMode),Ii(this,"_sep",i.sep),Ii(this,"_iter",i.iter),Ii(this,"_siter",i.siter),k8(this,"_i",0),Ii(this,"_prng",XFe(r,e,i)),Ii(this,"PRNG",this._prng.PRNG),this}BFe(Ne,U8);Zf(Ne.prototype,"seed",QFe);Zf(Ne.prototype,"seedLength",$Fe);DFe(Ne.prototype,"state",rWe,tWe);Zf(Ne.prototype,"stateLength",KFe);Zf(Ne.prototype,"byteLength",eWe);Ii(Ne.prototype,"_read",iWe);Ii(Ne.prototype,"destroy",nWe);C8.exports=Ne});var D8=s(function(wtr,B8){"use strict";var aWe=require("@stdlib/assert/is-plain-object"),sWe=require("@stdlib/object/assign"),uWe=require("@stdlib/string/format"),oWe=Qf();function vWe(r,e,t){var i;if(arguments.length>2){if(i=t,!aWe(i))throw new TypeError(uWe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=sWe({},t)}else i={};return i.objectMode=!0,new oWe(r,e,i)}B8.exports=vWe});var $8=s(function(Str,Q8){"use strict";var X8=require("@stdlib/assert/is-plain-object"),Y8=require("@stdlib/object/assign"),H8=require("@stdlib/string/format"),Z8=Qf();function gWe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!X8(r))throw new TypeError(H8("invalid argument. Options argument must be an object. Value: `%s`.",r));n=Y8({},r)}else if(i>2){if(!X8(t))throw new TypeError(H8("invalid argument. Options argument must be an object. Value: `%s`.",t));n=Y8({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new Z8(v,g,n)}function o(){return new Z8(r,e,n)}}Q8.exports=gWe});var rX=s(function(Otr,eX){"use strict";var K8=require("@stdlib/utils/define-nonenumerable-read-only-property"),Hm=Qf(),fWe=D8(),dWe=$8();K8(Hm,"objectMode",fWe);K8(Hm,"factory",dWe);eX.exports=Hm});var tX=s(function(Etr,lWe){lWe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var aX=s(function(_tr,nX){"use strict";var cWe=require("@stdlib/assert/is-plain-object"),qr=require("@stdlib/assert/has-own-property"),mWe=require("@stdlib/assert/is-boolean").isPrimitive,hWe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,iX=require("@stdlib/assert/is-string").isPrimitive,pWe=require("@stdlib/assert/is-positive-integer").isPrimitive,yWe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Cn=require("@stdlib/string/format");function qWe(r,e){return cWe(e)?qr(e,"sep")&&(r.sep=e.sep,!iX(r.sep))?new TypeError(Cn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):qr(e,"objectMode")&&(r.objectMode=e.objectMode,!mWe(r.objectMode))?new TypeError(Cn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):qr(e,"encoding")&&(r.encoding=e.encoding,!iX(r.encoding)&&r.encoding!==null)?new TypeError(Cn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):qr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!hWe(r.highWaterMark))?new TypeError(Cn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):qr(e,"iter")&&(r.iter=e.iter,!yWe(r.iter))?new TypeError(Cn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):qr(e,"siter")&&(r.siter=e.siter,!pWe(r.siter))?new TypeError(Cn("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(Cn("invalid argument. Options argument must be an object. Value: `%s`.",e))}nX.exports=qWe});var uX=s(function(Ntr,sX){"use strict";var bWe=require("debug"),wWe=bWe("random:streams:lognormal");sX.exports=wWe});var Kf=s(function(Ltr,dX){"use strict";var fX=require("readable-stream").Readable,SWe=require("@stdlib/assert/is-positive-number").isPrimitive,OWe=require("@stdlib/assert/is-number").isPrimitive,EWe=require("@stdlib/math/base/assert/is-nan"),_We=require("@stdlib/assert/is-error"),NWe=require("@stdlib/object/assign"),LWe=require("@stdlib/utils/inherit"),oX=require("@stdlib/utils/define-nonenumerable-property"),ki=require("@stdlib/utils/define-nonenumerable-read-only-property"),$f=require("@stdlib/utils/define-read-only-accessor"),RWe=require("@stdlib/utils/define-read-write-accessor"),PWe=ln().factory,vX=require("@stdlib/buffer/from-string"),TWe=require("@stdlib/utils/next-tick"),gX=require("@stdlib/string/format"),jWe=tX(),MWe=aX(),ws=uX();function xWe(){return this._prng.seed}function AWe(){return this._prng.seedLength}function GWe(){return this._prng.stateLength}function VWe(){return this._prng.byteLength}function FWe(){return this._prng.state}function WWe(r){this._prng.state=r}function IWe(){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=vX(e):e=vX(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function kWe(r){var e;if(this._destroyed)return ws("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,TWe(t),this;function t(){r&&(ws("Stream was destroyed due to an error. Error: %s.",_We(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(!OWe(r)||EWe(r))throw new TypeError(gX("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!SWe(e))throw new TypeError(gX("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=NWe({},jWe),arguments.length>2&&(n=MWe(i,t),n))throw n;return ws("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),fX.call(this,i),oX(this,"_destroyed",!1),ki(this,"_objectMode",i.objectMode),ki(this,"_sep",i.sep),ki(this,"_iter",i.iter),ki(this,"_siter",i.siter),oX(this,"_i",0),ki(this,"_prng",PWe(r,e,i)),ki(this,"PRNG",this._prng.PRNG),this}LWe(Le,fX);$f(Le.prototype,"seed",xWe);$f(Le.prototype,"seedLength",AWe);RWe(Le.prototype,"state",FWe,WWe);$f(Le.prototype,"stateLength",GWe);$f(Le.prototype,"byteLength",VWe);ki(Le.prototype,"_read",IWe);ki(Le.prototype,"destroy",kWe);dX.exports=Le});var cX=s(function(Rtr,lX){"use strict";var zWe=require("@stdlib/assert/is-plain-object"),JWe=require("@stdlib/object/assign"),UWe=require("@stdlib/string/format"),CWe=Kf();function BWe(r,e,t){var i;if(arguments.length>2){if(i=t,!zWe(i))throw new TypeError(UWe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=JWe({},t)}else i={};return i.objectMode=!0,new CWe(r,e,i)}lX.exports=BWe});var bX=s(function(Ptr,qX){"use strict";var mX=require("@stdlib/assert/is-plain-object"),hX=require("@stdlib/object/assign"),pX=require("@stdlib/string/format"),yX=Kf();function DWe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!mX(r))throw new TypeError(pX("invalid argument. Options argument must be an object. Value: `%s`.",r));n=hX({},r)}else if(i>2){if(!mX(t))throw new TypeError(pX("invalid argument. Options argument must be an object. Value: `%s`.",t));n=hX({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new yX(v,g,n)}function o(){return new yX(r,e,n)}}qX.exports=DWe});var OX=s(function(Ttr,SX){"use strict";var wX=require("@stdlib/utils/define-nonenumerable-read-only-property"),Zm=Kf(),XWe=cX(),YWe=bX();wX(Zm,"objectMode",XWe);wX(Zm,"factory",YWe);SX.exports=Zm});var EX=s(function(jtr,HWe){HWe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308,normalized:!1}});var RX=s(function(Mtr,LX){"use strict";var ZWe=require("@stdlib/assert/is-plain-object"),br=require("@stdlib/assert/has-own-property"),_X=require("@stdlib/assert/is-boolean").isPrimitive,QWe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,NX=require("@stdlib/assert/is-string").isPrimitive,$We=require("@stdlib/assert/is-positive-integer").isPrimitive,KWe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,zi=require("@stdlib/string/format");function eIe(r,e){return ZWe(e)?br(e,"sep")&&(r.sep=e.sep,!NX(r.sep))?new TypeError(zi("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):br(e,"objectMode")&&(r.objectMode=e.objectMode,!_X(r.objectMode))?new TypeError(zi("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):br(e,"encoding")&&(r.encoding=e.encoding,!NX(r.encoding)&&r.encoding!==null)?new TypeError(zi("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):br(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!QWe(r.highWaterMark))?new TypeError(zi("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):br(e,"iter")&&(r.iter=e.iter,!KWe(r.iter))?new TypeError(zi("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):br(e,"siter")&&(r.siter=e.siter,!$We(r.siter))?new TypeError(zi("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):br(e,"normalized")&&(r.normalized=e.normalized,!_X(r.normalized))?new TypeError(zi("invalid option. `%s` option must be a boolean. Option: `%s`.","normalized",r.normalized)):(br(e,"seed")&&(r.seed=e.seed),br(e,"state")&&(r.state=e.state),br(e,"copy")&&(r.copy=e.copy),null):new TypeError(zi("invalid argument. Options argument must be an object. Value: `%s`.",e))}LX.exports=eIe});var TX=s(function(xtr,PX){"use strict";var rIe=require("debug"),tIe=rIe("random:streams:minstd");PX.exports=tIe});var rd=s(function(Atr,AX){"use strict";var xX=require("readable-stream").Readable,iIe=require("@stdlib/assert/is-error"),nIe=require("@stdlib/object/assign"),aIe=require("@stdlib/utils/inherit"),jX=require("@stdlib/utils/define-nonenumerable-property"),Bn=require("@stdlib/utils/define-nonenumerable-read-only-property"),ed=require("@stdlib/utils/define-read-only-accessor"),sIe=require("@stdlib/utils/define-read-write-accessor"),uIe=$().factory,MX=require("@stdlib/buffer/from-string"),oIe=require("@stdlib/utils/next-tick"),vIe=EX(),gIe=RX(),Ss=TX();function fIe(){return this._prng.seed}function dIe(){return this._prng.seedLength}function lIe(){return this._prng.stateLength}function cIe(){return this._prng.byteLength}function mIe(){return this._prng.state}function hIe(r){this._prng.state=r}function pIe(){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=MX(e):e=MX(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function yIe(r){var e;if(this._destroyed)return Ss("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,oIe(t),this;function t(){r&&(Ss("Stream was destroyed due to an error. Error: %s.",iIe(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=nIe({},vIe),arguments.length>0&&(i=gIe(t,r),i))throw i;return Ss("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),xX.call(this,t),jX(this,"_destroyed",!1),Bn(this,"_objectMode",t.objectMode),Bn(this,"_sep",t.sep),Bn(this,"_iter",t.iter),Bn(this,"_siter",t.siter),jX(this,"_i",0),e=uIe(t),t.normalized&&(e=e.normalized),Bn(this,"_prng",e),this}aIe(Re,xX);ed(Re.prototype,"seed",fIe);ed(Re.prototype,"seedLength",dIe);sIe(Re.prototype,"state",mIe,hIe);ed(Re.prototype,"stateLength",lIe);ed(Re.prototype,"byteLength",cIe);Bn(Re.prototype,"_read",pIe);Bn(Re.prototype,"destroy",yIe);AX.exports=Re});var VX=s(function(Gtr,GX){"use strict";var qIe=require("@stdlib/assert/is-plain-object"),bIe=require("@stdlib/object/assign"),wIe=require("@stdlib/string/format"),SIe=rd();function OIe(r){var e;if(arguments.length>0){if(e=r,!qIe(e))throw new TypeError(wIe("invalid argument. Options argument must be an object. Value: `%s`.",e));e=bIe({},r)}else e={};return e.objectMode=!0,new SIe(e)}GX.exports=OIe});var WX=s(function(Vtr,FX){"use strict";var EIe=require("@stdlib/assert/is-plain-object"),_Ie=require("@stdlib/object/assign"),NIe=require("@stdlib/string/format"),LIe=rd();function RIe(r){var e;if(arguments.length>0){if(!EIe(r))throw new TypeError(NIe("invalid argument. Options argument must be an object. Value: `%s`.",r));e=_Ie({},r)}else e={};return t;function t(){return new LIe(e)}}FX.exports=RIe});var zX=s(function(Ftr,kX){"use strict";var IX=require("@stdlib/utils/define-nonenumerable-read-only-property"),Qm=rd(),PIe=VX(),TIe=WX();IX(Qm,"objectMode",PIe);IX(Qm,"factory",TIe);kX.exports=Qm});var JX=s(function(Wtr,jIe){jIe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308,normalized:!1}});var DX=s(function(Itr,BX){"use strict";var MIe=require("@stdlib/assert/is-plain-object"),wr=require("@stdlib/assert/has-own-property"),UX=require("@stdlib/assert/is-boolean").isPrimitive,xIe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,CX=require("@stdlib/assert/is-string").isPrimitive,AIe=require("@stdlib/assert/is-positive-integer").isPrimitive,GIe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Ji=require("@stdlib/string/format");function VIe(r,e){return MIe(e)?wr(e,"sep")&&(r.sep=e.sep,!CX(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,!UX(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,!CX(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,!xIe(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,!GIe(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,!AIe(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,!UX(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))}BX.exports=VIe});var YX=s(function(ktr,XX){"use strict";var FIe=require("debug"),WIe=FIe("random:streams:minstd-shuffle");XX.exports=WIe});var id=s(function(ztr,$X){"use strict";var QX=require("readable-stream").Readable,IIe=require("@stdlib/assert/is-error"),kIe=require("@stdlib/object/assign"),zIe=require("@stdlib/utils/inherit"),HX=require("@stdlib/utils/define-nonenumerable-property"),Dn=require("@stdlib/utils/define-nonenumerable-read-only-property"),td=require("@stdlib/utils/define-read-only-accessor"),JIe=require("@stdlib/utils/define-read-write-accessor"),UIe=ee().factory,ZX=require("@stdlib/buffer/from-string"),CIe=require("@stdlib/utils/next-tick"),BIe=JX(),DIe=DX(),Os=YX();function XIe(){return this._prng.seed}function YIe(){return this._prng.seedLength}function HIe(){return this._prng.stateLength}function ZIe(){return this._prng.byteLength}function QIe(){return this._prng.state}function $Ie(r){this._prng.state=r}function KIe(){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=ZX(e):e=ZX(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function eke(r){var e;if(this._destroyed)return Os("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,CIe(t),this;function t(){r&&(Os("Stream was destroyed due to an error. Error: %s.",IIe(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=kIe({},BIe),arguments.length>0&&(i=DIe(t,r),i))throw i;return Os("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),QX.call(this,t),HX(this,"_destroyed",!1),Dn(this,"_objectMode",t.objectMode),Dn(this,"_sep",t.sep),Dn(this,"_iter",t.iter),Dn(this,"_siter",t.siter),HX(this,"_i",0),e=UIe(t),t.normalized&&(e=e.normalized),Dn(this,"_prng",e),this}zIe(Pe,QX);td(Pe.prototype,"seed",XIe);td(Pe.prototype,"seedLength",YIe);JIe(Pe.prototype,"state",QIe,$Ie);td(Pe.prototype,"stateLength",HIe);td(Pe.prototype,"byteLength",ZIe);Dn(Pe.prototype,"_read",KIe);Dn(Pe.prototype,"destroy",eke);$X.exports=Pe});var e7=s(function(Jtr,KX){"use strict";var rke=require("@stdlib/assert/is-plain-object"),tke=require("@stdlib/object/assign"),ike=require("@stdlib/string/format"),nke=id();function ake(r){var e;if(arguments.length>0){if(e=r,!rke(e))throw new TypeError(ike("invalid argument. Options argument must be an object. Value: `%s`.",e));e=tke({},r)}else e={};return e.objectMode=!0,new nke(e)}KX.exports=ake});var t7=s(function(Utr,r7){"use strict";var ske=require("@stdlib/assert/is-plain-object"),uke=require("@stdlib/object/assign"),oke=require("@stdlib/string/format"),vke=id();function gke(r){var e;if(arguments.length>0){if(!ske(r))throw new TypeError(oke("invalid argument. Options argument must be an object. Value: `%s`.",r));e=uke({},r)}else e={};return t;function t(){return new vke(e)}}r7.exports=gke});var a7=s(function(Ctr,n7){"use strict";var i7=require("@stdlib/utils/define-nonenumerable-read-only-property"),$m=id(),fke=e7(),dke=t7();i7($m,"objectMode",fke);i7($m,"factory",dke);n7.exports=$m});var s7=s(function(Btr,lke){lke.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308,normalized:!1}});var g7=s(function(Dtr,v7){"use strict";var cke=require("@stdlib/assert/is-plain-object"),Sr=require("@stdlib/assert/has-own-property"),u7=require("@stdlib/assert/is-boolean").isPrimitive,mke=require("@stdlib/assert/is-nonnegative-number").isPrimitive,o7=require("@stdlib/assert/is-string").isPrimitive,hke=require("@stdlib/assert/is-positive-integer").isPrimitive,pke=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Ui=require("@stdlib/string/format");function yke(r,e){return cke(e)?Sr(e,"sep")&&(r.sep=e.sep,!o7(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,!u7(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,!o7(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,!mke(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,!pke(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,!hke(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,!u7(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))}v7.exports=yke});var d7=s(function(Xtr,f7){"use strict";var qke=require("debug"),bke=qke("random:streams:mt19937");f7.exports=bke});var ad=s(function(Ytr,h7){"use strict";var m7=require("readable-stream").Readable,wke=require("@stdlib/assert/is-error"),Ske=require("@stdlib/object/assign"),Oke=require("@stdlib/utils/inherit"),l7=require("@stdlib/utils/define-nonenumerable-property"),Xn=require("@stdlib/utils/define-nonenumerable-read-only-property"),nd=require("@stdlib/utils/define-read-only-accessor"),Eke=require("@stdlib/utils/define-read-write-accessor"),_ke=T().factory,c7=require("@stdlib/buffer/from-string"),Nke=require("@stdlib/utils/next-tick"),Lke=s7(),Rke=g7(),Es=d7();function Pke(){return this._prng.seed}function Tke(){return this._prng.seedLength}function jke(){return this._prng.stateLength}function Mke(){return this._prng.byteLength}function xke(){return this._prng.state}function Ake(r){this._prng.state=r}function Gke(){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=c7(e):e=c7(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function Vke(r){var e;if(this._destroyed)return Es("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,Nke(t),this;function t(){r&&(Es("Stream was destroyed due to an error. Error: %s.",wke(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=Ske({},Lke),arguments.length>0&&(i=Rke(t,r),i))throw i;return Es("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),m7.call(this,t),l7(this,"_destroyed",!1),Xn(this,"_objectMode",t.objectMode),Xn(this,"_sep",t.sep),Xn(this,"_iter",t.iter),Xn(this,"_siter",t.siter),l7(this,"_i",0),e=_ke(t),t.normalized&&(e=e.normalized),Xn(this,"_prng",e),this}Oke(Te,m7);nd(Te.prototype,"seed",Pke);nd(Te.prototype,"seedLength",Tke);Eke(Te.prototype,"state",xke,Ake);nd(Te.prototype,"stateLength",jke);nd(Te.prototype,"byteLength",Mke);Xn(Te.prototype,"_read",Gke);Xn(Te.prototype,"destroy",Vke);h7.exports=Te});var y7=s(function(Htr,p7){"use strict";var Fke=require("@stdlib/assert/is-plain-object"),Wke=require("@stdlib/object/assign"),Ike=require("@stdlib/string/format"),kke=ad();function zke(r){var e;if(arguments.length>0){if(e=r,!Fke(e))throw new TypeError(Ike("invalid argument. Options argument must be an object. Value: `%s`.",e));e=Wke({},r)}else e={};return e.objectMode=!0,new kke(e)}p7.exports=zke});var b7=s(function(Ztr,q7){"use strict";var Jke=require("@stdlib/assert/is-plain-object"),Uke=require("@stdlib/object/assign"),Cke=require("@stdlib/string/format"),Bke=ad();function Dke(r){var e;if(arguments.length>0){if(!Jke(r))throw new TypeError(Cke("invalid argument. Options argument must be an object. Value: `%s`.",r));e=Uke({},r)}else e={};return t;function t(){return new Bke(e)}}q7.exports=Dke});var O7=s(function(Qtr,S7){"use strict";var w7=require("@stdlib/utils/define-nonenumerable-read-only-property"),Km=ad(),Xke=y7(),Yke=b7();w7(Km,"objectMode",Xke);w7(Km,"factory",Yke);S7.exports=Km});var E7=s(function($tr,Hke){Hke.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var L7=s(function(Ktr,N7){"use strict";var Zke=require("@stdlib/assert/is-plain-object"),Or=require("@stdlib/assert/has-own-property"),Qke=require("@stdlib/assert/is-boolean").isPrimitive,$ke=require("@stdlib/assert/is-nonnegative-number").isPrimitive,_7=require("@stdlib/assert/is-string").isPrimitive,Kke=require("@stdlib/assert/is-positive-integer").isPrimitive,eze=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Yn=require("@stdlib/string/format");function rze(r,e){return Zke(e)?Or(e,"sep")&&(r.sep=e.sep,!_7(r.sep))?new TypeError(Yn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Or(e,"objectMode")&&(r.objectMode=e.objectMode,!Qke(r.objectMode))?new TypeError(Yn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Or(e,"encoding")&&(r.encoding=e.encoding,!_7(r.encoding)&&r.encoding!==null)?new TypeError(Yn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Or(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!$ke(r.highWaterMark))?new TypeError(Yn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Or(e,"iter")&&(r.iter=e.iter,!eze(r.iter))?new TypeError(Yn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Or(e,"siter")&&(r.siter=e.siter,!Kke(r.siter))?new TypeError(Yn("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(Yn("invalid argument. Options argument must be an object. Value: `%s`.",e))}N7.exports=rze});var P7=s(function(eir,R7){"use strict";var tze=require("debug"),ize=tze("random:streams:negative-binomial");R7.exports=ize});var ud=s(function(rir,A7){"use strict";var x7=require("readable-stream").Readable,nze=require("@stdlib/assert/is-positive-number").isPrimitive,aze=require("@stdlib/assert/is-probability").isPrimitive,sze=require("@stdlib/assert/is-error"),uze=require("@stdlib/object/assign"),oze=require("@stdlib/utils/inherit"),T7=require("@stdlib/utils/define-nonenumerable-property"),Ci=require("@stdlib/utils/define-nonenumerable-read-only-property"),sd=require("@stdlib/utils/define-read-only-accessor"),vze=require("@stdlib/utils/define-read-write-accessor"),gze=Ia().factory,j7=require("@stdlib/buffer/from-string"),fze=require("@stdlib/utils/next-tick"),M7=require("@stdlib/string/format"),dze=E7(),lze=L7(),_s=P7();function cze(){return this._prng.seed}function mze(){return this._prng.seedLength}function hze(){return this._prng.stateLength}function pze(){return this._prng.byteLength}function yze(){return this._prng.state}function qze(r){this._prng.state=r}function bze(){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=j7(e):e=j7(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function wze(r){var e;if(this._destroyed)return _s("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,fze(t),this;function t(){r&&(_s("Stream was destroyed due to an error. Error: %s.",sze(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(!nze(r))throw new TypeError(M7("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!aze(e))throw new TypeError(M7("invalid argument. Second argument must be a probability. Value: `%s`.",e));if(i=uze({},dze),arguments.length>2&&(n=lze(i,t),n))throw n;return _s("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),x7.call(this,i),T7(this,"_destroyed",!1),Ci(this,"_objectMode",i.objectMode),Ci(this,"_sep",i.sep),Ci(this,"_iter",i.iter),Ci(this,"_siter",i.siter),T7(this,"_i",0),Ci(this,"_prng",gze(r,e,i)),Ci(this,"PRNG",this._prng.PRNG),this}oze(je,x7);sd(je.prototype,"seed",cze);sd(je.prototype,"seedLength",mze);vze(je.prototype,"state",yze,qze);sd(je.prototype,"stateLength",hze);sd(je.prototype,"byteLength",pze);Ci(je.prototype,"_read",bze);Ci(je.prototype,"destroy",wze);A7.exports=je});var V7=s(function(tir,G7){"use strict";var Sze=require("@stdlib/assert/is-plain-object"),Oze=require("@stdlib/object/assign"),Eze=require("@stdlib/string/format"),_ze=ud();function Nze(r,e,t){var i;if(arguments.length>2){if(i=t,!Sze(i))throw new TypeError(Eze("invalid argument. Options argument must be an object. Value: `%s`.",i));i=Oze({},t)}else i={};return i.objectMode=!0,new _ze(r,e,i)}G7.exports=Nze});var J7=s(function(iir,z7){"use strict";var F7=require("@stdlib/assert/is-plain-object"),W7=require("@stdlib/object/assign"),I7=require("@stdlib/string/format"),k7=ud();function Lze(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!F7(r))throw new TypeError(I7("invalid argument. Options argument must be an object. Value: `%s`.",r));n=W7({},r)}else if(i>2){if(!F7(t))throw new TypeError(I7("invalid argument. Options argument must be an object. Value: `%s`.",t));n=W7({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new k7(v,g,n)}function o(){return new k7(r,e,n)}}z7.exports=Lze});var B7=s(function(nir,C7){"use strict";var U7=require("@stdlib/utils/define-nonenumerable-read-only-property"),eh=ud(),Rze=V7(),Pze=J7();U7(eh,"objectMode",Rze);U7(eh,"factory",Pze);C7.exports=eh});var D7=s(function(air,Tze){Tze.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var H7=s(function(sir,Y7){"use strict";var jze=require("@stdlib/assert/is-plain-object"),Er=require("@stdlib/assert/has-own-property"),Mze=require("@stdlib/assert/is-boolean").isPrimitive,xze=require("@stdlib/assert/is-nonnegative-number").isPrimitive,X7=require("@stdlib/assert/is-string").isPrimitive,Aze=require("@stdlib/assert/is-positive-integer").isPrimitive,Gze=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Hn=require("@stdlib/string/format");function Vze(r,e){return jze(e)?Er(e,"sep")&&(r.sep=e.sep,!X7(r.sep))?new TypeError(Hn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Er(e,"objectMode")&&(r.objectMode=e.objectMode,!Mze(r.objectMode))?new TypeError(Hn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Er(e,"encoding")&&(r.encoding=e.encoding,!X7(r.encoding)&&r.encoding!==null)?new TypeError(Hn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Er(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!xze(r.highWaterMark))?new TypeError(Hn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Er(e,"iter")&&(r.iter=e.iter,!Gze(r.iter))?new TypeError(Hn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Er(e,"siter")&&(r.siter=e.siter,!Aze(r.siter))?new TypeError(Hn("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(Hn("invalid argument. Options argument must be an object. Value: `%s`.",e))}Y7.exports=Vze});var Q7=s(function(uir,Z7){"use strict";var Fze=require("debug"),Wze=Fze("random:streams:normal");Z7.exports=Wze});var vd=s(function(oir,t5){"use strict";var r5=require("readable-stream").Readable,Ize=require("@stdlib/assert/is-positive-number").isPrimitive,kze=require("@stdlib/assert/is-number").isPrimitive,zze=require("@stdlib/math/base/assert/is-nan"),Jze=require("@stdlib/assert/is-error"),Uze=require("@stdlib/object/assign"),Cze=require("@stdlib/utils/inherit"),$7=require("@stdlib/utils/define-nonenumerable-property"),Bi=require("@stdlib/utils/define-nonenumerable-read-only-property"),od=require("@stdlib/utils/define-read-only-accessor"),Bze=require("@stdlib/utils/define-read-write-accessor"),Dze=mn().factory,K7=require("@stdlib/buffer/from-string"),Xze=require("@stdlib/utils/next-tick"),e5=require("@stdlib/string/format"),Yze=D7(),Hze=H7(),Ns=Q7();function Zze(){return this._prng.seed}function Qze(){return this._prng.seedLength}function $ze(){return this._prng.stateLength}function Kze(){return this._prng.byteLength}function e3e(){return this._prng.state}function r3e(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 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=K7(e):e=K7(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function i3e(r){var e;if(this._destroyed)return Ns("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,Xze(t),this;function t(){r&&(Ns("Stream was destroyed due to an error. Error: %s.",Jze(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(!kze(r)||zze(r))throw new TypeError(e5("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!Ize(e))throw new TypeError(e5("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=Uze({},Yze),arguments.length>2&&(n=Hze(i,t),n))throw n;return Ns("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),r5.call(this,i),$7(this,"_destroyed",!1),Bi(this,"_objectMode",i.objectMode),Bi(this,"_sep",i.sep),Bi(this,"_iter",i.iter),Bi(this,"_siter",i.siter),$7(this,"_i",0),Bi(this,"_prng",Dze(r,e,i)),Bi(this,"PRNG",this._prng.PRNG),this}Cze(Me,r5);od(Me.prototype,"seed",Zze);od(Me.prototype,"seedLength",Qze);Bze(Me.prototype,"state",e3e,r3e);od(Me.prototype,"stateLength",$ze);od(Me.prototype,"byteLength",Kze);Bi(Me.prototype,"_read",t3e);Bi(Me.prototype,"destroy",i3e);t5.exports=Me});var n5=s(function(vir,i5){"use strict";var n3e=require("@stdlib/assert/is-plain-object"),a3e=require("@stdlib/object/assign"),s3e=require("@stdlib/string/format"),u3e=vd();function o3e(r,e,t){var i;if(arguments.length>2){if(i=t,!n3e(i))throw new TypeError(s3e("invalid argument. Options argument must be an object. Value: `%s`.",i));i=a3e({},t)}else i={};return i.objectMode=!0,new u3e(r,e,i)}i5.exports=o3e});var g5=s(function(gir,v5){"use strict";var a5=require("@stdlib/assert/is-plain-object"),s5=require("@stdlib/object/assign"),u5=require("@stdlib/string/format"),o5=vd();function v3e(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!a5(r))throw new TypeError(u5("invalid argument. Options argument must be an object. Value: `%s`.",r));n=s5({},r)}else if(i>2){if(!a5(t))throw new TypeError(u5("invalid argument. Options argument must be an object. Value: `%s`.",t));n=s5({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new o5(v,g,n)}function o(){return new o5(r,e,n)}}v5.exports=v3e});var l5=s(function(fir,d5){"use strict";var f5=require("@stdlib/utils/define-nonenumerable-read-only-property"),rh=vd(),g3e=n5(),f3e=g5();f5(rh,"objectMode",g3e);f5(rh,"factory",f3e);d5.exports=rh});var c5=s(function(dir,d3e){d3e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var p5=s(function(lir,h5){"use strict";var l3e=require("@stdlib/assert/is-plain-object"),_r=require("@stdlib/assert/has-own-property"),c3e=require("@stdlib/assert/is-boolean").isPrimitive,m3e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,m5=require("@stdlib/assert/is-string").isPrimitive,h3e=require("@stdlib/assert/is-positive-integer").isPrimitive,p3e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Zn=require("@stdlib/string/format");function y3e(r,e){return l3e(e)?_r(e,"sep")&&(r.sep=e.sep,!m5(r.sep))?new TypeError(Zn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):_r(e,"objectMode")&&(r.objectMode=e.objectMode,!c3e(r.objectMode))?new TypeError(Zn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):_r(e,"encoding")&&(r.encoding=e.encoding,!m5(r.encoding)&&r.encoding!==null)?new TypeError(Zn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):_r(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!m3e(r.highWaterMark))?new TypeError(Zn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):_r(e,"iter")&&(r.iter=e.iter,!p3e(r.iter))?new TypeError(Zn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):_r(e,"siter")&&(r.siter=e.siter,!h3e(r.siter))?new TypeError(Zn("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(Zn("invalid argument. Options argument must be an object. Value: `%s`.",e))}h5.exports=y3e});var q5=s(function(cir,y5){"use strict";var q3e=require("debug"),b3e=q3e("random:streams:pareto1");y5.exports=b3e});var fd=s(function(mir,_5){"use strict";var E5=require("readable-stream").Readable,b5=require("@stdlib/assert/is-positive-number").isPrimitive,w3e=require("@stdlib/assert/is-error"),S3e=require("@stdlib/object/assign"),O3e=require("@stdlib/utils/inherit"),w5=require("@stdlib/utils/define-nonenumerable-property"),Di=require("@stdlib/utils/define-nonenumerable-read-only-property"),gd=require("@stdlib/utils/define-read-only-accessor"),E3e=require("@stdlib/utils/define-read-write-accessor"),_3e=za().factory,S5=require("@stdlib/buffer/from-string"),N3e=require("@stdlib/utils/next-tick"),O5=require("@stdlib/string/format"),L3e=c5(),R3e=p5(),Ls=q5();function P3e(){return this._prng.seed}function T3e(){return this._prng.seedLength}function j3e(){return this._prng.stateLength}function M3e(){return this._prng.byteLength}function x3e(){return this._prng.state}function A3e(r){this._prng.state=r}function G3e(){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=S5(e):e=S5(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function V3e(r){var e;if(this._destroyed)return Ls("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,N3e(t),this;function t(){r&&(Ls("Stream was destroyed due to an error. Error: %s.",w3e(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(!b5(r))throw new TypeError(O5("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!b5(e))throw new TypeError(O5("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=S3e({},L3e),arguments.length>2&&(n=R3e(i,t),n))throw n;return Ls("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),E5.call(this,i),w5(this,"_destroyed",!1),Di(this,"_objectMode",i.objectMode),Di(this,"_sep",i.sep),Di(this,"_iter",i.iter),Di(this,"_siter",i.siter),w5(this,"_i",0),Di(this,"_prng",_3e(r,e,i)),Di(this,"PRNG",this._prng.PRNG),this}O3e(xe,E5);gd(xe.prototype,"seed",P3e);gd(xe.prototype,"seedLength",T3e);E3e(xe.prototype,"state",x3e,A3e);gd(xe.prototype,"stateLength",j3e);gd(xe.prototype,"byteLength",M3e);Di(xe.prototype,"_read",G3e);Di(xe.prototype,"destroy",V3e);_5.exports=xe});var L5=s(function(hir,N5){"use strict";var F3e=require("@stdlib/assert/is-plain-object"),W3e=require("@stdlib/object/assign"),I3e=require("@stdlib/string/format"),k3e=fd();function z3e(r,e,t){var i;if(arguments.length>2){if(i=t,!F3e(i))throw new TypeError(I3e("invalid argument. Options argument must be an object. Value: `%s`.",i));i=W3e({},t)}else i={};return i.objectMode=!0,new k3e(r,e,i)}N5.exports=z3e});var x5=s(function(pir,M5){"use strict";var R5=require("@stdlib/assert/is-plain-object"),P5=require("@stdlib/object/assign"),T5=require("@stdlib/string/format"),j5=fd();function J3e(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!R5(r))throw new TypeError(T5("invalid argument. Options argument must be an object. Value: `%s`.",r));n=P5({},r)}else if(i>2){if(!R5(t))throw new TypeError(T5("invalid argument. Options argument must be an object. Value: `%s`.",t));n=P5({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new j5(v,g,n)}function o(){return new j5(r,e,n)}}M5.exports=J3e});var V5=s(function(yir,G5){"use strict";var A5=require("@stdlib/utils/define-nonenumerable-read-only-property"),th=fd(),U3e=L5(),C3e=x5();A5(th,"objectMode",U3e);A5(th,"factory",C3e);G5.exports=th});var F5=s(function(qir,B3e){B3e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var k5=s(function(bir,I5){"use strict";var D3e=require("@stdlib/assert/is-plain-object"),Nr=require("@stdlib/assert/has-own-property"),X3e=require("@stdlib/assert/is-boolean").isPrimitive,Y3e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,W5=require("@stdlib/assert/is-string").isPrimitive,H3e=require("@stdlib/assert/is-positive-integer").isPrimitive,Z3e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Qn=require("@stdlib/string/format");function Q3e(r,e){return D3e(e)?Nr(e,"sep")&&(r.sep=e.sep,!W5(r.sep))?new TypeError(Qn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Nr(e,"objectMode")&&(r.objectMode=e.objectMode,!X3e(r.objectMode))?new TypeError(Qn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Nr(e,"encoding")&&(r.encoding=e.encoding,!W5(r.encoding)&&r.encoding!==null)?new TypeError(Qn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Nr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!Y3e(r.highWaterMark))?new TypeError(Qn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Nr(e,"iter")&&(r.iter=e.iter,!Z3e(r.iter))?new TypeError(Qn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Nr(e,"siter")&&(r.siter=e.siter,!H3e(r.siter))?new TypeError(Qn("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(Qn("invalid argument. Options argument must be an object. Value: `%s`.",e))}I5.exports=Q3e});var J5=s(function(wir,z5){"use strict";var $3e=require("debug"),K3e=$3e("random:streams:poisson");z5.exports=K3e});var ld=s(function(Sir,D5){"use strict";var B5=require("readable-stream").Readable,eJe=require("@stdlib/assert/is-positive-number").isPrimitive,rJe=require("@stdlib/assert/is-error"),tJe=require("@stdlib/object/assign"),iJe=require("@stdlib/utils/inherit"),U5=require("@stdlib/utils/define-nonenumerable-property"),Xi=require("@stdlib/utils/define-nonenumerable-read-only-property"),dd=require("@stdlib/utils/define-read-only-accessor"),nJe=require("@stdlib/utils/define-read-write-accessor"),aJe=cn().factory,C5=require("@stdlib/buffer/from-string"),sJe=require("@stdlib/string/format"),uJe=require("@stdlib/utils/next-tick"),oJe=F5(),vJe=k5(),Rs=J5();function gJe(){return this._prng.seed}function fJe(){return this._prng.seedLength}function dJe(){return this._prng.stateLength}function lJe(){return this._prng.byteLength}function cJe(){return this._prng.state}function mJe(r){this._prng.state=r}function hJe(){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=C5(e):e=C5(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function pJe(r){var e;if(this._destroyed)return Rs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,uJe(t),this;function t(){r&&(Rs("Stream was destroyed due to an error. Error: %s.",rJe(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(!eJe(r))throw new TypeError(sJe("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(t=tJe({},oJe),arguments.length>1&&(i=vJe(t,e),i))throw i;return Rs("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),B5.call(this,t),U5(this,"_destroyed",!1),Xi(this,"_objectMode",t.objectMode),Xi(this,"_sep",t.sep),Xi(this,"_iter",t.iter),Xi(this,"_siter",t.siter),U5(this,"_i",0),Xi(this,"_prng",aJe(r,t)),Xi(this,"PRNG",this._prng.PRNG),this}iJe(Ae,B5);dd(Ae.prototype,"seed",gJe);dd(Ae.prototype,"seedLength",fJe);nJe(Ae.prototype,"state",cJe,mJe);dd(Ae.prototype,"stateLength",dJe);dd(Ae.prototype,"byteLength",lJe);Xi(Ae.prototype,"_read",hJe);Xi(Ae.prototype,"destroy",pJe);D5.exports=Ae});var Y5=s(function(Oir,X5){"use strict";var yJe=require("@stdlib/assert/is-plain-object"),qJe=require("@stdlib/object/assign"),bJe=require("@stdlib/string/format"),wJe=ld();function SJe(r,e){var t;if(arguments.length>1){if(t=e,!yJe(t))throw new TypeError(bJe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=qJe({},e)}else t={};return t.objectMode=!0,new wJe(r,t)}X5.exports=SJe});var eY=s(function(Eir,K5){"use strict";var OJe=require("@stdlib/assert/is-positive-number").isPrimitive,H5=require("@stdlib/assert/is-plain-object"),Z5=require("@stdlib/object/assign"),Q5=require("@stdlib/string/format"),$5=ld();function EJe(r,e){var t,i,n;if(t=arguments.length,t>1){if(!H5(e))throw new TypeError(Q5("invalid argument. Options argument must be an object. Value: `%s`.",e));n=u,i=Z5({},e)}else if(t===1)if(OJe(r))n=u,i={};else{if(!H5(r))throw new TypeError(Q5("invalid argument. Options argument must be an object. Value: `%s`.",r));i=Z5({},r),n=a}else i={},n=a;return n;function a(o){return new $5(o,i)}function u(){return new $5(r,i)}}K5.exports=EJe});var iY=s(function(_ir,tY){"use strict";var rY=require("@stdlib/utils/define-nonenumerable-read-only-property"),ih=ld(),_Je=Y5(),NJe=eY();rY(ih,"objectMode",_Je);rY(ih,"factory",NJe);tY.exports=ih});var nY=s(function(Nir,LJe){LJe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308,name:"mt19937"}});var uY=s(function(Lir,sY){"use strict";var RJe=require("@stdlib/assert/is-plain-object"),Lr=require("@stdlib/assert/has-own-property"),PJe=require("@stdlib/assert/is-boolean").isPrimitive,TJe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,aY=require("@stdlib/assert/is-string").isPrimitive,jJe=require("@stdlib/assert/is-positive-integer").isPrimitive,MJe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,$n=require("@stdlib/string/format");function xJe(r,e){return RJe(e)?Lr(e,"sep")&&(r.sep=e.sep,!aY(r.sep))?new TypeError($n("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Lr(e,"objectMode")&&(r.objectMode=e.objectMode,!PJe(r.objectMode))?new TypeError($n("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Lr(e,"encoding")&&(r.encoding=e.encoding,!aY(r.encoding)&&r.encoding!==null)?new TypeError($n("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Lr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!TJe(r.highWaterMark))?new TypeError($n("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Lr(e,"iter")&&(r.iter=e.iter,!MJe(r.iter))?new TypeError($n("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Lr(e,"siter")&&(r.siter=e.siter,!jJe(r.siter))?new TypeError($n("invalid option. `%s` option must be a positive integer. Option: `%s`.","siter",r.siter)):(Lr(e,"name")&&(r.name=e.name),Lr(e,"seed")&&(r.seed=e.seed),Lr(e,"state")&&(r.state=e.state),Lr(e,"copy")&&(r.copy=e.copy),null):new TypeError($n("invalid argument. Options argument must be an object. Value: `%s`.",e))}sY.exports=xJe});var vY=s(function(Rir,oY){"use strict";var AJe=require("debug"),GJe=AJe("random:streams:randi");oY.exports=GJe});var md=s(function(Pir,lY){"use strict";var dY=require("readable-stream").Readable,VJe=require("@stdlib/assert/is-error"),FJe=require("@stdlib/object/assign"),WJe=require("@stdlib/utils/inherit"),gY=require("@stdlib/utils/define-nonenumerable-property"),Yi=require("@stdlib/utils/define-nonenumerable-read-only-property"),cd=require("@stdlib/utils/define-read-only-accessor"),IJe=require("@stdlib/utils/define-read-write-accessor"),kJe=hu().factory,fY=require("@stdlib/buffer/from-string"),zJe=require("@stdlib/utils/next-tick"),JJe=nY(),UJe=uY(),Ps=vY();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 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=fY(e):e=fY(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 Ps("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,zJe(t),this;function t(){r&&(Ps("Stream was destroyed due to an error. Error: %s.",VJe(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=FJe({},JJe),arguments.length>0&&(t=UJe(e,r),t))throw t;return Ps("Creating a readable stream configured with the following options: %s.",JSON.stringify(e)),dY.call(this,e),gY(this,"_destroyed",!1),Yi(this,"_objectMode",e.objectMode),Yi(this,"_sep",e.sep),Yi(this,"_iter",e.iter),Yi(this,"_siter",e.siter),gY(this,"_i",0),Yi(this,"_prng",kJe(e)),Yi(this,"PRNG",this._prng.PRNG),this}WJe(Ge,dY);cd(Ge.prototype,"seed",CJe);cd(Ge.prototype,"seedLength",BJe);IJe(Ge.prototype,"state",YJe,HJe);cd(Ge.prototype,"stateLength",DJe);cd(Ge.prototype,"byteLength",XJe);Yi(Ge.prototype,"_read",ZJe);Yi(Ge.prototype,"destroy",QJe);lY.exports=Ge});var mY=s(function(Tir,cY){"use strict";var $Je=require("@stdlib/assert/is-plain-object"),KJe=require("@stdlib/object/assign"),eUe=require("@stdlib/string/format"),rUe=md();function tUe(r){var e;if(arguments.length>0){if(e=r,!$Je(e))throw new TypeError(eUe("invalid argument. Options argument must be an object. Value: `%s`.",e));e=KJe({},r)}else e={};return e.objectMode=!0,new rUe(e)}cY.exports=tUe});var pY=s(function(jir,hY){"use strict";var iUe=require("@stdlib/assert/is-plain-object"),nUe=require("@stdlib/object/assign"),aUe=require("@stdlib/string/format"),sUe=md();function uUe(r){var e;if(arguments.length>0){if(!iUe(r))throw new TypeError(aUe("invalid argument. Options argument must be an object. Value: `%s`.",r));e=nUe({},r)}else e={};return t;function t(){return new sUe(e)}}hY.exports=uUe});var bY=s(function(Mir,qY){"use strict";var yY=require("@stdlib/utils/define-nonenumerable-read-only-property"),nh=md(),oUe=mY(),vUe=pY();yY(nh,"objectMode",oUe);yY(nh,"factory",vUe);qY.exports=nh});var wY=s(function(xir,gUe){gUe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308,name:"improved-ziggurat"}});var EY=s(function(Air,OY){"use strict";var fUe=require("@stdlib/assert/is-plain-object"),De=require("@stdlib/assert/has-own-property"),dUe=require("@stdlib/assert/is-boolean").isPrimitive,lUe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,SY=require("@stdlib/assert/is-string").isPrimitive,cUe=require("@stdlib/assert/is-positive-integer").isPrimitive,mUe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,Kn=require("@stdlib/string/format");function hUe(r,e){return fUe(e)?De(e,"sep")&&(r.sep=e.sep,!SY(r.sep))?new TypeError(Kn("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):De(e,"objectMode")&&(r.objectMode=e.objectMode,!dUe(r.objectMode))?new TypeError(Kn("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):De(e,"encoding")&&(r.encoding=e.encoding,!SY(r.encoding)&&r.encoding!==null)?new TypeError(Kn("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):De(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!lUe(r.highWaterMark))?new TypeError(Kn("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):De(e,"iter")&&(r.iter=e.iter,!mUe(r.iter))?new TypeError(Kn("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):De(e,"siter")&&(r.siter=e.siter,!cUe(r.siter))?new TypeError(Kn("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(Kn("invalid argument. Options argument must be an object. Value: `%s`.",e))}OY.exports=hUe});var NY=s(function(Gir,_Y){"use strict";var pUe=require("debug"),yUe=pUe("random:streams:randn");_Y.exports=yUe});var pd=s(function(Vir,TY){"use strict";var PY=require("readable-stream").Readable,qUe=require("@stdlib/assert/is-error"),bUe=require("@stdlib/object/assign"),wUe=require("@stdlib/utils/inherit"),LY=require("@stdlib/utils/define-nonenumerable-property"),Hi=require("@stdlib/utils/define-nonenumerable-read-only-property"),hd=require("@stdlib/utils/define-read-only-accessor"),SUe=require("@stdlib/utils/define-read-write-accessor"),OUe=yu().factory,RY=require("@stdlib/buffer/from-string"),EUe=require("@stdlib/utils/next-tick"),_Ue=wY(),NUe=EY(),Ts=NY();function LUe(){return this._prng.seed}function RUe(){return this._prng.seedLength}function PUe(){return this._prng.stateLength}function TUe(){return this._prng.byteLength}function jUe(){return this._prng.state}function MUe(r){this._prng.state=r}function xUe(){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=RY(e):e=RY(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function AUe(r){var e;if(this._destroyed)return Ts("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,EUe(t),this;function t(){r&&(Ts("Stream was destroyed due to an error. Error: %s.",qUe(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=bUe({},_Ue),arguments.length>0&&(t=NUe(e,r),t))throw t;return Ts("Creating a readable stream configured with the following options: %s.",JSON.stringify(e)),PY.call(this,e),LY(this,"_destroyed",!1),Hi(this,"_objectMode",e.objectMode),Hi(this,"_sep",e.sep),Hi(this,"_iter",e.iter),Hi(this,"_siter",e.siter),LY(this,"_i",0),Hi(this,"_prng",OUe(e)),Hi(this,"PRNG",this._prng.PRNG),this}wUe(Ve,PY);hd(Ve.prototype,"seed",LUe);hd(Ve.prototype,"seedLength",RUe);SUe(Ve.prototype,"state",jUe,MUe);hd(Ve.prototype,"stateLength",PUe);hd(Ve.prototype,"byteLength",TUe);Hi(Ve.prototype,"_read",xUe);Hi(Ve.prototype,"destroy",AUe);TY.exports=Ve});var MY=s(function(Fir,jY){"use strict";var GUe=require("@stdlib/assert/is-plain-object"),VUe=require("@stdlib/object/assign"),FUe=require("@stdlib/string/format"),WUe=pd();function IUe(r){var e;if(arguments.length>0){if(e=r,!GUe(e))throw new TypeError(FUe("invalid argument. Options argument must be an object. Value: `%s`.",e));e=VUe({},r)}else e={};return e.objectMode=!0,new WUe(e)}jY.exports=IUe});var AY=s(function(Wir,xY){"use strict";var kUe=require("@stdlib/assert/is-plain-object"),zUe=require("@stdlib/object/assign"),JUe=require("@stdlib/string/format"),UUe=pd();function CUe(r){var e;if(arguments.length>0){if(!kUe(r))throw new TypeError(JUe("invalid argument. Options argument must be an object. Value: `%s`.",r));e=zUe({},r)}else e={};return t;function t(){return new UUe(e)}}xY.exports=CUe});var FY=s(function(Iir,VY){"use strict";var GY=require("@stdlib/utils/define-nonenumerable-read-only-property"),ah=pd(),BUe=MY(),DUe=AY();GY(ah,"objectMode",BUe);GY(ah,"factory",DUe);VY.exports=ah});var WY=s(function(kir,XUe){XUe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308,name:"mt19937"}});var zY=s(function(zir,kY){"use strict";var YUe=require("@stdlib/assert/is-plain-object"),Rr=require("@stdlib/assert/has-own-property"),HUe=require("@stdlib/assert/is-boolean").isPrimitive,ZUe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,IY=require("@stdlib/assert/is-string").isPrimitive,QUe=require("@stdlib/assert/is-positive-integer").isPrimitive,$Ue=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,ea=require("@stdlib/string/format");function KUe(r,e){return YUe(e)?Rr(e,"sep")&&(r.sep=e.sep,!IY(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,!HUe(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,!IY(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,!ZUe(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,!$Ue(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,!QUe(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))}kY.exports=KUe});var UY=s(function(Jir,JY){"use strict";var eCe=require("debug"),rCe=eCe("random:streams:randu");JY.exports=rCe});var qd=s(function(Uir,XY){"use strict";var DY=require("readable-stream").Readable,tCe=require("@stdlib/assert/is-error"),iCe=require("@stdlib/object/assign"),nCe=require("@stdlib/utils/inherit"),CY=require("@stdlib/utils/define-nonenumerable-property"),Zi=require("@stdlib/utils/define-nonenumerable-read-only-property"),yd=require("@stdlib/utils/define-read-only-accessor"),aCe=require("@stdlib/utils/define-read-write-accessor"),sCe=Tt().factory,BY=require("@stdlib/buffer/from-string"),uCe=require("@stdlib/utils/next-tick"),oCe=WY(),vCe=zY(),js=UY();function gCe(){return this._prng.seed}function fCe(){return this._prng.seedLength}function dCe(){return this._prng.stateLength}function lCe(){return this._prng.byteLength}function cCe(){return this._prng.state}function mCe(r){this._prng.state=r}function hCe(){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=BY(e):e=BY(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function pCe(r){var e;if(this._destroyed)return js("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,uCe(t),this;function t(){r&&(js("Stream was destroyed due to an error. Error: %s.",tCe(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=iCe({},oCe),arguments.length>0&&(t=vCe(e,r),t))throw t;return js("Creating a readable stream configured with the following options: %s.",JSON.stringify(e)),DY.call(this,e),CY(this,"_destroyed",!1),Zi(this,"_objectMode",e.objectMode),Zi(this,"_sep",e.sep),Zi(this,"_iter",e.iter),Zi(this,"_siter",e.siter),CY(this,"_i",0),Zi(this,"_prng",sCe(e)),Zi(this,"PRNG",this._prng.PRNG),this}nCe(Fe,DY);yd(Fe.prototype,"seed",gCe);yd(Fe.prototype,"seedLength",fCe);aCe(Fe.prototype,"state",cCe,mCe);yd(Fe.prototype,"stateLength",dCe);yd(Fe.prototype,"byteLength",lCe);Zi(Fe.prototype,"_read",hCe);Zi(Fe.prototype,"destroy",pCe);XY.exports=Fe});var HY=s(function(Cir,YY){"use strict";var yCe=require("@stdlib/assert/is-plain-object"),qCe=require("@stdlib/object/assign"),bCe=require("@stdlib/string/format"),wCe=qd();function SCe(r){var e;if(arguments.length>0){if(e=r,!yCe(e))throw new TypeError(bCe("invalid argument. Options argument must be an object. Value: `%s`.",e));e=qCe({},r)}else e={};return e.objectMode=!0,new wCe(e)}YY.exports=SCe});var QY=s(function(Bir,ZY){"use strict";var OCe=require("@stdlib/assert/is-plain-object"),ECe=require("@stdlib/object/assign"),_Ce=require("@stdlib/string/format"),NCe=qd();function LCe(r){var e;if(arguments.length>0){if(!OCe(r))throw new TypeError(_Ce("invalid argument. Options argument must be an object. Value: `%s`.",r));e=ECe({},r)}else e={};return t;function t(){return new NCe(e)}}ZY.exports=LCe});var e6=s(function(Dir,KY){"use strict";var $Y=require("@stdlib/utils/define-nonenumerable-read-only-property"),sh=qd(),RCe=HY(),PCe=QY();$Y(sh,"objectMode",RCe);$Y(sh,"factory",PCe);KY.exports=sh});var r6=s(function(Xir,TCe){TCe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var n6=s(function(Yir,i6){"use strict";var jCe=require("@stdlib/assert/is-plain-object"),Pr=require("@stdlib/assert/has-own-property"),MCe=require("@stdlib/assert/is-boolean").isPrimitive,xCe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,t6=require("@stdlib/assert/is-string").isPrimitive,ACe=require("@stdlib/assert/is-positive-integer").isPrimitive,GCe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,ra=require("@stdlib/string/format");function VCe(r,e){return jCe(e)?Pr(e,"sep")&&(r.sep=e.sep,!t6(r.sep))?new TypeError(ra("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Pr(e,"objectMode")&&(r.objectMode=e.objectMode,!MCe(r.objectMode))?new TypeError(ra("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Pr(e,"encoding")&&(r.encoding=e.encoding,!t6(r.encoding)&&r.encoding!==null)?new TypeError(ra("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Pr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!xCe(r.highWaterMark))?new TypeError(ra("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Pr(e,"iter")&&(r.iter=e.iter,!GCe(r.iter))?new TypeError(ra("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Pr(e,"siter")&&(r.siter=e.siter,!ACe(r.siter))?new TypeError(ra("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(ra("invalid argument. Options argument must be an object. Value: `%s`.",e))}i6.exports=VCe});var s6=s(function(Hir,a6){"use strict";var FCe=require("debug"),WCe=FCe("random:streams:rayleigh");a6.exports=WCe});var wd=s(function(Zir,g6){"use strict";var v6=require("readable-stream").Readable,ICe=require("@stdlib/assert/is-positive-number").isPrimitive,kCe=require("@stdlib/assert/is-error"),zCe=require("@stdlib/object/assign"),JCe=require("@stdlib/utils/inherit"),u6=require("@stdlib/utils/define-nonenumerable-property"),Qi=require("@stdlib/utils/define-nonenumerable-read-only-property"),bd=require("@stdlib/utils/define-read-only-accessor"),UCe=require("@stdlib/utils/define-read-write-accessor"),CCe=Ja().factory,o6=require("@stdlib/buffer/from-string"),BCe=require("@stdlib/utils/next-tick"),DCe=require("@stdlib/string/format"),XCe=r6(),YCe=n6(),Ms=s6();function HCe(){return this._prng.seed}function ZCe(){return this._prng.seedLength}function QCe(){return this._prng.stateLength}function $Ce(){return this._prng.byteLength}function KCe(){return this._prng.state}function eBe(r){this._prng.state=r}function rBe(){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=o6(e):e=o6(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 Ms("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,BCe(t),this;function t(){r&&(Ms("Stream was destroyed due to an error. Error: %s.",kCe(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(!ICe(r))throw new TypeError(DCe("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(t=zCe({},XCe),arguments.length>1&&(i=YCe(t,e),i))throw i;return Ms("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),v6.call(this,t),u6(this,"_destroyed",!1),Qi(this,"_objectMode",t.objectMode),Qi(this,"_sep",t.sep),Qi(this,"_iter",t.iter),Qi(this,"_siter",t.siter),u6(this,"_i",0),Qi(this,"_prng",CCe(r,t)),Qi(this,"PRNG",this._prng.PRNG),this}JCe(We,v6);bd(We.prototype,"seed",HCe);bd(We.prototype,"seedLength",ZCe);UCe(We.prototype,"state",KCe,eBe);bd(We.prototype,"stateLength",QCe);bd(We.prototype,"byteLength",$Ce);Qi(We.prototype,"_read",rBe);Qi(We.prototype,"destroy",tBe);g6.exports=We});var d6=s(function(Qir,f6){"use strict";var iBe=require("@stdlib/assert/is-plain-object"),nBe=require("@stdlib/object/assign"),aBe=require("@stdlib/string/format"),sBe=wd();function uBe(r,e){var t;if(arguments.length>1){if(t=e,!iBe(t))throw new TypeError(aBe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=nBe({},e)}else t={};return t.objectMode=!0,new sBe(r,t)}f6.exports=uBe});var y6=s(function($ir,p6){"use strict";var oBe=require("@stdlib/assert/is-positive-number").isPrimitive,l6=require("@stdlib/assert/is-plain-object"),c6=require("@stdlib/object/assign"),m6=require("@stdlib/string/format"),h6=wd();function vBe(r,e){var t,i,n;if(t=arguments.length,t>1){if(!l6(e))throw new TypeError(m6("invalid argument. Options argument must be an object. Value: `%s`.",e));n=u,i=c6({},e)}else if(t===1)if(oBe(r))n=u,i={};else{if(!l6(r))throw new TypeError(m6("invalid argument. Options argument must be an object. Value: `%s`.",r));i=c6({},r),n=a}else i={},n=a;return n;function a(o){return new h6(o,i)}function u(){return new h6(r,i)}}p6.exports=vBe});var w6=s(function(Kir,b6){"use strict";var q6=require("@stdlib/utils/define-nonenumerable-read-only-property"),uh=wd(),gBe=d6(),fBe=y6();q6(uh,"objectMode",gBe);q6(uh,"factory",fBe);b6.exports=uh});var S6=s(function(enr,dBe){dBe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var _6=s(function(rnr,E6){"use strict";var lBe=require("@stdlib/assert/is-plain-object"),Tr=require("@stdlib/assert/has-own-property"),cBe=require("@stdlib/assert/is-boolean").isPrimitive,mBe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,O6=require("@stdlib/assert/is-string").isPrimitive,hBe=require("@stdlib/assert/is-positive-integer").isPrimitive,pBe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,ta=require("@stdlib/string/format");function yBe(r,e){return lBe(e)?Tr(e,"sep")&&(r.sep=e.sep,!O6(r.sep))?new TypeError(ta("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):Tr(e,"objectMode")&&(r.objectMode=e.objectMode,!cBe(r.objectMode))?new TypeError(ta("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Tr(e,"encoding")&&(r.encoding=e.encoding,!O6(r.encoding)&&r.encoding!==null)?new TypeError(ta("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Tr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!mBe(r.highWaterMark))?new TypeError(ta("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Tr(e,"iter")&&(r.iter=e.iter,!pBe(r.iter))?new TypeError(ta("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Tr(e,"siter")&&(r.siter=e.siter,!hBe(r.siter))?new TypeError(ta("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(ta("invalid argument. Options argument must be an object. Value: `%s`.",e))}E6.exports=yBe});var L6=s(function(tnr,N6){"use strict";var qBe=require("debug"),bBe=qBe("random:streams:t");N6.exports=bBe});var Od=s(function(inr,j6){"use strict";var T6=require("readable-stream").Readable,wBe=require("@stdlib/assert/is-positive-number").isPrimitive,SBe=require("@stdlib/assert/is-error"),OBe=require("@stdlib/object/assign"),EBe=require("@stdlib/utils/inherit"),R6=require("@stdlib/utils/define-nonenumerable-property"),$i=require("@stdlib/utils/define-nonenumerable-read-only-property"),Sd=require("@stdlib/utils/define-read-only-accessor"),_Be=require("@stdlib/utils/define-read-write-accessor"),NBe=Ba().factory,P6=require("@stdlib/buffer/from-string"),LBe=require("@stdlib/utils/next-tick"),RBe=require("@stdlib/string/format"),PBe=S6(),TBe=_6(),xs=L6();function jBe(){return this._prng.seed}function MBe(){return this._prng.seedLength}function xBe(){return this._prng.stateLength}function ABe(){return this._prng.byteLength}function GBe(){return this._prng.state}function VBe(r){this._prng.state=r}function FBe(){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=P6(e):e=P6(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function WBe(r){var e;if(this._destroyed)return xs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,LBe(t),this;function t(){r&&(xs("Stream was destroyed due to an error. Error: %s.",SBe(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(!wBe(r))throw new TypeError(RBe("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(t=OBe({},PBe),arguments.length>1&&(i=TBe(t,e),i))throw i;return xs("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),T6.call(this,t),R6(this,"_destroyed",!1),$i(this,"_objectMode",t.objectMode),$i(this,"_sep",t.sep),$i(this,"_iter",t.iter),$i(this,"_siter",t.siter),R6(this,"_i",0),$i(this,"_prng",NBe(r,t)),$i(this,"PRNG",this._prng.PRNG),this}EBe(Ie,T6);Sd(Ie.prototype,"seed",jBe);Sd(Ie.prototype,"seedLength",MBe);_Be(Ie.prototype,"state",GBe,VBe);Sd(Ie.prototype,"stateLength",xBe);Sd(Ie.prototype,"byteLength",ABe);$i(Ie.prototype,"_read",FBe);$i(Ie.prototype,"destroy",WBe);j6.exports=Ie});var x6=s(function(nnr,M6){"use strict";var IBe=require("@stdlib/assert/is-plain-object"),kBe=require("@stdlib/object/assign"),zBe=require("@stdlib/string/format"),JBe=Od();function UBe(r,e){var t;if(arguments.length>1){if(t=e,!IBe(t))throw new TypeError(zBe("invalid argument. Options argument must be an object. Value: `%s`.",t));t=kBe({},e)}else t={};return t.objectMode=!0,new JBe(r,t)}M6.exports=UBe});var I6=s(function(anr,W6){"use strict";var CBe=require("@stdlib/assert/is-positive-number").isPrimitive,A6=require("@stdlib/assert/is-plain-object"),G6=require("@stdlib/object/assign"),V6=require("@stdlib/string/format"),F6=Od();function BBe(r,e){var t,i,n;if(t=arguments.length,t>1){if(!A6(e))throw new TypeError(V6("invalid argument. Options argument must be an object. Value: `%s`.",e));n=u,i=G6({},e)}else if(t===1)if(CBe(r))n=u,i={};else{if(!A6(r))throw new TypeError(V6("invalid argument. Options argument must be an object. Value: `%s`.",r));i=G6({},r),n=a}else i={},n=a;return n;function a(o){return new F6(o,i)}function u(){return new F6(r,i)}}W6.exports=BBe});var J6=s(function(snr,z6){"use strict";var k6=require("@stdlib/utils/define-nonenumerable-read-only-property"),oh=Od(),DBe=x6(),XBe=I6();k6(oh,"objectMode",DBe);k6(oh,"factory",XBe);z6.exports=oh});var U6=s(function(unr,YBe){YBe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var D6=s(function(onr,B6){"use strict";var HBe=require("@stdlib/assert/is-plain-object"),jr=require("@stdlib/assert/has-own-property"),ZBe=require("@stdlib/assert/is-boolean").isPrimitive,QBe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,C6=require("@stdlib/assert/is-string").isPrimitive,$Be=require("@stdlib/assert/is-positive-integer").isPrimitive,KBe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,ia=require("@stdlib/string/format");function e9e(r,e){return HBe(e)?jr(e,"sep")&&(r.sep=e.sep,!C6(r.sep))?new TypeError(ia("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):jr(e,"objectMode")&&(r.objectMode=e.objectMode,!ZBe(r.objectMode))?new TypeError(ia("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):jr(e,"encoding")&&(r.encoding=e.encoding,!C6(r.encoding)&&r.encoding!==null)?new TypeError(ia("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):jr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!QBe(r.highWaterMark))?new TypeError(ia("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):jr(e,"iter")&&(r.iter=e.iter,!KBe(r.iter))?new TypeError(ia("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):jr(e,"siter")&&(r.siter=e.siter,!$Be(r.siter))?new TypeError(ia("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(ia("invalid argument. Options argument must be an object. Value: `%s`.",e))}B6.exports=e9e});var Y6=s(function(vnr,X6){"use strict";var r9e=require("debug"),t9e=r9e("random:streams:triangular");X6.exports=t9e});var Nd=s(function(gnr,$6){"use strict";var Q6=require("readable-stream").Readable,vh=require("@stdlib/assert/is-number").isPrimitive,gh=require("@stdlib/math/base/assert/is-nan"),i9e=require("@stdlib/assert/is-error"),n9e=require("@stdlib/object/assign"),a9e=require("@stdlib/utils/inherit"),H6=require("@stdlib/utils/define-nonenumerable-property"),Ki=require("@stdlib/utils/define-nonenumerable-read-only-property"),_d=require("@stdlib/utils/define-read-only-accessor"),s9e=require("@stdlib/utils/define-read-write-accessor"),u9e=Da().factory,Z6=require("@stdlib/buffer/from-string"),o9e=require("@stdlib/utils/next-tick"),Ed=require("@stdlib/string/format"),v9e=U6(),g9e=D6(),As=Y6();function f9e(){return this._prng.seed}function d9e(){return this._prng.seedLength}function l9e(){return this._prng.stateLength}function c9e(){return this._prng.byteLength}function m9e(){return this._prng.state}function h9e(r){this._prng.state=r}function p9e(){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=Z6(e):e=Z6(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function y9e(r){var e;if(this._destroyed)return As("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,o9e(t),this;function t(){r&&(As("Stream was destroyed due to an error. Error: %s.",i9e(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(!vh(r)||gh(r))throw new TypeError(Ed("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!vh(e)||gh(e))throw new TypeError(Ed("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e));if(!vh(t)||gh(t))throw new TypeError(Ed("invalid argument. Third argument must be a number and not NaN. Value: `%s`.",t));if(!(r<=t&&t<=e))throw new RangeError(Ed("invalid arguments. Parameters must satisfy the following condition: %s. a: `%f`. b: `%f`. c: `%f`.","a <= c <= b",r,e,t));if(n=n9e({},v9e),arguments.length>3&&(a=g9e(n,i),a))throw a;return As("Creating a readable stream configured with the following options: %s.",JSON.stringify(n)),Q6.call(this,n),H6(this,"_destroyed",!1),Ki(this,"_objectMode",n.objectMode),Ki(this,"_sep",n.sep),Ki(this,"_iter",n.iter),Ki(this,"_siter",n.siter),H6(this,"_i",0),Ki(this,"_prng",u9e(r,e,t,n)),Ki(this,"PRNG",this._prng.PRNG),this}a9e(ke,Q6);_d(ke.prototype,"seed",f9e);_d(ke.prototype,"seedLength",d9e);s9e(ke.prototype,"state",m9e,h9e);_d(ke.prototype,"stateLength",l9e);_d(ke.prototype,"byteLength",c9e);Ki(ke.prototype,"_read",p9e);Ki(ke.prototype,"destroy",y9e);$6.exports=ke});var e4=s(function(fnr,K6){"use strict";var q9e=require("@stdlib/assert/is-plain-object"),b9e=require("@stdlib/object/assign"),w9e=require("@stdlib/string/format"),S9e=Nd();function O9e(r,e,t,i){var n;if(arguments.length>3){if(n=i,!q9e(n))throw new TypeError(w9e("invalid argument. Options argument must be an object. Value: `%s`.",n));n=b9e({},i)}else n={};return n.objectMode=!0,new S9e(r,e,t,n)}K6.exports=O9e});var s4=s(function(dnr,a4){"use strict";var r4=require("@stdlib/assert/is-plain-object"),t4=require("@stdlib/object/assign"),i4=require("@stdlib/string/format"),n4=Nd();function E9e(r,e,t,i){var n,a,u;if(n=arguments.length,n===1){if(!r4(r))throw new TypeError(i4("invalid argument. Options argument must be an object. Value: `%s`.",r));a=t4({},r)}else if(n>3){if(!r4(i))throw new TypeError(i4("invalid argument. Options argument must be an object. Value: `%s`.",i));a=t4({},i)}else a={};return n<3?u=o:u=v,u;function o(g,c,l){return new n4(g,c,l,a)}function v(){return new n4(r,e,t,a)}}a4.exports=E9e});var v4=s(function(lnr,o4){"use strict";var u4=require("@stdlib/utils/define-nonenumerable-read-only-property"),fh=Nd(),_9e=e4(),N9e=s4();u4(fh,"objectMode",_9e);u4(fh,"factory",N9e);o4.exports=fh});var g4=s(function(cnr,L9e){L9e.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var l4=s(function(mnr,d4){"use strict";var R9e=require("@stdlib/assert/is-plain-object"),Mr=require("@stdlib/assert/has-own-property"),P9e=require("@stdlib/assert/is-boolean").isPrimitive,T9e=require("@stdlib/assert/is-nonnegative-number").isPrimitive,f4=require("@stdlib/assert/is-string").isPrimitive,j9e=require("@stdlib/assert/is-positive-integer").isPrimitive,M9e=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,na=require("@stdlib/string/format");function x9e(r,e){return R9e(e)?Mr(e,"sep")&&(r.sep=e.sep,!f4(r.sep))?new TypeError(na("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(na("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):Mr(e,"encoding")&&(r.encoding=e.encoding,!f4(r.encoding)&&r.encoding!==null)?new TypeError(na("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):Mr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!T9e(r.highWaterMark))?new TypeError(na("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):Mr(e,"iter")&&(r.iter=e.iter,!M9e(r.iter))?new TypeError(na("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):Mr(e,"siter")&&(r.siter=e.siter,!j9e(r.siter))?new TypeError(na("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(na("invalid argument. Options argument must be an object. Value: `%s`.",e))}d4.exports=x9e});var m4=s(function(hnr,c4){"use strict";var A9e=require("debug"),G9e=A9e("random:streams:uniform");c4.exports=G9e});var Rd=s(function(pnr,w4){"use strict";var b4=require("readable-stream").Readable,h4=require("@stdlib/assert/is-number").isPrimitive,p4=require("@stdlib/math/base/assert/is-nan"),V9e=require("@stdlib/assert/is-error"),F9e=require("@stdlib/object/assign"),W9e=require("@stdlib/utils/inherit"),y4=require("@stdlib/utils/define-nonenumerable-property"),en=require("@stdlib/utils/define-nonenumerable-read-only-property"),Ld=require("@stdlib/utils/define-read-only-accessor"),I9e=require("@stdlib/utils/define-read-write-accessor"),k9e=hn().factory,q4=require("@stdlib/buffer/from-string"),z9e=require("@stdlib/utils/next-tick"),dh=require("@stdlib/string/format"),J9e=g4(),U9e=l4(),Gs=m4();function C9e(){return this._prng.seed}function B9e(){return this._prng.seedLength}function D9e(){return this._prng.stateLength}function X9e(){return this._prng.byteLength}function Y9e(){return this._prng.state}function H9e(r){this._prng.state=r}function Z9e(){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=q4(e):e=q4(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function Q9e(r){var e;if(this._destroyed)return Gs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,z9e(t),this;function t(){r&&(Gs("Stream was destroyed due to an error. Error: %s.",V9e(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(!h4(r)||p4(r))throw new TypeError(dh("invalid argument. First argument must be a number and not NaN. Value: `%s`.",r));if(!h4(e)||p4(e))throw new TypeError(dh("invalid argument. Second argument must be a number and not NaN. Value: `%s`.",e));if(r>=e)throw new RangeError(dh("invalid argument. Minimum support must be less than maximum support. Value: `[%f, %f]`.",r,e));if(i=F9e({},J9e),arguments.length>2&&(n=U9e(i,t),n))throw n;return Gs("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),b4.call(this,i),y4(this,"_destroyed",!1),en(this,"_objectMode",i.objectMode),en(this,"_sep",i.sep),en(this,"_iter",i.iter),en(this,"_siter",i.siter),y4(this,"_i",0),en(this,"_prng",k9e(r,e,i)),en(this,"PRNG",this._prng.PRNG),this}W9e(ze,b4);Ld(ze.prototype,"seed",C9e);Ld(ze.prototype,"seedLength",B9e);I9e(ze.prototype,"state",Y9e,H9e);Ld(ze.prototype,"stateLength",D9e);Ld(ze.prototype,"byteLength",X9e);en(ze.prototype,"_read",Z9e);en(ze.prototype,"destroy",Q9e);w4.exports=ze});var O4=s(function(ynr,S4){"use strict";var $9e=require("@stdlib/assert/is-plain-object"),K9e=require("@stdlib/object/assign"),eDe=require("@stdlib/string/format"),rDe=Rd();function tDe(r,e,t){var i;if(arguments.length>2){if(i=t,!$9e(i))throw new TypeError(eDe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=K9e({},t)}else i={};return i.objectMode=!0,new rDe(r,e,i)}S4.exports=tDe});var P4=s(function(qnr,R4){"use strict";var E4=require("@stdlib/assert/is-plain-object"),_4=require("@stdlib/object/assign"),N4=require("@stdlib/string/format"),L4=Rd();function iDe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!E4(r))throw new TypeError(N4("invalid argument. Options argument must be an object. Value: `%s`.",r));n=_4({},r)}else if(i>2){if(!E4(t))throw new TypeError(N4("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 L4(v,g,n)}function o(){return new L4(r,e,n)}}R4.exports=iDe});var M4=s(function(bnr,j4){"use strict";var T4=require("@stdlib/utils/define-nonenumerable-read-only-property"),lh=Rd(),nDe=O4(),aDe=P4();T4(lh,"objectMode",nDe);T4(lh,"factory",aDe);j4.exports=lh});var x4=s(function(wnr,sDe){sDe.exports={objectMode:!1,encoding:null,sep:"\n",copy:!0,siter:1e308}});var V4=s(function(Snr,G4){"use strict";var uDe=require("@stdlib/assert/is-plain-object"),xr=require("@stdlib/assert/has-own-property"),oDe=require("@stdlib/assert/is-boolean").isPrimitive,vDe=require("@stdlib/assert/is-nonnegative-number").isPrimitive,A4=require("@stdlib/assert/is-string").isPrimitive,gDe=require("@stdlib/assert/is-positive-integer").isPrimitive,fDe=require("@stdlib/assert/is-nonnegative-integer").isPrimitive,aa=require("@stdlib/string/format");function dDe(r,e){return uDe(e)?xr(e,"sep")&&(r.sep=e.sep,!A4(r.sep))?new TypeError(aa("invalid option. `%s` option must be a string. Option: `%s`.","sep",r.sep)):xr(e,"objectMode")&&(r.objectMode=e.objectMode,!oDe(r.objectMode))?new TypeError(aa("invalid option. `%s` option must be a boolean. Option: `%s`.","objectMode",r.objectMode)):xr(e,"encoding")&&(r.encoding=e.encoding,!A4(r.encoding)&&r.encoding!==null)?new TypeError(aa("invalid option. `%s` option must be a string or null. Option: `%s`.","encoding",r.encoding)):xr(e,"highWaterMark")&&(r.highWaterMark=e.highWaterMark,!vDe(r.highWaterMark))?new TypeError(aa("invalid option. `%s` option must be a nonnegative number. Option: `%s`.","highWaterMark",r.highWaterMark)):xr(e,"iter")&&(r.iter=e.iter,!fDe(r.iter))?new TypeError(aa("invalid option. `%s` option must be a nonnegative integer. Option: `%s`.","iter",r.iter)):xr(e,"siter")&&(r.siter=e.siter,!gDe(r.siter))?new TypeError(aa("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(aa("invalid argument. Options argument must be an object. Value: `%s`.",e))}G4.exports=dDe});var W4=s(function(Onr,F4){"use strict";var lDe=require("debug"),cDe=lDe("random:streams:weibull");F4.exports=cDe});var Td=s(function(Enr,C4){"use strict";var U4=require("readable-stream").Readable,I4=require("@stdlib/assert/is-positive-number").isPrimitive,mDe=require("@stdlib/assert/is-error"),hDe=require("@stdlib/object/assign"),pDe=require("@stdlib/utils/inherit"),k4=require("@stdlib/utils/define-nonenumerable-property"),rn=require("@stdlib/utils/define-nonenumerable-read-only-property"),Pd=require("@stdlib/utils/define-read-only-accessor"),yDe=require("@stdlib/utils/define-read-write-accessor"),qDe=pn().factory,z4=require("@stdlib/buffer/from-string"),J4=require("@stdlib/string/format"),bDe=require("@stdlib/utils/next-tick"),wDe=x4(),SDe=V4(),Vs=W4();function ODe(){return this._prng.seed}function EDe(){return this._prng.seedLength}function _De(){return this._prng.stateLength}function NDe(){return this._prng.byteLength}function LDe(){return this._prng.state}function RDe(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 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=z4(e):e=z4(this._sep+e)),r=this.push(e),this._i%this._siter===0&&this.emit("state",this.state)}}function TDe(r){var e;if(this._destroyed)return Vs("Attempted to destroy an already destroyed stream."),this;return e=this,this._destroyed=!0,bDe(t),this;function t(){r&&(Vs("Stream was destroyed due to an error. Error: %s.",mDe(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(!I4(r))throw new TypeError(J4("invalid argument. First argument must be a positive number. Value: `%s`.",r));if(!I4(e))throw new TypeError(J4("invalid argument. Second argument must be a positive number. Value: `%s`.",e));if(i=hDe({},wDe),arguments.length>2&&(n=SDe(i,t),n))throw n;return Vs("Creating a readable stream configured with the following options: %s.",JSON.stringify(i)),U4.call(this,i),k4(this,"_destroyed",!1),rn(this,"_objectMode",i.objectMode),rn(this,"_sep",i.sep),rn(this,"_iter",i.iter),rn(this,"_siter",i.siter),k4(this,"_i",0),rn(this,"_prng",qDe(r,e,i)),rn(this,"PRNG",this._prng.PRNG),this}pDe(Je,U4);Pd(Je.prototype,"seed",ODe);Pd(Je.prototype,"seedLength",EDe);yDe(Je.prototype,"state",LDe,RDe);Pd(Je.prototype,"stateLength",_De);Pd(Je.prototype,"byteLength",NDe);rn(Je.prototype,"_read",PDe);rn(Je.prototype,"destroy",TDe);C4.exports=Je});var D4=s(function(_nr,B4){"use strict";var jDe=require("@stdlib/assert/is-plain-object"),MDe=require("@stdlib/object/assign"),xDe=require("@stdlib/string/format"),ADe=Td();function GDe(r,e,t){var i;if(arguments.length>2){if(i=t,!jDe(i))throw new TypeError(xDe("invalid argument. Options argument must be an object. Value: `%s`.",i));i=MDe({},t)}else i={};return i.objectMode=!0,new ADe(r,e,i)}B4.exports=GDe});var $4=s(function(Nnr,Q4){"use strict";var X4=require("@stdlib/assert/is-plain-object"),Y4=require("@stdlib/object/assign"),H4=require("@stdlib/string/format"),Z4=Td();function VDe(r,e,t){var i,n,a;if(i=arguments.length,i===1){if(!X4(r))throw new TypeError(H4("invalid argument. Options argument must be an object. Value: `%s`.",r));n=Y4({},r)}else if(i>2){if(!X4(t))throw new TypeError(H4("invalid argument. Options argument must be an object. Value: `%s`.",t));n=Y4({},t)}else n={};return i<2?a=u:a=o,a;function u(v,g){return new Z4(v,g,n)}function o(){return new Z4(r,e,n)}}Q4.exports=VDe});var rH=s(function(Lnr,eH){"use strict";var K4=require("@stdlib/utils/define-nonenumerable-read-only-property"),ch=Td(),FDe=D4(),WDe=$4();K4(ch,"objectMode",FDe);K4(ch,"factory",WDe);eH.exports=ch});var iH=s(function(Rnr,tH){"use strict";var P=require("@stdlib/utils/define-read-only-property"),L={};P(L,"arcsine",Ok());P(L,"bernoulli",Ck());P(L,"beta",lz());P(L,"betaprime",Vz());P(L,"binomial",n3());P(L,"boxMuller",w3());P(L,"cauchy",U3());P(L,"chi",gJ());P(L,"chisquare",jJ());P(L,"cosine",KJ());P(L,"discreteUniform",wU());P(L,"erlang",UU());P(L,"exponential",gC());P(L,"f",xC());P(L,"frechet",rB());P(L,"gamma",EB());P(L,"geometric",BB());P(L,"gumbel",l9());P(L,"hypergeometric",A9());P(L,"improvedZiggurat",Q9());P(L,"invgamma",bD());P(L,"kumaraswamy",UD());P(L,"laplace",f8());P(L,"levy",x8());P(L,"logistic",rX());P(L,"lognormal",OX());P(L,"minstd",zX());P(L,"minstdShuffle",a7());P(L,"mt19937",O7());P(L,"negativeBinomial",B7());P(L,"normal",l5());P(L,"pareto1",V5());P(L,"poisson",iY());P(L,"randi",bY());P(L,"randn",FY());P(L,"randu",e6());P(L,"rayleigh",w6());P(L,"t",J6());P(L,"triangular",v4());P(L,"uniform",M4());P(L,"weibull",rH());tH.exports=L});var hh=s(function(Pnr,aH){"use strict";var nH=require("@stdlib/array/base/assert/is-accessor-array"),mh=nn();function IDe(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 nH(r)?g=r.get(t):g=r[t],nH(i)?c=i.get(a):c=i[a],v.fcn=mh.factory(g,c,o),v;v.fcn=mh.factory(o)}else v.fcn=mh;return v.arity+=2,v}aH.exports=IDe});var uH=s(function(Tnr,sH){"use strict";var kDe=require("@stdlib/strided/base/nullary"),zDe=require("@stdlib/strided/base/binary"),JDe=hh();function UDe(r,e,t,i,n,a,u,o){var v=JDe(e,t,0,i,n,0,arguments.length>7,o);return v.arity===0?(kDe([a],[r],[u],v.fcn),a):(zDe([e,i,a],[r],[t,n,u],v.fcn),a)}sH.exports=UDe});var vH=s(function(jnr,oH){"use strict";var CDe=require("@stdlib/strided/base/nullary").ndarray,BDe=require("@stdlib/strided/base/binary").ndarray,DDe=hh();function XDe(r,e,t,i,n,a,u,o,v,g,c){var l=DDe(e,t,i,n,a,u,arguments.length>10,c);return l.arity===0?(CDe([o],[r],[v],[g],l.fcn),o):(BDe([e,n,o],[r],[t,a,v],[i,u,g],l.fcn),o)}oH.exports=XDe});var dH=s(function(Mnr,fH){"use strict";var YDe=require("@stdlib/utils/define-nonenumerable-read-only-property"),gH=uH(),HDe=vH();YDe(gH,"ndarray",HDe);fH.exports=gH});var hH=s(function(xnr,mH){"use strict";var lH=require("@stdlib/utils/define-nonenumerable-read-write-accessor"),jd=require("@stdlib/utils/define-nonenumerable-read-only-accessor"),Fs=require("@stdlib/utils/define-nonenumerable-read-only-property"),ZDe=require("@stdlib/assert/is-function"),QDe=require("@stdlib/assert/is-method-in"),$De=require("@stdlib/assert/is-plain-object"),KDe=require("@stdlib/utils/constant-function"),e8e=require("@stdlib/utils/noop"),cH=require("@stdlib/strided/base/unary"),ph=require("@stdlib/string/format");function r8e(r){if(!ZDe(r))throw new TypeError(ph("invalid argument. First argument must be a function. Value: `%s`.",r));if(!QDe(r,"factory"))throw new TypeError(ph("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],!$De(i))throw new TypeError(ph("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),lH(n,"state",KDe(null),e8e),Fs(n,"stateLength",null),Fs(n,"byteLength",null)):(jd(n,"seed",u),jd(n,"seedLength",o),lH(n,"state",c,l),jd(n,"stateLength",v),jd(n,"byteLength",g)),Fs(n,"PRNG",t.PRNG),Fs(n,"ndarray",a),n;function n(m,h,p,d,f){return cH([h,d],[m],[p,f],t),d}function a(m,h,p,d,f,y,q){return cH.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}}}mH.exports=r8e});var yh=s(function(Anr,pH){"use strict";var t8e=hH();pH.exports=t8e});var qh=s(function(Gnr,yH){"use strict";var i8e=yh(),n8e=an(),a8e=i8e(n8e);yH.exports=a8e});var bH=s(function(Vnr,qH){"use strict";var s8e=qh(),u8e=s8e();qH.exports=u8e});var OH=s(function(Fnr,SH){"use strict";var o8e=require("@stdlib/utils/define-nonenumerable-read-only-property"),wH=bH(),v8e=qh();o8e(wH,"factory",v8e);SH.exports=wH});var wh=s(function(Wnr,_H){"use strict";var EH=require("@stdlib/array/base/assert/is-accessor-array"),bh=un();function g8e(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 EH(r)?g=r.get(t):g=r[t],EH(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}_H.exports=g8e});var LH=s(function(Inr,NH){"use strict";var f8e=require("@stdlib/strided/base/nullary"),d8e=require("@stdlib/strided/base/binary"),l8e=wh();function c8e(r,e,t,i,n,a,u,o){var v=l8e(e,t,0,i,n,0,arguments.length>7,o);return v.arity===0?(f8e([a],[r],[u],v.fcn),a):(d8e([e,i,a],[r],[t,n,u],v.fcn),a)}NH.exports=c8e});var PH=s(function(knr,RH){"use strict";var m8e=require("@stdlib/strided/base/nullary").ndarray,h8e=require("@stdlib/strided/base/binary").ndarray,p8e=wh();function y8e(r,e,t,i,n,a,u,o,v,g,c){var l=p8e(e,t,i,n,a,u,arguments.length>10,c);return l.arity===0?(m8e([o],[r],[v],[g],l.fcn),o):(h8e([e,n,o],[r],[t,a,v],[i,u,g],l.fcn),o)}RH.exports=y8e});var MH=s(function(znr,jH){"use strict";var q8e=require("@stdlib/utils/define-nonenumerable-read-only-property"),TH=LH(),b8e=PH();q8e(TH,"ndarray",b8e);jH.exports=TH});var Oh=s(function(Jnr,AH){"use strict";var xH=require("@stdlib/array/base/assert/is-accessor-array"),Sh=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 xH(r)?g=r.get(t):g=r[t],xH(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}AH.exports=w8e});var VH=s(function(Unr,GH){"use strict";var S8e=require("@stdlib/strided/base/nullary"),O8e=require("@stdlib/strided/base/binary"),E8e=Oh();function _8e(r,e,t,i,n,a,u,o){var v=E8e(e,t,0,i,n,0,arguments.length>7,o);return v.arity===0?(S8e([a],[r],[u],v.fcn),a):(O8e([e,i,a],[r],[t,n,u],v.fcn),a)}GH.exports=_8e});var WH=s(function(Cnr,FH){"use strict";var N8e=require("@stdlib/strided/base/nullary").ndarray,L8e=require("@stdlib/strided/base/binary").ndarray,R8e=Oh();function P8e(r,e,t,i,n,a,u,o,v,g,c){var l=R8e(e,t,i,n,a,u,arguments.length>10,c);return l.arity===0?(N8e([o],[r],[v],[g],l.fcn),o):(L8e([e,n,o],[r],[t,a,v],[i,u,g],l.fcn),o)}FH.exports=P8e});var zH=s(function(Bnr,kH){"use strict";var T8e=require("@stdlib/utils/define-nonenumerable-read-only-property"),IH=VH(),j8e=WH();T8e(IH,"ndarray",j8e);kH.exports=IH});var _h=s(function(Dnr,UH){"use strict";var JH=require("@stdlib/array/base/assert/is-accessor-array"),Eh=vn();function M8e(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 JH(r)?g=r.get(t):g=r[t],JH(i)?c=i.get(a):c=i[a],v.fcn=Eh.factory(g,c,o),v;v.fcn=Eh.factory(o)}else v.fcn=Eh;return v.arity+=2,v}UH.exports=M8e});var BH=s(function(Xnr,CH){"use strict";var x8e=require("@stdlib/strided/base/nullary"),A8e=require("@stdlib/strided/base/binary"),G8e=_h();function V8e(r,e,t,i,n,a,u,o){var v=G8e(e,t,0,i,n,0,arguments.length>7,o);return v.arity===0?(x8e([a],[r],[u],v.fcn),a):(A8e([e,i,a],[r],[t,n,u],v.fcn),a)}CH.exports=V8e});var XH=s(function(Ynr,DH){"use strict";var F8e=require("@stdlib/strided/base/nullary").ndarray,W8e=require("@stdlib/strided/base/binary").ndarray,I8e=_h();function k8e(r,e,t,i,n,a,u,o,v,g,c){var l=I8e(e,t,i,n,a,u,arguments.length>10,c);return l.arity===0?(F8e([o],[r],[v],[g],l.fcn),o):(W8e([e,n,o],[r],[t,a,v],[i,u,g],l.fcn),o)}DH.exports=k8e});var ZH=s(function(Hnr,HH){"use strict";var z8e=require("@stdlib/utils/define-nonenumerable-read-only-property"),YH=BH(),J8e=XH();z8e(YH,"ndarray",J8e);HH.exports=YH});var Lh=s(function(Znr,$H){"use strict";var QH=require("@stdlib/array/base/assert/is-accessor-array"),Nh=gn();function U8e(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 QH(r)?g=r.get(t):g=r[t],QH(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}$H.exports=U8e});var eZ=s(function(Qnr,KH){"use strict";var C8e=require("@stdlib/strided/base/nullary"),B8e=require("@stdlib/strided/base/binary"),D8e=Lh();function X8e(r,e,t,i,n,a,u,o){var v=D8e(e,t,0,i,n,0,arguments.length>7,o);return v.arity===0?(C8e([a],[r],[u],v.fcn),a):(B8e([e,i,a],[r],[t,n,u],v.fcn),a)}KH.exports=X8e});var tZ=s(function($nr,rZ){"use strict";var Y8e=require("@stdlib/strided/base/nullary").ndarray,H8e=require("@stdlib/strided/base/binary").ndarray,Z8e=Lh();function Q8e(r,e,t,i,n,a,u,o,v,g,c){var l=Z8e(e,t,i,n,a,u,arguments.length>10,c);return l.arity===0?(Y8e([o],[r],[v],[g],l.fcn),o):(H8e([e,n,o],[r],[t,a,v],[i,u,g],l.fcn),o)}rZ.exports=Q8e});var aZ=s(function(Knr,nZ){"use strict";var $8e=require("@stdlib/utils/define-nonenumerable-read-only-property"),iZ=eZ(),K8e=tZ();$8e(iZ,"ndarray",K8e);nZ.exports=iZ});var Rh=s(function(ear,sZ){"use strict";var eXe=yh(),rXe=fn(),tXe=eXe(rXe);sZ.exports=tXe});var oZ=s(function(rar,uZ){"use strict";var iXe=Rh(),nXe=iXe();uZ.exports=nXe});var fZ=s(function(tar,gZ){"use strict";var aXe=require("@stdlib/utils/define-nonenumerable-read-only-property"),vZ=oZ(),sXe=Rh();aXe(vZ,"factory",sXe);gZ.exports=vZ});var Th=s(function(iar,lZ){"use strict";var dZ=require("@stdlib/array/base/assert/is-accessor-array"),Ph=Ce();function uXe(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=Ph.factory(g,c,o),v;v.fcn=Ph.factory(o)}else v.fcn=Ph;return v.arity+=2,v}lZ.exports=uXe});var mZ=s(function(nar,cZ){"use strict";var oXe=require("@stdlib/strided/base/nullary"),vXe=require("@stdlib/strided/base/binary"),gXe=Th();function fXe(r,e,t,i,n,a,u,o){var v=gXe(e,t,0,i,n,0,arguments.length>7,o);return v.arity===0?(oXe([a],[r],[u],v.fcn),a):(vXe([e,i,a],[r],[t,n,u],v.fcn),a)}cZ.exports=fXe});var pZ=s(function(aar,hZ){"use strict";var dXe=require("@stdlib/strided/base/nullary").ndarray,lXe=require("@stdlib/strided/base/binary").ndarray,cXe=Th();function mXe(r,e,t,i,n,a,u,o,v,g,c){var l=cXe(e,t,i,n,a,u,arguments.length>10,c);return l.arity===0?(dXe([o],[r],[v],[g],l.fcn),o):(lXe([e,n,o],[r],[t,a,v],[i,u,g],l.fcn),o)}hZ.exports=mXe});var bZ=s(function(sar,qZ){"use strict";var hXe=require("@stdlib/utils/define-nonenumerable-read-only-property"),yZ=mZ(),pXe=pZ();hXe(yZ,"ndarray",pXe);qZ.exports=yZ});var Mh=s(function(uar,SZ){"use strict";var wZ=require("@stdlib/array/base/assert/is-accessor-array"),jh=dn();function yXe(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 wZ(r)?g=r.get(t):g=r[t],wZ(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}SZ.exports=yXe});var EZ=s(function(oar,OZ){"use strict";var qXe=require("@stdlib/strided/base/nullary"),bXe=require("@stdlib/strided/base/binary"),wXe=Mh();function SXe(r,e,t,i,n,a,u,o){var v=wXe(e,t,0,i,n,0,arguments.length>7,o);return v.arity===0?(qXe([a],[r],[u],v.fcn),a):(bXe([e,i,a],[r],[t,n,u],v.fcn),a)}OZ.exports=SXe});var NZ=s(function(gar,_Z){"use strict";var OXe=require("@stdlib/strided/base/nullary").ndarray,EXe=require("@stdlib/strided/base/binary").ndarray,_Xe=Mh();function NXe(r,e,t,i,n,a,u,o,v,g,c){var l=_Xe(e,t,i,n,a,u,arguments.length>10,c);return l.arity===0?(OXe([o],[r],[v],[g],l.fcn),o):(EXe([e,n,o],[r],[t,a,v],[i,u,g],l.fcn),o)}_Z.exports=NXe});var PZ=s(function(far,RZ){"use strict";var LXe=require("@stdlib/utils/define-nonenumerable-read-only-property"),LZ=EZ(),RXe=NZ();LXe(LZ,"ndarray",RXe);RZ.exports=LZ});var Ah=s(function(dar,jZ){"use strict";var TZ=require("@stdlib/array/base/assert/is-accessor-array"),xh=ln();function PXe(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 TZ(r)?g=r.get(t):g=r[t],TZ(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}jZ.exports=PXe});var xZ=s(function(lar,MZ){"use strict";var TXe=require("@stdlib/strided/base/nullary"),jXe=require("@stdlib/strided/base/binary"),MXe=Ah();function xXe(r,e,t,i,n,a,u,o){var v=MXe(e,t,0,i,n,0,arguments.length>7,o);return v.arity===0?(TXe([a],[r],[u],v.fcn),a):(jXe([e,i,a],[r],[t,n,u],v.fcn),a)}MZ.exports=xXe});var GZ=s(function(car,AZ){"use strict";var AXe=require("@stdlib/strided/base/nullary").ndarray,GXe=require("@stdlib/strided/base/binary").ndarray,VXe=Ah();function FXe(r,e,t,i,n,a,u,o,v,g,c){var l=VXe(e,t,i,n,a,u,arguments.length>10,c);return l.arity===0?(AXe([o],[r],[v],[g],l.fcn),o):(GXe([e,n,o],[r],[t,a,v],[i,u,g],l.fcn),o)}AZ.exports=FXe});var WZ=s(function(mar,FZ){"use strict";var WXe=require("@stdlib/utils/define-nonenumerable-read-only-property"),VZ=xZ(),IXe=GZ();WXe(VZ,"ndarray",IXe);FZ.exports=VZ});var zZ=s(function(har,kZ){"use strict";var kXe=require("@stdlib/strided/base/nullary"),IZ=$();function zXe(r,e,t,i){var n;return arguments.length>3?n=IZ.factory(i):n=IZ,kXe([e],[r],[t],n),e}kZ.exports=zXe});var CZ=s(function(par,UZ){"use strict";var JXe=require("@stdlib/strided/base/nullary").ndarray,JZ=$();function UXe(r,e,t,i,n){var a;return arguments.length>4?a=JZ.factory(n):a=JZ,JXe([e],[r],[t],[i],a),e}UZ.exports=UXe});var XZ=s(function(yar,DZ){"use strict";var CXe=require("@stdlib/strided/base/nullary"),BZ=$();function BXe(r,e,t,i){var n;return arguments.length>3?n=BZ.factory(i):n=BZ,CXe([e],[r],[t],n.normalized),e}DZ.exports=BXe});var ZZ=s(function(qar,HZ){"use strict";var DXe=require("@stdlib/strided/base/nullary").ndarray,YZ=$();function XXe(r,e,t,i,n){var a;return arguments.length>4?a=YZ.factory(n):a=YZ,DXe([e],[r],[t],[i],a.normalized),e}HZ.exports=XXe});var KZ=s(function(bar,$Z){"use strict";var Gh=require("@stdlib/utils/define-nonenumerable-read-only-property"),Vh=zZ(),YXe=CZ(),QZ=XZ(),HXe=ZZ();Gh(Vh,"ndarray",YXe);Gh(Vh,"normalized",QZ);Gh(QZ,"ndarray",HXe);$Z.exports=Vh});var tQ=s(function(war,rQ){"use strict";var ZXe=require("@stdlib/strided/base/nullary"),eQ=ee();function QXe(r,e,t,i){var n;return arguments.length>3?n=eQ.factory(i):n=eQ,ZXe([e],[r],[t],n),e}rQ.exports=QXe});var aQ=s(function(Sar,nQ){"use strict";var $Xe=require("@stdlib/strided/base/nullary").ndarray,iQ=ee();function KXe(r,e,t,i,n){var a;return arguments.length>4?a=iQ.factory(n):a=iQ,$Xe([e],[r],[t],[i],a),e}nQ.exports=KXe});var oQ=s(function(Oar,uQ){"use strict";var e7e=require("@stdlib/strided/base/nullary"),sQ=ee();function r7e(r,e,t,i){var n;return arguments.length>3?n=sQ.factory(i):n=sQ,e7e([e],[r],[t],n.normalized),e}uQ.exports=r7e});var fQ=s(function(Ear,gQ){"use strict";var t7e=require("@stdlib/strided/base/nullary").ndarray,vQ=ee();function i7e(r,e,t,i,n){var a;return arguments.length>4?a=vQ.factory(n):a=vQ,t7e([e],[r],[t],[i],a.normalized),e}gQ.exports=i7e});var cQ=s(function(_ar,lQ){"use strict";var Fh=require("@stdlib/utils/define-nonenumerable-read-only-property"),Wh=tQ(),n7e=aQ(),dQ=oQ(),a7e=fQ();Fh(Wh,"ndarray",n7e);Fh(Wh,"normalized",dQ);Fh(dQ,"ndarray",a7e);lQ.exports=Wh});var pQ=s(function(Nar,hQ){"use strict";var s7e=require("@stdlib/strided/base/nullary"),mQ=T();function u7e(r,e,t,i){var n;return arguments.length>3?n=mQ.factory(i):n=mQ,s7e([e],[r],[t],n),e}hQ.exports=u7e});var bQ=s(function(Lar,qQ){"use strict";var o7e=require("@stdlib/strided/base/nullary").ndarray,yQ=T();function v7e(r,e,t,i,n){var a;return arguments.length>4?a=yQ.factory(n):a=yQ,o7e([e],[r],[t],[i],a),e}qQ.exports=v7e});var OQ=s(function(Rar,SQ){"use strict";var g7e=require("@stdlib/strided/base/nullary"),wQ=T();function f7e(r,e,t,i){var n;return arguments.length>3?n=wQ.factory(i):n=wQ,g7e([e],[r],[t],n.normalized),e}SQ.exports=f7e});var NQ=s(function(Par,_Q){"use strict";var d7e=require("@stdlib/strided/base/nullary").ndarray,EQ=T();function l7e(r,e,t,i,n){var a;return arguments.length>4?a=EQ.factory(n):a=EQ,d7e([e],[r],[t],[i],a.normalized),e}_Q.exports=l7e});var PQ=s(function(Tar,RQ){"use strict";var Ih=require("@stdlib/utils/define-nonenumerable-read-only-property"),kh=pQ(),c7e=bQ(),LQ=OQ(),m7e=NQ();Ih(kh,"ndarray",c7e);Ih(kh,"normalized",LQ);Ih(LQ,"ndarray",m7e);RQ.exports=kh});var Jh=s(function(jar,jQ){"use strict";var TQ=require("@stdlib/array/base/assert/is-accessor-array"),zh=mn();function h7e(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 TQ(r)?g=r.get(t):g=r[t],TQ(i)?c=i.get(a):c=i[a],v.fcn=zh.factory(g,c,o),v;v.fcn=zh.factory(o)}else v.fcn=zh;return v.arity+=2,v}jQ.exports=h7e});var xQ=s(function(Mar,MQ){"use strict";var p7e=require("@stdlib/strided/base/nullary"),y7e=require("@stdlib/strided/base/binary"),q7e=Jh();function b7e(r,e,t,i,n,a,u,o){var v=q7e(e,t,0,i,n,0,arguments.length>7,o);return v.arity===0?(p7e([a],[r],[u],v.fcn),a):(y7e([e,i,a],[r],[t,n,u],v.fcn),a)}MQ.exports=b7e});var GQ=s(function(xar,AQ){"use strict";var w7e=require("@stdlib/strided/base/nullary").ndarray,S7e=require("@stdlib/strided/base/binary").ndarray,O7e=Jh();function E7e(r,e,t,i,n,a,u,o,v,g,c){var l=O7e(e,t,i,n,a,u,arguments.length>10,c);return l.arity===0?(w7e([o],[r],[v],[g],l.fcn),o):(S7e([e,n,o],[r],[t,a,v],[i,u,g],l.fcn),o)}AQ.exports=E7e});var WQ=s(function(Aar,FQ){"use strict";var _7e=require("@stdlib/utils/define-nonenumerable-read-only-property"),VQ=xQ(),N7e=GQ();_7e(VQ,"ndarray",N7e);FQ.exports=VQ});var zQ=s(function(Gar,kQ){"use strict";var L7e=require("@stdlib/strided/base/nullary"),IQ=Tt();function R7e(r,e,t,i){var n;return arguments.length>3?n=IQ.factory(i):n=IQ,L7e([e],[r],[t],n),e}kQ.exports=R7e});var CQ=s(function(Var,UQ){"use strict";var P7e=require("@stdlib/strided/base/nullary").ndarray,JQ=Tt();function T7e(r,e,t,i,n){var a;return arguments.length>4?a=JQ.factory(n):a=JQ,P7e([e],[r],[t],[i],a),e}UQ.exports=T7e});var XQ=s(function(Far,DQ){"use strict";var j7e=require("@stdlib/utils/define-nonenumerable-read-only-property"),BQ=zQ(),M7e=CQ();j7e(BQ,"ndarray",M7e);DQ.exports=BQ});var Ch=s(function(War,HQ){"use strict";var YQ=require("@stdlib/array/base/assert/is-accessor-array"),Uh=hn();function x7e(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 YQ(r)?g=r.get(t):g=r[t],YQ(i)?c=i.get(a):c=i[a],v.fcn=Uh.factory(g,c,o),v;v.fcn=Uh.factory(o)}else v.fcn=Uh;return v.arity+=2,v}HQ.exports=x7e});var QQ=s(function(Iar,ZQ){"use strict";var A7e=require("@stdlib/strided/base/nullary"),G7e=require("@stdlib/strided/base/binary"),V7e=Ch();function F7e(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?(A7e([a],[r],[u],v.fcn),a):(G7e([e,i,a],[r],[t,n,u],v.fcn),a)}ZQ.exports=F7e});var KQ=s(function(kar,$Q){"use strict";var W7e=require("@stdlib/strided/base/nullary").ndarray,I7e=require("@stdlib/strided/base/binary").ndarray,k7e=Ch();function z7e(r,e,t,i,n,a,u,o,v,g,c){var l=k7e(e,t,i,n,a,u,arguments.length>10,c);return l.arity===0?(W7e([o],[r],[v],[g],l.fcn),o):(I7e([e,n,o],[r],[t,a,v],[i,u,g],l.fcn),o)}$Q.exports=z7e});var t$=s(function(zar,r$){"use strict";var J7e=require("@stdlib/utils/define-nonenumerable-read-only-property"),e$=QQ(),U7e=KQ();J7e(e$,"ndarray",U7e);r$.exports=e$});var Dh=s(function(Jar,n$){"use strict";var i$=require("@stdlib/array/base/assert/is-accessor-array"),Bh=pn();function C7e(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 i$(r)?g=r.get(t):g=r[t],i$(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}n$.exports=C7e});var s$=s(function(Uar,a$){"use strict";var B7e=require("@stdlib/strided/base/nullary"),D7e=require("@stdlib/strided/base/binary"),X7e=Dh();function Y7e(r,e,t,i,n,a,u,o){var v=X7e(e,t,0,i,n,0,arguments.length>7,o);return v.arity===0?(B7e([a],[r],[u],v.fcn),a):(D7e([e,i,a],[r],[t,n,u],v.fcn),a)}a$.exports=Y7e});var o$=s(function(Car,u$){"use strict";var H7e=require("@stdlib/strided/base/nullary").ndarray,Z7e=require("@stdlib/strided/base/binary").ndarray,Q7e=Dh();function $7e(r,e,t,i,n,a,u,o,v,g,c){var l=Q7e(e,t,i,n,a,u,arguments.length>10,c);return l.arity===0?(H7e([o],[r],[v],[g],l.fcn),o):(Z7e([e,n,o],[r],[t,a,v],[i,u,g],l.fcn),o)}u$.exports=$7e});var f$=s(function(Bar,g$){"use strict";var K7e=require("@stdlib/utils/define-nonenumerable-read-only-property"),v$=s$(),e5e=o$();K7e(v$,"ndarray",e5e);g$.exports=v$});var l$=s(function(Dar,d$){"use strict";var z=require("@stdlib/utils/define-read-only-property"),k={};z(k,"arcsine",dH());z(k,"bernoulli",OH());z(k,"beta",MH());z(k,"betaprime",zH());z(k,"cosine",ZH());z(k,"discreteUniform",aZ());z(k,"exponential",fZ());z(k,"gamma",bZ());z(k,"invgamma",PZ());z(k,"lognormal",WZ());z(k,"minstd",KZ());z(k,"minstdShuffle",cQ());z(k,"mt19937",PQ());z(k,"normal",WQ());z(k,"randu",XQ());z(k,"uniform",t$());z(k,"weibull",f$());d$.exports=k});var sa=require("@stdlib/utils/define-read-only-property"),tn={};sa(tn,"array",mx());sa(tn,"base",s1());sa(tn,"iterators",hI());sa(tn,"sample",kI());sa(tn,"shuffle",ek());sa(tn,"streams",iH());sa(tn,"strided",l$());module.exports=tn; /** * @license Apache-2.0 * diff --git a/dist/index.js.map b/dist/index.js.map index a5ed0b74..4bde77ba 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/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/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/tools/unary-factory/lib/main.js", "../strided/tools/unary-factory/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/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) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See 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) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See 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) 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) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See 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) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See 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 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 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 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( 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,GAA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AI,YAAa,IAAuB,EASrDD,GAAaC,GAAI,SAAU,IAAyB,EASpDD,GAAaC,GAAI,UAAW,IAA0B,EAStDD,GAAaC,GAAI,UAAW,IAA0B,EAStDD,GAAaC,GAAI,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_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_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_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", "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_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/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/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) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See 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) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See 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 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 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( 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,GAA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A0C,EAUjEC,EAAK,CAAC,EASVD,EAAaC,EAAI,UAAW,IAAqC,EASjED,EAAaC,EAAI,YAAa,IAAuC,EASrED,EAAaC,EAAI,OAAQ,IAAkC,EAS3DD,EAAaC,EAAI,YAAa,IAAuC,EASrED,EAAaC,EAAI,SAAU,IAAoC,EAS/DD,EAAaC,EAAI,kBAAmB,IAA8C,EASlFD,EAAaC,EAAI,cAAe,IAAyC,EASzED,EAAaC,EAAI,QAAS,IAAmC,EAS7DD,EAAaC,EAAI,WAAY,IAAsC,EASnED,EAAaC,EAAI,YAAa,IAAuC,EASrED,EAAaC,EAAI,SAAU,IAAoC,EAS/DD,EAAaC,EAAI,gBAAiB,IAA4C,EAS9ED,EAAaC,EAAI,UAAW,IAAqC,EASjED,EAAaC,EAAI,SAAU,IAAoC,EAS/DD,EAAaC,EAAI,QAAS,IAAmC,EAS7DD,EAAaC,EAAI,UAAW,IAAqC,EASjED,EAAaC,EAAI,UAAW,IAAqC,EAKjEF,GAAO,QAAUE,ICxKjB,IAAIC,GAAc,QAAS,yCAA0C,EAUjEC,GAAK,CAAC,EASVD,GAAaC,GAAI,QAAS,IAAwB,EASlDD,GAAaC,GAAI,OAAQ,IAAuB,EAShDD,GAAaC,GAAI,YAAa,IAAuB,EASrDD,GAAaC,GAAI,SAAU,IAAyB,EASpDD,GAAaC,GAAI,UAAW,IAA0B,EAStDD,GAAaC,GAAI,UAAW,IAA0B,EAStDD,GAAaC,GAAI,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_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_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"] } diff --git a/strided/bernoulli/README.md b/strided/bernoulli/README.md new file mode 100644 index 00000000..15da4bdd --- /dev/null +++ b/strided/bernoulli/README.md @@ -0,0 +1,375 @@ + + +# Bernoulli Random Numbers + +> Fill a strided array with pseudorandom numbers drawn from a [Bernoulli][@stdlib/random/base/bernoulli] distribution. + +
+ +## Usage + +```javascript +var bernoulli = require( '@stdlib/random/strided/bernoulli' ); +``` + +#### bernoulli( N, p, sp, out, so ) + +Fills a strided array with pseudorandom numbers drawn from a [Bernoulli][@stdlib/random/base/bernoulli] distribution. + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); + +// Create an array: +var out = new Float64Array( 10 ); + +// Fill the array with pseudorandom numbers: +bernoulli( out.length, [ 0.5 ], 0, out, 1 ); +``` + +The function has the following parameters: + +- **N**: number of indexed elements. +- **p**: rate parameter. +- **sp**: index increment for `p`. +- **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 ]; + +bernoulli( 3, [ 0.5 ], 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 p0 = new Float64Array( [ 0.5, 0.5, 0.5, 0.5, 0.5, 0.5 ] ); + +// Create offset view: +var p1 = new Float64Array( p0.buffer, p0.BYTES_PER_ELEMENT*3 ); // start at 4th element + +// Create an output array: +var out = new Float64Array( 3 ); + +// Fill the output array: +bernoulli( out.length, p1, -1, out, 1 ); +``` + +#### bernoulli.ndarray( N, p, sp, op, out, so, oo ) + +Fills a strided array with pseudorandom numbers drawn from a [Bernoulli][@stdlib/random/base/bernoulli] 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: +bernoulli.ndarray( out.length, [ 0.5 ], 0, 0, out, 1, 0 ); +``` + +The function has the following additional parameters: + +- **op**: starting index for `p`. +- **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 ]; + +bernoulli.ndarray( 3, [ 0.5 ], 0, 0, out, 2, 1 ); +``` + +#### bernoulli.factory( \[options] ) + +Returns a function for filling strided arrays with pseudorandom numbers drawn from a [Bernoulli][@stdlib/random/base/bernoulli] distribution. + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); + +var random = bernoulli.factory(); +// returns + +// Create an array: +var out = new Float64Array( 10 ); + +// Fill the array with pseudorandom numbers: +random( out.length, [ 0.5 ], 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 = bernoulli.factory( opts ); + +var out = new Float64Array( 10 ); +random( out.length, [ 0.5 ], 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 = bernoulli.factory( opts ); + +var out = new Float64Array( 10 ); +random( out.length, [ 0.5 ], 0, out, 1 ); +``` + +* * * + +#### random.PRNG + +The underlying pseudorandom number generator. + +```javascript +var prng = bernoulli.PRNG; +// returns +``` + +#### bernoulli.seed + +The value used to seed the underlying pseudorandom number generator. + +```javascript +var seed = bernoulli.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 = bernoulli.factory({ + 'prng': minstd +}); +// returns + +var seed = random.seed; +// returns null +``` + +#### bernoulli.seedLength + +Length of underlying pseudorandom number generator seed. + +```javascript +var len = bernoulli.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 = bernoulli.factory({ + 'prng': minstd +}); +// returns + +var len = random.seedLength; +// returns null +``` + +#### bernoulli.state + +Writable property for getting and setting the underlying pseudorandom number generator state. + +```javascript +var state = bernoulli.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 = bernoulli.factory({ + 'prng': minstd +}); +// returns + +var state = random.state; +// returns null +``` + +#### bernoulli.stateLength + +Length of underlying pseudorandom number generator state. + +```javascript +var len = bernoulli.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 = bernoulli.factory({ + 'prng': minstd +}); +// returns + +var len = random.stateLength; +// returns null +``` + +#### bernoulli.byteLength + +Size (in bytes) of underlying pseudorandom number generator state. + +```javascript +var sz = bernoulli.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 = bernoulli.factory({ + 'prng': minstd +}); +// returns + +var sz = random.byteLength; +// returns null +``` + +
+ + + +
+ +* * * + +## Notes + +- If `N <= 0`, both `bernoulli` and `bernoulli.ndarray` leave the output array unchanged. +- Both `bernoulli` and `bernoulli.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 bernoulli = require( '@stdlib/random/strided/bernoulli' ); + +// Specify a PRNG seed: +var opts = { + 'seed': 1234 +}; + +// Create a seeded PRNG: +var rand1 = bernoulli.factory( opts ); + +// Create an array: +var x1 = zeros( 10, 'float64' ); + +// Fill the array with pseudorandom numbers: +rand1( x1.length, [ 0.5 ], 0, x1, 1 ); + +// Create another function for filling strided arrays: +var rand2 = bernoulli.factory( opts ); +// returns + +// Create a second array: +var x2 = zeros( 10, 'generic' ); + +// Fill the array with the same pseudorandom numbers: +rand2( x2.length, [ 0.5 ], 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/bernoulli/benchmark/benchmark.float32.broadcast.js b/strided/bernoulli/benchmark/benchmark.float32.broadcast.js new file mode 100644 index 00000000..b5a1c6cb --- /dev/null +++ b/strided/bernoulli/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( 0.5, 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/bernoulli/benchmark/benchmark.float32.js b/strided/bernoulli/benchmark/benchmark.float32.js new file mode 100644 index 00000000..3deb9350 --- /dev/null +++ b/strided/bernoulli/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( 0.5, 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/bernoulli/benchmark/benchmark.float64.broadcast.js b/strided/bernoulli/benchmark/benchmark.float64.broadcast.js new file mode 100644 index 00000000..1830f44f --- /dev/null +++ b/strided/bernoulli/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( 0.5, 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/bernoulli/benchmark/benchmark.float64.js b/strided/bernoulli/benchmark/benchmark.float64.js new file mode 100644 index 00000000..b7589113 --- /dev/null +++ b/strided/bernoulli/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( 0.5, 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/bernoulli/benchmark/benchmark.generic.broadcast.js b/strided/bernoulli/benchmark/benchmark.generic.broadcast.js new file mode 100644 index 00000000..467cec20 --- /dev/null +++ b/strided/bernoulli/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( 0.5, 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/bernoulli/benchmark/benchmark.generic.js b/strided/bernoulli/benchmark/benchmark.generic.js new file mode 100644 index 00000000..57c26b35 --- /dev/null +++ b/strided/bernoulli/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( 0.5, 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/bernoulli/docs/repl.txt b/strided/bernoulli/docs/repl.txt new file mode 100644 index 00000000..17e6ea26 --- /dev/null +++ b/strided/bernoulli/docs/repl.txt @@ -0,0 +1,203 @@ + +{{alias}}( N, p, sp, out, so ) + Fills a strided array with pseudorandom numbers drawn from a Bernoulli + 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. + + p: ArrayLikeObject + Success probability. + + sp: integer + Index increment for `p`. + + 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, [ 0.5 ], 0, out, 1 ) + [...] + + +{{alias}}.ndarray( N, p, sp, op, out, so, oo ) + Fills a strided array with pseudorandom numbers drawn from a Bernoulli + 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. + + p: ArrayLikeObject + Success probability. + + sp: integer + Index increment for `p`. + + op: integer + Starting index for `p`. + + 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, [ 0.5 ], 0, 0, out, 1, 0 ) + [...] + + +{{alias}}.factory( [options] ) + Returns a function for filling strided arrays with pseudorandom numbers + drawn from a Bernoulli 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, [ 0.5 ], 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, [ 0.5 ], 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, [ 0.5 ], 0, out, 1 ) + [...] + > out = {{alias:@stdlib/array/zeros}}( 3, 'generic' ); + > {{alias}}( out.length, [ 0.5 ], 0, out, 1 ) + [...] + + // Set the state: + > {{alias}}.state = state; + + // Regenerate previous generated values: + > out = {{alias:@stdlib/array/zeros}}( 3, 'generic' ); + > {{alias}}( out.length, [ 0.5 ], 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/bernoulli/docs/types/index.d.ts b/strided/bernoulli/docs/types/index.d.ts new file mode 100644 index 00000000..2f7d8e1e --- /dev/null +++ b/strided/bernoulli/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 Bernoulli distribution. +*/ +interface Random extends PRNG { + /** + * Fills a strided array with pseudorandom numbers drawn from a Bernoulli distribution. + * + * @param N - number of indexed elements + * @param p - success probability + * @param sp - `p` 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: + * bernoulli( out.length, [ 0.5 ], 0, out, 1 ); + */ + ( N: number, p: Collection, sp: number, out: Collection, so: number ): Collection; + + /** + * Fills a strided array with pseudorandom numbers drawn from a Bernoulli distribution using alternative indexing semantics. + * + * @param N - number of indexed elements + * @param p - success probability + * @param sp - `p` strided length + * @param op - starting index for `p` + * @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: + * bernoulli.ndarray( out.length, [ 0.5 ], 0, 0, out, 1, 0 ); + */ + ndarray( N: number, p: Collection, sp: number, op: 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 Bernoulli 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 = bernoulli.factory(); + * + * // Create an array: + * var out = new Float64Array( 10 ); + * + * // Fill the array with pseudorandom numbers: + * random( out.length, [ 0.5 ], 0, out, 1 ); + * + * @example + * var Float64Array = require( '@stdlib/array/float64' ); + * + * // Create a new PRNG function: + * var random = bernoulli.factory({ + * 'seed': 297 + * }); + * + * // Create an array: + * var out = new Float64Array( 10 ); + * + * // Fill the array with pseudorandom numbers: + * random( out.length, [ 0.5 ], 0, out, 1 ); + */ + factory( options?: Options ): Random; +} + +/** +* Fills a strided array with pseudorandom numbers drawn from a Bernoulli distribution. +* +* @param N - number of indexed elements +* @param p - success probability +* @param sp - `p` 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: +* bernoulli( out.length, [ 0.5 ], 0, out, 1 ); +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* // Create an array: +* var out = new Float64Array( 10 ); +* +* // Fill the array with pseudorandom numbers: +* bernoulli.ndarray( out.length, [ 0.5 ], 0, 0, out, 1, 0 ); +*/ +declare var bernoulli: Routine; + + +// EXPORTS // + +export = bernoulli; diff --git a/strided/bernoulli/docs/types/test.ts b/strided/bernoulli/docs/types/test.ts new file mode 100644 index 00000000..b4dc8c38 --- /dev/null +++ b/strided/bernoulli/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/bernoulli/examples/index.js b/strided/bernoulli/examples/index.js new file mode 100644 index 00000000..7fab243d --- /dev/null +++ b/strided/bernoulli/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 bernoulli = require( './../lib' ); + +// Specify a PRNG seed: +var opts = { + 'seed': 1234 +}; + +// Create a seeded PRNG: +var rand1 = bernoulli.factory( opts ); + +// Create an array: +var x1 = zeros( 10, 'float64' ); + +// Fill the array with pseudorandom numbers: +rand1( x1.length, [ 0.5 ], 0, x1, 1 ); + +// Create another function for filling strided arrays: +var rand2 = bernoulli.factory( opts ); +// returns + +// Create a second array: +var x2 = zeros( 10, 'generic' ); + +// Fill the array with the same pseudorandom numbers: +rand2( x2.length, [ 0.5 ], 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/bernoulli/lib/factory.js b/strided/bernoulli/lib/factory.js new file mode 100644 index 00000000..fe51bf00 --- /dev/null +++ b/strided/bernoulli/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/bernoulli' ); + + +// MAIN // + +/** +* Returns a function for filling strided arrays containing pseudorandom numbers drawn from a Bernoulli 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 bernoulli = factory(); +* // returns +* +* var out = new Float64Array( 10 ); +* // returns +* +* var arr = bernoulli( out.length, [ 0.5 ], 0, out, 1 ); +* // returns +* +* var bool = ( arr === out ); +* // returns true +*/ +var factory = unaryFactory( base ); + + +// EXPORTS // + +module.exports = factory; diff --git a/strided/bernoulli/lib/index.js b/strided/bernoulli/lib/index.js new file mode 100644 index 00000000..07b4f22c --- /dev/null +++ b/strided/bernoulli/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 Bernoulli distribution. +* +* @module @stdlib/random/strided/bernoulli +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* var bernoulli = require( '@stdlib/random/strided/bernoulli' ); +* +* // Create an array: +* var out = new Float64Array( 10 ); +* +* // Fill the array with pseudorandom numbers: +* bernoulli( out.length, [ 0.5 ], 0, out, 1 ); +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* var bernoulli = require( '@stdlib/random/strided/bernoulli' ); +* +* // Create an array: +* var out = new Float64Array( 10 ); +* +* // Fill the array with pseudorandom numbers: +* bernoulli.ndarray( out.length, [ 0.5 ], 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/bernoulli/lib/main.js b/strided/bernoulli/lib/main.js new file mode 100644 index 00000000..45de196a --- /dev/null +++ b/strided/bernoulli/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 Bernoulli distribution. +* +* @name bernoulli +* @type {Function} +* @param {NonNegativeInteger} N - number of indexed elements +* @param {Collection} p - success probability +* @param {integer} sp - `p` 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: +* bernoulli( out.length, [ 0.5 ], 0, out, 1 ); +*/ +var bernoulli = factory(); + + +// EXPORTS // + +module.exports = bernoulli; diff --git a/strided/bernoulli/package.json b/strided/bernoulli/package.json new file mode 100644 index 00000000..f35f1ce4 --- /dev/null +++ b/strided/bernoulli/package.json @@ -0,0 +1,73 @@ +{ + "name": "@stdlib/random/strided/bernoulli", + "version": "0.0.0", + "description": "Fill a strided array with pseudorandom numbers drawn from a Bernoulli 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", + "bernoulli", + "discrete", + "generator", + "seed", + "seedable", + "strided", + "array", + "vector", + "ndarray" + ] +} diff --git a/strided/bernoulli/test/test.factory.js b/strided/bernoulli/test/test.factory.js new file mode 100644 index 00000000..10b3167b --- /dev/null +++ b/strided/bernoulli/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/bernoulli' ); +var factory = require( './../lib' ).factory; + + +// VARIABLES // + +// Valid values for PRNG parameters: +var PARAM1 = randomArray( 10, 0.01, 0.99, { + '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, 0.01, 0.99, { + '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, 0.01, 0.99, { + '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, 0.01, 0.99, { + '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, 0.01, 0.99, { + '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, 1, 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, 1, out, 1 ); + t.deepEqual( out, expected, 'returns expected value' ); + + random( 0, x1, 1, 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, 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' ); + + 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, 0.01, 0.99, { + '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, 0.01, 0.99, { + '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, 0.01, 0.99, { + '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, 0.01, 0.99, { + '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, 1, 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, 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' ); + + 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, 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' ); + + 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/bernoulli/test/test.js b/strided/bernoulli/test/test.js new file mode 100644 index 00000000..e7fde2ad --- /dev/null +++ b/strided/bernoulli/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/bernoulli/test/test.main.js b/strided/bernoulli/test/test.main.js new file mode 100644 index 00000000..310d75ca --- /dev/null +++ b/strided/bernoulli/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, 0.01, 0.99, { + '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, 0.01, 0.99, { + '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, 0.01, 0.99, { + '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, 1, 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, 1, out, 1 ); + t.deepEqual( out, expected, 'returns expected value' ); + + random( 0, x1, 1, 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, 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' ); + + 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/bernoulli/test/test.ndarray.js b/strided/bernoulli/test/test.ndarray.js new file mode 100644 index 00000000..5a3a609a --- /dev/null +++ b/strided/bernoulli/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, 0.01, 0.99, { + '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, 0.01, 0.99, { + '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, 0.01, 0.99, { + '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, 1, 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, 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' ); + + 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, 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' ); + + 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(); +}); diff --git a/strided/lib/index.js b/strided/lib/index.js index b2d80498..c5625d29 100644 --- a/strided/lib/index.js +++ b/strided/lib/index.js @@ -45,6 +45,15 @@ var ns = {}; */ setReadOnly( ns, 'arcsine', require( './../../strided/arcsine' ) ); +/** +* @name bernoulli +* @memberof ns +* @readonly +* @type {Function} +* @see {@link module:@stdlib/random/strided/bernoulli} +*/ +setReadOnly( ns, 'bernoulli', require( './../../strided/bernoulli' ) ); + /** * @name beta * @memberof ns